diff options
author | sw.multimedia <sw.multimedia@starfivetech.com> | 2021-09-03 17:00:36 +0300 |
---|---|---|
committer | Tekkaman Ninja <tekkamanninja@163.com> | 2021-09-29 09:51:22 +0300 |
commit | b9512dffcc066bc33a69c5b47e5c30d6a7209726 (patch) | |
tree | 24a895f5de8f6600e474dd5bac669f01d19f9402 /arch/riscv | |
parent | aa2ef16eb27390314af2c65f840bff5e7d5b0cf4 (diff) | |
download | u-boot-b9512dffcc066bc33a69c5b47e5c30d6a7209726.tar.xz |
starfive: apply the pinctl to dts
Diffstat (limited to 'arch/riscv')
-rw-r--r-- | arch/riscv/dts/jh7100-beaglev-starlight.dts | 323 | ||||
-rw-r--r-- | arch/riscv/dts/jh7100.dtsi | 12 |
2 files changed, 323 insertions, 12 deletions
diff --git a/arch/riscv/dts/jh7100-beaglev-starlight.dts b/arch/riscv/dts/jh7100-beaglev-starlight.dts index b7e9ac531d..73e2f89acf 100644 --- a/arch/riscv/dts/jh7100-beaglev-starlight.dts +++ b/arch/riscv/dts/jh7100-beaglev-starlight.dts @@ -5,6 +5,7 @@ #include "jh7100.dtsi" #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/leds/common.h> +#include <dt-bindings/pinctrl/pinctrl-starfive.h> #include <dt-bindings/starfive_fb.h> / { @@ -85,13 +86,306 @@ }; }; +&gmac { + snps,reset-gpios = <&gpio 63 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&gmac_pins>; +}; + +&gpio { + /* don't reset gpio mux for serial console on uart3 */ + starfive,keep-gpiomux = <13 14>; + + gmac_pins: gmac-0 { + gtxclk-pins { + pins = <PAD_FUNC_SHARE(115)>; + bias-pull-up; + drive-strength = <35>; + input-enable; + input-schmitt-enable; + slew-rate = <0>; + }; + miitxclk-pins { + pins = <PAD_FUNC_SHARE(116)>; + bias-pull-up; + drive-strength = <14>; + input-enable; + input-schmitt-disable; + slew-rate = <0>; + }; + tx-pins { + pins = <PAD_FUNC_SHARE(117)>, + <PAD_FUNC_SHARE(119)>, + <PAD_FUNC_SHARE(120)>, + <PAD_FUNC_SHARE(121)>, + <PAD_FUNC_SHARE(122)>, + <PAD_FUNC_SHARE(123)>, + <PAD_FUNC_SHARE(124)>, + <PAD_FUNC_SHARE(125)>, + <PAD_FUNC_SHARE(126)>; + bias-pull-up; + drive-strength = <35>; + input-disable; + input-schmitt-disable; + slew-rate = <0>; + }; + rxclk-pins { + pins = <PAD_FUNC_SHARE(127)>; + bias-pull-up; + drive-strength = <14>; + input-enable; + input-schmitt-disable; + slew-rate = <6>; + }; + rxer-pins { + pins = <PAD_FUNC_SHARE(129)>; + bias-pull-up; + drive-strength = <14>; + input-enable; + input-schmitt-disable; + slew-rate = <0>; + }; + rx-pins { + pins = <PAD_FUNC_SHARE(128)>, + <PAD_FUNC_SHARE(130)>, + <PAD_FUNC_SHARE(131)>, + <PAD_FUNC_SHARE(132)>, + <PAD_FUNC_SHARE(133)>, + <PAD_FUNC_SHARE(134)>, + <PAD_FUNC_SHARE(135)>, + <PAD_FUNC_SHARE(136)>, + <PAD_FUNC_SHARE(137)>, + <PAD_FUNC_SHARE(138)>, + <PAD_FUNC_SHARE(139)>, + <PAD_FUNC_SHARE(140)>, + <PAD_FUNC_SHARE(141)>; + bias-pull-up; + drive-strength = <14>; + input-enable; + input-schmitt-enable; + slew-rate = <0>; + }; + }; + + i2c0_pins: i2c0-0 { + i2c-pins { + pinmux = <GPIOMUX(62, GPO_LOW, + GPO_I2C0_PAD_SCK_OEN, + GPI_I2C0_PAD_SCK_IN)>, + <GPIOMUX(61, GPO_LOW, + GPO_I2C0_PAD_SDA_OEN, + GPI_I2C0_PAD_SDA_IN)>; + bias-disable; /* external pull-up */ + input-enable; + input-schmitt-enable; + }; + }; + + i2c1_pins: i2c1-0 { + i2c-pins { + pinmux = <GPIOMUX(47, GPO_LOW, + GPO_I2C1_PAD_SCK_OEN, + GPI_I2C1_PAD_SCK_IN)>, + <GPIOMUX(48, GPO_LOW, + GPO_I2C1_PAD_SDA_OEN, + GPI_I2C1_PAD_SDA_IN)>; + bias-pull-up; + input-enable; + input-schmitt-enable; + }; + }; + + i2c2_pins: i2c2-0 { + i2c-pins { + pinmux = <GPIOMUX(60, GPO_LOW, + GPO_I2C2_PAD_SCK_OEN, + GPI_I2C2_PAD_SCK_IN)>, + <GPIOMUX(59, GPO_LOW, + GPO_I2C2_PAD_SDA_OEN, + GPI_I2C2_PAD_SDA_IN)>; + bias-disable; /* external pull-up */ + input-enable; + input-schmitt-enable; + }; + }; + + pwm_pins: pwm-0 { + pwm-pins { + pinmux = <GPIOMUX(7, + GPO_PWM_PAD_OUT_BIT0, + GPO_PWM_PAD_OE_N_BIT0, + GPI_NONE)>, + <GPIOMUX(5, + GPO_PWM_PAD_OUT_BIT1, + GPO_PWM_PAD_OE_N_BIT1, + GPI_NONE)>, + <GPIOMUX(45, + GPO_PWM_PAD_OUT_BIT2, + GPO_PWM_PAD_OE_N_BIT2, + GPI_NONE)>; + bias-disable; + drive-strength = <35>; + input-disable; + input-schmitt-disable; + slew-rate = <0>; + }; + }; + + sdio0_pins: sdio0-0 { + clk-pins { + pinmux = <GPIOMUX(54, GPO_SDIO0_PAD_CCLK_OUT, + GPO_ENABLE, GPI_NONE)>; + bias-disable; + input-disable; + input-schmitt-disable; + }; + sdio-pins { + pinmux = <GPIOMUX(55, GPO_LOW, GPO_DISABLE, + GPI_SDIO0_PAD_CARD_DETECT_N)>, + <GPIOMUX(53, + GPO_SDIO0_PAD_CCMD_OUT, + GPO_SDIO0_PAD_CCMD_OEN, + GPI_SDIO0_PAD_CCMD_IN)>, + <GPIOMUX(49, + GPO_SDIO0_PAD_CDATA_OUT_BIT0, + GPO_SDIO0_PAD_CDATA_OEN_BIT0, + GPI_SDIO0_PAD_CDATA_IN_BIT0)>, + <GPIOMUX(50, + GPO_SDIO0_PAD_CDATA_OUT_BIT1, + GPO_SDIO0_PAD_CDATA_OEN_BIT1, + GPI_SDIO0_PAD_CDATA_IN_BIT1)>, + <GPIOMUX(51, + GPO_SDIO0_PAD_CDATA_OUT_BIT2, + GPO_SDIO0_PAD_CDATA_OEN_BIT2, + GPI_SDIO0_PAD_CDATA_IN_BIT2)>, + <GPIOMUX(52, + GPO_SDIO0_PAD_CDATA_OUT_BIT3, + GPO_SDIO0_PAD_CDATA_OEN_BIT3, + GPI_SDIO0_PAD_CDATA_IN_BIT3)>; + bias-pull-up; + input-enable; + input-schmitt-enable; + }; + }; + + sdio1_pins: sdio1-0 { + clk-pins { + pinmux = <GPIOMUX(33, GPO_SDIO1_PAD_CCLK_OUT, + GPO_ENABLE, GPI_NONE)>; + bias-disable; + input-disable; + input-schmitt-disable; + }; + sdio-pins { + pinmux = <GPIOMUX(29, + GPO_SDIO1_PAD_CCMD_OUT, + GPO_SDIO1_PAD_CCMD_OEN, + GPI_SDIO1_PAD_CCMD_IN)>, + <GPIOMUX(36, + GPO_SDIO1_PAD_CDATA_OUT_BIT0, + GPO_SDIO1_PAD_CDATA_OEN_BIT0, + GPI_SDIO1_PAD_CDATA_IN_BIT0)>, + <GPIOMUX(30, + GPO_SDIO1_PAD_CDATA_OUT_BIT1, + GPO_SDIO1_PAD_CDATA_OEN_BIT1, + GPI_SDIO1_PAD_CDATA_IN_BIT1)>, + <GPIOMUX(34, + GPO_SDIO1_PAD_CDATA_OUT_BIT2, + GPO_SDIO1_PAD_CDATA_OEN_BIT2, + GPI_SDIO1_PAD_CDATA_IN_BIT2)>, + <GPIOMUX(31, + GPO_SDIO1_PAD_CDATA_OUT_BIT3, + GPO_SDIO1_PAD_CDATA_OEN_BIT3, + GPI_SDIO1_PAD_CDATA_IN_BIT3)>; + bias-pull-up; + input-enable; + input-schmitt-enable; + }; + }; + + spi2_pins: spi2-0 { + mosi-pin { + pinmux = <GPIOMUX(18, GPO_SPI2_PAD_TXD, + GPO_ENABLE, GPI_NONE)>; + bias-disable; + input-disable; + input-schmitt-disable; + }; + miso-pin { + pinmux = <GPIOMUX(16, GPO_LOW, GPO_DISABLE, + GPI_SPI2_PAD_RXD)>; + bias-pull-up; + input-enable; + input-schmitt-enable; + }; + sck-pin { + pinmux = <GPIOMUX(12, GPO_SPI2_PAD_SCK_OUT, + GPO_ENABLE, GPI_NONE)>; + bias-disable; + input-disable; + input-schmitt-disable; + }; + ss-pins { + pinmux = <GPIOMUX(15, GPO_SPI2_PAD_SS_0_N, + GPO_ENABLE, GPI_NONE)>, + <GPIOMUX(11, GPO_SPI2_PAD_SS_1_N, + GPO_ENABLE, GPI_NONE)>; + bias-disable; + input-disable; + input-schmitt-disable; + }; + }; + + uart0_pins: uart0-0 { + rx-pins { + pinmux = <GPIOMUX(40, GPO_LOW, GPO_DISABLE, + GPI_UART0_PAD_SIN)>, + <GPIOMUX(39, GPO_LOW, GPO_DISABLE, + GPI_UART0_PAD_CTSN)>; + bias-pull-up; + input-enable; + input-schmitt-enable; + }; + tx-pins { + pinmux = <GPIOMUX(41, GPO_UART0_PAD_SOUT, + GPO_ENABLE, GPI_NONE)>, + <GPIOMUX(42, GPO_UART0_PAD_RTSN, + GPO_ENABLE, GPI_NONE)>; + bias-disable; + input-disable; + input-schmitt-disable; + }; + }; + + uart3_pins: uart3-0 { + rx-pins { + pinmux = <GPIOMUX(13, GPO_LOW, GPO_DISABLE, + GPI_UART3_PAD_SIN)>; + bias-pull-up; + drive-strength = <14>; + input-enable; + input-schmitt-enable; + slew-rate = <0>; + }; + tx-pins { + pinmux = <GPIOMUX(14, GPO_UART3_PAD_SOUT, + GPO_ENABLE, GPI_NONE)>; + bias-disable; + drive-strength = <35>; + input-disable; + input-schmitt-disable; + slew-rate = <0>; + }; + }; +}; + &i2c0 { clock-frequency = <100000>; i2c-sda-hold-time-ns = <300>; i2c-sda-falling-time-ns = <500>; i2c-scl-falling-time-ns = <500>; - scl-gpio = <&gpio 62 GPIO_ACTIVE_HIGH>; - sda-gpio = <&gpio 61 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; status = "okay"; imx219@10 { @@ -143,8 +437,8 @@ i2c-sda-hold-time-ns = <300>; i2c-sda-falling-time-ns = <100>; i2c-scl-falling-time-ns = <100>; - scl-gpio = <&gpio 47 GPIO_ACTIVE_HIGH>; - sda-gpio = <&gpio 48 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; status = "okay"; ac108_a: ac108@3b { @@ -215,8 +509,8 @@ i2c-sda-hold-time-ns = <300>; i2c-sda-falling-time-ns = <500>; i2c-scl-falling-time-ns = <500>; - scl-gpio = <&gpio 60 GPIO_ACTIVE_HIGH>; - sda-gpio = <&gpio 59 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins>; status = "okay"; seeed_plane_i2c@45 { @@ -261,6 +555,12 @@ clock-frequency = <27000000>; }; +&ptc { + pinctrl-names = "default"; + pinctrl-0 = <&pwm_pins>; + status = "okay"; +}; + &qspi { nor_flash: nor-flash@0 { compatible = "spi-flash"; @@ -297,7 +597,8 @@ broken-cd; bus-width = <4>; cap-sd-highspeed; - max-frequency = <10000000>; + pinctrl-names = "default"; + pinctrl-0 = <&sdio0_pins>; status = "okay"; }; @@ -311,6 +612,8 @@ max-frequency = <10000000>; mmc-pwrseq = <&wifi_pwrseq>; non-removable; + pinctrl-names = "default"; + pinctrl-0 = <&sdio1_pins>; status = "okay"; wifi@1 { @@ -552,6 +855,8 @@ }; &spi2 { + pinctrl-names = "default"; + pinctrl-0 = <&spi2_pins>; status = "okay"; spi_dev0: spi@0 { @@ -562,10 +867,14 @@ }; &uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; status = "okay"; }; &uart3 { + pinctrl-names = "default"; + pinctrl-0 = <&uart3_pins>; status = "okay"; }; diff --git a/arch/riscv/dts/jh7100.dtsi b/arch/riscv/dts/jh7100.dtsi index c20231e99b..eaabebf5b5 100644 --- a/arch/riscv/dts/jh7100.dtsi +++ b/arch/riscv/dts/jh7100.dtsi @@ -262,15 +262,17 @@ status = "disabled"; }; - gpio: gpio@11910000 { - compatible = "starfive,jh7100-gpio"; - reg = <0x0 0x11910000 0x0 0x10000>; + gpio: pinctrl@11910000 { + compatible = "starfive,jh7100-pinctrl"; + reg = <0x0 0x11910000 0x0 0x10000>, + <0x0 0x11858000 0x0 0x1000>; + reg-names = "gpio", "padctl"; clocks = <&clkgen JH7100_CLK_GPIO_APB>; gpio-controller; #gpio-cells = <2>; + interrupts = <32>; interrupt-controller; #interrupt-cells = <2>; - interrupts = <32>; }; i2c0: i2c@118b0000 { @@ -412,7 +414,7 @@ clocks = <&clkgen JH7100_CLK_PWM_APB>; #pwm-cells = <3>; sifive,npwm = <8>; - + status = "disabled"; }; qspi: spi@11860000 { |