List of Figures
List of Tables
-
Correspondence from the device number to the module it belongs to
-
List of configuration information for the instruction set functions implemented in the 3A5000
-
Registers related to inter-processor interrupt and their functional descriptions
-
List of inter-processor interrupt and communication registers for processor core 0
-
List of inter-processor interrupt and communication registers for processor core 1
-
List of inter-processor interrupt and communication registers for processor core 2
-
List of inter-processor interrupt and communication registers for processor core 3
-
List of inter-processor interrupt and communication registers for the current processor core
-
Extended I/O interrupt status register for each processor core
-
Description of the interrupt destination processor core routing register
-
Interrupt destination processor core routing register address
-
Extended I/O interrupt status register for the current processor core
-
Description of temperature status detection and control register
-
Commands that can be received by the HyperTransport receiver
-
Default address window layout of the 4 HyperTransport interfaces
-
Address window distribution inside the HyperTransport interface of the Loongson 3 processor
-
Address window provided in the HyperTransport interface of the Loongson 3A5000 processor
-
Definition of command, capabilities pointer, capability ID registers
-
Definition of revision id, link freq, link error, link freq capregisters
-
Definition of busreceive address window 0 enable (external access) register
-
Definition of HT bus receive address window 0 base address (external access) register
-
Definition of HT bus receive address window 1 enable (external access) register
-
Definition of bus receive address window 1 base address (external access) register
-
Definition of bus receive address window 2 enable (external access) register
-
Definition of HT bus receive address window 2 base address (external Access) register
-
Definition of HT bus receive address window 3 enable (external access) register
-
Definition of HT bus receive address window 3 base address (external access) register
-
Definition of HT bus receive address window 4 enable (external access) register
-
Definition of HT bus receive address window 4 base address (external access) register
-
Definition of configuration space extended address translation register
-
HT bus prefetchable address window 0 enable (internal access)
-
HT bus prefetchable address window 0 base address (internal access)
-
HT bus prefetchable address window 1 enable (internal access)
-
HT bus prefetchable address window 1 base address (internal access)
-
HT bus uncache address window 0 base address (internal access)
-
HT bus uncache address window 1 base address (internal access)
-
HT Bus uncache Address Window 2 Base Address (Internal Access)
-
HT Bus uncache address window 3 base address (internal access)
-
Definition of HT bus P2P address window 0 enable (external access) register
-
Definition of HT bus P2P address window 0 base address (external access) register
-
Definition of HT bus P2P address window 1 enable (external access) register
-
Definition of HT bus P2P address window 1 base address (external access) register
About this manual
Copyright Statement
The copyright of this document belongs to Loongson Technology Corporation Limited. Without written permission, no company or individualmay disclose, reproduce or otherwise distribute any part of this document to third parties. Otherwise, they will be held legally responsible.
Disclaimer
This document provides only periodic information, and the contents contained may be updated at any time without notice, depending on the actual situation of the product. Loongson Technology Corporation Limited is not responsible for any direct or indirect damage aused by the improper use of the document.
Loongson Technology Corporation Limited
Building No.2, Loongson Industrial Park,
Zhongguancun Environmental Protection Park, Haidian District, Beijing
Tel: 010-62546668
Fax: 010-62600826
Reading Guide
This manual introduces the Loongson 3A5000/3B5000 multicore processor architecture and register descriptions. It provides detailed descriptions of the chip system architecture, functions and configurations of the main modules, register lists and bit fields.
Translator’s Note
These documents were translated by Yanteng Si and Feiyang Chen.
This is the translation of https://github.com/loongson/LoongArch-Documentation/releases/latest/download/Loongson-3A5000-usermanual-v1.03-CN.pdf.
Due to the limited knowledge of the translators, there are some inevitable errors and omissions existing in this document, please feel free to correct.
License
This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
Contributors
Since the release of the project, we have gotten several errata and content changes donated. Here are all the people who have contributed to LoongArch Documentation as an open source project. Thank you everyone for helping make this a better book for everyone.
The contributors are listed in alphabetical order.
Chao LI <lichao@loongson.cn>
Chenghua Xu <xuchenghua@loongson.cn>
Dandan Zhang <zhangdandan@loongson.cn>
Feiyang Chen <chenfeiyang@loongson.cn>
FreeFlyingSheep <fyang.168.hi@163.com>
Konstantin Romanov <konstantinsromanov@gmail.com>
LI Chao <lichao@loongson.cn>
limeidan <limeidan@loongson.cn>
liuzhensong <liuzhensong@loongson.cn>
mengqinggang <mengqinggang@loongson.cn>
Qi Hu <huqi@loongson.cn>
qmuntal <quimmuntal@gmail.com>
tangxiaolin <tangxiaolin@loongson.cn>
WANG Xuerui <git@xen0n.name>
wangguofeng <wangguofeng@loongson.cn>
Wu Xiaotian <wuxiaotian@loongson.cn>
Wu Xiaotian <yetist@gmail.com>
Xi Ruoyao <xry111@mengyan1223.wang>
Yang Yujie <yangyujie@alumni.sjtu.edu.cn>
Yang Yujie <yangyujie@loongson.cn>
Yanteng <siyanteng@loongson.cn>
Yanteng Si <siyanteng@loongson.cn>
1. Introduction
1.1. Introduction to the Loongson Family of Processors
Loongson processors mainly include three series. Loongson Series 1 processor adopts 32-bit processor cores and integrates various peripheral interfaces to form application-specific monolithic solutions, which are mainly applied to IOT terminals, instrumentation devices, data acquisition and other fields. Loongson Series 2 processor adopts 32-bit/64-bit processor cores and integrates various peripheral interfaces to form a high-performance low-power SoC chip for network devices, industrial terminals, intelligent manufacturing, etc. Loongson Series 3 processors integrate multiple 64-bit processor cores and necessary storage and IO interfaces on-chip, targeting high-end embedded computers, desktops, servers and other applications.
The Loongson 3 multi-core series processors are designed based on a scalable multi-core interconnect architecture, which integrates multiple high-performance processor cores and a large amount of Level 2 Cache on a single chip, and interconnects multiple chips through high-speed I/O interfaces to form a larger scale system.
The scalable interconnect architecture adopted by Loongson 3 is shown in the figure below.
Each node consists of 8 × 8
cross-switches, with each cross-switch connecting four processor cores and four shared caches, and interconnecting with other nodes in four directions: East (E), South (N), West (W), and North (N).
The node structure of the Loongson 3 is shown in the figure below. Each node has two levels of AXI cross-switches connecting the processor, the shared Cache, the memory controller, and the I/O controller. The first level AXI cross-switch (called X1 Switch) connects the processor and the shared Cache, and the second level cross-switch (called X2 Switch) connects the shared Cache and the memory controller.
In each node, up to 8 × 8 X1
cross switches are connected to four processor cores (P0
, P1
, P2
, P3
in the figure) through four Master ports.
The four interleave shared Cache blocks (S0
, S1
, S2
, S3
in the figure) are universally addressed through the four slave ports.
Other nodes or I/O nodes in the East, South, West and North directions are connected via four pairs of Master/Slave ports (EM
/ES
, SM
/SS
, WM
/WS
, NM
/NS
in the figure).
The X2
cross-switch connects four shared Caches via four Master ports, at least one Slave port to a memory controller, and at least one slave port to a configuration module (Xconf
) of the cross-switch that is used to configure the address windows of X1
and X2
of this node.
Additional memory controllers, I/O ports, can be connected as needed.
1.2. Introduction to Loongson 3A5000/3B5000
The Loongson 3A5000/3B5000 is a quad-core Loongson processor with a stable operating frequency of 2.0
-2.5GHz
.
The main technical features are as follows:
-
On-chip integration of four 64-bit quad-launch superscalar LA464 processor cores.
-
Peak floating-point computing power
160GFLOPS@2.5GHz
. -
On-chip integration of 16MB of split shared tertiary Cache.
-
Maintenance of Cache consistency for multi-core and I/O DMA accesses via directory protocol.
-
On-chip integration of two 72-bit DDR4 controllers with ECC, supporting DDR4-3200.
-
On-chip integration of two 16-bit HyperTransport controllers (hereinafter referred to as HT) with a maximum bus frequency of
3.2
GHz. -
Each group of 16-bit HT ports can be split into two groups of 8-bit HT ports for use.
-
2
I2C
,1
UART,1
SPI,16
GPIO interfaces on-chip
The architecture of the Loongson 3A5000/3B5000 is designed to increase the shared Cache capacity based on the 3A4000 and supports 16-way interconnect.
The Loongson 3B5000 supports consistent interconnects on the HT0
interface compared to the 3A5000, with special filtering based on server scenario requirements.
There is no difference in the other parts from the hardware and software perspective, and they are collectively referred to as 3A5000.
The overall architecture of the Loongson 3A5000 chip is based on multi-level interconnects and is shown in the figure below.
The first level of interconnect uses a 5 × 5
frequency division switch to connect four LA464 cores (as masters), four shared Cache modules (as slaves), and one I/O port to I/O-RING (The I/O port uses one Master and one Slave).
The second level interconnect uses a 5 × 3
cross-switch to connect four shared Cache modules (as masters), two DDR3/4 memory controllers, and one I/O port to the I/O-RING.
The I/O-RING contains 8
ports and the connections include 4
HT controllers, MISC module, SE module and two level cross switches.
The two HT controllers (lo/hi) share the 16-bit HT bus, which is used as two 8-bit HT buses, or lo can occupy the 16-bit HT bus exclusively.
A DMA controller is integrated into the HT controller, which is responsible for the DMA control of the I/O and the maintenance of inter-chip consistency.
All of these interconnect structures use read/write separated data channels with a 128-bit data channel width operating at the same frequency as the processor core to provide high-speed on-chip data transport. In addition, a one-level cross-switch connects the four processor cores to the SCache with a 256-bit read data channel to increase the read bandwidth of the on-chip processor cores accessing the SCache.
2. System Configuration and Control
2.1. Chip Operating Modes
Depending on the structure of the constituent systems, the Loongson 3A5000 consists of two main operating modes.
Single-chip mode: The system contains only 1
chip of Loongson 3A5000, which is a symmetric multiprocessor system (SMP).
Multi-chip interconnect mode: The system contains 2
, 4
, or 16
chips of the Loongson 3A5000 interconnected through HT ports to form a non-uniform access multiprocessor system (CC-NUMA).
2.2. Descriptions of Pins
Main control pins include DO_TEST
, ICCC_EN
, NODE_ID[2:0]
, CLKSEL[9:0]
, and CHIP_CONFIG[5:0]
.
Signal | Pull-up or Pull-down | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Pull-up |
|
||||||||||||||||||||||||||||||||
|
Pull-down |
|
||||||||||||||||||||||||||||||||
|
Indicates the processor number in multi-chip coherent interconnect mode |
|||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||
|
|
3. Physical Address Space Layout
The Loongson 3 Seriesprocessor has a globally accessible hierarchical addressing design for system physical address distribution to ensure extended system development compatibility.
The physical address width of the entire system is 48
bits.
The entire address space is evenly distributed over 16 nodes according to the high 4
bits of the address, i.e., 44
bits of address space per node.
3.1. Physical Address Space Layout Between Nodes
The Loongson 3A5000 processor can be directly connected with 2
/4
/8
/16
3A5000 chips to build a CC-NUMA system, the processor number of each chip is determined by the pin NODEID
, and the address space of each chip is distributed as follows:
Chip Node ID (NODEID) | [47:44] Bits of the Address |
Start address | End address |
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
When the number of system nodes is less than 16
nodes, the nodemask
field of the route setting register (0x1fe00400
) should be set to ensure that a response can be obtained even if there is no physical node address when a guessed access occurs (2-way: 0x1
; 4-way: 0x3
; 8-way: 0x7
; 16-way: 0xF
).
3.2. Physical Address Space Layout Within Nodes
The Loongson 3A5000 uses a single node 4-core configuration, so the corresponding addresses of the DDR memory controller and HT bus integrated in the Loongson 3A5000 chip are contained in a 44-bit address space from 0x0
(inclusive) to 0x1000_0000_0000
(exclusive).
Within each node, the 44-bit address space is further divided among all devices connected within the node, and requests are routed to the four shared Cache modules only when the access type is cached.
Depending on the chip and system architecture configuration, if there is no slave device connected on a port, the corresponding address space is reserved address space and access is not allowed.
The address space corresponding to each slave device side of the Loongson 3A5000 chip internal interconnect is as follows:
Device | the [43:40] bits of the address |
Start address within nodes | End address within nodes |
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Unlike the directional port mapping relationship, the Loongson 3A5000 can determine the cross-addressing method of the shared Cache based on the access behavior of the actual application.
The address space corresponding to the four shared Cache modules in the node is determined based on one or two select bits of the address bits, and can be dynamically configured and modified by software.
A configuration register named SCID_SEL
is set to determine the address selection bits, as shown in the following table.
By default the [7:6]
address hash is used for distribution, i.e., the two bits of address [7:6]
determine the corresponding shared Cache number.
This register is addressed as 0x1fe00400 and can also be accessed using the configuration register instruction (IOCSR).
SCID_SEL | Address Bit Selection | SCID_SEL | Address Bit Selection |
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The default distribution of the internal 44-bit physical addresses for each node of the Loongson 3A5000 processor is shown in the table below:
Address Range | Access Properties | Destination |
---|---|---|
|
Local node, uncache |
|
|
Local node, uncache |
|
|
Local node, uncache |
|
|
Local node, uncache |
|
|
Local node, uncache |
|
|
Local node, uncache |
|
Mc interleave is |
Local node, uncache |
|
Mc interleave is |
Local node, uncache |
|
|
Local node, Cache |
|
|
Local node, Cache |
|
|
Local node, Cache |
|
|
Local node, Cache |
|
3.3. Address Routing Layout and Configuration
The routing of the loongson 3A5000 is mainly implemented through the system’s two-level cross switch with IO-RING.
The software can configure the routing of the requests received by each Master port.
Each Master port has 8
address windows, and the target routing of 8
address windows can be completed.
Each address window consists of three 64-bit registers, BASE
, MASK
and MMAP
, with BASE
aligned by K
bytes; MASK
adopts a format similar to network mask with high bit of 1
; the lower four bits of MMAP
indicate the number of the corresponding target Slave port; MMAP[4]
indicates allow fetch instrustions; MMAP[5]
indicates allow block read; MMAP[6]
indicates allow interleaved access enable; MMAP[7]
indicates window enable.
[7] | [6] | [5] | [4] |
---|---|---|---|
Window enable |
Allow interleaved access to SCache/memory |
Allow to read blocks |
Allow to fetch instructions |
Window hit formula: (IN_ADDR & MASK) == BASE
Since Loongson 3 uses fixed routing by default, the configuration window is closed at power-up and requires system software to enable it for use.
When the SCache/memory interleaved access configuration is enabled, the slave number is only valid when it is 0
or 4
.
0
indicates routing to SCACHE
and SCID_SEL
determines how interleaved access is performed across the 4
SCaches.
4
indicates routing to memory and interleave_bit
determines how interleaved accesses are performed across the 2
MCs.
The address window translation registers are shown in the table below. The base address is 0x1FE0_0000, or accessed via the IOCSR instruction.
Address | Register | Address | Register |
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
- |
- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The secondary xbar
mainly connects 2
memory controllers and IO-RING as slave devices, with 4 SCache (4
, representing 4xxx
, same as 5
, 6
, 7
) and IO-RING (9
) as master devices for window mapping, which can use these window configuration registers (4
, 5
, 6
, 7
, 9
) for memory window configuration and address translation.
Each address window consists of three 64-bit registers, BASE
, MASK
, and MMAP
, with BASE
aligned in K
bytes, MASK
in a format similar to the network mask high bit 1, and MMAP
containing the converted address, routing, and enable control bits, as shown in the following table:
[63:48] | [47:10] | [7:4] | [3:0] |
---|---|---|---|
Reserved |
Address after translation |
Window enable |
Slave device number |
Among them, the devices corresponding to the slave device number are shown in the following table:
Slave Device Number | Destination Device |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The meaning of the window enable bits is shown in the table below:
[7] | [6] | [5] | [4] |
---|---|---|---|
Window enable |
Allow interleaved access to DDR.
Valid when the slave device number is |
Allow to read blocks |
Allow to fetch instructions |
Note that the window configuration cannot perform address translation for Cache consistency requests, otherwise the address at the SCache will not match the address at the processor-level Cache, resulting in a Cache consistency maintenance error.
Window hit formula: (IN_ADDR & MASK) == BASE
New address conversion formula: OUT_ADDR = (IN_ADDR & ~MASK) | {MMAP[63:10], 10’h0}
According to the default register configuration, the CPU’s address range of 0x00000000
-0x0fffffff
after the chip is booted (256M
) mapped to the address interval 0x00000000
-0x0fffffff
of the DDR.
0x10000000
-0x17ffffff
are mapped to the PCI_MEM
space of the bridge chip.
0x18000000
-0x19ffffff
are mapped to the PCI_IO
space of the bridge chip.
0x1a000000
-0x1affffff
are mapped to the bridge chip’s PCI configuration space (Type0
).
0x1b000000
-0x1bffffff
are mapped to the bridge chip’s PCI configuration space (Type1
).
0x40000000
-0x7fffffff
are mapped to the bridge chip’s PCI_MEM
space.
Software can implement the new address space routing and translation by modifying the corresponding configuration registers.
In addition, when there is a read access to an illegal address due to CPU guessing execution, all 8
address windows are not hit and random data is returned to prevent the CPU from dying, etc.
4. Chip Configuration Register
The chip configuration registers in the Loongson3A5000 provide a mechanism for reading and writing configuration of various functions of the chip. The individual configuration registers are described in detail below.
The base address of each chip configuration register in this chapter is 0x1fe00000, which can also be accessed using the configuration register instruction (IOCSR).
CSR[A][B] in this document indicates bit B in the IOCSR register with offset address A, where B can be a range.
4.1. Version Register (0x0000
)
The offset address is 0x0000
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
R |
|
Configuration register version number |
4.2. Chip Characteristics Register (0x0008
)
This register identifies a number of software-related processor features for software to view before enabling a specific function.
The offset address is 0x0008
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
R |
|
|
|
|
R |
|
|
|
|
R |
|
|
|
|
R |
|
|
|
|
R |
|
|
|
|
R |
|
|
|
|
R |
|
|
|
|
R |
|
|
|
|
R |
|
|
|
|
R |
|
Interrupt pin decoding mode is available |
|
|
R |
|
Legacy compatibility mode |
|
|
WR |
|
KVM Virtual Machine Mode |
4.3. Manufacturer Name Register (0x0010
)
This register is used to identify the vendor name.
The offset address is 0x0010
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
R |
|
string “Loongson” |
4.4. Chip Name Register (0x0020
)
This register is used to identify the chip name.
The offset address is 0x0020
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
R |
|
String “3A5000” |
4.5. Function configuration Register (0x0180
)
The offset address is 0x0180
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
RW |
|
||
|
RW |
|
||
|
RW |
|
Reserved |
|
|
|
RW |
|
Whether to disable |
|
|
RW |
|
Routing all memory accesses to the configuration space |
|
|
RW |
|
|
|
|
RW |
|
|
|
|
RW |
|
Whether to enable |
|
|
RW |
|
Whether to disable |
|
|
RW |
|
Routing all memory accesses to the configuration space |
|
|
RW |
|
|
|
|
RW |
|
|
|
|
RW |
|
Whether to enable |
|
|
RW |
|
HT Controller 0 frequency division |
|
|
RW |
|
Whether to enable |
|
|
RW |
|
HT Controller 1 frequency division |
|
|
RW |
|
Whether to enable |
|
|
RW |
|
Node Frequency Division |
|
|
RW |
|
|
|
|
R |
|
CPU version |
4.6. Pin Controller Driver Configuration Register (0x0188
)
The offset address is 0x0188
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
||||
|
|
RW |
|
HT control signal driver configuration |
|
|
RW |
|
I2C control signal driver configuration |
|
|
RW |
|
UART control signal driver configuration |
|
|
RW |
|
SPI control signal driver configuration |
|
|
RW |
|
GPIO control signal driver configuration |
|
|
RW |
|
SE UART control signal driver configuration |
|
|
RW |
|
SE SPI control signal driver configuration |
|
|
RW |
|
SE I2C control signal driver configuration |
|
|
RW |
|
SE SCI control signal driver configuration |
|
|
RW |
|
SE RNG control signal driver configuration |
|
|
RW |
|
SE GPIO control signal driver configuration |
4.7. Function Collection Register (0x0190
)
The offset address is 0x0190
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
R |
Reserved |
||
|
|
R |
Motherboard configuration control |
|
|
|
R |
On-board frequency multiplier configuration |
|
|
|
R |
core7-core0 are bad or not |
|
|
|
R |
|
|
|
|
R |
|
4.8. Temperature Collection Register (0x0198
)
The offset address is 0x0198
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
R |
Reserved |
||
|
R |
Reserved |
||
|
|
R |
Dotest pin status |
|
|
|
R |
Iccc_en pin status |
|
|
R |
Reserved |
||
|
|
R |
Temperature sensor 0 overflow |
|
|
|
R |
Temperature sensor 1 overflow |
|
|
||||
|
|
R |
Temperature sensor 0 centigrade temperature
Temperature range: |
|
|
|
R |
Temperature sensor 1 centigrade temperature
Temperature range: |
4.9. Frequency Configuration Register (0x01B0
)
The following sets of software multiplier setting registers are used to set the operating frequency of the chip master clock and the memory controller clock when CLKSEL
is configured in software control mode (refer to the CLKSEL
setting method in Descriptions of Pins).
Among other things, the MEM CLOCK
configuration supports multiple modes.
In 4x
mode (mem div
), MEM CLOCK
should be 4x the memory controller clock; in 2x
mode (mem div
), MEM CLOCK
should be 2x
the memory controller clock; in 1x
mode (mem div
), MEM CLOCK
should be the memory controller clock frequency .
The memory bus operates at 2
times the memory controller clock and the bus operates at 4
times the memory controller clock.
NODE CLOCK
corresponds to the clock frequency of the processor core, on-chip network, and shared Cache.
Each clock configuration generally has three parameters, DIV_REFC
, DIV_LOOPC
, and DIV_OUT
.
The final clock frequency is (reference clock / DIV_REFC * DIV_LOOPC) / DIV_OUT
.
In software control mode, the default corresponding clock frequency is the frequency of the external reference clock (100MHz
or 25MHz
), which needs to be set in software during the processor startup.
The process of setting the individual clocks should be done as follows:
-
Set registers other than
SEL_PLL_*
andSOFT_SET_PLL
, i.e., these two registers are written to 0 during the setting process. -
Set registers other than
SEL_PLL_*
andSOFT_SET_PLL
, i.e., these two registers are written to 0 during the setting process.
LOCKED_*
in the register to be 1
.-
Set
SEL_PLL_*
to1
, then the corresponding clock frequency will be switched to the software-set frequency.
The following register is the configuration register of Main CLOCK, Main Clock is used to generate the maximum operating frequency of node clock, core clock, etc.
The base address is 0x1fe00000
and the offset address is 0x1b0
:
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Clock output selection
|
|
RW |
|
Reserved |
|
|
|
RW |
|
Allow software to set the PLL |
|
|
RW |
|
Bypass L1 PLL |
|
|
RW |
|
Reserved |
|
|
RW |
|
Enable VDDA LDO |
|
|
RW |
|
Enable VDDD LDO |
|
|
|||
|
|
RW |
|
L2 clock DACPD |
|
|
RW |
|
L2 clock DSMPD |
|
RW |
|
Reserved |
|
|
|
R |
|
L1 PLL is locked or not |
|
|
R |
|
Reserved |
|
|
RW |
|
Disable L1 PLL |
|
RW |
|
Reserved |
|
|
|
RW |
|
Select L2 clock output |
|
RW |
|
Reserved |
|
|
|
RW |
|
L1 PLL input parameters |
|
|
RW |
|
L1 PLL input parameters |
|
Reserved |
|||
|
|
RW |
|
L1 PLL input parameters |
|
|
RW |
||
|
|
RW |
||
|
|
RW |
||
|
|
RW |
||
|
|
RW |
||
|
|
RW |
||
|
|
RW |
||
|
|
RW |
||
|
|
RW |
||
Other |
|
RW |
Reserved |
Note: PLL ouput = (clk_ref /div_refc * div_loopc) / div_out
.
The result of clk_ref/div_refc
for the PLL should be 25
/50
/100MHz
, with 50MHz
recommended.
The VCO frequency (the part in parentheses in the above equation) must be in the range 4.8GHz
-6.4GHz
.
This requirement also applies to memory PLLs.
In addition, the recommended setting for div_loopc is less than 255
.
The recommended setting for div_out
is 1
/2
/4
/6
and above 6
, and 3
/5
is not recommended.
The following register is the MEM CLOCK
configuration register, the MEM CLOCK
clock frequency should be configured to 1
/2
of the final DDR bus clock frequency.
The base address is 0x1fe00000
, offset address is 0x1c0
:
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Clock output selection
|
|
|
RW |
|
Allow software to set MEM PLL |
|
|
RW |
|
Bypass MEM_PLL |
|
|
RW |
|
Reset the internal frequency divider |
|
|
RW |
|
|
|
|
R |
|
MEM_PLL is locked or not |
|
|
RW |
|
Disable MEM PLL |
|
|
RW |
|
MEM PLL input parameters When the NODE clock is selected ( |
|
|
RW |
|
MEM PLL input parameters |
|
|
RW |
|
MEM PLL input parameters |
|
|
RW |
|
|
|
|
|||
|
|
RW |
||
|
|
RW |
||
|
|
RW |
||
|
|
RW |
||
|
|
|||
|
|
RW |
||
|
RW |
Reserved |
4.10. Processor Core Frequency Division Configuration Register (0x01D0
)
The following registers are used for dynamic frequency division of the processor core.
Using this register to set the frequency of the processor core, the frequency conversion operation can be done within 100ns with no additional overhead.
The base address is 0x1fe00000
and the offset address is 0x01d0
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Core 0 frequency division control value |
|
|
RW |
|
Core 0 clock enable |
|
|
RW |
|
Core 1 frequency division control value |
|
|
RW |
|
Core 1 clock enable |
|
|
RW |
|
Core 2 frequency division control value |
|
|
RW |
|
Core 2 clock enable |
|
|
RW |
|
Core 3 frequency division control value |
|
|
RW |
|
Core 3 clock enable |
Note: The clock frequency value after software dividing is equal to the original (dividing control value + 1)/8
.
4.11. Processor Core Reset Control Register (0x01D8
)
The following registers are used for software-controlled reset of the processor core.
To reset, set resetn to 0
, resetn_pre to 0
, wait 500
microseconds, resetn_pre
to 1
, and reset n
to 1
to complete the reset process.
The base address of this register is 0x1fe00000
and the offset address is 0x01d8
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Core 0 reset auxiliary control |
|
|
RW |
|
Core 0 reset |
|
|
RW |
|
Core 1 reset auxiliary control |
|
|
RW |
|
Core 1 reset |
|
|
RW |
|
Core 2 reset auxiliary control |
|
|
RW |
|
Core 2 reset |
|
|
RW |
|
Core 3 reset auxiliary control |
|
|
RW |
|
Core 3 reset |
4.12. Routing Configuration Register (0x0400
)
The following registers are used to control some of the routing settings within the chip.
The base address is 0x1fe00000
and the offset address is 0x0400
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Shared Cache hash bit control |
|
|
RW |
|
Node mask to avoid no response when guessing the address of an unused node |
|
|
RW |
|
HT1 inter-chip routing enable control |
|
|
RW |
|
Disable routing via base address |
|
|
RW |
|
Enable |
|
|
RW |
|
Enable |
|
|
RW |
|
MCC mode enable |
|
|
RW |
SCache capacity cut in half |
|
|
|
RW |
|
|
|
|
RW |
|
|
|
|
RW |
|
Enable routing control for both MCs |
|
|
RW |
|
Memory hash control |
|
|
RW |
|
Memory hash enable |
|
|
R |
Ht-related configuration pins |
|
|
|
RW |
|
Close ht space for consistency mode to avoid routing HT space addresses to HT |
|
|
RW |
|
Cross-chip bandwidth balancing configuration |
4.13. Other Function Configuration Register (0x0420
)
The following registers are used to control some of the functions enabled within the chip.
The base address is 0x1fe00000
and the offset address is 0x0420
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Completely disable the JTAG interface |
|
|
RW |
|
Completely disable the LA464JTAG debug interface |
|
|
RW |
|
Completely disable LA132 |
|
|
RW |
|
Completely disable the LA132 JTAG debug interface |
|
|
RW |
|
Disable fuse |
|
|
RW |
|
Disable fuse |
|
|
RW |
|
Disable ID modification |
|
Reserved |
|||
|
|
RW |
|
LA132 reset control |
|
|
R |
|
LA132 go to sleep |
|
|
RW |
|
LA132 inter-processor interrupt register |
|
|
RW |
|
LA132 I/O interrupt enable for each core |
|
|
RW |
|
LA132 frequency division control |
|
|
RW |
|
LA132 clock enable |
|
|
RW |
|
Stable clock selection
|
|
|
RW |
|
Stable clock reset control |
|
|
RW |
|
Enable private frequency adjustment registers for each core |
|
|
RW |
|
Enable private clock for each core |
|
|
RW |
|
Configure the bus timeout configuration.
The actual time is the power of |
|
|
RW |
|
HT Controller software reset control |
|
|
RW |
|
Frequency adjustment mode selection for each core
|
|
|
RW |
|
Frequency adjustment mode selection for nodes
|
|
|
RW |
|
Frequency adjustment mode selection for LA132
|
|
|
RW |
|
Frequency adjustment mode selection for each HT
|
|
|
RW |
|
Frequency adjustment mode selection for stable clock
|
|
Reserved |
|||
|
|
RW |
|
Stable clock frequency adjustment register |
|
|
RW |
|
Stable clock enable |
|
|
RW |
|
Extended I/O interrupt enable |
|
|
RW |
|
Enable interrupt pin encode mode |
|
||||
|
||||
|
|
RW |
|
Temperature sensor selection |
|
|
R |
|
Current value auto frequency adjustment |
|
|
R |
|
Flags in effect auto frequency adjustment |
4.14. Centigrade Temperature Register (0x0428
)
The following registers are used to observe the chip internal temperature sensor values. In degrees Celsius.
The base address is 0x1fe00000
and the offset address is 0x0428
.
This register is available only when CSR[0x0008][0]
is valid.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RO |
|
Centigrade temperature |
|
RW |
|
4.15. SRAM Adjustment Register (0x0430
)
The following registers are used to adjust the operating frequency of Sram inside the processor core.
The offset address is 0x0430
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Inter-processor sram configuration register |
|
RW |
|
4.16. FUSE0
Observation Register (0x0460
)
The following registers are used to observe the Fuse0
values visible to some software.
The offset address is 0x0460
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
4.17. FUSE1
Observation Register (0x0470
)
The following registers are used to observe the Fuse1
values visible to some software.
The offset address is 0x0470
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
5. Chip Clock Division and Enable Control
The Loongson 3A5000 can use a single external reference clock, SYS_CLOCK
.
The generation of each clock can depend on SYS_CLOCK
, and the following sections describe each of these clocks.
The Loongson 3A5000 has separate frequency dividing mechanisms for the processor core, on-chip network and shared Cache, HT controller, and LA132 core.
In line with the 3A4000, the 3A5000 also supports 1/n
divider values,It can also be accessed using the configuration register instruction (IOCSR).
The base address of each chip configuration register in this chapter is 0x1fe00000
.
5.1. Introduction to Chip Module clock
The chip reference clock SYS_CLOCK
usually uses a 100MHz
crystal input, but a 25MHz
crystal input is also available.
Different crystal frequencies need to be selected via CLKSEL[4]
.
The reference clock of the HT PHY can use the 200MHz
differential reference input of each PHY in addition to the SYS CLOCK.
Use CLKSEL[8]
to make the selection.
When SYS CLOCK is selected as the reference clock and a 25MHz
crystal input is used, the HT PHY cannot operate at 3.2GHz
.
The clocks used in the Loongson 3A5000 chip and their control methods are shown in the following table.
Clock | Clock Source | Frequency Multiplier Method | Frequency Division Control | Enable Control | Clock Description |
---|---|---|---|---|---|
Boot clock |
SYS_CLOCK |
|
Not supported |
Not supported |
SPI, UART, I2C controller clock |
Main clock |
SYS PLL |
PLL configuration |
Not supported |
Not supported |
SYS PLL output Node clock, core clock, HTcore clock, LA132 clock source Optional mem clock, stable clock source |
Node clock |
Main clock |
|
Supported |
Not supported |
On-chip network, shared Cache, node clock, HT controller clock source |
Core0 clock |
Main clock |
|
Supported |
Supported |
Core0 clock |
Core1 clock |
Main clock |
|
Supported |
Supported |
Core1 clock |
Core2 clock |
Main clock |
|
Supported |
Supported |
Core2 clock |
Core3 clock |
Main clock |
|
Supported |
Supported |
Core3 clock |
HTcore0 clock |
Node clock |
|
Supported |
Supported |
HT0 controller clock, and software needs to be guaranteed to be below |
HTcore1 clock |
Node clock |
|
Supported |
Supported |
HT1 controller clock, and software needs to be guaranteed to be below |
LA132 clock |
Main clock |
|
Supported |
Supported |
LA132 clock, and software needs to be guaranteed to be below |
Stable clock |
SYS_CLOCK |
|
Supported |
Supported |
Processor core constant counter clock |
Mem clock |
MEM PLL |
PLL configuration |
Not supported |
Supported |
Memory controller clock |
Main clock |
|
Not supported |
Supported |
Memory controller alternative clock |
5.2. Processor Core Frequency Division and Enable Control
There are various modes of processor core frequency division, one is per-address access mode, and the other is processor configuration instruction access mode, which are described below. Each processor core can be controlled separately.
5.2.1. Accessing by Address
The per-address access mode is compatible with the 3A3000 processor and uses the processor core software frequency divider setup register, which uses the same address for setup.
Using this register to set the processor core for tuning allows the frequency conversion operation to be completed in 100ns
with no other additional overhead.
The base address is 0x1fe00000
,It can also be accessed using the configuration register instruction (IOCSR),and the offset address is 0x01d0
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Core 0 frequency division control value |
|
|
RW |
|
Core 0 clock enable |
|
|
RW |
|
Core 1 frequency division control value |
|
|
RW |
|
Core 1 clock enable |
|
|
RW |
|
Core 2 frequency division control value |
|
|
RW |
|
Core 2 clock enable |
|
|
RW |
|
Core 3 frequency division control value |
|
|
RW |
|
Core 3 clock enable |
Note: The clock frequency value after software dividing is equal to the original (dividing control value + 1)/8
.
In addition to the frequency division configuration compatible with the 3A3000 processor, the clock frequency after frequency division can be adjusted from (Frequency Division Control Value + 1)/8
to 1/(Frequency Division Control Value + 1)`
by setting the register in the 3A5000.
This register is located in other function configuration register.
The base address is 0x1fe00000
,It can also be accessed using the configuration register instruction (IOCSR),and the offset address is 0x0420
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Frequency adjustment mode selection for each core
|
5.2.2. Accessing by Configuration Register Instructions
In addition to the legacy per-address access mode, the 3A5000 also supports access to private frequency division configuration registers using the configuration register instruction.
Note that the private frequency division configuration register control is mutually exclusive with the original processor core software frequency division setup register control, and only one of the two can be used.
The choice is made by using the corresponding bit on the other function configuration register.
This register has a base address of 0x1fe00000
,It can also be accessed using the configuration register instruction (IOCSR), and an offset address of 0x0420
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Enable private frequency adjustment registers for each core |
|
|
RW |
|
Enable private clock for each core |
When freqscale_percore
is set to 1
, the freqscale bit in the private divider configuration register is used to set the divider for its own clock (including freqscale_mode
).
When freqscale_percore
is set to 1
, the clken_mode
bit in the private frequency division configuration register is used to set the clock enable.
Bit in the private frequency division configuration register is used to control the clock enable when clken_percore
is set to 1
.
This configuration register is defined as follows.
The offset address is 0x1050
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Current processor core frequency division mode selection
|
|
|
RW |
|
Current processor core clock enable |
|
|
RW |
|
Current processor core frequency divider configuration |
5.3. Node Clock Division and Enable Control
The node clock is the clock used by the on-chip network and shared Cache, and has two different control modes, a software setting mode and a hardware automatic frequency division setting.
The node clock does not support full shutdown, so there is no corresponding clken control bit.
5.3.1. Software Configuration
The software setup method is compatible with the 3A3000 processor and uses the same address to set the node frequency division bits in the Function Setup register.
This register has a base address of 0x1fe00000
,It can also be accessed using the configuration register instruction (IOCSR), and an offset address of 0x0180
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Node 0 frequency division |
In line with the processor core’s dividing control, the node clock can also be adjusted from (dividing control value + 1)/8
to 1/(dividing control value + 1)
after dividing by setting the register.
This register is located in other function configuration register.
The base address is 0x1fe00000
and the offset address is 0x0420
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Frequency adjustment mode selection for nodes
|
5.3.2. Hardware Automatic Configuration
In addition to the active setting by the software, the node clock also supports the automatic frequency division setting triggered by the temperature sensor.
The auto-division setting is set by the software in advance for different temperatures, and the corresponding auto-division setting will be triggered when the temperature of the temperature sensor reaches the corresponding preset value.
In order to ensure the operation of the chip in a high-temperature environment, it can be set so that the high temperature automatic frequency reduction, so that the chip in excess of the preset range of active clock division, to achieve the effect of reducing the chip flip rate. See 12.3 for details on how to set it up.
5.4. HT Controller Frequency Division and Enable Control
The frequency division mechanism of the HT controller is similar to the others.
The two HT controllers can be controlled separately.
The settings are made using the corresponding bits in the function configuration register.
Its base address is 0x1fe00000
,It can also be accessed using the configuration register instruction (IOCSR), and offset address 0x0180
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
HT Controller 0 frequency division |
|
|
RW |
|
Whether to enable HT0 |
|
|
RW |
|
HT Controller 1 frequency division |
|
|
RW |
|
Whether to enable HT1 |
In line with other frequency division controls, the HT controller clock can be adjusted from (frequency division control value + 1)/8
to 1/(frequency division control value + 1)
by setting the clock frequency after frequency division through a register.
This register is located in other function configuration register.
The base address is 0x1fe00000
,It can also be accessed using the configuration register instruction (IOCSR), and the offset address is 0x0420
.
Note that since the HT core clock is derived from the Node clock, it is also affected by the Node clock frequency division.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Frequency adjustment mode selection for each HT
|
5.5. Stable Counter Frequency Ddivision and Enable Control
Stable Counter’s frequency division mechanism is similar to the others.
It is set using the corresponding bits in the other function configuration register.
Its base address is 0x1fe00000
,It can also be accessed using the configuration register instruction (IOCSR), and offset address 0x0420
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Stable clock selection
|
|
|
RW |
|
Stable clock reset control
|
|
|
RW |
|
Frequency adjustment mode selection for stable clock
|
|
|
RW |
|
Stable clock frequency adjustment register |
|
|
RW |
|
Stable clock enable |
It should be noted that after stable_reset is set to 0
, only the software reset is released.
At this time, if GPIO_FUNC_en[13]
is 1
, the reset of the stable counter is still controlled by GPIO[13]
(low valid).
The GPIO output enable register base address is 0x1fe00000,It can also be accessed using the configuration register instruction (IOCSR), offset address 0x0500.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
GPIO output enable (active low) |
|
|
RW |
|
GPIO function enable (active low) |
6. Software Clock System
Several different levels of usage are defined in the Loongson 3A5000 processor for the clocks used by the system software. Inside the processor core are the legacy counter/compare registers, the stable counter registers, and the chip-level node counter registers.
The following is introductions to stable counter and node counter.
6.1. Stable Counter
The constant clock source in the 3A5000 is called the stable counter, which is a separate master clock from the processor core’s own clock and from the node clock.
In the 3A5000, both the processor core clock and the node clock are derived from the master clock, but both can freely control the number of divisions (see the introduction in the previous chapter), while the clock of the stable counter is derived from the input reference clock and can also be independently divided and does not vary with the frequency of other clocks.
Based on this clock source, a timer and a timer are implemented. This chapter mainly introduces the registers related to the Stable couter.
6.1.1. Configuration Address for Stable Timer
Using the Stable counter clock source, a monotonically increasing timer counter and a timer timer that decrements down from the set value are implemented; each processor core has its own independent Stable counter and Stable timer.
When the processor accesses the timer, it can only be accessed by rdhwr
, DRDTIME
and other specific instructions; when the processor accesses the timer, it can be accessed by address to load/store or by CSR configuration register instructions.
Name | Offset Address | Read/Write | Description |
---|---|---|---|
|
|
RW |
Timer configuration register for processor core 0 |
|
|
R |
Timer remaining value for processor core 0 |
|
|
RW |
Timer configuration register for processor core 1 |
|
|
R |
Timer remaining value for processor core 1 |
|
|
RW |
Timer configuration register for processor core 2 |
|
|
R |
Timer remaining value for processor core 2 |
|
|
RW |
Timer configuration register for processor core 3 |
|
|
R |
Timer remaining value for processor core 3 |
Name | Offset Address | Read/Write | Description |
---|---|---|---|
|
|
RW |
Timer configuration register of the current processor core |
|
|
R |
Timer remaining value for the current processor core |
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
||||
|
|
RW |
|
Reset to |
|
|
RW |
|
Cycle count enable.
When this bit is |
|
|
RW |
|
General enable.
The timer is active when this bit is |
|
|
RW |
|
The initial value for conducting the countdown |
|
||||
|
|
R |
|
Value |
|
|
R |
|
The remaining value of the countdown.
When not in a cycle count, the value will stay at |
6.1.2. Clock Control for Stable Counter
The Stable counter can optionally use either the reference clock input or the master clock and can be controlled by software dividing mechanism for dividing the frequency. In general, it is recommended to use the reference clock input, which is able to be completely free from dynamic frequency tuning interference compared to the master clock.
The following is the clock control register of the Stable counter.
This register is located in the control chip other function configuration register.
The base address is 0x1fe00000
,It can also be accessed using the configuration register instruction (IOCSR), and the offset address 0x0420
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Stable clock selection
|
|
|
RW |
|
Stable clock reset control
|
|
|
RW |
|
Frequency adjustment mode selection for stable clock
|
|
|
RW |
|
Stable clock frequency adjustment register |
|
|
RW |
|
Stable clock enable |
After the BIOS has configured the Stable counter clock source, the MCSR
section in each processor core needs to be updated to control the values of CPUCFG.0x4
and CPUCFG.0x5
.
Referring to the description in Instruction set features implemented in 3A5000, CPUCFG.0x4
should be filled with the crystal clock frequency in Hz; CPUCFG.0x5[31:16]
should be filled with the dividing factor; CPUCFG.0x5[15:0]
should be filled with the multiplication factor.
The latter two should be filled in with the help of BIOS for calculation, so that the result of CCFreq*CFM/CFD
is equal to the actual frequency of Stable Counter.
6.1.3. Calibration of Stable Counter
In the single-chip case, the Counter difference between each core is within 2 cycles, and no special calibration is needed.
In the multi-chip case, there are large differences between different chips, and a special hardware and software calibration mechanism is needed to keep the counter difference of each core below 100ns
.
First, to ensure that the master clock of each chip does not deviate during use, the same crystal is used to drive SYS_CLK
for all chips.
Second, to ensure that the Stable counter of each chip starts timing at the same moment, the hardware needs to use the multiplexing function of two GPIO pins. Node 0 uses GPIO12 to output the reset signal, and all other nodes (including Node 0) use GPIO13 to input the reset signal (which needs to be configured for the Stable counter function). On the motherboard a buffer device need to be used to ensure the reset timing (mainly the signal slope), the better the reset timing, the less the difference in clocks between different chips.
The software must reset the global Stable counter via GPIO12 before using the Stable counter. Before resetting, need to ensure that the clock selection of each chip is consistent and that the reset of each chip has been lifted. This work is usually done by the BIOS. The connection scheme of the system is shown in the following figure.
6.2. Node Counter
The behavior of the Node counter in the Loongson 3A5000 is the same as that of the 3A4000.
It should be noted that the counting frequency of Node counter is exactly the same as Node clock. If you want to use Node counter as the basis for clock calculation, you should avoid inverting Node clock.
6.2.1. Accessing by Address
The per-address access mode is compatible with the 3A3000 processor and uses the same addresses for setup. The base address of the configuration register is `0x1fe00000`can also be accessed using the configuration register instruction (IOCSR), as shown in the table below.
Name | Offset Address | Read/Write | Description |
---|---|---|---|
Node counter |
|
R |
64-bit node clock count |
6.3. Summary of Clock System
The new Stable counter in Loongson 3A5000 has an advantage over the node counter and CP0counter in terms of stability, as it does not change with other clocks (node clock and core clock).
In terms of ease of use, the Stable counter is also easier to access, using instruction for both user and Guest states. Stable counter is the preferred solution for software reference clock systems.
Node clock is more of a design for legacy compatibility and is a backup solution for the clock system. It will be phased out in future chip designs.
7. GPIO Control
Up to 32
GPIOs are provided in the 3A5000 for system use, and most of them are multiplexed with other functions.
The GPIOs can also be configured as interrupt inputs and their interrupt levels can be set through register settings.
The base address of each chip configuration register in this chapter is 0x1fe00000
.
7.1. Output Enable Register (0x0500
)
The base address is 0x1fe00000
and the offset address is 0x0500
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
GPIO output enable (active low) |
|
|
RW |
|
GPIO function enable (active low) |
7.2. Input/Output Register (0x0508
)
The base address is 0x1fe00000
and the offset address is 0x0508
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
GPIO output configuration |
|
|
RO |
|
GPIO input status |
7.3. Interrupt Control Register (0x0510
)
The base address is 0x1fe00000
and the offset address is 0x0510
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
GPIO interrupt active level configuration
|
|
|
RW |
|
GPIO interrupt enable contrl (active high) |
7.4. GPIO Pin Function Multiplexing Table
The 3A5000 has a large number of GPIO pins multiplexed with other functions, and the following list shows the pin function selection of the chip function pins.
It should be noted that GPIO00
-GPIO15
are GPIO functions when the chip is reset, and the default state is input, not driving I/O.
In order to prevent the internal logic from driving the corresponding I/O, the corresponding HT0
/1_Hi
/Lo_Hostmode
pins can be pulled down.
At this point, although the default is still the HT function at reset, it will not drive the I/O pins and will not affect external devices.
Only need to set the function to GPIO mode before using the GPIO function in software.
GPIO Register | Pin Name | Multiplexing Function | Default Function |
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- |
|
|
|
- |
|
|
|
- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7.5. GPIO Interrupt Control
The GPIO pins in the 3A5000 can all be used as interrupt inputs.
GPIO00
, GPIO08
, GPIO16
, GPIO24
share the interrupt controller’s interrupt line 0
.
GPIO01
, GPIO09
, GPIO17
, GPIO25
share the interrupt controller’s interrupt line 1
.
GPIO02
, GPIO10
, GPIO18
, GPIO26
share the interrupt controller’s interrupt line 2
.
GPIO03
, GPIO11
, GPIO19
, GPIO27
share the interrupt controller’s interrupt line 3
.
GPIO04
, GPIO12
, GPIO20
, GPIO28
share the interrupt controller’s interrupt line 4
.
GPIO05
, GPIO13
, GPIO21
, GPIO29
share the interrupt controller’s interrupt line 5
.
GPIO06
, GPIO14
, GPIO22
, GPIO30
share the interrupt controller’s interrupt line 6
.
GPIO07
, GPIO15
, GPIO23
, GPIO31
share the interrupt controller’s interrupt line 7
.
The interrupt enable of each GPIO is controlled by the configuration register GPIO_INT_en
and the interrupt level is controlled by GPIO_INT_POL
, the registers are as follows:
The base address is 0x1fe00000
and the offset address is 0x0510
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
GPIO interrupt active level configuration
|
|
|
RW |
|
GPIO interrupt enable contrl (active high) |
When each interrupt line on the interrupt controller enables only one of the GPIOs, an interrupt can be triggered at a fixed edge (falling edge when POL is set to 0
, rising edge when POL is set to 1
) and logged in the interrupt controller using edge triggering.
8. LA464 Processor Core
LA464 is a quad-launch 64-bit high-performance processor core. It can be used as a single core for high-end embedded and desktop applications, or as a basic processor core to form an on-chip multi-core system for server and high-performance machine applications. The multiple LA464 cores in the Loongson 3A5000 form a distributed multi-core architecture with a shared on-chip last-level Cache through the AXI interconnect network. The main features of LA464 are as follows:
-
Support for the Loongson autonomous instruction set (LoongArch).
-
Four-launch superscalar architecture with four fixed-point, two vector, and two access components.
-
Each vector component is
256
bits wide, and each component supports up to eight double 32-bit floating-point multiplication and addition operations. -
Access components support 256-bit memory access, with 64-bit virtual addresses and 48-bit physical addresses.
-
support for register renaming, dynamic scheduling, transfer prediction, and other chaotic execution techniques.
-
64 fully-associative items plus
2048
items connected in 8-way groups, for a total of2112
TLBs,64
instruction TLBs, and variable page size. -
First-level instruction Cache and data Cache size of
64KB
each, 4-way group concatenation. -
Victim Cache as a private secondary Cache,
256KB
in size, 16-way group concatenation. -
Supports access optimization techniques such as Non-blocking access and Load-Speculation.
-
Supports Cache Consistency Protocol for on-chip multi-core processors.
-
Supports parity check for first-level Cache and ECC check for second-level, on-chip last-level Cache.
-
Supports standard JTAG debugging interface for easy hardware and software debugging.
The structure of LA464 is shown in the following figure.
8.1. Instruction set features implemented in 3A5000
The functional features of the Loongson instruction set implemented in the Loongson 3A5000 can be dynamically confirmed by the Loongson instruction set attribute identification mechanism.
The CPUCFG instruction is a user-state instruction, which is used as CPUCFG rd, rj, where the source operand rj register holds the register number of the configuration information word to be accessed, and the returned configuration word information is written to the rd register, each configuration information word contains up to 32 bits of configuration information. For example, bit 0 of configuration word 1 indicates whether the LA32 architecture is implemented, then this configuration information is expressed as CPUCFG.1.LA32[bit0], where 1 means that the font size of the configuration information word is 1, LA32 means that the helper name of this configuration information field is LA32, and bit 0 means that the field LA32 is located in bit 0 of the configuration word. If the configuration information needs to be expressed in multiple bits, then the location information will be recorded in the form of bitAA:BB, which means the consecutive (AA-BB+1) bits from the AAth to the BBth bit of the configuration information word.
The following table gives a list of configuration information for the instruction set functions implemented in the 3A5000. The last column, “Possible Value”, indicates a possible value to be read from this register, but does not imply that this is the value to be read from the 3A5000 processor. Please refer to the results of the actual hardware execution of the instruction, and make subsequent software judgments based on the actual read values.
Register Number |
Bit Field |
Name |
Description |
Possible Value |
|
|
|
Processor Identity |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The value of the supported physical address bits |
|
|
|
|
The value of the supported vitrual address bits |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The version number of the floating-point arithmetic standard.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Constant frequency counter and timer version number.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The maximum number of directory levels supported by the page walk instruction |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The maximum configurable virtual address is shortened by |
|
|
|
|
|
Constant frequency counter and timer and the corresponding multiplication factor of the clock used by the timer |
N/A |
|
|
Constant frequency counter and timer and the division coefficient corresponding to the clock used by the timer |
N/A |
|
|
|
|
|
|
|
|
In the performance monitor, the architecture defines the version number of the event, and |
|
|
|
|
Number of performance monitors minus |
|
|
|
|
Number of bits of a performance monitor minus |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Number of channels minus |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Number of channels minus |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Number of channels minus |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Number of channels minus |
|
|
|
|
|
|
|
|
|
|
8.2. Access to 3A5000 Control and Status Registers
The 3A5000 supports configuration status register space access. The CSR is accessed using a new, independent addressing space called the CSR space that does not overlap with existing register space, memory space, or JTAG space.
CSR read and write accesses are performed via the custom IOCSRRD.B/H/W/D
and IOCSRWR
.
IOCSRRD.B/H/W/D
is used as IOCSRRD.B/H/W/D rd,rj
, where the source operand rj
register holds the address of the CSR with access, and the CSR read back is written to the rd
register.
IOCSRWR.B/H/W/D
is used as IOCSRWR.B/H/W/D rd,rj
, where the source operand rj
register holds the address of the CSR with access, and the source operand rd register holds the value of the CSR to be written.
IOCSRRD.B/H/W/D
and IOCSRWR.B/H/W/D
are allowed to operate in the kernel state only.
IOCSRRD.B/H/W/D
and IOCSRWR.B/H/W/D
instructions can be used instead of the original address-mapped configuration registers, i.e., the 0x1fe00000
and 0x3ff00000
spaces, as described in the relevant sections for access details.
9. Shared Cache (SCache)
The SCache module is a three-level Cache shared by all processor cores within the Loongson 3A5000 processor. The main features of the SCache module include:
-
16-item Cache access queue.
-
Keyword priority.
-
Supports Cache Consistency Protocol through directories.
-
Can be used in on-chip multi-core architectures or directly interfaced with single-processor IP.
-
16-way group concatenation architecture.
-
Supports ECC checksum.
-
Supports DMA consistent read/write and prefetch reads.
-
Supports 16 types of shared Cache hashing.
-
Supports shared Cache by window lock.
-
Guaranteed read data return atomicity.
The shared Cache module includes the shared Cache management module scachemanage
and the shared Cache access module scacheaccess
.
scachemanage
is responsible for processing access requests from processors and DMAs, while the shared Cache TAG, directory and data information is stored in the scacheaccess
module.
To reduce power consumption, the TAG, directory and data of the shared Cache can be accessed separately.
The shared Cache status bits and w
bits are stored together with TAG, TAG is stored in TAG RAM, directory is stored in DIR RAM and data is stored in DATA RAM.
Failure request accesses the shared Cache and reads the TAG, directory of all roads at the same time and picks the directory according to TAG and reads the data according to the hit.
Replacement requests, refill requests and write back requests operate only on the TAGs, directories and data of one way.
To improve the performance of some specific computing tasks, a locking mechanism is added to the shared Cache.
Blocks that fall in the locked area of the Shared Cache are locked and therefore will not be replaced out of the Shared Cache (unless all 16
paths of the Shared Cache contain locked blocks).
The four sets of lock window registers inside the shared Cache module can be dynamically configured through the chip configuration register space, but it must be ensured that one of the 16
Shared Caches must not be locked.
In addition, when the shared Cache receives a DMA write request, if the area to be written is hit and locked in the shared Cache, then the DMA write will be written directly to the shared Cache.
Name | Address | Bit Field | Description |
---|---|---|---|
|
|
|
Valid bits for lock window 0 |
|
|
|
Lock address for lock window 0 |
|
|
|
Mask for lock window 0 |
|
|
|
Valid bits for lock window 1 |
|
|
|
Lock address for lock window 1 |
|
|
|
Mask for lock window 1 |
|
|
|
Valid bits for lock window 2 |
|
|
|
Lock address for lock window 2 |
|
|
|
Mask for lock window 2 |
|
|
|
Valid bits for lock window 3 |
|
|
|
Lock address for lock window 3 |
|
|
|
Mask for lock window 3 |
For example, when an address addr causes slock0_valid && addr & slock0_mask) == (slock0_addr & slock0_mask
to be 1
, the address is locked by lock window 0.
The 4
SCache use the same configuration register with base address 0x1fe00000
,It can also be accessed using the configuration register instruction (IOCSR), and offset address 0x0280
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
SCache LRU replacement algorithm enable |
|
|
RW |
|
SCache prefetch function enable |
|
|
RW |
|
Stop prefetching when SCache prefetching exceeds the address range of the configured size
(Note: Valid when |
|
|
RW |
|
SCache prefetch size
(Note: Valid when |
|
|
RW |
|
Number of clock cycles of
Other - Invalid |
|
|
RW |
|
MCC storefill function enable |
|
||||
|
|
RW |
|
|
|
|
RW |
|
10. Inter-Processor Interrupts and Communication
The Loongson 3A5000 implements eight inter-processor interrupt registers (IPI) for each processor core to support interrupts and communication between processor cores during multi-core BIOS boot and OS runtime.
Two different access modes are supported in the Loongson 3A5000, one is an address access mode compatible with processors such as the 3A3000, and the other is designed to support direct private access to the processor register space. Separate descriptions are provided in later sections.
10.1. Accessing by Address
For the Loongson 3A5000, the following registers can be accessed using base address 0x1fe0_0000
,It can also be accessed using the configuration register instruction (IOCSR).
Of these, base address 0x3ff0_0000
can be turned off by the disable_0x3ff0
control bit in the Routing Setup Register.
See the tables below for specific register descriptions and addresses.
Name | Read/Write | Description |
---|---|---|
|
R |
The processor core |
|
RW |
32-bit enable register to control whether the corresponding interrupt bit is valid or not. |
|
W |
32-bit set register.
Write |
|
W |
32-bit clear register.
Write |
|
RW |
Cache registers for passing parameters at boot time, accessible as 64-bit or 32-bit uncache. |
|
RW |
Cache registers for passing parameters at boot time, accessible as 64-bit or 32-bit uncache. |
|
RW |
Cache registers for passing parameters at boot time, accessible as 64-bit or 32-bit uncache. |
|
RW |
Cache registers for passing parameters at boot time, accessible as 64-bit or 32-bit uncache. |
The registers related to interprocessor interrupts and their functions in the Loongson 3A5000 are described as follows:
Name | Offset Address | Read/Write | Description |
---|---|---|---|
|
|
R |
|
|
|
RW |
|
|
|
W |
|
|
|
W |
|
|
|
RW |
|
|
|
RW |
|
|
|
RW |
|
|
|
RW |
|
Name | Offset Address | Read/Write | Description |
---|---|---|---|
|
|
R |
|
|
|
RW |
|
|
|
W |
|
|
|
W |
|
|
|
R |
|
|
|
RW |
|
|
|
W |
|
|
|
W |
|
Name | Offset Address | Read/Write | Description |
---|---|---|---|
|
|
R |
|
|
|
RW |
|
|
|
W |
|
|
|
W |
|
|
|
R |
|
|
|
RW |
|
|
|
W |
|
|
|
W |
|
Name | Offset Address | Read/Write | Description |
---|---|---|---|
|
|
R |
|
|
|
RW |
|
|
|
W |
|
|
|
W |
|
|
|
R |
|
|
|
RW |
|
|
|
W |
|
|
|
W |
|
The above is a list of inter-processor interrupt-related registers for a single-node multiprocessor system composed of a single Loongson 3A5000 chip.
When multiple Loongson 3A5000 chips are interconnected to form a multi-node CC-NUMA system, each node within a chip corresponds to a global system node number, and the IPI register addresses of the processor cores within the node are fixed at an offset from the base address of the node in the table above.
For example, the IPI_Status address of processor core 0 of node 0 is 0x1fe01000
, while the processor address of processor 0 of node 1 is 0x10001fe01000
, and so on.
10.2. Accessing by Configuration Register Instructions
In the Loongson 3A5000, a new processor core direct register access instruction has been added to provide access to configuration registers through private space. In order to use inter-processor interrupt registers more easily, some adjustments are made to the inter-processor interrupt register definitions in this mode.
Name | Offset Address | Read/Write | Description |
---|---|---|---|
|
|
R |
|
|
|
RW |
|
|
|
W |
|
|
|
W |
|
|
|
RW |
|
|
|
RW |
|
|
|
RW |
|
|
|
RW |
|
In order to send inter-processor interrupt requests and MailBox communication to other cores, the following registers are accessed.
Name | Offset Address | Read/Write | Description |
---|---|---|---|
|
|
WO |
32-bit interrupt distribution register
|
|
|
WO |
64-bit MailBox Cache register
|
|
|
WO |
32-bit frequency enable register
|
Note that since the Mail_Send register can only send 32
bits of data at a time, it must be split into two transmissions when sending 64 bits of data.
Therefore, the target core needs to ensure the integrity of the transport by other software means while waiting for the contents of the Mail_Box
.
For example, after sending the Mail_Box
data, an inter-processor interrupt is used to indicate that the transmission is complete.
10.3. Debug Support for Configuration Register Instructions
The configuration register instruction is in principle used without cross-chip access, but in order to meet the needs for debugging, etc., cross-chip access is supported here by using multiple register addresses. It is worth noting that such registers can only be written, not read.
In addition to IPI_Send
, Mail Send
, Freq Send
mentioned in the previous section, there is also an Any Send
register available with the following address.
Name | Offset Address | Read/Write | Description |
---|---|---|---|
|
|
WO |
64-bit register access register
|
11. I/O Interrupts
The Loongson 3A5000 chip supports two different interrupt methods. The first is the legacy interrupt method, which is compatible with processors such as the 3A3000, and the second is the new extended I/O interrupt method, which is used to support the interrupt cross-chip and dynamic distribution functions of the HT controller. The following describes each of the two interrupt methods.
11.1. Legacy I/O Interrupts
The legacy interrupts on the Loongson 3A5000 chip support 32
interrupt sources managed in a unified manner as shown in the figure below.
Any of the I/O interrupt sources can be configured to enable or disable, how it is triggered, and the target processor core interrupt pin to be routed.
Legacy interrupts do not support cross-chip distribution of interrupts, and can only interrupt processor cores within the same processor chip.
The interrupt-related configuration registers are in the form of bits to control the corresponding interrupt lines, and the interrupt control bit connections and attributes are configured in the following table.
The configuration of interrupt enable (Enable) has three registers: Intenset
, Intenclr
and Inten
.
Intenset
sets the interrupt enable, the interrupt corresponding to the bit written 1
in the Intenset
register is enabled.
Intenclr
clears the interrupt enable, the interrupt corresponding to the bit written 1
in the Intenclr
register is cleared.
The Inten
register reads the current status of each interrupt enable.
The edge-triggered interrupt signal is selected by the Intedge
configuration register, with a write of 1
for edge-triggered and a write of 0
for level-triggered.
The interrupt handler can clear the interrupt record by using the corresponding bit of Intenclr
.
Clearing the interrupt will also clear the interrupt enable.
Bit Field | Read/Write (Default Value) | ||||
---|---|---|---|---|---|
Intedge |
Inten |
Intenset |
Intenclr |
Interrupt Source |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
|
RW ( |
R ( |
RW ( |
RW ( |
|
Similar to inter-processor interrupts, the base address of I/O interrupts can also be accessed using 0x1fe00000
, or through the processor core’s dedicated register configuration instructions.
11.1.1. Accessing by Address
This access is compatible with that of processors such as the 3A3000, where either 0x1fe00000
or 0x3ff00000
can be used for the base address.
The 0x3ff00000
base address can be disabled via the disable_0x3ff0
control bit in the Routing Configuration Register.
Name | Offset Address | Description |
---|---|---|
|
|
32-bit interrupt status register |
|
|
32-bit interrupt enable status register |
|
|
32-bit set enable register |
|
|
32-bit clear enable register |
|
|
32-bit trigger mode register |
|
|
32-bit interrupt status routed to |
|
|
32-bit interrupt status routed to |
|
|
32-bit interrupt status routed to |
|
|
32-bit interrupt status routed to |
Four processor cores are integrated in the Loongson 3A5000, and the 32-bit interrupt sources described above can be software configured to select the target processor core for the desired interrupt.
Further, the interrupt sources can be routed to any of the processor cores INT0
to INT3
.
Each of the 32 I/O interrupt sources corresponds to an 8-bit routing controller with the format and addresses shown in Description of the interrupt destination processor core routing register and Interrupt destination processor core routing register address.
The routing register uses a vector approach to routing, e.g., 0x48
indicates routing to INT2
of processor 3.
Starting with the 3A5000, the interrupt pin routing bits are added in a coded manner and are enabled by the CSR[0x420][49]
bit control.
When this bit is enabled, the [7:4]
bits in the table below change from a bitmap representation to a numeric encoding method.
Configurable values 0
-7
indicate interrupt pins 0
-7
.
For example, in this mode, 0x28
indicates routing to INT2
on processor 3.
Bit Field | Description |
---|---|
|
Processor core vector number for routing |
|
Processor core interrupt pin vector number for routing |
Name | Offset Address | Description | Name | Offset Address | Description |
---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11.1.2. Accessing by Configuration Register Instructions
In the Loongson 3A5000, the configuration registers can also be accessed through private space using the same access method as the configuration register instruction. The offset address used by the instruction is the same as that accessed through the address. In addition, for the convenience of users, a dedicated private interrupt status register is set for different current interrupt states of each core, as shown in the following table.
Name | Offset Address | Description |
---|---|---|
|
|
32-bit interrupt status routing to the current processor core |
11.2. Extended I/O Interrupts
In addition to being compatible with the legacy I/O interrupt method, the 3A5000 supports extended I/O interrupts, which are used to distribute 256-bit interrupts on the HT bus directly to each processor core instead of forwarding them through the HT interrupt line, increasing the flexibility of I/O interrupt usage.
Before the core can use the extended I/O interrupt, it needs to enable the corresponding bit in the “Other function configuration register”.
This register has a base address of 0x1fe00000
,It can also be accessed using the configuration register instruction (IOCSR), an offset address of 0x0420
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Extended I/O interrupt enable |
In Extended I/O interrupt mode, HT interrupts can be forwarded directly across slices and distributed in rotation.
In the current version, up to s
extended interrupt vectors can be supported.
11.2.1. Accessing by Address
The following are the associated extended I/O interrupt registers.
As with the other configuration registers, the base address can be used as 0x1fe00000
, or can be accessed via the processor core’s dedicated register configuration instructions.
Name | Offset Address | Description |
---|---|---|
|
|
Interrupt enable configuration for extended I/O interrupt |
|
|
Interrupt enable configuration for extended I/O interrupt |
|
|
Interrupt enable configuration for extended I/O interrupt |
|
|
Interrupt enable configuration for extended I/O interrupt |
Name | Offset Address | Description |
---|---|---|
|
|
Auto-rotation enable register for extended I/O interrupt |
|
|
Auto-rotation enable register for extended I/O interrupt |
|
|
Auto-rotation enable register for extended I/O interrupt |
|
|
Auto-rotation enable register for extended I/O interrupt |
Name | Offset Address | Description |
---|---|---|
|
|
Interrupt status for extended I/O interrupt |
|
|
Interrupt status for extended I/O interrupt |
|
|
Interrupt status for extended I/O interrupt |
|
|
Interrupt status for extended I/O interrupt |
Name | Offset Address | Description |
---|---|---|
|
|
Interrupt status of extended I/O interrupt |
|
|
Interrupt status of extended I/O interrupt |
|
|
Interrupt status of extended I/O interrupt |
|
|
Interrupt status of extended I/O interrupt |
|
|
Interrupt status of extended I/O interrupt |
|
|
Interrupt status of extended I/O interrupt |
|
|
Interrupt status of extended I/O interrupt |
|
|
Interrupt status of extended I/O interrupt |
|
|
Interrupt status of extended I/O interrupt |
|
|
Interrupt status of extended I/O interrupt |
|
|
Interrupt status of extended I/O interrupt |
|
|
Interrupt status of extended I/O interrupt |
|
|
Interrupt status of extended I/O interrupt |
|
|
Interrupt status of extended I/O interrupt |
|
|
Interrupt status of extended I/O interrupt |
|
|
Interrupt status of extended I/O interrupt |
Similar to legacy I/O interrupts, the 256-bit interrupt source for Extended I/O interrupts can be software-configured to select the target processor core for the desired interrupt.
However, the interrupt sources are not individually selected to route to any of the processor core interrupts INT0 through INT3, but rather the routing of INT interrupts is done in groups. The following are the interrupt pin routing registers configured by group.
Starting with the 3A5000, the interrupt pin routing bits have been added in a coded manner and are enabled by the CSR[0x420][49]
bit control.
When this bit is enabled, the [3:0]
bits in the table below changes from a bitmap representation to a numeric encoding method.
Configurable values 0
-7
indicate interrupt pins 0
-7
.
For example, in this mode, 0x2
indicates routing to INT2
.
Bit Field | Description |
---|---|
|
Processor core interrupt pin vector number for routing |
|
Reserved |
Name | Offset Address | Description |
---|---|---|
|
|
Pin routing method of |
|
|
Pin routing method of |
|
|
Pin routing method of |
|
|
Pin routing method of |
|
|
Pin routing method of |
|
|
Pin routing method of |
|
|
Pin routing method of |
|
|
Pin routing method of |
Each interrupt source additionally corresponds to an 8-bit routing controller with the format and address shown in Description of the interrupt destination processor core routing register and Interrupt destination processor core routing register address.
The [7:4]
bits are used to select the real node routing vector in Interrupt destination node mapping method configuration.
The routing register uses a vector approach for routing, e.g., 0x48
indicates a route to processor core 3 of the node referred to by EXT_IOI_node_type4
.
Bit Field | Description |
---|---|
|
Processor core vector number for routing |
|
Selection of node mapping method of routing (as configured in Interrupt destination node mapping method configuration) |
Note that when using the rotating distribution mode (corresponding to an EXT_IOIbounce
of 1
), rotate on the fully mapped mode of node number to processor core number.
The setting of EXT_IOIbounce
should follow the associated route mapping configuration.
For example, when the setting in the tables above is 0x27
and the setting of EXT_IOI_node_type2
in the the tables below is 0x0013
, the interrupt will rotate in turn on node 0 core 0, node 0 core 1, node 0 core 2, node 1 core 0, node 1 core 1, node 1 core 2, node 4 core 0, node 4 core 1, and node 4 core 2.
When using fixed distribution mode (corresponding to an EXT_IOIbounce
of 0
), only one bit on the bitmap of the node number is allowed to be 1
, or all 0
values, corresponding to local triggering.
Name | Offset Address | Description |
---|---|---|
|
|
Processor core routing method of |
|
|
Processor core routing method of |
|
|
Processor core routing method of |
|
||
|
|
Processor core routing method of |
|
|
Processor core routing method of |
Name | Offset Address | Description |
---|---|---|
|
|
Mapping vector type |
|
|
Mapping vector type |
|
|
Mapping vector type |
|
||
|
|
Mapping vector type 15 for 16 nodes (software configuration) |
11.2.2. Accessing by Configuration Register Instructions
The biggest difference when accessing using the processor core’s configuration register instructions is that access to the processor core’s interrupt status registers becomes private, and each core only needs to issue a query request to the same address to get the current core’s interrupt status.
Name | Offset Address | Description |
---|---|---|
|
|
Interrupt status of the extended I/O interrupt |
|
|
Interrupt status of the extended I/O interrupt |
|
|
Interrupt status of the extended I/O interrupt |
|
|
Interrupt status of the extended I/O interrupt |
11.2.3. Extended I/O Interrupt Trigger Register
To support the dynamic distribution of extended I/O interrupts, an extended I/O interrupt trigger register is added to the configuration register to set the corresponding I/O interrupts to be set. This register can be used for debugging or testing interrupts in normal times.
The description of this register is as follows:
Name | Offset Address | Read/Write | Description |
---|---|---|---|
|
|
WO |
Extended I/O interrupt setting register
|
11.2.4. Difference in Handling Between Extended I/O Interrupts and Legacy HT Interrupts
With legacy HT interrupt processing, HT interrupts are processed internally by the HT controller and mapped directly to the 256
interrupt vectors on the HT configuration registers, and then the 256
interrupt vectors are grouped to generate 4
or 8
interrupts that are routed to the various processor cores.
Due to the legacy interrupt line connection, no cross-chip interrupts can be generated directly, so all HT I/O interrupts can only be handled directly by a single chip.
On the other hand, the interrupts distributed by the hardware within the chip are only in units of the final 4
or 8
interrupts and cannot be handled on a bit-by-bit basis, which leads to the problem of poor hardware interrupt distribution.
With the extended I/O interrupt method, HT interrupts are sent directly from the HT controller to the chip’s interrupt controller for processing, and the interrupt controller can directly get 256
Instead of the previous 4
or 8
interrupts, each of these 256-bit interrupts can be routed and distributed independently, and can be distributed and rotated across slices.
With Extended I/O interrupts, the software processing is slightly different than with legacy HT interrupts.
With legacy HT interrupts, the kernel looks directly at the interrupt vector of the HT controller (typically 0x90000efdfb000080
) and then processes the interrupts by bit, regardless of how the routing mode is configured.
After using Extended I/O interrupts, the cores go directly to the Extended I/O status register (configuration space 0x1800
) to read the interrupt status for processing.
Each core will only read the interrupt’s own interrupt status and process it, and there will be no interference between different cores.
12. Temperature Sensor
12.1. Real-time Temperature Collection
Two temperature sensors are integrated inside the Loongson 3A5000, which can be observed through the sampling register starting at 0x1FE00198
, and can be controlled using the flexible high and low temperature interrupt alarm or auto-tuning function.
The corresponding bits of the temperature sensors in the sampling register are as follows (base address is 0x1FE00000
, offset address is 0x0198
):
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
R |
Temperature sensor 0 overflow |
|
|
|
R |
Temperature sensor 1 overflow |
|
|
|
R |
Temperature sensor 0 centigrade temperature
Temperature range: |
|
|
|
R |
Temperature sensor 1 centigrade temperature
Temperature range: |
The control registers can be set to enable over preset temperature interrupt, under preset temperature interrupt and high temperature auto down function.
In addition, the current centigrade temperature can be read directly using the new centigrade temperature register.
This register can also be accessed using a read operation with base address 0x1FE00000
or 0x3FF00000
, or directly using a configuration register instruction with offset 0x0428
.
The register is described as follows:
Name | Offset Address | Read/Write | Description |
---|---|---|---|
|
|
R |
Temperature sensor centigrade temperature |
12.2. High/Low Temperature Interrupt Trigger
For the high and low temperature interrupt alarm function, there are 4
groups of control registers to set the threshold value.
Each group of registers contains the following three control bits:
GATE
: Set the threshold value for high or low temperature.
When the input temperature is higher than the high temperature threshold or lower than the low temperature threshold, an interrupt will be generated.
Note that the Gate value should be set to the 16-bit value corresponding to the 0x198
register, not the centigrade temperature.
EN
: Interrupt enable control.
The setting of this set of registers is valid only after setting 1
.
SEL
: Input temperature selection.
This register is used to configure which sensor’s temperature is selected as input.
Either 0
or 1
can be used.
The high temperature interrupt control register contains four sets of setting bits to control the triggering of high temperature interrupts; the low temperature interrupt control register contains four sets of setting bits to control the triggering of low temperature interrupts. There is another set of registers for displaying the interrupt status, corresponding to the high-temperature interrupt and low-temperature interrupt, respectively, and any write operation to this register will clear the interrupt status.
These registers are described below, and their base addresses are 0x1fe00000
,It can also be accessed using the configuration register instruction (IOCSR):
Register | Address | Read/Write | Description |
---|---|---|---|
High temperature interrupt control register |
|
RW |
|
Low temperature interrupt control register |
|
RW |
|
Interrupt status register |
|
RW |
Interrupt status register; write
|
High order bits of high temperature interrupt control register |
|
RW |
|
12.3. High Temperature Automatic Underclock Configuration
In order to ensure the operation of the chip in a high temperature environment, it can be set to make the high temperature automatic frequency reduction, so that the chip is actively clocked when it exceeds the preset range to achieve the effect of reducing the chip flip rate.
For the high-temperature downconversion function, there are four sets of control registers to set its behavior. Each set of registers contains the following four control bits:
GATE
: Set the threshold value for high or low temperature.
When the input temperature is higher than the high temperature threshold or lower than the low temperature threshold, the frequency dividing operation will be triggered.
EN
: Enable control.
The setting of this group of registers is valid only after setting 1
.
SEL
: Input temperature selection.
This register is used to configure which sensor’s temperature is selected as input.
FREQ
: Frequency division number.
When the dividing operation is triggered, the clock is divided using the preset FREQ
.
The dividing mode is controlled by freqscale_mode_node
.
Its base address is 0x1fe00000
,It can also be accessed using the configuration register instruction (IOCSR).
Register | Address | Read/Write | Description |
---|---|---|---|
High-temperature underclock control register |
|
RW |
The four groups of configurations are prioritized from highest to lowest
|
Thsens_freq_scale_up |
|
RW |
High order bits of temperature sensor control register
|
12.4. Temperature Status Detection and Control
The pins PROCHOTn
and THERMTRIPn
are used for temperature status detection and control, which are multiplexed with GPIO14
and GPIO15
respectively.
PROCHOTn
can be used as both input and output, while THERMTRIPn
has only output function.
When PROCHOTn
is used as an input, the chip is controlled by the external temperature detection circuit, and the external temperature detection circuit can set PROCHOTn
to 0
when it needs to lower the chip temperature, and the chip will take down frequency measures after receiving this low level.
When PROCHOTn
is an output, the chip can output high-temperature interrupts, and select one of the four interrupts set by the high-temperature interrupt control register through the prochotn_o_sel
register.
Select one of the four interrupts set in the high-temperature interrupt control register as the external high-temperature interrupt.
THERMTRIPn
as output is selected by the chip from the 4
interrupts set by the high-temperature interrupt control register through the thermtripn_o_sel
register as the outgoing high-temperature interrupt.
Although both THERMTRIPn
and PROCHOTn
are external high temperature interrupts, THERMTRIPn
has a higher degree of urgency than PROCHOTn
.
When PROCHOTn
is set, the external temperature control circuit can also take certain measures, such as increasing the fan speed.
In contrast, when THERMTRIPn
is set, the external power control circuitry should take direct emergency power-off measures.
The specific control registers are as follows:
Register | Address | Read/Write | Description |
---|---|---|---|
Temperature status detection and control register |
|
RW |
|
12.5. Control of temperature sensors
The 3A5000 has 4
internal temperature sensors, which can be configured via registers to adjust the temperature/voltage monitoring, monitoring point configuration and monitoring frequency, etc.
The output of each temperature sensor can also be directly observed for debugging (base address is 0x1FE00000
,It can also be accessed using the configuration register instruction (IOCSR), offset address of temperature sensor configuration register is 0x01580+vtsensor_id<<4
, offset address of temperature sensor data register is 0x01588+vtsensor_id<<4
).
Note that the voltage monitoring function is currently not available
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Enable temperature sensor configuration.
If set, monitoring mode and monitoring point can be selected by |
|
|
RW |
|
|
|
|
RW |
|
Monitoring frequency:
|
|
|
RW |
|
Sensor monitoring point configuration: |
|
|
RW |
|
Enable the temperature sensor output and replace the value of |
|
|
RW |
|
Temperature sensor output monitoring point selection.
It is disabled when |
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
R |
|
Monitoring mode for sensor configuration
|
|
|
R |
|
Monitoring points for sensor configuration |
|
|
R |
|
Overflow of sensor monitoring values |
|
|
R |
|
Sensor readout monitoring values |
Calculation of the readout value:
Node temperature = data*731/0x4000 - 273
(temperature range -40
degrees - 125
degrees)
Voltage = data*1.226/0x1000
13. DDR4 SDRAM Controller Configuration
The Loongson 3A5000 processor’s internally integrated memory controller is designed to comply with the DDR4 SDRAM industry standard (JESD79-4).
13.1. Introduction to DDR4 SDRAM Controller Functions
The Loongson 3A5000 processor supports both DDP and 3DS packaging modes.
The DDP supports up to 8
CSs (implemented by 8
DDR3/DDR4 SDRAM chip select signals, i.e., 4
double-sided memory sticks) and the 3DS supports up to 4
CSs (implemented by 8
DDR4 SDRAM chip select signals, i.e., 32
logical RANKS).
A total of 22
bits of address bus (i.e., 18
bits of row address bus, 2
bits of logical Bank bus and 2
bits of logical Bank Group bus, where the row address bus is multiplexed with RASn
, CASn
, and Wen
).
The Loongson 3A5000 processor can adjust the DDR4 controller parameter settings to support different memory chip types when they are specifically selected for use.
The maximum supported chip selection (CS_n
) is 8
, the number of logical RANKS (Chip ID
) is 8
, the number of row addresses (ROW
) is 18
, the number of column addresses (COL
) is 12
, the number of logical body selections (BANK
) is 2
(DDR4), and the number of logical body groups (BANK Group
) is 2
.
The multiplexing relationship between CS_n
and Chip ID
can be matched, please see DDR4 SDRAM Parameter Configuration Format for details.
The physical address of the memory request sent by the CPU can be mapped in many different ways according to different configurations inside the controller.
The memory control circuitry integrated in the Loongson 3A5000 processor only accepts memory read/write requests from the processor or external devices, and is in the Slave State for all memory read/write operations.
The memory controller in the Loongson 3A5000 processor has the following features:
-
Fully flowing operation of commands, read and write data on the interface.
-
Memory command merging and sequencing to improve overall bandwidth.
-
Configuration register read and write ports, which can modify the basic parameters of memory devices.
-
Built-in dynamic delay compensation circuit (DCC) for reliable sending and receiving of data.
-
ECC function can detect 1-bit and 2-bit errors on the data path and can automatically correct 1-bit errors.
-
DDR3/4 SDRAM support and parameter configuration supports
x4
,x8
, andx16
particles. -
Controller to PHY frequency ratio of
1/2
. -
Support data transport rate range from
800Mbps
to3200Mbps
.
13.2. DDR4 SDRAM Parameter Configuration Format
13.2.1. Parameter List of the Memory Controller
Offset | 63:55 | 55:48 | 47:40 | 39:32 | 31:24 | 23:16 | 15:8 | 7:0 |
---|---|---|---|---|---|---|---|---|
PHY |
||||||||
|
|
|||||||
|
|
|
|
|||||
|
|
|
||||||
|
||||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
||||||
|
|
|
|
|
|
|||
|
|
|
||||||
|
|
|
|
|
|
|||
|
|
|
||||||
|
|
|
|
|
|
|||
|
|
|
||||||
|
|
|
|
|
|
|||
|
|
|
||||||
|
|
|
|
|
|
|||
|
|
|
||||||
|
|
|
|
|
|
|||
|
|
|
||||||
|
|
|
|
|
|
|||
|
|
|
||||||
|
|
|
|
|
|
|||
|
|
|
||||||
|
|
|
|
|
|
|||
|
|
|
||||||
|
|
|
|
|
|
|||
|
|
|
|
|
|
|||
…… |
||||||||
|
|
|
|
|
||||
|
|
|
|
|||||
|
|
|
|
|
|
|
||
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
||||||
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
||||
|
|
|
|
|||||
|
|
|
|
|
|
|
||
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
||||||
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
||||
|
|
|
|
|||||
|
|
|
|
|
|
|
||
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
||||||
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
||||
|
|
|
|
|||||
|
|
|
|
|
|
|
||
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
||||||
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
||||
|
|
|
|
|||||
|
|
|
|
|
|
|
||
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
||||||
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
||||
|
|
|
|
|||||
|
|
|
|
|
|
|
||
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
||||||
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
||||
|
|
|
|
|||||
|
|
|
|
|
|
|
||
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
||||||
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
||||
|
|
|
|
|||||
|
|
|
|
|
|
|
||
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
||||||
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
||||
|
|
|
|
|||||
|
|
|
|
|
|
|
||
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
||||||
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
…… |
||||||||
|
|
|
|
|
||||
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
||||||||
…… |
||||||||
|
|
|
|
|||||
|
|
|
|
|
||||
|
|
|
|
|
||||
|
|
|
|
|
||||
|
|
|||||||
|
||||||||
|
|
|
||||||
|
||||||||
CTL |
||||||||
|
|
|
|
|
|
|
||
|
|
|||||||
|
|
|
|
|||||
|
|
|
|
|
|
|||
|
|
|
|
|
||||
|
|
|
|
|
||||
…… |
||||||||
|
|
|
|
|
|
|||
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|||
|
|
|
||||||
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
||
|
||||||||
|
|
|
|
|
|
|
||
|
|
|
|
|
||||
…… |
||||||||
|
|
|
|
|
|
|
||
|
|
|
||||||
|
|
|
||||||
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|||||||
|
|
|||||||
|
|
|
|
|
||||
|
|
|
|
|
||||
|
|
|
|
|
||||
|
|
|
|
|
||||
|
|
|
|
|
||||
|
|
|
|
|
||||
|
|
|
|
|
||||
|
|
|
|
|
||||
|
|
|
|
|
||||
|
|
|
|
|||||
|
|
|
|
|
||||
|
|
|
|
|||||
|
|
|
|
|
||||
|
|
|
|
|||||
|
|
|
|
|
||||
|
|
|
|
|||||
|
|
|
|
|
||||
|
|
|
|
|||||
|
|
|
|
|
||||
|
|
|
|
|||||
|
|
|
|
|
||||
|
|
|
|
|||||
|
|
|
|
|
||||
|
|
|
|
|||||
|
|
|
|
|
|
|
||
|
|
|
||||||
|
|
|
||||||
|
||||||||
|
|
|
||||||
|
||||||||
|
|
|
|
|
|
|
||
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|||||||
|
|
|
|
|
||||
|
|
|
|
|
||||
|
||||||||
…… |
||||||||
|
|
|
|
|
|
|
||
|
||||||||
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
…… |
||||||||
|
|
|
||||||
|
|
|
||||||
…… |
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
||||||
|
|
|
||||||
…… |
||||||||
|
|
|||||||
|
|
|||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
|
|
|
||||||
…… |
||||||||
|
|
|||||||
|
|
|
||||||
|
|
|||||||
|
|
|
||||||
…… |
||||||||
|
|
|
|
|
|
|||
…… |
||||||||
|
|
|
|
|||||
|
|
|||||||
|
|
|
|
|||||
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||
|
|
|||||||
|
|
|
|
|||||
|
|
|||||||
…… |
||||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
…… |
||||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
…… |
||||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
…… |
||||||||
|
|
|
||||||
|
|
|
||||||
|
||||||||
|
||||||||
|
|
|
||||||
|
||||||||
|
|
|
||||||
|
||||||||
MON |
||||||||
|
|
|||||||
|
||||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
…… |
||||||||
|
|
|||||||
|
||||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
…… |
||||||||
|
|
|
||||||
|
||||||||
|
|
|
|
|
||||
|
|
|
|
|
||||
|
|
|
|
|
||||
|
|
|
|
|
||||
|
|
|
|
|
||||
|
|
|
|
|
||||
|
|
|
|
|
||||
|
|
|
|
|
||||
…… |
||||||||
TST |
||||||||
|
|
|
|
|||||
|
|
|
|
|||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
||||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|
|
|||||
|
|
|
|
|||||
|
|
|||||||
|
|
|||||||
…… |
||||||||
|
|
|
|
|
||||
|
|
|
|
|
|
|
||
|
|
|||||||
|
||||||||
|
|
|||||||
|
||||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
…… |
||||||||
|
||||||||
|
||||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
…… |
||||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
|||||||
|
|
13.3. Software Programming Guide
13.3.1. Initialization Operations
The initialization operation starts when the software writes 0x2
to register Init_start
(0x010
).
Before setting the Init_start
signal, all other registers must be set to the correct values.
The DRAM initialization process in cooperation with hardware and software is as follows:
-
Set
pm_clk_sel_ckca
andpm_clk_sel_ds
. -
Set
pm_phy_init_start
to1
to start initializing the PHY.
pm_dll_lock_*
or pm_pll_lock_*
of all clock generation modules to become 1
.-
Enabling all
pm_clken_*
. -
Set
pm_init_start
to1
to start initialization of the memory controller.
13.3.2. Control of Reset Pins
pm_dram_init
is the same as pm_cs_enable
.For simpler control of reset pins in states such as STR, special reset pin (DDR_RESETn
) control can be performed via the pad_reset_po
(0x808
) register, and there are two main control modes:
-
General mode,
reset_ctrl[1:0] == 2’b00
. The behavior of the reset signal pins in this mode is compatible with the general control mode.DDR_RESETn
is connected directly on the motherboard to the corresponding pin on the memory slot. The behavior of the pin is:-
When not powered up: pin status is low.
-
At power-up: pin state is low.
-
When the controller starts initialization: pin state is high.
-
During normal operation: pin state is high.
The timing is shown in the figure below:
Figure 7. General mode timing
-
-
Reverse mode,
reset_ctrl[1:0] == 2’b10
. In this mode, the reset signal pins are at the opposite effective level from the normal control mode when doing the actual memory control. So the motherboard needs to connect DDR_RESETn to the corresponding pin on the memory slot through the inverter. The pin behavior is:-
When not powered up: the pin state is low.
-
At power-up: pin state is low.
-
When the controller starts configuration: pin state is high.
-
When the controller starts initialization: pin state is low.
-
During normal operation: pin state is low.
The timing sequence is shown in the following figure:
Figure 8. Reverse mode timing
-
-
Reset disable mode,
pm_pad_reset_o[1:0] == 2’b01
. In this mode, the reset signal pin remains low during the whole memory operation. So the motherboard needs to connect DDR_RESETn to the corresponding pin on the memory slot through the inverter. The behavior of the pins is:-
always low.
The timing is shown in the following diagram:
Reset disable mode timing
-
By the latter two reset modes in conjunction, STR control can be achieved directly with the use of the memory controller’s reset signal. When the whole system is booted from the shutdown state, use the method 2 to use the memory stick to reset normally and start working. When the system resumes from STR, the method 3 is used to reconfigure the memory stick so that it starts working properly again without destroying the original state of the memory stick.
13.3.3. Leveling
The Leveling operation is an operation used in DDR3/4 to intelligently configure the phase relationship between various signals in the memory controller read and write operations. It usually includes Write Leveling, Read Leveling and GateLeveling. In this controller, only Write Leveling and Gate Leveling are implemented, and Read Leveling is not implemented. The software needs to judge the correctness of reading and writing to achieve the functions accomplished by Read Leveling. In addition to the DQS phase and GATE phase operated in the Leveling process, the configuration methods of Write DQ phase and Read DQ phase can be calculated based on these last confirmed phases. In addition, the design supports a bit-deskew function to compensate the delay difference between different bits within a dataslice.
13.3.3.1. Write Leveling
Write Leveling is used to configure the phase relationship between the write DQS and the clock, and the software programming needs to refer to the following steps.
-
Complete the controller initialization, see the previous subsection.
-
Set
Dll_wrdqs_x
(x = 0…8
) to0x20
. -
Set
Dll_wrdq_x
(x = 0..8
) to0x0
. -
Set
Lvl_mode
to2’b01
. -
Sample the
Lvl_ready
register, if it is1
, it means that the Write Leveling request can start. -
Set
Lvl_req
to1
. -
Sample the
Lvl_done
register, if it is1
, a Write Leveling request is complete. -
Sample the
Lvl_resp_x
register, if it is0
, increments the corresponding Dll_wrdq_x[6:0] anddll_1xdly[6:0]
by1
, and repeats 5-7 untilLvl_resp_x
is1
, then moves to 9; if it is1
, increments the correspondingDll_wrdq_x[6:0]
anddll_1xdly[6:0]
by1
and repeat 5-7 untilLvl_resp_x
is0
, then continue to increase the correspondingDll_wrdq_x[6:0]
anddll_1xdly[6:0]
by1
and repeat 5-7 untilLvl_resp_x
is1
, then turn to 9. -
Subtract
0x40
from the values ofDll_wrdq_x
anddll_1xdly
, at which point the values ofDll_wrdq_x
anddll_1xdly
should be the correct values to set. -
Set
pm_dly_2x
according to the DIMM type, for the particles to the right of the 0x0 bound the correspondingpm_dly_2x
value is increased by0x010101
. -
Set
Lvl_mode
(0x700
) to2’b00
to exit Write Leveling mode.
13.3.3.2. Gate Leveling
Gate Leveling is used to configure the timing of the enable sample read DQS window within the controller, refer to the following steps for software programming.
-
Complete controller initialization, see previous subsection.
-
Completing Write Leveling, see previous section.
-
Set
Dll_gate_x
(x = 0…8
) to0
. -
Set Lvl_mode to
2’b10
. -
Sample the
Lvl_ready
register; if it is1
, the Gate Leveling request can start. -
Set
Lvl_req
to1
. -
Sample the Lvl_done register, if it is
1
, a Gate Leveling request is complete. -
Sample the
Lvl_resp_x[0]
register, if the first sample findsLvl_resp_x[0]
to be1
, increase the correspondingDll_gate_x[6:0]
by1
and repeat 6-8 until the sample result is0
; otherwise proceed to the next step. -
If the sampling result is
0
, increment the correspondingDll_gate_x[6:0]
by1
and repeat 6-9; if it is1
, the Gate Leveling operation has succeeded. -
Set pm_rdedge_sel (
11
) according to the value of pm_rddqs_phase to setDll_gate_x
(x = 0…8
) minus0x20
. -
If the value of
Lvl_resp_x[7:5]
andLvl_resp_x[4:2]
changes, if each increases toBurst_length/2
, proceed to step13
; if it is not4
, it may be necessary to add or subtractRd_oe_begin_x
a plus or minus operation may be required forRd_oe_begin_x
, and if greater thanBurst_length/2
, some fine-tuning of the value ofDll_gate_x
is likely to be required. -
Set
Lvl_mode
(0x700
) to2’b00
to exit Gate Leveling mode. -
This ends the Gate Leveling operation.
13.3.4. Power Control Configuration Flow
First set pm_pad_ctrl_ca[0]
to 1
, then set pm_pad_ctrl_ca[0]
to 0
after memory initialization is complete.
This function is only available when CAL Mode is enabled in DDR4 mode.
13.3.5. Initiate a Separate MRS Command
In DDR3 mode, the sequence of MRS commands issued by the memory controller to the memory are:
MR2_CS0
, MR2_CS1
, MR2_CS2
, MR2_CS3
, MR2_CS4
, MR2_CS5
, MR2_CS6
, MR2_CS7
, MR3_CS0
, MR3_CS1
, MR3_CS2
, MR3_CS3
, MR3_CS4
, MR3_CS5
, MR3_CS6
, MR3_CS7
, MR1_CS0
, MR1_CS1
, MR1_CS2
, MR1_CS3
, MR1_CS4
, MR1_CS5
, MR1_CS6
, MR1_CS7
, MR0_CS0
, MR1_CS1
, MR1_CS2
, MR1_CS3
, MR0_CS4
, MR0_CS5
, MR0_CS6
, MR0_CS7
.
In addition, for DDR4 mode, the sequence of MRS commands issued by the memory controller to the memory are:
MR3_CS0
, MR3_CS1
, MR3_CS2
, MR3_CS3
, MR3_CS4
, MR3_CS5
, MR3_CS6
, MR3_CS7
, MR6_CS0
, MR6_CS1
, MR6_CS2
, MR6_CS3
, MR6_CS4
, MR6_CS5
, MR6_CS6
, MR6_CS7
, MR5_CS0
, MR5_CS1
, MR5_CS2
, MR5_CS3
, MR5_CS4
, MR5_CS5
, MR5_CS6
, MR5_CS7
, MR4_CS0
, MR1_CS1
, MR1_CS2
, MR1_CS3
, MR4_CS4
, MR4_CS5
, MR4_CS6
, MR4_CS7
, MR2_CS0
, MR2_CS1
, MR2_CS2
, MR2_CS3
, MR2_CS4
, MR2_CS5
, MR2_CS6
, MR2_CS7
, MR1_CS0
, MR1_CS1
, MR1_CS2
, MR1_CS3
, MR1_CS4
, MR1_CS5
, MR1_CS6
, MR1_CS7
, MR0_CS0
, MR1_CS1
, MR1_CS2
, MR1_CS3
, MR0_CS4
, MR0_CS5
, MR0_CS6
, MR0_CS7
.
Among them, whether the MRS command corresponding to CS is valid or not is determined by Cs_mrs
.
Only when the bit corresponding to each chip select on Cs_mrs
is valid, this MRS command is actually sent to DRAM.
The value of each corresponding MR is determined by the register Mr*_cs*
.
These values are also used for the MRS command when initializing the memory.
The operation is as follows:
-
Set the registers
Cs_mrs
(0x1101
),Mr*_cs*
(0x1140
-0x11f8
) to the correct values. -
Set Command_mode (
0x1120
) to1
to put the controller into command sending mode. -
Sample Status_cmd (
0x1122
), if it is1
, the controller is in command sending mode and can proceed to the next operation, if it is0
, it needs to continue to wait.
Mrs_req
(0x1126
) to 1
to send MRS command to DRAM.-
sample
Mrs_done
(0x1127
), if it is1
, it means the MRS command has been sent and can exit, if it is0
, it needs to continue to wait. -
Set
Command_mode
(0x1120
) to0
to make the controller exit the command sending mode.
13.3.6. Arbitrary Operation Control Bus
The memory controller can send any combination of commands to DRAM via command send mode.
The software can set Cmd_cs
, Cmd_cmd
, Cmd_ba
, Cmd_a
(0x1128
) to be sent to DRAM in command send mode.
The specific operation is as follows:
-
Set registers
Cmd_cs
,Cmd_cmd
,Cmd_ba
,Cmd_a
(0x1128
) to the correct values. -
Set
Command_mode
(0x1120
) to1
to put the controller into command sending mode; -
Sample
Status_cmd
(0x1122
), if it is1
, the controller is in command sending mode and can proceed to the next operation, if it is0
, it needs to continue to wait;
Cmd_req
(0x1121
) to 1
to send a command to DRAM.-
Set
Command_mode
(0x1120
) to0
to make the controller exit the command sending mode.
13.3.7. Control of Self-cycling Test Mode
The self-cycling test mode can be used in test mode or normal function mode, respectively. For this purpose, this memory controller implements two separate sets of control interfaces, one for direct control by the test port in test mode and the other for configuration enable test by the register configuration module in normal function mode.
The multiplexing of these two sets of interfaces is controlled using port test_phy
.
When test_phy
is valid, the test_*
port of the controller is used for control, and the self-test is fully controlled by hardware at this time; when test_phy
is invalid, the parameters of pm_*
programmed by software are used for control.
The specific signal meaning of using the test port can be found in the same name section of the register parameters.
These two sets of interfaces are basically the same in terms of control parameters, only the access point is different, here to introduce the control method of software programming. The specific operation is as follows:
-
Set all the parameters of the memory controller correctly.
-
Set register
Lpbk_en
to1
. -
Set the register Lpbk_start to
1
; then the self-loop test starts. -
At this point the self-loop test has begun and the software needs to be checked frequently for errors, as follows:
-
Sample register
Lpbk_error
, if it is1
, it means that an error occurred, at this time the first error data and correct data throughLpbk_*
and other observation registers can be observed; if this value is0
, it means that there has not been a data error.
13.3.8. Control of the Use of ECC Function
The ECC function is only available in 64-bit mode.
ecc_enable
(0x1280
) consists of the following 2
control bits:
Ecc_enable[0]
controls whether to enable the ECC function, which is enabled only if this valid bit is set.
Ecc_enable[1]
controls whether to report errors through the processor’s internal read response path, so that a read access with an ECC two-bit error can immediately cause an exception to occur in the processor core.
In addition, ECC errors can be notified to the processor core via an interrupt.
This interrupt is controlled through Int_enable.
The interrupt consists of two vectors, Int_vector[0]
for an ECC error (both 1-bit and 2-bit errors) and Int_vecotr[1]
for an ECC two-bit error.
Clearance of Int_vector
is achieved by writing 1
to the corresponding bit.
13.3.9. Observation of Error States
After a memory controller error, the corresponding system configuration registers can be accessed to get the corresponding error information and perform simple debugging operations.
The register base address is 0x1fe00000
or 0x3ff00000
, which can also be accessed using the configuration register instruction, and the registers and their corresponding bits are as follows.
Register | Offset Address | Read/Write | Description |
---|---|---|---|
Memory controller 0 ECC set register |
|
RW |
Memory controller 0 ECC set register
|
|
RW |
Reserved |
|
Memory controller 0 ECC counter register |
|
RW |
Memory controller 0 ECC counter register
|
Memory controller 0 ECC error count register |
|
RO |
Memory controller 0 ECC error count register
|
Memory controller 0 ECC checking register |
|
RO |
Memory controller 0 ECC checking register
|
Memory controller 0 ECC error address register |
|
RO |
Memory controller 0 ECC error address register
|
Memory controller 0 ECC error data register 0 |
|
RO |
Memory controller 0 ECC error data register 0
|
Memory controller 0 ECC error data register 1 |
|
RO |
Memory controller 0 ECC error data register 1
|
Memory controller 0 ECC error data register 2 |
|
RO |
Memory controller 0 ECC error data register 2
|
Memory controller 0 ECC error data register 3 |
|
RO |
Memory controller 0 ECC error data register 3
|
Register | Offset Address | Read/Write | Description |
---|---|---|---|
Memory controller 1 ECC set register |
|
RW |
Memory controller 1 ECC set register
|
|
RW |
Reserved |
|
Memory controller 1 ECC counter register |
|
RW |
Memory controller 1 ECC counter register
|
Memory controller 1 ECC error count register |
|
RO |
Memory controller 1 ECC error count register
|
Memory controller 1 ECC checking register |
|
RO |
Memory controller 1 ECC checking register
|
Memory controller 1 ECC error address register |
|
RO |
Memory controller 1 ECC error address register
|
Memory controller 1 ECC error data register 0 |
|
RO |
Memory controller 1 ECC error data register 0
|
Memory controller 1 ECC error data register 1 |
|
RO |
Memory controller 1 ECC error data register 1
|
Memory controller 1 ECC error data register 2 |
|
RO |
Memory controller 1 ECC error data register 2
|
Memory controller 1 ECC error data register 3 |
|
RO |
Memory controller 1 ECC error data register 3
|
14. HyperTransport Controller
In the Loongson 3A5000, the HyperTransport bus is used to enable external device connections and multi-chip interconnections.
When used for peripheral connection, I/O Cache consistency can be freely selected by the user program (set through the address window Uncache, see Retry Count Register).
When configured to support Cache consistency mode, the I/O device access to the internal DMA is transparent to the Cache hierarchy, i.e., the hardware automatically maintains its consistency without the need for software maintenance through program Cache instructions.
When the HyperTransport bus is used for multi-chip interconnects, the HT0
controller (initial address 0x0C00_0000_0000
-0x0DFF_FFFF_FFFF
) can be pin-configured to support inter-chip Cache.
The HT1
controller (initial address 0x0E00_0000_0000
-0x0FFF_FFFF_FFFF
) can be configured in software to support interchip Cache consistency maintenance, as described in HyperTransport Multi-processor Support.
In an 8-chip interconnect fabric, the HT1_HI
controller’s conformance mode is configured via the pins in CHIP_CONFIG
.
The HyperTransport controller supports up to 16-bit width in both directions and 2.4GHz
operation.
After the connection is established by automatic system initialization, the user program can change the width and operating frequency and re-initialize by modifying the corresponding configuration registers in the protocol as described in HyperTransport Hardware Configuration and Initialization.
The main features of the Loongson 3A5000 HyperTransport controller are as follows:
-
Support for HT1.0/HT3.0 protocol
-
Supports
200
/400
/800
/1600
/2000
/2400
/3200MHz
operating frequency -
HT1.0 supports length of
8
bits -
HT3.0 supports length of
8
/16
bits -
Each HT controller (
HT0
/HT1
) can be configured as two 8-bit HT controllers -
Bus control signals (including
PowerOK
,Rstn
,LDT_Stopn
) direction can be configured -
Peripheral DMA space Cache/Uncache configurable
-
Configurable for Cache Consistency Mode when used in multi-chip interconnects
14.1. HyperTransport Hardware Configuration and Initialization
The HyperTransport bus consists of a transmission signal bus and control signal pins, etc. The following table gives a description of the HyperTransport bus related pins and their functions.
Pins | Name | Description |
---|---|---|
|
Bus width configuration |
1: The
|
|
Master device mode |
0: Set |
|
Bus Powerok |
HyperTransport bus Powerok signal. controlled by When |
|
Bus Rstn |
HyperTransport bus Rstn signal. controlled by When |
|
Bus Ldt_Stopn |
HyperTransport bus controlled by When |
|
Bus Ldt_Reqn |
HyperTransport bus |
|
Master device mode |
1: Set
|
|
Bus Powerok |
HyperTransport bus Powerok signal. controlled by When
When |
|
Bus Rstn |
HyperTransport bus Rstn signal. controlled by When
When |
|
Bus Ldt_Stopn |
HyperTransport bus controlled by When
When |
|
Bus Ldt_Reqn |
HyperTransport bus
When |
|
CLK[1:0] |
HyperTransport bus CLK signal
When
When |
|
|
HyperTransport bus CTL signal
When
When HT0_8x2 is 0,
|
|
|
HyperTransport bus CAD signal When
When |
The initialization of HyperTransport starts automatically after each reset.
After a cold start the HyperTransport bus will automatically operate at the minimum frequency (200MHz
) and minimum width (8-bit) and will try to perform a bus initialization handshake.
Whether the initialization is completed or not can be read from the register InitComplete
(see Capability Registers).
After the initialization is complete, the width of the bus can be read from the Link Width Out
and Link Width In
registers (see Capability Registers).
After initialization, the user can rewrite the Link Width Out
, Link Width In
and Link Freq
registers.
The corresponding registers of the other device can also be configured.
After the configuration is completed, a hot reset of the bus or a re-initialization operation via the HT_Ldt_Stopn
signal is required to make the rewritten register values effective.
After the reinitialization, the HyperTransport bus will operate at the new frequency and width.
It is important to note that the configuration of the devices on both sides of the HyperTransport needs to correspond to each other, otherwise the HyperTransport interface will not work properly.
14.2. HyperTransport Protocol Support
The Loongson 3A5000’s HyperTransport bus supports most commands in the version 1.03/3.0 protocol and includes some extended commands in the extended conformance protocol that supports multi-chip interconnects. The commands that can be received by the HyperTransport receiver in both of these modes are shown in the table below. Note that atomic operation commands for the HyperTransport bus are not supported.
Encode | Channel | Commands | Standard mode | extension (consistency) |
---|---|---|---|---|
|
- |
|
Empty package or flow control |
|
|
|
|
No operation |
|
|
|
|
bit
bit
bit bit |
bit bit
bit bit |
|
|
|
bit bit
bit bit |
bit bit
bit bit |
|
|
|
Read operation returns |
|
|
|
|
The write operation returns |
|
|
|
|
---- |
Write command extension |
|
|
|
---- |
Write address extension |
|
|
|
---- |
Read Response Extension |
|
|
|
---- |
Read command extension |
|
|
|
No operation |
|
|
|
|
---- |
Read Address Extension |
|
|
|
Guaranteed sequential relationships |
|
|
- |
|
Sync/Error |
For the sender, the commands that will be sent out in both modes are shown in the table below.
Code | Channel | Commands | Standard mode | extension (consistency) |
---|---|---|---|---|
|
- |
|
Blanket or flow control |
|
|
|
|
bit
|
bit bit
|
|
|
|
bit
bit |
bit
bit |
|
|
|
Read operation returns |
|
|
|
|
The write operation returns |
|
|
|
|
---- |
Write command extension |
|
|
|
---- |
Write address extension |
|
|
|
---- |
Read Response Extension |
|
|
|
---- |
Read command extension |
|
|
|
---- |
Read Address Extension |
|
- |
|
Will only forward |
14.3. HyperTransport Interrupt Support
The HyperTransport controller provides 256
interrupt vectors to support Fix
, Arbiter
, and other types of interrupts, but does not provide support for hardware automatic EOI.
For the above two supported types of interrupts, the controller automatically writes to the interrupt register after receiving them and performs interrupt notification to the system interrupt controller according to the setting of the interrupt mask register.
See the description of the interrupt control registers in Interrupt Vector Register for specific interrupt control.
14.3.1. PIC Interrupts
The controller has made special support for PIC interrupts to speed up the processing of this type of interrupt.
A typical PIC interrupt is completed by the following steps:
-
The PIC controller sends a PIC interrupt request to the system.
-
The system sends an interrupt vector query to the PIC controller.
-
The PIC controller sends an interrupt vector number to the system.
-
The system clears the corresponding interrupt on the PIC controller.
Only after all the above 4
steps are completed, the PIC controller will send the next interrupt to the system.
For the Loongson 3A5000 HyperTransport controller, the first 3
steps will be processed automatically and the PIC interrupt vector will be written to the corresponding location in the 256
interrupt vectors.
And after the software system has processed the interrupt, it needs to process step 4, which is to issue a clear interrupt to the PIC controller.
After that, the processing of the next interrupt starts.
14.3.2. Local Interrupts Handling
In the legacy interrupt handling model, all interrupts are stored by the interrupt vector inside the HT controller and then distributed through the interrupt line of the HT controller connected to the interrupt router on the chip. In this case, HT interrupts are only available to CPU cores through a limited number of connections, and cannot be distributed across chips, so the usage scenario is rather limited.
In this HT interrupt mode, when performing interrupt processing, the interrupt router on the chip is transparent to the software and the core goes directly to the interrupt vector of the HT controller (typically 0x90000efdfb000080
) for lookup and then per-bit processing.
At this point, regardless of how the routing mode is configured, all interrupts on the HT controller are read directly.
14.3.3. Extended Interrupts Handling
The extended I/O interrupts implemented in the 3A5000 can greatly increase the flexibility of interrupt distribution and interrupt handling.
In HT’s interrupt expansion mode, interrupts other than PIC interrupts are written directly to the new extended interrupt register on the chip interrupt router, and then routed or distributed according to the relevant configuration of the extended interrupt register.
After using the extended I/O interrupts, the HT controller is transparent to the software when processing the interrupts, and the cores read the interrupt status directly from the extended I/O status register (configuration space 0x1800
) for processing, and each core only reads the interrupt status of the interrupt itself and processes it without interference between different cores.
Interrupt forwarding is performed on the HT controller by enabling the external interrupt transition configuration register.
As described in External Interrupt Conversion Configuration, the software needs to set HT_int_trans
to the target address of the Extended I/O Interrupt Trigger Register.
The address of this register in the 3A5000 is 0x1fe01140
, or 0x10000_00001140
.
Before the kernel can use the extended interrupt processing, it needs to enable the corresponding bit in the “Other function settings register”.
This register has a base address of 0x1fe00000
, It can also be accessed using the configuration register instruction (IOCSR), and an offset address of 0x0420
.
Bit Field | Name | Read/Write | Reset Value | Description |
---|---|---|---|---|
|
|
RW |
|
Extended I/O interrupt enable |
14.4. HyperTransport Address Windows
14.4.1. HyperTransport Space
The default address window distribution of the four HyperTransport interfaces in the Loongson 3A5000 processor is as follows.
Base Address | End Address | Size | Definition |
---|---|---|---|
|
|
|
HT0_LO Window |
|
|
|
HT0_HI Window |
|
|
|
HT1_LO Window |
|
|
|
HT1_HI Window |
By default (no additional system address windows are configured), the software accesses each HyperTransport interface based on the address space described above, and can also access it from other address spaces by configuring the address windows on the cross-switch (see Address Routing Layout and Configuration). The internal 40-bit address space of each HyperTransport interface has the address windows distributed as shown in the table below.
Base Address | end address | Size | Definition |
---|---|---|---|
|
|
|
MEM Space |
|
|
|
Reserved |
|
|
|
Interrupt |
|
|
|
PIC Interrupt Response |
|
|
|
System Information |
|
|
|
Reserved |
|
|
|
HT Controller Configuration Space |
|
|
|
I/O space |
|
|
|
HT Controller Configuration Space |
|
|
|
Reserved |
14.4.2. HyperTransport Controller Internal Window Configuration
The HyperTransport interface of the Loongson 3A5000 processor provides a variety of rich address windows for users to use. The roles and functions of these address windows are described in the following table.
Address Window | Number of windows | Acceptance bus | Role | Remarks |
---|---|---|---|---|
Receive window (See Receive Address Window Configuration Register for window configuration) |
|
HyperTransport |
Determines whether to receive accesses issued on the HyperTransport bus. |
When in master bridge mode (i.e., act_as_slave is 0 in the configuration register), only accesses falling in these address windows will be responded to by the internal bus, and other accesses will be considered as P2P accesses and re-sent back to the HyperTransport bus
When in device mode (i.e., act_as_slave is |
Post window (see POST Address Window Configuration Register for window configuration) |
|
Internal Bus |
Determine whether to treat internal bus write accesses to the HyperTransport bus as Post Write |
External write accesses that fall in these address spaces will be treated as Post Write. Post Write: in HyperTransport protocol, this write access does not need to wait for a write completion response, i.e., the write access completion response to the processor will be made after the controller issues this write access to the bus. |
Prefetchable window (see Prefetchable Address Window Configuration Register for window configuration) |
|
Internal Bus |
Determines whether to receive internal Cache accesses as Fetch instructions accesses. |
When the processor core is executed in a chaotic order, some guess read accesses or fetch accesses are issued to the bus, which are wrong for some I/O spaces. By default, such accesses will be returned directly by the HT controller without accessing the HyperTransport bus. Such accesses to the HyperTransport bus can be enabled through these windows. |
Uncache window (see Uncache Address Window Configuration Register for window configuration) |
|
HyperTransport |
Determine whether to treat accesses on the HyperTransport bus as Uncache accesses to the internal |
The I/O DMA accesses inside the Loongson 3A5000 processor will be accessed as Cache by default and will be determined by the SCache to be hit or miss, thus maintaining its I/O consistency information. The configuration of these windows allows accesses that hit in these windows to access memory directly as Uncache, without maintaining I/O consistency information through hardware. |
14.5. Configuration Register
The configuration register module is mainly used to control the configuration register access requests arriving from the AXI SLAVE
side or the HT RECEIVER
side, to perform external interrupt processing, and to store a large number of software-visible configuration registers used to control the various operating modes of the system.
First of all, the configuration registers used to control the various actions of the HT controller are accessed and stored in this module, and the access offset address of this module is 0xFD_FB00_0000
to 0xFD_FBFF_FFFF
on the HT controller side.
All software visible registers in the HT controller are shown in the following table:
Enable | 0x00 | Device ID | Vendor ID | ||
---|---|---|---|---|---|
|
Status |
Command |
|||
|
Class Code |
Revision ID |
|||
|
BIST |
Header Type |
Latency Timer |
Cache Line Size |
|
|
|||||
|
|||||
|
|||||
|
|||||
|
|||||
|
|||||
|
Cardbus CIS Pointer |
||||
|
Subsystem ID |
Subsystem Vendor ID |
|||
|
Expansion ROM Enable Address |
||||
|
Reserved |
Capabilities Pointer |
|||
|
Reserved |
||||
|
Bridge Control |
Interrupt Pin |
Interrupt Line |
||
Cap 0 PRI |
|
Command |
Capabilities Pointer |
Capability ID |
|
|
Link Config 0 |
Link Control 0 |
|||
|
Link Config 1 |
Link Control 1 |
|||
|
LinkFreqCap0 |
Link Error0/Link Freq 0 |
Revision ID |
||
|
LinkFreqCap1 |
Link Error1/Link Freq 1 |
Feature |
||
|
Error Handling |
Enumeration Scratchpad |
|||
|
Reserved |
Mem Limit Upper |
Mem Enable Upper |
||
Cap 1 Retry |
|
Capability Type |
Reserved |
Capability Pointer |
Capabiliter ID |
|
Status 1 |
Control 1 |
Status 0 |
Control 0 |
|
|
Retry Count 1 |
Retry Count 0 |
|||
CAP 3 |
|
Capability Type |
Revision ID |
Capability Pointer |
Capabiliter ID |
CAP 4 Interrupt |
|
Capability Type |
Index |
Capability Pointer |
Capabiliter ID |
|
Dataport |
||||
|
IntrInfo[31:0] |
||||
|
IntrInfo[63:32] |
||||
Int Vector |
|
INT Vector[31:0] |
|||
|
INT Vector[63:32] |
||||
|
INT Vector[95:64] |
||||
|
INT Vector[127:96] |
||||
|
INT Vector[159:128] |
||||
|
INT Vector[191:160] |
||||
|
INT Vector[223:192] |
||||
|
INT Vector[255:224] |
||||
|
INT Enable[31:0] |
||||
|
INT Enable[63:32] |
||||
|
INT Enable[95:64] |
||||
|
INT Enable[127:96] |
||||
|
INT Enable[159:128] |
||||
|
INT Enable[191:160] |
||||
|
INT Enable[223:192] |
||||
|
INT Enable[255:224] |
||||
CAP 5 Gen3 |
|
Capability Type |
Cap Enum/Index |
Capability Pointer |
Capabiliter ID |
|
Global Link Training |
||||
|
Transmitter Configuration 0 |
||||
|
Receiver Configuration 0 |
||||
|
Link Training 0 |
||||
|
Frequency Extension |
||||
|
Transmitter Configuration 1 |
||||
|
Receiver Configuration 1 |
||||
|
Link Training 1 |
||||
|
BIST Control |
||||
Enable |
|
Device ID |
Vendor ID |
||
|
Status |
Command |
|||
|
Class Code |
Revision ID |
|||
|
BIST |
Header Type |
Latency Timer |
Cache Line Size |
|
|
|||||
|
|||||
|
|||||
|
|||||
|
|||||
|
|||||
|
Cardbus CIS Pointer |
||||
|
Subsystem ID |
Subsystem Vendor ID |
|||
|
Expansion ROM Enable Address |
||||
|
Reserved |
Capabilities Pointer |
|||
|
Reserved |
||||
|
Bridge Control |
Interrupt Pin |
Interrupt Line |
||
Receive Windows |
|
HT RX Enable 0 |
|||
|
HT RX Mask 0 |
||||
|
HT RX Enable 1 |
||||
|
HT RX Mask 1 |
||||
|
HT RX Enable 2 |
||||
|
HT RX Mask 2 |
||||
|
HT RX Enable 3 |
||||
|
HT RX Mask 3 |
||||
|
HT RX Enable 4 |
||||
|
HT RX Mask 4 |
||||
Header Trans |
|
HT RX Header Trans |
|||
|
HT RX EXT Header Trans |
||||
Post Windows |
|
HT TX Post Enable 0 |
|||
|
HT TX Post Mask 0 |
||||
|
HT TX Post Enable 1 |
||||
|
HT TX Post Mask 1 |
||||
Prefetchable Windows |
|
HT TX Prefetchable Enable 0 |
|||
|
HT TX Prefetchable Mask 0 |
||||
|
HT TX Prefetchable Enable 1 |
||||
|
HT TX Prefetchable Mask 1 |
||||
Uncache Windows |
|
HT RX Uncache Enable 0 |
|||
|
HT RX Uncache Mask 0 |
||||
|
HT RX Uncache Enable 1 |
||||
|
HT RX Uncache Mask 1 |
||||
|
HT RX Uncache Enable 2 |
||||
|
HT RX Uncache Mask 2 |
||||
|
HT RX Uncache Enable 3 |
||||
|
HT RX Uncache Mask 3 |
||||
P2P Windows |
|
HT RX P2P Enable 0 |
|||
|
HT RX P2P Mask 0 |
||||
|
HT RX P2P Enable 1 |
||||
|
HT RX P2P Mask 1 |
||||
APP Config |
|
APP Configuration 0 |
|||
|
APP Configuration 1 |
||||
|
RX Bus Value |
||||
|
PHY status |
||||
Buffer |
|
TX Buffer 0 |
|||
|
TX Buffer 1 / Rx buffer hi |
||||
|
TX Buffer turning |
||||
|
RX Buffer lo |
||||
Training |
|
Training 0 Counter Short |
|||
|
Training 0 Counter Long |
||||
|
Training 1 Counter |
||||
|
Training 2 Counter |
||||
|
Training 3 Counter |
||||
PLL |
|
PLL Configuration |
|||
PHY |
|
I/O Configuration |
|||
|
PHY Configuration |
||||
DEBUG |
|
HT3 DEBUG 0 |
|||
|
HT3 DEBUG 1 |
||||
|
HT3 DEBUG 2 |
||||
|
HT3 DEBUG 3 |
||||
|
HT3 DEBUG 4 |
||||
|
HT3 DEBUG 5 |
||||
|
HT3 DEBUG 6 |
||||
POST ID WINDOWS |
|
HT TX POST ID WIN0 |
|||
|
HT TX POST ID WIN1 |
||||
|
HT TX POST ID WIN2 |
||||
|
HT TX POST ID WIN3 |
||||
POST ID WINDOWS |
|
INT TRANS WIN lo |
|||
|
INT TRANS WIN hi |
The specific meaning of each register is shown in the following sections.
14.5.1. Bridge Control Register
Offset: 0x3C
Reset value: 0x00000000
Name: Bus reset control
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
Reserved |
|
|
|
|
|
R/W |
Bus reset control.
|
|
|
|
|
Reserved |
14.5.2. Capability Registers
Offset: 0x40
Reset value: 0x20010008
Name: Command, capabilities pointer, capability ID
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R |
Command format is HOST/Sec |
|
|
|
|
R |
Reserved |
|
|
|
|
R/W |
Provided to the software for recording the current number of Units |
|
|
|
|
HOST mode: can be used to record the number of IDs used SLAVE mode: record own Unit ID HOST/SLAVE mode is controlled by act_as_slave register |
|
|
|
|
|
R |
Next cap register offset address |
|
|
|
|
R |
HyperTransport capability ID |
Offset: 0x44
Reset value: 0x00112000
Name: Link config, link control
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
Sender Width The value after a cold reset is the maximum width of the current connection, the value written to this register will take effect after the next hot reset or HT Disconnect
|
|
|
|
|
Reserved |
|
|
|
|
|
R/W |
Receiver width The value after a cold reset is the maximum width of the current connection, and the value written to this register will take effect after the next hot reset or HT Disconnect |
|
|
|
|
R |
Double-word flow control is not supported on the transmitter side |
|
|
|
|
R |
HT Maximum width of HT bus transmitter: |
|
|
|
|
R |
Receive side does not support double-word flow control |
|
|
|
|
R |
Maximum width of HT bus receiver side: |
|
|
|
|
Reserved |
|
|
|
|
|
R/W |
Whether to turn off HT PHY when HT bus enters HT Disconnect state
|
|
|
|
|
Reserved |
|
|
|
|
|
R/W |
CRC error occurs in high |
|
|
|
|
R/W |
CRC error occurs in low |
|
|
|
|
R/W |
HT PHY Off Control
When in
|
|
|
|
|
R |
HT bus end |
|
|
|
|
R |
Whether HT bus initialization is complete |
|
|
|
|
R |
Indicates connection failure |
|
|
|
|
Reserved |
|
|
|
|
|
R/W |
Whether to flood HT bus when CRC error occurs |
|
|
|
|
R/W |
High
|
Offset: 0x4C
Reset value: 0x80250023
Name: Revision ID, link freq, link error, link freq cap
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R |
HT bus frequency supported, with different values generated depending on the external PLL settings (this bit is meaningless when using the software configuration PLL (
|
|
|
|
|
Reserved |
|
|
|
|
|
R |
HT bus packet overflow |
|
|
|
|
R/W |
Protocol error, meaning an unrecognizable command was received on the HT bus |
|
|
|
|
R/W |
HT bus operating frequency, the value written to this register will take effect after the next thermal reset or HT Disconnect, the value set corresponds to the Link Freq Cap bit (when using software configuration PLL ( |
|
|
|
|
R/W |
Version number: |
Offset: 0x50
Reset value: 0x00000002
Name: Feature capability
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
Reserved |
|
|
|
|
|
R |
No |
|
|
|
|
Reserved |
|
|
|
|
|
R |
Not needed |
|
|
|
|
R |
Not supported |
|
|
|
|
R |
Support LDTSTOP# |
|
|
|
|
R |
Not supported |
14.5.3. Error Retry Control Register
Used for HyerTransport 3.0 mode error retransmission enable, to configure the maximum number of Short Retry, to show whether the Retry counter is flipped or not.
Offset: 0x64
Reset value: 0x00000000
Name: Error retry control register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R |
Reserved |
|
|
|
|
R |
Retry Counter count rollover |
|
|
|
|
R |
Reserved |
|
|
|
|
R/W |
Maximum number of Short Retry allowed |
|
|
|
|
R |
|
|
|
|
|
R/W |
Error reconnect function enable control |
14.5.4. Retry Count Register
Offset: 0x68
Reset value: 0x00000000
Name: Retry count register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R |
Reserved |
|
|
|
|
R |
Retry count |
14.5.5. Revision ID Register
Used to configure the controller version, configure it to a new version number and take effect via Warm Reset.
Offset: 0x6C
Reset value: 0x00200000
Name: Revision ID register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R |
Reserved |
|
|
|
|
R/W |
Revision ID control register.
|
|
|
|
|
R |
Reserved |
14.5.6. Interrupt Discovery and Configuration
Offset: 0x70
Reset value: 0x80000008
Name: Interrupt capability
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R |
Interrupt discovery and configuration block |
|
|
|
|
R/W |
Read register offset address |
|
|
|
|
R |
Capabilities Pointer |
|
|
|
|
R |
Hypertransport Capablity ID |
Offset: 0x74
Reset value: 0x00000000
Name: Dataport
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
When the previous register Index is |
Offset: 0x78
Reset value: 0xF8000000
Name: IntrInfo[31:0]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R |
Reserved |
|
|
|
|
R/W |
IntrInfo[23:2] When a PIC interrupt is issued, the value of IntrInfo is used to represent the interrupt vector |
|
|
|
|
R |
Reserved |
Offset: 0x7c
Reset value: 0x00000000
Name: IntrInfo[63:32]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R |
Reserved |
14.5.7. Interrupt Vector Register
There are 256
interrupt vector registers, among which Fix
, Arbiter
and PIC interrupts on the HT bus are directly mapped to these 256
interrupt vectors, while other interrupts such as SMI
, NMI
, INIT
, INTA
, INTB
, INTC
, INTD
can be mapped to any 8-bit interrupt vector through register 0x50[28:24]
.
The mapping order is {INTD, INTC, INTB, INTA, 1’b0, INIT, NMI, SMI}
.
The corresponding value of the interrupt vector is {Interrupt Index, internal vector [2:0]}
.
By default, 256-bit interrupts can be distributed to 4-bit interrupt lines.
When not using interrupts from the high 8-bit HT controller, 256-bit interrupts can also be distributed to 8-bit interrupt lines by setting ht_int_8bit
.
The 256 interrupt vectors are mapped to different interrupt lines by selecting different register configurations according to the interrupt routing method as follows:
Number of interruptions | Strip | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
---|---|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
As an example of using a 4-bit interrupt line, the different mappings are as follows.
ht_int_stripe_1
:
[0,1,2,3……63]
Corresponding to interrupted line 0
/ HT HI Corresponding to interrupted line 4
[64,65,66,67……127]
Corresponding interrupt line 1
/ HT HI Corresponding interrupt line 5
[128,129,130,131 ……191]
corresponds to interrupted line 2
/ HT HI corresponds to interrupted line 6
[192,193,194,195 ……255]
corresponds to the broken line 3
/ HT HI corresponds to the broken line 7
ht_int_stripe_2
:
[0,2,4,6 ……126]
corresponds to interrupt line 0
/ HT HI corresponds to interrupt line 4
[1,3,5,7 ……127]
corresponds to interrupt line 1
/ HT HI corresponds to interrupt line 5
[128,130,132,134 ……254]
corresponds to interrupted line 2
/ HT HI corresponds to interrupted line 6
[129,131,133,135 ……255]
corresponds to the interrupt line 3
/ HT HI corresponds to the interrupt line 7
ht_int_stripe_4
:
[0,4,8,12 ……252]
corresponds to interrupt line 0
/ HT HI corresponds to interrupt line 4
[1,5,9,13 ……253]
corresponds to interrupt line 1
/ HT HI corresponds to interrupt line 5
[2,6,10,14 ……254]
corresponds to interrupted line 2
/ HT HI corresponds to interrupted line 6
[3,7,11,15 ……255]
corresponds to interrupted line 3
/ HT HI corresponds to interrupted line 7
The following description of the interrupt vector corresponds to ht_int_stripe_1
, the other two ways can be obtained from the above description.
Offset: 0x80
Reset value: 0x00000000
Name: HT bus interrupt vector register [31:0]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus interrupt vector register |
Offset: 0x84
Reset value: 0x00000000
Name: HT bus interrupt vector register[63:32]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus interrupt vector register |
Offset: 0x88
Reset value: 0x00000000
Name: HT Bus Interrupt Vector Register [95:64]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus interrupt vector register |
Offset: 0x8c
Reset value: 0x00000000
Name: HT bus interrupt vector register [127:96]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus interrupt vector register |
Offset: 0x90
Reset value: 0x00000000
Name: HT bus interrupt vector register [159:128]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus interrupt vector register |
Offset: 0x94
Reset value: 0x00000000
Name: HT bus interrupt vector register [191:160]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus interrupt vector register |
Offset: 0x98
Reset value: 0x00000000
Name: HT bus interrupt vector register [223:192]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus interrupt vector register |
Offset: 0x9c
Reset value: 0x00000000
Name: HT bus interrupt vector register [255:224]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus interrupt vector register |
14.5.8. Interrupt Enable Register
There are 256 interrupt enable registers, which correspond to the interrupt vector registers.
The interrupt enable register is set to 1
to turn on the corresponding interrupt, and set to 0
to mask the interrupt.
The 256
interrupt vectors are mapped to different interrupt lines according to the configuration of the interrupt routing registers, as follows:
ht_int_stripe_1
:
[0,1,2,3……63]
Corresponding interrupted line 0
/ HT HI Corresponding interrupted line 4
[64,65,66,67……127]
Corresponding interrupted line 1
/ HT HI Corresponding interrupted line 5
[128,129,130,131……191]
Corresponding interrupted line 2
/ HT HI Corresponding interrupted line 6
[192,193,194,195……255]
Corresponding interrupted line 3
/ HT HI Corresponding interrupted line 7
ht_int_stripe_2
:
[0,2,4,6……126]
Corresponding interrupted line 0
/ HT HI Corresponding interrupted line 4
[1,3,5,7……127]
Corresponding interrupted line 1
/ HT HI Corresponding interrupted line 5
[128,130,132,134……254]
Corresponding interrupted line 2
/ HT HI Corresponding interrupted line 6
[129,131,133,135……255]
Corresponding interrupted line 3
/ HT HI Corresponding interrupted line 7
ht_int_stripe_4
:
[0,4,8,12……252]
Corresponding interrupted line 0
/ HT HI Corresponding interrupted line 4
[1,5,9,13……253]
Corresponding interrupted line 1
/ HT HI Corresponding interrupted line 5
[2,6,10,14……254]
Corresponding interrupted line 2
/ HT HI Corresponding interrupted line 6
[3,7,11,15……255]
Corresponding interrupted line 3
/ HT HI Corresponding interrupted line 7
The following description of the interrupt vector corresponds to ht_int_stripe_1
, the other two ways can be obtained from the above description.
Offset: 0xa0
Reset value: 0x00000000
Name: HT Bus Interrupt Enable Register [31:0]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus interrupt enable register |
Offset: 0xa4
Reset value: 0x00000000
Name: HT Bus Interrupt Enable Register [63:32]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus interrupt enable register |
Offset: 0xa8
Reset value: 0x00000000
Name: HT Bus Interrupt Enable Register [95:64]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus interrupt enable register |
Offset: 0xac
Reset value: 0x00000000
Name: HT Bus Interrupt Enable Register [127:96]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HHT bus interrupt enable register |
Offset: 0xb0
Reset value: 0x00000000
Name: HT Bus Interrupt Enable Register [159:128]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus interrupt enable register |
Offset: 0xb4
Reset value: 0x00000000
Name: HT Bus Interrupt Enable Register[191:160]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus interrupt enable register |
Offset: 0xb8
Reset value: 0x00000000
Name: HT Bus Interrupt Enable Register [223:192]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus interrupt enable register |
Offset: 0xbc
Reset value: 0x00000000
Name: HT Bus Interrupt Enable Register [255:224]
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus interrupt enable register |
14.5.9. Link Train Register
HyperTransport 3.0 Link initialization and link training control registers.
Offset: 0xD0
Reset value: 0x00000070
Name: Link train register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R |
Reserved |
|
|
|
|
R/W |
Link status of the sender in Disconnected or Inactive state.
|
|
|
|
|
R/W |
In HyperTransport 3.0 mode, only one Non-info CMD can appear in any four consecutive DWSs by default.
|
|
|
|
|
R |
Reserved |
|
|
|
|
R/W |
Link status of the receiving end in Disconnected or Inactive state.
|
|
|
|
|
R/W |
Long Retry Maximum number of times |
|
|
|
|
R/W |
Enable or disable Scramble
|
|
|
|
|
R/W |
Whether to enable
|
|
|
|
|
R |
Whether AC mode is detected
|
|
|
|
|
R |
Reserved |
14.5.10. Receive Address Window Configuration Register
The formula for hitting the address window in the HT controller is as follows:
hit = ( BASE & MASK ) == ( ADDR & MASK )
addr_out_trans = TRANS_EN ? TRANS | ADDR & ~MASK : ADDR
addr_out = Multi_node_en ?
addr_out_trans[39:37], addr_out_trans[43:40], 3'b0,addr_out[36:0]:
addr_out_trans
It should be noted that when configuring the address window register, the high bits of MASK
should be all 1s and the low bits should be all 0
values.
The actual number of bits of 0
in MASK
indicates the size of the address window.
The address of the receive address window is the address received on the HT bus. HT addresses that fall within the P2P window will be forwarded back to the HT bus as P2P commands, HT addresses that fall within the normal receive window and are not in the P2P window will be sent to the CPU, and commands for other addresses will be forwarded back to the HT bus as P2P commands.
Offset: 0x140
Reset value: 0x00000000
Name: HT bus receive address window 0 enable (external access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus receives address window 0, enable signal |
|
|
|
|
R/W |
HT bus receive address window 0, map enable signal |
|
|
|
|
R/W |
HT bus receive address window 0, multi-node address mapping enable Convert |
|
|
|
|
R/W |
HT bus receive address window 0, protocol address hit enable. Must be set to 0 |
|
|
|
|
R/W |
HT bus receive address window 0, |
Offset: 0x144
Reset value: 0x00000000
Name: HT bus receive address window 0 base address (external access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus receive address window 0, address base address of |
|
|
|
|
R/W |
HT bus receive address window 0, address mask of |
Offset: 0x148
Reset value: 0x00000000
Name: HT bus receive address window 1 enable (external access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus receives address window 1, enable signal |
|
|
|
|
R/W |
HT bus receive address window 1, mapping enable signal |
|
|
|
|
R/W |
HT bus receive address window 1, multi-node address mapping enable. Convert |
|
|
|
|
R/W |
HT bus receive address window 1, protocol address hit enable. Must be set to 0 |
|
|
|
|
R/W |
HT bus receive address window 1, |
Offset: 0x14c
Reset value: 0x00000000
Name: HT bus receive address window 1 base address (external access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus receive address window 1, |
|
|
|
|
R/W |
HT bus receive address window 1, address mask of |
Offset: 0x150
Reset value: 0x00000000
Name: HT bus receive address window 2 enable (External Access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus receives address window 2, enable signal |
|
|
|
|
R/W |
HT bus receive address window 2, mapping enable signal |
|
|
|
|
R/W |
HT bus receive address window 2, multi-node address mapping enable. Convert |
|
|
|
|
R/W |
HT bus receive address window 2, protocol address hit enable. Must be set to |
|
|
|
|
R/W |
HT bus receive address window 2, |
Offset: 0x154
Reset value: 0x00000000
Name: HT bus receive address window 2 base address (external access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus receive address window 2, address base address of |
|
|
|
|
R/W |
HT bus receive address window |
Offset: 0x158
Reset value: 0x00000000
Name: HT bus receive address window 3 enable (external access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus receives address window 3, enable signal |
|
|
|
|
R/W |
HT bus receive address window 3, mapping enable signal |
|
|
|
|
R/W |
HT bus receive address window 3, multi-node address mapping enable. Convert |
|
|
|
|
R/W |
HT bus receive address window 3, protocol address hit enable. Must be set to |
|
|
|
|
R/W |
HT bus receive address window 3, |
Offset: 0x15C
Reset value: 0x00000000
Name: HT bus receive address window 3 base address (external access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus receive address window 3, address base address of |
|
|
|
|
R/W |
HT bus receive address window 3, address masked |
Offset: 0x160
Reset value: 0x00000000
Name: HT bus receive address window 4 enable (external access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus receives address window 4, enable signal |
|
|
|
|
R/W |
HT bus receive address window 4, map enable signal |
|
|
|
|
R/W |
HT bus receive address window 4, multi-node address mapping enable. Convert |
|
|
|
|
R/W |
HT bus receive address window 4, protocol address hit enable. Must be set to |
|
|
|
|
R/W |
HT bus receive address window 4, |
Offset: 0x164
Reset value: 0x00000000
Name: HT bus receive address window 4 base address (external access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus receive address window 4, address base address of |
|
|
|
|
R/W |
HT bus receive address window 4, address masked |
14.5.11. Space Conversion Configuration Register
Used to perform various transformations of the HT’s configuration space.
Offset: 0x168
Reset value: 0x00000000
Name: Configuration space extension address translation
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
Adjust the converted address type1 flag bit of the configuration space ( |
|
|
|
|
R/W |
Enable the high address ( |
|
|
|
|
R/W |
High address |
Offset: 0x16C
Reset value: 0x00000000
Name: Extended address translation
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
Enables the high address ( |
|
|
|
|
R/W |
High address |
14.5.12. POST Address Window Configuration Register
The address window hit formula is detailed in Receive Address Window Configuration Register.
The address in this window is the address received on the AXI bus.
All write accesses that land in this window will be returned immediately on the AXI B
channel and sent to the HT bus in the POST WRITE
command format.
Write requests not in this window, on the other hand, are sent to the HT bus in NONPOST WRITE
format and wait for the HT bus response before returning to the AXI bus.
Offset: 0x170
Reset value: 0x00000000
Name: HT bus POST address window 0 enable (internal access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus POST address window 0, enable signal |
|
|
|
|
R/W |
HT access unpacking enable (corresponds to the external uncache ACC operation window of the CPU core) |
|
|
|
|
Reserved |
|
|
|
|
|
R/W |
HT bus POST address window 0, |
Offset: 0x174
Reset value: 0x00000000
Name: HT bus POST address window 0 base address (internal access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus POST address Window 0, address base address of |
|
|
|
|
R/W |
HT bus POST address window 0, address masked |
Offset: 0x178
Reset value: 0x00000000
Name: HT bus POST address window 1 enable (internal access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus POST address window 1, enable signal |
|
|
|
|
R/W |
HT access unpacking enable (corresponds to the external uncache ACC operation window of the CPU core) |
|
|
|
|
Reserved |
|
|
|
|
|
R/W |
HT bus POST address window 1, |
Offset: 0x17c
Reset value: 0x00000000
Name: HT bus POST address window 1 base address (internal access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus POST address window 1, address base address of |
|
|
|
|
R/W |
HT bus POST address window 1, |
14.5.13. Prefetchable Address Window Configuration Register
The address window hit formula is detailed in Receive Address Window Configuration Register.
The address in this window is the address received on the AXI bus. Fetch instructions and Cache accesses that land in this window are only sent to the HT bus. Other fetch or Cache accesses will not be sent to the HT bus, but will be returned immediately, or in the case of read instructions, the corresponding number of invalid reads.
Offset: 0x180
Reset value: 0x00000000
Name: HT bus prefetchable address window 0 enable (Internal Access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus prefetchable address window 0, enable signal |
|
|
|
|
R/W |
Reserved |
|
|
|
|
R/W |
HT bus prefetchable address window 0, |
Offset: 0x184
Reset value: 0x00000000
Name: HT bus prefetchable address window 0 base address (internal access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus prefetches address window 0, address base address of |
|
|
|
|
R/W |
HT bus prefetchable address window 0, |
Offset: 0x188
Reset value: 0x00000000
Name: HT bus prefetchable address window 1 enable (internal access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus prefetchable address window 1, enable signal |
|
|
|
|
Reserved |
|
|
|
|
|
R/W |
HT bus prefetchable address window 1, |
Offset: 0x18c
Reset value: 0x00000000
Name: HT bus prefetchable address window 1 base address (internal access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus prefetchable address window 1, address base address of |
|
|
|
|
R/W |
HT bus prefetchable address window 1, address masked |
14.5.14. Uncache Address Window Configuration Register
The address window hit formula is detailed in Receive Address Window Configuration Register.
The address of this window is the address received on the HT bus. A read or write command that lands in this window will not be sent to SCache and will not invalidate the first-level Cache, but will be sent directly to memory or other address space, i.e., the read or write command in this address window will not maintain Cache consistency of the I/O. This window is mainly for some operations that will not hit in Cache and therefore can improve the efficiency of accessing memory, such as accessing video memory.
Offset: 0x190
Reset value: 0x00000000
Name: HT bus uncache address window 0 enable (internal access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus uncache address window 0, enable signal |
|
|
|
|
R/W |
HT bus uncache address window 0, mapping enable signal |
|
|
|
|
R/W |
HT bus uncache receive address window 0, multi-node address mapping enable |
|
|
|
|
R/W |
HT bus uncache receive address window 0, protocol address hit enable |
|
|
|
|
R/W |
HT bus uncache address window 0, |
Offset: 0x194
Reset value: 0x00000000
Name: HT bus uncache address window 0 base address (internal access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus uncache address window 0, address base address of |
|
|
|
|
R/W |
HT bus uncache address window 0, address masked |
Offset: 0x198
Reset value: 0x00000000
Name: HT bus uncache address window 1 enabled (internal access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus uncache address window 1, enable signal |
|
|
|
|
R/W |
HT bus uncache address window 1, mapping enable signal |
|
|
|
|
R/W |
HT bus uncache receive address window 1, multi-node address mapping enable |
|
|
|
|
R/W |
HT bus uncache receive address window 1, protocol address hit enable |
|
|
|
|
R/W |
HT bus uncache address window 1, |
Offset: 0x19c
Reset value: 0x00000000
Name: HT bus uncache address window 1 base address (internal access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus uncache address window 1, address base address of |
|
|
|
|
R/W |
HT bus uncache address window 1, |
Offset: 0x1A0
Reset value: 0x00000000
Name: HT bus uncache address window 2 enable (internal access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus uncache address window 2, enable signal |
|
|
|
|
R/W |
HT bus uncache address window 2, mapping enable signal |
|
|
|
|
R/W |
HT bus uncache receive address window 2, multi-node address mapping enable |
|
|
|
|
R/W |
HT bus uncache receive address window 2, protocol address hit enable |
|
|
|
|
R/W |
HT bus uncache address window 2, |
Offset: 0x1A4
Reset value: 0x00000000
Name: HT bus uncache address window 2 base address (internal access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus uncache address window 2, address base address of |
|
|
|
|
R/W |
HT bus uncache address window 2, address masked |
Offset: 0x1A8
Reset value: 0x00000000
Name: HT bus uncache address window 3 enabled (internal access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus uncache address window 3, enable signal |
|
|
|
|
R/W |
HT bus uncache address window 3, mapping enable signal |
|
|
|
|
R/W |
HT bus uncache receive address window 3, multi-node address mapping enable |
|
|
|
|
R/W |
HT bus uncache receive address window 3, protocol address hit enable |
|
|
|
|
R/W |
HT bus uncache address window 3, |
Offset: 0x1AC
Reset value: 0x00000000
Name: HT Bus uncache address window 3 base address (internal sccess)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus uncache address window 3, address base address of |
|
|
|
|
R/W |
HT bus uncache address window 3, address masked |
14.5.15. P2P Address Window Configuration Register
The address window hit formula is detailed in Receive Address Window Configuration Register.
The address of this window is the address received on the HT bus. The read and write commands that land on the address of this window are forwarded directly back to the bus as P2P commands, and this window has the highest priority compared to the normal receive window and the uncache window.
Offset: 0x1B0
Reset value: 0x00000000
Name: HT bus P2P address window 0 enable (external access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus P2P address window 0, enable signal |
|
|
|
|
R/W |
HT bus P2P address window 0, |
Offset: 0x1B4
Reset value: 0x00000000
Name: HT bus P2P address window 0 base address (external access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus P2P address window 1, address base address of |
|
|
|
|
R/W |
HT bus P2P address window 1, address masked |
Offset: 0x1B8
Reset value: 0x00000000
Name: HT bus P2P address window 1 enable (external access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus P2P address window 1, enable signal |
|
|
|
|
R/W |
HT bus P2P address window 1, |
Offset: 0x1BC
Reset value: 0x00000000
Name: HT bus P2P address window 1 base address (external access)
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
HT bus P2P address window 1, address base address of |
|
|
|
|
R/W |
HT bus P2P address window 1, address masked |
14.5.16. Controller Parameter Configuration Register
Offset: 0x1C0
Reset value: 0x00904321
Name: APP CONFIG 0
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
Reserved |
|
|
|
|
|
R/W |
Putting the bus into The correct way is: |
|
|
|
|
R/W |
Wake up HT bus from The correct way is to set In addition, a direct read/write request to the bus can also wake up the bus automatically |
|
|
|
|
R/W |
Enable cad and ctl for sample input, displayed in the |
|
|
|
|
R/W |
For 32/64/128/256-bit MEM write access, whether to use the Dword Write command format (Byte Write method of writing will be converted to 128-bit write with |
|
|
|
|
R/W |
For configuration space write access, whether to use the Dword Write command format (Byte Write method of writing will be converted to 128-bit write with |
|
|
|
|
R/W |
For I/O space write access, whether to use the Dword Write command format (Byte Write method of writing will be converted to 128-bit write with |
|
|
|
|
RW |
Whether to reset the size of the 128-bit write with |
|
|
|
|
RW |
Whether it is processor consistency mode, the initial value is determined by the |
|
|
|
|
RW |
Consistency mode, split all packets into |
|
|
|
|
R/W |
Whether the receiver does not care about HT sequential relations |
|
|
|
|
R/W |
Configure Seqid issued by HT bus when |
|
|
|
|
R/W |
HT bus Nop flow control packet priority |
|
|
|
|
R/W |
Non Post channel read/write priority |
|
|
|
|
R/W |
Response channel read/write priority |
|
|
|
|
R/W |
Post channel read/write priority
For each channel priority are used according to the time change to increase the priority policy, the group memory is used to configure the initial priority of each channel |
Offset: 0x1C4
Reset value: 0x00904321
Name: APP CONFIG1
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
Enable write unwrapping when the tx post ID window hits (all write requests that cross a 32-byte bound are split into two consecutive write requests (byte write)) |
|
|
|
|
R/W |
Set the |
|
|
|
|
R/W |
Set the |
|
|
|
|
R/W |
Set the |
|
|
|
|
R/W |
When the sender encounters a write request with the same |
|
|
|
|
R/W |
When the sender encounters a read request with the same |
|
|
|
|
R/W |
Disable the conversion of write request |
|
|
|
|
R/W |
Disable the conversion of |
|
|
|
|
R/W |
Reserved |
|
|
|
|
R/W |
Set |
|
|
|
|
R/W |
Disable access to the configuration register space at the receiving end |
|
|
|
|
R/W |
Used to control the random delay range of Rrequest transmission in consistency mode
|
|
|
|
|
R/W |
Enable interrupt sending on CRC error |
|
|
|
|
R/W |
Interrupt pin selection in case of CRC interrupt |
|
|
||||
|
|
|
|
R/W |
Use of |
|
|
|
|
R/W |
Corresponding to the
|
|
|
|
|
R/W |
Which interrupt vector to redirect interrupts other than standard interrupts (including There are
|
14.5.17. Receive Diagnostic Register
Offset: 0x1C8
Reset value: 0x00000000
Name: Receive diagnostic register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
Save the sampled value of input |
|
|
|
|
R/W |
Save the input
|
|
14.5.18. PHY Status Register
Used to observe the PHY-related status and debug.
Offset: 0x1CC
Reset value: 0x83308000
Name: PHY status register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R |
Reserved |
|
|
|
|
R |
High |
|
|
|
|
R |
Low |
|
|
|
|
R |
High |
|
|
|
|
R |
Low |
|
|
|
|
R |
Phase Lock |
|
|
|
|
R |
PHY Status |
|
|
|
|
R |
|
|
|
|
|
R |
|
|
|
|
|
R |
Initialization complete |
|
|
|
R |
Reserved |
14.5.19. Transport Command Cache Size Register
The Command Send Cache Size register is used to observe the number of caches available on the transmitter for each command channel.
Offset: 0x1D0
Reset value: 0x00000000
Name: Command send Cache size register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R |
Number of |
|
|
|
|
R |
Number of |
|
|
|
|
R |
Number of sender |
|
|
|
|
R |
Number of sender |
14.5.20. Transport Data Cache Size Register
The data send Cache size register is used to observe the number of caches available on the transmitter for each data channel.
Offset: 0x1D4
Reset value: 0x00000000
Name: Data send buffer size register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R |
Reserved |
|
|
|
|
R/W |
Bit |
|
|
|
|
R/W |
Bit |
|
|
|
|
R/W |
Bit |
|
|
|
|
R/W |
Bit |
|
|
|
|
R/W |
Bit |
|
|
|
|
R/W |
Bit |
|
|
|
|
R/W |
Bit |
|
|
|
|
R |
Number of |
|
|
|
|
R |
Number of |
|
|
|
|
R |
Number of |
14.5.21. Transport Cache Debug Register
The transmit buffer debug register is used to manually set the number of buffers on the transmit side of the HT controller and to adjust the number of different transmit buffers by increasing or decreasing.
Offset: 0x1D8
Reset value: 0x00000000
Name: Send Cache debug register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
Consistent mode to enable interleaved transmission between channel |
|
|
|
|
R/W |
Enables interleaved transmission of flow control packets with other virtual channels |
|
|
|
|
R/W |
Sender Cache debug symbols
|
|
|
|
|
R/W |
Sender Cache debug enable register
|
|
|
|
|
R/W |
Increase or decrease the number of R channel data Cache at the transmitter. When When |
|
|
|
|
R/W |
Increase or decrease the number of R channel data Cache at the transmitter. When tx_neg is When tx_neg is |
|
|
|
|
R/W |
Increase or decrease the number of PC channel data Cache at the transmitter. When tx_neg is When tx_neg is |
|
|
|
|
R/W |
Increase or decrease the number of B channel command Cache at the transmitter. When tx_neg is When tx_neg is |
|
|
|
|
R/W |
Increase or decrease the number of R channel command Cache on the transmitter side. When tx_neg is When tx_neg is |
|
|
|
|
R/W |
Increase or decrease the number of NPC channel command/data Cache on the transmitter side. When tx_neg is When tx_neg is |
|
|
|
|
R/W |
Increase or decrease the number of PC channel command Cache on the transmitter side. When tx_neg is When tx_neg is |
14.5.22. Receive Buffer Initialization Configuration Register
Offset: 0x1DC
Reset value: 0x07778888
Name: Receive buffer initialization configuration register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
Read data buffer initialization information of the receive buffer |
|
|
|
|
R/W |
Npc data buffer initialization information of the receive buffer |
|
|
|
|
R/W |
Receive buffer initialization information for pc data buffer |
|
|
|
|
R/W |
Receive the bresponse command buffer initialization information of the buffer |
|
|
|
|
R/W |
Receive the read command buffer initialization information of the buffer |
|
|
|
|
R/W |
Npc command buffer initialization information of the receive buffer |
|
|
|
|
R/W |
Receive the pc command buffer initialization information of the buffer |
14.5.23. Training 0 Timeout Short Counter Register
Used to configure the Training 0 short timing timeout threshold in HyerTransport 3.0 mode, with a counter clock frequency of 1/4
of the HyperTransport 3.0 link bus clock frequency.
Offset: 0x1E0
Reset value: 0x00000080
Name: Training 0 timeout short counter register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
|
|
|
|
|
R/W |
|
|
|
|
|
R/W |
Training 0 timeout short counter register |
14.5.24. Training 0 Timeout Long Counter Register
Used in HyerTransport 3.0 mode Training 0 long count timeout threshold with counter clock frequency 1/4
of HyperTransport 3.0 link bus clock frequency.
Offset: 0x1E4
Reset value: 0x000fffff
Name: Training 0 timeout count register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
Training 0 timeout long counter register |
14.5.25. Training 1 Counter Register
For HyerTransport 3.0 mode Training 1 count threshold, the counter clock frequency is 1/4
of the HyperTransport 3.0 link bus clock frequency.
Offset: 0x1E8
Reset value: 0x0004fffff
Name: Training 1 counter register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
Training 1 counter register |
14.5.26. Training 2 Counter Register
For the Training 2 count threshold in HyerTransport 3.0 mode, the counter clock frequency is 1/4
of the HyperTransport 3.0 link bus clock frequency.
Offset: 0x1EC
Reset value: 0x0007fffff
Name: Training 2 counter register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
Training |
14.5.27. Training 3 Counter Register
For the Training 3 count threshold in HyerTransport 3.0 mode, the counter clock frequency is 1/4
of the HyperTransport 3.0 link bus clock frequency.
Offset: 0x1F0
Name: Training 3 counter register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
Training 3 counter register |
14.5.28. Software Frequency Configuration Register
The controller is used to switch to the link frequency and controller frequency supported by any protocol and PLL during operation; the specific switching method is: under the premise of enabling software configuration mode, set bit 1
of the software frequency configuration register and write the new clock-related parameters, including div_refc
and div_loop
, which determine the PLL output frequency, the link div_hi_div
and phy_lo_div
, and the controller’s divide factor core_div
.
The controller will automatically reset the PLL and configure the new clock parameters by entering warm reset or LDT
disconnect.
PHY_LINK_CLK
is the HT bus frequency.
The clock frequency is calculated by the formula:
When using SYS_CLOCK
as the reference clock input and SYS_CLOCK
is 25MHz
(CLKSEL[8]
is 1
and CLKSEL[5]
is 1
), the frequency is calculated as follows:
HyperTransport 1.0:
PHY_LINK_CLK = 12.5MHz × div_loop / div_refc / phy_div
HyperTransport 3.0:
PHY_LINK_CLK = 25MHz × div_loop / div_refc / phy_div
In other cases, the frequency is calculated as:
HyperTransport 1.0:
PHY_LINK_CLK = 50MHz × div_loop / div_refc / phy_div
HyperTransport 3.0:
PHY_LINK_CLK = 100MHz × div_loop / div_refc / phy_div
The wait time for PLL re-lock is approximately 30us
by default with system clk at 33M
; a custom wait count limit can also be written into the register.
Note that in the 3A5000, HT_CORE_CLK
is no longer controlled by this configuration, but by the NODE clock divider.
Offset: 0x1F4
Reset value: 0x00000000
Name: Software frequency configuration register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
Counter limit configuration register, when set counter select, the counter limit is |
|
|
|
|
R/W |
Lock Timer Custom Enable.
|
|
|
|
|
R |
Reserved |
|
|
|
|
R/W |
PLL internal frequency multiplication factor |
|
|
|
|
R/W |
PLL internal dividing factor |
|
|
|
|
R/W |
High PHY frequency division factor |
|
|
|
|
R/W |
Low PHY frequency division factor |
|
|
|
|
R |
Lock Flag |
|
|
|
|
R |
Reserved |
|
|
|
|
R/W |
Software configuration enable bit.
|
|
|
|
|
R |
Reserved |
14.5.29. PHY Impedance Matching Control Register
Used to control the impedance matching enable of the PHY and the impedance matching parameter setting of the transmitter and receiver.
Offset: 0x1F8
Reset value: 0x00000000
Name: PHY impedance matching control register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
|
|
|
|
|
R/W |
|
|
|
|
|
R/W |
|
|
|
|
|
R/W |
|
|
|
|
|
R/W |
|
14.5.30. PHY Configuration Register
Used to configure PHY related physical parameters, when the controller is two independent 8-bit controllers, the high PHY and low PHY are controlled independently by the two controllers. When the controller is one 16-bit controller, the configuration parameters of the high and low PHY are unified by the low controller.
Offset: 0x1FC
Reset value: 0x83308000
Name: PHY configuration register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
PLL to |
|
|
|
|
R/W |
PLL to |
|
|
|
|
R/W |
Clock
|
|
|
|
|
R/W |
Clock selection used to lock the
|
|
|
|
|
R/W |
PAD EQD high frequency gain |
|
|
|
|
R/W |
PAD EQD low frequency gain |
|
|
|
|
R/W |
PAD EQD compensation limit |
|
|
|
|
R/W |
LDO Control
|
|
|
|
|
R/W |
BandGap control
|
|
|
|
|
R |
Reserved |
|
|
|
|
R/W |
PAD pre-emphasis control signal |
|
|
|
|
R |
Reserved |
14.5.31. Link Initialization Debug Register
Used to configure whether to use the CDRlock
signal provided by the PHY as the link CDR completion flag during link initialization in HyperTransport 3.0 mode.
If the lock signal is ignored, the controller is required to count and wait for a certain amount of time before the default CDR is completed.
Offset: 0x240
Reset value: 0x00000000
Name: Link initialization debug register
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
Whether to ignore CRC lock during link initialization and wait for completion by counter count.
|
|
|
|
|
R/W |
Wait for the counter count limit and finish counting based on the controller clock |
14.5.32. LDT Debug Register
Software changes to the controller frequency will result in inaccurate timing of the LDT reconnect phase. The counter needs to be configured as the time between the invalidation of the LDT signal and the start of link initialization of the controller after the software configuration of the frequency, which is based on the controller clock.
Offset: 0x244
Reset value: 0x00000000
Name: LDT Debug register 1
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
The |
|
|
|
|
R/W |
The |
Offset: 0x248
Reset value: 0x00000000
Name: LDT Debug register 2
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
|
|
|
|
|
R/W |
Offset: 0x24C
Reset value: 0x00000000
Name: LDT Debug register 3
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
|
|
|
|
|
R/W |
Offset: 0x250
Reset value: 0x00000000
Name: LDT Debug register 4
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
|
|
|
|
|
R/W |
Offset: 0x254
Reset value: 0x00000000
Name: LDT Debug register 5
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
|
|
|
|
|
R/W |
|
|
|
|
|
R/W |
Offset: 0x258
Reset value: 0x00000000
Name: LDT Debug register 6
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
14.5.33. HT TX POST ID Window Configuration Register
This window sends hit requests outbound through the HT POST channel by comparing the ID of the internal write request to a pre-defined window.
Offset: 0x260
Reset value: 0x00000000
Name: HT TX POST ID WIN0
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
|
|
|
|
|
R/W |
|
Offset: 0x264
Reset value: 0x00000000
Name: HT TX POST ID WIN1
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
|
|
|
|
|
R/W |
|
Offset: 0x268
Reset value: 0x00000000
Name: HT TX POST ID WIN2
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
|
|
|
|
|
R/W |
|
Offset: 0x26C
Reset value: 0x00000000
Name: HT TX POST ID WIN3
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
|
|
|
|
|
R/W |
|
14.5.34. External Interrupt Conversion Configuration
This setting converts an interrupt received by the HT into a write operation to a specific address that is written directly to the extended I/O interrupt vector inside the chip, rather than generating an interrupt inside the HT controller. With this approach, advanced features such as direct cross-chip distribution of I/O interrupts can be used.
Offset: 0x270
Reset value: 0x00000000
Name: HT RX INT TRANS Lo
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
Low order bits of interrupt translation address |
|
Reserved |
|
|
R |
Reserved |
Offset: 0x274
Reset value: 0x00000000
Name: HT RX INT TRANS Hi
Bit Field | Name | Length | Reset Value | Read/Write | Description |
---|---|---|---|---|---|
|
|
|
|
R/W |
Interrupt transition enable |
|
|
|
|
R/W |
Whether to allow interrupt transition This bit is set for |
|
|
|
|
R/W |
Interrupt Transition |
|
|
|
|
R/W |
High order bits of interrupt translation address |
14.6. Access to HyperTransport Bus Configuration Space
The protocol for the HyperTransport interface software layer is basically the same as the PCI protocol, with slightly different specific access details as the access to the configuration space is directly related to the underlying protocol.
As listed in Address window distribution inside the HyperTransport interface of the Loongson 3 processor, the address range of the HT bus configuration space is 0xFD_FE00_0000
to 0xFD_FFFF_FFFF
.
For the configuration access in the HT protocol, the following format is used in the Loongson 3A5000:
14.7. HyperTransport Multi-processor Support
The loongson3 processor uses the HyperTransport interface for multiprocessor interconnects and can automatically maintain consistency requests between 2
-8
chips in hardware.
Loongson 3 Interconnect Routing
Loongson 3 interconnect routing has two methods, one is to use the simple X
-Y
routing method.
If a request is sent from 11
to 00
, it is routed from 11
to 00
, first in the X
direction, from 11
to 10
, and then in the Y
direction, from 10
to 00
.
When its response returns from 00
to 11
, it is routed first in the X
direction, from 00
to 01
, and then in the Y
direction, from 01
to 11
.
from 00
to 01
, and then the Y
direction, from 01
to 11
.
The other is diagonal direct access, which is achieved by connecting two diagonal chips in hardware to greatly reduce access latency, and this access requires separate enablement through software.
Due to the characteristics of this algorithm, a variety of different approaches can be used when building multi-chip interconnects.
Structure of Four Loongson 3 Chips Interconnected
The four CPUs are connected in a two-by-two ring structure.
Each CPU is connected to two adjacent chips using the two 8-bit controllers of HT0
and to the diagonal chip using HT1 HI
, resulting in the interconnection structure shown below:
Structure of Sixteen Loongson 3 Chips Interconnected
The sixteen interconnects use the remaining HT1_LO
after the above four interconnects (called Clusters) for interconnecting between Clusters.
The structure is as follows:
Structure of Two Loongson 3 Chips with 8-bit Interconnection
8-bit HT bus interconnect.
In this interconnect, only 8-bit HT interconnects can be used between the two processors.
The two chip numbers are 00
and 01
respectively, and from the routing algorithm, it can be known that both chips access each other through the same 8-bit HT bus as in the four-chip interconnect.
This is shown below:
However, the HT bus can be used in 16-bit mode at the widest, and the resulting connection method to maximize bandwidth should be to use a 16-bit interconnect structure.
In Loongson 3, as long as the HT0
controller is set to 16-bit mode, all commands sent to the HT0 controller will be sent to HT0_LO
instead of to HT0_HI
or HT0_LO
respectively according to the routing table as before, so that the 16-bit bus for interconnection can be used.
So, only need to configure the 16-bit mode of CPU0
and CPU1
correctly and connect the high and low buses correctly to use the 16-bit HT bus interconnect.
This interconnection structure can also be accessed using the 8-bit HT bus protocol.
The resulting interconnection structure is as follows:
15. Low-speed I/O Controller Configuration
The Loongson 3 I/O controllers include a UART controller, SPI controller, I2C and GPIO registers. These I/O controllers share an AXI port, and CPU requests are sent to the corresponding devices after address decoding.
15.1. UART Controller
The UART controller has the following features
-
Full duplex asynchronous data receive/send
-
Programmable data format
-
16-bit programmable clock counter
-
Support for receive timeout detection
-
Multi-interrupt system with arbitration
-
FIFO-only operation
-
Compatible with NS16550A in terms of registers and functions
Two UART interfaces are integrated inside the chip, and the functional registers are exactly the same, only the access base address is different.
UART0 register physical address base address is 0x1FE001E0
.
UART1 register physical address base address is 0x1FE001E8
.
A physical address is also provided for each of the two UARTs, 0x1FE00100
(UART0
) and 0x1FE00110
(UART1
) respectively.
The two additional registers RFC
and TFC
can be accessed through this set of addresses.
15.1.1. Data Transport Register (DAT
)
Name: Data transport register
Length: [7:0]
Offset: 0x00
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
W |
Data transport register |
15.1.2. Interrupt Enable Register (IER
)
Name: Interrupt enable register
Length: [7:0]
Offset: 0x01
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
Reserved |
|
RW |
Reserved |
|
|
|
RW |
Modem status interrupt enable
|
|
|
|
RW |
Receiver line status interrupt enable
|
|
|
|
RW |
Transport save register empty interrupt enable
|
|
|
|
RW |
Receive valid data interrupt enable
|
15.1.3. Interrupt Identity Register (IIR
)
Name: Interrupt source register
Length: [7:0]
Offset: 0x02
Reset value: 0xc1
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
Reserved |
|
R |
Reserved |
|
|
|
R |
Bits to indicate the interrupt source, as detailed in the following table |
|
|
|
R |
Bits to indicate the interrupt |
Bit 3 |
Bit 2 |
Bit 1 |
Priority | Interrupt Type | Interrupt Source | Interrupt Reset Control |
---|---|---|---|---|---|---|
|
|
|
1st |
Receive line status |
Odd or even, overflow, frame errors, or interrupt interruptions |
Read |
|
|
|
2nd |
Valid data received |
The number of characters in the |
The number of characters in the |
|
|
|
2nd |
Receive timeout |
At least one character in the |
Read receive |
|
|
|
3rd |
Transport save register is empty |
Transport save register is empty |
Write data to |
|
|
|
4th |
Modem status |
|
Read |
15.1.4. FIFO Control Register (FCR
)
Name: FIFO control register
Length: [7:0]
Offset: 0x02
Reset value: 0xc0
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
W |
Receive trigger value for interrupt request from
|
|
Reserved |
|
W |
Reserved |
|
|
|
W |
|
|
|
|
W |
|
|
Reserved |
|
W |
Reserved |
15.1.5. Line Control Register (LCR
)
Name: Line control register
Length: [7:0]
Offset: 0x03
Reset value: 0x03
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
Frequency division latch access bit
|
|
|
|
RW |
Interrupt control bit
|
|
|
|
RW |
Specify parity bit
|
|
|
|
RW |
Parity bit selection
|
|
|
|
RW |
Parity bits enable
|
|
|
|
RW |
Define the number of bits to generate the stop bit
|
|
|
|
RW |
Set the number of bits per character
|
15.1.6. MODEM Control Register (MCR
)
Name: Modem control register
Length: [7:0]
Offset: 0x04
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
Reserved |
|
W |
Reserved |
|
|
|
W |
Loopback mode control bit
|
|
|
|
W |
Connect to |
|
|
|
W |
Connect to |
|
|
|
W |
|
|
|
|
W |
|
15.1.7. Line State Register (LSR
)
Name: Line status register
Length: [7:0]
Offset: 0x05
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
R |
Error indication bit
|
|
|
|
R |
Transport empty indication bit
|
|
|
|
R |
Transport
|
|
|
|
R |
interrupted interrupt indication bit
|
|
|
|
R |
Frame error indication bit
|
|
|
|
R |
Parity bit error indication bit
|
|
|
|
R |
Data overflow indication bit
|
|
|
|
R |
Receive data valid indication bit
|
When reading this register, LSR[4:1]
and LSR[7]
are cleared to zero, LSR[6:5]
is cleared when writing data to the transmit FIFO
, and LSR[0]
is judged for the receive FIFO
.
15.1.8. MODEM State Register (MSR
)
Name: Modem status register
Length: [7:0]
Offset: 0x06
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
R |
The inverse of the |
|
|
|
R |
The inverse of the |
|
|
|
R |
The inverse of the |
|
|
|
R |
The inverse of the |
|
|
|
R |
|
|
|
|
R |
|
|
|
|
R |
|
|
|
|
R |
|
15.1.9. Receive FIFO Counter (RFC
)
Name: Receive FIFO count value
Length: [7:0]
Offset: 0x08
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
R |
Reflects the number of valid data in the current received |
15.1.10. Transport FIFO Counter (TFC
)
Name: Transport FIFO Count value
Length: [7:0]
Offset: 0x09
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
R |
Reflects the number of valid data in the current transport |
15.1.11. Frequency Division Latchs
Name: Frequency Divider Latch 1
Length: [7:0]
Offset: 0x00
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
Store the lower |
Name: Frequency Divider Latch 2
Length: [7:0]
Offset: 0x01
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
Store the higher |
Name: frequency divider latch 3
Length: [7:0]
Offset: 0x02
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
Store the decimal division value of the division latch |
15.1.12. Use of New Registers
The new receive FIFO counter (RFC
) allows the CPU to detect the number of valid data in the Receive FIFO, so that the CPU can read multiple data continuously after receiving an interrupt, improving the CPU’s ability to process UART received data.
Transport FIFO Counter (TFC
) for the CPU to detect the number of valid data in the transport FIFO, whereby the CPU can continuously send multiple data while ensuring that the transport FIFO does not overflow, improving the CPU’s ability to process UART transport data.
Frequency divider latch 3 (i.e. fractional divider register) is used to solve the problem that the required baud rate cannot be obtained accurately by dividing by integers only.
The integer part of the quotient is assigned to the MSB
and LSB
by the divider latch, and the fractional part is assigned to the divider latch D_DIV
by multiplying by 256
.
15.2. SPI Controller
The SPI controller has the following features:
-
Full-duplex synchronous serial data transmission
-
Variable length byte transport support up to
4
-
Master mode support
-
Mode failure generates an error flag and issues an interrupt request
-
Dual buffered receivers
-
Polarity and phase programmable serial clock
-
SPI can be controlled in wait mode
-
Boot from SPI support
-
Dual/Quad mode SPI FLASH support
The SPI controller register physical address base address is 0x1FE001F0
.
Address Name | Address Range | Size |
---|---|---|
SPI Boot |
|
|
SPI Memory |
|
|
SPI Register |
|
|
The SPI Boot address space is the first address space accessed by the processor when the system boots up, and the 0xBFC00000
address is automatically routed to the SPI.
The SPI Memory space can also be accessed directly through a read request from the CPU, and its minimum 1M
bytes overlap with the SPI BOOT space.
15.2.1. Control Register (SPCR
)
Name: SPI FLASH control register
Length: [7:0]
Offset: 0x00
Reset value: 0x10
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
Interrupt output enable signal (active high) |
|
|
|
RW |
System operation enable signal (active high) |
|
|
|
RW |
Reserved |
|
|
|
RW |
Master mode select bit, this bit is always |
|
|
|
RW |
Clock polarity bits |
|
|
|
RW |
Clock phase bit of |
|
|
|
RW |
|
15.2.2. State Register (SPSR
)
Name: Status register
Length: [7:0]
Offset: 0x01
Reset value: 0x05
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
Interrupt flag bit.
|
|
|
|
RW |
Write register overflow flag bit.
|
|
|
|
RW |
Reserved |
|
|
|
RW |
Write register full flag.
|
|
|
|
RW |
Write register empty flag.
|
|
|
|
RW |
Read register full flag.
|
|
|
|
RW |
Read register empty flag.
|
15.2.3. Transport Data Register (TxFIFO
)
Name: Transport data register
Length: [7:0]
Offset: 0x02
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
W |
Transport data register |
15.2.4. External Register (SPER
)
Name: External register
Length: [7:0]
Offset: 0x03
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
Send an interrupt request signal after how many bytes have been transported
|
|
|
|
RW |
Reserved |
|
|
|
RW |
Set the ratio of the frequency division together with |
spre | 00 | 00 | 00 | 00 | 01 | 01 | 01 | 01 | 10 | 10 | 10 | 10 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
Frequency division factor |
|
|
|
|
|
|
|
|
|
|
|
|
15.2.5. Parameter Control Register (SFC_PARAM
)
Name: SPI FLASH parameter control register
Length: [7:0]
Offset: 0x04
Reset value: 0x21
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
Clock division number selection (the division factor is the same as the |
|
|
|
RW |
Use dual I/O mode with higher priority than fast read mode |
|
|
|
RW |
Use fast read mode |
|
|
|
RW |
SPI FLASH supports continuous address read mode |
|
|
|
RW |
SPI FLASH read enable, when invalid |
15.2.6. Chip Select Control Register (SFC_SOFTCS
)
Name: SPI FLASH chip select control register
Length: [7:0]
Offset: 0x05
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
csn pin output |
|
|
|
RW |
The |
15.2.7. Timing Control Register (SFC_TIMING
)
Name: SPI FLASH timing control register
Length: [7:0]
Offset: 0x06
Reset value: 0x03
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
Reserved |
|
|
|
RW |
4-wire mode enable.
|
|
|
|
RW |
|
|
|
|
RW |
The minimum invalidation time of the SPI FLASH chip select signal, calculated as the clock period
|
15.2.8. Custom Controller Register (CTRL
)
Name: SPI FLASH custom control register
Length: [7:0]
Offset: 0x08
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
Number of bytes in one transport |
|
|
|
RW |
Reserved |
|
|
|
RW |
Multi-byte transport mode |
|
|
|
RW |
Start multi-byte transport, auto-zero when finished |
15.2.9. Custom Command Register (CMD
)
Name: SPI FLASH custom command register
Length: [7:0]
Offset: 0x09
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
Set the command to transport to SPI FLASH |
15.2.10. Custom Data Register 0 (BUF0
)
Name: SPI FLASH custom data register 0
Length: [7:0]
Offset: 0x0a
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
When transporting a write command to the SPI, this register configures the first byte of data sent; when transporting a read command to the SPI, this register stores the first data read back. |
15.2.11. Custom Data Register 1 (BUF1
)
Name: SPI FLASH custom data register 1
Length: [7:0]
Offset: 0x0b
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
When transporting a write command to the SPI, this register configures the second byte of data sent; when transporting a read command to the SPI, this register stores the second data read back. |
15.2.12. Custom Timing Register 0 (TIMER0
)
Name: SPI FLASH custom timing register 0
Length: [7:0]
Offset: 0x0c
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
Lower |
15.2.13. Custom Timing Register 1 (TIMER1
)
Name: SPI FLASH custom timing register 1
Length: [7:0]
Offset: 0x0d
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
Middle |
15.2.14. Custom Timing Register 2 (TIMER2
)
Name: SPI FLASH custom timing register 2
Length: [7:0]
Offset: 0x0e
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
Higher 8 bits of the time value required for the custom command |
15.2.15. Guide to the Use of SPI Dual/Quad Mode
In addition to the legacy single-wire mode, the SPI controller also supports two operating modes, dual mode and quad mode, for booting from the SPI FLASH.
The SPI controller can be put into dual mode by setting the dual_io
register, and quad mode by setting the quad_io
register.
The configuration code for these two registers can be added to the first few instructions of the BIOS code, and then the controller will be pointed to the corresponding operating mode after the configuration is completed, which can improve the boot-up speed.
Note that some SPI FLASHs do not enable quad mode by default, or need to configure timing related parameters in quad mode (e.g.Dummy clocks).
In order to increase the applicability of SPI controller to various FLASHs, this controller adds custom registers (0x8
-0xe
).
The specific usage is:
-
Setting the Custom command register (
CMD
) (0x9
), which is the command sent to the SPI FLASH. -
Configuring the wait time into the custom timing registers
TIMER0
-TIMER2
(0xc
-0xe
) if the SPI FLASH requires that the command sent this time takes a while to complete, otherwise these registers remain at the default value of0
. -
If writing configuration information to the SPI FLASH, the configuration information needs to be written to the custom data registers
BUF0
-BUF1
(0xa
-0xb
); if reading configuration information to the SPI FLASH, these two registers store the read back values. -
Configuration custom control register
CTRL[7:1]
whereCTRL[1]
(nbmode
) represents that the multi-byte transport mode will be performed, and the number of bytes to be transported this time is given byCTRL[7:4]
(nbyte
). -
Configure the custom control register
CTRL[0]
to start this transport.
Generally, the registers to be configured are located in the non-volatile memory of FLASH, so the above configuration is only needed once.
15.3. I2C Controller
This chapter gives a detailed description of the I2C and its configuration for use. The system chip has an integrated I2C interface, which is mainly used to implement the exchange of data between two devices. The I2C bus is a serial bus consisting of a data line SDA and a clock SCL to send and receive data. Bi-directional transmission is performed between devices with a maximum transmission rate of 400kbps.
The I2C controller integrated in the Loongson 3A5000 can act as either a master or a slave device, and the two modes are switched between by configuring internal registers.
As a slave device, it is only used to read the internal temperature of the chip, and the address of the slave device is specified by register SLV_CTRL[6:0]
.
The physical address base address of the I2C0 controller register is 0x1FE00120
.
The I2C1 controller register physical address base address is 0x1FE00130
.
The specific internal registers are described below.
15.3.1. Frequency Division Latch Low-order Byte Register (PRERlo
)
Name: Frequency division latch low-order byte register
Length: [7:0]
Offset: 0x00
Reset value: 0xff
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
Store the lower |
15.3.2. Frequency Division Latch High-order Byte Register (PRERhi
)
Name: Frequency division latch high-order byte register
Length: [7:0]
Offset: 0x01
Reset value: 0xff
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
Store the high |
Assuming that the value of the divider latch is prescale, the frequency of the PCLK clock input from the LPB bus is clock_a
, and the output frequency of the SCL bus is clock_s
, the following relationship should be satisfied:
Prcescale = clock_a/(4*clock_s)-1
15.3.3. Control Register (CTR
)
Name: Control register
Length: [7:0]
Offset: 0x02
Reset value: 0x20
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
RW |
Module operating enable bit
|
|
|
|
RW |
Interrupt enable bit.
|
|
|
|
RW |
Module master-slave selection
|
|
|
|
RW |
Reserved |
15.3.4. Transport Data Register (TXR
)
Name: Transport data register
Length: [7:0]
Offset: 0x03
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
W |
Store the next byte to be transported |
|
|
|
W |
When data is transported, this bit stores the lowest bit of the data. When the address is transported, this bit indicates the read and write status |
15.3.5. Receive Data Register (RXR
)
Name: Receive data register
Length: [7:0]
Offset: 0x03
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
R |
Store the last received byte |
15.3.6. Command Control Register (CR
)
Name: Command register
Length: [7:0]
Offset: 0x04
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
W |
Generate the |
|
|
|
W |
Generate the |
|
|
|
W |
Generate the read signal |
|
|
|
W |
Generate the write signal |
|
|
|
W |
Generate the response signal |
|
|
|
W |
Reserved |
|
|
|
W |
Generate interrupt response signal |
Both are automatically cleared by the hardware after the I2C sends data.
Read operation of these bits always reads back 0
.
A bit 3
of 1
means that the controller does not send ack at the end of this transmission, and vice versa at the end.
15.3.7. State Register (SR
)
Name: Status register
Length: [7:0]
Offset: 0x04
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
R |
Receive response bit
|
|
|
|
R |
I2c bus busy flag bit
|
|
|
|
R |
When the I2C core loses control of the I2C bus, this bit is |
|
|
|
R |
Reserved |
|
|
|
R |
Indicate the process of transport
|
|
|
|
R |
Interrupt flag bit.
When one data transport is finished, or another device initiates data transport, this bit is |
15.3.8. Slave Device Controller Register (SLV_CTRL
)
Name: Slave device control register
Length: [7:0]
Offset: 0x07
Reset value: 0x00
Bit Field | Name | Length | Read/Write | Description |
---|---|---|---|---|
|
|
|
WR |
Slave mode enable, active when |
|
|
|
WR |
Slave mode I2C address. It can be configured via software |
16. Kernel Support
16.1. New Feature Support
In order to use the new features provided by the 3A5000 processor in the kernel, they can be identified or enabled according to the following methods. Only the parts that can improve system performance are described here.
16.1.1. Extended Interrupt Mode
In order to enable the extended interrupt mode in the kernel, set it up in the following order.
-
Extended interrupt mode support is identified by
CSR[0x8][3]
. -
The external interrupt translation register of the HT controller that is expected to support extended interrupt mode needs to be configured to the correct value in PMON. The registers are defined as follows and set to the following values:
INT_trans_en = 0 //Use CSR register for enable control
,CSR[0x420][48]
and this register can both enable extended interrupt mode, in PMON the default does not enable this mode, by the kernel configurationCSR[0x420][48]
to turn onINT_trans_allow = 1 // Allow external interrupt transition function
INT_trans_addr = 0x1000000001140 // Extended interrupt register address
, see 14.3.3.INT_trans_cache = 0 //Uncache mode
Offset:
0x270
Reset value:
0x00000000
Name: HT RX INT TRANS Lo
Table 227. HT RX INT TRANS Lo Bit Field Name Length Reset Value Read/Write Description 31:4
INT_trans_addr[31:4]
28
0x0
R/W
Low order bits of interrupt translation address
3:0
Reserved
4
0x0
R
Reserved
Offset:
0x274
Reset value:
0x00000000
Name: HT RX INT TRANS Hi
Table 228. HT RX INT TRANS Hi Bit Field Name Length Reset Value Read/Write Description 31
INT_trans_en
1
0x0
R/W
Interrupt transition enable
30
INT_trans_allow
1
0x0
R/W
Whether to allow interrupt transition
29:26
INT_trans_cache
4
0x0
R/W
Interrupt Transition
Cache
Field25:0
INT_trans_addr[58:32]
26
0x0
R/W
High order bits of interrupt translation address
-
The kernel first identifies the extended interrupt mode support by
CSR[0x8][3]
, and then enables the extended interrupt mode by registerCSR[0x420][48]
.The base address is
0x1fe00000
, It can also be accessed using the configuration register instruction (IOCSR), and the offset address is0x0420
.Table 229. Other function configuration register Bit Field Name Read/Write Reset Value Description 48
EXT_INT_en
RW
0x0
Extended I/O interrupt enable
-
Set the corresponding routing and internal control for the extended interrupt mode.
16.2. Configuration Register Instruction Debug Support
The configuration register instruction is in principle used without cross-chip access, but in order to meet the need for debugging and other functions, cross-chip access is supported here using multiple register addresses. It is worth noting that such registers can only be written, not read.
Together with the existing inter-processor interrupts and other registers that can be accessed across slices, all such registers and their addresses are listed below.
Name | Offset Address | Read/Write | Description |
---|---|---|---|
|
|
WO |
32-bit interrupt distribution register
|
|
|
WO |
64-bit MailBox Cache register
|
|
|
WO |
32-bit frequency enable register
|
|
|
WO |
64-bit register access register
|