Linux-Amlogic Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/5] arm64: dts: meson: g12a: add network support
@ 2019-05-10 16:49 Jerome Brunet
  2019-05-10 16:49 ` [PATCH 1/5] arm64: dts: meson: g12a: add ethernet mac controller Jerome Brunet
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Jerome Brunet @ 2019-05-10 16:49 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-amlogic, devicetree, linux-kernel, Jerome Brunet

Add network support for the g12a

Jerome Brunet (5):
  arm64: dts: meson: g12a: add ethernet mac controller
  arm64: dts: meson: g12a: add ethernet pinctrl definitions
  arm64: dts: meson: g12a: add mdio multiplexer
  arm64: dts: meson: u200: add internal network
  arm64: dts: meson: sei510: add network support

 .../boot/dts/amlogic/meson-g12a-sei510.dts    |  7 ++
 .../boot/dts/amlogic/meson-g12a-u200.dts      |  7 ++
 arch/arm64/boot/dts/amlogic/meson-g12a.dtsi   | 90 +++++++++++++++++++
 3 files changed, 104 insertions(+)

-- 
2.20.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 1/5] arm64: dts: meson: g12a: add ethernet mac controller
  2019-05-10 16:49 [PATCH 0/5] arm64: dts: meson: g12a: add network support Jerome Brunet
@ 2019-05-10 16:49 ` Jerome Brunet
  2019-05-10 16:49 ` [PATCH 2/5] arm64: dts: meson: g12a: add ethernet pinctrl definitions Jerome Brunet
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 17+ messages in thread
From: Jerome Brunet @ 2019-05-10 16:49 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-amlogic, devicetree, linux-kernel, Jerome Brunet

Add the synopsys ethernet mac controller embedded in the g12a SoC family.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-g12a.dtsi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
index 2f4f4dd54cba..a32db09809f7 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
@@ -102,6 +102,27 @@
 		#size-cells = <2>;
 		ranges;
 
+		ethmac: ethernet@ff3f0000 {
+			compatible = "amlogic,meson-axg-dwmac",
+				     "snps,dwmac-3.70a",
+				     "snps,dwmac";
+			reg = <0x0 0xff3f0000 0x0 0x10000
+			       0x0 0xff634540 0x0 0x8>;
+			interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "macirq";
+			clocks = <&clkc CLKID_ETH>,
+				 <&clkc CLKID_FCLK_DIV2>,
+				 <&clkc CLKID_MPLL2>;
+			clock-names = "stmmaceth", "clkin0", "clkin1";
+			status = "disabled";
+
+			mdio0: mdio {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				compatible = "snps,dwmac-mdio";
+			};
+		};
+
 		apb: bus@ff600000 {
 			compatible = "simple-bus";
 			reg = <0x0 0xff600000 0x0 0x200000>;
-- 
2.20.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 2/5] arm64: dts: meson: g12a: add ethernet pinctrl definitions
  2019-05-10 16:49 [PATCH 0/5] arm64: dts: meson: g12a: add network support Jerome Brunet
  2019-05-10 16:49 ` [PATCH 1/5] arm64: dts: meson: g12a: add ethernet mac controller Jerome Brunet
@ 2019-05-10 16:49 ` Jerome Brunet
  2019-05-11 17:06   ` Martin Blumenstingl
  2019-05-10 16:49 ` [PATCH 3/5] arm64: dts: meson: g12a: add mdio multiplexer Jerome Brunet
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Jerome Brunet @ 2019-05-10 16:49 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-amlogic, devicetree, linux-kernel, Jerome Brunet

Add the ethernet pinctrl settings for RMII, RGMII and internal phy leds

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-g12a.dtsi | 37 +++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
index a32db09809f7..fe0f73730525 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
@@ -206,6 +206,43 @@
 						};
 					};
 
+					eth_leds_pins: eth-leds {
+						mux {
+							groups = "eth_link_led",
+								 "eth_act_led";
+							function = "eth";
+							bias-disable;
+						};
+					};
+
+					eth_rmii_pins: eth-rmii {
+						mux {
+							groups = "eth_mdio",
+								 "eth_mdc",
+								 "eth_rgmii_rx_clk",
+								 "eth_rx_dv",
+								 "eth_rxd0",
+								 "eth_rxd1",
+								 "eth_txen",
+								 "eth_txd0",
+								 "eth_txd1";
+							function = "eth";
+							bias-disable;
+						};
+					};
+
+					eth_rgmii_pins: eth-rgmii {
+						mux {
+							groups = "eth_rxd2_rgmii",
+								 "eth_rxd3_rgmii",
+								 "eth_rgmii_tx_clk",
+								 "eth_txd2_rgmii",
+								 "eth_txd3_rgmii";
+							function = "eth";
+							bias-disable;
+						};
+					};
+
 					hdmitx_ddc_pins: hdmitx_ddc {
 						mux {
 							groups = "hdmitx_sda",
-- 
2.20.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 3/5] arm64: dts: meson: g12a: add mdio multiplexer
  2019-05-10 16:49 [PATCH 0/5] arm64: dts: meson: g12a: add network support Jerome Brunet
  2019-05-10 16:49 ` [PATCH 1/5] arm64: dts: meson: g12a: add ethernet mac controller Jerome Brunet
  2019-05-10 16:49 ` [PATCH 2/5] arm64: dts: meson: g12a: add ethernet pinctrl definitions Jerome Brunet
@ 2019-05-10 16:49 ` Jerome Brunet
  2019-05-11 16:59   ` Martin Blumenstingl
  2019-05-10 16:49 ` [PATCH 4/5] arm64: dts: meson: u200: add internal network Jerome Brunet
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Jerome Brunet @ 2019-05-10 16:49 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-amlogic, devicetree, linux-kernel, Jerome Brunet

Add the g12a mdio multiplexer which allows to connect to either
an external phy through the SoC pins or the internal 10/100 phy

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-g12a.dtsi | 32 +++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
index fe0f73730525..6e9587aafb5d 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
@@ -460,6 +460,38 @@
 				assigned-clock-rates = <100000000>;
 				#phy-cells = <1>;
 			};
+
+			eth_phy: mdio-multiplexer@4c000 {
+				compatible = "amlogic,g12a-mdio-mux";
+				reg = <0x0 0x4c000 0x0 0xa4>;
+				clocks = <&clkc CLKID_ETH_PHY>,
+					 <&xtal>,
+					 <&clkc CLKID_MPLL_5OM>;
+				clock-names = "pclk", "clkin0", "clkin1";
+				mdio-parent-bus = <&mdio0>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				ext_mdio: mdio@0 {
+					reg = <0>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+				};
+
+				int_mdio: mdio@1 {
+					reg = <1>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					internal_ephy: ethernet_phy@8 {
+						compatible = "ethernet-phy-id0180.3301",
+							     "ethernet-phy-ieee802.3-c22";
+						interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
+						reg = <8>;
+						max-speed = <100>;
+					};
+				};
+			};
 		};
 
 		aobus: bus@ff800000 {
-- 
2.20.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 4/5] arm64: dts: meson: u200: add internal network
  2019-05-10 16:49 [PATCH 0/5] arm64: dts: meson: g12a: add network support Jerome Brunet
                   ` (2 preceding siblings ...)
  2019-05-10 16:49 ` [PATCH 3/5] arm64: dts: meson: g12a: add mdio multiplexer Jerome Brunet
@ 2019-05-10 16:49 ` Jerome Brunet
  2019-05-10 16:49 ` [PATCH 5/5] arm64: dts: meson: sei510: add network support Jerome Brunet
  2019-05-10 16:52 ` [PATCH 0/5] arm64: dts: meson: g12a: " Jerome Brunet
  5 siblings, 0 replies; 17+ messages in thread
From: Jerome Brunet @ 2019-05-10 16:49 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-amlogic, devicetree, linux-kernel, Jerome Brunet

The u200 is the main mother board for the S905D2. It can provide
both the internal and external network. However, by default the
resistance required for the external RGMII bus are not fitted, so
enable the internal PHY.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts
index 7cc3e2d6a4f1..c2221eb4549e 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts
@@ -15,6 +15,7 @@
 
 	aliases {
 		serial0 = &uart_AO;
+		ethernet0 = &ethmac;
 	};
 
 	chosen {
@@ -145,6 +146,12 @@
 	};
 };
 
+&ethmac {
+	status = "okay";
+	phy-handle = <&internal_ephy>;
+	phy-mode = "rmii";
+};
+
 &hdmi_tx {
 	status = "okay";
 	pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
-- 
2.20.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 5/5] arm64: dts: meson: sei510: add network support
  2019-05-10 16:49 [PATCH 0/5] arm64: dts: meson: g12a: add network support Jerome Brunet
                   ` (3 preceding siblings ...)
  2019-05-10 16:49 ` [PATCH 4/5] arm64: dts: meson: u200: add internal network Jerome Brunet
@ 2019-05-10 16:49 ` Jerome Brunet
  2019-05-10 22:45   ` Kevin Hilman
  2019-05-10 16:52 ` [PATCH 0/5] arm64: dts: meson: g12a: " Jerome Brunet
  5 siblings, 1 reply; 17+ messages in thread
From: Jerome Brunet @ 2019-05-10 16:49 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-amlogic, devicetree, linux-kernel, Jerome Brunet

Enable the network interface of the SEI510 which use the internal PHY.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts
index 61fb30047d7f..4a785b17c1af 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts
@@ -29,6 +29,7 @@
 
 	aliases {
 		serial0 = &uart_AO;
+		ethernet0 = &ethmac;
 	};
 
 	chosen {
@@ -144,6 +145,12 @@
 	};
 };
 
+&ethmac {
+	status = "okay";
+	phy-handle = <&internal_ephy>;
+	phy-mode = "rmii";
+};
+
 &hdmi_tx {
 	status = "okay";
 	pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
-- 
2.20.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 0/5] arm64: dts: meson: g12a: add network support
  2019-05-10 16:49 [PATCH 0/5] arm64: dts: meson: g12a: add network support Jerome Brunet
                   ` (4 preceding siblings ...)
  2019-05-10 16:49 ` [PATCH 5/5] arm64: dts: meson: sei510: add network support Jerome Brunet
@ 2019-05-10 16:52 ` " Jerome Brunet
  5 siblings, 0 replies; 17+ messages in thread
From: Jerome Brunet @ 2019-05-10 16:52 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-amlogic, linux-kernel, devicetree

On Fri, 2019-05-10 at 18:49 +0200, Jerome Brunet wrote:
> Add network support for the g12a

I forgot to mention that series applies on top of the node
re-order series [0]

[0]: https://lkml.kernel.org/r/20190510155327.5759-1-jbrunet@baylibre.com

> 
> Jerome Brunet (5):
>   arm64: dts: meson: g12a: add ethernet mac controller
>   arm64: dts: meson: g12a: add ethernet pinctrl definitions
>   arm64: dts: meson: g12a: add mdio multiplexer
>   arm64: dts: meson: u200: add internal network
>   arm64: dts: meson: sei510: add network support
> 
>  .../boot/dts/amlogic/meson-g12a-sei510.dts    |  7 ++
>  .../boot/dts/amlogic/meson-g12a-u200.dts      |  7 ++
>  arch/arm64/boot/dts/amlogic/meson-g12a.dtsi   | 90 +++++++++++++++++++
>  3 files changed, 104 insertions(+)
> 



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 5/5] arm64: dts: meson: sei510: add network support
  2019-05-10 16:49 ` [PATCH 5/5] arm64: dts: meson: sei510: add network support Jerome Brunet
@ 2019-05-10 22:45   ` Kevin Hilman
  2019-05-11 15:46     ` Jerome Brunet
  2019-05-11 17:16     ` Martin Blumenstingl
  0 siblings, 2 replies; 17+ messages in thread
From: Kevin Hilman @ 2019-05-10 22:45 UTC (permalink / raw)
  To: Jerome Brunet; +Cc: linux-amlogic, devicetree, linux-kernel, Jerome Brunet

Jerome Brunet <jbrunet@baylibre.com> writes:

> Enable the network interface of the SEI510 which use the internal PHY.
>
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>

I tried testing this series on SEI510, but I must still be missing some
defconfig options, as the default defconfig doesn't lead to a working
interface.


I tried adding this kconfig fragment[1], and the dwmac probes/inits but
I must still be missing something, as the dwmac is still failing to find
a PHY.  Boot log: https://termbin.com/ivf3

I have the same result testing on the u200.

Kevin

[1] amlogic network kconfig fragment
CONFIG_STMMAC_ETH=y

# following are needed, but automatically enabled if above is set
#CONFIG_STMMAC_PLATFORM=m
#CONFIG_DWMAC_MESON=m

CONFIG_PHYLIB=y
CONFIG_MICREL_PHY=y
CONFIG_REALTEK_PHY=y

CONFIG_MDIO_BUS_MUX_MESON_G12A=y
CONFIG_MESON_GXL_PHY=y

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 5/5] arm64: dts: meson: sei510: add network support
  2019-05-10 22:45   ` Kevin Hilman
@ 2019-05-11 15:46     ` Jerome Brunet
  2019-05-13 16:31       ` Kevin Hilman
  2019-05-11 17:16     ` Martin Blumenstingl
  1 sibling, 1 reply; 17+ messages in thread
From: Jerome Brunet @ 2019-05-11 15:46 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-amlogic, linux-kernel, devicetree

On Fri, 2019-05-10 at 15:45 -0700, Kevin Hilman wrote:
> Jerome Brunet <jbrunet@baylibre.com> writes:
> 
> > Enable the network interface of the SEI510 which use the internal PHY.
> > 
> > Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> 
> I tried testing this series on SEI510, but I must still be missing some
> defconfig options, as the default defconfig doesn't lead to a working
> interface.

That's weird. AFAICT, the net part has hit Linus's tree.
You should have everything needed by default, the mdio mux has

> default m if ARCH_MESON

> 
> 
> I tried adding this kconfig fragment[1], and the dwmac probes/inits but
> I must still be missing something, as the dwmac is still failing to find
> a PHY.  Boot log: https://termbin.com/ivf3
> 
> I have the same result testing on the u200.

I don't any other patch pending for the network of the g12a.
Maybe I've done something wrong while rebasing. I'll check on monday.

> 
> Kevin
> 
> [1] amlogic network kconfig fragment
> CONFIG_STMMAC_ETH=y
> 
> # following are needed, but automatically enabled if above is set
> #CONFIG_STMMAC_PLATFORM=m
> #CONFIG_DWMAC_MESON=m
> 
> CONFIG_PHYLIB=y
> CONFIG_MICREL_PHY=y
> CONFIG_REALTEK_PHY=y
> 
> CONFIG_MDIO_BUS_MUX_MESON_G12A=y
> CONFIG_MESON_GXL_PHY=y



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/5] arm64: dts: meson: g12a: add mdio multiplexer
  2019-05-10 16:49 ` [PATCH 3/5] arm64: dts: meson: g12a: add mdio multiplexer Jerome Brunet
@ 2019-05-11 16:59   ` Martin Blumenstingl
  2019-05-11 17:30     ` Jerome Brunet
  0 siblings, 1 reply; 17+ messages in thread
From: Martin Blumenstingl @ 2019-05-11 16:59 UTC (permalink / raw)
  To: Jerome Brunet; +Cc: Kevin Hilman, devicetree, linux-kernel, linux-amlogic

Hi Jerome,

On Fri, May 10, 2019 at 6:49 PM Jerome Brunet <jbrunet@baylibre.com> wrote:
>
> Add the g12a mdio multiplexer which allows to connect to either
> an external phy through the SoC pins or the internal 10/100 phy
>
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  arch/arm64/boot/dts/amlogic/meson-g12a.dtsi | 32 +++++++++++++++++++++
>  1 file changed, 32 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
> index fe0f73730525..6e9587aafb5d 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
> @@ -460,6 +460,38 @@
>                                 assigned-clock-rates = <100000000>;
>                                 #phy-cells = <1>;
>                         };
> +
> +                       eth_phy: mdio-multiplexer@4c000 {
> +                               compatible = "amlogic,g12a-mdio-mux";
> +                               reg = <0x0 0x4c000 0x0 0xa4>;
> +                               clocks = <&clkc CLKID_ETH_PHY>,
> +                                        <&xtal>,
> +                                        <&clkc CLKID_MPLL_5OM>;
I haven't noticed that before but there's a typo in the MPLL_5OM clock
definition:
the O (capital o) should be a 0 (zero).
can you fix this typo in an additional clock patch for v5.2 - then we
don't have to do it in v5.3 where this .dtsi might already use it

> +                               clock-names = "pclk", "clkin0", "clkin1";
> +                               mdio-parent-bus = <&mdio0>;
> +                               #address-cells = <1>;
> +                               #size-cells = <0>;
> +
> +                               ext_mdio: mdio@0 {
> +                                       reg = <0>;
> +                                       #address-cells = <1>;
> +                                       #size-cells = <0>;
> +                               };
> +
> +                               int_mdio: mdio@1 {
> +                                       reg = <1>;
> +                                       #address-cells = <1>;
> +                                       #size-cells = <0>;
> +
> +                                       internal_ephy: ethernet_phy@8 {
> +                                               compatible = "ethernet-phy-id0180.3301",
> +                                                            "ethernet-phy-ieee802.3-c22";
please drop the compatible string and replace it with a comment (if
you feel that it's needed).
quote from Documentation/devicetree/bindings/net/phy.txt:
> If the PHY reports an incorrect ID (or none at all) then the
> "compatible" list may contain an entry with the correct PHY ID in the
> form: "ethernet-phy-idAAAA.BBBB"

I am going to send a patch for other Amlogic boards to remove any
ethernet-phy-id comaptible string


Regards
Martin

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/5] arm64: dts: meson: g12a: add ethernet pinctrl definitions
  2019-05-10 16:49 ` [PATCH 2/5] arm64: dts: meson: g12a: add ethernet pinctrl definitions Jerome Brunet
@ 2019-05-11 17:06   ` Martin Blumenstingl
  2019-05-11 17:27     ` Jerome Brunet
  0 siblings, 1 reply; 17+ messages in thread
From: Martin Blumenstingl @ 2019-05-11 17:06 UTC (permalink / raw)
  To: Jerome Brunet; +Cc: Kevin Hilman, devicetree, linux-kernel, linux-amlogic

Hi Jerome,

On Fri, May 10, 2019 at 6:49 PM Jerome Brunet <jbrunet@baylibre.com> wrote:
>
> Add the ethernet pinctrl settings for RMII, RGMII and internal phy leds
>
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  arch/arm64/boot/dts/amlogic/meson-g12a.dtsi | 37 +++++++++++++++++++++
>  1 file changed, 37 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
> index a32db09809f7..fe0f73730525 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
> @@ -206,6 +206,43 @@
>                                                 };
>                                         };
>
> +                                       eth_leds_pins: eth-leds {
> +                                               mux {
> +                                                       groups = "eth_link_led",
> +                                                                "eth_act_led";
> +                                                       function = "eth";
> +                                                       bias-disable;
> +                                               };
> +                                       };
> +
> +                                       eth_rmii_pins: eth-rmii {
> +                                               mux {
> +                                                       groups = "eth_mdio",
> +                                                                "eth_mdc",
> +                                                                "eth_rgmii_rx_clk",
> +                                                                "eth_rx_dv",
> +                                                                "eth_rxd0",
> +                                                                "eth_rxd1",
> +                                                                "eth_txen",
> +                                                                "eth_txd0",
> +                                                                "eth_txd1";
> +                                                       function = "eth";
> +                                                       bias-disable;
> +                                               };
> +                                       };
> +
> +                                       eth_rgmii_pins: eth-rgmii {
> +                                               mux {
> +                                                       groups = "eth_rxd2_rgmii",
> +                                                                "eth_rxd3_rgmii",
> +                                                                "eth_rgmii_tx_clk",
> +                                                                "eth_txd2_rgmii",
> +                                                                "eth_txd3_rgmii";
> +                                                       function = "eth";
> +                                                       bias-disable;
> +                                               };
> +                                       };
it seems that the group definition is incomplete (missing things like
eth_mdc, eth_rx_dv, ...)

we could also mix the eth_rmii_pins and eth_rgmii_pins in a board.dts
(maybe that was your idea in the first place?):
  phy-mode = "rgmii";
  pinctrl-0 = <&eth_rmii_pins>, <&eth_rgmii_pins>;
  pinctrl-names = "default";
however, in this case I would prefer if "eth_rmii_pins" was named only
"eth_pins" (following mostly what Amlogic does with the pin group
naming: eth_* for pins that are valid in both, rmii and rgmii mode and
eth*rgmii* for pins that are only valid in rgmii mode)


Regards
Martin

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 5/5] arm64: dts: meson: sei510: add network support
  2019-05-10 22:45   ` Kevin Hilman
  2019-05-11 15:46     ` Jerome Brunet
@ 2019-05-11 17:16     ` Martin Blumenstingl
  2019-05-11 17:25       ` Jerome Brunet
  1 sibling, 1 reply; 17+ messages in thread
From: Martin Blumenstingl @ 2019-05-11 17:16 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-amlogic, devicetree, linux-kernel, Jerome Brunet

Hi Kevin,

On Sat, May 11, 2019 at 12:45 AM Kevin Hilman <khilman@baylibre.com> wrote:
>
> Jerome Brunet <jbrunet@baylibre.com> writes:
>
> > Enable the network interface of the SEI510 which use the internal PHY.
> >
> > Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
>
> I tried testing this series on SEI510, but I must still be missing some
> defconfig options, as the default defconfig doesn't lead to a working
> interface.
>
>
> I tried adding this kconfig fragment[1], and the dwmac probes/inits but
> I must still be missing something, as the dwmac is still failing to find
> a PHY.  Boot log: https://termbin.com/ivf3
>
> I have the same result testing on the u200.
I wonder if we're simply missing the pinctrl definitions in the ethmac node:
  pinctrl-0 = <&eth_rmii_pins>;
  pinctrl-names = "default";

I don't know how the SoC works internally but I am assuming that the
MDIO pins are routed to the "internal PHY" (within the chip).
also we need the eth_rmii_pins anyways for the RXD/TXD pins which are
connected to the physical Ethernet port on the board.
bonus question: while writing this email I'm surprised to see that on
GXL we don't use the rmii pins anywhere, why is Ethernet working fine
there?


Martin

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 5/5] arm64: dts: meson: sei510: add network support
  2019-05-11 17:16     ` Martin Blumenstingl
@ 2019-05-11 17:25       ` Jerome Brunet
  0 siblings, 0 replies; 17+ messages in thread
From: Jerome Brunet @ 2019-05-11 17:25 UTC (permalink / raw)
  To: Martin Blumenstingl, Kevin Hilman; +Cc: linux-amlogic, linux-kernel, devicetree

On Sat, 2019-05-11 at 19:16 +0200, Martin Blumenstingl wrote:
> Hi Kevin,
> 
> On Sat, May 11, 2019 at 12:45 AM Kevin Hilman <khilman@baylibre.com> wrote:
> > Jerome Brunet <jbrunet@baylibre.com> writes:
> > 
> > > Enable the network interface of the SEI510 which use the internal PHY.
> > > 
> > > Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> > 
> > I tried testing this series on SEI510, but I must still be missing some
> > defconfig options, as the default defconfig doesn't lead to a working
> > interface.
> > 
> > 
> > I tried adding this kconfig fragment[1], and the dwmac probes/inits but
> > I must still be missing something, as the dwmac is still failing to find
> > a PHY.  Boot log: https://termbin.com/ivf3
> > 
> > I have the same result testing on the u200.
> I wonder if we're simply missing the pinctrl definitions in the ethmac node:
>   pinctrl-0 = <&eth_rmii_pins>;
>   pinctrl-names = "default";
> 
> I don't know how the SoC works internally but I am assuming that the
> MDIO pins are routed to the "internal PHY" (within the chip).
> also we need the eth_rmii_pins anyways for the RXD/TXD pins which are
> connected to the physical Ethernet port on the board.
> bonus question: while writing this email I'm surprised to see that on
> GXL we don't use the rmii pins anywhere, why is Ethernet working fine
> there?

AFAIK, the pinmux is for the external pad Martin
The internal phy does not use those pads.

> 
> 
> Martin



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/5] arm64: dts: meson: g12a: add ethernet pinctrl definitions
  2019-05-11 17:06   ` Martin Blumenstingl
@ 2019-05-11 17:27     ` Jerome Brunet
  2019-05-15  0:10       ` Kevin Hilman
  0 siblings, 1 reply; 17+ messages in thread
From: Jerome Brunet @ 2019-05-11 17:27 UTC (permalink / raw)
  To: Martin Blumenstingl; +Cc: Kevin Hilman, devicetree, linux-kernel, linux-amlogic

On Sat, 2019-05-11 at 19:06 +0200, Martin Blumenstingl wrote:
> Hi Jerome,
> 
> On Fri, May 10, 2019 at 6:49 PM Jerome Brunet <jbrunet@baylibre.com> wrote:
> > Add the ethernet pinctrl settings for RMII, RGMII and internal phy leds
> > 
> > Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> > ---
> >  arch/arm64/boot/dts/amlogic/meson-g12a.dtsi | 37 +++++++++++++++++++++
> >  1 file changed, 37 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
> > index a32db09809f7..fe0f73730525 100644
> > --- a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
> > +++ b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
> > @@ -206,6 +206,43 @@
> >                                                 };
> >                                         };
> > 
> > +                                       eth_leds_pins: eth-leds {
> > +                                               mux {
> > +                                                       groups = "eth_link_led",
> > +                                                                "eth_act_led";
> > +                                                       function = "eth";
> > +                                                       bias-disable;
> > +                                               };
> > +                                       };
> > +
> > +                                       eth_rmii_pins: eth-rmii {
> > +                                               mux {
> > +                                                       groups = "eth_mdio",
> > +                                                                "eth_mdc",
> > +                                                                "eth_rgmii_rx_clk",
> > +                                                                "eth_rx_dv",
> > +                                                                "eth_rxd0",
> > +                                                                "eth_rxd1",
> > +                                                                "eth_txen",
> > +                                                                "eth_txd0",
> > +                                                                "eth_txd1";
> > +                                                       function = "eth";
> > +                                                       bias-disable;
> > +                                               };
> > +                                       };
> > +
> > +                                       eth_rgmii_pins: eth-rgmii {
> > +                                               mux {
> > +                                                       groups = "eth_rxd2_rgmii",
> > +                                                                "eth_rxd3_rgmii",
> > +                                                                "eth_rgmii_tx_clk",
> > +                                                                "eth_txd2_rgmii",
> > +                                                                "eth_txd3_rgmii";
> > +                                                       function = "eth";
> > +                                                       bias-disable;
> > +                                               };
> > +                                       };
> it seems that the group definition is incomplete (missing things like
> eth_mdc, eth_rx_dv, ...)
> 
> we could also mix the eth_rmii_pins and eth_rgmii_pins in a board.dts
> (maybe that was your idea in the first place?):

yes that's the idea

>   phy-mode = "rgmii";
>   pinctrl-0 = <&eth_rmii_pins>, <&eth_rgmii_pins>;
>   pinctrl-names = "default";
> however, in this case I would prefer if "eth_rmii_pins" was named only
> "eth_pins" (following mostly what Amlogic does with the pin group
> naming: eth_* for pins that are valid in both, rmii and rgmii mode and
> eth*rgmii* for pins that are only valid in rgmii mode)

I can't say I share your preference. I let Kevin decide what he wants.

> 
> 
> Regards
> Martin



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/5] arm64: dts: meson: g12a: add mdio multiplexer
  2019-05-11 16:59   ` Martin Blumenstingl
@ 2019-05-11 17:30     ` Jerome Brunet
  0 siblings, 0 replies; 17+ messages in thread
From: Jerome Brunet @ 2019-05-11 17:30 UTC (permalink / raw)
  To: Martin Blumenstingl; +Cc: Kevin Hilman, devicetree, linux-kernel, linux-amlogic

On Sat, 2019-05-11 at 18:59 +0200, Martin Blumenstingl wrote:
> Hi Jerome,
> 
> On Fri, May 10, 2019 at 6:49 PM Jerome Brunet <jbrunet@baylibre.com> wrote:
> > Add the g12a mdio multiplexer which allows to connect to either
> > an external phy through the SoC pins or the internal 10/100 phy
> > 
> > Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> > ---
> >  arch/arm64/boot/dts/amlogic/meson-g12a.dtsi | 32 +++++++++++++++++++++
> >  1 file changed, 32 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
> > index fe0f73730525..6e9587aafb5d 100644
> > --- a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
> > +++ b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
> > @@ -460,6 +460,38 @@
> >                                 assigned-clock-rates = <100000000>;
> >                                 #phy-cells = <1>;
> >                         };
> > +
> > +                       eth_phy: mdio-multiplexer@4c000 {
> > +                               compatible = "amlogic,g12a-mdio-mux";
> > +                               reg = <0x0 0x4c000 0x0 0xa4>;
> > +                               clocks = <&clkc CLKID_ETH_PHY>,
> > +                                        <&xtal>,
> > +                                        <&clkc CLKID_MPLL_5OM>;
> I haven't noticed that before but there's a typo in the MPLL_5OM clock
> definition:
> the O (capital o) should be a 0 (zero).
> can you fix this typo in an additional clock patch for v5.2 - then we
> don't have to do it in v5.3 where this .dtsi might already use it
> 
> > +                               clock-names = "pclk", "clkin0", "clkin1";
> > +                               mdio-parent-bus = <&mdio0>;
> > +                               #address-cells = <1>;
> > +                               #size-cells = <0>;
> > +
> > +                               ext_mdio: mdio@0 {
> > +                                       reg = <0>;
> > +                                       #address-cells = <1>;
> > +                                       #size-cells = <0>;
> > +                               };
> > +
> > +                               int_mdio: mdio@1 {
> > +                                       reg = <1>;
> > +                                       #address-cells = <1>;
> > +                                       #size-cells = <0>;
> > +
> > +                                       internal_ephy: ethernet_phy@8 {
> > +                                               compatible = "ethernet-phy-id0180.3301",
> > +                                                            "ethernet-phy-ieee802.3-c22";
> please drop the compatible string and replace it with a comment (if
> you feel that it's needed).
> quote from Documentation/devicetree/bindings/net/phy.txt:
> > If the PHY reports an incorrect ID (or none at all) then the
> > "compatible" list may contain an entry with the correct PHY ID in the
> > form: "ethernet-phy-idAAAA.BBBB"

I would keep this for the internal phy. The id completely made up by the MDIO mux, so it
is a lot weaker than the usual PHY.

The fact is that I made a mistake (which I'm going to correct) in the g12a mdio mux and
the id is incorrect. Thanks to this, we know the PHY the correct internal phy driver
is picked up.

> 
> I am going to send a patch for other Amlogic boards to remove any
> ethernet-phy-id comaptible string

Make sense for the external phys but I think it is wiser to keep it for the internal ones.

For external phys, A manufacturer could replace the device w/o any notice, so we should
rely on the id to pick it up correctly. For a the PHY embedded in the SoC, we which one it
is and it can't change (w/o notice at least)

> 
> 
> Regards
> Martin



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 5/5] arm64: dts: meson: sei510: add network support
  2019-05-11 15:46     ` Jerome Brunet
@ 2019-05-13 16:31       ` Kevin Hilman
  0 siblings, 0 replies; 17+ messages in thread
From: Kevin Hilman @ 2019-05-13 16:31 UTC (permalink / raw)
  To: Jerome Brunet; +Cc: linux-amlogic, linux-kernel, devicetree

Jerome Brunet <jbrunet@baylibre.com> writes:

> On Fri, 2019-05-10 at 15:45 -0700, Kevin Hilman wrote:
>> Jerome Brunet <jbrunet@baylibre.com> writes:
>> 
>> > Enable the network interface of the SEI510 which use the internal PHY.
>> > 
>> > Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
>> 
>> I tried testing this series on SEI510, but I must still be missing some
>> defconfig options, as the default defconfig doesn't lead to a working
>> interface.
>
> That's weird. AFAICT, the net part has hit Linus's tree.

Ah, that's the key ingredient.  I was testing with a v5.1 baseline (not
linus/master) along with all my queued up changes.  I just pulled in
linus/master to test this series, and indeed, everything works, and I
don't need my config fragment either.

Thanks for clarifying.

If repost needed, feel free to add

Tested-by: Kevin Hilman <khilman@baylibre.com>

Kevin

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/5] arm64: dts: meson: g12a: add ethernet pinctrl definitions
  2019-05-11 17:27     ` Jerome Brunet
@ 2019-05-15  0:10       ` Kevin Hilman
  0 siblings, 0 replies; 17+ messages in thread
From: Kevin Hilman @ 2019-05-15  0:10 UTC (permalink / raw)
  To: Jerome Brunet, Martin Blumenstingl
  Cc: linux-amlogic, linux-kernel, devicetree

Jerome Brunet <jbrunet@baylibre.com> writes:

> On Sat, 2019-05-11 at 19:06 +0200, Martin Blumenstingl wrote:
>> Hi Jerome,
>> 
>> On Fri, May 10, 2019 at 6:49 PM Jerome Brunet <jbrunet@baylibre.com> wrote:
>> > Add the ethernet pinctrl settings for RMII, RGMII and internal phy leds
>> > 
>> > Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
>> > ---
>> >  arch/arm64/boot/dts/amlogic/meson-g12a.dtsi | 37 +++++++++++++++++++++
>> >  1 file changed, 37 insertions(+)
>> > 
>> > diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
>> > index a32db09809f7..fe0f73730525 100644
>> > --- a/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
>> > +++ b/arch/arm64/boot/dts/amlogic/meson-g12a.dtsi
>> > @@ -206,6 +206,43 @@
>> >                                                 };
>> >                                         };
>> > 
>> > +                                       eth_leds_pins: eth-leds {
>> > +                                               mux {
>> > +                                                       groups = "eth_link_led",
>> > +                                                                "eth_act_led";
>> > +                                                       function = "eth";
>> > +                                                       bias-disable;
>> > +                                               };
>> > +                                       };
>> > +
>> > +                                       eth_rmii_pins: eth-rmii {
>> > +                                               mux {
>> > +                                                       groups = "eth_mdio",
>> > +                                                                "eth_mdc",
>> > +                                                                "eth_rgmii_rx_clk",
>> > +                                                                "eth_rx_dv",
>> > +                                                                "eth_rxd0",
>> > +                                                                "eth_rxd1",
>> > +                                                                "eth_txen",
>> > +                                                                "eth_txd0",
>> > +                                                                "eth_txd1";
>> > +                                                       function = "eth";
>> > +                                                       bias-disable;
>> > +                                               };
>> > +                                       };
>> > +
>> > +                                       eth_rgmii_pins: eth-rgmii {
>> > +                                               mux {
>> > +                                                       groups = "eth_rxd2_rgmii",
>> > +                                                                "eth_rxd3_rgmii",
>> > +                                                                "eth_rgmii_tx_clk",
>> > +                                                                "eth_txd2_rgmii",
>> > +                                                                "eth_txd3_rgmii";
>> > +                                                       function = "eth";
>> > +                                                       bias-disable;
>> > +                                               };
>> > +                                       };
>> it seems that the group definition is incomplete (missing things like
>> eth_mdc, eth_rx_dv, ...)
>> 
>> we could also mix the eth_rmii_pins and eth_rgmii_pins in a board.dts
>> (maybe that was your idea in the first place?):
>
> yes that's the idea
>
>>   phy-mode = "rgmii";
>>   pinctrl-0 = <&eth_rmii_pins>, <&eth_rgmii_pins>;
>>   pinctrl-names = "default";
>> however, in this case I would prefer if "eth_rmii_pins" was named only
>> "eth_pins" (following mostly what Amlogic does with the pin group
>> naming: eth_* for pins that are valid in both, rmii and rgmii mode and
>> eth*rgmii* for pins that are only valid in rgmii mode)
>
> I can't say I share your preference. I let Kevin decide what he wants.
>
It seems we've gone the eth_pins route for meson-gxl.dtsi, so I'd prefer
to be consistent with that.

Kevin

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, back to index

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-10 16:49 [PATCH 0/5] arm64: dts: meson: g12a: add network support Jerome Brunet
2019-05-10 16:49 ` [PATCH 1/5] arm64: dts: meson: g12a: add ethernet mac controller Jerome Brunet
2019-05-10 16:49 ` [PATCH 2/5] arm64: dts: meson: g12a: add ethernet pinctrl definitions Jerome Brunet
2019-05-11 17:06   ` Martin Blumenstingl
2019-05-11 17:27     ` Jerome Brunet
2019-05-15  0:10       ` Kevin Hilman
2019-05-10 16:49 ` [PATCH 3/5] arm64: dts: meson: g12a: add mdio multiplexer Jerome Brunet
2019-05-11 16:59   ` Martin Blumenstingl
2019-05-11 17:30     ` Jerome Brunet
2019-05-10 16:49 ` [PATCH 4/5] arm64: dts: meson: u200: add internal network Jerome Brunet
2019-05-10 16:49 ` [PATCH 5/5] arm64: dts: meson: sei510: add network support Jerome Brunet
2019-05-10 22:45   ` Kevin Hilman
2019-05-11 15:46     ` Jerome Brunet
2019-05-13 16:31       ` Kevin Hilman
2019-05-11 17:16     ` Martin Blumenstingl
2019-05-11 17:25       ` Jerome Brunet
2019-05-10 16:52 ` [PATCH 0/5] arm64: dts: meson: g12a: " Jerome Brunet

Linux-Amlogic Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-amlogic/0 linux-amlogic/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-amlogic linux-amlogic/ https://lore.kernel.org/linux-amlogic \
		linux-amlogic@lists.infradead.org linux-amlogic@archiver.kernel.org
	public-inbox-index linux-amlogic


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-amlogic


AGPL code for this site: git clone https://public-inbox.org/ public-inbox