Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

This article provides a brief overview of the SP7350 software. Subsequent articles will delve into the detailed components of the software. The initial section begins with an introduction to the basic hardware through block diagrams, followed by an explanation of software operations. The final will touch upon CPU addressing space and register addresses.

Hardware introduction

The SP7350 incorporates a quad-core ARM Cortex A55 CPU, Verisilicon VIP9000 NPU, Verisilicon video codec, ROM, SRAM, eMMC controller, SPI-NAND flash controller, 8-bit NAND flash controller, UART controller, USB3.0 controller, USB2.0 controller, GPIO, CPIO interface, and DDR3/DDR4/LPDDR4 SDRAM controller, all interconnected by a 128-bit AXI bus, as illustrated in figure below.

image-20240124-090334.png

Cortex-A55 x4 (up to 2.1GHz )

L1: 32KiB, L2: 128KiB, L3: 1MiB

Support DVFS (0.7V / 0.8V / 1.0V)

NPU (1GHz@typical case, 4.6 TOPS)

38 AI models, such as yolov5, mobilenet_v2, squeezenet_v1, inception_v3, and etc., have been verified.

Video codec

H.264 encoder (up to 1920x1080 @ 30fps)

H.264 decoder (up to 1920x1080 @ 60fps)

Crypto engine (AES-256, RSA-2048, MD5, GHASH, SHA2/3)

Support DDR3 (1866) / DDR4 (2666) / LPDDR4 (3200), up to 8GiB

4 CH MIPI/CSI-RX (up to 10 virtual channel, 2688x1944)

1 CH MIPI/DSI-TX or MIPI/CSI-TX (1920x1080)

Support 5 boot devices:

SPI-NOR flash

SPI-NAND flash

8-bit NAND flash

eMMC

SD card

DMA / HWRNG / RTC / Watchdog

Cortex-M4 (with dedicated 384 KiB SRAM, run up to 400M)

Support CPIO (chip-to-chip high-speed interface, up to 9.6GB/s)

USB2.0 x1

USB3.1 Gen. 1 x1

Giga Ethernet

SDIO3.0

3 CH I2S audio

4 CH ADC, 4 CH PWM

7 CH UART, 10 CH I2C, 6 CH SPI

9 CH Timer

106 GPIO (including 48 DVIO)

The Cortex A55, designed by ARM, is a 64-bit, quad-core, general-purpose CPU that implements the ARMv8-A instruction set. It provides 31 sets of 64-bit general-purpose registers, a 64-bit program counter, stack pointer, and exception link register. It features L1 cache of 32 KiB each for instructions and data, an L2 cache of 128 KiB, and an L3 cache of 512 KiB. The Cortex A55 supports 64-bit virtual addresses and 48-bit physical addresses, with four privilege modes: unprivileged (EL-0), OS kernel mode (EL-1), Hypervisor mode (EL-2), and monitor mode. It operates in both secure and non-secure worlds.

The VIP9000 NPU, designed by Verisilicon, is a Neural-network Processor Unit (NPU) specialized for hardware-accelerated processing in artificial intelligence, particularly in neural networks, machine vision, and machine learning. It includes 2048 MACs and achieves computational performance up to 5 TOPS (@900MGHz). Verisilicon provides development environments like AcuityIDE, enabling developers to easily create AI programs and applications.

The DDR3/DDR4/LPDDR4 SDRAM controller, designed by Synopsys, supports three types of DRAM: DDR3, DDR4, and LPDDR4. It features 2 channels, each with 16 bits, totaling 32 bits. The maximum capacity of DRAM supported is 8 GiB, with a maximum speed of 12.8 GiB/s (@1600MHz).

The ROM has a size of 96 KiB and stores the boot program. The first instruction executed after CPU reset resides in the ROM, responsible for initializing the system and loading the next stage of the boot loader from storage devices and executing it. The SRAM has a size of 256 KiB, serving as high-speed RAM for the system or a buffer for DMA transfers. In this system, SRAM also has a special purpose as the RAM for loading and executing the boot loader before initializing DRAM.

The eMMC controller supports eMMC specification version 4.41, with a voltage range of 1.8V (SDR 200 MHz) to 3.3V (DDR 52MHz). The SPI-NAND flash controller and 8-bit NAND flash controller support automatic BCH (1K60) and SLC NAND, with a speed of 104 MHz at 3.3V and 133 MHz or STR mode at 1.8V. The SD card controller supports SD 3.0 specification (also known as SDXC), with a maximum capacity of 2 TB, a maximum speed of 104 MB/s, and automatic switching between 3.3V and 1.8V.

The USB3.0 controller, designed by Synopsys, support dual-roll device (DRD) with a maximum transfer capability of 5 Gbps. USB2.0 controller supports host, device and OTG mode. It supports high-speed, full-speed and low-speed mode. The UART controller has 7 channels, and there are 106 GPIO pins supporting multiplexing.

The CPIO, designed by Sunplus, is a high-speed, full-duplex interface for communicating from chiplet to chiplet, supporting 4 lanes for TX/RX data, CPI, and CPI-X modes, supporting data swap, and achieving a transfer capability of 9.6 GiB/s (@4 lanes, 12nm) or 4.8 GiB/s (@4 lanes, 28nm).

The P chip (Peripheral chip), designed by the customer, includes specific peripheral devices according to the customer's requirements. The C chip can connect to one DRAM and one P chip, as shown in figure below:

The maximum supported capacity of DRAM is 8 GiB. The P chip is designed by the customer to include specific peripherals such as Giga Ethernet, USB3.1 Gen 2, Image fusion processor, MIPI CSI-2, WiFi, Display Engine, and etc. The C chip provides powerful computation capabilities, including general computation, AI inference, graphic computation, and video compression/decompression, meeting the customer's computation needs.

Software operations

Software includes i-boot, x-boot, TF-A, OP-TEE, U-Boot, Linux and FreeRTOS. i-boot (internal boot code) is stored in the chip's internal mask ROM. Upon power-on reset, when the system initializes, the program counters of all CPUs (four ARM Cortex A55) are set to point to the entry point address of the i-boot program. Once the power-on reset deasserts, the CPUs start executing from the entry point address of the i-boot program. i-boot first initializes the CPU, sets up all interrupt vectors, initializes the stack, initializes the cache, configures serial ports, sets timers, and more. After initialization, it loads x-boot from external storage devices into SRAM and executes it.

x-boot (external boot code) is a first-stage boot-loader placed in eMMC, NAND flash, or SD cards, loaded into system SRAM by i-boot. As it runs on SRAM, its size (including code, data, and stack) must not exceed the system SRAM's capacity. The primary task of x-boot is to initialize the DRAM controller and PHY, perform calibration on DRAM PHY and signals, and once calibrated, the DRAM is ready for use. x-boot then switches the CPU from 32-bit mode to 64-bit mode and loads TF-A and U-Boot from external storage into DRAM, executing TF-A.

TF-A (ARM Trusted Firmware-A), developed by ARM, operates at the highest privilege level (EL-3) under ARMv8-A, providing APIs for switching between the secure world and non-secure world. After TF-A completes initialization, it jumps to execute U-Boot (already loaded into DRAM by x-boot).

OP-TEE (Open Portable Trusted Execution Environment)

U-Boot (Universal Boot-loader), developed by Denx Software Engineering, serves as the second-stage bootloader in this system. U-Boot is widely used in embedded systems, supporting various computer architectures. It is free software under the GNU General Public License. As it runs in DRAM, its size is no longer limited by SRAM (only limited by the system's DRAM size), ranging from hundreds of kilobytes to several megabytes. Apart from being a bootloader for the Linux kernel, U-Boot supports access to storage devices like USB flash drives, SD cards, hard disks, reads and burns NOR flash, NAND flash, and eMMC, and supports file systems such as FAT, ext2, ext3, ext4, nfs, ubifs. It also supports network protocols and functions like Ethernet, DHCP, BOOTP, TFTP, NFS, among many others. After initializing itself and external devices, U-Boot then loads Linux from external storage into DRAM and executes it.

Linux is an open-source Unix-like operating system. Linus Torvalds first released its kernel on October 5, 1991. Combined with other utilities, Linux has become a complete operating system. It supports various computer architectures, and anyone can freely use, modify, and redistribute it as long as they adhere to the GNU General Public License. Linux manages all devices on the system, including the CPU, interrupt controller, timer, and DRAM, while all applications run under its management.

FreeRTOS

The following figure illustrates the operation flow of i-boot, x-boot, TF-A, OP-TEE, U-Boot, Linux and FreeRTOS. i-boot loads x-boot from external storage device into SRAM and executes it. x-boot then loads images of TF-A, OP-TEE and U-Boot from external storage device into DRAM and executes TF-A. TF-A runs OP-TEE and then U-Boot, which has already been loaded into DRAM by it. Finally, U-Boot loads Linux from external storage device into DRAM and executes it.

image-20240122-033709.png

Ubuntu server and ROS/ROS2 are optional.

Software components after system boots up

Afer system boots up successfully, software components look like figure below. Note that i-boot locates at chip internal mask ROM and is a part of hardware. x-boot, U-Boot only exist temporarily at boot time.

image-20240124-090120.png

CPU (Cortex A55) addressing space

This project's hardware supports a 16 GiB address space (with 34 address lines), including 8 GiB for the C chip and 4 GiB each reserved for CPIO-L and CPIO-R. The address space layout is depicted in Figure 2.1:

In the first 4 GiB address space, the initial 3.5 GiB is allocated for the C chip's DRAM, while the remaining 0.5 GiB is reserved for internal C chip devices. The second 4 GiB address space is dedicated to the C chip's DRAM. The third 4 GiB space is reserved for the P chip connected to CPIO-L, and the fourth 4 GiB address space is reserved for the P chip connected to CPIO-R. The C chip has a total of 8 GiB of address space, and each of the two P chips has a 4 GiB address space.

Addressing space for 2 GB DRAM

image-20240124-074744.png

Addressing space for 4 GB DRAM

image-20240124-075014.png

Addressing space for 8 GB DRAM

image-20240124-075046.png

Address map of device and registers

The following figure provides a detailed view of the address map, starting from address 0xf0000000. It begins with 64 MiB of SPI-NOR flash (direct address space for NOR flash), followed by 64 MiB of SPI-NAND flash (direct address space for NAND flash), 8 MiB of device registers (such as UART controller, RTC controller, OTP controller, SPI-NOR flash controller, SPI-NAND flash controller, eMMC controller, SD card controller, USB3 controller, etc.), 4 MiB of AO registers, 16 MiB of DDR controller registers, 1 MiB of Cortex-A55 (4-core CPU) registers, 1 MiB of Cortex-M4 (micro-controller) registers, 256 KiB of CBDMA SRAM, 384 KiB of CM4 SRAM, 64 MiB 8-bit NAND flash controller and 96 KiB of ROM.

image-20240124-085319.png

  • No labels