Skip to contentSkip to conversation

add Ethernet support for S700

PATCH New Amit Singh Tomar 3 participants 26 messages May 9, 2020 – Jul 8, 2020

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

cover add Ethernet support for S700

This series adds Ethernet Support Actions Semi OWL S700 SoC.

First patch(1/7) series adds Ethernet clock for S900 and S700, S900 part is just compiled tested.

Patches(from 2/7 and 3/7) adds support for RTL 8201F PHY module and introduce configuration option "RTL8201F_PHY_S700_RMII_TIMINGS" to fulfil specific timing requirements for S700.

Patches(from 4/21 to 7/21) are there to enable Ethenet support in S700, MAC is based on Designware IP.

These patches re-uses the existing driver(drivers/net/designware.c) and programs SoC specific bits to enable ethernet. SoC specific glue code is kept in dwmac_s700.c file, did it this way as found it more cleaner but having done that I am not really sure, if it's bit of a overkill to have it place in glue code or we can keep this glue code somewhere in machine file ?

Series is tested on Cubieboard7-lite by tftping all the images needed to boot Linux.

Amit Singh Tomar (7):
clk: actions: Add Ethernet clocks
net: phy: realtek: Add support for RTL8201F PHY module.
net: phy: realtek: Introduce PHY_RTL8201F_S700_RMII_TIMINGS to adjust
rx/tx timings
net: designware: s700: Add glue code for S700 mac
arm: dts: s700: add node for ethernet controller
owl: Kconfig: Enable DM eth for OWL platform
configs: Enable mac and phy configs

 arch/arm/Kconfig                          |  1 +
 arch/arm/dts/s700-u-boot.dtsi             | 13 ++++++
 arch/arm/include/asm/arch-owl/regs_s700.h |  8 ++++
 arch/arm/include/asm/arch-owl/regs_s900.h |  4 ++
 configs/cubieboard7_defconfig             |  4 ++
 drivers/clk/owl/clk_owl.c                 |  9 +++++
 drivers/clk/owl/clk_owl.h                 |  2 -
 drivers/net/Kconfig                       |  7 ++++
 drivers/net/Makefile                      |  1 +
 drivers/net/dwmac_s700.c                  | 66 +++++++++++++++++++++++++++++++
 drivers/net/phy/Kconfig                   |  9 +++++
 drivers/net/phy/realtek.c                 | 55 ++++++++++++++++++++++++++
 12 files changed, 177 insertions(+), 2 deletions(-)
 create mode 100644 drivers/net/dwmac_s700.c
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/7 clk: actions: Add Ethernet clocks

This commit adds clocks needed for ethernet operations for Actions OWL family of SoCs (S700 and S900).

---
 arch/arm/include/asm/arch-owl/regs_s700.h | 2 ++
 arch/arm/include/asm/arch-owl/regs_s900.h | 4 ++++
 drivers/clk/owl/clk_owl.c                 | 9 +++++++++
 drivers/clk/owl/clk_owl.h                 | 2 --
 4 files changed, 15 insertions(+), 2 deletions(-)
arch/arm/include/asm/arch-owl/regs_s700.h +2 -0
index 2f21c15cca8c..90459ae95eeb 100644
@@ -53,4 +53,6 @@
 #define CMU_CVBSPLL		0x00B8
 #define CMU_SSTSCLK		0x00C0
 
+#define CMU_DEVCLKEN1_ETH	BIT(23)
+
 #endif
arch/arm/include/asm/arch-owl/regs_s900.h +4 -0
index 9e9106ddaab9..084bc9b8c3fb 100644
@@ -61,4 +61,8 @@
 #define CMU_TVOUTPLLDEBUG0			(0x00EC)
 #define CMU_TVOUTPLLDEBUG1			(0x00FC)
 
+#define CMU_DEVCLKEN1_ETH			BIT(22)
+#define CLK_ETHERNET				CLK_ETH_MAC
+#define CMU_ETHERNETPLL				CMU_ASSISTPLL
+
 #endif
drivers/clk/owl/clk_owl.c +9 -0
index 5607b2b7b516..b80862e17f51 100644
@@ -85,6 +85,11 @@ int owl_clk_enable(struct clk *clk)
 		/* Enable UART3 interface clock */
 		setbits_le32(priv->base + CMU_DEVCLKEN1, CMU_DEVCLKEN1_UART3);
 		break;
+	case CLK_RMII_REF:
+	case CLK_ETHERNET:
+		setbits_le32(priv->base + CMU_DEVCLKEN1, CMU_DEVCLKEN1_ETH);
+		setbits_le32(priv->base + CMU_ETHERNETPLL, 5);
+		break;
 	default:
 		return -EINVAL;
 	}
@@ -110,6 +115,10 @@ int owl_clk_disable(struct clk *clk)
 		/* Disable UART3 interface clock */
 		clrbits_le32(priv->base + CMU_DEVCLKEN1, CMU_DEVCLKEN1_UART3);
 		break;
+	case CLK_RMII_REF:
+	case CLK_ETHERNET:
+		clrbits_le32(priv->base + CMU_DEVCLKEN1, CMU_DEVCLKEN1_ETH);
+		break;
 	default:
 		return -EINVAL;
 	}
drivers/clk/owl/clk_owl.h +0 -2
index b8d33624c5f5..a2065a726d46 100644
@@ -59,6 +59,4 @@ struct owl_clk_priv {
 #define CMU_DEVCLKEN1_UART5	BIT(21)
 #define CMU_DEVCLKEN1_UART3	BIT(11)
 
-#define CMU_DEVCLKEN1_ETH_S700	BIT(23)
-
 #endif
Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/7 clk: actions: Add Ethernet clocks

Quoted 4 lines · Amit Singh Tomar

This commit adds clocks needed for ethernet operations for Actions OWL family of SoCs (S700 and S900).

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200707/d082a44b/attachment.sig>
#3 lore raw

PATCH 2/7 net: phy: realtek: Add support for RTL8201F PHY module.

In reply to Amit Singh Tomar

This patch adds support for Realtek PHY RTL8201F 10/100Mbs (with variants: RTL8201FN and RTL8201FL) PHYceiver. It is present on Actions Semi Cubieboard7 board.

---
 drivers/net/phy/realtek.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/net/phy/realtek.c +20 -0
index 8f1d75963259..b9c373bfe3cc 100644
@@ -157,6 +157,14 @@ static int rtl8211x_config(struct phy_device *phydev)
 	return 0;
 }
 
+/* RealTek RTL8201F */
+static int rtl8201f_config(struct phy_device *phydev)
+{
+	genphy_config_aneg(phydev);
+
+	return 0;
+}
+
 static int rtl8211f_config(struct phy_device *phydev)
 {
 	u16 reg;
@@ -386,12 +394,24 @@ static struct phy_driver RTL8211F_driver = {
 	.writeext = &rtl8211f_phy_extwrite,
 };
 
+/* Support for RTL8201F PHY */
+static struct phy_driver RTL8201F_driver = {
+	.name = "RealTek RTL8201F 10/100Mbps Ethernet",
+	.uid = 0x1cc816,
+	.mask = 0xffffff,
+	.features = PHY_BASIC_FEATURES,
+	.config = &rtl8201f_config,
+	.startup = &rtl8211e_startup,
+	.shutdown = &genphy_shutdown,
+};
+
 int phy_realtek_init(void)
 {
 	phy_register(&RTL8211B_driver);
 	phy_register(&RTL8211E_driver);
 	phy_register(&RTL8211F_driver);
 	phy_register(&RTL8211DN_driver);
+	phy_register(&RTL8201F_driver);
 
 	return 0;
 }
Signature · 1 line
2.7.4
#4 lore raw

PATCH 2/7 net: phy: realtek: Add support for RTL8201F PHY module.

Quoted 5 lines · Amit Singh Tomar

This patch adds support for Realtek PHY RTL8201F 10/100Mbs (with variants: RTL8201FN and RTL8201FL) PHYceiver. It is present on Actions Semi Cubieboard7 board.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200707/e77e2ba7/attachment.sig>
#5 lore raw

PATCH 3/7 net: phy: realtek: Introduce PHY_RTL8201F_S700_RMII_TIMINGS to adjust rx/tx timings

In reply to Amit Singh Tomar

RTL8201F PHY module found on Actions Semi Cubieboard7 seems to have specific Rx/Tx interface timings requirement for proper PHY operations. These timing values are not documented anywhere and picked from vendor code.

This commits lets proper packets to be transmitted over the network.

---
 drivers/net/phy/Kconfig   |  9 +++++++++
 drivers/net/phy/realtek.c | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)
drivers/net/phy/Kconfig +9 -0
index d1f049e62ab7..123c17c04458 100644
@@ -235,6 +235,15 @@ config RTL8211F_PHY_FORCE_EEE_RXC_ON
 	  Default n, which means that the PHY state is not changed. To work
 	  around the issues, change this setting to y.
 
+config RTL8201F_PHY_S700_RMII_TIMINGS
+	bool "Ethernet PHY RTL8201F: adjust RMII Tx Interface timings"
+	depends on PHY_REALTEK
+	help
+	  This provides an option to configure specific timing requirements (needed
+	  for proper PHY operations) for the PHY module present on ACTION SEMI S700
+	  based cubieboard7. Exact timing requiremnets seems to be SoC specific
+	  (and it's undocumented) that comes from vendor code itself.
+
 config PHY_SMSC
 	bool  "Microchip(SMSC) Ethernet PHYs support"
 
drivers/net/phy/realtek.c +35 -0
index b9c373bfe3cc..a549a106876f 100644
@@ -13,6 +13,7 @@
 #define PHY_RTL8211x_FORCE_MASTER BIT(1)
 #define PHY_RTL8211E_PINE64_GIGABIT_FIX BIT(2)
 #define PHY_RTL8211F_FORCE_EEE_RXC_ON BIT(3)
+#define PHY_RTL8201F_S700_RMII_TIMINGS BIT(4)
 
 #define PHY_AUTONEGOTIATE_TIMEOUT 5000
 
@@ -58,6 +59,15 @@
 #define MIIM_RTL8211F_TX_DELAY		0x100
 #define MIIM_RTL8211F_LCR		0x10
 
+#define RTL8201F_RMSR			0x10
+
+#define RMSR_RX_TIMING_SHIFT		BIT(2)
+#define RMSR_RX_TIMING_MASK		GENMASK(7, 4)
+#define RMSR_RX_TIMING_VAL		0x4
+#define RMSR_TX_TIMING_SHIFT		BIT(3)
+#define RMSR_TX_TIMING_MASK		GENMASK(11, 8)
+#define RMSR_TX_TIMING_VAL		0x5
+
 static int rtl8211f_phy_extread(struct phy_device *phydev, int addr,
 				int devaddr, int regnum)
 {
@@ -112,6 +122,15 @@ static int rtl8211f_probe(struct phy_device *phydev)
 	return 0;
 }
 
+static int rtl8210f_probe(struct phy_device *phydev)
+{
+#ifdef CONFIG_RTL8201F_PHY_S700_RMII_TIMINGS
+	phydev->flags |= PHY_RTL8201F_S700_RMII_TIMINGS;
+#endif
+
+	return 0;
+}
+
 /* RealTek RTL8211x */
 static int rtl8211x_config(struct phy_device *phydev)
 {
@@ -160,6 +179,21 @@ static int rtl8211x_config(struct phy_device *phydev)
 /* RealTek RTL8201F */
 static int rtl8201f_config(struct phy_device *phydev)
 {
+	unsigned int reg;
+
+	if (phydev->flags & PHY_RTL8201F_S700_RMII_TIMINGS) {
+		phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT,
+			  7);
+		reg = phy_read(phydev, MDIO_DEVAD_NONE, RTL8201F_RMSR);
+		reg &= ~(RMSR_RX_TIMING_MASK | RMSR_TX_TIMING_MASK);
+		/* Set the needed Rx/Tx Timings for proper PHY operation */
+		reg |= (RMSR_RX_TIMING_VAL << RMSR_RX_TIMING_SHIFT)
+		       | (RMSR_TX_TIMING_VAL << RMSR_TX_TIMING_SHIFT);
+		phy_write(phydev, MDIO_DEVAD_NONE, RTL8201F_RMSR, reg);
+		phy_write(phydev, MDIO_DEVAD_NONE, MIIM_RTL8211F_PAGE_SELECT,
+			  0);
+	}
+
 	genphy_config_aneg(phydev);
 
 	return 0;
@@ -400,6 +434,7 @@ static struct phy_driver RTL8201F_driver = {
 	.uid = 0x1cc816,
 	.mask = 0xffffff,
 	.features = PHY_BASIC_FEATURES,
+	.probe = &rtl8210f_probe,
 	.config = &rtl8201f_config,
 	.startup = &rtl8211e_startup,
 	.shutdown = &genphy_shutdown,
Signature · 1 line
2.7.4
#6 lore raw

PATCH 3/7 net: phy: realtek: Introduce PHY_RTL8201F_S700_RMII_TIMINGS to adjust rx/tx timings

Quoted 8 lines · Amit Singh Tomar

RTL8201F PHY module found on Actions Semi Cubieboard7 seems to have specific Rx/Tx interface timings requirement for proper PHY operations. These timing values are not documented anywhere and picked from vendor code.

This commits lets proper packets to be transmitted over the network.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200707/f5de7049/attachment.sig>
#7 lore raw

PATCH 4/7 net: designware: s700: Add glue code for S700 mac

In reply to Amit Singh Tomar

This patchs adds glue logic to enable designware mac present on Action Semi based S700 SoC, Configures SoC specific bits.

Undocumented bit that programs the PHY interface select register comes from vendor source.

It has been tested on Cubieboard7-lite based on S700 SoC.

---
 arch/arm/include/asm/arch-owl/regs_s700.h |  6 +++
 drivers/net/Kconfig                       |  7 ++++
 drivers/net/Makefile                      |  1 +
 drivers/net/dwmac_s700.c                  | 66 +++++++++++++++++++++++++++++++
 4 files changed, 80 insertions(+)
 create mode 100644 drivers/net/dwmac_s700.c
arch/arm/include/asm/arch-owl/regs_s700.h +6 -0
index 90459ae95eeb..0f79faec69c1 100644
@@ -55,4 +55,10 @@
 
 #define CMU_DEVCLKEN1_ETH	BIT(23)
 
+#define GPIO_MFP_PWM           (0xE01B0000)
+#define MFP_CTL0               (GPIO_MFP_PWM + 0x40)
+#define MFP_CTL1               (GPIO_MFP_PWM + 0x44)
+#define MFP_CTL2               (GPIO_MFP_PWM + 0x48)
+#define MFP_CTL3               (GPIO_MFP_PWM + 0x4C)
+
 #endif
drivers/net/Kconfig +7 -0
index a2587a29e165..1a04e333efdf 100644
@@ -225,6 +225,13 @@ config ETH_DESIGNWARE_SOCFPGA
 	  Altera system manager to correctly interface with the PHY.
 	  This code handles those SoC specifics.
 
+config ETH_DESIGNWARE_S700
+	bool "Actins S700 glue driver for Synopsys Designware Ethernet MAC"
+	depends on DM_ETH && ETH_DESIGNWARE
+	help
+	  This provides glue layer to use Synopsys Designware Ethernet MAC
+	  present on Actions S700 SoC.
+
 config ETHOC
 	bool "OpenCores 10/100 Mbps Ethernet MAC"
 	help
drivers/net/Makefile +1 -0
index 6d9b8772b1a5..6f01d0169240 100644
@@ -18,6 +18,7 @@ obj-$(CONFIG_CS8900) += cs8900.o
 obj-$(CONFIG_TULIP) += dc2114x.o
 obj-$(CONFIG_ETH_DESIGNWARE) += designware.o
 obj-$(CONFIG_ETH_DESIGNWARE_SOCFPGA) += dwmac_socfpga.o
+obj-$(CONFIG_ETH_DESIGNWARE_S700) += dwmac_s700.o
 obj-$(CONFIG_DRIVER_DM9000) += dm9000x.o
 obj-$(CONFIG_DNET) += dnet.o
 obj-$(CONFIG_E1000) += e1000.o
drivers/net/dwmac_s700.c new file +66 -0

66 lines not on this page · raw message

Signature · 1 line
2.7.4
#8 lore raw

PATCH 4/7 net: designware: s700: Add glue code for S700 mac

Quoted 9 lines · Amit Singh Tomar

This patchs adds glue logic to enable designware mac present on Action Semi based S700 SoC, Configures SoC specific bits.

Undocumented bit that programs the PHY interface select register comes from vendor source.

It has been tested on Cubieboard7-lite based on S700 SoC.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200707/d537c923/attachment.sig>
#9 lore raw

PATCH 5/7 arm: dts: s700: add node for ethernet controller

In reply to Amit Singh Tomar

This patch adds node for ethernet controller found on Action Semi OWL S700 SoC.

Since, there is no upstream Linux binding exist for S700 ethernet controller, Changes are put in u-boot specific dtsi file.

---
 arch/arm/dts/s700-u-boot.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/dts/s700-u-boot.dtsi +13 -0
index a527cccc75f2..1b2768272c62 100644
@@ -6,6 +6,19 @@
 /{
 	soc {
 		u-boot,dm-pre-reloc;
+
+		gmac:  ethernet at e0220000 {
+			compatible = "actions,s700-ethernet";
+			reg = <0 0xe0220000 0 0x2000>;
+			interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "macirq";
+			local-mac-address = [ 00 18 fe 66 66 66 ];
+			clocks = <&cmu CLK_ETHERNET>, <&cmu CLK_RMII_REF>;
+			clock-names = "ethernet", "rmii_ref";
+			phy-mode = "rmii";
+			status = "okay";
+                };
+
 	};
 };
 
Signature · 1 line
2.7.4
#10 lore raw

PATCH 5/7 arm: dts: s700: add node for ethernet controller

Quoted 5 lines · Amit Singh Tomar

This patch adds node for ethernet controller found on Action Semi OWL S700 SoC.

Since, there is no upstream Linux binding exist for S700 ethernet controller, Changes are put in u-boot specific dtsi file.

But that should not be the S700 SoC .dtsi, instead the cubieboard .dts file, since you specify the PHY mode in here (which is board specific).

Quoted 10 lines
---
 arch/arm/dts/s700-u-boot.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/dts/s700-u-boot.dtsi +0 -0
index a527cccc75f2..1b2768272c62 100644

arch/arm/dts/s700-u-boot.dtsi line 15

Quoted 10 lines
arch/arm/dts/s700-u-boot.dtsi +7 -0
@@ -6,6 +6,19 @@
 /{
 	soc {
 		u-boot,dm-pre-reloc;
+
+		gmac:  ethernet at e0220000 {
+			compatible = "actions,s700-ethernet";
+			reg = <0 0xe0220000 0 0x2000>;
+			interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "macirq";
+			local-mac-address = [ 00 18 fe 66 66 66 ];

Is there another solution to that? Maybe put that in the environment instead? Or generate this randomly or ideally by hashing some serial number?

Cheers,
Andre.

Quoted 10 lines
arch/arm/dts/s700-u-boot.dtsi +6 -0
+			clocks = <&cmu CLK_ETHERNET>, <&cmu CLK_RMII_REF>;
+			clock-names = "ethernet", "rmii_ref";
+			phy-mode = "rmii";
+			status = "okay";
+                };
+
 	};
 };
 
#11 lore raw

PATCH 5/7 arm: dts: s700: add node for ethernet controller

Quoted 9 lines · Andr? Przywara
Quoted 5 lines · Amit Singh Tomar

This patch adds node for ethernet controller found on Action Semi OWL S700 SoC.

Since, there is no upstream Linux binding exist for S700 ethernet controller, Changes are put in u-boot specific dtsi file.

But that should not be the S700 SoC .dtsi, instead the cubieboard .dts file, since you specify the PHY mode in here (which is board specific).

The general way to move forward here is that bindings should be getting proposed to Linux and accepted there, and U-Boot can take a WIP of them, that gets updated later on to match, but we shouldn't get it here first.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200512/b20eff94/attachment.sig>
author
#12 lore raw

PATCH 5/7 arm: dts: s700: add node for ethernet controller

Hi,

Quoted 3 lines

The general way to move forward here is that bindings should be getting proposed to Linux and accepted there, and U-Boot can take a WIP of them, that gets updated later on to match, but we shouldn't get it here first.

I do have a plan to propose this binding to Linux but this is kind of ready(I mean, the other bits
like PHY and driver) for U-boot. So thought of posting it to the list here.

Thanks
-Amit

#13 lore raw

PATCH 5/7 arm: dts: s700: add node for ethernet controller

Quoted 9 lines · Amit Tomer

Hi,

Quoted 3 lines

The general way to move forward here is that bindings should be getting proposed to Linux and accepted there, and U-Boot can take a WIP of them, that gets updated later on to match, but we shouldn't get it here first.

I do have a plan to propose this binding to Linux but this is kind of ready(I mean, the other bits
like PHY and driver) for U-boot. So thought of posting it to the list here.

For some initial review, fine, but we need to have the Linux bindings being reviewed at the same time, and before things come in to U-Boot. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200512/d8fe1fcb/attachment.sig>
#14 lore raw

PATCH 5/7 arm: dts: s700: add node for ethernet controller

In reply to Tom Rini
Quoted 8 lines · Tom Rini
Quoted 7 lines · Andr? Przywara
Quoted 5 lines · Amit Singh Tomar

This patch adds node for ethernet controller found on Action Semi OWL S700 SoC.

Since, there is no upstream Linux binding exist for S700 ethernet controller, Changes are put in u-boot specific dtsi file.

Quoted 6 lines
Quoted 2 lines

But that should not be the S700 SoC .dtsi, instead the cubieboard .dts file, since you specify the PHY mode in here (which is board specific).

The general way to move forward here is that bindings should be getting proposed to Linux and accepted there, and U-Boot can take a WIP of them, that gets updated later on to match, but we shouldn't get it here first.

Yes, this is of course a stop-gap measure, but a useful one: Being able to TFTP a kernel helps with developing the kernel port, especially since U-Boot doesn't support MMC (yet).
And there are easier things than pushing a DT binding into the kernel tree without having a Linux driver ready ...

Cheers,
Andre

#15 lore raw

PATCH 5/7 arm: dts: s700: add node for ethernet controller

Quoted 16 lines · Andr? Przywara
Quoted 8 lines · Tom Rini
Quoted 7 lines · Andr? Przywara
Quoted 5 lines · Amit Singh Tomar

This patch adds node for ethernet controller found on Action Semi OWL S700 SoC.

Since, there is no upstream Linux binding exist for S700 ethernet controller, Changes are put in u-boot specific dtsi file.

Quoted 6 lines
Quoted 2 lines

But that should not be the S700 SoC .dtsi, instead the cubieboard .dts file, since you specify the PHY mode in here (which is board specific).

The general way to move forward here is that bindings should be getting proposed to Linux and accepted there, and U-Boot can take a WIP of them, that gets updated later on to match, but we shouldn't get it here first.

Quoted 5 lines

Yes, this is of course a stop-gap measure, but a useful one: Being able to TFTP a kernel helps with developing the kernel port, especially since U-Boot doesn't support MMC (yet).
And there are easier things than pushing a DT binding into the kernel tree without having a Linux driver ready ...

So, we're at -rc2 for v2020.07. The DDR calculation stuff I can see getting pulled in. Is the ethernet driver for this SoC so far from done that it's not ready for linux-next? Things don't have to be in mainline proper, but the expectation is that it's making reasonable progress there and been reviewed so that binding changes between what we take in U-Boot at first and a final re-sync once it is in mainline are minimal.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200512/fffdc39f/attachment.sig>
author
#16 lore raw

PATCH 5/7 arm: dts: s700: add node for ethernet controller

Quoted 6 lines

So, we're at -rc2 for v2020.07. The DDR calculation stuff I can see getting pulled in. Is the ethernet driver for this SoC so far from done that it's not ready for linux-next? Things don't have to be in mainline proper, but the expectation is that it's making reasonable progress there and been reviewed so that binding changes between what we take in U-Boot at first and a final re-sync once it is in mainline are minimal.

To be honest, we haven't put any of the Ethernet bits for Linux yet. We have put few patches for review to support MMC for S700 in Linux, and once those gets merged we would start working on Ethernet.

Thanks
-Amit

#17 lore raw

PATCH 5/7 arm: dts: s700: add node for ethernet controller

In reply to Tom Rini

On 12/05/2020 16:09, Tom Rini wrote:

Hi,

Quoted 23 lines · Andr? Przywara
Quoted 16 lines · Tom Rini
Quoted 8 lines · Andr? Przywara
Quoted 7 lines · Amit Singh Tomar
Quoted 5 lines

This patch adds node for ethernet controller found on Action Semi OWL S700 SoC.

Since, there is no upstream Linux binding exist for S700 ethernet controller, Changes are put in u-boot specific dtsi file.

Quoted 6 lines
Quoted 2 lines

But that should not be the S700 SoC .dtsi, instead the cubieboard .dts file, since you specify the PHY mode in here (which is board specific).

The general way to move forward here is that bindings should be getting proposed to Linux and accepted there, and U-Boot can take a WIP of them, that gets updated later on to match, but we shouldn't get it here first.

Quoted 5 lines

Yes, this is of course a stop-gap measure, but a useful one: Being able to TFTP a kernel helps with developing the kernel port, especially since U-Boot doesn't support MMC (yet).
And there are easier things than pushing a DT binding into the kernel tree without having a Linux driver ready ...

Quoted 6 lines

So, we're at -rc2 for v2020.07. The DDR calculation stuff I can see getting pulled in. Is the ethernet driver for this SoC so far from done that it's not ready for linux-next? Things don't have to be in mainline proper, but the expectation is that it's making reasonable progress there and been reviewed so that binding changes between what we take in U-Boot at first and a final re-sync once it is in mainline are minimal.

I don't think there is any particular rush in getting this actually merged. After all it seems like the users of this board can be counted on one hand.
I think it's nice to have this on the list, so interested parties can pull it in if there is a need. But we can surely wait how the binding evolves in the kernel tree, though this might take some time.

Cheers,
Andre.

#18 lore raw

PATCH 5/7 arm: dts: s700: add node for ethernet controller

Quoted 34 lines · Andr? Przywara

On 12/05/2020 16:09, Tom Rini wrote:

Hi,

Quoted 23 lines · Andr? Przywara
Quoted 16 lines · Tom Rini
Quoted 8 lines · Andr? Przywara
Quoted 7 lines · Amit Singh Tomar
Quoted 5 lines

This patch adds node for ethernet controller found on Action Semi OWL S700 SoC.

Since, there is no upstream Linux binding exist for S700 ethernet controller, Changes are put in u-boot specific dtsi file.

Quoted 6 lines
Quoted 2 lines

But that should not be the S700 SoC .dtsi, instead the cubieboard .dts file, since you specify the PHY mode in here (which is board specific).

The general way to move forward here is that bindings should be getting proposed to Linux and accepted there, and U-Boot can take a WIP of them, that gets updated later on to match, but we shouldn't get it here first.

Quoted 5 lines

Yes, this is of course a stop-gap measure, but a useful one: Being able to TFTP a kernel helps with developing the kernel port, especially since U-Boot doesn't support MMC (yet).
And there are easier things than pushing a DT binding into the kernel tree without having a Linux driver ready ...

Quoted 6 lines

So, we're at -rc2 for v2020.07. The DDR calculation stuff I can see getting pulled in. Is the ethernet driver for this SoC so far from done that it's not ready for linux-next? Things don't have to be in mainline proper, but the expectation is that it's making reasonable progress there and been reviewed so that binding changes between what we take in U-Boot at first and a final re-sync once it is in mainline are minimal.

Quoted 6 lines

I don't think there is any particular rush in getting this actually merged. After all it seems like the users of this board can be counted on one hand.
I think it's nice to have this on the list, so interested parties can pull it in if there is a need. But we can surely wait how the binding evolves in the kernel tree, though this might take some time.

OK, I think that'll be good enough for a while then. I'll mark this as RFC in patchwork so I don't forget it's not quite ready for merging anyhow. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200512/df755d3c/attachment.sig>
author
#19 lore raw

PATCH 5/7 arm: dts: s700: add node for ethernet controller

In reply to André Przywara

Hi,

Quoted 10 lines · Andr? Przywara
Quoted 5 lines · Amit Singh Tomar

This patch adds node for ethernet controller found on Action Semi OWL S700 SoC.

Since, there is no upstream Linux binding exist for S700 ethernet controller, Changes are put in u-boot specific dtsi file.

But that should not be the S700 SoC .dtsi, instead the cubieboard .dts file, since you specify the PHY mode in here (which is board specific).

But MAC is present on SoC , so I thought of adding it s700 specific u-boot.dtsi as
it is already hosting few other things .

Quoted 15 lines
Quoted 15 lines
---
 arch/arm/dts/s700-u-boot.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/dts/s700-u-boot.dtsi +2 -0
index a527cccc75f2..1b2768272c62 100644
@@ -6,6 +6,19 @@
 /{
      soc {
              u-boot,dm-pre-reloc;
+
+             gmac:  ethernet at e0220000 {
Quoted 8 lines

arch/arm/dts/s700-u-boot.dtsi line 15

Quoted 5 lines
arch/arm/dts/s700-u-boot.dtsi +5 -0
+                     compatible = "actions,s700-ethernet";
+                     reg = <0 0xe0220000 0 0x2000>;
+                     interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
+                     interrupt-names = "macirq";
+                     local-mac-address = [ 00 18 fe 66 66 66 ];

Is there another solution to that? Maybe put that in the environment instead? Or generate this randomly or ideally by hashing some serial number?

Yeah, I tried having "CONFIG_NET_RANDOM_ETHADDR" other day which seems to work(would double check it).

But is there a reason not to use "local-mac-address", since driver does not support parsing this
property ?

Thanks
-Amit.

#20 lore raw

PATCH 5/7 arm: dts: s700: add node for ethernet controller

Quoted 11 lines · Amit Tomer

Hi,

Quoted 8 lines · Andr? Przywara
Quoted 5 lines · Amit Singh Tomar

This patch adds node for ethernet controller found on Action Semi OWL S700 SoC.

Since, there is no upstream Linux binding exist for S700 ethernet controller, Changes are put in u-boot specific dtsi file.

Quoted 6 lines
Quoted 2 lines

But that should not be the S700 SoC .dtsi, instead the cubieboard .dts file, since you specify the PHY mode in here (which is board specific).

But MAC is present on SoC , so I thought of adding it s700 specific u-boot.dtsi as
it is already hosting few other things .

The MAC is indeed, but not the PHY and the MAC address.
And since this -u-boot.dtsi trick only works once in the chain, you have to move this to the board version of the file.
Doesn't really make any difference looking at the vast number of boards using the S700 ;-)

Quoted 25 lines
Quoted 16 lines
Quoted 16 lines
---
 arch/arm/dts/s700-u-boot.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm/dts/s700-u-boot.dtsi +2 -0
index a527cccc75f2..1b2768272c62 100644
@@ -6,6 +6,19 @@
 /{
      soc {
              u-boot,dm-pre-reloc;
+
+             gmac:  ethernet at e0220000 {
Quoted 8 lines

arch/arm/dts/s700-u-boot.dtsi line 15

Quoted 5 lines
arch/arm/dts/s700-u-boot.dtsi +5 -0
+                     compatible = "actions,s700-ethernet";
+                     reg = <0 0xe0220000 0 0x2000>;
+                     interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
+                     interrupt-names = "macirq";
+                     local-mac-address = [ 00 18 fe 66 66 66 ];

Is there another solution to that? Maybe put that in the environment instead? Or generate this randomly or ideally by hashing some serial number?

Quoted 6 lines

Yeah, I tried having "CONFIG_NET_RANDOM_ETHADDR" other day which seems to work(would double check it).

But is there a reason not to use "local-mac-address", since driver does not support parsing this
property ?

I don't think local-mac-address is meant to be in a .dts file, actually. It's more useful to communicate some MAC address between firmware and bootloaders/kernels. You can use this in your development setup, but this should not be submitted. Otherwise every board on the planet would use the same MAC address.

Cheers,
Andre

#21 lore raw

PATCH 5/7 arm: dts: s700: add node for ethernet controller

In reply to Amit Singh Tomar
Quoted 7 lines · Amit Singh Tomar

This patch adds node for ethernet controller found on Action Semi OWL S700 SoC.

Since, there is no upstream Linux binding exist for S700 ethernet controller, Changes are put in u-boot specific dtsi file.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200707/c69ed77f/attachment.sig>
#22 lore raw

PATCH 6/7 owl: Kconfig: Enable DM eth for OWL platform

In reply to Amit Singh Tomar

This patch selects CONFIG_DM_ETH (ethernet driver is base on DM model) for Action semi owl SoC.

---
 arch/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/Kconfig +1 -0
index 0d463088a2e4..80e07f92febc 100644
@@ -904,6 +904,7 @@ config ARCH_MX5
 config ARCH_OWL
 	bool "Actions Semi OWL SoCs"
 	select DM
+	select DM_ETH
 	select DM_SERIAL
 	select OWL_SERIAL
 	select CLK
Signature · 1 line
2.7.4
#23 lore raw

PATCH 6/7 owl: Kconfig: Enable DM eth for OWL platform

Quoted 4 lines · Amit Singh Tomar

This patch selects CONFIG_DM_ETH (ethernet driver is base on DM model) for Action semi owl SoC.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200707/a5c4720a/attachment.sig>
#24 lore raw

PATCH 7/7 configs: Enable mac and phy configs

In reply to Amit Singh Tomar

This patch adds MAC and PHY related configs (needed for proper ethernet operations) for Action Semi S700 SoC.

---
 configs/cubieboard7_defconfig | 4 ++++
 1 file changed, 4 insertions(+)
configs/cubieboard7_defconfig +4 -0
index 637dc9e9fb79..c82afc340313 100644
@@ -10,3 +10,7 @@ CONFIG_BOOTARGS="console=ttyOWL3,115200n8"
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_PROMPT="U-Boot => "
 CONFIG_DEFAULT_DEVICE_TREE="s700-cubieboard7"
+CONFIG_ETH_DESIGNWARE_S700=y
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_PHY_REALTEK=y
+CONFIG_RTL8201F_PHY_S700_RMII_TIMINGS=y
Signature · 1 line
2.7.4
#25 lore raw

PATCH 7/7 configs: Enable mac and phy configs

Quoted 4 lines · Amit Singh Tomar

This patch adds MAC and PHY related configs (needed for proper ethernet operations) for Action Semi S700 SoC.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200707/9874418e/attachment.sig>