riscv: dts: starfive: jh7100-common: Setup pinmux and enable gmac
authorCristian Ciocaltea <cristian.ciocaltea@collabora.com>
Wed, 20 Dec 2023 21:17:40 +0000 (23:17 +0200)
committerConor Dooley <conor.dooley@microchip.com>
Wed, 31 Jan 2024 12:23:26 +0000 (12:23 +0000)
Add pinmux configuration for DWMAC found on the JH7100 based boards and
enable the related DT node, providing a basic PHY configuration.

Co-developed-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
arch/riscv/boot/dts/starfive/jh7100-common.dtsi

index 6aac0404b4654d45dde8c0d6f41b3102c3e31771..ae1a6aeb0aeaa1182ece8005f4ed9686adec6398 100644 (file)
        };
 };
 
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins>;
+       phy-mode = "rgmii-id";
+       status = "okay";
+
+       mdio: mdio {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "snps,dwmac-mdio";
+       };
+};
+
 &gpio {
+       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,