Overview
The aim of this document is to explain how to setup pins of SP7350 in device-tree source. SP7350 has 106 general purpose IO (GPIO) pins which are multiplexed with other special functions, like eMMC device, SPI-NOR flash, SPI-NAND flash, Ethernet PHY (RGMII or RMII interface), UART, I2C pins, and etc.
The following sections will explain how to setup GPIOs and special function pins in device-tree source file. Note that the same device-tree source file is used by U-Boot and Linux in SP7350. Both Pinctrl drivers support generic helper bindings.
Properties
function
The function to be applied on particular pins or groups. See section "Functions" below.
pins
The pins to apply the properties to. See section "Pins" below.
groups
The groups to apply the properties to. See section "Groups" below.
Functions
We define a bunch of functions as listed in appendix Function-group Table below.
Pins
...
IO Pins
In the Linux, name of IO pin is in form of GPIO(id), like GPIO0, GPIO1, GPIO2, GPIO99…, GPIO105, and etc. There are two kinds of GPIO pins. One is 1.8V GPIO pins, and the other is 1.8V/3.0V Dual Voltage IO (DVIO) pins. Beside configure 1.8V or 3.0V power to power supply of a DVIO group in your circuit boards (hardware), you need to setup Voltage Mode Select (MS control) in device-tree source. Refer to groups of GPIO and DVIO in appendix GPIO Table below in details.
Groups
We define a bunch of groups as listed in appendix Function-group Table below.
Voltage Mode Select
For These IO pins of SP7350 are categorized, based on their operating voltage, into two groups:
Single-supply IO pins: The IO pins operate on a single power supply, specifically at 1.8V.
Dual-supply IO pins: The IO pins offer a dual power supply option, supporting both 1.8V and 3.0V. These pins are referred to as DVIO pins in the subsequent sections.
Refer to table below for a breakdown of power domain, supplying voltage, pin name (hardware pin name), supplying power pins of all IO pins of SP7350:
GPIO # | Power domain | Type | Pin name | Power-supply |
0 - 19 | Main | 1.8V GPIO | G_MX0 - G_MX19 | VDDPST18_GPIO |
20 | 1.8V/3.0V |
...
DVIO |
...
Properties | Pins | Value |
---|---|---|
sunplus,ms-dvio-group-0 | G_MX21~G_MX27 | “3V0“ for 3.0V; “1V8“ for 1.8V. |
sunplus,ms-dvio-group-1 | G_MX20, G_MX28~G_MX37 | “3V0“ for 3.0V; “1V8“ for 1.8V. |
sunplus,ms-dvio-ao-group-0 | AO_MX0~AO_MX9 | “3V0“ for 3.0V; “1V8“ for 1.8V. |
sunplus,ms-dvio-ao-group-1 | AO_MX10~AO_MX19 | “3V0“ for 3.0V; “1V8“ for 1.8V. |
sunplus,ms-dvio-ao-group-2 | AO_MX20~AO_MX29 | “3V0“ for 3.0V; “1V8“ for 1.8V. |
pinmux
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
Here we only list the generic pinmux methods supported by SP7350. |
Set a single pin to function "GPIO"
...
G_MX20 | VDDPST3018_DVIO_2 | ||
21 - 27 | G_MX21 - G_MX27 | VDDPST3018_DVIO_1 | |
28 - 37 | G_MX28 - G_MX37 | VDDPST3018_DVIO_2 | |
38 - 43 | G_MX38 - G_MX43 | AVDDIO_3018_SD | |
44 - 49 | G_MX44 - G_MX49 | AVDDIO_3018_SDIO | |
50 - 59 | CM4 (AO) | AO_MX0 - AO_MX9 | VDDPST3018_DVIO_AO_1 |
60 - 69 | AO_MX10 - AO_MX19 | VDDPST3018_DVIO_AO_2 | |
70 - 79 | AO_MX20 - AO_MX29 | VDDPST3018_DVIO_AO_3 | |
80 - 98 | 1.8V GPIO | AO_MX30 - AO_MX48 | VDDPST18_GPIO_AO |
99 - 105 | IV_MX0 - IV_MX6 |
Voltage Mode Select
Beyond configuring the 1.8V or 3.0V power to supply pins of a DVIO group in circuit boards (hardware), setting up the voltage mode select (ms control) control-bits is crucial for the normal operation of IO pins. The following properties configure voltage mode select control-bits in the Device Tree Source (DTS) file:
Properties | Pins | Value |
---|---|---|
sunplus,ms-dvio-group-0 | G_MX21~G_MX27 | “3V0“ for 3.0V; “1V8“ for 1.8V. |
sunplus,ms-dvio-group-1 | G_MX20, G_MX28~G_MX37 | “3V0“ for 3.0V; “1V8“ for 1.8V. |
sunplus,ms-dvio-ao-group-0 | AO_MX0~AO_MX9 | “3V0“ for 3.0V; “1V8“ for 1.8V. |
sunplus,ms-dvio-ao-group-1 | AO_MX10~AO_MX19 | “3V0“ for 3.0V; “1V8“ for 1.8V. |
sunplus,ms-dvio-ao-group-2 | AO_MX20~AO_MX29 | “3V0“ for 3.0V; “1V8“ for 1.8V. |
These properties should be set in the pinctrl node in the DTS file. For example:
Code Block | ||
---|---|---|
| ||
pctl: pinctrl@f8800080 {
:
:
sunplus,ms-dvio-group-0 = “1V8“;
sunplus,ms-dvio-group-1 = “3V0“;
sunplus,ms-dvio-ao-group-2 = “1V8“;
:
}; |
Default voltage is “3V0”.
Pin Multiplexing Nodes
function - the multiplex function to select.
groups - the list of groups to select with this function. Either this or "pins" must be specified.
pins - the list of pins to select with this function. Either this or "groups" must be specified.
Refer to examples below:
Set a single pin to GPIO function
Code Block | ||
---|---|---|
| ||
pinmux_example { function = "GPIO"; pins = "GPIO0"; }; |
Set pin GPIO0 to GPIO function.
Set several pins to
...
GPIO
...
function
...
Code Block | ||
---|---|---|
| ||
pinmux_example {
function = "GPIO";
pins = "GPIO0", "GPIO1", "GPIO10";
}; |
Set pins GPIO0, GPIO1, GPIO10 to GPIO function.
Set a group of pins to a
...
specified function
set group "UART0_X1" to function "UART0"
Code Block | ||
---|---|---|
| ||
pinmux_example { function = "UART0"; groups = "UART0_X1"; }; |
...
Set a group of pins, whose group-name is UART0_X1, to UART0 function. Actually, the group includes pins GPIO50 and GPIO51.
Refer to Function-group Table in appendix.
Pin Configuration Nodes
Info |
---|
Here we only list the generic pin configuration parameters supported by SP7350. |
...
Code Block | ||
---|---|---|
| ||
pinconf_example { : : sunplus,bias-strong-pull-up; : : }; |
DTS Files
Device-tree source files of SP7350 are located in linux/kernel/arch/arm64/boot/dts/sunplus/.
...
Boards | Device-tree source files |
C3V-W EVBEvaluation Board | sp7350-ev.dts |
C3V-W Demo Board | sp7350-evdm.dts |
Example
Voltage Mode Select
...
Every device should have a node in device-tree source (dts) file in Linux. Property pinctrl-0 (or pinctrl-1, pinctrl-2,… if a device has more states) is used to point at pin configuration node within pin controller (node pinctrl@f8800080 in SP7021). Pin configuration nodes (sub-nodes in node pinctrl@f8800080 ) define the actual pins assignment. For examples:
pinmux
eMMC device:
Pins of eMMC of SP7350, [D5, D3, D4, D0, D1, CLK, D2, D7, D6, CMD, DS], can be multiplexed to pin-group GPIO [20, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37].
...
Refer to "Function-group Table" in Appendix.
pinconf
One configuration to all pins.
...
Code Block | ||
---|---|---|
| ||
uart7_pins: pinmux_uart7-pins {
function = "UART7";
groups = "UART7";
drive-strength-microamp = <SPPCTRL_GPIO_DRV_IOH_6600_IOL_6600UA>;
}; |
Refer to Driving-strength Table of GPIO and Driving-strength Table of DVIO in Appendix.
Appendix
List of support properties
...
Properties
...
Values
...
Descriptions
...
bias-disable
...
NA
...
Disable pull-up, pull-down and strong pull-up
...
bias-high-impedance
...
NA
...
bias-pull-up
...
NA
...
bias-pull-down
...
NA
...
drive-open-drain
...
NA
...
For GPIO or DVIO
...
drive-strength-microamp
...
= "UART7";
groups = "UART7";
drive-strength-microamp = <SPPCTRL_GPIO_DRV_IOH_6600_IOL_6600UA>;
}; |
...
pins
...
“GPIO0” ~ “GPIO105”
...
Refer to Driving-strength Table of GPIO and
...
function
...
…
...
Refer to Function-group Table
...
groups
...
…
...
Refer to Function-group Table
...
input-disable
...
NA
...
For GPIO or DVIO
...
input-enable
...
NA
...
For GPIO or DVIO
...
input-schmitt-disable
...
NA
...
input-schmitt-enable
...
NA
...
output-disable
...
NA
...
For GPIO or DVIO
...
output-enable
...
NA
...
For GPIO or DVIO
...
output-high
...
NA
...
For GPIO or DVIO
...
output-low
...
NA
...
For GPIO or DVIO
Driving-strength Table of DVIO in Appendix.
Appendix
List of support properties
GPIO #
Power domain
Pin type
Pin name
Power-supply
0 - 19
Main
1.8V GPIO
G_MX0 - G_MX19
VDDPST18_GPIO
20
1.8V/3.0V DVIO
G_MX20
VDDPST3018_DVIO_2
21 - 27
Properties | Values | Descriptions | ||||
bias-disable | NA | Disable pull-up, pull-down and strong pull-up | ||||
bias-high-impedance | NA | |||||
bias-pull-up | NA | For GPIO only, excluding DVIO | ||||
sunplus,input-invert-disablebias-pull-down | NA | |||||
For GPIO or DVIO | sunplus,input-invert-enabledrive-open-drain | NA | For GPIO or DVIO | |||
sunplus,msdrive-dvio-group-0 | “1V8” or “3V0” | For G_MX21 - G_MX27 | ||||
sunplus,ms-dvio-group-1 | “1V8” or “3V0” | For G_MX20, G_MX28 - G_MX37 | ||||
sunplus,ms-dvio-ao-group-0 | “1V8” or “3V0” | For AO_MX0 - AO_MX9 | ||||
sunplus,ms-dvio-ao-group-1 | “1V8” or “3V0” | For AO_MX10 - AO_MX19 | ||||
sunplus,ms-dvio-ao-group-2 | “1V8” or “3V0” | For AO_MX20 - AO_MX29 | ||||
sunplus,output-invert-strength-microamp | … | Refer to Driving-strength Table of GPIO and DVIO. | ||||
function | … | Refer to Function-group Table | ||||
groups | … | Refer to Function-group Table | ||||
input-disable | NA | For GPIO or DVIO | ||||
input-enable | NA | For GPIO or DVIO | ||||
input-schmitt-disable | NA | |||||
input-schmitt-enable | NA | |||||
output-disable | NA | For GPIO or DVIO | ||||
sunplus,output-invert-enable | NA | For GPIO or DVIO | sunplus,slew-rate-control-disable | NA | sunplus,slew-rate-control-enable | NA |
GPIO Table
28 - 37
output-high | NA | For GPIO or DVIO |
output-low | NA | For GPIO or DVIO |
pins | “GPIO0” ~ “GPIO105” | |
sunplus,bias-strong-pull-up | NA | For GPIO only, excluding DVIO |
sunplus,input-invert-disable | NA | For GPIO or DVIO |
sunplus,input-invert-enable | NA | For GPIO or DVIO |
sunplus,ms-dvio-group-0 | “1V8” or “3V0” | For G_MX21 - G_MX27 |
VDDPST3018_DVIO_1
sunplus,ms-dvio-group-1 | “1V8” or “3V0” | For G_MX20, G_MX28 - G_MX37 |
VDDPST3018_DVIO_2
38 - 43
G_MX38 - G_MX43
AVDDIO_3018_SD
44 - 49
G_MX44 - G_MX49
AVDDIO_3018_SDIO
50 - 59
CM4 (AO)
AO_MX0 - AO_MX9
VDDPST3018_DVIO_AO_1
60 - 69
sunplus,ms-dvio-ao-group-0 | “1V8” or “3V0” | For AO_MX0 - AO_MX9 |
sunplus,ms-dvio-ao-group-1 | “1V8” or “3V0” | For AO_MX10 - AO_MX19 |
VDDPST3018_DVIO_AO_2
70 - 79
sunplus,ms-dvio-ao-group-2 | “1V8” or “3V0” | For AO_MX20 - AO_MX29 |
VDDPST3018_DVIO_AO_3
80 - 98
1.8V GPIO
AO_MX30 - AO_MX48
VDDPST18_GPIO_AO
99 - 105
sunplus,output-invert-disable | NA | For GPIO or DVIO |
sunplus,output-invert-enable | NA | For GPIO or DVIO |
sunplus,slew-rate-control-disable | NA | |
sunplus,slew-rate-control-enable | NA |
Driving-strength Table of GPIO
...