Skip to contentSkip to conversation

rockchip: rk3288: Add pinctrl support for the gmac ethernet interface

PATCH New Romain Perier 2 participants 4 messages Jun 26, 2017 – Jul 4, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 rockchip: rk3288: Add pinctrl support for the gmac ethernet interface

From: Sjoerd Simons <[email protected]>

Add support for the gmac ethernet interface to pinctrl. This hardcodes the setup to match that of the firefly and Radxa Rock2 boards, using the RGMII phy mode for gmac interface and GPIO4B0 as the phy reset GPIO.

---

Note: The patch has not been merged during the integration of the GMAC driver. It fixes the ethernet 1gbs issue (caused by a drive length issue)

Changes in v2:
- Added Signed-off-by with my email
- Fixed coding style issues for GPIO_BIAS and GPIO_PULL
- Added missing space in comment

 arch/arm/include/asm/arch-rockchip/grf_rk3288.h | 178 ++++++++++++++++++++++++
 drivers/pinctrl/rockchip/pinctrl_rk3288.c       | 118 ++++++++++++++++
 2 files changed, 296 insertions(+)
arch/arm/include/asm/arch-rockchip/grf_rk3288.h +178 -0
index fbc4a0d80f..818e4c5666 100644
@@ -283,6 +283,163 @@ enum {
 	GPIO3C0_EMMC_CMD,
 };
 
+/* GRF_GPIO3DL_IOMUX */
+enum {
+	GPIO3D3_SHIFT		= 12,
+	GPIO3D3_MASK		= 7,
+	GPIO3D3_GPIO		= 0,
+	GPIO3D3_FLASH1_DATA3,
+	GPIO3D3_HOST_DOUT3,
+	GPIO3D3_MAC_RXD3,
+	GPIO3D3_SDIO1_DATA3,
+
+	GPIO3D2_SHIFT		= 8,
+	GPIO3D2_MASK		= 7,
+	GPIO3D2_GPIO		= 0,
+	GPIO3D2_FLASH1_DATA2,
+	GPIO3D2_HOST_DOUT2,
+	GPIO3D2_MAC_RXD2,
+	GPIO3D2_SDIO1_DATA2,
+
+	GPIO3D1_SHIFT		= 4,
+	GPIO3D1_MASK		= 7,
+	GPIO3D1_GPIO		= 0,
+	GPIO3DL1_FLASH1_DATA1,
+	GPIO3D1_HOST_DOUT1,
+	GPIO3D1_MAC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= 7,
+	GPIO4B1_GPIO		= 0,
+	GPIO4B1_FLASH1_CSN2,
+	GPIO4B1_HOST_DOUT15,
+	GPIO4B1_MAC_TXCLK,
+	GPIO4B1_SDIO1_PWREN,
+
+	GPIO4B0_SHIFT		= 0,
+	GPIO4B0_MASK		= 7,
+	GPIO4B0_GPIO		= 0,
+	GPIO4B0_FLASH1_DQS,
+	GPIO4B0_HOST_DOUT14,
+	GPIO4B0_MAC_COL,
+	GPIO4B0_FLASH1_CSN3,
+};
+
 /* GRF_GPIO4C_IOMUX */
 enum {
 	GPIO4C7_SHIFT		= 14,
@@ -886,4 +1043,25 @@ enum GRF_SOC_CON8 {
 	RK3288_DPHY_TX0_TURNREQUEST_DIS = 0,
 };
 
+/* GPIO Bias settings */
+enum GPIO_BIAS {
+	GPIO_BIAS_2MA = 0,
+	GPIO_BIAS_4MA,
+	GPIO_BIAS_8MA,
+	GPIO_BIAS_12MA,
+};
+
+#define GPIO_BIAS_MASK	0x3
+#define GPIO_BIAS_SHIFT(x)  ((x) * 2)
+
+enum GPIO_PU_PD {
+	GPIO_PULL_NORMAL = 0,
+	GPIO_PULL_UP,
+	GPIO_PULL_DOWN,
+	GPIO_PULL_REPEAT,
+};
+
+#define GPIO_PULL_MASK	0x3
+#define GPIO_PULL_SHIFT(x)  ((x) * 2)
+
 #endif
drivers/pinctrl/rockchip/pinctrl_rk3288.c +118 -0

136 lines not on this page · raw message

Signature · 1 line
2.11.0
#1 lore raw

PATCH v2 1/1 rockchip: rk3288: Add pinctrl support for the gmac ethernet interface

Quoted 13 lines

From: Sjoerd Simons <[email protected]>

Add support for the gmac ethernet interface to pinctrl. This hardcodes the setup to match that of the firefly and Radxa Rock2 boards, using the RGMII phy mode for gmac interface and GPIO4B0 as the phy reset GPIO.

---

Note: The patch has not been merged during the integration of the GMAC driver. It fixes the ethernet 1gbs issue (caused by a drive length issue)

Quoted 9 lines

Changes in v2:
- Added Signed-off-by with my email
- Fixed coding style issues for GPIO_BIAS and GPIO_PULL
- Added missing space in comment

 arch/arm/include/asm/arch-rockchip/grf_rk3288.h | 178 ++++++++++++++++++++++++
 drivers/pinctrl/rockchip/pinctrl_rk3288.c       | 118 ++++++++++++++++
 2 files changed, 296 insertions(+)
#2 lore raw

PATCH v2 1/1 rockchip: rk3288: Add pinctrl support for the gmac ethernet interface

In reply to Romain Perier
Quoted 14 lines

From: Sjoerd Simons <[email protected]>

Add support for the gmac ethernet interface to pinctrl. This hardcodes the setup to match that of the firefly and Radxa Rock2 boards, using the RGMII phy mode for gmac interface and GPIO4B0 as the phy reset GPIO.

---

Note: The patch has not been merged during the integration of the GMAC driver. It fixes the ethernet 1gbs issue (caused by a drive length issue)

Quoted 9 lines

Changes in v2:
- Added Signed-off-by with my email
- Fixed coding style issues for GPIO_BIAS and GPIO_PULL
- Added missing space in comment

 arch/arm/include/asm/arch-rockchip/grf_rk3288.h | 178 ++++++++++++++++++++++++
 drivers/pinctrl/rockchip/pinctrl_rk3288.c       | 118 ++++++++++++++++
 2 files changed, 296 insertions(+)
#3 lore raw

PATCH v2 1/1 rockchip: rk3288: Add pinctrl support for the gmac ethernet interface

In reply to Romain Perier
Quoted 15 lines

From: Sjoerd Simons <[email protected]>

Add support for the gmac ethernet interface to pinctrl. This hardcodes the setup to match that of the firefly and Radxa Rock2 boards, using the RGMII phy mode for gmac interface and GPIO4B0 as the phy reset GPIO.

---

Note: The patch has not been merged during the integration of the GMAC driver. It fixes the ethernet 1gbs issue (caused by a drive length issue)

Quoted 9 lines

Changes in v2:
- Added Signed-off-by with my email
- Fixed coding style issues for GPIO_BIAS and GPIO_PULL
- Added missing space in comment

 arch/arm/include/asm/arch-rockchip/grf_rk3288.h | 178 ++++++++++++++++++++++++
 drivers/pinctrl/rockchip/pinctrl_rk3288.c       | 118 ++++++++++++++++
 2 files changed, 296 insertions(+)

Applied to u-boot-rockchip/next, thanks!