7. System Control
7.1 Introduction
This chapter will introduce the basic system control registers. For example, the clock and reset enable/disable of each block, the pinmux select, the thermal control, the DC2DC control and the GPIO select control. It can help user to set basic parameters for system and flexible operations. This chapter describes the following information and functions. (Detail descriptions please check each register list)
Group 0: Describe the parameters of each block clock and reset enable/disable.
Group 1: Describe the pinmux parameters.
Group 2: Describe the pinmux parameters.
Group 3: Describe the pinmux parameters.
Group 4: Describe the PLL setting parameters for each block.
Group 5: Describe the thermal and DC2DC control parameters.
Group 6: Describe the GPIO control parameters.
Group 7: Describe the GPIO control parameters.
7.2 Hardware Reset control
The system blocks reset can be issued by the Group0.21~30 registers. Each bit map to correspond block. Please make sure the reset bit set as 0 when the block starts to work.For example, if user want to enable I2CM0 reset, please set 0x00010001 to Group0.24 register. Set 0x00010000 to Group0.24 to disable reset.Figure 7-1 show the system hardware reset generator. Moon0 block mean Group0 registers that include control bits in lower 16bits and mask bits in higher 16bits.
Figure 7-1 Hardware Reset Generator
7.3 Clock enable control
The system blocks clock can be enabled or disabled by the Group0.1~10 registers. Each bit map to correspond block. Please set the clock bit to 1 for enable the block's clock.For example, if user want to enable SPI_COMBO_0 clock, please set 0x00040004 to Group0.3 register. Set 0x00040000 to Group0.3 to disable clock.Figure 7-2 show the SPI_COMBO block clock enable structure.
Figure 7-2 SPI_COMBO Block Clock Enable
7.4 System PLL control
There are 5 system PLL blocks in SP7021, they are PLLSYS, PLLA, PLLE, PLLF and PLLTV. They can be programmable by the Group4.0~16 registers.
7.4.1 PLLSYS control
The PLLSYS is used for generating system clock; it could generate wide frequency range with different register setting, Also the PLLSYS could operate steady with low time jitter and low power consumption. The control register is Group4.26. There are three mode in PLLSYS module. Please refer to table 7-1&7-2 for parameters setting.
Table 7-1 Three mode PLLSYS
Table 7-2 The detail setting of three mode PLLSYS
7.4.2 PLLF control
The PLLFLASH(PLLF) is mainly used as clock sources for eMMC, SPI-NAND or SPI-NOR Flash memory. It could generate wide frequency range with different register setting, Also the PLLFLASH could operate steady with low time jitter and low power consumption. The control register is Group4.13. PLLSYS & PLLFLASH have identical function structure so each control bit usage is the same. Please refer to table 7-1&7-2 for parameters setting.
7.4.3 PLLE control
The PLLE is mainly used as clock source for ethernet. It could generate 4 kinds frequency, 50MHz, 2.5MHz, 25MHz and 112.5MHz, which controlled by register Group4.12 bit14, 13, 12 and 11. Please refer to Group4.12 register for detail parameters setting.
7.4.4 PLLTV control
The PLLTV is mainly used as clock source for HDMITX and Display module. It could generate wide frequency range with different register setting, Also the PLLTV could operate steady with low time jitter and low power consumption. The control registers are Group4.14, 15 and 16.
Frequency Operate Equation:
Integer MODE (SEL_FRA_TV=0)
(A) DIVM [6:0]: Reference divider
Ex. M=1 for DIVM[6:0]=7’b000_0000, M=32 for DIVM[6:0]=7’b001_1111.
(B) DIVN [7:0]: PLL feedback divider
Ex. N=11 for DIVN[7:0]=8’b0000_1010, N=32 for DIVN[7:0]=8’b0001_1111.
(C) DIVR[1:0]: Post divider
Ex. R=0 for Divisor=1: FCKOUT= FVCO / 1
R=1 for Divisor=2: FCKOUT= FVCO / 2
R=2 for Divisor=4: FCKOUT= FVCO / 4
R=3 for Divisor=8: FCKOUT= FVCO / 8
Fractional MODE (SEL_FRA_TV=1, DOUBLE_SEL_TV=0)
- For SDM_MOD_TV=0, PH_SEL_TV=0, NFRA=45
- For SDM_MOD_TV=0, PH_SEL_TV=1, NFRA=43
(A) DIVN [7:0]: PLL feedback divider is useless
DIVM & DIVR are the same as Integer mode
7.4.5 PLLA control
The PLLA is mainly used as clock source for audio module. It could generate wide frequency range with different register setting, Also the PLLA could operate steady with low time jitter and low power consumption. The control registers are Group4.7~11.
Frequency Operate Equation:
where R is modulus set by DIVR_A and M by DIVM_A.
FCKOUT indicates frequency of FCKOUT_A, FVCO stands for the frequency of VCO and FCLKREF is the frequency of CLKREF_A(27MHz).
Fractional dividing modulus of f
where N.fideal is an ideal fractional dividing modulus and N.fbase is the basic fractional dividing modulus controlled by DIVN_A & PH_SEL_A.
DIVN_A directly represent integer part of the basic fractional dividing modulus shown below:
It should be noted that exception for N cannot be set less than 2 .
The N.fbase provides user a basic fractional dividing modulus with resolution of multiple of 0.1, and the fractional part is controlled by PH_SEL_A as shown in the pin description section. User can intuitively set this part:
It should be noted that exception for .fbase is that setting PH_SEL_A=4’b1001~4’b1110 makes N.fideal a truly integer dividing modulus “plus one”, regardless of K & M.
For example, DIVN_A=6’b000100 and PH_SEL_A=4’b1001 makes N.fideal=4+1=5
The last part is the residue of the fractional dividing modulus, the ratio of K to M, which is realized by PH_STEP_SEL_A, M_SDM_A & K_SDM_A. Both K & M can be arbitrarily set from 0~2047 and noted that K must be equal or less than M, and the coefficient of 0.1 is set by PH_STEP_SEL=2’b01.
Now user can try to randomly give a fractional dividing modulus. There has an examples shown below.
Ex: N.f = 5.4033333 = 5+0.4+0.01x341/1023
DIVN_A=6’b000101, PH_SEL_A=4’b0100, PH_STEP_SEL=2’b01, K_SDM_A=11’b001-0101-0101 and M_SDM_A=11’b011-1111-1111
Frequency calculate example
M_SDM_A=11’b1001, DIVR_A=2’b00, DOUBLE_SEL=1’b0, MUX_SEL_A=1’b0, PH_STEP_SEL_A=2’b01
7.5 DC2DC control
SP7021 embedded 3 DC2DC modules, they are 3.3V to 0.9V, 3.3V to 1.2V and 3.3V to 1.5V. So SP7021 just need one single power supply that is 3.3V. The parameters can be set by Group5.23~31 registers.
7.6 Thermal sensor control
SP7021 embedded a thermal sensor which operation temperature range between -40°C ~125°C. The resolution is 1°C. The parameters can be set by Group5 registers.
For example, when MO_THERMAL_VBE_SEL=0x01(default), then read TCODE value from G5.12[10:0] and calculate chip temperature as below:
Unit is Celsius.
7.7 System Pinmux control
There are totally 64 pins can be set as Multiplex Peripheral Pins. Multiplex Peripheral Pins include ETH_SW, SDIO, PWM, Input Capture, SPI MASTER, SPI SLAVE, I2C MASTER, UART(1~4), TIMER, GPIO INT functions. This function can be controlled by Group2~3 registers. Please refer to chapter 5 for detail description of this function.
Another pinmux type which provide fixed function in fixed pins is also supported. They can be control by Group1.1~4 registers. For example, in the chapter 4 pin description, the pin92~97 describe as below:
Pin Name | LQFP 176 Pin No | Type | Description(Multiplex Pins in this interface Shown in Bold) | Drive (mA) |
|---|---|---|---|---|
EMMC_D0/ SPI_NAND_D0 | 92 | I/O I/O | EMMC data pin0 SPI_NAND_D0 |
|
EMMC_D1/ SPI_NAND_D2 | 93 | I/O I/O | EMMC data pin1 SPI_NAND_D2 |
|
EMMC_CLK/ SPI_NAND_CLK | 94 | I/O I/O | EMMC clock pin SPI_NAND_CLK |
|
EMMC_D2/ SPI_NAND_D1 | 95 | I/O I/O | EMMC data pin2 SPI_NAND_D1 |
|
EMMC_D7/ SPI_NAND_D3 | 96 | I/O I/O | EMMC data pin7 SPI_NAND_D3 |
|
EMMC_D6/ SPI_NAND_CEN | 97 | I/O I/O | EMMC data pin6 SPI_NAND_CEN |
|
If user set Group1.1[4] as "1", the pin92~97 will support SPI_NAND function interface.
If user set Group1.1[5] as "1". the pin92~97 will become EMMC function interface.
7.8 System GPIO control
There are totally 72 GPIO pins which are separated into 9 I/O ports, and each port contains 8 GPIO signals. The I/O driving capability for signals in GPIO0 is 16mA and 8mA for those in other GPIO ports. All 72 GPIO signals are Tri-state Output with Schmitt Trigger Input. The GPIO can be controlled by Group6~7 registers. Please refer to chapter 5 for detail description of this function.
7.9 Core Clock Divide Enable
There has a special mode to divide core clock to half. Core clock is generated by dividing pll clock, so set pll cleck to half, it will let core clock become half also. The control bit is CORECLK_DIV2_EN which map to 0x9EC0000C[10]. 0: Pll cleck, 1: Pll clock/2.
7.10 Registers Map
7.10.1 Registers Memory Map
Address | Group No. | Register Name | Register Description |
0x9C000000 | G0.0 | mo stamp | Chip Revision Stamp ID Register |
0x9C000004 | G0.1 | mo clken0 | Clock Enable Register #0 |
0x9C000008 | G0.2 | mo clken1 | Clock Enable Register #1 |
0x9C00000C | G0.3 | mo clken2 | Clock Enable Register #2 |
0x9C000010 | G0.4 | mo clken3 | Clock Enable Register #3 |
0x9C000014 | G0.5 | mo clken4 | Clock Enable Register #4 |
0x9C000018 | G0.6 | mo clken5 | Clock Enable Register #5 |
0x9C00001C | G0.7 | mo clken6 | Clock Enable Register #6 |
0x9C000020 | G0.8 | mo clken7 | Clock Enable Register #7 |
0x9C000024 | G0.9 | mo clken8 | Clock Enable Register #8 |
0x9C000028 | G0.10 | mo clken9 | Clock Enable Register #9 |
0x9C00002C | G0.11 | mo gclken0 | Clock Gating Enable Register #0 |
0x9C000030 | G0.12 | mo gclken1 | Clock Gating Enable Register #1 |
0x9C000034 | G0.13 | mo gclken2 | Clock Gating Enable Register #2 |
0x9C000038 | G0.14 | mo gclken3 | Clock Gating Enable Register #3 |
0x9C00003C | G0.15 | mo gclken4 | Clock Gating Enable Register #4 |
0x9C000040 | G0.16 | mo gclken5 | Clock Gating Enable Register #5 |
0x9C000044 | G0.17 | mo gclken6 | Clock Gating Enable Register #6 |
0x9C000048 | G0.18 | mo gclken7 | Clock Gating Enable Register #7 |
0x9C00004C | G0.19 | mo gclken8 | Clock Gating Enable Register #8 |
0x9C000050 | G0.20 | mo gclken9 | Clock Gating Enable Register #9 |
0x9C000054 | G0.21 | mo reset0 | Hardware Reset Control Register #0 |
0x9C000058 | G0.22 | mo reset1 | Hardware Reset Control Register #1 |
0x9C00005C | G0.23 | mo reset2 | Hardware Reset Control Register #2 |
0x9C000060 | G0.24 | mo reset3 | Hardware Reset Control Register #3 |
0x9C000064 | G0.25 | mo reset4 | Hardware Reset Control Register #4 |
0x9C000068 | G0.26 | mo reset5 | Hardware Reset Control Register #5 |
0x9C00006C | G0.27 | mo reset6 | Hardware Reset Control Register #6 |
0x9C000070 | G0.28 | mo reset7 | Hardware Reset Control Register #7 |
0x9C000074 | G0.29 | mo reset8 | Hardware Reset Control Register #8 |
0x9C000078 | G0.30 | mo reset9 | Hardware Reset Control Register #9 |
0x9C00007C | G0.31 | mo sft cfg mode | Software Configure Hardware Mode |
Address | Group No. | Register Name | Register Description |
0x9C000080 | G1.0 | sft cfg 0 | Test Mode Control Register |
0x9C000084 | G1.1 | sft cfg 1 | PIN Mux Table Control Register #1 |
0x9C000088 | G1.2 | sft cfg 2 | PIN Mux Table Control Register #2 |
0x9C00008C | G1.3 | sft cfg 3 | PIN Mux Table Control Register #3 |
0x9C000090 | G1.4 | sft cfg 4 | PIN Mux Table Control Register #4 |
0x9C000094 | G1.5 | rsv | Reserved |
0x9C000098 | G1.6 | rsv | Reserved |
0x9C00009C | G1.7 | rsv | Reserved |
0x9C0000A0 | G1.8 | rsv | Reserved |
0x9C0000A4 | G1.9 | rsv |