Overview

Overview

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 source code and software operations, followed by an explanation of CPU addressing space. The final section touches on the device address map.

Table of Contents

Source Code

The source code for SP7350 is readily available on both GitHub and Gitee repositories:

For downloading and compiling the code, detailed instructions can be found at:

Downloading and Compiling Code

Additionally, for in-system programming of flash devices on the SP7350 platform, refer to:

In-system Programming Flash Devices

Software Operations

The software components include i-boot, x-boot, TF-A, OP-TEE, U-Boot, Linux, and FreeRTOS. The operation flow of these components is illustrated in the figure below:

image-20240202-100534.png

Upon power-on, i-boot loads the x-boot image from an external storage device into SRAM, verifies it, and executes it. x-boot initiates the DDR controller and conducts training for the DDR PHY. Upon the successful completion of DDR PHY training, DDR DRAM becomes operational. Subsequently, x-boot loads TF-A, OP-TEE, and U-Boot images from an external storage device into DRAM, verifying their integrity. Following this, it executes TF-A, which in turn calls OP-TEE and initiates U-Boot. U-Boot loads the Linux image from an external storage device into DRAM and executes it. Once Linux boots successfully, it proceeds to load the firmware of CM4 (FreeRTOS) and starts CM4.

Note that i-boot resides in the chip's internal mask ROM and is a hardware component. x-boot and U-Boot exist temporarily during boot time. Ubuntu server and ROS/ROS2 are optional. After a successful system boot, the stacked software components resemble the figure below:

image-20240202-100346.png

CPU (Cortex A55) Addressing Space

The CPU of SP7350 supports a 16 GiB addressing space (with 34 address lines), including 8 GiB for DRAM and 4 GiB reserved for CPIO. The addressing space layout is depicted in three figures for 2 GiB DRAM, 4 GiB DRAM, and 8 GiB DRAM.

Addressing Space for 2 GB DRAM

In the first 4 GiB address space, the initial 2 GiB is allocated for DRAM, while the remaining 0.25 GiB is reserved for chip internal devices and registers. The second and fourth 4 GiB address spaces are reserved, and the third 4 GiB address space is for the device (or P-chip) connected with the CPIO bus.

image-20240124-074744.png

Addressing Space for 4 GB DRAM

The first 0.75 GiB address space is allocated for DRAM, followed by 0.25 GiB for chip internal devices and registers. The initial 0.25 GiB of the second 4 GiB address space is allocated for DRAM, while the remaining 3.75 GiB is reserved. The third 4 GiB address space is for the device (or P-chip) connected with the CPIO bus, and the last 4 GiB address space is reserved.

image-20240313-103329.png

Addressing Space for 8 GB DRAM

The first 4 GiB address space is the same as the layout of 4 GiB DRAM. The second 4 GiB address space is allocated for DRAM, and the third 4 GiB address space is for the device (or P-chip) connected with the CPIO bus. The initial 0.25 GiB of the last 4 GiB address space is allocated for DRAM, while the remaining 3.75 GiB is reserved.

image-20240313-103827.png

Address Map of Devices and Registers

The detailed address map begins at address 0xf0000000. It includes segments such as 64 MiB of SPI-NOR flash, 64 MiB of SPI-NAND flash, device registers, AO device registers, DDR SRAM controller registers, Cortex-A55 registers, Cortex-M4 registers, CBDMA SRAM, CM4 SRAM, 8-bit NAND flash controller, and ROM.

image-20240124-100546.png

Interrupt

CA55 Interrupt Table

Bit

Descriptions

Hardware Name

Level/Edge

0

Interrupt_from_GPIO

PI_GPIO_INT0

Programmable

1

Interrupt_from_GPIO

PI_GPIO_INT1

Programmable

2

Interrupt_from_GPIO

PI_GPIO_INT2

Programmable

3

Interrupt_from_GPIO

PI_GPIO_INT3

Programmable

4

Interrupt_from_GPIO

PI_GPIO_INT4

Programmable

5

Interrupt_from_GPIO

PI_GPIO_INT5

Programmable

6

Interrupt_from_GPIO

PI_GPIO_INT6

Programmable

7

Interrupt_from_GPIO

PI_GPIO_INT7

Programmable

8

I2C0

I2C0_INT

Level

9

MAILBOX1_CA55_to_CM4

CPU0_TO_2_DIRECT_INT0

Level

10

MAILBOX1_CA55_to_CM4

CPU0_TO_2_DIRECT_INT1

Level

11

RTC_2Hz_INT_to_CM4

RTC_2HZ_INT

Edge

12

CPIOR

CPIOR_CTL_INT

Level

13

MAILBOX1_CA55_to_CM4

CPU0_TO_2_DIRECT_INT2

Level

14

MAILBOX1_CA55_to_CM4

CPU0_TO_2_DIRECT_INT3

Level

15

SDIO_controller

CARD_CTL2_INT

Level

16

SD_controller

CARD_CTL1_INT

Level

17

EMMC_controller

CARD_CTL0_INT

Level

18

SPI_FLASH

SPI_INT

Level

19

GMAC

GMAC_INT

Level

20

AXI_DMA

AXI_DMA_INT

Level

21

GMAC

GMAC_PMT_INT

Level

22

I2C6

I2C6_INT

Level

23

SPI_NAND

SPI_ND_INT

Level

24

BCH

BCH_INT

Level

25

MAILBOX1_CA55_to_CM4

CPU0_TO_2_DIRECT_INT4

Level

26

MAILBOX0_CA55_to_CM4

CPU0_TO_2_DIRECT_INT5

Level

27

SPI_CB0

SPI_CB0_INT

level

28

SPI_CB1

SPI_CB1_INT

level

29

SPI_CB2

SPI_CB2_INT

level

30

SPI_CB3

SPI_CB3_INT

level

31

SPI_CB4

SPI_CB4_INT

level

32

SPI_CB5

SPI_CB5_INT

level

33

THERMAL

THERMAL_S_INT

Level

34

THERMAL

THERMAL_A_INT

Level

35

UART2AXI

UADBG_INT

Level

36

VI0_CSIIW0

VI0_CSIIW0_INT_FIELD_START

Level

37

VI0_CSIIW0

VI0_CSIIW0_INT_FIELD_END

Level

38

VI0_CSIIW1

VI0_CSIIW1_INT_FIELD_START

Level

39

VI0_CSIIW1

VI0_CSIIW1_INT_FIELD_END

Level

40

VI1_CSIIW0

VI1_CSIIW0_INT_FIELD_START

Level

41

VI1_CSIIW0

VI1_CSIIW0_INT_FIELD_END

Level

42

VI1_CSIIW1

VI1_CSIIW1_INT_FIELD_START

Level

43

VI1_CSIIW1

VI1_CSIIW1_INT_FIELD_END

Level

44

VI4_CSIIW0

VI4_CSIIW0_INT_FIELD_START

Level

45

VI4_CSIIW0

VI4_CSIIW0_INT_FIELD_END

Level

46

VI4_CSIIW1

VI4_CSIIW1_INT_FIELD_START

Level

47

VI4_CSIIW1

VI4_CSIIW1_INT_FIELD_END

Level

48

SEC_IP

SEC_INT

Level

49

AXI_Global_Monitor_int

AXI_MON_TOP_INT

Level

50

AXI_Global_Monitor_int

AXI_MON_PAI_INT

Level

51

STC_TIMESTAMP

STC_TIMESTAMP_INTERRUPT_TIMERW

Level

52

STC_TIMESTAMP

STC_TIMESTAMP_INTERRUPT_TIMER0

Edge

53

STC_TIMESTAMP

STC_TIMESTAMP_INTERRUPT_TIMER1

Edge

54

STC_TIMESTAMP

STC_TIMESTAMP_INTERRUPT_TIMER2B

Edge

55

STC_TIMESTAMP

STC_TIMESTAMP_INTERRUPT_TIMER3B

Edge

56

RTC

WakeupKey_INT

Level

57

TZC400

TZC_400_INT

Level

58

GMAC

GMAC_LPI_INT

Level

59

MIPITX

MIPITX_INT

Level

60

UART

UA0_INT

Level

61

UART

UA1_INT

Level

62

Reserved

AXI_MON_TOP_INT

Level

63

DISP_PWM

DISP_PWM_USER_INT_0

Edge

64

DISP_PWM

DISP_PWM_INT_END_0

Edge

65

DISP_PWM

DISP_PWM_USER_INT_1

Edge

66

DISP_PWM

DISP_PWM_INT_END_1

Edge

67

DISP_PWM

DISP_PWM_USER_INT_2

Edge

68

DISP_PWM

DISP_PWM_INT_END_2

Edge

69

DISP_PWM

DISP_PWM_USER_INT_3

Edge

70