Sg2002 TRM en
Sg2002 TRM en
Sg2002 TRM en
Version : 1.0
Release Date : 2024-06-17
1 Disclaimer 3
2 System Overview 5
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 System Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3.1 Processor Cores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3.2 TPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3.3 Video codec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3.4 Video Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3.5 ISP and Image processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.6 Hardware acceleration engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.7 Audio Codec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.8 Network Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3.9 Security System Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3.10 Intelligent and safe operating environment . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3.11 Peripheral interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3.12 External memory interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3.13 Chip physical specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3 System Architecture 11
3.1 Interrupt Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2 Address-Space Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3 Packaging and Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3.1 Packaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3.2 Pin information description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.3.3 Pin default state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5 Power Management 29
5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.1.1 Power Domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.1.1.1 Active Domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.1.1.2 No-die Domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.1.2 Power operating mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.2 Clock Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.2.1 Turn off unnecessary clock dividers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.2.2 Adjust the operating frequency of the module . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.2.3 Module-level low-power control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
i
5.2.4 Shut down unused PLLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.3 DDR low power control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.4 Voltage Regulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
ii
6.6.1.36 RTC_DN_RSTN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.6.1.37 RTC_DN_MAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.6.1.38 RTC_PWR_CYC_MAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.6.1.39 RTC_WARM_RST_MAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.6.1.40 RTC_EN_7SEC_RST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.6.1.41 RTC_EN_PWR_WAKEUP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
6.6.1.42 RTC_EN_SHDN_REQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
6.6.1.43 RTC_EN_THM_SHDN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
6.6.1.44 RTC_EN_PWR_CYC_REQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.6.1.45 RTC_EN_WARM_RST_REQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.6.1.46 RTC_EN_PWR_VBAT_DET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
6.6.1.47 FSM_STATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.6.1.48 RTC_EN_WDG_RST_REQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.6.1.49 RTC_EN_SUSPEND_REQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.6.1.50 RTC_PG_REG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
6.6.1.51 RTC_ST_ON_REASON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.6.1.52 RTC_ST_OFF_REASON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.6.1.53 RTC_EN_WAKEUP_REQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.6.1.54 RTC_PWR_WAKEUP_POLARITY . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.6.1.55 RTC_DB_SEL_REQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
6.6.1.56 RTC_PWR_DET_SEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
6.6.2 RTC_MACRO_REG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
6.6.2.1 RTC_PWR_DET_COMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
6.6.2.2 RTC_MACRO_DA_CLEAR_ALL . . . . . . . . . . . . . . . . . . . . . . . . . . 62
6.6.2.3 RTC_MACRO_DA_SET_ALL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.6.2.4 RTC_MACRO_DA_LATCH_PASS . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.6.2.5 RTC_MACRO_DA_SOC_READY . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.6.2.6 RTC_MACRO_PD_SLDO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.6.2.7 RTC_MACRO_RG_DEFD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.6.2.8 RTC_MACRO_RG_SET_T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
6.6.2.9 RTC_MACRO_RO_CLK_STOP . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
6.6.2.10 RTC_MACRO_RO_DEFQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
6.6.2.11 RTC_MACRO_RO_T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
6.6.3 RTC_CTRL_REG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
6.6.3.1 RTC_CTRL0_UNLOCKKEY . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
6.6.3.2 RTC_CTRL0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
6.6.3.3 RTC_CTRL_STATUS0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.6.3.4 RTC_CTRL_STATUS1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.6.3.5 rtc_ctrl_status2gpio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.6.3.6 rtcsys_rst_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
6.6.3.7 rtcsys_clkmux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
6.6.3.8 rtcsys_mcu51_ctrl0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
6.6.3.9 rtcsys_mcu51_ctrl1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
6.6.3.10 rtcsys_pmu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.6.3.11 rtcsys_status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
6.6.3.12 rtcsys_clkbyp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
6.6.3.13 rtcsys_clk_en . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
6.6.3.14 rtcsys_wkup_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
6.6.3.15 rtcsys_clkdiv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
6.6.3.16 fc_coarse_en . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
6.6.3.17 fc_coarse_cal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
6.6.3.18 fc_fine_en . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
6.6.3.19 fc_fine_period . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
6.6.3.20 fc_fine_cal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
iii
6.6.3.21 rtcsys_pmu2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
6.6.3.22 rtcsys_clkdiv1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
6.6.3.23 rtcsys_mcu51_dbg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
6.6.3.24 sw_reg0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
6.6.3.25 sw_reg1_por . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.6.3.26 fab_lp_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.6.3.27 rtcsys_mcu51_ictrl1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
6.6.3.28 rtc_ip_pwr_req . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
6.6.3.29 rtc_ip_iso_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
6.6.3.30 rtcsys_wkup_ctrl1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
6.6.3.31 rtcsys_sram_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
6.6.3.32 rtcsys_io_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
6.6.3.33 rtcsys_wdt_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
6.6.3.34 rtcsys_irrx_clk_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
6.6.3.35 rtcsys_rtc_wkup_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
6.6.3.36 rtcsys_por_rst_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7 Reset 81
7.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
7.2 Reset Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
7.3 Reset configuration register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.3.1 Reset configuration register overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.3.2 Reset configuration register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.3.2.1 SOFT_RSTN_0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.3.2.2 SOFT_RSTN_1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
7.3.2.3 SOFT_RSTN_2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7.3.2.4 SOFT_RSTN_3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
7.3.2.5 SOFT_CPUAC_RSTN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
7.3.2.6 SOFT_CPU_RSTN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
8 Clock 91
8.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
8.2 Functional block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
8.3 Clock resources and frequency division structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
8.4 PLL configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
8.4.1 Integer Multiplier PLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
8.4.2 Fractional Multiplier PLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
8.5 IP/Subsystem clock configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
8.5.1 IP/SYS clock source and clock division configuration . . . . . . . . . . . . . . . . . . . . . 100
8.5.2 MCLK0/MCLK1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
8.5.3 Clk_A24M . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
8.6 PLL Control Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
8.7 PLL Control Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
8.7.1 PLL_G2 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
8.7.1.1 pll_g2_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
8.7.1.2 pll_g2_status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
8.7.1.3 mipimpll_csr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
8.7.1.4 apll0_csr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
8.7.1.5 disppll_csr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
8.7.1.6 cam0pll_csr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
8.7.1.7 cam1pll_csr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
8.7.1.8 pll_g2_ssc_syn_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
8.7.1.9 apll_ssc_syn_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
8.7.1.10 apll_ssc_syn_set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
iv
8.7.1.11 disppll_ssc_syn_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
8.7.1.12 disppll_ssc_syn_set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
8.7.1.13 cam0pll_ssc_syn_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
8.7.1.14 cam0pll_ssc_syn_set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
8.7.1.15 cam1pll_ssc_syn_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
8.7.1.16 cam1pll_ssc_syn_set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
8.7.1.17 apll_frac_div_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
8.7.1.18 apll_frac_div_m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
8.7.1.19 apll_frac_div_n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
8.7.1.20 mipimpll_clk_csr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
8.7.1.21 a0pll_clk_csr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
8.7.1.22 disppll_clk_csr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
8.7.1.23 cam0pll_clk_csr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
8.7.1.24 cam1pll_clk_csr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
8.7.1.25 clk_cam0_src_div . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
8.7.1.26 clk_cam1_src_div . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
8.7.2 PLL_G6 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
8.7.2.1 pll_g6_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
8.7.2.2 pll_g6_status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
8.7.2.3 mpll_csr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
8.7.2.4 tpll_csr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
8.7.2.5 fpll_csr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
8.7.2.6 pll_g6_ssc_syn_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
8.7.2.7 dpll_ssc_syn_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
8.7.2.8 dpll_ssc_syn_set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
8.7.2.9 dpll_ssc_syn_span . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
8.7.2.10 dpll_ssc_syn_step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
8.7.2.11 mpll_ssc_syn_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
8.7.2.12 mpll_ssc_syn_set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
8.7.2.13 mpll_ssc_syn_span . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
8.7.2.14 mpll_ssc_syn_step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
8.7.2.15 tpll_ssc_syn_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
8.7.2.16 tpll_ssc_syn_set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
8.7.2.17 tpll_ssc_syn_span . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
8.7.2.18 tpll_ssc_syn_step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
8.8 IP/Subsystem Clcok Control Registers Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
8.9 IP/Subsystem Clcok Control Registers Description . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
8.9.1 clk_en_0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
8.9.2 clk_en_1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
8.9.3 clk_en_2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
8.9.4 clk_en_3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
8.9.5 clk_en_4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
8.9.6 clk_sel_0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
8.9.7 clk_byp_0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
8.9.8 clk_byp_1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
8.9.9 div_clk_a53_0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
8.9.10 div_clk_a53_1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
8.9.11 div_clk_cpu_axi0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
8.9.12 div_clk_cpu_gic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
8.9.13 div_clk_tpu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
8.9.14 div_clk_emmc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
8.9.15 div_clk_100k_emmc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
8.9.16 div_clk_sd0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
8.9.17 div_clk_100k_sd0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
v
8.9.18 div_clk_sd1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
8.9.19 div_clk_100k_sd1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
8.9.20 div_clk_spi_nand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
8.9.21 div_clk_500m_eth0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
8.9.22 div_clk_gpio_db . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
8.9.23 div_clk_sdma_aud0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
8.9.24 div_clk_sdma_aud1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
8.9.25 div_clk_sdma_aud2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
8.9.26 div_clk_sdma_aud3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
8.9.27 div_clk_cam0_200 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
8.9.28 div_clk_axi4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
8.9.29 div_clk_axi6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
8.9.30 div_clk_dsi_esc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
8.9.31 div_clk_axi_vip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
8.9.32 div_clk_src_vip_sys_0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
8.9.33 div_clk_src_vip_sys_1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
8.9.34 div_clk_disp_src_vip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
8.9.35 div_clk_axi_video_codec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
8.9.36 div_clk_vc_src0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
8.9.37 div_clk_1m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
8.9.38 div_clk_spi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
8.9.39 div_clk_i2c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
8.9.40 div_clk_src_vip_sys_2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
8.9.41 div_clk_audsrc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
8.9.42 div_clk_pwm_src_0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
8.9.43 div_clk_ap_debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
8.9.44 div_clk_rtcsys_src_0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
8.9.45 div_clk_c906_0_0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
8.9.46 div_clk_c906_0_1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
8.9.47 div_clk_c906_1_0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
8.9.48 div_clk_c906_1_1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
8.9.49 div_clk_src_vip_sys_3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
8.9.50 div_clk_src_vip_sys_4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
vi
9.3.2.12 sd_pwrsw_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
9.3.2.13 sd_pwrsw_time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
9.3.2.14 ddr_axi_qos_ow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
9.3.2.15 sd_ctrl_opt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
9.3.2.16 sdma_dma_int_mux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
vii
10.2.2.11 IOBLK_G7_REG_UART0_RX . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
10.2.2.12 IOBLK_G7_REG_EMMC_DAT2 . . . . . . . . . . . . . . . . . . . . . . . . . . 210
10.2.2.13 IOBLK_G7_REG_EMMC_CLK . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
10.2.2.14 IOBLK_G7_REG_EMMC_DAT0 . . . . . . . . . . . . . . . . . . . . . . . . . . 211
10.2.2.15 IOBLK_G7_REG_EMMC_DAT3 . . . . . . . . . . . . . . . . . . . . . . . . . . 212
10.2.2.16 IOBLK_G7_REG_EMMC_CMD . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
10.2.2.17 IOBLK_G7_REG_EMMC_DAT1 . . . . . . . . . . . . . . . . . . . . . . . . . . 213
10.2.2.18 IOBLK_G7_REG_JTAG_CPU_TMS . . . . . . . . . . . . . . . . . . . . . . . . . 213
10.2.2.19 IOBLK_G7_REG_JTAG_CPU_TCK . . . . . . . . . . . . . . . . . . . . . . . . . 214
10.2.2.20 IOBLK_G7_REG_IIC0_SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
10.2.2.21 IOBLK_G7_REG_IIC0_SDA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
10.2.2.22 IOBLK_G7_REG_AUX0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
10.2.2.23 IOBLK_G10_REG_SD0_CLK . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
10.2.2.24 IOBLK_G10_REG_SD0_CMD . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
10.2.2.25 IOBLK_G10_REG_SD0_D0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
10.2.2.26 IOBLK_G10_REG_SD0_D1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
10.2.2.27 IOBLK_G10_REG_SD0_D2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
10.2.2.28 IOBLK_G10_REG_SD0_D3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
10.2.2.29 IOBLK_G12_REG_PAD_MIPIRX4N . . . . . . . . . . . . . . . . . . . . . . . . 219
10.2.2.30 IOBLK_G12_REG_PAD_MIPIRX4P . . . . . . . . . . . . . . . . . . . . . . . . 219
10.2.2.31 IOBLK_G12_REG_PAD_MIPIRX3N . . . . . . . . . . . . . . . . . . . . . . . . 220
10.2.2.32 IOBLK_G12_REG_PAD_MIPIRX3P . . . . . . . . . . . . . . . . . . . . . . . . 220
10.2.2.33 IOBLK_G12_REG_PAD_MIPIRX2N . . . . . . . . . . . . . . . . . . . . . . . . 221
10.2.2.34 IOBLK_G12_REG_PAD_MIPIRX2P . . . . . . . . . . . . . . . . . . . . . . . . 221
10.2.2.35 IOBLK_G12_REG_PAD_MIPIRX1N . . . . . . . . . . . . . . . . . . . . . . . . 222
10.2.2.36 IOBLK_G12_REG_PAD_MIPIRX1P . . . . . . . . . . . . . . . . . . . . . . . . 222
10.2.2.37 IOBLK_G12_REG_PAD_MIPIRX0N . . . . . . . . . . . . . . . . . . . . . . . . 223
10.2.2.38 IOBLK_G12_REG_PAD_MIPIRX0P . . . . . . . . . . . . . . . . . . . . . . . . 223
10.2.2.39 IOBLK_G12_REG_PAD_MIPI_TXM2 . . . . . . . . . . . . . . . . . . . . . . . 224
10.2.2.40 IOBLK_G12_REG_PAD_MIPI_TXP2 . . . . . . . . . . . . . . . . . . . . . . . . 224
10.2.2.41 IOBLK_G12_REG_PAD_MIPI_TXM1 . . . . . . . . . . . . . . . . . . . . . . . 225
10.2.2.42 IOBLK_G12_REG_PAD_MIPI_TXP1 . . . . . . . . . . . . . . . . . . . . . . . . 225
10.2.2.43 IOBLK_G12_REG_PAD_MIPI_TXM0 . . . . . . . . . . . . . . . . . . . . . . . 226
10.2.2.44 IOBLK_G12_REG_PAD_MIPI_TXP0 . . . . . . . . . . . . . . . . . . . . . . . . 226
10.2.2.45 IOBLK_G12_REG_GPIO_RTX . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
10.2.2.46 IOBLK_GRTC_REG_PWR_VBAT_DET . . . . . . . . . . . . . . . . . . . . . . 227
10.2.2.47 IOBLK_GRTC_REG_PWR_RSTN . . . . . . . . . . . . . . . . . . . . . . . . . . 228
10.2.2.48 IOBLK_GRTC_REG_PWR_SEQ1 . . . . . . . . . . . . . . . . . . . . . . . . . . 228
10.2.2.49 IOBLK_GRTC_REG_PWR_SEQ2 . . . . . . . . . . . . . . . . . . . . . . . . . . 229
10.2.2.50 IOBLK_GRTC_REG_PTEST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
10.2.2.51 IOBLK_GRTC_REG_PWR_WAKEUP0 . . . . . . . . . . . . . . . . . . . . . . . 230
10.2.2.52 IOBLK_GRTC_REG_PWR_BUTTON1 . . . . . . . . . . . . . . . . . . . . . . . 230
10.2.2.53 IOBLK_GRTC_REG_XTAL_XIN . . . . . . . . . . . . . . . . . . . . . . . . . . 231
10.2.2.54 IOBLK_GRTC_REG_PWR_GPIO0 . . . . . . . . . . . . . . . . . . . . . . . . . 231
10.2.2.55 IOBLK_GRTC_REG_PWR_GPIO1 . . . . . . . . . . . . . . . . . . . . . . . . . 232
10.2.2.56 IOBLK_GRTC_REG_PWR_GPIO2 . . . . . . . . . . . . . . . . . . . . . . . . . 232
10.2.2.57 IOBLK_GRTC_REG_SD1_D3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
10.2.2.58 IOBLK_GRTC_REG_SD1_D2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
10.2.2.59 IOBLK_GRTC_REG_SD1_D1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
10.2.2.60 IOBLK_GRTC_REG_SD1_D0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
10.2.2.61 IOBLK_GRTC_REG_SD1_CMD . . . . . . . . . . . . . . . . . . . . . . . . . . 235
10.2.2.62 IOBLK_GRTC_REG_SD1_CLK . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
10.2.2.63 IOBLK_GRTC_REG_GPIO_ZQ . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
viii
11 DMA Controller 237
11.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
11.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
11.3 Function Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
11.3.1 Peripheral Request Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
11.3.2 Access Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
11.3.3 Basic Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
11.3.4 Linked-list Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
11.3.5 Interrupts and Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
11.3.6 Channel Security Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
11.4 Way of working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
11.4.1 Clock and Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
11.4.2 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
11.4.3 Basic Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
11.4.4 Linked-list Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
11.4.5 Interrupt handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
11.5 DMAC Resisters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
11.5.1 DMAC_IDREG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
11.5.2 DMAC_COMPVERREG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
11.5.3 DMAC_CFGREG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
11.5.4 DMAC_CHENREG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
11.5.5 DMAC_INTSTATUSREG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
11.5.6 DMAC_COMMONREG_INTCLEARREG . . . . . . . . . . . . . . . . . . . . . . . . . . 260
11.5.7 DMAC_COMMONREG_INTSTATUS_ENABLEREG . . . . . . . . . . . . . . . . . . . . 261
11.5.8 DMAC_COMMONREG_INTSIGNAL_ENABLEREG . . . . . . . . . . . . . . . . . . . . 262
11.5.9 DMAC_COMMONREG_INTSTATUSREG . . . . . . . . . . . . . . . . . . . . . . . . . . 263
11.5.10 DMAC_RESETREG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
11.5.11 CHx_SAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
11.5.12 CHx_DAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
11.5.13 CHx_BLOCK_TS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
11.5.14 CHx_CTL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
11.5.15 CHx_CFG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
11.5.16 CHx_LLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
11.5.17 CHx_STATUSREG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
11.5.18 CHx_SWHSSRCREG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
11.5.19 CHx_SWHSDSTREG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
11.5.20 CHx_BLK_TFR_RESUMEREQREG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
11.5.21 CHx_AXI_IDREG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
11.5.22 CHx_AXI_QOSREG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
11.5.23 CHx_SSTAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
11.5.24 CHx_DSTAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
11.5.25 CHx_SSTATAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
11.5.26 CHx_DSTATAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
11.5.27 CHx_INTSTATUS_ENABLEREG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
11.5.28 CHx_INTSTATUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
11.5.29 CHx_INTSIGNAL_ENABLEREG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
11.5.30 CHx_INTCLEARREG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
12 Timers 305
12.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
12.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
12.3 Function Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
12.4 Way of Working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
12.4.1 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
ix
12.4.2 Interrupt Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
12.4.3 Clock Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
12.5 Timer Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
12.6 Timer Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
12.6.1 Timer1LoadCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
12.6.2 Timer1CurrentValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
12.6.3 Timer1ControlReg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
12.6.4 Timer1EOI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
12.6.5 Timer1IntStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
12.6.6 TimersIntStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
12.6.7 TimersEOI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
12.6.8 TimersRawIntStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
13 WatchDog 313
13.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
13.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
13.3 Function Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
13.3.1 Application Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
13.3.2 Functional Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
13.4 Way of Working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
13.4.1 Count Clock Frequency Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
13.4.2 System Initialization Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
13.4.3 Interrupt Handling Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
13.4.4 Close WatchDog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
13.5 WDT Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
13.6 WDT Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
13.6.1 WDT_CR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
13.6.2 WDT_TORR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
13.6.3 WDT_CCVR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
13.6.4 WDT_CRR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
13.6.5 WDT_STAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
13.6.6 WDT_EOI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
13.6.7 WDT_TOC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
x
15.3.2.4 Arbitration Mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
15.3.2.5 Traffic Statistics and Command-latency Statistics . . . . . . . . . . . . . . . . . . . 334
15.3.2.6 Address Mapping Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
15.4 Way of Working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
15.4.1 Soft Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
15.4.2 DDR Initialization Configuration Process . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
15.5 AXI Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
15.5.1 AXI Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
15.5.2 AXI Register Description (Base address: 0x0800_4000) . . . . . . . . . . . . . . . . . . . 340
15.5.2.1 AXI_CTRL0_1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
15.5.2.2 AXI_CTRL1_1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
15.5.2.3 AXI_CTRL0_2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
15.5.2.4 AXI_CTRL1_2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
15.5.2.5 AXI_CTRL0_3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
15.5.2.6 AXI_CTRL1_3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
15.5.3 AXI Register Description (Base address: 0x0800_8000) . . . . . . . . . . . . . . . . . . . 342
15.5.3.1 AXI_MON0_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
15.5.3.2 AXI_MON0_INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
15.5.3.3 AXI_MON0_FILTER0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
15.5.3.4 AXI_MON0_FILTER1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
15.5.3.5 AXI_MON0_FILTER2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
15.5.3.6 AXI_MON0_FILTER3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
15.5.3.7 AXI_MON0_FILTER4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
15.5.3.8 AXI_MON0_FILTER5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
15.5.3.9 AXI_MON0_FILTER6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
15.5.3.10 AXI_MON0_FILTER7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
15.5.3.11 AXI_MON0_FILTER8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
15.5.3.12 AXI_MON0_RPT0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
15.5.3.13 AXI_MON0_RPT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
15.5.3.14 AXI_MON0_RPT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
15.5.3.15 AXI_MON0_RPT3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
15.5.3.16 AXI_MON1_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
15.5.3.17 AXI_MON1_INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
15.5.3.18 AXI_MON1_FILTER0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
15.5.3.19 AXI_MON1_FILTER1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
15.5.3.20 AXI_MON1_FILTER2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
15.5.3.21 AXI_MON1_FILTER3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
15.5.3.22 AXI_MON1_FILTER4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
15.5.3.23 AXI_MON1_FILTER5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
15.5.3.24 AXI_MON1_FILTER6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
15.5.3.25 AXI_MON1_FILTER7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
15.5.3.26 AXI_MON1_FILTER8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
15.5.3.27 AXI_MON1_RPT0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
15.5.3.28 AXI_MON1_RPT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
15.5.3.29 AXI_MON1_RPT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
15.5.3.30 AXI_MON1_RPT3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
15.5.3.31 AXI_MON2_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
15.5.3.32 AXI_MON2_INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
15.5.3.33 AXI_MON2_FILTER0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
15.5.3.34 AXI_MON2_FILTER1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
15.5.3.35 AXI_MON2_FILTER2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
15.5.3.36 AXI_MON2_FILTER3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
15.5.3.37 AXI_MON2_FILTER4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
15.5.3.38 AXI_MON2_FILTER5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
xi
15.5.3.39 AXI_MON2_FILTER6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
15.5.3.40 AXI_MON2_FILTER7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
15.5.3.41 AXI_MON2_FILTER8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
15.5.3.42 AXI_MON2_RPT0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
15.5.3.43 AXI_MON2_RPT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
15.5.3.44 AXI_MON2_RPT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
15.5.3.45 AXI_MON2_RPT3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
15.5.3.46 AXI_MON3_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
15.5.3.47 AXI_MON3_INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
15.5.3.48 AXI_MON3_FILTER0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
15.5.3.49 AXI_MON3_FILTER1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
15.5.3.50 AXI_MON3_FILTER2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
15.5.3.51 AXI_MON3_FILTER3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
15.5.3.52 AXI_MON3_FILTER4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
15.5.3.53 AXI_MON3_FILTER5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
15.5.3.54 AXI_MON3_FILTER6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
15.5.3.55 AXI_MON3_FILTER7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
15.5.3.56 AXI_MON3_FILTER8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
15.5.3.57 AXI_MON3_RPT0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
15.5.3.58 AXI_MON3_RPT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
15.5.3.59 AXI_MON3_RPT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
15.5.3.60 AXI_MON3_RPT3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
15.5.3.61 AXI_MON4_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
15.5.3.62 AXI_MON4_INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
15.5.3.63 AXI_MON4_FILTER0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
15.5.3.64 AXI_MON4_FILTER1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
15.5.3.65 AXI_MON4_FILTER2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
15.5.3.66 AXI_MON4_FILTER3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
15.5.3.67 AXI_MON4_FILTER4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
15.5.3.68 AXI_MON4_FILTER5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
15.5.3.69 AXI_MON4_FILTER6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
15.5.3.70 AXI_MON4_FILTER7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
15.5.3.71 AXI_MON4_FILTER8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
15.5.3.72 AXI_MON4_RPT0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
15.5.3.73 AXI_MON4_RPT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
15.5.3.74 AXI_MON4_RPT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
15.5.3.75 AXI_MON4_RPT3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
15.5.3.76 AXI_MON5_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
15.5.3.77 AXI_MON5_INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
15.5.3.78 AXI_MON5_FILTER0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
15.5.3.79 AXI_MON5_FILTER1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
15.5.3.80 AXI_MON5_FILTER2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
15.5.3.81 AXI_MON5_FILTER3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
15.5.3.82 AXI_MON5_FILTER4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
15.5.3.83 AXI_MON5_FILTER5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
15.5.3.84 AXI_MON5_FILTER6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
15.5.3.85 AXI_MON5_FILTER7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
15.5.3.86 AXI_MON5_FILTER8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
15.5.3.87 AXI_MON5_RPT0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
15.5.3.88 AXI_MON5_RPT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
15.5.3.89 AXI_MON5_RPT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
15.5.3.90 AXI_MON5_RPT3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
15.5.3.91 AXI_MON6_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
15.5.3.92 AXI_MON6_INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
xii
15.5.3.93 AXI_MON6_FILTER0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
15.5.3.94 AXI_MON6_FILTER1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
15.5.3.95 AXI_MON6_FILTER2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
15.5.3.96 AXI_MON6_FILTER3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
15.5.3.97 AXI_MON6_FILTER4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
15.5.3.98 AXI_MON6_FILTER5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
15.5.3.99 AXI_MON6_FILTER6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
15.5.3.100AXI_MON6_FILTER7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
15.5.3.101AXI_MON6_FILTER8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
15.5.3.102AXI_MON6_RPT0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
15.5.3.103AXI_MON6_RPT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
15.5.3.104AXI_MON6_RPT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
15.5.3.105AXI_MON6_RPT3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
15.5.3.106AXI_MON7_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
15.5.3.107AXI_MON7_INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
15.5.3.108AXI_MON7_FILTER0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
15.5.3.109AXI_MON7_FILTER1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
15.5.3.110AXI_MON7_FILTER2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
15.5.3.111AXI_MON7_FILTER3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
15.5.3.112AXI_MON7_FILTER4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
15.5.3.113AXI_MON7_FILTER5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
15.5.3.114AXI_MON7_FILTER6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
15.5.3.115AXI_MON7_FILTER7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
15.5.3.116AXI_MON7_FILTER8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
15.5.3.117AXI_MON7_RPT0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
15.5.3.118AXI_MON7_RPT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
15.5.3.119AXI_MON7_RPT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
15.5.3.120AXI_MON7_RPT3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
15.5.3.121AXI_MON8_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
15.5.3.122AXI_MON8_INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
15.5.3.123AXI_MON8_FILTER0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
15.5.3.124AXI_MON8_FILTER1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
15.5.3.125AXI_MON8_FILTER2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
15.5.3.126AXI_MON8_FILTER3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
15.5.3.127AXI_MON8_FILTER4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
15.5.3.128AXI_MON8_FILTER5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
15.5.3.129AXI_MON8_FILTER6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
15.5.3.130AXI_MON8_FILTER7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
15.5.3.131AXI_MON8_FILTER8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
15.5.3.132AXI_MON8_RPT0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
15.5.3.133AXI_MON8_RPT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
15.5.3.134AXI_MON8_RPT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
15.5.3.135AXI_MON8_RPT3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
15.5.3.136AXI_MON9_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
15.5.3.137AXI_MON9_INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
15.5.3.138AXI_MON9_FILTER0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
15.5.3.139AXI_MON9_FILTER1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
15.5.3.140AXI_MON9_FILTER2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
15.5.3.141AXI_MON9_FILTER3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
15.5.3.142AXI_MON9_FILTER4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
15.5.3.143AXI_MON9_FILTER5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
15.5.3.144AXI_MON9_FILTER6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
15.5.3.145AXI_MON9_FILTER7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
15.5.3.146AXI_MON9_FILTER8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
xiii
15.5.3.147AXI_MON9_RPT0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
15.5.3.148AXI_MON9_RPT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
15.5.3.149AXI_MON9_RPT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
15.5.3.150AXI_MON9_RPT3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
15.5.3.151AXI_MON10_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
15.5.3.152AXI_MON10_INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
15.5.3.153AXI_MON10_FILTER0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
15.5.3.154AXI_MON10_FILTER1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
15.5.3.155AXI_MON10_FILTER2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
15.5.3.156AXI_MON10_FILTER3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
15.5.3.157AXI_MON10_FILTER4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
15.5.3.158AXI_MON10_FILTER5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
15.5.3.159AXI_MON10_FILTER6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
15.5.3.160AXI_MON10_FILTER7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
15.5.3.161AXI_MON10_FILTER8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
15.5.3.162AXI_MON10_RPT0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
15.5.3.163AXI_MON10_RPT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
15.5.3.164AXI_MON10_RPT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
15.5.3.165AXI_MON10_RPT3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
15.5.3.166AXI_MON11_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
15.5.3.167AXI_MON11_INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
15.5.3.168AXI_MON11_FILTER0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
15.5.3.169AXI_MON11_FILTER1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
15.5.3.170AXI_MON11_FILTER2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
15.5.3.171AXI_MON11_FILTER3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
15.5.3.172AXI_MON11_FILTER4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
15.5.3.173AXI_MON11_FILTER5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
15.5.3.174AXI_MON11_FILTER6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
15.5.3.175AXI_MON11_FILTER7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
15.5.3.176AXI_MON11_FILTER8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
15.5.3.177AXI_MON11_RPT0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
15.5.3.178AXI_MON11_RPT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
15.5.3.179AXI_MON11_RPT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
15.5.3.180AXI_MON11_RPT3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
15.6 DDRC Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
15.6.1 DDRC Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
15.6.2 DDRC Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
15.6.2.1 DRAM_REF_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
15.6.2.2 DRAM_MRD0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
15.6.2.3 DRAM_MRD1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
xiv
16.4 Work Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
16.4.1 Initialization Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
16.4.2 Device Status Register Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
16.4.3 SPI NOR Flash Address Mode Switching Process . . . . . . . . . . . . . . . . . . . . . . . 389
16.4.4 DMA Read Operation Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
16.4.5 DMA Write Operation Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
16.4.6 Other things to note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
16.5 Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
16.6 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
16.6.1 SPI_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
16.6.2 CE_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
16.6.3 DLY_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
16.6.4 DMMR_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
16.6.5 TRAN_CSR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
16.6.6 TRAN_NUM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
16.6.7 FF_PORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
16.6.8 FF_PT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
16.6.9 INT_STS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
16.6.10 INT_EN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
xv
17.7.10 reg_tx_data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
17.7.11 reg_rx_data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
xvi
19.1.3.6 Digital Camera (DC) Interface Timing . . . . . . . . . . . . . . . . . . . . . . . . 426
19.1.4 Image Storage Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
19.1.5 VI Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
19.1.6 VI Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
19.1.6.1 REG_00 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
19.1.6.2 REG_10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
19.1.6.3 REG_14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
19.1.6.4 REG_18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
19.1.6.5 REG_1C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
19.1.6.6 REG_20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
19.1.6.7 REG_24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
19.1.6.8 REG_28 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
19.1.6.9 REG_30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
19.1.6.10 REG_40 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
19.1.6.11 REG_44 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
19.1.6.12 REG_48 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
19.1.6.13 REG_50 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
19.1.6.14 REG_54 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
19.1.6.15 REG_58 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
19.1.6.16 REG_60 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
19.1.6.17 REG_64 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
19.1.6.18 REG_68 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
19.1.6.19 REG_6C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
19.1.6.20 REG_70 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
19.1.6.21 REG_74 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
19.1.6.22 REG_80 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
19.1.6.23 REG_88 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
19.1.6.24 REG_8C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
19.1.6.25 REG_90 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
19.1.6.26 REG_94 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
19.1.6.27 REG_98 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
19.1.6.28 REG_9C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
19.1.6.29 REG_A0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
19.1.6.30 REG_A4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
19.1.6.31 REG_B0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
19.1.6.32 REG_B4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
19.1.6.33 REG_D0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
19.1.6.34 REG_D4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
19.1.6.35 REG_D8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
19.1.6.36 REG_DC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
19.1.6.37 REG_E0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
19.1.6.38 REG_E4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
19.1.6.39 REG_E8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
19.1.6.40 REG_EC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
19.1.6.41 REG_F0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
19.1.6.42 REG_F4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
19.1.6.43 REG_F8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
19.1.6.44 REG_FC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
19.1.6.45 REG_100 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
19.1.6.46 REG_104 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
19.1.6.47 REG_108 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
19.1.6.48 REG_110 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
19.1.6.49 REG_114 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
19.1.6.50 REG_118 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
xvii
19.1.6.51 REG_11C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
19.1.6.52 REG_120 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
19.1.6.53 REG_124 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
19.2 VDP (Video Display Processor) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
19.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
19.2.2 Architecture Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
19.2.3 Way of Working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
19.2.3.1 Clock Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
19.2.3.2 Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
19.2.3.3 Output Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
19.2.3.4 Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
19.2.3.5 Vertical Timing Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
19.2.3.6 Low Bandwidth Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
19.2.4 Function Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
19.2.4.1 Video Layer Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
19.2.4.2 Video Layer V Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
19.2.4.3 Graphics Layer G Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
19.2.4.4 Overlay Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
19.2.4.5 Overlay Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
19.2.4.6 Display Channel Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
19.2.4.7 Timing Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
19.2.4.8 HD Output Interface MIPI Tx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
19.2.4.9 HD Output Interface BT.1120 Features . . . . . . . . . . . . . . . . . . . . . . . . 452
19.2.4.10 SD output interface BT.656 features . . . . . . . . . . . . . . . . . . . . . . . . . 452
19.2.4.11 BT.601 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
19.2.4.12 MCU Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
19.2.4.13 LCD LVDS Output Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
19.2.5 VDP Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
19.2.6 VDP Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
19.2.6.1 VDP DISP Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
19.2.6.2 VDP_OSD Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
19.3 MIPI Rx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
19.3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
19.3.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
19.3.3 Function Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
19.3.3.1 Typical Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
19.3.3.2 MIPI Interface Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
19.3.3.3 MIPI Interface Linear Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
19.3.3.4 MIPI interface wide dynamic mode . . . . . . . . . . . . . . . . . . . . . . . . . . 525
19.3.3.5 Sub-LVDS interface data format . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
19.3.3.6 Sub-LVDS interface Linear Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
19.3.3.7 Sub-LVDS Interface Wide Dynamic Mode . . . . . . . . . . . . . . . . . . . . . . 530
19.3.3.8 HiSPi Interface Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
19.3.3.9 HiSPi Interface Linear Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
19.3.3.10 HiSPi Interface Wide Dynamic Mode . . . . . . . . . . . . . . . . . . . . . . . . . 533
19.3.4 MIPI Rx Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
19.3.5 MIPI Rx Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
19.3.5.1 MIPI Rx PHY Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . 537
19.3.5.2 MIPI Rx CSI Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
19.3.5.3 MIPI Rx Sub-LVDS Control Registers . . . . . . . . . . . . . . . . . . . . . . . . 560
19.4 MIPI Tx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
19.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
19.4.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
19.4.3 Function Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
xviii
19.4.3.1 Tx D-PHY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
19.4.3.2 Tx Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
19.4.3.3 Sending of Data Packets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
19.4.3.4 Type of Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
19.4.3.5 Interface Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
19.4.4 MIPI Tx Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
19.4.5 MIPI Tx Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
19.4.5.1 DSI_MAC_REG_00 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
19.4.5.2 DSI_MAC_REG_01 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
19.4.5.3 DSI_MAC_REG_02 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
19.4.5.4 DSI_MAC_REG_03 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
19.4.5.5 DSI_MAC_REG_04 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
19.4.5.6 DSI_MAC_REG_05 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
19.4.5.7 DSI_MAC_REG_06 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
19.4.5.8 DSI_MAC_REG_07 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
19.4.5.9 DSI_MAC_REG_08 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
19.4.5.10 DSI_MAC_REG_09 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
19.4.6 MIPI Tx PHY Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
19.4.7 MIPI Tx PHY Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
19.4.7.1 REG_00 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
19.4.7.2 REG_01 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
19.4.7.3 REG_02 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
19.4.7.4 REG_03 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
19.4.7.5 REG_04 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
19.4.7.6 REG_05 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
19.4.7.7 REG_23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
19.4.7.8 REG_24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
19.4.7.9 REG_25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
19.4.7.10 REG_26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
19.4.7.11 REG_27 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
19.4.7.12 REG_28 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582
19.4.7.13 REG_2D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582
xix
20.2.3.2 Audio ADC Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
20.2.3.3 Audio DAC Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
21 Peripherals 619
21.1 I2C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
21.1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
21.1.2 Function Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
21.1.3 Functional Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
21.1.4 I2C Protocol Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
21.1.5 Way of Working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
21.1.5.1 Configure I2C Clock and Timing Parameters . . . . . . . . . . . . . . . . . . . . . 620
21.1.5.2 Data transfer in non-DMA mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
21.1.5.3 Data transfer in DMA mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
21.1.6 I2C Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
21.1.7 I2C Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
21.1.7.1 IC_CON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
21.1.7.2 IC_TAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
21.1.7.3 IC_SAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
21.1.7.4 IC_DATA_CMD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
21.1.7.5 IC_SS_SCL_HCNT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
21.1.7.6 IC_SS_SCL_LCNT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
21.1.7.7 IC_FS_SCL_HCNT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
21.1.7.8 IC_FS_SCL_LCNT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
21.1.7.9 IC_INTR_STAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
21.1.7.10 IC_INTR_MASK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
21.1.7.11 IC_RAW_INTR_STAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
21.1.7.12 IC_RX_TL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
21.1.7.13 IC_TX_TL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
21.1.7.14 IC_CLR_INTR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
21.1.7.15 IC_CLR_RX_UNDER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
21.1.7.16 IC_CLR_RX_OVER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
21.1.7.17 IC_CLR_TX_OVER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
21.1.7.18 IC_CLR_RD_REQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
21.1.7.19 IC_CLR_TX_ABRT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
21.1.7.20 IC_CLR_RX_DONE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
21.1.7.21 IC_CLR_ACTIVITY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
21.1.7.22 IC_CLR_STOP_DET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
21.1.7.23 IC_CLR_START_DET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
21.1.7.24 IC_CLR_GEN_CALL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
21.1.7.25 IC_ENABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
21.1.7.26 IC_STATUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
21.1.7.27 IC_TXFLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
21.1.7.28 IC_RXFLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
21.1.7.29 IC_SDA_HOLD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
21.1.7.30 IC_TX_ABRT_SOURCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
21.1.7.31 IC_SLV_DATA_NACK_ONLY . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
21.1.7.32 IC_DMA_CR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
21.1.7.33 IC_DMA_TDLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
21.1.7.34 IC_DMA_RDLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
21.1.7.35 IC_SDA_SETUP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
21.1.7.36 IC_ACK_GENERAL_CALL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
21.1.7.37 IC_ENABLE_STATUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
21.1.7.38 IC_FS_SPKLEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
21.1.7.39 IC_HS_SPKLEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
xx
21.2 UART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
21.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
21.2.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
21.2.3 Function Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
21.2.3.1 Application Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
21.2.3.2 Functional Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
21.2.4 Way of Working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637
21.2.4.1 Baud Rate Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637
21.2.4.2 Data Sending Flow Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
21.2.4.3 Data Receiving Flow Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
21.2.4.4 Data transfer in interrupt or query mode . . . . . . . . . . . . . . . . . . . . . . . 640
21.2.4.5 Data transfer in DMA mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
21.2.5 UART Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
21.2.6 UART Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
21.2.6.1 RBR_THR_DLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
21.2.6.2 IER_DLH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644
21.2.6.3 FCR_IIR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645
21.2.6.4 LCR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646
21.2.6.5 MCR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646
21.2.6.6 LSR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646
21.2.6.7 MSR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
21.2.6.8 LPDLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
21.2.6.9 LPDLH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
21.2.6.10 SRBR_STHR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
21.2.6.11 FAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
21.2.6.12 TFR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
21.2.6.13 RFW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
21.2.6.14 USR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
21.2.6.15 TFL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
21.2.6.16 RFL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
21.2.6.17 SRR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
21.2.6.18 SRTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
21.2.6.19 SBCR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
21.2.6.20 SDMAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
21.2.6.21 SFE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
21.2.6.22 SRT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
21.2.6.23 STET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
21.2.6.24 HTX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
21.2.6.25 DMASA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
21.3 SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
21.3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
21.3.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
21.3.3 Function Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
21.3.3.1 Typical Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
21.3.4 Way of Working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
21.3.4.1 Operating Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
21.3.4.2 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
21.3.4.3 Interrupt Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654
21.3.4.4 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654
21.3.4.5 SPI data transmission process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
21.3.4.6 Data transfer in DMA mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657
21.3.5 Three serial peripheral bus timing diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . 657
21.3.5.1 Motorola SPI interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657
21.3.5.2 TI Synchronous Serial Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
xxi
21.3.5.3 National Semiconductor Microwire Interface . . . . . . . . . . . . . . . . . . . . . 660
21.3.6Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
21.3.7Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
21.3.7.1 CTRLR0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
21.3.7.2 CTRLR1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
21.3.7.3 SPIENR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
21.3.7.4 MWCR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
21.3.7.5 SER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
21.3.7.6 BAUDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
21.3.7.7 TXFTLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
21.3.7.8 RXFTLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
21.3.7.9 TXFLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
21.3.7.10 RXFLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
21.3.7.11 SR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
21.3.7.12 IMR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672
21.3.7.13 ISR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673
21.3.7.14 RISR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674
21.3.7.15 TXOICR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674
21.3.7.16 RXOICR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
21.3.7.17 RXUICR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
21.3.7.18 MSTICR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
21.3.7.19 ICR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
21.3.7.20 DMACR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
21.3.7.21 DMATDLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
21.3.7.22 DMARDLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
21.3.7.23 DR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
21.3.7.24 RX_SAMPLE_DLY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
21.4 eMMC/SD/SDIO Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
21.4.1 Function Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
21.4.1.1 Functional Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
21.4.1.2 Command and Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
21.4.1.3 Data Transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
21.4.1.4 Speed mode and voltage switching supported by SD3.0 . . . . . . . . . . . . . . . 686
21.4.1.5 eMMC supported Speed Modes and Voltages . . . . . . . . . . . . . . . . . . . . 686
21.4.2 Application Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
21.4.2.1 Clock Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
21.4.2.2 Soft Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
21.4.2.3 Interface Clock Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
21.4.2.4 Non-Data Transfer Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
21.4.2.5 Stop or Abort Data Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
21.4.2.6 Non-DMA data Transfer Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
21.4.2.7 SDMA Data Transfer Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
21.4.2.8 ADMA Data Transfer Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
21.4.3 Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
21.4.4 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704
21.4.4.1 SDMA_SADDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704
21.4.4.2 BLK_SIZE_AND_CNT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704
21.4.4.3 ARGUMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
21.4.4.4 XFER_MODE_AND_CMD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
21.4.4.5 RESP31_0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707
21.4.4.6 RESP63_32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707
21.4.4.7 RESP95_64 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
21.4.4.8 RESP127_96 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
21.4.4.9 BUF_DATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
xxii
21.4.4.10 PRESENT_STS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
21.4.4.11 HOST_CTL1_PWR_BG_WUP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
21.4.4.12 CLK_CTL_SWRST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711
21.4.4.13 NORM_AND_ERR_INT_STS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712
21.4.4.14 NORM_AND_ERR_INT_STS_EN . . . . . . . . . . . . . . . . . . . . . . . . . . 713
21.4.4.15 NORM_AND_ERR_INT_SIG_EN . . . . . . . . . . . . . . . . . . . . . . . . . . 714
21.4.4.16 AUTO_CMD_ERR_AND_HOST_CTL2 . . . . . . . . . . . . . . . . . . . . . . . 715
21.4.4.17 CAPABILITIES1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
21.4.4.18 CAPABILITIES2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
21.4.4.19 FORCE_EVENT_ERR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
21.4.4.20 ADMA_ERR_STS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
21.4.4.21 ADMA_SADDR_L . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
21.4.4.22 ADMA_SADDR_H . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
21.4.4.23 PRESENT_VUL_INIT_DS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
21.4.4.24 PRESENT_VUL_HS_SDR12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
21.4.4.25 PRESENT_VUL_SDR25_SDR50 . . . . . . . . . . . . . . . . . . . . . . . . . . 720
21.4.4.26 PRESENT_VUL_SDR104_DDR50 . . . . . . . . . . . . . . . . . . . . . . . . . 721
21.4.4.27 SLOT_INT_AND_HOST_VER . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
21.4.4.28 EMMC_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
21.4.4.29 EMMC_BOOT_CTL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
21.4.4.30 CDET_TOUT_CTL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
21.4.4.31 MBIU_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
21.4.4.32 PHY_TX_RX_DLY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
21.4.4.33 PHY_DS_DLY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
21.4.4.34 PHY_DLY_STS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
21.4.4.35 PHY_CONFIG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
21.5 GPIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
21.5.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
21.5.2 Way of Working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
21.5.2.1 Interface Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
21.5.2.2 General Purpose Input and Output . . . . . . . . . . . . . . . . . . . . . . . . . . 725
21.5.2.3 Interrupt Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
21.5.3 GPIO Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726
21.5.4 GPIO Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
21.5.4.1 GPIO_SWPORTA_DR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
21.5.4.2 GPIO_SWPORTA_DDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
21.5.4.3 GPIO_INTEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
21.5.4.4 GPIO_INTMASK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
21.5.4.5 GPIO_INTTYPE_LEVEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
21.5.4.6 GPIO_INT_POLARITY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
21.5.4.7 GPIO_INTSTATUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
21.5.4.8 GPIO_RAW_INTSTATUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
21.5.4.9 GPIO_DEBOUNCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
21.5.4.10 GPIO_PORTA_EOI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
21.5.4.11 GPIO_EXT_PORTA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
21.5.4.12 GPIO_LS_SYNC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
21.6 USB DRD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
21.6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
21.6.2 Function Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
21.6.2.1 System Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
21.6.2.2 Functional Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
21.6.3 USBC Function and Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
21.6.3.1 USBC Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
21.6.3.2 USBC Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
xxiii
21.6.3.3 USBC Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
21.6.4Host Initialization Program Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786
21.6.5Host Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786
21.6.5.1 Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786
21.6.5.2 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787
21.6.6 Device Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
21.6.7 Device Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799
21.6.7.1 Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799
21.6.7.2 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799
21.7 SARADC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815
21.7.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815
21.7.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815
21.7.3 Way of Working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815
21.7.4 SARADC Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815
21.7.5 SARADC Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
21.7.5.1 saradc_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
21.7.5.2 saradc_status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
21.7.5.3 saradc_cyc_set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817
21.7.5.4 saradc_ch1_result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817
21.7.5.5 saradc_ch2_result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817
21.7.5.6 saradc_ch3_result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818
21.7.5.7 saradc_intr_en . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818
21.7.5.8 saradc_intr_clr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818
21.7.5.9 saradc_intr_sta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818
21.7.5.10 saradc_intr_raw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818
21.7.5.11 saradc_test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 819
21.7.5.12 saradc_trim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 819
21.8 Temperature Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 820
21.8.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 820
21.8.2 Way of Working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 820
21.8.3 Temperature sensor Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823
21.8.4 Temperature sensor Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823
21.8.4.1 tempsen_version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823
21.8.4.2 tempsen_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823
21.8.4.3 tempsen_status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824
21.8.4.4 tempsen_set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824
21.8.4.5 tempsen_intr_en . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824
21.8.4.6 tempsen_intr_clr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824
21.8.4.7 tempsen_intr_sta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825
21.8.4.8 tempsen_intr_raw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825
21.8.4.9 tempsen_ch0_result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825
21.8.4.10 tempsen_ch1_result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826
21.8.4.11 tempsen_ch0_temp_th . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826
21.8.4.12 tempsen_ch1_temp_th . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826
21.8.4.13 Overheat_th . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826
21.8.4.14 tempsen_auto_period . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 827
21.8.4.15 tempsen_overheat_ctrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 827
21.8.4.16 tempsen_overheat_countdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 827
21.8.4.17 tempsen_ch0_temp_th_cnt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 827
21.8.4.18 tempsen_ch1_temp_th_cnt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 828
21.9 PWM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 829
21.9.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 829
21.9.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 829
21.9.3 Way of Working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 829
xxiv
21.9.4 PWM Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831
21.9.5 PWM Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 832
21.9.5.1 HLPERIOD0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 832
21.9.5.2 PERIOD0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833
21.9.5.3 HLPERIOD1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833
21.9.5.4 PERIOD1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833
21.9.5.5 HLPERIOD2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833
21.9.5.6 PERIOD2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833
21.9.5.7 HLPERIOD3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 834
21.9.5.8 PERIOD3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 834
21.9.5.9 POLARITY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 834
21.9.5.10 PWMSTART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
21.9.5.11 PWMDONE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
21.9.5.12 PWMUPDATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
21.9.5.13 PCOUNT0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 836
21.9.5.14 PCOUNT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 836
21.9.5.15 PCOUNT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 836
21.9.5.16 PCOUNT3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 836
21.9.5.17 PULSECOUNT0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 836
21.9.5.18 PULSECOUNT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 837
21.9.5.19 PULSECOUNT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 837
21.9.5.20 PULSECOUNT3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 837
21.9.5.21 SHIFTCOUNT0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 837
21.9.5.22 SHIFTCOUNT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 837
21.9.5.23 SHIFTCOUNT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838
21.9.5.24 SHIFTCOUNT3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838
21.9.5.25 SHIFTSTART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838
21.9.5.26 PWM_OE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838
21.10 KeyScan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839
21.10.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839
21.10.2 Way of Working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839
21.10.3 Basic Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 840
21.10.4 Use FIFO mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 840
21.10.5 Use snapshot array mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 840
21.10.6 KeyScan Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841
21.10.7 KeyScan Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841
21.10.7.1 KEYSCAN_CONFIG0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841
21.10.7.2 KEYSCAN_CONFIG0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841
21.10.7.3 KEYSCAN_CONFIG2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 842
21.10.7.4 KEYSCAN_CONFIG3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 842
21.10.7.5 KEYSCAN_SNAPSHOT_ARRAY . . . . . . . . . . . . . . . . . . . . . . . . . . 842
21.10.7.6 KEYSCAN_SNAPSHOT_TRIG . . . . . . . . . . . . . . . . . . . . . . . . . . . 842
21.10.7.7 KEYSCAN_FIFO_STATUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
21.10.7.8 KEYSCAN_FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
21.10.7.9 KEYSCAN_IRQ_ENABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
21.10.7.10KEYSCAN_IRQ_FLAG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 844
21.10.7.11KEYSCAN_IRQ_CLEAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 844
21.11 Wiegand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845
21.11.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845
21.11.1.1 Wiegand 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845
21.11.1.2 Wiegand 34 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 846
21.11.2 Way of Working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847
21.11.2.1 TX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847
21.11.2.2 RX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848
xxv
21.11.3 Wiegand Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848
21.11.4 Wiegand Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848
21.11.4.1 TX_CONFIG0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848
21.11.4.2 TX_CONFIG1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849
21.11.4.3 TX_CONFIG2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849
21.11.4.4 TX_BUFFER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849
21.11.4.5 TX_TRIG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849
21.11.4.6 TX_BUSY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
21.11.4.7 TX_BUSY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
21.11.4.8 RX_CONFIG0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
21.11.4.9 RX_CONFIG1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
21.11.4.10RX_CONFIG2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851
21.11.4.11RX_BUFFER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851
21.11.4.12RX_BUFFER_VALID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851
21.11.4.13RX_BUFFER_CLEAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 852
21.11.4.14RX_DEBUG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 852
21.11.4.15IRQ_ENABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 852
21.11.4.16IRQ_FLAG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853
21.11.4.17IRQ_CLEAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853
21.12 IRRX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854
21.12.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854
21.12.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854
21.12.3 Way of Working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854
21.12.4 IRRX Register Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854
21.12.5 IRRX Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 855
21.12.5.1 IR_EN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 855
21.12.5.2 IR_MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856
21.12.5.3 IR_CFG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856
21.12.5.4 IR_FRAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856
21.12.5.5 int_en . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857
21.12.5.6 int_clr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857
21.12.5.7 int_clr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857
21.12.5.8 int . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857
21.12.5.9 int_raw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858
21.12.5.10IR_SYMBOL_CFG0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858
21.12.5.11IR_SYMBOL_CFG1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858
21.12.5.12IR_SYMBOL_CFG2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859
21.12.5.13IR_SYMBOL_CFG3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859
21.12.5.14IR_SYMBOL_CFG4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859
21.12.5.15IR_SYMBOL_CFG5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 860
21.12.5.16IR_SYMBOL_CFG6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 860
21.12.5.17IR_SYMBOL_CFG7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 860
21.12.5.18IR_CLOCK_CTRL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 860
21.12.5.19IR_DATA0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 861
21.12.5.20IR_DATA1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 861
21.12.5.21IR_DATA2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 861
21.12.5.22IR_DATA3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 861
21.12.5.23IR_DATA4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 861
21.12.5.24IR_NEC_DATA0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 861
21.12.5.25IR_SONY_DATA0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 862
21.12.5.26IR_SONY_DATA1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 862
21.12.5.27IR_PHILIPS_DATA0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 862
21.12.5.28IR_PHILIPS_DATA1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 862
21.12.5.29IR_PRD_REC0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 862
xxvi
21.12.5.30IR_PRD_REC1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 863
21.12.5.31IR_PRD_REC2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 863
21.12.5.32IR_PRD_REC3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 863
21.12.5.33IR_PRD_REC4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 863
21.12.5.34IR_PRD_REC5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 863
xxvii
22.1.6.38 key_data_7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 878
22.1.6.39 key_data_8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 879
22.1.6.40 key_data_9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 879
22.1.6.41 key_data_10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 879
22.1.6.42 key_data_11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 879
22.1.6.43 key_data_12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 879
22.1.6.44 key_data_13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 879
22.1.6.45 key_data_14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
22.1.6.46 key_data_15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
22.1.6.47 key_data_16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
22.1.6.48 key_data_17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
22.1.6.49 key_data_18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
22.1.6.50 key_data_19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
22.1.6.51 key_data_20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
22.1.6.52 key_data_21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
22.1.6.53 key_data_22 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
22.1.6.54 key_data_23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
22.1.6.55 ini_data_0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
22.1.6.56 ini_data_1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
22.1.6.57 ini_data_2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 882
22.1.6.58 ini_data_3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 882
22.1.6.59 ini_data_4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 882
22.1.6.60 ini_data_5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 882
22.1.6.61 ini_data_6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 882
22.1.6.62 ini_data_7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 882
22.1.6.63 ini_data_8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 883
22.1.6.64 ini_data_9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 883
22.1.6.65 ini_data_10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 883
22.1.6.66 ini_data_11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 883
22.1.6.67 sha_data_0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 883
22.1.6.68 sha_data_1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 883
22.1.6.69 sha_data_2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 884
22.1.6.70 sha_data_3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 884
22.1.6.71 sha_data_4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 884
22.1.6.72 sha_data_5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 884
22.1.6.73 sha_data_6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 884
22.1.6.74 sha_data_7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 884
22.2 Security Debugging Firewall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 885
22.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 885
22.2.2 Status query and password input interface (I2C) . . . . . . . . . . . . . . . . . . . . . . . . 886
22.2.3 Status inquiry and password entry process . . . . . . . . . . . . . . . . . . . . . . . . . . . 887
22.2.3.1 Status inquiry process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 887
22.2.3.2 Password input process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 887
22.3 Efuse Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 888
xxviii
CONTENTS
Revision History
ONE
DISCLAIMER
Contact Us
Official website
https://www.sophgo.com/
Document publishing website
https://github.com/sophgo/sophgo-doc
3
CHAPTER 1. DISCLAIMER
TWO
SYSTEM OVERVIEW
2.1 Introduction
SG2002 is a high-performance, low-power chip launched for the AIot field. It has multiple built-in powerful cores:
2 x C906, 1 x Arm Cortex A53, 1 x 8051. Users can quickly switch cores according to needs. At the same time, it
integrates hardware codecs: H.264 video compression codec, H.265 video compression encoder and ISP, supporting
the configuration of professional-level video image ISP: HDR wide dynamic range, 3D noise reduction, defogging,
lens distortion correction and other image enhancement and correction algorithms.
The chip also integrates a self-developed TPU, which can provide 1.0TOPS IN8 computing power. The specially
designed TPU scheduling engine efficiently delivers extremely high-bandwidth data streams to all tensor processor
cores.
At the same time, it supports a variety of peripheral interfaces: 5 x I2C, 2 x SDIO3.0, 2 x I2S, 15 x PWM, 1 x USB
2.0, etc., to meet the needs of various scenarios.
5
CHAPTER 2. SYSTEM OVERVIEW
2.3 Features
2.3.2 TPU
• Input
– Supports two simultaneous video inputs (mipi 2L + 1L)
– Supports MIPI, Sub-LVDS, HiSPI and other serial interfaces
– Support 8/10/12 bit RGB Bayer video input
– Support BT.656
– Support AHD multi-channel mixed BT format
– Supports SONY, OnSemi, OmniVision and other high-definition CMOS sensors
– Provide programmable frequency output for sensor as reference clock
– Supports a maximum width of 2880 and a maximum resolution of 5M (2688x1944, 2880x1620)
• Output
– Supports multiple serial and parallel screen display specifications
– Support serial interfaces such as MIPI
– Supports BT656, BT601 (8bit), BT1120, 8080 and other parallel interfaces
– Support SPI output interface
• 90 degree, 180 degree, 270 degree rotation for image and video
• Mirror and Flip functions for image and video
• Video 2-layer OSD overlay
• Video 1/32 ~ 32x zoom function
• 3A (AE/AWB/AF) algorithm
• Fixed mode noise elimination, dead pixel correction
• Lens shading correction, lens distortion correction, purple fringing correction
• Direction adaptive demosaic
• Gamma correction, (regional/global) dynamic contrast enhancement, color management and enhancement
• Area adaptive defogging
• Bayer noise reduction, 3D noise reduction, detail enhancement and sharpening enhancement
• Local Tone mapping
• Sensor self-bandwidth dynamic and 2 frame wide dynamic
• Two-axis digital image stabilization
• Lens distortion correction
• Provide PC-side ISP tuning tools
• Integrated Audio CODEC, supports 16-bit audio source/voice input and output
• Integrated mono microphone input
• Integrated mono output. (An external amplifier is required to drive the speaker)
• Internally integrated another microphone is directly connected to the output channel to facilitate AEC imple-
mentation
• Software audio codec protocols (G.711, G.726, ADPCM)
• Software supports audio 3A (AEC, ANR, AGC) function
• The Ethernet module provides one Ethernet MAC to receive and send network data.
• Ethernet MAC with built-in 10/100Mbps Fast Ethernet Transceiver, can work in 10/100Mbps full-duplex or
half-duplex mode.
• Support the establishment of trust chain: Provide the foundation of a secure environment and the foundation of
a trusted environment, such as hardware security settings and root of trust.
• Supports secure boot and provides security hardware and software protection functions.
• Support data encryption security: data encryption program, computing core encryption.
• Support software and firmware signature verification process: verify software credibility and integrity, includ-
ing booting and loading signature verification procedures.
• Support secure storage and transmission: protect external data storage and exchange.
• Support security updates.
• Built-in DRAM.
– DDR3 16bit x 1, maximum speed up to 1866Mbps, capacity 2Gbit (256MB).
• SPI NOR flash interface (1.8V / 3.0V).
– Supports 1, 2, 4 wire modes.
– Maximum support is 256MByte.
• SPI Nand flash interface (1.8V / 3.0V).
– Supports 1KB/2KB/4KB page (corresponding maximum capacity 16GB/32GB/64GB).
– Use the ECC module built into the device itself.
• eMMC 4.5 interface (1.8V/3.0V) SD0 EMMC has a common power supply. Because the SD card defaults to
3V, it is not suitable to connect to 1.8V eMMC when there is an SD card.
– 4 bit interface.
– Support HS200.
– Maximum supported capacity 2TB.
• Power consumption
– 1080P + Video encode + AI : ~ 500mW
• Operating Voltage
– Core voltage is 0.9V
– IO voltage is 1.8V and 3.0V
– DDR voltage is as shown in the table below
∗ 1.35V
• Encapsulation
– Using QFN package, the package size is 9mmx9mmx0.9mm. The pin pitch is 0.35mm. The total number
of pins is 88.
THREE
SYSTEM ARCHITECTURE
Table 3.1: Interrupt number and Interrupt source mapping for ARM
Cortex-A53
INT # INT Source INT INT Source INT # INT Source
32 TEMPSENS 70 SPI1 108 TRNG
33 RTC Alarm 71 SPI2 109 ddr_axi_mon
34 RTC Longpress 72 SPI3 110 ddr_pi_phy
35 VBAT DET 73 SPI4 111 SPI_NOR
36 JPEG 74 WatchDog0 112 EPHY
37 H264 75 KEYSCAN 113 IVE
38 H265 76 GPIO0 114 Reserved
39 VC SBM 77 GPIO1 115 Reserved
40 ISP 78 GPIO2 116 SARADC
41 SC_TOP 79 GPIO3 117 mbox
42 CSI_MAC0 80 Wiegand0 151 npmuirq[0]
43 CSI_MAC1 81 Wiegand1 152 ctiirq[0]
44 LDC 82 Wiegand2 159 nexterrirq
45 System DMA 83 RTC MBOX 116 SARADC
46 USB 84 N/A
54 SD1 92 TDMA
11
CHAPTER 3. SYSTEM ARCHITECTURE
56 I2S0 94 Reserved
57 I2S1 95 Timer0
58 I2S2 96 Timer1
59 I2S3 97 Timer2
60 UART0 98 Timer3
61 UART1 99 Timer4
Table 3.2: Interrupt number and Interrupt source mapping for Master
RISCV C906 @ 1.0Ghz
INT # INT Source INT # INT Source INT # INT Source
16 TEMPSENS 52 I2C3 88 hsperi_firewall
17 RTC Alarm 53 I2C4 89 ddr_fw
18 RTC Longpress 54 SPI1 90 rom_firewall
19 VBAT DET 55 SPI2 91 SPACC
20 JPEG 56 SPI3 92 TRNG
21 H264 57 SPI4 93 ddr_axi_mon
22 H265 58 WatchDog1 94 ddr_pi_phy
23 VC SBM 59 KEYSCAN 95 SPI_NOR
24 ISP 60 GPIO0 96 EPHY
25 SC_TOP 61 GPIO1 97 IVE
26 CSI_MAC0 62 GPIO2 98 Reserved
27 CSI_MAC1 63 GPIO3 99 Reserved
28 LDC 64 Wiegand0 100 SARADC
29 System DMA 65 Wiegand1 101 mbox
continues on next page
32 Ethnet0 68 N/A
39 SPI_NAND 75 TPU
40 I2S0 76 TDMA
41 I2S1 77 Reserved
42 I2S2 78 Reserved
43 I2S3 79 Timer0
44 UART0 80 Timer1
45 UART1 81 Timer2
46 UART2 82 Timer3
47 UART3 83 Timer4
48 UART4 84 Timer5
49 I2C0 85 Timer6
50 I2C1 86 Timer7
51 I2C2 87 peri_firewall
Table 3.3: Interrupt number and Interrupt source mapping for Slave
RISCV C906 @ 700Mhz
INT # INT Source INT # INT Source INT # INT Source
16 JPEG 32 I2C0 48 RTC GPIO
17 H264 33 I2C1 49 RTC UART
18 H265 34 I2C2 50 RTC I2C
19 VC SBM 35 I2C3 51 RTC WDG
20 ISP 36 I2C4 52 TDMA
21 SC_TOP 37 SPI1 53 Reserved
22 CSI_MAC0 38 SPI2 54 Reserved
23 CSI_MAC1 39 WatchDog2 55 Timer4
24 LDC 40 KEYSCAN 56 Timer5
25 System DMA 41 GPIO0 57 Timer6
26 I2S0 42 GPIO1 58 Timer7
27 I2S1 43 GPIO2 59 SPACC
28 I2S2 44 GPIO3 60 IVE
29 I2S3 45 Wiegand0 61 mbox
30 UART0 46 RTC MBOX
* Reading and writing operations on the reserved address space may produce unpredictable results.
3.3.1 Packaging
Using QFN package, the package size is 9mm x 9mm x 0.9mm. Pin spacing is 0.35mm. The total number of pins is
88. Please refer to the figure below for detailed package dimensions.
2 PAD_AUD_AINLAUDIO VDD18A_MIPI
_MIC GPIO
(1.8V)
4 PAD_AUD_AOUTR AUDIO VDD18A_MIPI
GPIO
(1.8V)
67 GPIO_RTX 1.8V GPIO G12 VDD18A_USB
___EPHY_RTX _PLL_ETH
35 GPIO_ZQ 1.8V GPIO GRTC VDDIO_RTC
___PAD_ZQ
#N/A PKG_TYPE0 1.8V GPIO G1 VDD18A_USB no pin out
_PLL_ETH
#N/A PKG_TYPE1 1.8V GPIO G1 VDD18A_USB no pin out
_PLL_ETH
#N/A PKG_TYPE2 1.8V GPIO G1 VDD18A_USB no pin out
_PLL_ETH
#N/A MUX_SPI1_MISO NA NA NA Result is feed to
PAD_MIPIRX3N
func7
#N/A MUX_SPI1_MOSI NA NA NA Result is feed to
PAD_MIPIRX3P
func7
#N/A MUX_SPI1_CS NA NA NA Result is feed to
PAD_MIPIRX4P
func7
#N/A MUX_SPI1_SCK NA NA NA Result is feed to
PAD_MIPIRX4N
func7
FOUR
4.1 Overview
The chip is booted from the built-in ROM (BOOTROM). When the chip is reset, it will detect whether there is a
weak pull-up or weak pull-down on the two pins (EMMC_DAT3, EMMC_DAT0) to confirm the type of memory
device currently selected.
Secure boot chips will check during boot and chip upgrade to ensure that the software being executed or upgraded is
safe.
25
CHAPTER 4. BOOT AND UPGRADE
• Support booting from SPI Nor Flash (EMMC_DAT3 pull down, EMMC_DAT0 pull up)
• Support booting from SPI Nand Flash (EMMC_DAT3 pull down, EMMC_DAT0 pull down)
• Support booting from eMMC (EMMC_DAT3 pull up, EMMC_DAT0 pull up)
Note: SD0 and eMMC domain share IO power, because the SD card run with 3.0V by default, and eMMC is mostly
1.8V, basically eMMC is not supported unless SD0 does not connect with the SD card.
FIVE
POWER MANAGEMENT
5.1 Overview
29
CHAPTER 5. POWER MANAGEMENT
The RTCSYS subsystem is internally divided into two sub power domains: AO (Always-On) domain and MCU do-
main (VDDC_SW_MCU area). The system can choose to turn off the power domain to which the MCU belongs
through registers to achieve power saving needs. Please refer to the Power Domain Control Process chapter for de-
tails.
In the system sleep state, the MCU can handle interrupts and wake up the system through the configuration register,
and can also communicate with external devices through I2C/UART.
The specific composition of the RTCSYS subsystem is as follows:
• AO (Always-On) domain
– 1 set of WDT is used to issue an interrupt or reset signal after a certain period of time when an abnor-
mality occurs in the system to interrupt or reset the entire system. Related control registers refer to the
RTCSYS_WDT section of the WDT Register Overview chapter.
– RTC (Real Time Clock), for detailed introduction, please refer to the Real Time Clock chapter.
– 1 set of interrupt controllers to manage interrupt sources (ictrl). For detailed introduction, please refer to
the Interrupt Handling chapter.
– 1 set of GPIO, related control registers refer to the RTCSYS_GPIO section of the GPIO Register
Overview chapter.
– 1 set of SARADC, related control registers refer to the RTCSYS_SARADC section of the SARADC Reg-
ister Overview chapter.
– 1 group of IRRX, related control registers refer to the IRRX Register Overview chapter.
• MCU domain
– An 8051 microcontroller (MCU), see chapter 8051 Subsystem for details.
– 8KB space AHB SRAM, which can be used by 8051 as instruction TCM or temporary data storage.
– 2 sets of 32-bit counters, used for timing and counting functions, which can be used for application pro-
grams to implement timing and counting, or for the operating system to implement system clocks.
– 1 group off-chip SPINOR control.
– 2 sets of Mailbox, allowing ACPU and 8051 to communicate with each other. For detailed introduction,
please refer to the MAILBOX chapter.
– 1 set of I2C, related control registers refer to the RTCSYS_I2C section of the I2C Register Overview
chapter.
– 1 set of UART, related control registers refer to the RTCSYS_UART section of the UART Register
Overview chapter.
Based on Power Domain, the chip supports two main power operating modes:
• MCU-Only (32k-less) Mode:
Only No-die Domain works. In this No-die domain, there is a small MCU system with its own clock, timer,
uart, i2c, gpio, adc and other peripherals, which can replace the SoC’s external MCU. The MCU in the No-die
Domain can wake up the main system and return to Active Mode after receiving and filtering external input.
There is a calibrated oscillator in the system to wake up quickly and fall asleep quickly. To further save power
consumption every time it is woken up.
When the MCU is in the Idle state, the power consumption is approximately 200uA.
• Active Mode
Active mode is a state where the chip is fully awake and working. At this time, as long as the power supply is
normal, the devices in the No-die Domain and Active Domain will work normally. But there are other power-
saving techniques such as dynamic frequency scaling or dynamic clock gating.
Refer to the Clock configuration chapter and turn off the unused clock divider according to the clock source required
by each module, to achieve the purpose of saving power consumption.
Select a lower clock source according to the clock specifications required by each module. There are many frequency
division configurations to reduce the module operating frequency. It should be noted that reducing the frequency of a
single module may not necessarily reduce the overall power consumption.
• Analog module: MIPI/USB/ETH/AUD related register settings, turn off unused modules or enter low power
consumption mode.
• Digital modules: Turn off the clocks of unnecessary digital modules according to hardware and specifications.
Referring to the PLL configuration, you can Powerdown the PLL that is not needed to save power consumption.
After the bus is not accessed for a period of time, the DDR controller will automatically enter the “Self refresh” and
“Power down” states to reduce system power consumption.
In some scenarios, it is impossible to find a large enough gap to enter “self refresh” due to intermittent access. At this
time, you can also consider using the built-in statistical register to access the data volume. To confirm whether the
bandwidth is excessive, you can consider directly reducing the frequency.
The DDR controller supports dynamic frequency adjustment. However, adjusting the frequency will temporarily stop
DDR access for a period of time. Therefore, in order to reduce interruption time, which may make real-time applica-
tion buffer underflow or overflow, it is limited to two levels: 50% and 100%.
By default the chip uses PWM0 to control VDDC voltage regulation. The following is an example of using PWM to
control the DCDC output voltage.
SIX
6.1 Overview
The RTC (Real Time Clock) is an independently powered module in the chip. It contains a 32KHz oscillator and a
Power-On-Reset (POR) sub-module, which can be used for time display and scheduled alarm produce. In addition,
the hardware state machine provides triggering and timing control for chip power-on, power-off and reset.
35
CHAPTER 6. REAL TIME CLOCK
6.2 Features
The RTC is an independently powered constant current module in the chip. When the RTC is powered on for the first
time, the internal POR module generates a low-level pulse, and the 32KHz oscillator starts to oscillate. The POR low
level maintenance time is greater than 13 clock(32KHz) cycles, and the RTC enters the initial state. When the state
machine detects that the battery voltage is in a normal state, it starts to complete the chip power-on process according
to the default value sequence and releases the system reset signal. After the software is powered on for the first time,
it is necessary to initialize the RTC and configure the initial counting value. When the system is to be shut down or
enter sleep mode, the system control register (RTC_CTRL) can be configured to trigger the RTC state machine to
complete the chip power-off process according to the configuration sequence.
When the chip is in power-off shutdown or sleep state, it will continue to work as long as the RTC power supply
is maintained to save necessary software code or user data in SRAM and information registers (RTC_INFO0 ~
RTC_INFO3, RTC_NOPOR_INFO0 ~ RTC_NOPOR_INFO3); the counter will continue to count. At the same
time, it will also detect whether the button triggers the chip to turn on or wake up from sleep. When the trigger is
received, the state machine will complete the chip power-on process according to the configured timing and release
the system reset signal. After the processor core is restarted, the software can determine the chip status by read-
ing back the contents previously written to the information register. The RTC also provides two status registers
(RTC_ST_ON_REASON, RTC_ST_OFF_REASON) to record the previous power-off or power-on of the chip re-
spectively. As well as the trigger conditions for reset, and provide more detailed content, such as whether unexpected
events have occurred: forced reset, chip overheating, or battery/power supply loss, etc. In addition, when the RTC
receives the Watchdog, it will trigger the state machine to send out a system reset signal according to the configured
timing to restart the chip.
The RTC’s counting clock uses a 32KHz clock and runs based on a 32-bit adding counter to provide second count-
ing. The initial counting value is loaded from the register RTC_SET_SEC_CNTR_VALUE. The software can read
back the second value through the register RTC_SEC_CNTR_VALUE and convert it into the specific year, month,
day, hour, and minute.
The 32KHz clock and second pulse period can be calibrated through the software process, or the hardware module
can be turned on to perform automatic calibration periodically.
Software can enable Alarm by configuring the 32-bit register RTC_ALARM_TIME and writing 1 to
RTC_ALARM_ENABLE. When the second count value RTC_SEC_CNTR_VALUE is incremented to be equal to
the RTC_ALARM_TIME value, the RTC will generate an alarm interrupt. The interrupt status will remain until 0 is
written to RTC_ALARM_ENABLE.
In addition, the RTC provides battery low-voltage detection. When the battery voltage is lower than a certain level,
the RTC will generate an interrupt. After the software receives the low-voltage interrupt, it can immediately execute
the shutdown program and trigger the RTC to complete the power-off process to prevent abnormal errors in the sys-
tem.
As a chip power-on and power-off control unit, RTC itself cannot be soft-reset alone. In addition to the POR for the
first power-on, it can support a forced full-chip reset (including RTC) by pressing the RSTN button in case of an ab-
normality. After the RSTN button is released, all RTC registers are restored to their default values, and the state ma-
chine returns to its initial state. If the state machine detects that the battery voltage is in a normal state, it starts to
complete the chip power-on process according to the default value sequence and releases the system reset signal.
After the chip is powered on for the first time, the system needs to initialize the RTC. However, before initialization,
the 32KHz oscillator clock and second time need to be calibrated. The calibration module uses a 25MHz crystal
oscillator clock to sample a 32KHz clock, and cooperates with the software process operation. In the coarse tune
mode, a 32KHz clock cycle is sampled with a 25MHz crystal oscillator clock. The software adjusts the configura-
tion register RTC_ANA_CALIB[8:0] according to the number of sampling pulses, speeding up or slowing down
the 32KHz oscillation clock cycle time to improve 32KHz clock accuracy. After completing the coarse adjustment,
you can further enter the fine tune mode. The default value is to sample 256 32KHz clock cycles with a 25MHz
crystal oscillator clock. The software averages the number of sampled pulses to obtain the number of pulses re-
quired for counting the 32KHz clock in 1 second. And write the value to the register RTC_SEC_PULSE_GEN_INT,
RTC_SEC_PULSE_GEN_FRAC to complete the second calibration.
The 32KHz clock coarse adjustment software process is as follows:
1. Set register RTC_ANA_SEL_FTUNE to 0, and the initial value of RTC_ANA_CALIB is 0x100
2. The following uses the bindary search method to achieve calibration:
FTUNE = RTC_ANA_CALIB; offset = 0x80
3. Set the configuration register RTC_FC_COARSE_EN to 1 and start coarse adjustment. Poll the value of
RTC_FC_COARSE_TIME until it is greater than the previous read value, configure RTC_FC_COARSE_EN
to 0
4. Read RTC_FC_COARSE_VALUE and obtain the count value of a 32KHz clock cycle sampled by a 25MHz
clock.
if (RTC_FC_COARSE_VALUE > 770) FTUNE = FTUNE + offset;
if (RTC_FC_COARSE_VALUE < 755) FTUNE = FTUNE - offset;
Write FTUNE value back to register RTC_ANA_CALIB
offset = offset >> 1;
5. When the value of RTC_FC_COARSE_VALUE is between 755~770, the 32KHz clock accuracy has reached
32,768Hz ± 1%. Finish coarse adjustment. Otherwise, wait for 0.5ms and repeat steps 3 ~ 5, up to 8 times to
complete.
The 32KHz clock fine adjustment calibration software process is as follows:
7. Configure RTC_MACRO_DA_LATCH_PASS to 0
8. Configure RTC_MACRO_DA_SOC_READY to 0
9. Read RTC_MACRO_RO_T to get the counter value
The RTC will send status signals of alarm interruption and low-voltage detection interruption. When the sys-
tem receives the alarm interruption, it indicates that the scheduled time has expired, and the user can perform
corresponding custom operations. Set register RTC_ALARM_ENABLE to 0 to clear the interrupt status. If you
need to continue setting a new timing time, write the new value to the register RTC_ALARM_TIME and set
RTC_ALARM_ENABLE to 1 again.
The system software can power off the chip and enter the sleep state (suspend) by configuring the register
req_suspend to 1. The configuration register RTC_EN_PWR_WAKEUP selects the source that triggers the chip
wakeup. It should be noted that before configuring req_suspend, the register RTC_PG_REG must be written to 0
to allow the DDR IO to enter a constant state (retent) to avoid the DDR data to be damaged due to malfunction dur-
ing power-off or power-on of the chip. When the chip wakes up, the system software must write 1 to the register
RTC_PG_REG to release the protection state of the DDR IO before executing the DDR initialization process.
In addition, if you want to use buttons (PWR_ON, PWR_BUTTON, PWR_WAKEUP) to wake up, before entering
the sleep state, you must first configure the relevant IO PINMUX register and lock the IO as RTC input function.
By configuring the register req_shdn to 1, the system software can make the chip including DDR power off and enter
the shutdown state. The configuration register RTC_EN_PWR_UP selects the source that can trigger the chip power-
on.
The RTC register contains multiple parts, RTC_CORE_REG, RTC_MACRO_REG and RTC_CTRL_REG. The reg-
ister base addresses are different and they are all accessed through the bus.
The overview of RTC_CORE_REG register is shown in RTC_CORE_REG Overview (Base: 0x05026000).
6.6.1 RTC_CORE_REG
6.6.1.1 RTC_ANA_CALIB
30:18 Reserved
31 RTC_ANA_SEL_FTUNE R/W Select 32K OSC calibration value source 0x1
0 = Controlled by register
RTC_ANA_CALIB
1 = Controlled by hardware circuit
6.6.1.2 RTC_SEC_PULSE_GEN
6.6.1.3 RTC_ALARM_TIME
6.6.1.4 RTC_ALARM_ENABLE
6.6.1.5 RTC_SET_SEC_CNTR_VALUE
6.6.1.6 RTC_SET_SEC_CNTR_TRIG
6.6.1.7 RTC_SEC_CNTR_VALUE
6.6.1.8 RTC_INFO0
6.6.1.9 RTC_INFO1
6.6.1.10 RTC_INFO2
6.6.1.11 RTC_INFO3
6.6.1.12 RTC_NOPOR_INFO0
6.6.1.13 RTC_NOPOR_INFO1
6.6.1.14 RTC_NOPOR_INFO2
6.6.1.15 RTC_NOPOR_INFO3
6.6.1.16 RTC_APB_BUSY_SEL
6.6.1.17 RTC_DB_PWR_VBAT_DET
6.6.1.18 RTC_DB_BUTTON1
6.6.1.19 RTC_DB_PWR_ON
6.6.1.20 RTC_7SEC_RESET
6.6.1.21 RTC_THM_SHDN_AUTO_REBOOT
6.6.1.22 RTC_POR_DB_MAGIC_KEY
6.6.1.23 RTC_DB_SEL_PWR
6.6.1.24 RTC_UP_SEQ0
6.6.1.25 RTC_UP_SEQ1
6.6.1.26 RTC_UP_SEQ2
6.6.1.27 RTC_UP_SEQ3
6.6.1.28 RTC_UP_IF_EN
6.6.1.29 RTC_UP_RSTN
6.6.1.30 RTC_UP_MAX
6.6.1.31 RTC_DN_SEQ0
6.6.1.32 RTC_DN_SEQ1
6.6.1.33 RTC_DN_SEQ2
6.6.1.34 RTC_DN_SEQ3
6.6.1.35 RTC_DN_IF_EN
6.6.1.36 RTC_DN_RSTN
6.6.1.37 RTC_DN_MAX
6.6.1.38 RTC_PWR_CYC_MAX
6.6.1.39 RTC_WARM_RST_MAX
6.6.1.40 RTC_EN_7SEC_RST
6.6.1.41 RTC_EN_PWR_WAKEUP
6.6.1.42 RTC_EN_SHDN_REQ
6.6.1.43 RTC_EN_THM_SHDN
6.6.1.44 RTC_EN_PWR_CYC_REQ
6.6.1.45 RTC_EN_WARM_RST_REQ
6.6.1.46 RTC_EN_PWR_VBAT_DET
6.6.1.47 FSM_STATE
6.6.1.48 RTC_EN_WDG_RST_REQ
6.6.1.49 RTC_EN_SUSPEND_REQ
6.6.1.50 RTC_PG_REG
6.6.1.51 RTC_ST_ON_REASON
6.6.1.52 RTC_ST_OFF_REASON
6.6.1.53 RTC_EN_WAKEUP_REQ
6.6.1.54 RTC_PWR_WAKEUP_POLARITY
6.6.1.55 RTC_DB_SEL_REQ
6.6.1.56 RTC_PWR_DET_SEL
6.6.2 RTC_MACRO_REG
6.6.2.1 RTC_PWR_DET_COMP
6.6.2.2 RTC_MACRO_DA_CLEAR_ALL
6.6.2.3 RTC_MACRO_DA_SET_ALL
6.6.2.4 RTC_MACRO_DA_LATCH_PASS
6.6.2.5 RTC_MACRO_DA_SOC_READY
6.6.2.6 RTC_MACRO_PD_SLDO
6.6.2.7 RTC_MACRO_RG_DEFD
6.6.2.8 RTC_MACRO_RG_SET_T
6.6.2.9 RTC_MACRO_RO_CLK_STOP
6.6.2.10 RTC_MACRO_RO_DEFQ
6.6.2.11 RTC_MACRO_RO_T
6.6.3 RTC_CTRL_REG
6.6.3.1 RTC_CTRL0_UNLOCKKEY
6.6.3.2 RTC_CTRL0
6.6.3.3 RTC_CTRL_STATUS0
6.6.3.4 RTC_CTRL_STATUS1
6.6.3.5 rtc_ctrl_status2gpio
6.6.3.6 rtcsys_rst_ctrl
6.6.3.7 rtcsys_clkmux
6.6.3.8 rtcsys_mcu51_ctrl0
6.6.3.9 rtcsys_mcu51_ctrl1
6.6.3.10 rtcsys_pmu
To be continued . . . . . .
6.6.3.11 rtcsys_status
6.6.3.12 rtcsys_clkbyp
6.6.3.13 rtcsys_clk_en
6.6.3.14 rtcsys_wkup_ctrl
6.6.3.15 rtcsys_clkdiv
6.6.3.16 fc_coarse_en
6.6.3.17 fc_coarse_cal
6.6.3.18 fc_fine_en
6.6.3.19 fc_fine_period
6.6.3.20 fc_fine_cal
6.6.3.21 rtcsys_pmu2
6.6.3.22 rtcsys_clkdiv1
6.6.3.23 rtcsys_mcu51_dbg
6.6.3.24 sw_reg0
6.6.3.25 sw_reg1_por
6.6.3.26 fab_lp_ctrl
6.6.3.27 rtcsys_mcu51_ictrl1
6.6.3.28 rtc_ip_pwr_req
6.6.3.29 rtc_ip_iso_ctrl
6.6.3.30 rtcsys_wkup_ctrl1
6.6.3.31 rtcsys_sram_ctrl
6.6.3.32 rtcsys_io_ctrl
6.6.3.33 rtcsys_wdt_ctrl
6.6.3.34 rtcsys_irrx_clk_ctrl
6.6.3.35 rtcsys_rtc_wkup_ctrl
6.6.3.36 rtcsys_por_rst_ctrl
SEVEN
RESET
7.1 Overview
The reset management module uniformly manages the reset and timing of the entire chip, subsystem, and functional
modules.
81
CHAPTER 7. RESET
There are three levels of reset management modules inside the chip to manage the reset of the entire chip, subsys-
tems, and various functional modules.
The Reset Ctrl Level 1 circuit is responsible for the system power-on reset function. The power-on reset (POR) is
generated by the real-time clock module in conjunction with the global power management and crystal timing. For
details, refer to the section Real Time Clock. Level 1 Reset can be triggered in the following ways:
• Power on reset
• Overheat protection reset
• Watchdog reset: When RCT_CTRL0.hw_wdg_rst_en is 1 (see RTC_CTRL0, Offset Address: 0x008) and bit[0]
of sys_ctrl_reg.reg_sw_root_reset_en is 0 (see sys_ctrl_reg, Offset Address: 0x008), the watchdog timer times
out and triggers a system reset.
The Reset Ctrl Level 2 circuit is responsible for generating a System Hard Reset, which performs a hard reset on the
chip globally including subsystems and functional modules. Level 2 Reset can be triggered in the following ways:
• Watchdog reset: When bit[0] of sys_ctrl_reg.reg_sw_root_reset_en is 1 (see sys_ctrl_reg, Offset Address:
0x008), the watchdog timer times out and triggers a system reset.
• External reset pin (RSTN), which has beuilt-in debounce circuit, RSTN high and low level effective signals
must reach 6.56ms.
The Reset Ctrl Level 3 circuit is responsible for providing the reset configuration register (Reset CRG) corresponding
to the soft reset control. For details, refer to Reset configuration register. It includes:
• System soft reset: Reset the entire chip, except for a few circuits and RTC internal circuits.
• Processor subsystem reset: Resets the processor and processor subsystem. Programming of register
SOFT_CPUAC_RSTN can soft reset the processor and subsystem. After writing 0 to the configuration reg-
ister, the reset controller will wait for a 24us delay before triggering the corresponding processor reset. During
this period, the processor should end access to the bus to avoid the bus hanging after reset. After triggering the
reset, the corresponding reset signal will last for 8us and then be automatically released. The processor and
processor subsystem will complete the reset and start booting.
• Functional subsystem and modules reset: Reset each functional subsystem and functional modules. Program-
ming of register SOFT_RSTN_0 ~ 3 can soft reset each functional module. The reset configuration is active
low, and the reset signal will not be cleared automatically. Therefore, after the software configures the corre-
sponding register to 0 to trigger the reset, it also needs to be configured to 1 to release the reset. Before reset-
ting, make sure that the built-in DMA of each functional module and functional subsystem to the bus and the
processor to the module are idle. Otherwise, the reset will fail and the system may hang.
7.3.2.1 SOFT_RSTN_0
7.3.2.2 SOFT_RSTN_1
7.3.2.3 SOFT_RSTN_2
7.3.2.4 SOFT_RSTN_3
7.3.2.5 SOFT_CPUAC_RSTN
7.3.2.6 SOFT_CPU_RSTN
EIGHT
CLOCK
8.1 Overview
91
CHAPTER 8. CLOCK
XTAL_XIN is the PLL input clock, fixedly connected to the 25MHz crystal; RTC_XIN is the RTC input clock,
fixedly connected to the 32.768KHz crystal.
The clock of the entire system is mainly divided into two parts: PLL clocks and IP/Subsystem clocks.
The system clock source mainly comes from external XTAL. XTAL has its frequency multiplied by a PLL. As
shown in Clock source frequency division diagram, for each IP, XTAL is generally used as the initial clock source.
After being multiplied by one or more PLL clocks, each is processed by a frequency division circuit and then used as
clcok input for an IP or subsystem.
See PLL Configuration Parameters, the chip has 8 built-in PLLs (not counting Analog IP built-in PLL), which are
divided into two types of PLL: integer frequency multiplication and fractional frequency multiplication.
For more information on PLL Configuration/Control Registers, refer to PLL Control Register Overview and PLL
Control Register Description.
Clock source and preset frequency division parameter table lists all IP/Subsystem clocks and related information in
the system. The following is an introduction to IP/Subsystem clock related information based on this table.
• “CLK_NAME” is the clock name of the IP/Subsystem clock.
• Each IP/Subsystem clock can be switched on and off via registers (Gate function). The specific settings are
controlled by the registers clk_en_0, clk_en_1, clk_en_2, clk_en_3 and clk_en_4. Each bit controls a clock.
See clk_en_0, Offset Address: 0x000, clk_en_1, Offset Address: 0x004, clk_en_2, Offset Address: 0x008,
clk_en_3, Offset Address: 0x00c and clk_en_4, Offset Address: 0x010.
• The “DIV” column identifies whether the clock supports frequency division (Divide function), “Y” indicates
support, and empty indicates not support. Each clock that supports frequency division has a corresponding
DIV register for setting the division factor (Divider Factor). For example, clk_tpu corresponds to the [20:16]
bit field of div_clk_tpu.
• If a clock supports frequency division, there may be multiple parent clocks (PLL clock or xtal) as clock
sources for frequency division. These parent clocks are divided into two groups, DIV_IN0 and DIV_IN1,
which correspond to “DIV_IN0” column and the “DIV_IN1” column on the table respectively. Each group
contains one or more Sources. We can select the Source through the clk_src bit field of the DIV regis-
ter corresponding to the clock. Most clocks that support frequency division only need one set of Source,
namely DIV_IN0. A small number of clocks have two sets of Sources, including clk_a53, clk_c906_0 and
clk_c906_1. If a clock has two sets of Sources, then the clock has two corresponding DIV registers. For exam-
ple, clk_a53 corresponds to div_clk_a53_0 and div_clk_a53_1. We can select groups DIV_IN0 and DIV_IN1
through register clk_sel_0, the default is DIV_IN1 (Reset). The “PLL SRC/DIV/FREQ” column gives the
“Parent Clock”/”Division Factor”/”Frequency Value” selected by default for this clock. The software can
switch the clock source from XTAL to PLL after Boot, and adjust the clock frequency division configuration.
• The “XTAL” column identifies whether the clock supports bypassing its parent clock to xtal. “Y” indicates
support, and empty indicates not support. The specific settings are controlled by the registers clk_byp_0 and
clk_byp_1, see clk_byp_0, Offset Address: 0x030 and clk_byp_1, Offset Address: 0x034.
Table 8.4: Clock source and preset frequency division parameter table
CLK_NAME XTAL DIV PLL SRC DIV_IN0 DIV_IN1
/DIV/FREQ
clk_a53 Y Y fpll /(2)/750M tpll a0pll mip- mpll fpll
impll
clk_cpu_axi0 Y Y fpll /(3)/500M fpll disp-
pll
clk_cpu_gic Y Y fpll /(5)/300M fpll
clk_xtal_a53 xtal
clk_tpu Y Y fpll /(3)/500M tpll a0pll mip- fpll
impll
clk_tpu_fab mipimpll
clk_ahb_rom clk_axi4
clk_ddr_axi_reg clk_axi6
clk_rtc_25m xtal
clk_tempsen xtal
clk_saradc xtal
clk_efuse xtal
clk_apb_efuse xtal
clk_debug xtal
clk_xtal_misc xtal
continues on next page
1. Turn off the IP clock; if the clock cannot be turned off, you should first configure it to a stable frequency divi-
sion clock
1. CPU frequency conversion: configure clk_sel_0 to choose to switch to SRC1 to avoid too low frequency
2. IP frequency conversion: configure clk_byp_0/1 to switch the clock to XTAL
2. Configure the clock source and divider configuration to be adjusted
3. The frequency divider register [3] needs to be configured for this clock divider configuration to take effect.
4. Select the clock source to the configured clock divider
8.5.2 MCLK0/MCLK1
8.5.3 Clk_A24M
8.7.1.1 pll_g2_ctrl
8.7.1.2 pll_g2_status
8.7.1.3 mipimpll_csr
8.7.1.4 apll0_csr
8.7.1.5 disppll_csr
8.7.1.6 cam0pll_csr
8.7.1.7 cam1pll_csr
8.7.1.8 pll_g2_ssc_syn_ctrl
8.7.1.9 apll_ssc_syn_ctrl
8.7.1.10 apll_ssc_syn_set
8.7.1.11 disppll_ssc_syn_ctrl
8.7.1.12 disppll_ssc_syn_set
8.7.1.13 cam0pll_ssc_syn_ctrl
8.7.1.14 cam0pll_ssc_syn_set
8.7.1.15 cam1pll_ssc_syn_ctrl
8.7.1.16 cam1pll_ssc_syn_set
8.7.1.17 apll_frac_div_ctrl
8.7.1.18 apll_frac_div_m
8.7.1.19 apll_frac_div_n
8.7.1.20 mipimpll_clk_csr
8.7.1.21 a0pll_clk_csr
8.7.1.22 disppll_clk_csr
8.7.1.23 cam0pll_clk_csr
8.7.1.24 cam1pll_clk_csr
8.7.1.25 clk_cam0_src_div
8.7.1.26 clk_cam1_src_div
8.7.2.1 pll_g6_ctrl
8.7.2.2 pll_g6_status
8.7.2.3 mpll_csr
8.7.2.4 tpll_csr
8.7.2.5 fpll_csr
8.7.2.6 pll_g6_ssc_syn_ctrl
8.7.2.7 dpll_ssc_syn_ctrl
8.7.2.8 dpll_ssc_syn_set
8.7.2.9 dpll_ssc_syn_span
8.7.2.10 dpll_ssc_syn_step
8.7.2.11 mpll_ssc_syn_ctrl
8.7.2.12 mpll_ssc_syn_set
8.7.2.13 mpll_ssc_syn_span
8.7.2.14 mpll_ssc_syn_step
8.7.2.15 tpll_ssc_syn_ctrl
8.7.2.16 tpll_ssc_syn_set
8.7.2.17 tpll_ssc_syn_span
8.7.2.18 tpll_ssc_syn_step
8.9.1 clk_en_0
8.9.2 clk_en_1
8.9.3 clk_en_2
8.9.4 clk_en_3
8.9.5 clk_en_4
8.9.6 clk_sel_0
8.9.7 clk_byp_0
8.9.8 clk_byp_1
8.9.9 div_clk_a53_0
8.9.10 div_clk_a53_1
8.9.11 div_clk_cpu_axi0
8.9.12 div_clk_cpu_gic
8.9.13 div_clk_tpu
8.9.14 div_clk_emmc
8.9.15 div_clk_100k_emmc
8.9.16 div_clk_sd0
8.9.17 div_clk_100k_sd0
8.9.18 div_clk_sd1
8.9.19 div_clk_100k_sd1
8.9.20 div_clk_spi_nand
8.9.21 div_clk_500m_eth0
8.9.22 div_clk_gpio_db
8.9.23 div_clk_sdma_aud0
8.9.24 div_clk_sdma_aud1
8.9.25 div_clk_sdma_aud2
8.9.26 div_clk_sdma_aud3
8.9.27 div_clk_cam0_200
8.9.28 div_clk_axi4
8.9.29 div_clk_axi6
8.9.30 div_clk_dsi_esc
8.9.31 div_clk_axi_vip
8.9.32 div_clk_src_vip_sys_0
8.9.33 div_clk_src_vip_sys_1
8.9.34 div_clk_disp_src_vip
8.9.35 div_clk_axi_video_codec
8.9.36 div_clk_vc_src0
8.9.37 div_clk_1m
8.9.38 div_clk_spi
8.9.39 div_clk_i2c
8.9.40 div_clk_src_vip_sys_2
8.9.41 div_clk_audsrc
8.9.42 div_clk_pwm_src_0
8.9.43 div_clk_ap_debug
8.9.44 div_clk_rtcsys_src_0
8.9.45 div_clk_c906_0_0
8.9.46 div_clk_c906_0_1
8.9.47 div_clk_c906_1_0
8.9.48 div_clk_c906_1_1
8.9.49 div_clk_src_vip_sys_3
8.9.50 div_clk_src_vip_sys_4
NINE
SYSTEM CONTROLLER
9.1 Overview
The system controller implements some system control and enablement of the chip through registers, including sys-
tem soft reset, clock control, etc. The reset clock has been described in other chapters. This chapter describes the
configuration and status registers of some other system function modules.
143
CHAPTER 9. SYSTEM CONTROLLER
System global soft reset, debug reset and watchdog reset need to be enabled by configuring the reg_sw_root_reset_en
register. Details of each bit are described in reg_sw_root_reset_en.
This chip system has 8 built-in DMA channels, each configured with 0 ~ 7 channel request interfaces. Channel re-
quests from 0 to 7 are mapped to one of the peripheral interfaces in the table below by the system control registers
sdma_dma_ch_remap0 and sdma_dma_ch_remap1. Note that multiple channels cannot be configured as the same
peripheral interface.
Configuration steps:
Configure the DMA channel image register sdma_dma_ch_remap0, sdma_dma_ch_remap1, update_dma_remp_0_3,
update_dma_remp_4_7 and write 1 to make the mapping effective.
The system DMA channel mapping is as follows:
The AXI transmission priority from the subsystem can be configured by ddr_axi_urgent_ow, ddr_axi_urgent,
ddr_axi_qos_0, ddr_axi_qos_1 of the control system controller. For details, please refer to the DDR controller chap-
ter DDR Controller.
9.3.2.1 conf_info
9.3.2.2 sys_ctrl_reg
9.3.2.3 usb_phy_ctrl_reg
9.3.2.4 sdma_dma_ch_remap0
9.3.2.5 sdma_dma_ch_remap1
9.3.2.6 top_timer_clk_sel
9.3.2.7 top_wdt_ctrl
9.3.2.8 ddr_axi_urgent_ow
9.3.2.9 ddr_axi_urgent
9.3.2.10 ddr_axi_qos_0
9.3.2.11 ddr_axi_qos_1
9.3.2.12 sd_pwrsw_ctrl
9.3.2.13 sd_pwrsw_time
9.3.2.14 ddr_axi_qos_ow
9.3.2.15 sd_ctrl_opt
9.3.2.16 sdma_dma_int_mux
TEN
10.1.1.1 ADC
153
CHAPTER 10. PINMUX AND PINCTRL
10.1.1.3 Audio
10.1.1.4 Ethernet
10.1.1.5 DSI/LVDS
10.1.1.6 CSI/sLVDS/HiSPI
10.1.1.11 eMMC
10.1.1.12 SPI_NAND
10.1.1.13 SPI_NOR
10.1.1.14 I2C
To be continued . . . . . .
10.1.1.16 IIS
To be continued . . . . . .
10.1.1.17 PWM
10.1.1.19 System
10.1.1.21 SPI_NOR1
10.1.1.22 SD1
10.1.1.23 SD0
10.1.1.24 SPI
To be continued . . . . . .
10.1.1.25 UART
10.1.1.27 Wiegand
10.1.1.28 GPIO
10.1.1.30 Debug
10.1.1.31 Others
10.2.2.1 IOBLK_G1_REG_PWM0_BUCK
10.2.2.2 IOBLK_G1_REG_ADC1
10.2.2.3 IOBLK_G1_REG_PKG_TYPE0
10.2.2.4 IOBLK_G1_REG_USB_VBUS_DET
10.2.2.5 IOBLK_G1_REG_PKG_TYPE1
10.2.2.6 IOBLK_G1_REG_PKG_TYPE2
10.2.2.7 IOBLK_G7_REG_SD0_CD
10.2.2.8 IOBLK_G7_REG_SD0_PWR_EN
10.2.2.9 IOBLK_G7_REG_SPK_EN
10.2.2.10 IOBLK_G7_REG_UART0_TX
10.2.2.11 IOBLK_G7_REG_UART0_RX
10.2.2.12 IOBLK_G7_REG_EMMC_DAT2
10.2.2.13 IOBLK_G7_REG_EMMC_CLK
10.2.2.14 IOBLK_G7_REG_EMMC_DAT0
10.2.2.15 IOBLK_G7_REG_EMMC_DAT3
10.2.2.16 IOBLK_G7_REG_EMMC_CMD
10.2.2.17 IOBLK_G7_REG_EMMC_DAT1
10.2.2.18 IOBLK_G7_REG_JTAG_CPU_TMS
10.2.2.19 IOBLK_G7_REG_JTAG_CPU_TCK
10.2.2.20 IOBLK_G7_REG_IIC0_SCL
10.2.2.21 IOBLK_G7_REG_IIC0_SDA
10.2.2.22 IOBLK_G7_REG_AUX0
10.2.2.23 IOBLK_G10_REG_SD0_CLK
10.2.2.24 IOBLK_G10_REG_SD0_CMD
10.2.2.25 IOBLK_G10_REG_SD0_D0
10.2.2.26 IOBLK_G10_REG_SD0_D1
10.2.2.27 IOBLK_G10_REG_SD0_D2
10.2.2.28 IOBLK_G10_REG_SD0_D3
10.2.2.29 IOBLK_G12_REG_PAD_MIPIRX4N
10.2.2.30 IOBLK_G12_REG_PAD_MIPIRX4P
10.2.2.31 IOBLK_G12_REG_PAD_MIPIRX3N
10.2.2.32 IOBLK_G12_REG_PAD_MIPIRX3P
10.2.2.33 IOBLK_G12_REG_PAD_MIPIRX2N
10.2.2.34 IOBLK_G12_REG_PAD_MIPIRX2P
10.2.2.35 IOBLK_G12_REG_PAD_MIPIRX1N
10.2.2.36 IOBLK_G12_REG_PAD_MIPIRX1P
10.2.2.37 IOBLK_G12_REG_PAD_MIPIRX0N
10.2.2.38 IOBLK_G12_REG_PAD_MIPIRX0P
10.2.2.39 IOBLK_G12_REG_PAD_MIPI_TXM2
10.2.2.40 IOBLK_G12_REG_PAD_MIPI_TXP2
10.2.2.41 IOBLK_G12_REG_PAD_MIPI_TXM1
10.2.2.42 IOBLK_G12_REG_PAD_MIPI_TXP1
10.2.2.43 IOBLK_G12_REG_PAD_MIPI_TXM0
10.2.2.44 IOBLK_G12_REG_PAD_MIPI_TXP0
10.2.2.45 IOBLK_G12_REG_GPIO_RTX
10.2.2.46 IOBLK_GRTC_REG_PWR_VBAT_DET
10.2.2.47 IOBLK_GRTC_REG_PWR_RSTN
10.2.2.48 IOBLK_GRTC_REG_PWR_SEQ1
10.2.2.49 IOBLK_GRTC_REG_PWR_SEQ2
10.2.2.50 IOBLK_GRTC_REG_PTEST
10.2.2.51 IOBLK_GRTC_REG_PWR_WAKEUP0
10.2.2.52 IOBLK_GRTC_REG_PWR_BUTTON1
10.2.2.53 IOBLK_GRTC_REG_XTAL_XIN
10.2.2.54 IOBLK_GRTC_REG_PWR_GPIO0
10.2.2.55 IOBLK_GRTC_REG_PWR_GPIO1
10.2.2.56 IOBLK_GRTC_REG_PWR_GPIO2
10.2.2.57 IOBLK_GRTC_REG_SD1_D3
10.2.2.58 IOBLK_GRTC_REG_SD1_D2
10.2.2.59 IOBLK_GRTC_REG_SD1_D1
10.2.2.60 IOBLK_GRTC_REG_SD1_D0
10.2.2.61 IOBLK_GRTC_REG_SD1_CMD
10.2.2.62 IOBLK_GRTC_REG_SD1_CLK
10.2.2.63 IOBLK_GRTC_REG_GPIO_ZQ
ELEVEN
DMA CONTROLLER
11.1 Overview
DMA (Direct Memory Access) does not require the CPU to interfere with data one by one. Data can be transferred
directly between the memory and the device. This mechanism greatly reduces the CPU control time and increases
the data transfer rate. It is very suitable for use in large amounts of data transfer. When the chip is working, it often
requires multiple channels of data transmission at the same time. One channel requires a DMA hardware support,
and the DMAC (DMA Controller) is responsible for the control of multiple channels. Diagram DMAC hardware
control flow diagram is a DMAC hardware control flow chart. The source and destination devices can be in differ-
ent AXI sinks.
237
CHAPTER 11. DMA CONTROLLER
11.2 Features
DMA has 8 built-in DMA channels, and each channel’s peripheral request needs to be configured to be mapped to
the peripheral. Please refer to System DMA channel mapping instructions to configure the DMA channel before en-
abling it.
DMA data transmission is set in blocks and completed by burst transmission. The length of burst transmission can
be set, but what often happens is that the amount of block data is not perfectly an integer multiple of the burst trans-
mission length. The length of the last transaction transmitted will be less than the set burst transmission length, and a
single transmission request will be required to complete it.
The sources and destinations of the maximum supported 8 DMA channels can have the following four combinations:
a. RAM to RAM.
b. Memory to device.
c. Device to memory.
d. Device to device.
The amount of data to be transferred individually can be calculated by the value written to the following scratchpad
• Source transfer data volume (bytes):
src_single_size_bytes = CHx_CTL.SRC_TR_WIDTH/8
• Source burst transfer data volume (bytes):
src_burst_size_bytes = CHx_CTL.SRC_MSIZE * src_single_size_bytes
• Target transfer data volume (bytes):
dst_single_size_bytes = CHx_CTL.DST_TR_WIDTH/8
• Target burst transfer data volume (bytes):
dst_burst_size_bytes = CHx_CTL.DST_MSIZE * dst_single_size_bytes
The transmission process control can be controlled by the DMA controller or the source device or the destination
device. When performing block data transfer, the amount of data transferred is calculated as follows:
• The transfer process is controlled by the DMA controller:
blk_size_bytes_dma = CHx_BLOCK_TS.BLOCK_TS * src_single_size_bytes
• The source device controls the transfer process:
blk_size_bytes_src = (number of block burst transfers issued by the source device * src_burst_size_bytes) +
(number of individual block transfers from source device * src_single_size_bytes)
• The destination device controls the transfer process:
blk_size_bytes_dst = (number of block burst transfers sent by the destination device * dst_burst_size_bytes) +
(Number of separate transfers of destination device blocks * dst_single_size_bytes)
Linked-list transmission is used when block transmission of multiple discontinuous addresses is required. Each block
of data will be followed by a linked-list information to store the information of the next node, so that no CPU inter-
vention is required during data transmission. Block transfer of the next discontinuous space can be performed di-
rectly. Diagram Linked list relative address and data format is the configuration format of the linked list information.
It must comply with the information format to enter the linked list transmission work.
Channel security can be implemented by the awprot value and arprot value of each channel. It complies with the
AXI bus protocol. When the channel is a safe channel, the arprot or awprot value needs to be 0x0. If it is other val-
ues, it is an unsafe channel.
The DMAC clock is enabled by writing 0x1 to CLK_EN_1[1], so that the clock can work normally. Writing
REG_SOFT_RESET_X_SDMA_INIT to 0x0 resets the DMAC, writing 0x1 takes the DMAC out of reset.
11.4.2 Initialization
It can support up to 8 channels for simultaneous transmission. After initialization, the DMAC channel needs to be
enabled before data transmission can begin. You can refer to the following steps for memory-to-memory data trans-
mission.
• Read the register DMAC_ChEnReg to obtain the idle channel.
• Write 0x0 to the channel register SRC_MULTBLK_TYPE and DST_MULTBLK_TYPE respectively to con-
figure continuous block transfer.
• Write 0x0 to register TT_FC to configure the channel for memory-to-memory data transfer.
• Write the transferred information into the registers CHx_SAR, CHx_ADR, CHx_BLOCK_TS, CHx_CTL.
• Write 0x1 to the register DMAC_ChEnReg to enable the selected DMA channel.
• Software can obtain the BLOCK_TFR_DONE status through interrupts or polling. When its value rises to
1, it means that the data transmission has been completed. Then write 0x0 to DMAC_ChEnReg to close the
channel and restore it to an idle channel.
Linked-list transfer does not limit the number of nodes. Except for the end node, each node must store information
pointing to the next node. Linked-list transfer can be completed by referring to the following steps.
1. Read the register DMAC_ChEnReg to obtain the idle channel.
2. Write 0x3 to the channel register SRC_MULTBLK_TYPE and DST_MULTBLK_TYPE respectively to con-
figure linked list transmission.
3. Configure the registers CHx_LLP, CHx_CTL.ShadowReg_Or_LLI_Valid, CHx_CTL.LLI_Last, and write the
information required to point to the first node.
4. Write 0x1 to the register DMAC_ChEnReg to enable the selected DMA channel.
5. The software can obtain the BLOCK_TFR_DONE status through interrupts or polling. When its value rises to
1, it means that the last node data transmission has been completed, and then writes 0x0 to DMAC_ChEnReg
to close the channel and restore it to an idle channel.
11.5.1 DMAC_IDREG
11.5.2 DMAC_COMPVERREG
11.5.3 DMAC_CFGREG
31:2 Reserved
11.5.4 DMAC_CHENREG
11.5.5 DMAC_INTSTATUSREG
11.5.6 DMAC_COMMONREG_INTCLEARREG
11.5.7 DMAC_COMMONREG_INTSTATUS_ENABLEREG
11.5.8 DMAC_COMMONREG_INTSIGNAL_ENABLEREG
11.5.9 DMAC_COMMONREG_INTSTATUSREG
To be continued . . . . . .
To be continued . . . . . .
31:9 Reserved
11.5.10 DMAC_RESETREG
11.5.11 CHx_SAR
11.5.12 CHx_DAR
11.5.13 CHx_BLOCK_TS
11.5.14 CHx_CTL
1 Reserved
2 DMS R/W Destination Master Select. 0x0
Identifies the Master Interface layer from
which the destination device (peripheral or
memory) is accessed.
• 0: AXI master 1
• 1: AXI Master 2
3 Reserved
4 SINC R/W Source Address Increment. 0x0
Indicates whether to increment the source
address on every source transfer. If the de-
vice is fetching data from a source periph-
eral FIFO with a fixed address, then set this
field to ‘No change’.
• 0: Increment
• 1: No Change
5 Reserved
6 DINC R/W Destination Address Increment. 0x0
Indicates whether to increment the destina-
tion address on every destination transfer.
If the device is writing data from a source
peripheral FIFO with a fixed address, then
set this field to ‘No change’.
• 0: Increment
• 1: No Change
7 Reserved
10:8 SRC_TR_WIDTH R/W Source Transfer Width. 0x0
Mapped to AXI bus arsize, this
value must be less than or equal to
DMAX_M_DATA_WIDTH.
13:11 DST_TR_WIDTH R/W Destination Transfer Width. 0x0
Mapped to AXI bus awsize, this
value must be less than or equal to
DMAX_M_DATA_WIDTH.
To be continued . . . . . .
31 Reserved
34:32 AR_PROT R/W AXI ‘ar_prot’ signal 0x0
37:35 AW_PROT R/W AXI ‘aw_prot’ signal 0x0
38 ARLEN_EN R/W Source Burst Length Enable 0x0
If this bit is set to 1, DW_axi_dmac uses
the value of CHx_CTL.ARLEN as AXI
Burst length for source data transfer till the
extent possible; remaining transfers use
maximum possible burst length.
If this bit is set to 0, DW_axi_dmac
uses any possible value
that is less than or equal to
DMAX_CHx_MAX_AMBA_BURST_LENGTH
as AXI Burst length for source data trans-
fer.
To be continued . . . . . .
To be continued . . . . . .
11.5.15 CHx_CFG
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
11.5.16 CHx_LLP
11.5.17 CHx_STATUSREG
11.5.18 CHx_SWHSSRCREG
11.5.19 CHx_SWHSDSTREG
11.5.20 CHx_BLK_TFR_RESUMEREQREG
11.5.21 CHx_AXI_IDREG
11.5.22 CHx_AXI_QOSREG
11.5.23 CHx_SSTAT
11.5.24 CHx_DSTAT
11.5.25 CHx_SSTATAR
11.5.26 CHx_DSTATAR
11.5.27 CHx_INTSTATUS_ENABLEREG
2 Reserved
3 Enable_SRC_TRANSCOMP_IntStat R/W Source Transaction Completed Sta- 0x0
tus Enable.
• 0: Disable the genera-
tion of Source Transac-
tion Complete Interrupt in
CHx_INTSTATUSREG
• 1: Enable the genera-
tion of Source Transac-
tion Complete Interrupt in
CHx_INTSTATUSREG
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
15 Reserved
16 Enable_SLVIF_DEC_ERR_IntStat R/W Slave Interface Decode Error Status 0x0
Enable.
• 0: Disable the genera-
tion of Slave Interface De-
code Error Interrupt in
CHx_INTSTATUSREG
• 1: Enable the generation
of Slave Interface De-
code Error Interrupt in
CHx_INTSTATUSREG
To be continued . . . . . .
To be continued . . . . . .
11.5.28 CHx_INTSTATUS
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
26:22 Reserved
27 CH_LOCK_CLEARED_IntStat RO Channel Lock Cleared.
This indicates to the software that the
locking of the corresponding channel
in DW_axi_dmac is cleared.
• 0: Channel locking is not
cleared.
• 1: Channel locking is cleared.
To be continued . . . . . .
11.5.29 CHx_INTSIGNAL_ENABLEREG
2 Reserved
3 Enable_SRC R/W Source Transaction Completed Signal En- 0x0
_TRANSCOMP_IntSignal able.
• 0: Disable the propagation of Source
Transaction Complete Interrupt to
generate a port level interrupt
• 1: Enable the propagation of Source
Transaction Complete Interrupt to
generate a port level interrupt
To be continued . . . . . .
To be continued . . . . . .
14 Enable_SLVIF_MULTIB LK- R/W Slave Interface Multi Block type Error Sig- 0x0
TYPE_ERR_IntSignal nal Enable.
• 0: Disable the propagation of Slave
Interface Multi Block type Error In-
terrupt to generate a port level inter-
rupt
• 1: Enable the propagation of Slave
Interface Multi Block type Error In-
terrupt to generate a port level inter-
rupt
15 Reserved
16 Enable_SLV R/W Slave Interface Decode Error Signal En- 0x0
IF_DEC_ERR_IntSignal able.
• 0: Disable the propagation of Slave
Interface Decode Error Interrupt to
generate a port level interrupt
• 1: Enable the propagation of Slave
Interface Decode Error Interrupt to
generate a port level interrupt
To be continued . . . . . .
21 Enable_SLVIF_WR ON- R/W Slave Interface Write On Hold Error Signal 0x0
HOLD_ERR_IntSignal Enable.
• 0: Disable the propagation of Slave
Interface Write On Hold Error Inter-
rupt to generate a port level interrupt
• 1: Enable the propagation of Slave
Interface Write On Hold Error Inter-
rupt to generate a port level interrupt
26:22 Reserved
To be continued . . . . . .
11.5.30 CHx_INTCLEARREG
To be continued . . . . . .
To be continued . . . . . .
TWELVE
TIMERS
12.1 Overview
The system is configured with 8 Timer modules providing timing and counting function. These timers can be used
to implement timing and counting for applications, and can also be used for the operating system to implement the
system clock.
305
CHAPTER 12. TIMERS
12.2 Features
Timer is based on a 32-bit down counter. The counter value is decremented by 1 on each rising edge of the count
clock. When the count value decreases to zero, the Timer will generate an interrupt.
Timer has the following 2 counting modes:
• Free running mode: The timer continues to count, and when the count value decreases to 0, it automatically
returns to its maximum value and continues counting. The maximum count length is 0xFFFF_FFFF.
• User-defined counting mode: The timer continues to count. When the count value decreases to 0, the initial
value is loaded again from the TimerNLoadCount (N=1~8) register and continues counting.
The method of loading the initial count value of the timer is as follows:
The initial count value of the timer can be loaded by writing the TimerNLoadCount (N=1~8) register.
12.4.1 Initialization
• Step 1: Write the TimerNLoadCount (N=1~8) register to load the initial count value for the Timer.
• Step 2: Set the TimerNControlReg[2:0] (N=1~8) register, select the Timer counting mode, mask the Timer
interrupt, and start the Timer to start counting.
System Timer optional 25MHz/32KHz counting clock. Use reg_timer_clk_sel to make the selection.
12.6.1 Timer1LoadCount
12.6.2 Timer1CurrentValue
12.6.3 Timer1ControlReg
12.6.4 Timer1EOI
12.6.5 Timer1IntStatus
12.6.6 TimersIntStatus
12.6.7 TimersEOI
12.6.8 TimersRawIntStatus
THIRTEEN
WATCHDOG
13.1 Overview
The system is configured with 4 watchdog modules. It is used to issue an interrupt or reset signal after a certain pe-
riod of time to interrupt or reset the entire system when an abnormality occurs in the system.
313
CHAPTER 13. WATCHDOG
13.2 Features
The system configures register parameter values for WatchDog through the system bus. WatchDog periodically
sends WDT_INTR interrupt requests to the system, and when the system does not respond to the interrupt (such as
crashes), it sends a WDT_SYS_RST reset signal to reset the system to achieve the purpose of monitoring system op-
eration.
WatchDog runs based on a 32-bit down counter. Its initial count value has two sources, loaded from WDT_ITORR
and WDT_TORR respectively, and calculated based on the value of ITOR_MODE (for specific calculation methods,
refer to the description in WDT_TORR, Offset Address: 0x004). WDT_ITORR is used for the first timer count of
WatchDog after power-on, and subsequent timer counts are based on WDT_TORR.
When the WatchDog clock is enabled, the count value is decremented by 1 on the rising edge of each count clock.
When the count value decreases to 0, WatchDog will generate an interrupt. Then at the next rising edge of the count-
ing clock, the counter reloads the initial counting value from the register WDT_TORR and starts counting down.
The user can set the register WDT_CR[1] to decide whether to send a reset signal WDT_SYS_RST immediately
when the counter count value decreases to 0 for the first time. If it is set to 0, a reset signal is sent immediately. Oth-
erwise, if it is 1, an interrupt is generated and the second count starts. If the CPU has not cleared the WatchDog inter-
rupt when the second count decreases to 0, WatchDog will send a reset signal WDT_SYS_RST and the counter will
stop counting.
WatchDog counting clock is 25MHz/32KHz clock. Use reg_wdt_clk_sel to make the selection.
After the system is powered on and reset, the WatchDog counter stops counting. During the system initialization pro-
cess, WatchDog needs to be initialized and started to run. The initialization process of WatchDog is as follows:
• Step 1: Write register WDT_TORR to set the initial value of WatchDog count.
• Step 2: Write register WDT_CR[1] to set WatchDog count timeout response mode.
• Step 3: Write register WDT_CR[0] to start WatchDog counting.
After the system receives an interrupt from WatchDog, it should clear its interrupt status in time.
The process of WatchDog interrupt processing is as follows:
• Step 1: Read the register WDT_EOI and clear the interrupt status of WatchDog.
• Step 2: Write 0x76 to the register WDT_CRR and restart WatchDog.
The WDT register is accessed via the bus. Includes four WDTs, 3 are Active Domains, and 1 is No-die Domain.
Their base addresses are:
• WDT0: 0x03010000
• WDT1: 0x03011000
• WDT2: 0x03012000
• RTCSYS_WDT: 0x0502D000
Each WDT consists of a set of control registers, each set has the same definition, and an overview is shown in WDT
Registers Overview.
13.6.1 WDT_CR
13.6.2 WDT_TORR
13.6.3 WDT_CCVR
13.6.4 WDT_CRR
13.6.5 WDT_STAT
13.6.6 WDT_EOI
13.6.7 WDT_TOC
FOURTEEN
8051 SUBSYSTEM
14.1 Overview
The 8051 subsystem is located within RTCSYS and is independently powered. System software can use the 8051
to manage wake conditions and wake the system while the system is asleep, and communicate with external devices
through peripheral controllers.
321
CHAPTER 14. 8051 SUBSYSTEM
14.2 Features
The RTCSYS subsystem is divided into two power domains: AO (Always-On) domain and MCU domain. The MCU
domain can be powered on and off through the configuration register. The process is as follows:
MCU power_off:
1. Soft reset register = 0
2. Set register reg_mcu_iso_en = 1
3. Set register reg_mcu_pwr_req = 0
MCU power_on:
1. Set register reg_mcu_pwr_req = 1
2. Polling register reg_mcu_pwr_ack = 1
3. Set register reg_mcu_iso_en = 0
4. Soft reset register = 1
8051 is in reset state at the beginning of the system. Using 8051, you can complete the following software process
through ACPU:
1. The 8051 reset state is in reset state (register reg_soft_rstn_mcu = 0).
2. Configure the register reg_mcu_rom_addr_size to determine the instruction TCM size.
3. Configure the register reg_51irom_ioffset to determine the location on the AHB SRAM where TCM is exe-
cuted.
4. Configure register reg_soft_rstn_mcu =1 to release the 8051 reset state.
8051 can receive external level-triggered interrupts through the int0_n and int1_n interfaces. int0_n/int1_n selects to
output interrupt signals to 8051 from ictl (interrupt control) and configuration register reg_51_int1_src_mask respec-
tively.
14.3.4 MAILBOX
Mailbox provides 2 sets of spinlock function fields and 4 sets of 32bit information fields, allowing ACPU/8051 to
transmit information to each other.
The registers of the 8051 subsystem are defined in the RTC CTRL register. For details, refer to the
RTC_CTRL_REG section of the RTC Register Overview chapter.
The registers of the 8051 subsystem are defined in the RTC CTRL register, please refer to the RTC_CTRL_REG sec-
tion for details.
FIFTEEN
DDR CONTROLLER
15.1 Overview
The DDR controller implements data access to dynamic memory (DRAM). It converts the data access commands of
each master device in the SoC into dynamic memory commands that comply with the JEDEC standard, and sched-
ules them appropriately, thereby improving the use efficiency of the dynamic memory bus.
327
CHAPTER 15. DDR CONTROLLER
15.2 Features
Function Features:
• Support:
– DDR2 maximum data rate 1333 Mbps.
– DDR3 maximum data rate 1866 Mbps.
• Supports interface data width 16-bit.
• Supports single channel, single rank.
• Support automatic refresh control.
• Support priority control.
• Support data traffic statistics.
• Support low power consumption mode.
• Support address mapping.
• Support pin multiplexing.
The DRAM interface supports 16-bit data width and 32-bit data width. SoC/DRAM interconnection diagram is the
interconnection diagram between the main chip and the single-chip DRAM device:
Command is consists of several signals, which vary depending on the DRAM type. Table DDR2/DDR3 command
signal comparison table compares command signals for DDR2 and DDR3:
Based on the storage characteristics of DRAM, JEDEC developed a set of standards that specify the commands and
timing required to access DRAM data and control DRAM status. By properly configuring the DDR register, the
DDR controller can issue timing sequences that meet JEDEC standards to complete actions such as reading, writing,
and low-power control.
The DDR interface timing meets the JDEDC standard. Following are table DDR2 Command Truth Table and table
DDR3 Command Truth Table. They are the truth tables of DDR2 and DDR3 support commands for user reference.
The rest of the information can refer to the JEDEC standard.
The DDR controller has the ability to control the automatic refresh function. The purpose of controlling automatic
refresh is to reduce the delay in accessing data or reduce the impact of refresh commands on DRAM bandwidth. Try
to send refresh commands when the DRAM is idle. The specific available methods are:
• Refresh at equal intervals: Send a refresh command every tREFI time.
• Tricky refresh: The DDR controller internally counts the number of expired tREFIs, and then uses idle time to
continuously send them.
The DDR controller mainly optimizes the bandwidth usage of the system based on various DRAM control timings,
and schedules each command through a priority scheduling algorithm. In addition, DDRC also implements two
scheduling auxiliary means, timeout control and real-time control (these two control means are enabled according
to business needs, and can be enabled at the same time or separately) to control command requests. .
• Consecutive address access restrictions
The limit level is: 0 ~ 15 DRAM read/write instructions, and the configuration of each AXI port is indepen-
dent. The DDR controller has high priority for contiguous addresses by default to optimize DRAM utilization.
This mechanism limits the maximum length of contiguous DRAM that can be accessed by each AXI port.
• Priority scheduling
The priority level is: 0 ~ 15. The higher the value, the higher the priority. The read/write priority configuration
of each AXI port is independent.
• Timeout control
For read/write transfers of each AXI port, the timeout register can be configured to avoid too long waiting.
After the waiting time is reached, AXI ports that have not yet reached the waiting time or that have not been
configured with the timeout attribute are forcibly blocked.
• Real-time control
For real-time functions, the hardware buffering threshold can be configured. If the buffering is insufficient, the
priority will be automatically raised to the highest level, and other AXI ports can be restricted from generating
new transmissions.
The DDR controller supports traffic statistics function: it can count the read and write traffic of each AXI port to col-
lect current traffic information to determine whether flow control is required. Statistics of overall DRAM read/write
traffic can be collected.
The DDR controller supports the AXI latency statistics function and supports cumulative latency statistics for speci-
fied/unspecified transmissions.
The DDR controller converts the access address of the system bus into the access address of the DRAM. Can imple-
ment RBC (row_bank_column), BRC, and support bank interleave in row/column bit.
15.5.2.1 AXI_CTRL0_1
15.5.2.2 AXI_CTRL1_1
15.5.2.3 AXI_CTRL0_2
15.5.2.4 AXI_CTRL1_2
15.5.2.5 AXI_CTRL0_3
15.5.2.6 AXI_CTRL1_3
15.5.3.1 AXI_MON0_CTRL
15.5.3.2 AXI_MON0_INPUT
15.5.3.3 AXI_MON0_FILTER0
15.5.3.4 AXI_MON0_FILTER1
15.5.3.5 AXI_MON0_FILTER2
15.5.3.6 AXI_MON0_FILTER3
15.5.3.7 AXI_MON0_FILTER4
15.5.3.8 AXI_MON0_FILTER5
15.5.3.9 AXI_MON0_FILTER6
15.5.3.10 AXI_MON0_FILTER7
15.5.3.11 AXI_MON0_FILTER8
15.5.3.12 AXI_MON0_RPT0
15.5.3.13 AXI_MON0_RPT1
15.5.3.14 AXI_MON0_RPT2
15.5.3.15 AXI_MON0_RPT3
15.5.3.16 AXI_MON1_CTRL
15.5.3.17 AXI_MON1_INPUT
15.5.3.18 AXI_MON1_FILTER0
15.5.3.19 AXI_MON1_FILTER1
15.5.3.20 AXI_MON1_FILTER2
15.5.3.21 AXI_MON1_FILTER3
15.5.3.22 AXI_MON1_FILTER4
15.5.3.23 AXI_MON1_FILTER5
15.5.3.24 AXI_MON1_FILTER6
15.5.3.25 AXI_MON1_FILTER7
15.5.3.26 AXI_MON1_FILTER8
15.5.3.27 AXI_MON1_RPT0
15.5.3.28 AXI_MON1_RPT1
15.5.3.29 AXI_MON1_RPT2
15.5.3.30 AXI_MON1_RPT3
15.5.3.31 AXI_MON2_CTRL
15.5.3.32 AXI_MON2_INPUT
15.5.3.33 AXI_MON2_FILTER0
15.5.3.34 AXI_MON2_FILTER1
15.5.3.35 AXI_MON2_FILTER2
15.5.3.36 AXI_MON2_FILTER3
15.5.3.37 AXI_MON2_FILTER4
15.5.3.38 AXI_MON2_FILTER5
15.5.3.39 AXI_MON2_FILTER6
15.5.3.40 AXI_MON2_FILTER7
15.5.3.41 AXI_MON2_FILTER8
15.5.3.42 AXI_MON2_RPT0
15.5.3.43 AXI_MON2_RPT1
15.5.3.44 AXI_MON2_RPT2
15.5.3.45 AXI_MON2_RPT3
15.5.3.46 AXI_MON3_CTRL
15.5.3.47 AXI_MON3_INPUT
15.5.3.48 AXI_MON3_FILTER0
15.5.3.49 AXI_MON3_FILTER1
15.5.3.50 AXI_MON3_FILTER2
15.5.3.51 AXI_MON3_FILTER3
15.5.3.52 AXI_MON3_FILTER4
15.5.3.53 AXI_MON3_FILTER5
15.5.3.54 AXI_MON3_FILTER6
15.5.3.55 AXI_MON3_FILTER7
15.5.3.56 AXI_MON3_FILTER8
15.5.3.57 AXI_MON3_RPT0
15.5.3.58 AXI_MON3_RPT1
15.5.3.59 AXI_MON3_RPT2
15.5.3.60 AXI_MON3_RPT3
15.5.3.61 AXI_MON4_CTRL
15.5.3.62 AXI_MON4_INPUT
15.5.3.63 AXI_MON4_FILTER0
15.5.3.64 AXI_MON4_FILTER1
15.5.3.65 AXI_MON4_FILTER2
15.5.3.66 AXI_MON4_FILTER3
15.5.3.67 AXI_MON4_FILTER4
15.5.3.68 AXI_MON4_FILTER5
15.5.3.69 AXI_MON4_FILTER6
15.5.3.70 AXI_MON4_FILTER7
15.5.3.71 AXI_MON4_FILTER8
15.5.3.72 AXI_MON4_RPT0
15.5.3.73 AXI_MON4_RPT1
15.5.3.74 AXI_MON4_RPT2
15.5.3.75 AXI_MON4_RPT3
15.5.3.76 AXI_MON5_CTRL
15.5.3.77 AXI_MON5_INPUT
15.5.3.78 AXI_MON5_FILTER0
15.5.3.79 AXI_MON5_FILTER1
15.5.3.80 AXI_MON5_FILTER2
15.5.3.81 AXI_MON5_FILTER3
15.5.3.82 AXI_MON5_FILTER4
15.5.3.83 AXI_MON5_FILTER5
15.5.3.84 AXI_MON5_FILTER6
15.5.3.85 AXI_MON5_FILTER7
15.5.3.86 AXI_MON5_FILTER8
15.5.3.87 AXI_MON5_RPT0
15.5.3.88 AXI_MON5_RPT1
15.5.3.89 AXI_MON5_RPT2
15.5.3.90 AXI_MON5_RPT3
15.5.3.91 AXI_MON6_CTRL
15.5.3.92 AXI_MON6_INPUT
15.5.3.93 AXI_MON6_FILTER0
15.5.3.94 AXI_MON6_FILTER1
15.5.3.95 AXI_MON6_FILTER2
15.5.3.96 AXI_MON6_FILTER3
15.5.3.97 AXI_MON6_FILTER4
15.5.3.98 AXI_MON6_FILTER5
15.5.3.99 AXI_MON6_FILTER6
15.5.3.100 AXI_MON6_FILTER7
15.5.3.101 AXI_MON6_FILTER8
15.5.3.102 AXI_MON6_RPT0
15.5.3.103 AXI_MON6_RPT1
15.5.3.104 AXI_MON6_RPT2
15.5.3.105 AXI_MON6_RPT3
15.5.3.106 AXI_MON7_CTRL
15.5.3.107 AXI_MON7_INPUT
15.5.3.108 AXI_MON7_FILTER0
15.5.3.109 AXI_MON7_FILTER1
15.5.3.110 AXI_MON7_FILTER2
15.5.3.111 AXI_MON7_FILTER3
15.5.3.112 AXI_MON7_FILTER4
15.5.3.113 AXI_MON7_FILTER5
15.5.3.114 AXI_MON7_FILTER6
15.5.3.115 AXI_MON7_FILTER7
15.5.3.116 AXI_MON7_FILTER8
15.5.3.117 AXI_MON7_RPT0
15.5.3.118 AXI_MON7_RPT1
15.5.3.119 AXI_MON7_RPT2
15.5.3.120 AXI_MON7_RPT3
15.5.3.121 AXI_MON8_CTRL
15.5.3.122 AXI_MON8_INPUT
15.5.3.123 AXI_MON8_FILTER0
15.5.3.124 AXI_MON8_FILTER1
15.5.3.125 AXI_MON8_FILTER2
15.5.3.126 AXI_MON8_FILTER3
15.5.3.127 AXI_MON8_FILTER4
15.5.3.128 AXI_MON8_FILTER5
15.5.3.129 AXI_MON8_FILTER6
15.5.3.130 AXI_MON8_FILTER7
15.5.3.131 AXI_MON8_FILTER8
15.5.3.132 AXI_MON8_RPT0
15.5.3.133 AXI_MON8_RPT1
15.5.3.134 AXI_MON8_RPT2
15.5.3.135 AXI_MON8_RPT3
15.5.3.136 AXI_MON9_CTRL
15.5.3.137 AXI_MON9_INPUT
15.5.3.138 AXI_MON9_FILTER0
15.5.3.139 AXI_MON9_FILTER1
15.5.3.140 AXI_MON9_FILTER2
15.5.3.141 AXI_MON9_FILTER3
15.5.3.142 AXI_MON9_FILTER4
15.5.3.143 AXI_MON9_FILTER5
15.5.3.144 AXI_MON9_FILTER6
15.5.3.145 AXI_MON9_FILTER7
15.5.3.146 AXI_MON9_FILTER8
15.5.3.147 AXI_MON9_RPT0
15.5.3.148 AXI_MON9_RPT1
15.5.3.149 AXI_MON9_RPT2
15.5.3.150 AXI_MON9_RPT3
15.5.3.151 AXI_MON10_CTRL
15.5.3.152 AXI_MON10_INPUT
15.5.3.153 AXI_MON10_FILTER0
15.5.3.154 AXI_MON10_FILTER1
15.5.3.155 AXI_MON10_FILTER2
15.5.3.156 AXI_MON10_FILTER3
15.5.3.157 AXI_MON10_FILTER4
15.5.3.158 AXI_MON10_FILTER5
15.5.3.159 AXI_MON10_FILTER6
15.5.3.160 AXI_MON10_FILTER7
15.5.3.161 AXI_MON10_FILTER8
15.5.3.162 AXI_MON10_RPT0
15.5.3.163 AXI_MON10_RPT1
15.5.3.164 AXI_MON10_RPT2
15.5.3.165 AXI_MON10_RPT3
15.5.3.166 AXI_MON11_CTRL
15.5.3.167 AXI_MON11_INPUT
15.5.3.168 AXI_MON11_FILTER0
15.5.3.169 AXI_MON11_FILTER1
15.5.3.170 AXI_MON11_FILTER2
15.5.3.171 AXI_MON11_FILTER3
15.5.3.172 AXI_MON11_FILTER4
15.5.3.173 AXI_MON11_FILTER5
15.5.3.174 AXI_MON11_FILTER6
15.5.3.175 AXI_MON11_FILTER7
15.5.3.176 AXI_MON11_FILTER8
15.5.3.177 AXI_MON11_RPT0
15.5.3.178 AXI_MON11_RPT1
15.5.3.179 AXI_MON11_RPT2
15.5.3.180 AXI_MON11_RPT3
15.6.2.1 DRAM_REF_CTRL
15.6.2.2 DRAM_MRD0
15.6.2.3 DRAM_MRD1
SIXTEEN
16.1 Overview
383
CHAPTER 16. SPI NOR FLASH CONTROLLER
16.2 Features
The SPI NOR Flash controller can support three SPI NOR interface types, which are Standard SPI, Dual SPI inter-
face mode and Qual SPI interface mode.
Standard SPI interface mode has 1bit data input line and 1bit data output line. The chart shows the write operation
timing diagram of the Standard SPI interface mode, and the read operation timing diagram of the Standard SPI inter-
face mode.
Diagram 16.1: Standard SPI interface mode write operation timing diagram
Timing description:
• command/address/dummy cycles are output on the DO line in single-bit serial mode.
• Data is output on the DO line in single-bit serial mode.
Diagram 16.2: Standard SPI interface mode read operation timing diagram
Timing description:
Dual Input SPI interface mode, parallel 2bit data line in the data input stage. Dual-Input SPI interface timing is the
operation sequence diagram of Dual Input SPI interface mode.
Timing description:
• command/address/dummy cycles are output on the DO line in single-bit serial mode.
• Data is input (read) on the DO/DI line in 2 Bits.
Dual IO SPI interface mode, parallel 2-bit data lines in the address output and data input stages. Dual-IO SPI inter-
face timing is the operation sequence diagram of Dual IO SPI interface mode.
Timing description:
• Command is output on the DO line in single-bit serial mode.
• address/dummy cycles/Data is output (written) or input (read) on the DO/DI line in 2 Bits mode.
Quad Input SPI interface mode, parallel 4bit data lines in the data input stage. Quad-Input SPI mode timing diagram
is the Quad Input SPI interface mode operation sequence diagram.
Timing description:
• command/address/dummy cycles are output on the DO line in single-bit serial mode.
• Data is input (read) in DO/DI/WPN/HOLDN in 4 Bits mode.
Quad IO SPI interface mode, parallel 4bit data lines in the address output and data input stages. Quad-IO SPI mode
timing diagram is the Quad IO SPI interface mode operation sequence diagram.
Timing description:
• Command is output on the DO line in single-bit serial mode.
• address/dummy cycles/Data is output (write) or input (read) in DO/DI/WPN/HOLDN in 4 Bits mode.
The SPI NOR Boot data is located at the chip address 0x1000_0000~0x1FFF_FFFF, which is directly mapped to the
continuous address space 0x0000_0000~0x0FFF_FFFF of the SPI NOR Flash. SPI_NOR Flash can support up to
256MB. If you need to use SPI_NOR Flash larger than 16MB, you need to use the 4 bytes address mode. The reset
state of the chip is 3bytes address mode, and the 4bytes address mode needs to be enabled through configuration, so
SPI_NOR Flash needs to support 3bytes/4bytes address mode.
The software configures operation-related registers, such as operation commands, addresses, etc., and finally config-
ures the reg_go_busy register to issue operations. The controller issues operations to the device based on the soft-
ware configuration value.
• Step 1. If you need to adjust the Timing parameters, configure the SPI Clock Divider according to the device.
• Step 2. Configure the interrupt control register.
For SPI NOR Flash devices, it supports two Flash address modes of 3 Byte and 4 Byte. The address mode can be dy-
namically switched through the configuration register after the chip is started. The steps to switch the Flash address
mode after the chip starts up are as follows:
• Step 1. No Flash operation or ensure that the previous operation on the Flash device is completed.
• Step 2. According to the device requirements, use the register operation mode to configure the relevant regis-
ters of the device and send specific commands to configure the Flash to enter 4 Byte mode.
• Step 3. Configure the SPI NOR Flash controller [reg_byte4en] format to 4 Byte mode and complete the switch
from 3 Byte mode to 4 Byte mode.
• Do not change the relevant register configuration before the device operation is completed, otherwise it may
cause abnormal operation.
16.6.1 SPI_CTRL
16.6.2 CE_CTRL
16.6.3 DLY_CTRL
16.6.4 DMMR_CTRL
16.6.5 TRAN_CSR
16.6.6 TRAN_NUM
16.6.7 FF_PORT
16.6.8 FF_PT
16.6.9 INT_STS
16.6.10 INT_EN
SEVENTEEN
17.1 Overview
397
CHAPTER 17. SPI NAND FLASH CONTROLLER
17.2 Features
The SPI NAND Flash controller can support three SPI NAND interface types, namely Standard SPI, X2 interface
mode and X4 interface mode.
Standard SPI interface mode has 1-bit data input line and 1-bit data output line. The chart Standard SPI interface
mode write operation timing is the write operation timing diagram of the Standard SPI interface mode, and the dia-
gram Standard SPI interface mode read operation timing is the read operation timing diagram of the Standard SPI
interface mode.
Timing description:
• command/address/dummy cycles are output on the DO line in single-bit serial mode.
• Data is output on the DO line in single-bit serial mode.
Timing description:
X2 interface mode shares 2-bit data input and output lines. Diagram SPI Nand X2 interface mode operation timing is
the X2 interface mode operation sequence diagram.
Timing description:
• command/address/dummy cycles are output on the DO line in single-bit serial mode.
• Data is output (written) or input (read) on the DO/DI line in 2 Bits mode.
X4 interface mode shares 4-bit data input and output lines. Diagram SPI Nand X4 interface mode operation timing is
the X4 interface mode operation sequence diagram.
Timing description:
• command/address/dummy cycles are output on the DO line in single-bit serial mode.
• Data is output (written) or input (read) on the DO/DI/WPN/HOLDN line in 4 Bits mode.
When issuing SPI NAND Flash read and write operations, the column address is issued according to the specific
operation.
• Write operation: Column address is configured during LOAD operation, row address is configured during
PROGRAM operation.
• Read operation: configure the row address during PAGE READ TO CACHE operation and configure the col-
umn address during READ operation.
• Address issuance is completed by the controller, and the software needs to configure reg_trx_cmd_idx, and
address configuration reg_trx_cmd_cnt0, reg_trx_cmd_cnt1 according to the operation instructions.
Since the SPI NAND Flash address space is discontinuous and there is the possibility of bad blocks, Boot data can-
not be directly mapped to Flash.
Supports adaptive Boot function, which can automatically adapt hardware information based on Block0 data. The
controller requires that physical Block0 must be a good block, and other blocks can be automatically skipped if they
are bad blocks.
The software configures operation-related registers, such as operation commands, addresses, etc., and finally config-
ures the reg_trx_start register to issue operations. The controller issues operations to the device based on the soft-
ware configuration value. If data needs to be transferred to the device, an internal DMA operation is used to transfer
the data.
Supports built-in system DMA mode for read and write operations to increase access speed. In this way, on-chip or
off-chip memory space can be directly accessed through the bus.
• Step 1: Configure the DMA channel to use.
• Step 2: Configure source and destination addresses.
• Step 3: Configure the transmission format and data length.
The software sets a maximum 1 second TIMEOUT mechanism as a protection when the device does not respond
normally.
• Step 1: (If the Timing parameters need to be adjusted) Configure the timing registers reg_trx_sck_h and
reg_trx_sck_l according to the device.
• Step 2: Configure the interrupt control register reg_trx_done_int_en.
For flash operations, erasing must be performed before programming operations, and WREN operations must be
completed before erasing operations.
• Step 1: Configure the transmission data length reg_trx_cmd_cont_size.
• Step 2: Configure the device instructions and their related contents reg_trx_cmd_id, reg_trx_cmd_cont0.
• Step 3: Configure the reg_trx_start register issuing operation.
• Step 4: reg_trx_done_int is detected, indicating that the operation is completed.
• Some SPI NAND Flash devices require a RESET operation of the device before use or after an abnormal re-
set; therefore, for device compatibility considerations, the first transmission command after starting use or an
abnormal reset must be RESET.
• Do not change the relevant register configuration before the device operation is completed, otherwise it may
cause abnormal operation.
For a 2KB page_size configuration, the common size of the redundant area available to the software is 64Byte. The
structure of data in Buffer and Flash is as follows. The size of the redundant area is related to the actual device used.
Table 17.1: The structure of data in Buffer and Flash (2KB page_size)
User Data Data(2048) OOB(64)
For a 4KB page_size configuration, the common size of the redundant area available to the software is 256Byte. The
structure of data in Buffer and Flash is as follows. The size of the redundant area is related to the actual device used.
Table 17.2: The structure of data in Buffer and Flash (4KB page_size)
User Data Data(4096) OOB(256)
17.7.1 reg_ctrl
17.7.2 reg_timing_ctrl
17.7.3 reg_trx_size
17.7.4 reg_int_en
17.7.5 reg_int_clr
17.7.6 reg_int_sts
17.7.7 reg_cont0
17.7.8 reg_cont1
17.7.9 reg_cmplt_cnt
17.7.10 reg_tx_data
17.7.11 reg_rx_data
EIGHTEEN
NETWORK INTERFACE
18.1.1 Overview
The chip supports 1 Ethernet MAC to receive and send network data.
This Ethernet MAC is equipped with a built-in 10/100Mbps Fast Ethernet Transceiver, which can operate in
10/100Mbps, full-duplex or half-duplex mode.
The overall data flow of an ethernet switched interface is shown in the diagram eMAC overall data flow.
411
CHAPTER 18. NETWORK INTERFACE
The CPU first configures the Ethernet MAC to receive and send the Descriptor List buffer area and the Descriptor
List content, for example, the settings of the sending and receiving frame addresses and packet type and size parame-
ters.
When receiving, the Ethernet MAC receives various received data packets, and receives Descriptor List informa-
tion according to the CPU configuration, such as packet cache information, including packet cache starting address,
packet cache depth, etc., and stores the received packets in the DDR. Then notify the CPU to perform subsequent
processing actions.
When sending, the Ethernet MAC sends the packet cache information of the Descriptor List according to the CPU
configuration, such as the packet cache starting address, packet length and other packet information, etc., moves the
packets stored in the DDR, assembles them into packets by itself, and then sends to the network interface. Then no-
tify the CPU that the packet has been transmitted.
Set the receive direction interrupt, configure Re_Int_Enable bit[6] = 1, and the CPU queries the receive interrupt
status Reg_Int_Status bit[6].
CPU query receive interrupt status Reg_Int_Status bit[6], write 1 to clear the interrupt status.
Ethernet MAC provides MDIO interface settings for the PHY chip. The MDIO interface is divided into read
operations and write operations. The registers that mainly control the MDIO interface are Reg_MdioAddr and
Reg_MdioData.
• The configuration steps for read operations are as follows:
– Configure the following settings in the MDIO control register:
∗ Reg_MdioAddr bit[15:11] sets the PHY chip address. Please plan according to the PHY chip or
board end.
∗ Reg_MdioAddr bit[10:6] sets the PHY internal register address to be read and written.
∗ Reg_MdioAddr bit[1] is written to 0 (read action command).
– Finally, set Reg_MdioAddr bit[0] = 1 to start the read action.
The MDIO interface will receive the read data into Reg_MdioData bit[15:0], and change Reg_Mdi0Addr bit[0]
to 0.
• The configuration steps for write operations are as follows:
– Configure the following settings in the MDIO control register:
∗ Reg_MdioAddr bit[15:11] sets the PHY chip address. Please plan according to the PHY chip or
board end.
∗ Reg_MdioAddr bit[10:6] sets the PHY internal register address to be read and written.
∗ Reg_MdioAddr bit[1] is written to 1 (write action command).
– Finally, set Reg_MdioAddr bit[0] = 1 to start the writing action.
The MDIO interface will change Reg_Mdi0Addr bit[0] to 0 after the writing action is completed.
Ethernet MAC working mode: Ethernet MAC0 supports built-in EPHY function. The working mode adopted is
RMII (10/100M).
The speed and mode switching register settings are as follows:
• Configure ETH0 Reg_MacConfig bit[14] = (100M:1, 10M:0);
Note: This configuration cannot be performed when the chip is working normally. It is recommended to configure it
during initialization.
18.1.11.1 Reg_MacConfig
18.1.11.2 Reg_MdioAddr
18.1.11.3 Reg_MdioData
18.1.11.4 Reg_MacAddr0_High
18.1.11.5 Reg_MacAddr0_Low
18.1.11.6 Reg_MacAddr1_High
18.1.11.7 Reg_MacAddr1_Low
18.1.11.8 Reg_Tx_Packet_Num_Good_Bad
18.1.11.9 Reg_Tx_Bcast_Packets_Good
18.1.11.10 Reg_Tx_Mcast_Packets_Good
18.1.11.11 Reg_Tx_Ucast_Packets_Good_Bad
18.1.11.12 Reg_Tx_Mcast_Packets_Good_Bad
18.1.11.13 Reg_Tx_Bcast_Packets_Good_Bad
18.1.11.14 Reg_Rx_Packets_Num_Good_Bad
18.1.11.15 Reg_Rx_Bcast_Packets_Good
18.1.11.16 Reg_Rx_Mcast_Packets_Good
18.1.11.17 Reg_Rx_CRC_Error_Packets
18.1.11.18 Reg_Rx_Ucast_Packets_Good
18.1.11.19 Reg_Int_Enable
18.1.11.20 Reg_Int_Status
18.2 EthernetPHY
18.2.1 Overview
The chip provides a built-in Ethernet 10/100 Base-TX compliant PHY interface.
The 10/100Mbps transmission and reception functions are on standard category 5 (CAT5) twisted pair cables, and
the transmission and reception signals are connected to the RJ45 standard interface through a transformer.
NINETEEN
VIDEO INTERFACE
19.1 VI
19.1.1 Overview
The Video Input (VI) unit is a module on chip which is responsile receiving camera video data. VI can support MIPI
Rx (including MIPI, Sub-LVDS, HiSPi) interface or BT.656, BT.601, BT.1120 interface and DC (Digital Camera )
to receive video data, to processe it and send it to the next-level video processing module (ISP). The functional block
diagram of a VI is shown in the diagram VI functional block diagram.
VI is divided into two physical sub-modules, consisting of the mobile industry processor interface receiver module
MIPI Rx and the video input processing module VI Proc. The MIPI Rx module receives and processes different
video data, while the VI Proc module integrates video signals in different formats into a single video signal required
by the ISP module and sends it out.
421
CHAPTER 19. VIDEO INTERFACE
19.1.2 Features
VI can support multiple timing inputs and different interfaces, and perform video input collection for different encod-
ing methods. The system can use registers to configure different functional modes to adapt to different video inter-
faces.
The VI module can support up to three inputs. Typical inputs are as follows:
• 1 channel 5M (2688x1944, 2880x1620) @60fps HDR input or linear @30fps input.
• 2 channels FHD (1920x1080) @60fps HDR or line input + 1 channel BT input (BT.656, BT.601 or BT.1120).
• 1 channel 5M (2688x1944, 2880x1620) @60fps HDR or @30fps linear input + 1 channel BT input.
VI supports Y/C separated input BT.1120 interface timing. Before transmitting video signals, a synchronization code
will be transmitted. The synchronization code uses special bytes SAV and EAV in the data stream to represent the
start and end of valid row data respectively. After the synchronization code, 16 bits are used to transmit the video
signal, of which 8 bits are used to transmit brightness and the other 8 bits are used to transmit chroma, as shown in
the chart BT.1120 horizontal interface timing and the chart BT.1120 vertical interface timing.
The synchronization code format is a combination of 4 bytes, in order {0xFF, 0x00, 0x00, EAV/SAV}. The fourth
byte is detailed as follows. SG2002 only supports progressive progressive scan format (Progressive). Therefore, the
value of bit 6 is 0.
SAV_VLD: Valid line area, line synchronization signal ends, and valid pixels begin.
EVA_VLD: Effective line area, line synchronization signal starts, and effective pixel ends.
SAV_BLK: Blanking line area, end of line synchronization signal.
EAV_BLK: Blanking row area, horizontal sync signal starts.
VI also supports Y/C combined input BT.656 interface timing. During transmission, it also uses synchronization
codes SAV and EAV to indicate the start and end of valid line data, but only uses 8 bits to transmit video signals, and
uses time sharing to transmit brightness and Chromaticity, as shown in diagram BT.656 horizontal interface timing.
The only difference between BT.656 and BT.1120 is that 16 bit (BT.1120) and 8 bit (BT.656) are used for image
transmission. The rest of the vertical timing and synchronization code formats are the same.
In addition to utilizing synchronization codes BT.1120 and BT.656, VI supports BT.601 interface timing utilizing a
variety of different synchronization signals for transmission. The actual video data can be set to the 16-bit mode of
Y/C separate input or the 8-bit mode of Y/C combined time-sharing input using the register. The synchronization
mode can be selected by the register to be vhs, vde, or vsde. The detailed timing is as shown below.
The input synchronization signal in vhs mode is frame synchronization signal (vs), horizontal synchronization signal
(hs), the system must set the number of blanking lines after the frame (vs_back_porch), the image height (img_ht),
the number of blanking pixels after the line (hs_back_porch) and Image width (img_wd).
The vde mode synchronization signals are the row valid signal (vde) and the row valid signal (hde). In this mode, the
system does not need to set parameters related to timing and phase sequence. The VI module will receive data based
on the hde/vde signal and perform frame updates based on the vde signal.
The vsde mode sync signals are the frame sync signal (vs) and the valid pixel flag (de). In this mode, the system does
not need to set parameters related to timing and phase sequence. The VI module will receive data based on the de
signal and perform frame updates based on the vs signal.
VI supports digital camera (DC) interface timing that transmits RAW format and simulates BT transmission. The DC
interface can support four different modes: 8bit, 10bit, 12bit, and 16bit. Register settings can also be used to receive
synchronization codes or similar to BT. 601’s three different synchronization modes to receive video signals.
Images stored in DRAM are divided into two formats: Bayer 12bit and YCbCr 8bit. Among them, Y/Cb/Cr are
stored separately in three different DRAM locations. The arrangement of the two (12bit/8bit) format images in
DRAM is as shown in the figure below.
There are two identical sets of VI modules in the chip, and the internal register offset addresses are the same, and the
base addresses are 0x0A0C2000 and 0x0A0C4000 respectively. There is also a set of VI modules that only support
the BT interface, with the base address 0x0A0C6000.
19.1.6.1 REG_00
19.1.6.2 REG_10
19.1.6.3 REG_14
19.1.6.4 REG_18
19.1.6.5 REG_1C
19.1.6.6 REG_20
19.1.6.7 REG_24
19.1.6.8 REG_28
19.1.6.9 REG_30
19.1.6.10 REG_40
19.1.6.11 REG_44
19.1.6.12 REG_48
19.1.6.13 REG_50
19.1.6.14 REG_54
19.1.6.15 REG_58
19.1.6.16 REG_60
19.1.6.17 REG_64
19.1.6.18 REG_68
19.1.6.19 REG_6C
19.1.6.20 REG_70
19.1.6.21 REG_74
19.1.6.22 REG_80
19.1.6.23 REG_88
19.1.6.24 REG_8C
19.1.6.25 REG_90
19.1.6.26 REG_94
19.1.6.27 REG_98
19.1.6.28 REG_9C
19.1.6.29 REG_A0
19.1.6.30 REG_A4
19.1.6.31 REG_B0
19.1.6.32 REG_B4
19.1.6.33 REG_D0
19.1.6.34 REG_D4
19.1.6.35 REG_D8
19.1.6.36 REG_DC
19.1.6.37 REG_E0
19.1.6.38 REG_E4
19.1.6.39 REG_E8
19.1.6.40 REG_EC
19.1.6.41 REG_F0
19.1.6.42 REG_F4
19.1.6.43 REG_F8
19.1.6.44 REG_FC
19.1.6.45 REG_100
19.1.6.46 REG_104
19.1.6.47 REG_108
19.1.6.48 REG_110
19.1.6.49 REG_114
19.1.6.50 REG_118
19.1.6.51 REG_11C
19.1.6.52 REG_120
19.1.6.53 REG_124
19.2.1 Overview
The VDP module can superimpose graphics data on video data and then output it through different display channels.
Video data can be read from memory or receive video output from the VPSS module. Graphics data must be read
from memory.
VDP is equipped with a dedicated clock generator and the architecture is as follows:
19.2.3.2 Reset
19.2.3.4 Interrupt
• Support input image formats: 400, planar-420, planar-422, planar-444, RGB packet.
• The minimum input resolution is 64x64, and the maximum input resolution is 1920x1080.
• The minimum output resolution is 64x64, and the maximum output resolution is 1920x1080.
• Support input data bit width: 8-bit.
• YUV420 horizontal/vertical resolution is a multiple of 2.
• YUV422 horizontal resolution is a multiple of 2.
• YUV400/Planar-444(RGB or YUV)/RGB packet has no resolution limit.
• The source starting address is configurable, and the address is 32-byte aligned.
– Source stride configurable, 32-byte aligned.
• Support color space conversion and contrast/brightness adjustment.
• Support video layer BT.601, BT.709 color gamut conversion.
• Support configurable display position/size and can be displayed anywhere on the screen.
• Support input pixel formats: ARGB8888, ARGB4444, ARGB1555, LUT8, LUT4, LUT1.
• The minimum input resolution is 64x64, and the maximum input resolution is 1920x1080.
• The source starting address is configurable, and the address is 32-byte aligned.
– Source stride configurable, 32-byte aligned.
– Support color space conversion.
– Support configurable display position and can be displayed anywhere on the screen.
– Support 0~255 alpha.
– Support colorkey processing.
VDP only supports one video layer and one graphics layer overlay.
The VDP output interface can be connected to different chip interfaces and supports the configuration of various typ-
ical and atypical timing sequences.
All timing parameters must be configured before the interface is turned on.
REG_00
REG_01
REG_02
REG_03
REG_04
REG_05
REG_06
REG_07
REG_13
REG_14
REG_15
REG_16
REG_17
REG_18
REG_19
REG_20
REG_21
REG_22
REG_23
REG_24
REG_25
REG_26
REG_27
REG_28
REG_29
REG_30
REG_31
REG_32
REG_33
REG_34
REG_35
REG_36
REG_37
REG_39
REG_40
REG_41
REG_42
REG_43
REG_CATCH
REG_OSD_FIFO_M0
REG_OSD_FIFO_M1
REG_OSD_FIFO_CNT0
REG_OSD_FIFO_CNT1
REG_OSD_FIFO_CNT2
REG_OSD_FIFO_CNT3
REG_GAMMA_CTRL
REG_GAMMA_WR_LUT
REG_MCU_IF_CTRL
REG_HW_MCU_AUTO
REG_HW_MCU_CMD
REG_HW_MCU_CMD_0
REG_HW_MCU_CMD_1
REG_HW_MCU_CMD_2
REG_HW_MCU_CMD_3
REG_HW_MCU_CMD_4
REG_HW_MCU_CMD_5
REG_HW_MCU_CMD_6
REG_HW_MCU_CMD_7
REG_HW_MCU_OV
REG_SRGB_CTRL
COV_W0_CFG
COV_W0_SIZE
COV_W0_COLOR
COV_W1_CFG
COV_W1_SIZE
COV_W1_COLOR
COV_W2_CFG
COV_W2_SIZE
COV_W2_COLOR
COV_W3_CFG
COV_W3_SIZE
COV_W3_COLOR
REG_TGEN_LITE_SIZE
REG_TGEN_LITE_VS
REG_TGEN_LITE_HS
VGOP_REG_0
VGOP_REG_1
VGOP_REG_2
VGOP_REG_3
VGOP_REG_4
VGOP_REG_5
VGOP_REG_6
VGOP_REG_10
VGOP_REG_11
VGOP_REG_12
VGOP_REG_13
VGOP_REG_14
VGOP_REG_15
VGOP_REG_16
VGOP_REG_20
VGOP_REG_21
VGOP_REG_22
VGOP_REG_23
VGOP_REG_24
VGOP_REG_25
VGOP_REG_26
VGOP_REG_30
VGOP_REG_31
VGOP_REG_32
VGOP_REG_33
VGOP_REG_34
VGOP_REG_35
VGOP_REG_36
VGOP_REG_40
VGOP_REG_41
VGOP_REG_42
VGOP_REG_43
VGOP_REG_44
VGOP_REG_45
VGOP_REG_46
VGOP_REG_50
VGOP_REG_51
VGOP_REG_52
VGOP_REG_53
VGOP_REG_54
VGOP_REG_55
VGOP_REG_56
VGOP_REG_60
VGOP_REG_61
VGOP_REG_62
VGOP_REG_63
VGOP_REG_64
VGOP_REG_65
VGOP_REG_66
VGOP_REG_70
VGOP_REG_71
VGOP_REG_72
VGOP_REG_73
VGOP_REG_74
VGOP_REG_75
VGOP_REG_76
VGOP_REG_80
osd_common_ctrl
To be continued . . . . . .
VGOP_REG_81
LUT256 SRAM
VGOP_REG_82
LUT256 SRAM
VGOP_REG_83
VGOP_REG_84
constant color
VGOP_REG_85
debug
VGOP_REG_86
fb_thr
VGOP_REG_87
fb0_setting
VGOP_REG_88
fb0_init_st
VGOP_REG_89
fb0_st_ro
VGOP_REG_90
fb1_setting
VGOP_REG_91
fb1_init_st
VGOP_REG_92
fb1_st_ro
BW_LIMIT
VGOP_DEC_00
vgop_dec_ctrl
VGOP_DEC_01
vgop_dec_debug
VGOP_LUT16_0
vgop_lut16_0_1
VGOP_LUT16_1
vgop_lut16_2_3
VGOP_LUT16_2
vgop_lut16_4_5
VGOP_LUT16_3
vgop_lut16_6_7
VGOP_LUT16_4
vgop_lut16_8_9
VGOP_LUT16_5
vgop_lut16_10_11
VGOP_LUT16_6
vgop_lut16_12_13
VGOP_LUT16_7
vgop_lut16_14_15
19.3 MIPI Rx
19.3.1 Overview
The main function of the MIPI Rx (Mobile Industry Processor Interface Receiver) module is to receive video data
transmitted by the CMOS sensor. It supports MIPI D-PHY, sub-LVDS (Low-Voltage Differential Signal), HiSPi
(High-Speed Serial Pixel Interface), etc. Different serial video signal inputs are processed and converted into inter-
nal video timing, which is passed to the next-level video processing module (ISP).
The MIPI Rx module can be subdivided into two parts: PHY and Controller. The PHY module integrates analog and
digital parts and mainly converts serial signals into parallel signals. The Controller module is responsible for decod-
ing different video data formats and transmitting them to Back-end video processing module (ISP). The functional
block diagram and its location in the system are shown in the diagram MIPI Rx functional block diagram and loca-
tion in the system.
Diagram 19.19: MIPI Rx functional block diagram and location in the system
19.3.2 Features
In applications using image sensors, the MIPI Rx module register can be set according to different interface selec-
tions (MIPI/Sub-LVDS/HiSPi). At the same time, MIPI Rx also supports transmission requirements of different
speeds and different resolutions, and is compatible with a variety of images. Sensor format.
The MIPI Rx module contains 1 group of D-PHY, each group has six differential pairs. One D-PHY can support a
pair of differential clocks and up to four pairs of data differential signals, or support two groups of one pair of dif-
ferential clocks at the same time. The upper two pairs of data differential signals, so MIPI Rx can support 2 Sensor
inputs at the same time. In addition, MIPI Rx can support different differential pair sequencing and clock differential
pair positions. The source of the clock and the differential pair sequencing method can be configured through regis-
ters.
MIPI Rx only targets the timing conversion and decoding of the interface, and does not handle the image process-
ing part. Therefore, any resolution and frame rate can be supported under the premise of meeting the bandwidth.
The bandwidth of MIPI Rx is limited by two parts: the PHY’s interface data rate and the internal processing speed.
The input interface supports a maximum of 1.5Gbps/Lane, and the internal processing speed is a maximum of
600M*1pixels/s.
MIPI specifications are developed and maintained by different working groups, corresponding to applications in
different fields. MIPI Rx supports D-PHY and CSI-2 (Camera Serial Interface). D-PHY specifies the transmission
specification of the physical layer, and CSI-2 specifies the format and protocol of the Camera output data packet.
• D-PHY
D-PHY is a high-speed physical layer standard released by the MIPI Alliance, which specifies the physical
characteristics and transmission protocols of the interface layer. D-PHY uses 200mV source-synchronous low-
voltage differential signaling technology, and the data green rate range of each Lane supports up to 2500Mbps.
D-PHY can operate in two modes: Low Power (LP) and High Speed (HS).
• CSI-2
CSI-2 is a data protocol for cameras, which specifies the data packet format for communication between the
host and peripherals.
CSI-2 can support image applications with different pixel formats, and the minimum granularity of data trans-
mission is bytes. To increase the performance of CSI-2, you can choose the number of data Lanes. The CSI-2
protocol specifies the mechanism for the sender to pack pixel data into bytes, and specifies how multiple data
Lanes are allocated and managed. Bytes of data are organized in packets, which are transmitted between SoT
and EoT. The receiving end parses the corresponding data packet according to the protocol and recovers the
original pixel data.
Long packets are used to transmit valid pixel data and are divided into five parts: Data ID, Word Count, ECC, PAY-
LOAD, CHECKSUM.
• Data ID contains Virtual Channel and Data Type. Virtual Channel controls the channel used for transmission
and can use different channels to transmit different data. Data Type specifies the type of data to be transmitted.
• Word Count indicates the amount of data that the receiving end needs to receive.
• ECC is an error correction code that can correct or detect errors in Data Type and Word Count.
• PAYLOAD is the actual pixel data that needs to be transmitted.
• CHECKSUM is a checksum generated by a linear feedback shift register and is used to verify PAYLOAD data.
The structure of the long package is shown in the diagram CSI-2 long packet format.
The function of the short packet is to transmit information synchronously, including three parts: Data ID, Data Field
and ECC. Its format is shown in the diagram CSI-2 short packet format.
MIPI Rx supports the transmission of six video data formats, including YUV422-8bit, YUV422-10bit, RAW8,
RAW10, RAW12 and RAW16. The transmission methods of different data formats are described below.
The transmission mode of YUV422-8bit is in the form of UYVY, as shown in the diagram YUV422 8-bit data trans-
fer sequence.
The correspondence between the packet and the video signal is shown in the diagram YUV422-8bit data packet
transmission mapping.
The transmission format of the entire Frame will be as shown in the diagram YUV422 8-bit frame format.
The transmission mode of YUV422-10bit is also UYVY, and the transmission sequence is shown in the chart
YUV422-10bit data transfer sequence.
The correspondence between the packet and the video signal is shown in the diagram YUV422-10bit data packet
transmission mapping.
The transmission format of the entire Frame will be as shown in the diagram YUV422-10bit frame format.
The transfer sequence of RAW8 is shown in the diagram RAW8 data transfer sequence.
The transmission format of the entire Frame will be as shown in the diagram RAW8 frame format.
The transfer sequence of RAW10 is shown in the diagram RAW10 data transfer sequence.
The transmission format of the entire Frame will be as shown in the diagram RAW10 frame format.
The transfer sequence of RAW12 is shown in the diagram RAW12 data transfer sequence.
The transmission format of the entire Frame will be as shown in the diagram RAW12 frame format.
The transfer sequence of RAW16 is shown in the diagram RAW16 data transfer sequence.
The transmission format of the entire Frame will be as shown in the diagram RAW16 frame format.
The linear mode transmission format of the MIPI interface is shown in the diagram MIPI interface image format.
The transmission of each picture starts with the short packet Frame Start (FS) and ends with the short packet Frame
End (FE). The video content in the middle is in line units, and each long packet transmits a complete video line.
The long packet format is as specified by the MIPI standard. Each line has a 32-bit data packet header (PH, Pecket
Header), which contains information such as the Virtual Channel and Data Type of the current line.
MIPI Rx supports four wide dynamic range (WDR) modes of the MIPI interface, namely:
1. Use DT (Data Type) to distinguish long and short exposure data
2. Use the identification code (Identification Code) to distinguish long and short exposure data
3. Use registers to set long and short exposure data delay intervals
The WDR transmission method using DT is shown in the chart MIPI interface wide dynamic data transmission (us-
ing DT). Different exposure lengths share a set of FS/FE short packets, and the header of the long packet contains DT
information. Different DTs can be used to distinguish long and short exposure data. , the real data format DT and the
two sets of DT representing long and short exposure data can be set using registers, and MIPI Rx can parse out the
correct wide dynamic timing and send it to the rear video processing module.
Diagram 19.38: MIPI interface wide dynamic data transmission (using DT)
The WDR transmission method using ID is shown in the chart MIPI interface wide dynamic data transmission (using
ID). Different exposure lengths share a set of FS/FE short packets, and the first four pixels of each long packet in the
transmission data are used to transmit the data representing different exposure lengths. ID (Identification Code), the
ID representing long and short exposures can be set using registers. MIPI Rx will use the ID to distinguish different
exposure video signals, and remove the first four pixels before sending them to the video processing module.
Diagram 19.39: MIPI interface wide dynamic data transmission (using ID)
The last supported WDR transmission method does not have any DT or ID to indicate whether the transmitted long
packet contains long exposure or short exposure content. The user must set the register to indicate the number of
exposure lines between long exposure and short exposure. Difference, MIPI Rx will parse the corresponding timing
to the video processing module. The actual transmission timing is shown in the chart MIPI interface wide dynamic
data transmission (register setting).
Diagram 19.40: MIPI interface wide dynamic data transmission (register setting)
Ultra-low voltage differential signal sub-LVDS (Low-Voltage Differential Signal) is commonly used in front-end
cameras. It uses synchronization codes to distinguish the range of valid video signals and the long and short expo-
sures of wide dynamic mode.
The PHY of MIPI Rx converts differential serial data into parallel data, and then the controller of MIPI Rx decodes
the parallel data into pixel data according to different modes and synchronization codes.
MIPI Rx supports three bit width Sub-LVDS transmission modes of 8bit, 10bit and 12bit. The interface data format
is shown in the chart Sub-LVDS interface data format. All valid video signals will be in the middle of SAV and EAV
synchronization codes, where synchronization Codes are composed of four fields, and the bit width of each field is
the same as the following pixel bit width. The first three fields are fixed reference code words, and the fourth field
can be used to distinguish the start or end of the valid interval. The Sub-LVDS synchronization code format is shown
in the chart Sample of Sub-LVDS Sync Code. The synchronization code will use different values according to differ-
ent manufacturers. The chart Sample of Sub-LVDS Sync Code is just one of the implementation methods. Different
values can be in the register set up.
The transmission mode of Sub-LVDS synchronization code and pixel information in different Lanes is shown in the
chart Sub-LVDS Multi Lane Transmission mode. Each Lane will transmit the same synchronization code, followed by
pixel data. The pixel data will be transferred according to the used The number of channels is arranged sequentially
in units of pixel width.
The synchronization code and pixel data in Sub-LVDS are serial, while MIPI Rx supports the big and small ends of
the data and can be set using registers. Taking the big endian mode as an example, the timing of outputting a single
pixel is shown in the chart Sub-LVDS single pixel timing diagram.
In linear mode, Sub-LVDS uses synchronization codes to mark the start and end of each line in an image data, and
anything other than the synchronization codes SAV and EAV is not valid video data, as shown in the chart Sub-LVDS
Linear Mode Timing Diagram.
MIPI Rx can support two Sub-LVDS interface wide dynamic modes. In the first mode, as shown in the diagram Sub-
LVDS Wide dynamic mode I, the long and short exposure video signals are wrapped in SAV and EAV synchroniza-
tion codes respectively. MIPI Rx can use different The synchronization code analyzes whether the video signal is a
long exposure or a short exposure. The second mode is as shown in the diagram Sub-LVDS Wide dynamic mode II.
The long exposure and short exposure are wrapped in the same set of SAV and EAV. The width and blanking length
of each line must be set in the register. MIPI Rx must use these registers. The settings and synchronization codes are
used to analyze the timing of long exposure and short exposure, and then sent to the video processing module.
The High-Speed Serial Pixel (HiSPi) interface is also used in some cameras. Similar to Sub-LVDS, it uses syn-
chronization codes to distinguish valid video information and distinguish long and short exposures in wide dy-
namic mode. The HiSPi specification defines four different packaging modes, namely Packetized-SP, Streaming-SP,
Streaming-S and ActiveStart-SP8.
MIPI Rx supports two of the more common transmission methods, Packetized-SP and Streaming-SP.
MIPI Rx supports two different HiSPi modes. In Packetized-SP mode, as shown in the diagram HiSPi Packetized-
SP mode, the image sensor uses SOF to represent the first line of the valid video signal, and uses EOF to represent
the end of the last line of the valid video signal. Other valid video signals use SOL and EOL as the start and end of a
line.
In Streaming-SP mode, as shown in the diagram HiSPi Streaming-SP mode, the image sensor does not transmit the
EOL or EOF that represents the end, so the MIPI Rx controller must use the register settings to know the number of
valid video signals before it can be parsed. The correct video signal is sent to the video processing module (ISP). In
addition, the Streaming-SP mode also supports the SAV signal indicating the number of blank lines. The synchro-
nization codes supported by the two different transmission methods are organized as shown in the chart HiSPi Sync
Code Support Mode.
HiSPi interface wide dynamic mode is also divided into two different modes. The first Packetized-SP is shown in the
chart HiSPi Packetized-SP wide dynamic transmission. Long exposure and short exposure will be distinguished by
different synchronization codes, among which SOF_L and EOF_L The ones in are valid long exposure video signals,
and the ones in SOF_S and EOF_S are the valid short exposure video signals. The last few lines of long exposure
and the first few lines of short exposure are not valid pixel areas, but are filled with fixed values.
The second type of wide dynamic transfer of Streaming-SP is shown in the chart HiSPi Streaming-SP wide dynamic
transmission. The synchronization code and linear mode of long exposure and short exposure are the same, so a
register is needed to set the exposure line between long exposure and short exposure. Only with this digital gap can
MIPI Rx parse out the correct wide dynamic video signal.
Up to two sets of MIPI Rx modules can be used in the chip at the same time, which are mainly divided into three sets
of registers. The first part is the register that controls the PHY module, with a base address of 0x0A0D0000. The
second part is a register that controls the CSI module, with a base address of 0x0A0C2400 and 0x0A0C4400. The
third part is the register that controls the Sub-LVDS and HiSPi modules. The base addresses are 0x0A0C2200 and
0x0A0C4200.
REG_00
REG_04
REG_30
REG_34
REG_38
REG_3C
REG_40
REG_44
REG_48
REG_80
REG_A0
REG_A4
REG_A8
REG_AC
REG_00
REG_04
REG_08
REG_0C
REG_20
REG_24
REG_D0_0
REG_D0_1
REG_D0_3
REG_D0_4
REG_D0_5
REG_D0_6
REG_D0_7
REG_D0_8
REG_D0_9
REG_D0_A
REG_D1_0
REG_D1_1
REG_D1_3
REG_D1_4
REG_D1_5
REG_D1_6
REG_D1_7
REG_D1_8
REG_D1_9
REG_D1_A
REG_D2_0
REG_D2_1
REG_D2_3
REG_D2_4
REG_D2_5
REG_D2_6
REG_D2_7
REG_D2_8
REG_D2_9
REG_D2_A
REG_D3_0
REG_D3_1
REG_D3_3
REG_D3_4
REG_D3_5
REG_D3_6
REG_D3_7
REG_D3_8
REG_D3_9
REG_D3_A
REG_00
REG_04
REG_08
REG_0C
REG_20
REG_D0_0
REG_D0_1
REG_D0_3
REG_D0_4
REG_D0_5
REG_D0_6
REG_D0_7
REG_D0_8
REG_D0_9
REG_D0_A
REG_D1_0
REG_D1_1
REG_D1_3
REG_D1_4
REG_D1_5
REG_D1_6
REG_D1_7
REG_D1_8
REG_D1_9
REG_D1_A
REG_00
REG_04
REG_08
REG_0C
REG_10
REG_14
REG_18
REG_1C
REG_20
REG_24
REG_40
REG_60
REG_70
REG_74
REG_00
REG_04
REG_08
REG_0C
REG_10
REG_14
REG_18
REG_1C
REG_20
REG_24
REG_28
REG_2C
REG_30
REG_50
REG_54
REG_58
REG_60
REG_64
REG_68
REG_6C
REG_70
REG_74
REG_80
19.4 MIPI Tx
19.4.1 Overview
The Display Serial Interface (DSI) interface is a high-speed serial interface defined by the Mobile Industry Proces-
sor Interface alliance (MIPI Alliance) and is mainly used for the connection between the processor and the display
module. The MIPI Tx interface implements the DSI interface and supports MIPI D-PHY V1.0 serial signal output.
MIPI Tx consists of two parts: analog PHY and digital Controller. The system architecture and functional block dia-
gram are shown in the figure.
19.4.2 Features
19.4.3.1 Tx D-PHY
Tx D-PHY has two working modes, High Speed (HS) and Low Power (LP):
• Video mode data is transmitted through high-speed mode.
• Command mode data is transmitted through low-speed mode.
The data rate range of each lane (Lane) in high-speed mode is 80~2500Mbps, and the maximum rate in low-speed
mode is 10Mbps.
High-speed mode supports up to 4 data lanes. The actual number of data lanes used can be 1/2/4, and the order and
polarity are configurable. Low-speed mode transmission, reception and Bus Turn-Around (BTA) are only supported
by configured data lane0.
19.4.3.2 Tx Controller
When there are multiple high-speed packets to be transmitted, the Tx D-PHY will automatically switch between HS
and LP modes according to the high-speed data transmission requirements sent by the Tx Controller. Tx Controller
supports whether to send EoT packet (End of Transmission, EoT) at the end of HS transmission.
The controller supports the transmission of DSI RGB16/18/24/30 bit. The composition format of various data types
is as shown in the figure.
Note: RGB 18-bit only supports data type = 0x0E, does not support loosely Packet mode (data type = 0x2E)
MIPI Tx only transmits valid synchronization signals and data, and enters the BLLP area the rest of the time to re-
duce power consumption.
19.4.5.1 DSI_MAC_REG_00
19.4.5.2 DSI_MAC_REG_01
19.4.5.3 DSI_MAC_REG_02
19.4.5.4 DSI_MAC_REG_03
19.4.5.5 DSI_MAC_REG_04
19.4.5.6 DSI_MAC_REG_05
19.4.5.7 DSI_MAC_REG_06
19.4.5.8 DSI_MAC_REG_07
19.4.5.9 DSI_MAC_REG_08
19.4.5.10 DSI_MAC_REG_09
19.4.7.1 REG_00
19.4.7.2 REG_01
19.4.7.3 REG_02
19.4.7.4 REG_03
19.4.7.5 REG_04
19.4.7.6 REG_05
19.4.7.7 REG_23
19.4.7.8 REG_24
19.4.7.9 REG_25
19.4.7.10 REG_26
19.4.7.11 REG_27
19.4.7.12 REG_28
19.4.7.13 REG_2D
TWENTY
AUDIO INTERFACE
20.1 AIAO
20.1.1 Overview
The audio input/output interface (Audio Input/Audio Output) is used to interface with the chip’s built-in Audio
Codec or the chip’s external Audio Codec and digital microphone to complete the sending and receiving of audio
data and realize functions such as recording, playback, and intercom. The chip integrates AIAO related modules into
a subsystem, and the built-in Audio Codec ADC/DAC supports stereo input and output. It supports two sets of I2S
interfaces externally, and integrates 4 sets of I2S TX/RX modules internally, which can receive and send audio data
at the same time, and can support the simultaneous sending and receiving of multi-channel data. The basic module
block diagram is shown below:
583
CHAPTER 20. AUDIO INTERFACE
20.1.2 Features
The AIAO interface supports Master-mode, Slave-mode I2S and PCM modes, and supports multi-channel TDM
mode. Receive and send audio data to access the DDR space through DMA. The specific features are as follows:
• Highly flexible and configurable timing parameters, frame period, frame synchronization signal duration and
polarity are all configurable
• Configurable clock edges for signal generation and sampling
• Supports master mode and slave mode stereo I2S mode audio data sending and receiving
• Supports transmission and reception of audio data in master mode and slave mode mono and stereo PCM
mode
• Supports sending and receiving of multi-channel TDM mode audio data in master mode and slave mode
• Receive and send can be enabled individually or simultaneously
• Data adopts DMA operation and can be accessed circularly through the buffer developed by the software.
The AIAO subsystem connects the built-in Audio codec, I2S pins and TX/RX modules through the internal PIN-
MUX, and configures the registers appropriately according to the application requirements through software to
achieve different connection methods.
Diagram 20.2: Schematic diagram of connection with built-in Audio Codec through I2S interface
Diagram 20.3: Schematic diagram of connecting AIAO to an external Audio Codec through the I2S interface in mas-
ter mode
Diagram 20.4: Schematic diagram of connecting AIAO to an external Audio Codec through the I2S interface in slave
mode
The audio source is Analog-to-Digital converted into audio data through the built-in or external Audio Codec ADC,
which is received by the connected RX module through the I2S or PCM interface, and stored in the circular buffer
via DMA, and then taken out by the CPU for storage, thus Complete the recording function. The TX module reads
audio data from the circular buffer through DMA, and transmits the audio data to the connected built-in or external
Audio through the I2S or PCM interface. Codec DAC, performs Digital-to-Analog conversion for audio source play-
back.
When connecting to an external I2S interface, the supported I2S timing is as shown in the diagram I2S interface tim-
ing.
Chart I2S interface timing takes the audio data width 24-bit as an example. The data is transmitted in MSB First
mode. The MSB is delayed by one BCLK cycle relative to the LRCK signal. The data and LRCK signal are sent out
using the falling edge of BCLK and sampled on the rising edge of BCLK. (tx_sample_edge = 0, rx_sample_edge =
1).
When connecting to the external PCM interface, it supports PCM standard timing and data left-aligned timing. The
standard mode timing is as shown in the diagram PCM interface standard mode timing, and the left-aligned mode
timing is as shown in the diagram PCM Interface Left Justified Mode Timing.
Chart PCM interface standard mode timing takes the stereo audio data width of 16-bit as an example. The data is
transmitted in MSB First mode. The MSB is delayed by one BCLK cycle relative to the LRCK signal. The data and
LRCK signal are sent out using the falling edge of BCLK. On the rising edge of BCLK sample(tx_sample_edge = 0,
rx_sample_edge = 1).
In left-justified mode, the data and LRCK signals are sent out at the beginning of the same beat.
The Audio Codec integrated within AIAO and the external Audio Codec connected through the I2S interface can
work simultaneously through software configuration. The connection method is as shown in the figure: Schematic
diagram of connection with built-in Audio Codec through I2S interface, Schematic diagram of connecting AIAO
to an external Audio Codec through the I2S interface in master mode and Schematic diagram of connecting AIAO
to an external Audio Codec through the I2S interface in slave mode. Before enabling data transmission accord-
ing to application needs, the software must first configure the AIAO subsystem registers i2s_tdm_sclk_in_sel,
i2s_tdm_fs_in_sel, i2s_tdm_sdi_in_sel, i2s_tdm_sdo_out_sel to connect each interface to the corresponding TX/RX
module (I2S_TDM_0~I2S_TDM_3).
If AIAO operates in master mode, you must first set the TX/RX module register master_mode as the MCLK/BCLK
clock source to 1, configure the frequency division register I2S_CLK_CTRL1 (mclk_div, bclk_div) depending on the
sampling rate, and then set the register I2S_CLK_CTRL0 (aud_en) is 1, turns on clock gating.
The four TX/RX modules integrated by AIAO all have independent soft resets. Before enabling the TX/RX modules
for data transmission, the registers FIFO_RESET and I2S_RESET must be configured for soft reset.
An overview of AIAO subsystem registers is shown in table AIAO Registers Overview (Base Address:
0x0410_8000).
The I2S_TDM_0 ~ I2S_TDM_3 module register overview is shown in the table I2S_TDM_0/1/2/3 Registers
Overview (Base Address: 0x0410_0000 + n*0x10000).
i2s_tdm_sclk_in_sel
i2s_tdm_fs_in_sel
i2s_tdm_sdi_in_sel
i2s_tdm_sdo_out_sel
i2s_bclk_oen_sel
audio_pdm_ctrl
i2s_sys_int_en
i2s_sys_ints
BLK_MODE_SETTING
FRAME_SETTING
SLOT_SETTING1
SLOT_SETTING2
DATA_FORMAT
BLK_CFG
I2S_ENABLE
block enable
I2S_RESET
sw reset
I2S_INT_EN
interrupt enable
I2S_INT
interrupt status
FIFO_THRESHOLD
I2S_LRCK_MASTER
block enable
FIFO_RESET
RX_STATUS
TX_STATUS
I2S_CLK_CTRL0
I2S_CLK_CTRL1
I2S_PCM_SYNTH
RX_RD_PORT
TX_WR_PORT
20.2.1 Overview
The chip integrates high-performance Audio Codec, including stereo playback DAC (90dB DR A-Weighted), which
supports two single-ended lineout outputs; stereo recording ADC (90dB DR A-Weighted), which supports stereo
single-ended input.
20.2.2 Features
rxadc_ctrl0
rxadcc_ctrl1
rxadc_status
rxadc_ana0
rxadc_ana1
rxadc_ana2
rxadc_ana3
rxadc_ana4
txdac_ctrl0
txdac_ctrl1
txdac_status
txdac_afe0
txdac_afe1
txdac_ana0
txdac_ana1
TWENTYONE
PERIPHERALS
21.1 I2C
21.1.1 Overview
This chip is equipped with 6 I2C controllers (5 in Active Domain, 1 in No-die Domain), which can be individually
configured as Master/Slave. For IO configuration, please refer to Function pin mux for configuration.
I2C functional block diagram is the functional block diagram of the I2C module. IIC_CLK is the module clock, and
the chip supports 25MHz or 100MHz. The CPU selects various I2C modes and timings through the APB bus config-
uration register, writes TXFIFO, reads RXFIFO, and triggers FSM to send and receive SDA/SCL related IO signals.
System DMA can also be used with I2C. DMA_IF, and write TXFIFO and read RXFIFO through the APB bus to
send and receive I2C signals.
619
CHAPTER 21. PERIPHERALS
The chip I2C supports the general standard I2C protocol timing as shown in I2C Protocol Timing.
1. CLK_DIV CRG register chapter, configure clk_byp_0_31 to select IIC_CLK as the 25MHz default clock
source or 100MHz z clock source.
2. The module should be in disabled state when configuring related timing configuration. IC_ENABLE needs to
be set to 0, and query IC_ENABLE_STATUS[0] to confirm it is 0.
3. Refer to the table I2C clock selection and related register configuration relationship table, select according to
the I2C clock, and configure the I2C timing count register.
Table 21.1: I2C clock selection and related register configuration rela-
tionship table
Register 25M IIC_CLK 100M IIC_CLK Description
IC_SS_SCL_HCNT 115 460 SCL high level time counting in standard
speed mode
IC_SS_SCL_LCNT 135 540 SCL low level time counting in standard
speed mode
IC_FS_SCL_HCNT 21 90 SCL high level time counting in fast speed
mode
IC_FS_SCL_LCNT 42 160 SCL low level time counting in fast speed
mode
IC_SDA_HOLD 1 1 SDA hold time count, relative to SCL nega-
tive edge
IC_SDA_SETUP 6 25 SDA time count, relative to the positive
edge of SCL
IC_FS_SPKLEN 2 5 I2C glitch suppression time count
Includes 6 I2C, 5 Active Domain, 1 No-die Domain. Their base addresses are as follows. Each I2C consists of a set
of control registers, each set identically defined.
21.1.7.1 IC_CON
21.1.7.2 IC_TAR
21.1.7.3 IC_SAR
21.1.7.4 IC_DATA_CMD
21.1.7.5 IC_SS_SCL_HCNT
21.1.7.6 IC_SS_SCL_LCNT
21.1.7.7 IC_FS_SCL_HCNT
21.1.7.8 IC_FS_SCL_LCNT
21.1.7.9 IC_INTR_STAT
21.1.7.10 IC_INTR_MASK
21.1.7.11 IC_RAW_INTR_STAT
21.1.7.12 IC_RX_TL
21.1.7.13 IC_TX_TL
21.1.7.14 IC_CLR_INTR
21.1.7.15 IC_CLR_RX_UNDER
21.1.7.16 IC_CLR_RX_OVER
21.1.7.17 IC_CLR_TX_OVER
21.1.7.18 IC_CLR_RD_REQ
21.1.7.19 IC_CLR_TX_ABRT
21.1.7.20 IC_CLR_RX_DONE
21.1.7.21 IC_CLR_ACTIVITY
21.1.7.22 IC_CLR_STOP_DET
21.1.7.23 IC_CLR_START_DET
21.1.7.24 IC_CLR_GEN_CALL
21.1.7.25 IC_ENABLE
21.1.7.26 IC_STATUS
21.1.7.27 IC_TXFLR
21.1.7.28 IC_RXFLR
21.1.7.29 IC_SDA_HOLD
21.1.7.30 IC_TX_ABRT_SOURCE
21.1.7.31 IC_SLV_DATA_NACK_ONLY
21.1.7.32 IC_DMA_CR
21.1.7.33 IC_DMA_TDLR
21.1.7.34 IC_DMA_RDLR
21.1.7.35 IC_SDA_SETUP
21.1.7.36 IC_ACK_GENERAL_CALL
21.1.7.37 IC_ENABLE_STATUS
21.1.7.38 IC_FS_SPKLEN
21.1.7.39 IC_HS_SPKLEN
21.2 UART
21.2.1 Overview
UART (Universal Asynchronous Receiver Transmitter) is an asynchronous serial communication interface. Its main
function is to convert data from peripheral devices to serial and then transfer it to the internal bus, and to convert
data from parallel to serial and then output it to external devices. The main function of UART is to interface with the
UART of an external chip to achieve communication between the two chips.
This chip provides 5 UART controllers. The relevant overview is as follows. Note: Please refer to the specific pin
output definition before use. Due to different chip packages (QFN/BGA), some functions may not be exported. For
pin definition, refer to PinMux and PinCtrl.
21.2.2 Features
UART is a universal point-to-point physical layer transmission protocol that can be used to interface with various
systems, including PCs and various peripheral chips, and can be used as a communication interface between chips.
• Baud Rate
Since the UART interface does not have a reference clock and is an asynchronous transmission
method, both parties need to use the same transmission speed, that is, the baud rate (buadrate) for
communication. If there is an error, the error rate needs to be small enough to avoid misinforma-
tion. The rate of 1 bit is called baudrate. Typical baud rates are 300, 1200, 2400, 9600, 19200,
38400, 115200bps, etc.
• Frame Structure
The UART transmission data structure is in frames. The frame structure includes start signal, data
signal, check bit and end signal.
The start signal is the mark of the beginning of a frame. The very beginning of initiating a frame
transmission is to send a low-level signal bit on TXD. On RXD, if a low level signal bit is received
in the idle state, it is judged as receiving the start of a detection transmission.
• Data signal (data bit)
The data bit width can be adjusted according to different application requirements, and can be
5/6/7/8 bit data bit width. Typically 8-bit data width.
• Parity bit
The check bit is a 1-bit error correction signal. The check bits of the UART include odd parity
check, even parity and fixed check bits. It also supports the enable and disable of the check bit. For
detailed description, please see the LCR register.
• End signal (stop bit)
The end signal is the stop bit of the frame, supporting 1-bit, 1.5-bit and 2-bit stop bits. To send the
end signal of a frame is to send TXD high level to complete the transmission and enter the idle
state. After receiving a frame and counting the check bits, the end signal needs to be received.
𝑈 𝐴𝑅𝑇 _𝑆𝐶𝐿𝐾
𝐵𝑎𝑢𝑑 𝑟𝑎𝑡𝑒 =
16 * (256 * 𝐷𝐿𝐻 + 𝐷𝐿𝐿)
• Taking UART SCLK 25MHz as an example and configuring a baud rate of 115200, the formula is:
25𝑀
(256 * 𝐷𝐿𝐻 + 𝐷𝐿𝐿) = = 13.5
16 * 115200
If you choose to configure DLL as 14 and DLH as 0, the actual baud rate is:
25𝑀
𝐵𝑎𝑢𝑑 𝑟𝑎𝑡𝑒 = = 111607
16 * 14
The one-bit time error is:
(115200 − 114286)
𝐵𝑖𝑡 𝐸𝑟𝑟𝑜𝑟 = = 3.12%
115200
The accumulated time error of one frame is: 𝐹 𝑟𝑎𝑚𝑒 𝐸𝑟𝑟𝑜𝑟 = 3.12%*10 = 31.2%
• Taking UART SCLK 187.5MHz as an example, configure a baud rate of 115200, and the formula is:
187.5𝑀
(256 * 𝐷𝐿𝐻 + 𝐷𝐿𝐿) = = 101.7
16 * 115200
If you choose to configure DLL as 102 and DLH as 0, the actual baud rate is:
187.5𝑀
𝐵𝑎𝑢𝑑 𝑟𝑎𝑡𝑒 = = 114890
16 * 102
The one-bit time error is:
(115200 − 114890)
𝐵𝑖𝑡 𝐸𝑟𝑟𝑜𝑟 = = 0.27%
115200
The accumulated time error of one frame is: 𝐹 𝑟𝑎𝑚𝑒 𝐸𝑟𝑟𝑜𝑟 = 3.12%*10 = 2.7%
Initialization steps
3. Write 0 to LCR[7].
4. Configure LCR and set the corresponding UART working mode
5. Configure FCR and set the corresponding transmit and receive FIFO thresholds.
6. If you use the interrupt mode, you need to set IER and enable the corresponding interrupt signal;
Data sending
1. When LCR[7] is 0, write the transmission data to RBR_THR_DLL (Transmit Holding Register) to start data
transmission.
2. If the query method is used, detect the TX_FIFO status by reading USR[1] (Transmit FIFO not full) and TFL
(Transmit FIFO Level), and decide whether to continue writing data to RBR_THR_DLL based on the status of
TX_FIFO;
3. If the interrupt mode is used, detect the corresponding interrupt status bit; decide whether to continue writing
data to RBR_THR_DLL.
4. Determine whether the UART has completed sending all data by detecting USR[2] (Transmit FIFO Empty).
Data reception
1. If the query method is used, the RX_FIFO status is detected by reading USR[3] (Receive FIFO Not
Empty) and RFL (Receive FIFO Level), and based on the status of RX_FIFO, it is decided whether to read
RBR_THR_DLL (Receive Buffer Register) to obtain the data.
2. If the interrupt mode is used, the corresponding interrupt status bit detection is used to determine whether to
read RBR_THR_DLL (Receive Buffer Register) and obtain the data.
Initialization steps
Data sending
1. Configure system DMA channel mapping. Refer to the system DMA channel mapping and configure the se-
lected UART controller TX/RX request line number to the corresponding system DMA channel. For example:
UART0 TX configures system DMA channel 3, then sdma_dma_ch_remap0[29:24]=9. After the configuration
is completed, update_dma_remp_0_3 needs to be configured to make the configuration effective.
2. Configure the system DMA data channel, including data transmission source and destination addresses, data
transmission number, transmission type and other parameters. Please refer to the DMA controller chapter for
specific configuration.
3. Use the system DMA interrupt report to determine whether the data transmission is completed.
Data reception
1. Configure system DMA channel mapping. Refer to the DMA channel mapping and configure the selected
UART controller TX/RX request line number to the corresponding system DMA channel. For example:
UART0 RX configures system DMA channel 1, then sets sdma_dma_ch_remap0[13:8] = 8. After the configu-
ration is completed, update_dma_remp_0_3 needs to be configured to make the configuration effective.
2. Configure the system DMA data channel, including data transmission source and destination addresses, data
receiving area address, data transmission number, transmission type and other parameters. Please refer to the
DMA controller chapter for specific configuration.
3. Determine whether data reception is completed through system DMA interrupt reporting.
Includes 6 UARTs, 5 Active Domains, and 1 No-die Domain. Their base addresses are as follows. Each UART con-
sists of a set of control registers, each set identically defined.
21.2.6.1 RBR_THR_DLL
21.2.6.2 IER_DLH
21.2.6.3 FCR_IIR
21.2.6.4 LCR
21.2.6.5 MCR
21.2.6.6 LSR
21.2.6.7 MSR
21.2.6.8 LPDLL
21.2.6.9 LPDLH
21.2.6.10 SRBR_STHR
21.2.6.11 FAR
21.2.6.12 TFR
21.2.6.13 RFW
21.2.6.14 USR
21.2.6.15 TFL
21.2.6.16 RFL
21.2.6.17 SRR
21.2.6.18 SRTS
21.2.6.19 SBCR
21.2.6.20 SDMAM
21.2.6.21 SFE
21.2.6.22 SRT
21.2.6.23 STET
21.2.6.24 HTX
21.2.6.25 DMASA
21.3 SPI
21.3.1 Overview
The system is configured with 4 SPI controller modules, which can be used as Master to conduct synchronous serial
communication with external devices to achieve serial-to-parallel and parallel-to-serial conversion of data.
21.3.2 Features
The application block diagram when the SPI master connects to the external slave is as shown in the chart SPI appli-
cation block diagram
21.3.4.2 Clock
The SPI controller module reference clock can be set to 187.5MHz or 100MHz.
The output SPI_SCK supports up to 46.875MHz.
The calculation is as follows:
Output SPI_SCK = SPI working reference clock / BAUDR
SPI working reference clock : 187.5MHz or 100MHz.
BAUDR register : Set an even number between 2 and 65534.
Calculation example:
SPI working reference clock = 187.5MHz and BAUDR =4
Output SPI_SCK = 187.5MHz / 4 = 46.875MHz
The SPI controller module has 6 interrupts, the first 5 of which are active high maskable independent interrupt
sources.
• RXFINTR
Receive FIFO interrupt request. This interrupt is set when there is RXFTLR+1 or more valid data in the re-
ceive FIFO.
• RXOINTR
When the receive FIFO is full and new data needs to be written to the FIFO, FIFO Overflow will occur and
this interrupt is set. At this time data is written to the receive shift register instead of the FIFO.
• RXUINTR
When the receive FIFO is read empty and no new data is written to the receive FIFO before a new read request
occurs, FIFO Underflow will be caused and the interrupt will be set. The values read at this time are all 0. This
interrupt can be cleared by reading register RXUICR.
• TXOINTR
When the transmit FIFO is full and new data needs to be written to the FIFO, FIFO Overflow will occur and
this interrupt will be set.
• TXEINTR
Send FIFO interrupt request. This interrupt is set when there is TXFTLR or less valid data in the transmit
FIFO.
• SPI_INTR
The combined interrupt is the result of the “OR” operation of the above five interrupts. To mask this interrupt,
register IMR must be set to mask the above 5 interrupts. This interrupt is set if any of the above 5 independent
interrupts is set and enabled.
21.3.4.4 Initialization
• The process when the SPI master connects to the external SPI/SSP slave is shown in the diagram Data trans-
mission process when connecting to external SPI/SSP slave.
Diagram 21.10: Data transmission process when connecting to external SPI/SSP slave
• The process when the SPI master connects to the external Microwire slave is shown in the diagram Data trans-
mission process when connecting to external Microwire slave.
Diagram 21.11: Data transmission process when connecting to external Microwire slave
The SPI module uses two DMA channels, one for transmitting and one for receiving. The relevant registers for SPI
DMA mode settings are DMACR, DMATDLR, and DMARDLR.
The steps to enable SPI DMA mode are as follows:
• Step 1: Get two DMA channels.
• Step 2: Set register DMACR [1:0] to enable SPI DMA transmission and reception.
• Step 3: Set register SPIENR to “1” to enable SPI.
• Step 4: Send data:
1. Configure the control registers related to the sending DMA channel.
2. Start the DMA controller and respond to the SPI send FIFO request.
3. Use the DMA controller interrupt report to determine whether the transmission is completed. If it is
completed, close the SPI transmission DMA function.
• Step 5: Receive data:
1. Configure the control registers related to the receive DMA channel.
2. Start the DMA controller and respond to the DMA request of the SPI receive FIFO.
3. Use the DMA controller interrupt report to determine whether the data reception is completed. If it is
completed, close the SPI receiving DMA function.
• Step 6: Set register SPIENR to “0” to stop SPI.
The following figures represent the various data transmission formats of Motorola SPI. Among them, SCPH
represents the SPI_SCK phase, and SCPOL represents the SPI_SCK polarity, which is set through the register
CTRLR0[7:6].
(A) SCPH = 0
In this mode, SPI_CS_X is set to high level when in idle state and set to low level when transmitting.
SPI_SCK is different through the SCPOL setting. SCPOL = 0, it is set to low level when in idle state.
During transmission, data is captured on the rising edge of the clock. SCPOL = 1, set to high level when
in idle state. , when transmitting, the data is captured on the falling edge of the clock.
• The single frame transmission format is shown in the diagram Motorola SPI single frame transmission format
(SCPH = 0).
• The continuous frame transmission format is shown in the diagram Motorola SPI continuous frame transmis-
sion format (SCPH = 0).
(B) SCPH = 1
In this mode, SPI_CS_X is set to high level when in idle state and set to low level when transmitting.
SPI_SCK is different through the SCPOL setting. SCPOL = 0, it is set to low level when in idle state,
and data is captured on the falling edge of the clock during transmission. SCPOL = 1, set to high level
when in idle state. , when transmitting, the data is captured on the rising edge of the clock.
• The single frame transmission format is shown in the diagram Motorola SPI single frame transmission format
(SCPH = 1).
• The continuous frame transmission format is shown in the diagram Motorola SPI continuous frame transmis-
sion format (SCPH = 1).
In SSP mode, SPI_CS_X is set to high level when in idle state and set to low level during transmission. SPI_SCK is
set to low level when in idle state, and data is captured on the falling edge of the clock during transmission.
The following figures represent the TI SSP data transfer format.
• The single frame transmission format is shown in the diagram TI SSP single frame transmission format.
• The continuous frame transmission format is shown in the diagram TI SSP continuous frame transmission for-
mat.
In Microwire mode, SPI_CS_X is set to high level when in idle state and set to low level during transmission.
SPI_SCK is set to low level when in idle state, and data is captured on the rising edge of the clock during transmis-
sion.
When transmitting data in this mode, a control word must be added first, and the external chip then responds to the
data word required by the Master based on the control word. The control word length can be set through register
CTRLR0[15:12], and other related parameters can be set through register MWCR.
The following figures represent the NS Microwire data transmission format.
• The single frame transmission format is shown in the diagram NS Microwire Single frame transmission format.
• The continuous frame transmission format is shown in the diagram NS Microwire continuous frame transmis-
sion format.
The four sets of SPI module base addresses of the chip are shown in the table Base addresses for 4 sets of SPI mod-
ule.
Table Registes Overview (SPI0) is the offset address and definition of the registers of the first group of SPI modules
(SPI0). SPI0 ~ SPI3 have the same register definitions.
21.3.7.1 CTRLR0
To be continued . . . . . .
To be continued . . . . . .
31:16 Reserved
21.3.7.2 CTRLR1
21.3.7.3 SPIENR
21.3.7.4 MWCR
21.3.7.5 SER
21.3.7.6 BAUDR
21.3.7.7 TXFTLR
21.3.7.8 RXFTLR
21.3.7.9 TXFLR
21.3.7.10 RXFLR
21.3.7.11 SR
21.3.7.12 IMR
21.3.7.13 ISR
21.3.7.14 RISR
21.3.7.15 TXOICR
21.3.7.16 RXOICR
21.3.7.17 RXUICR
21.3.7.18 MSTICR
21.3.7.19 ICR
21.3.7.20 DMACR
21.3.7.21 DMATDLR
21.3.7.22 DMARDLR
21.3.7.23 DR
21.3.7.24 RX_SAMPLE_DLY
The EMMC/SD/SDIO controller (SDMMC controller for short) is used to handle operations such as data reading
and writing of SD cards and eMMC, as well as external devices supported by the SDIO protocol (such as Bluetooth,
WIFI, etc.). This chip provides three sets of SDMMC controllers. in:
• EMMC supports devices that comply with the eMMC4.1 and eMMC4.5 protocols.
• SDIO0 supports devices that comply with the Secure Digital Memory (SD 3.0) protocol.
• SDIO1 supports devices that comply with the Secure Digital I/O (SDIO 3.0) protocol.
The corresponding functional signals and pins of the three SDMMC controllers in the chip are as shown in the table
below.
SDMMC functions:
1. Support SD card, SDIO device and eMMC.
2. Transfer data between eMMC/SD/SDIO and system memory data through the internal DMA controller.
3. Supports CRC generation and checking of commands and data.
4. The frequency required between different modes can be generated through the internal frequency divider.
5. Provide a mechanism to turn off the internal clock and the clock on the interface to meet power saving require-
ments.
6. Provides 1-bit and 4-bit data transmission interfaces to communicate with devices.
7. Supports data read and write operations with block_size equal to 1~2048byte.
8. Support SDIO protocol, including interrupt interval, suspend, resume and read wait operations.
9. Supports AXI/AHB interface and can access system memory through internal DMA.
10. Supports AHB interface, which can access internal registers through CPU.
The bus packet of eMMC/SD mainly consists of three parts: command, response and data.
The command and response packets are transmitted through the CMD signal line.
• Command packet
The command packet is sent from the host to the device to indicate the start of an operation. The packet format
consists of 48 bits including start bit, transmission bit, command number, command parameter, CRC verifica-
tion code and end bit. As shown in eMMC/SD/SDIO command format.
• Response Packet
After receiving the command, the device will return a response according to different command categories to
display the status or parameters of the device. Its length is 48 bits or 136 bits. As shown in eMMC/SD/SDIO
response format.
• Data packet:
Data packets are used to exchange data between the host and the device. According to different needs, 1-bit
(DATA0), 4-bit (DATA0-DATA3) or 7-bit (DATA0-DATA7) can be selected. In each clock interval, Each data
signal line can choose to transmit (single data rate) or (dual data rate). The packet formats are shown in the
diagram eMMC/SD/SDIO 1-bit data packet format ~ the diagram 8-bit dual data rate data packet format.
Depending on whether there is data transmission, instructions can be further divided into the following two types:
• Non-data transmission commands: Complete command transmission and receive responses through the signal
line CMD.
Diagram 21.29: Non-data transmission instructions: Complete instruction transmission and receive responses
through the signal line CMD
• Data transmission instructions: In addition to the interaction on the signal line CMD, there is also data trans-
mission on the data lines DAT0~DAT3
The data transmission between the host and the device is mainly in blocks. In addition to the data, CRC check bits
are also included to verify the correctness of the data. The more commonly used methods are single-block data read-
ing and writing and multi-block data reading and writing. Compared with single-block data transmission, multi-
block data transmission has higher efficiency. Among them, the block size of EMMC and SD card is 512byte. SDIO
is special and can support block sizes of 1~2048byte. Users can define the block size value according to different
devices.
(1) Single block and multi-block read operations are shown in the diagram Single block and multi-block read oper-
ations. Single block transmission consists of instructions, responses, data and CRC. Multi-block transfers end
with a reliable STOP CMD to abort the transfer.
(2) Single block and multi-block write operations are as shown in the diagram Single block and multi-block write
operations. The transmission process will send a BUSY signal through the DAT0 signal line to notify the host
that the writing device is in progress.
As shown in the diagram clock shutdown program is a clock shutdown procedure. The host must ensure that no
transmission is taking place on the bus in order to shut down the clock.
(1) Read the temporary register PRESENT_STS.
(2) Check whether the bits CMD_INHIBIT and DAT_INHIBIT are both 0.
(3) If any bit is not 0, it means that the transmission is still in progress and a delay is required.
(4) If both are 0, you can set CLK_CTL[SD_CLK_EN]=0 to turn off the clock.
When the controller operates abnormally, reliably reset the configuration register (base address = 0x0300_3000) to
perform a soft reset. The temporary register addresses used are as follows:
1. EMMC: SOFT_RSTN_0[reg_soft_reset_x_emmc] (address offset: 0x000, Bit15)
2. SDIO0: SOFT_RSTN_0[reg_soft_reset_x_sd0] (address offset: 0x000, Bit16)
3. SDIO1: SOFT_RSTN_0[reg_soft_reset_x_sd1] (address offset: 0x000, Bit17)
Diagram Clock configuration flow chart is a flow chart for interface clock configuration. The SDMMC controller
provides a frequency divider inside, allowing users to adjust the required clock frequency according to different pro-
tocols and speed modes. Its relationship is:
FSD_CLK_OUT = FINT_CARD_CLK / (2 * clk_divisor)
When SDMMC changes the frequency, in addition to ensuring that no instructions and data are still being transmit-
ted, it must also be set according to the steps of the interface clock configuration flow chart to avoid glitches in the
clock output to the eMMC/SD device.
(1) Turn off the interface clock.
(2) Calculate the frequency division factor.
(3) Set the frequency division factor. Fill in the parameters calculated in (2) into CLK_CTL[FREQ_SEL], and
start turning on the internal clock switch (CLK_CTL[INT_CLK_EN]=1).
(4) Check CLK_CTL[INT_CLK_STABLE] to confirm whether the frequency switching is completed.
(5) If it has not been completed (CLK_CTL[INT_CLK_STABLE]=0), delay and wait.
(6) If switching the clock frequency is completed, turn on the interface clock.
There are two ways of aborting instructions: synchronous abort instruction and asynchronous abort instruction.
• Asynchronous abort command program
Diagram Program chart of asynchronous abort instruction is the program diagram of the non-synchronous
stop instruction. Detailed steps are as follows:
(1) Execute abort instructions according to different transmission modes.
(2) Set SW_RST_CMD and SW_RST_DAT in the SW_RESET register to reset the CMD and DAT signal
lines.
(3) Check the bits SW_RESET[SW_RST_CMD] and SW_RESET[SW_RST_DAT] to confirm whether the
reset is completed. If both are 0, end the program. If one of them is 1, return to step (3) and wait for a
delay.
(3) After receiving the interrupt, set NORM_INT_STS[XFER_CMPL]=1 to clear the XFER_CMPL inter-
rupt status.
(4) Execute abort instructions according to different transmission modes.
(5) Set SW_RST_CMD and SW_RST_DAT in the SW_RESET register to reset the CMD and DAT signal
lines.
(6) Check the bits SW_RESET[SW_RST_CMD] and SW_RESET[SW_RST_DAT] to confirm whether the
reset is completed. If both are 0, end the program. If one of them is 1, return to step (6) to delay waiting.
The program for non-DMA data transfer mode is as shown in the diagram Program for non-DMA data transfer
mode. Detailed steps are as follows:
(1) Write to the BLK_SIZE register to set the block size.
(2) Write to the BLK_CNT register to set the number of blocks.
(3) Write to the ARGUMENT register to set the command parameters.
(4) Write to the XFER_MODE register to set the transmission mode. The host can determine settings based on
usage scenarios. Contains Single or Multiple Block Select, DMA Enable, Block Count Enable, Data Transfer
Direction, Auto CMD Enable.
(5) Write to the CMD register to set the command and response types.
(6) Interrupt NORM_INT_STS[CMD_CMPL] waiting for Command completion.
(7) After receiving the interrupt, set NORM_INT_STS[CMD_CMPL]=1 to clear the CMD_CMPL interrupt sta-
tus.
(8) Then read the RESP1_0, RESP3_2, RESP5_4, RESP7_6 and other temporary registers to obtain the response
value.
(9) If it is a read operation, step (14) will be executed, if it is a write operation, step (10) will be executed.
(10) Waiting for the Buffer Write Ready interrupt NORM_INT_STS[BUF_WRDY].
(11) After receiving the interrupt, set NORM_INT_STS[BUFF_WRDY]=1 to clear the BUFF_WRDY interrupt
status.
(12) Write the data you want to write to the device sequentially into the BUF_DATA register.
(13) If there are more blocks to be written, go back to step (10) until the last block is written, then go to step (18).
(14) Waiting for the Buffer Read Ready interrupt NORM_INT_STS[BUF_RRDY].
(15) After receiving the interrupt, set NORM_INT_STS[BUFF_RRDY]=1 to clear the BUFF_RRDY interrupt sta-
tus.
(16) Read the data received from the device in sequence from the BUF_DATA register.
(17) If there are more blocks to be read, go back to step (14) until the last block is read, then go to step (18).
(18) Determine whether it is single module transmission, multi-module transmission or unlimited module transmis-
sion. If it is a single module or multi-module transmission, skip to step (19). If it is an infinite module transfer,
jump to step (21) and perform the action of aborting the transfer.
(19) Interrupt NORM_INT_STS[XFER_CMPL] waiting for completion of data transfer.
(20) After receiving the interrupt, set NORM_INT_STS[CMD_XFER]=1 to clear the XFER_CMPL interrupt sta-
tus.
(21) Execute the abort transfer procedure.
The SDMA data transfer mode program is shown in the diagram: ref:diagram_sdma_data_transfer, and the detailed
steps are as follows:
(1) Write to the SDMA_SA register to set the starting address of the system memory used for data transmission.
(2) Write to the BLK_SIZE register to set the block size.
(3) Write to the BLK_CNT register to set the number of blocks.
(4) Write to the ARGUMENT register to set the command parameters.
(5) Write to the XFER_MODE register to set the transmission mode. The host can determine settings based on
usage scenarios. Contains Single or Multiple Block Select, DMA Enable, Block Count Enable, Data Transfer
Direction, Auto CMD Enable.
(6) Write to the CMD register to set the command and response types.
(7) Interrupt NORM_INT_STS[CMD_CMPL] waiting for Command completion.
(8) After receiving the interrupt, set NORM_INT_STS[CMD_CMPL]=1 to clear the CMD_CMPL interrupt sta-
tus.
(9) Then read the RESP1_0, RESP3_2, RESP5_4, RESP7_6 and other temporary registers to obtain the response
value.
(10) Wait for data transfer interrupt and DMA interrupt.
(11) Read the interrupt status register NORM_INT_STS to determine the interrupt type. Skip to step (12) if it is a
DMA interrupt, or skip to step (14) if it is a data transfer interrupt.
(12) Set NORM_INT_STS[DMA_INT]=1 to clear the DMA_INT status value.
(13) Write to the SDMA_SA register to reset the starting address of the system memory for the next DMA. Then
skip to step (10).
(14) Set NORM_INT_STS[DMA_INT]=1 and [NORM_INT_STS[XFER_CMPL]=1 to clear the DMA_INT and
XFER_CMPL status values. Then end the program.
The ADMA data transfer mode program is shown in the diagram ADMA data transfer mode program, and the de-
tailed steps are as follows:
(1) Fill in the ADMA description table into the system memory.
(2) Write to the ADMA_SA_L and ADMA_SA_H registers to set the starting address of the system memory used
by the description table.
(3) Write to the BLK_SIZE register to set the block size.
(4) Write to the BLK_CNT register to set the number of blocks.
(5) Write to the ARGUMENT register to set the command parameters.
(6) Write to the XFER_MODE register to set the transmission mode. The host can determine settings based on
usage scenarios. Contains Single or Multiple Block Select, DMA Enable, Block Count Enable, Data Transfer
Direction, Auto CMD Enable.
(7) Write to the CMD register to set the command and response types.
(8) Interrupt NORM_INT_STS[CMD_CMPL] waiting for Command completion.
(9) After receiving the interrupt, set NORM_INT_STS[CMD_CMPL]=1 to clear the CMD_CMPL interrupt sta-
tus.
(10) Then read the RESP1_0, RESP3_2, RESP5_4, RESP7_6 and other temporary registers to obtain the response
value.
(11) Wait for data transfer interrupt or ADMA Error interrupt.
(12) Read the interrupt status register NORM_INT_STS and ERR_INT_STS to determine the interrupt type. Skip
to step (13) if it is an ADMA error interrupt, or step (15) if it is a data transfer interrupt.
(13) Set ERR_INT_STS[ADMA_ERR]=1 to clear the ADMA_ERR status value.
(14) Enter the ADMA Abort Transaction program (ADMA Abort Transaction) and execute the Abort Command to
abort the data transfer with the device. If necessary, you can check the ADMA Error Status register to check
the cause of the error.
(15) Set NORM_INT_STS[XFER_CMPL]=1 to clear the XFER_CMPL status value. Then end the program.
Table SDMMC Registers Overview is the SDMMC register overview (the base address of EMMC is 0x0430_0000,
SDIO0 is 0x0431_0000, SDIO1 is 0x0500_0000)
21.4.4.1 SDMA_SADDR
21.4.4.2 BLK_SIZE_AND_CNT
15 Reserved
31:16 BLK_CNT R/W Blocks Count for Current Transfer 0x0
21.4.4.3 ARGUMENT
Argument 1 Register
21.4.4.4 XFER_MODE_AND_CMD
To be continued . . . . . .
21.4.4.5 RESP31_0
21.4.4.6 RESP63_32
21.4.4.7 RESP95_64
21.4.4.8 RESP127_96
21.4.4.9 BUF_DATA
21.4.4.10 PRESENT_STS
21.4.4.11 HOST_CTL1_PWR_BG_WUP
To be continued . . . . . .
21.4.4.12 CLK_CTL_SWRST
21.4.4.13 NORM_AND_ERR_INT_STS
21.4.4.14 NORM_AND_ERR_INT_STS_EN
21.4.4.15 NORM_AND_ERR_INT_SIG_EN
21.4.4.16 AUTO_CMD_ERR_AND_HOST_CTL2
21.4.4.17 CAPABILITIES1
Capabilities 1 Register
21.4.4.18 CAPABILITIES2
Capabilities 2 Register
21.4.4.19 FORCE_EVENT_ERR
21.4.4.20 ADMA_ERR_STS
21.4.4.21 ADMA_SADDR_L
21.4.4.22 ADMA_SADDR_H
21.4.4.23 PRESENT_VUL_INIT_DS
21.4.4.24 PRESENT_VUL_HS_SDR12
21.4.4.25 PRESENT_VUL_SDR25_SDR50
21.4.4.26 PRESENT_VUL_SDR104_DDR50
21.4.4.27 SLOT_INT_AND_HOST_VER
21.4.4.28 EMMC_CTRL
21.4.4.29 EMMC_BOOT_CTL
21.4.4.30 CDET_TOUT_CTL
21.4.4.31 MBIU_CTRL
21.4.4.32 PHY_TX_RX_DLY
21.4.4.33 PHY_DS_DLY
21.4.4.34 PHY_DLY_STS
21.4.4.35 PHY_CONFIG
21.5 GPIO
The system includes 4 groups of GPIO (General Purpose Input/Output) under Active Domain, which are GPIO0
~ GPIO3, and 1 group of GPIO under No-die Domain, RTCSYS_GPIO. Each group of GPIO provides 32 pro-
grammable input and output pins.
Note: In this manual, GPIOA is often used instead of GPIO0, GPIOB instead of GPIO1, GPIOC instead of GPIO2,
and GPIOD instead of GPIO3.
The direction of each pin can be arbitrarily set as input or output, used to generate output signals for specific applica-
tions or collect input signals for specific applications. When set as an input pin, the GPIO can be used as an interrupt
source; when set as an output pin, each GPIO can independently output 0 or 1.
GPIO can generate maskable interrupts based on the level or transition value of the input signal. The
GPIOx_INTR_FLAG (x = 0 ~ 3) signal gives the interrupt controller an indication that an interrupt has occurred.
21.5.1 Features
When the chip is powered on or the system is reset, the four GPIO modules will be reset at the same time, and the
GPIO pins will be in the input state by default after reset.
Each pin can be set as input or output arbitrarily. The steps are as follows:
• Step 1: Configure the register GPIO_SWPORTA_DDR, set whether the GPIO is used as input or output.
• Step 2: When configured as an input pin, read the GPIO_EXT_PORTA register to view the input signal value;
when configured as an output pin, write the output value to the GPIO_SWPORTA_DR register to control the
GPIO output level.
Each GPIO can be used as an interrupt source, controlled through 9 registers such as GPIO_INTEN. Through these
registers the user can select the interrupt source, interrupt level polarity and edge triggering characteristics.
When multiple GPIO interrupts occur at the same time, they will be aggregated into one interrupt for reporting (each
of the 4 groups of GPIOs will have a collective interrupt flag reported).
The characteristics of the interrupt source and the interrupt trigger category are determined by the five reg-
isters GPIO_INTTYPE_LEVEL, GPIO_INT_POLARITY, GPIO_INTMASK, GPIO_DEBOUNCE, and
GPIO_LS_SYNC.
The original status and masked status of the interrupt are read through GPIO_RAW_INTSTATUS and
GPIO_INTSTATUS. The clearing of interrupt status can be controlled by setting GPIO_PORTA_EOI.
Each GPIO can support interrupts. The setting steps are as follows:
• Step 1: Configure the register GPIO_INTTYPE_LEVEL, select level trigger or edge trigger.
• Step 2: Configure the register GPIO_INT_POLARITY, select low level/high level trigger and falling
edge/rising edge trigger.
• Step 3: Write 0xFFFFFFFF to the register GPIO_PORTA_EOI to clear the interrupt.
• Step 4: Configure the GPIO_INTEN register; enable the GPIO pin interrupt function.
The chip includes 4 groups of GPIO under Active Domain and 1 group of GPIO under No-die Domain. The base
address is shown in table Base addresses of GPIO modules.
Table GPIO Registers Overview is the offset address and definition of the registers of the GPIO module (GPIO0) in
group 1. GPIOs in other groups have the same register definitions.
21.5.4.1 GPIO_SWPORTA_DR
21.5.4.2 GPIO_SWPORTA_DDR
21.5.4.3 GPIO_INTEN
21.5.4.4 GPIO_INTMASK
21.5.4.5 GPIO_INTTYPE_LEVEL
21.5.4.6 GPIO_INT_POLARITY
21.5.4.7 GPIO_INTSTATUS
21.5.4.8 GPIO_RAW_INTSTATUS
21.5.4.9 GPIO_DEBOUNCE
21.5.4.10 GPIO_PORTA_EOI
21.5.4.11 GPIO_EXT_PORTA
21.5.4.12 GPIO_LS_SYNC
21.6.1 Overview
The function of USB DRD is to play the role of Host or Device respectively, which can be changed through soft-
ware settings. The transmission protocol complies with the USB 2.0 specification, and the maximum transfer rate
can reach more than 40MB/s; the main operating modes of Host/Device are Scatter gather DMA transfer (scatter
gather DMA), details will be described in the Host and Device chapters respectively; the functions of USB DRD are
briefly listed as follows:
• Control Transfer
• Bulk Transfer
• Isochronous Transfer
• Host can connect to USB Hub and supports Interrupt Transfer
• Passed the USB Electrical Characteristics Test (USBET), with good signal quality and compatibility
The picture below shows the system block diagram inside the USB DRD:
USB DRD can switch between Host or Device functions. You can choose to use either one, but it cannot work at the
same time. Its function selection and management are controlled by the USBC block; in addition, Host and device
are triggered by some events and interrupts on the Serial Bus. , the register will also be placed in this block.
GOTGCTL
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
GOTGINT
Interrupt Register
To be continued . . . . . .
GAHBCFG
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
GUSBCFG
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
GRSTCTL
Reset Register
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
GINTSTS
GINTMSK
GUID
User ID Register
GLPMCFG
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
GPWRDN
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
After completing the [Frequency Startup Procedure] and [Mode Switching and Initialization Procedure], you need
to execute the XHCI initialization procedure, as listed below. Then you can start the four standard types of transmis-
sion according to your needs. The details of the method of starting standard transmission can be Refer to the XHCI
specification book, so I won’t go into details here:
Set the GINTMSK.PrtInt register to unmask state.
Set HCFG register to FS device or HS device.
Set the HPRT.PrtPwr register to 1. This setting will turn on V BUS on the USB bus.
Wait for the HPRT0.PrtConnDet interrupt to occur, which means there is a device connected to the USB downstream
port.
Set the HPRT.PrtRst register to 1 and start the USB port reset.
Wait at least 10ms to allow the USB port reset enough time to complete the handshake.
Set HPRT.PrtRst to 0 to complete the USB port reset procedure.
Wait for the HPRT.PrtEnChng interrupt to occur.
Read the HPRT.PrtSpd register to obtain the enumeration speed value.
Set the HFIR register to configure the corresponding PHY Clock.
Set the RXFSIZE register to configure the RXFIFO size.
Set the GNPTXFSIZ register to configure the size of the aperiodic transmission TXFIFO.
Set the HPTXFSIZ register to configure the size of the TXFIFO for periodic transmission.
The base-address of the Host register in the entire memory space is 0x0434_0000. In this article, this base address
will be represented by HOST_BASE_ADDR. Therefore, the actual addressing of each register of the Host controller
in the memory space will be [HOST_BASE_ADDR+relative address].
HCFG
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
HFIR
HFNUM
HPTXSTS
HAINT
HAINTMSK
HFLBAddr
HCCHARn
To be continued . . . . . .
To be continued . . . . . .
HCDMAn
HCDMABn
The basic-address of the Device register in the entire memory space is **0x0434_0000**. In this article, this ba-
sic addressing will be represented by DEV_BASE_ADDR, so the actual addressing of each register in the memory
space is It will be [DEV_BASE_ADDR + relative address].
DCFG
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
31:26 ResValid R/W Resume Validation Period (ResValid) This field 0x2
is effective only when DCFG.Ena32KHzSusp
is set. It controls the resume period when the
core resumes from suspend. The core counts for
“ResValid” number of clock cycles to detect a
valid resume when this bit is set.
DCTL
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
To be continued . . . . . .
DSTS
To be continued . . . . . .
DIEPMSK
DOEPMSK
DAINT
DAINTMSK
DIEPEMPMSK
DEACHINT
DEACHINTMSK
21.7 SARADC
21.7.1 Overview
SARADC is an analog signal to digital conversion controller. This chip has up to 2 SARADC controllers, one in the
Active Domain and another one in the No-die Domain, each providing 3 independent channels.
Note: The chip does not bring out all ADC channels on the pins for the controller under Active Domain. For details,
please refer to ADC.
21.7.2 Features
The CPU configures the scanning channel. Each SARADC controller can configure 3 channels at the same time and
start SARADC for channel scanning. After the channel scan completes all enabled channels, the system is notified of
the completion of the scan through an interrupt, and the CPU can obtain the conversion results.
After the system is powered on, in order to ensure the SARADC measurement accuracy, it is recommended to cal-
ibrate the SARADC module of the chip. The calibration is performed offline. The specific method is to first set
saradc_test.reg_saradc_vrefsel to external mode, and then manually adjust saradc_trim.reg_saradc_trim repeatedly
until the actual read sampling value is close to the external reference voltage value after conversion to meet the ac-
curacy requirements. After the calibration is completed, record the value of saradc_trim.reg_saradc_trim. Then each
time the power is turned on, through software programming, set saradc_test.reg_saradc_vrefsel to external mode and
then set the recorded value to saradc_trim.reg_saradc_trim.
21.7.5.1 saradc_ctrl
21.7.5.2 saradc_status
21.7.5.3 saradc_cyc_set
21.7.5.4 saradc_ch1_result
21.7.5.5 saradc_ch2_result
21.7.5.6 saradc_ch3_result
21.7.5.7 saradc_intr_en
21.7.5.8 saradc_intr_clr
21.7.5.9 saradc_intr_sta
21.7.5.10 saradc_intr_raw
21.7.5.11 saradc_test
21.7.5.12 saradc_trim
21.8.1 Overview
Because the chip junction temperature is too high, it may cause thermal run-away and cause permanent damage.
Therefore, the chip needs to be temperature controlled.
The first stage is software behavior. The temperature sensor can automatically detect whether the temperature ex-
ceeds a specific temperature at regular intervals and issue an overheating interrupt. After the software receives the
overheating interrupt, it can reduce power consumption and temperature by limiting the frequency or voltage of high-
power modules, starting fans, etc. the goal of. If the temperature returns to a safe range, the restrictions are lifted.
The second stage is hardware behavior. If the temperature continues to rise after the software is activated, the hard-
ware will intervene to perform thermal shut-down emergency response. However, this function is turned off by de-
fault. You need to set the relevant settings after starting the software and then enable it.
This chip has two built-in temperature sensors, and the CPU can periodically monitor the chip temperature. When
the chip is overheated and unresponsive, the power management module can be triggered to shut down and reset the
system to avoid the risk of overheating.
• Single measurement time configuration: reg_tempsen_accsel = 1 (1024T) configuration, the required single
measurement time is (1/(25M/12)*(1024+2+64) ~ 523.2us.
• Cycle measurement time configuration: reg_tempsen_auto_prediv is defaulted to 24, making each unit
of reg_tempsen_auto_cycle 1us. The period between two measurement times needs to be configured
with reg_tempsen_auto_cycle greater than 524. For example, to measure once per second, configure
reg_tempsen_auto_cycle = 1000000.
• Measurement channel configuration: If reg_tempsen_sel = 3 is configured, two temperature sensors will be
triggered to measure simultaneously.
• Configure high and low temperature monitoring temperature: Configure the temperature
tempsen_chx_temp_th that triggers high temperature alarm and low temperature recovery.
• Configuration interruption.
• Enable the temperature sensor for measurement: configure reg_tempsen_en = 1 to perform measurement and
wait for interrupt.
Diagram 21.43: Temperature measurement time, count and interrupt occurrence relationship diagram
• View temperature measurement results: sta_tempsen_chX_result records the previously completed tempera-
ture measurement results, sta_tempsen_chX_max_result records the maximum temperature value ever mea-
sured, tempsen_chX_temp_th_cnt records the number of consecutive high and low temperatures.
• Configure the overheat protection temperature reg_tempsen_overheat_th, overheat reset request countdown
time reg_tempsen_overheat_cycle and enable reg_overheat_reset_en.
Refer to the RTC register chapter again to configure the RTC registers hw_thm_shdn_en, RTC_EN_THM_SHDN,
RTC_THM_SHDN_AUTO_REBOOT to enable overheating to trigger power off or restart. When over-
heating occurs, the tempsensor controller will first issue an interrupt and start counting down. When
sta_tempsen_overheat_countdown is equal to 1, the RTC’s power-off protection request will be triggered. If the
software intervenes before and performs temperature control, you can configure reg_overheat_reset_clr to clear the
countdown. However, when the next measurement result is still overheated, the overheat protection interrupt will still
be triggered and countdown again.
21.8.4.1 tempsen_version
21.8.4.2 tempsen_ctrl
21.8.4.3 tempsen_status
21.8.4.4 tempsen_set
21.8.4.5 tempsen_intr_en
21.8.4.6 tempsen_intr_clr
21.8.4.7 tempsen_intr_sta
21.8.4.8 tempsen_intr_raw
21.8.4.9 tempsen_ch0_result
21.8.4.10 tempsen_ch1_result
21.8.4.11 tempsen_ch0_temp_th
21.8.4.12 tempsen_ch1_temp_th
21.8.4.13 Overheat_th
21.8.4.14 tempsen_auto_period
21.8.4.15 tempsen_overheat_ctrl
21.8.4.16 tempsen_overheat_countdown
21.8.4.17 tempsen_ch0_temp_th_cnt
21.8.4.18 tempsen_ch1_temp_th_cnt
21.9 PWM
21.9.1 Overview
The chip provides 4 PWM controllers PWM0, PWM1, PWM2 and PWM3.
Each controller provides 4 independent PWM signal outputs. They are:
• PWM0 includes PWM[0], PWM[1], PWM[2], PWM[3].
• PWM1 includes PWM[4], PWM[5], PWM[6], PWM[7].
• PWM2 includes PWM[8], PWM[9], PWM[10], PWM[11].
• PWM3 includes PWM[12], PWM[13], PWM[14], PWM[15].
21.9.2 Features
The PWM clock source can be selected from 100MHz or 148.5MHz, and the default is 100MHz.
• There is an internal 30-bit counter, the output period and the number of high/low level beats are configurable.
• Supports up to 50MHz (100MHz/2) or 74.25MHz (148.5MHz/2) output, and the lowest is about 0.093Hz
(100MHz/(2^30-1)) or 0.138Hz (148.5MHz/(2^32-1)) .
• Supports two modes: continuous output (PWMMODE = 0) and fixed pulse number output (PWMMODE = 1).
• Supports 4-channel PWM synchronous output mode (SHIFTMODE = 1), and the phase difference of the 4-
channel PWM output can be controlled through the configuration register.
For example: To output a waveform with a frequency of 1MHz, a low level ratio of 75%, and a pulse number of 16
1. Using the default 100MHz clock source, the period number (PERIOD0) is configured as 100MHz / 1MHz
= 100, and the low level number (HLPERIOD0) is configured as 100 x 75% = 75. The number of pulses
(PCOUNT0) is configured as 16.
2. Write 1 to PWMSTART[0] to start outputting the waveform.
3. Read the register PWMDONE[0] until the value is 1, indicating that the output is completed.
4. The register PULSECOUNT0 can be read to confirm the output pulse number status value.
To enable PWM again, you need to write 0 and then 1 to PWMSTART[0] to reset the counter and status register.
When the 4-channel PWM is to operate in synchronous output mode, first configure SHIFTMODE to 1. The process
is as follows:
1. Configure HLPERIOD0/PERIOD0, HLPERIOD1/PERIOD1, HLPERIOD2/PERIOD2, HLPE-
RIOD3/PERIOD3 to the same value.
2. According to the phase difference that the four square wave waveforms need to be staggered, configure appro-
priate values into the registers SHIFTCOUNT0, SHIFTCOUNT1, SHIFTCOUNT2, and SHIFTCOUNT3.
3. Configure PWMSTART[3:0] to 4’hF, and set SHIFTSTART to 1. The 4-channel counter will start counting at
the same time, and output the n-th PWM waveform when the counter value is equal to SHIFTCOUNTn.
For example: To output 4 channels of square waves with a frequency of 1KHz and a low level of 75% at the same
time, the waveforms of each channel should be staggered by 1/4 cycle.
1. Using the default 100MHz clock source, the cycle number is configured as 100MHz / 1KHz = 100,000, and
the low level number is configured as 100,000 x 75% = 75,000.
2. Configure SHIFTCOUNT0 = 0, SHIFTCOUNT1 = 100,000 x 1/4 = 25,000, SHIFTCOUNT2 = 100,000 x 2/4
= 50,000, SHIFTCOUNT3 = 100,000 x 3/4 = 75,000.
3. Set PWMSTART[3:0] to 4’hF, and set SHIFTSTART to 1, and the 4 PWM channels will output the first pulse
in sequence.
Set SHIFTSTART to 0 to end the output, and read the register PWMDONE[3:0] until the value is 4’hF, which means
that all 4 channels are output.
An overview of the PWM registers is shown in table PWM Registers Overview. Here take PWM0 controller as an
example, the other 3 controllers are similar.
Here take PWM0 controller as an example, the other 3 controllers are similar.
21.9.5.1 HLPERIOD0
21.9.5.2 PERIOD0
21.9.5.3 HLPERIOD1
21.9.5.4 PERIOD1
21.9.5.5 HLPERIOD2
21.9.5.6 PERIOD2
21.9.5.7 HLPERIOD3
21.9.5.8 PERIOD3
21.9.5.9 POLARITY
21.9.5.10 PWMSTART
21.9.5.11 PWMDONE
21.9.5.12 PWMUPDATE
21.9.5.13 PCOUNT0
21.9.5.14 PCOUNT1
21.9.5.15 PCOUNT2
21.9.5.16 PCOUNT3
21.9.5.17 PULSECOUNT0
21.9.5.18 PULSECOUNT1
21.9.5.19 PULSECOUNT2
21.9.5.20 PULSECOUNT3
21.9.5.21 SHIFTCOUNT0
21.9.5.22 SHIFTCOUNT1
21.9.5.23 SHIFTCOUNT2
21.9.5.24 SHIFTCOUNT3
21.9.5.25 SHIFTSTART
21.9.5.26 PWM_OE
21.10 KeyScan
21.10.1 Overview
Keyscan supports a matrix of up to 8 x 8 = 64 keys. If you don’t need so many keys, you can freely decide which
rows or columns to mask or retain. Depending on the software needs, snapshot mode and FIFO mode can be selected
to obtain key information.
When the state machine (FSM) is in rest mode (no keys are pressed), all rows output 0, and col is in input mode with
weak pull-up enabled (the weak pull-up is set in the register corresponding to ioblk, not in keyscan module). When
any key is pressed, the col end will see a value other than all 1 after debounce, indicating that a key is pressed. At
this time, FSM will start a scan, sequentially making Row [0] -> Row [7] output 0 only one bit at a time (the rest are
in the HiZ high-impedance state). Each result will be updated into an array.
FSM will continue to scan in a loop until the col returned by all rows is all 1, indicating that the keys are not pressed,
and then it will enter the rest mode again (all rows output 0).
The reg_row_mask, reg_col_mask and reg_enable in KEYSCAN0 allow you to selectively block certain IOs without
outputting or referring to their inputs when the 8x8 matrix is not used. Default is fully off. So it needs to be opened.
reg_db_col in KEYSCAN_CONFIG2 determines how long the column input needs to debounce before it can be
used.
The reg_slow_div in KEYSCAN_CONFIG1 determines the stay time of each stage of IP’s FSM. Remember that this
number must be larger than the debounce time, otherwise the interpretation will be confusing if the debounce is not
completed after the IO transition.
reg_wait_cntr in KEYSCAN_CONFIG3 can be used to reduce the scanning speed. Because as long as the key is
pressed, the keyscan module will continue to scan. This counter can control a fixed waiting time before starting a
new round of scanning to reduce the scanning frequency.
When using FIFO mode, the 64 key values scanned in by IP will be stored in the array. Every time the status of any
key is different from the last scanned content, it will push the key’s index and current value (0/1) into the FIFO. So
the number in [5:0] specifies which button it is. [6] Indicates whether to press (0) or release (1). When the FIFO is
not empty, an IRQ is issued. The advantage of this mode is that it eliminates the need for software to check which
bit has changed bit by bit. The disadvantage is that KEY_SCAN_FIFO is a register that will automatically pop when
read, so be careful when operating it.
Turn on reg_irq_fifo_not_empty_enable of KEYSCAN_IRQ_ENABLE. After receiving the IRQ,
read reg_irq_fifo_not_empty in KEYSCAN_IRQ_FLAG, and then check reg_fifo_not_empty of
KEYSCAN_FIFO_STATUS. Then start reading the contents of KEYSCAN_FIFO. Until it is cleared, clear
KEY_SCAN_IRQ_CLEAR and end IRQ retine.
When using the snapshot array, the values of the 64 keys currently scanned in the IP will be stored in an array. If the
content of this array is different from the content of KEYSCAN_SNAPSHOT_ARRAY, an IRQ will be sent. The
software can trigger KEYSCAN_SNAPSHOT_TRIG, capture the current array content into the snapshot array, and
then slowly compare what content has changed from the previous knowledge.
Turn on reg_irq_snapshot_change_enable of KEYSCAN_IRQ_ENABLE. After receiving the IRQ, read trigger
KEYSCAN_SNAPSHOT_TRIG, and then interpret the contents of KEYSCAN_SNAPSHOT_ARRAY. Then clear
KEY_SCAN_IRQ_CLEAR to end IRQ retine.
21.10.7.1 KEYSCAN_CONFIG0
21.10.7.2 KEYSCAN_CONFIG0
21.10.7.3 KEYSCAN_CONFIG2
21.10.7.4 KEYSCAN_CONFIG3
21.10.7.5 KEYSCAN_SNAPSHOT_ARRAY
21.10.7.6 KEYSCAN_SNAPSHOT_TRIG
21.10.7.7 KEYSCAN_FIFO_STATUS
21.10.7.8 KEYSCAN_FIFO
21.10.7.9 KEYSCAN_IRQ_ENABLE
21.10.7.10 KEYSCAN_IRQ_FLAG
21.10.7.11 KEYSCAN_IRQ_CLEAR
21.11 Wiegand
21.11.1 Overview
The Wiegand interface uses two single-ended signals, D0/D1. When the bus is idle, it is always high. A low pulse
appears on D0, which means a “0” is transmitted. A low pulse is found on D1, which means a “1” is transmitted.
Wiegand is commonly used in access control systems. There are two commonly used formats, Wiegand 26/34, which
represent the number of bits in the packet respectively. An introduction to these two formats is as follows.
21.11.1.1 Wiegand 26
21.11.1.2 Wiegand 34
F = Facility Code
U = User code
Some access cards have a string of numbers behind them. After converting them into hex,
Dec 0002262506 Hex : 22_85_EA
0x22 is Facility code (Dec = 34)
0x85EA is user code (Dec = 34282)
Diagram 21.51: Common magnetic cards, the digital meaning of magnetic buckles
The 34 and 34282 seen later are the Facility code & user code that were disassembled and expressed in decimal
again.
Note: This IP TX RX does not handle parity insert or checking, which are all handled by software.
The Wiegand module contains TX and RX and can be used in one or two directions. When TX goes out, RX will
block it, so RX will not receive the signal it sends. The TX supports push pull mode or open drain mode.
21.11.2.1 TX
Before TX, set the high time and low time of TX, and the number of bits in the packet is determined by MSB 1st or
LSB 1st . Then put the data in the TX_BUFFER register and use TX_TRIG to send the data.
After the complete TX transmission is completed, you can rely on the interrupt of TX finish or the status of polling
TX_BUSY to determine when the next packet can be sent.
21.11.2.2 RX
Before RX, set the debounce time and the number of bits expected to receive the packet. When D0 D1 has a low
pulse, RX starts pushing data into the temp buffer. When the number of received bits reaches the expected number
of bits for a packet, the temp buffer will be pushed into RX_BUFFER, an interrupt will be issued, and the software
will be asked to process it. The temp buffer continues to receive the next data.
If an idle timeout occurs on D0 D1, even if the number of bits has not been reached, it will be forced to be regarded
as a packet.
The high bits of the RX BUFFER will record the total number of bits received by this packet, whether it is caused by
timeout, or an overflow occurs before the software reads it.
Each time a packet is received, you can rely on the rx_buffer_rececived interrupt or RX_BUFFER_VALID to deter-
mine whether there is valid data in RX_BUFFER. After the RX Data is taken away, trigger RX_BUFFER_CLEAR
to clear RX_BUFFER to receive the next packet.
21.11.4.1 TX_CONFIG0
21.11.4.2 TX_CONFIG1
21.11.4.3 TX_CONFIG2
21.11.4.4 TX_BUFFER
21.11.4.5 TX_TRIG
21.11.4.6 TX_BUSY
21.11.4.7 TX_BUSY
21.11.4.8 RX_CONFIG0
21.11.4.9 RX_CONFIG1
21.11.4.10 RX_CONFIG2
21.11.4.11 RX_BUFFER
21.11.4.12 RX_BUFFER_VALID
21.11.4.13 RX_BUFFER_CLEAR
21.11.4.14 RX_DEBUG
21.11.4.15 IRQ_ENABLE
21.11.4.16 IRQ_FLAG
21.11.4.17 IRQ_CLEAR
21.12 IRRX
21.12.1 Overview
21.12.2 Features
The software pre-sets the received infrared data format. When the IRRX module receives the infrared communica-
tion signal, it decodes it. The code that conforms to the predetermined format is transmitted to the CPU through an
interrupt, and the CPU performs corresponding operations based on the code.
There is only 1 No-die Domain. Its base address (RTCSYS_IRRX) is: 0x0502E000.
21.12.5.1 IR_EN
21.12.5.2 IR_MODE
21.12.5.3 IR_CFG
21.12.5.4 IR_FRAME
21.12.5.5 int_en
21.12.5.6 int_clr
21.12.5.7 int_clr
21.12.5.8 int
21.12.5.9 int_raw
21.12.5.10 IR_SYMBOL_CFG0
21.12.5.11 IR_SYMBOL_CFG1
21.12.5.12 IR_SYMBOL_CFG2
21.12.5.13 IR_SYMBOL_CFG3
21.12.5.14 IR_SYMBOL_CFG4
21.12.5.15 IR_SYMBOL_CFG5
21.12.5.16 IR_SYMBOL_CFG6
21.12.5.17 IR_SYMBOL_CFG7
21.12.5.18 IR_CLOCK_CTRL
21.12.5.19 IR_DATA0
21.12.5.20 IR_DATA1
21.12.5.21 IR_DATA2
21.12.5.22 IR_DATA3
21.12.5.23 IR_DATA4
21.12.5.24 IR_NEC_DATA0
21.12.5.25 IR_SONY_DATA0
21.12.5.26 IR_SONY_DATA1
21.12.5.27 IR_PHILIPS_DATA0
21.12.5.28 IR_PHILIPS_DATA1
21.12.5.29 IR_PRD_REC0
21.12.5.30 IR_PRD_REC1
21.12.5.31 IR_PRD_REC2
21.12.5.32 IR_PRD_REC3
21.12.5.33 IR_PRD_REC4
21.12.5.34 IR_PRD_REC5
TWENTYTWO
SECURITY SUBSYSTEM
The chip provides an independent security subsystem module responsible for providing specific security functions.
The safety subsystem module includes the following safety function modules
• Crypto DMA unit (CryptoDMA)
• True Random Number Generator
• Secure Debug Protection
The cryptographic operation unit (CryptoDMA) provides hardware acceleration of symmetric key encryption, de-
cryption and hashing (Hash). The security eFuse unit is responsible for providing system security settings and se-
curity keys for use by the security subsystem. The true random number generation unit provides qualified random
numbers. Random numbers are used by security systems.
865
CHAPTER 22. SECURITY SUBSYSTEM
22.1 CryptoDMA
22.1.1 Overview
CryptoDMA is a hardware accelerator that implements symmetric key algorithms, hash algorithms and BASE64
conversion. It supports symmetric algorithms: AES 128/192/256, DES/TDES, SM4 and hash algorithms: SHA-
1/SHA256 and other cryptographic operations. Direct memory access of key encryption and decryption or hash op-
eration functions of data blocks is achieved through linked-list command strings.
• The symmetric algorithm is suitable for accelerated hardware encryption and decryption of data, and supports
a variety of group encryption and block concatenation processing methods, including ECB, CBC, and CTR.
• The implementation of the AES (Advanced Encryption Standard) algorithm complies with the FIPS 197 stan-
dard. The implementation of the DES (Data Encryption Standard)/TDES algorithm complies with ISO/IEC
18033-3.
• The hash algorithm is suitable for data integrity checking and digital signature operation acceleration. SHA1
and SHA256, compliant with FIPS180-2 standard.
• BASE64 operations are suitable for processing text data and storing 2-bit data, such as MIME email or URL
data.
22.1.2 Features
CryptoDMA provides memory direct access DMA function. The application only needs to provide a linked list in-
struction to the target data block to start the CryptoDMA DMA function. Until the completed interrupt notification
is received, the block encryption, decryption or hash operation is completed and the The operation result is output to
the target address.
Symmetric key algorithms AES/DES/SM4 all support ECB/CBC/CTR block encryption mode.
In ECB (Electronic CodeBook) mode, the encryption and decryption algorithms are directly applied to each grouped
data by the operation of each group. This feature allows plaintext encryption and ciphertext decryption to be per-
formed independently for any group of block data.
CBC (Cipher Block Chaining), the input plaintext group is first XORed with the input vector IV (Intialization Vector)
or the previous group ciphertext result, and then the encryption operation is performed. The encryption operation in
CBC mode must start from the first block. Block data grouping begins, and subsequent encryption operations require
the ciphertext obtained from the previous group for encryption. During decryption, the plaintext can be obtained by
decrypting the current ciphertext and XORing the previous set of ciphertexts.
CTR (Counter) uses encryption or decryption to encrypt or decrypt a set of different arrays to ensure the indepen-
dence and security of encrypted data processing. It generally uses an encrypted accumulation array and then per-
forms an XOR operation with the plain text.
22.1.6.1 dma_ctrl
22.1.6.2 int_mask
22.1.6.3 des_base_0
22.1.6.4 des_base_1
22.1.6.5 spacc_int_raw
22.1.6.6 secure_key_valid
22.1.6.7 des_addr_0
22.1.6.8 des_addr_1
22.1.6.9 PIO_cmd_data_0
22.1.6.10 PIO_cmd_data_1
22.1.6.11 PIO_cmd_data_2
22.1.6.12 PIO_cmd_data_3
22.1.6.13 PIO_cmd_data_4
22.1.6.14 PIO_cmd_data_5
22.1.6.15 PIO_cmd_data_6
22.1.6.16 PIO_cmd_data_7
22.1.6.17 PIO_cmd_data_8
22.1.6.18 PIO_cmd_data_9
22.1.6.19 PIO_cmd_data_10
22.1.6.20 PIO_cmd_data_11
22.1.6.21 PIO_cmd_data_12
22.1.6.22 PIO_cmd_data_13
22.1.6.23 PIO_cmd_data_14
22.1.6.24 PIO_cmd_data_15
22.1.6.25 PIO_cmd_data_16
22.1.6.26 PIO_cmd_data_17
22.1.6.27 PIO_cmd_data_18
22.1.6.28 PIO_cmd_data_19
22.1.6.29 PIO_cmd_data_20
22.1.6.30 PIO_cmd_data_21
22.1.6.31 key_data_0
22.1.6.32 key_data_1
22.1.6.33 key_data_2
22.1.6.34 key_data_3
22.1.6.35 key_data_4
22.1.6.36 key_data_5
22.1.6.37 key_data_6
22.1.6.38 key_data_7
22.1.6.39 key_data_8
22.1.6.40 key_data_9
22.1.6.41 key_data_10
22.1.6.42 key_data_11
22.1.6.43 key_data_12
22.1.6.44 key_data_13
22.1.6.45 key_data_14
22.1.6.46 key_data_15
22.1.6.47 key_data_16
22.1.6.48 key_data_17
22.1.6.49 key_data_18
22.1.6.50 key_data_19
22.1.6.51 key_data_20
22.1.6.52 key_data_21
22.1.6.53 key_data_22
22.1.6.54 key_data_23
22.1.6.55 ini_data_0
22.1.6.56 ini_data_1
22.1.6.57 ini_data_2
22.1.6.58 ini_data_3
22.1.6.59 ini_data_4
22.1.6.60 ini_data_5
22.1.6.61 ini_data_6
22.1.6.62 ini_data_7
22.1.6.63 ini_data_8
22.1.6.64 ini_data_9
22.1.6.65 ini_data_10
22.1.6.66 ini_data_11
22.1.6.67 sha_data_0
22.1.6.68 sha_data_1
22.1.6.69 sha_data_2
22.1.6.70 sha_data_3
22.1.6.71 sha_data_4
22.1.6.72 sha_data_5
22.1.6.73 sha_data_6
22.1.6.74 sha_data_7
In order to provide reading or control of related internal functions of the chip during debugging or testing, the chip
provides several debugging interfaces, such as JTAG, I2C and other different external interfaces. Without appropriate
protection mechanisms, these interfaces can easily be exploited to directly or indirectly attack the chip security mech-
anism or read internal information that needs to be kept confidential. To protect and control these interfaces, the chip
uses a security debug firewall.
22.2.1 Overview
The security debugging firewall provides an independently operating I2C interface for the outside of the chip to
query the current status of the debugging interface through I2C and enter the corresponding password to reopen the
interface in the protected state. Externally, you need to specify the correct I2C ID to connect to the firewall interface.
The I2C interface register address is as follows
The chip integrates 4Kbit eFuse space, and uses Efuse Ctrl to program and read Efuse.
The main functions of Efuse Ctrl include:
• Provides a dual eFuse bit (Double bit) protection mechanism, which consists of two physical eFuse bits form-
ing a single bit logical effective value, which is equivalent to providing a 2Kbit register space to improve the
robustness of eFuse programming or data maintenance.
• After power-on reset (Power-On-Reset), the contents of efuse are automatically loaded into the register to pro-
vide the required configuration settings for the chip system and reduce the number of times required to read
Efuse to increase the service life.
• Provides efuse programming, reading, verification reading and power-on and power-off instructions and con-
tent security protection mechanism.
The Efuse data register is divided into two areas, one is a non-safe area and the other is a safe area. The data in the
non-safe area is allowed to be accessed by all modules, and the safe area only allows access to the safe modules. The
non-secure area stores system configuration and public information, and the secure area stores security configuration,
keys and passwords.