Skip to contentSkip to conversation

Add support for Orange Pi 3

PATCH Superseded [email protected] 3 participants 15 messages Jun 20, 2019 – Jun 24, 2019

Subsystems (10)

v7 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v7 cover Add support for Orange Pi 3

From: Ondrej Jirman <megous-5qf/[email protected]>

This series implements support for Xunlong Orange Pi 3 board.

- ethernet support (patches 1-3)
- HDMI support (patches 4-6)

For some people, ethernet doesn't work after reboot (but works on cold boot), when the stmmac driver is built into the kernel. It works when the driver is built as a module. It's either some timing issue, or power supply issue or a combination of both. Module build induces a power cycling of the phy.

I encourage people with this issue, to build the driver into the kernel, and try to alter the reset timings for the phy in DTS or startup-delay-us and report the findings.

Please take a look.

thank you and regards,
Ondrej Jirman

Changes in v7:
- dropped stored reference to connector_pdev as suggested by Jernej
- added forgotten dt-bindings reviewed-by tag

Changes in v6:
- added dt-bindings reviewed-by tag
- fix wording in stmmac commit (as suggested by Sergei)

Changes in v5:
- dropped already applied patches (pinctrl patches, mmc1 pinconf patch)
- rename GMAC-3V3 -> GMAC-3V to match the schematic (Jagan)
- changed hdmi-connector's ddc-supply property to ddc-en-gpios (Rob Herring)

Changes in v4:
- fix checkpatch warnings/style issues
- use enum in struct sunxi_desc_function for io_bias_cfg_variant
- collected acked-by's
- fix compile error in drivers/pinctrl/sunxi/pinctrl-sun9i-a80-r.c:156 caused by missing conversion from has_io_bias_cfg struct member (I've kept the acked-by, because it's a trivial change, but feel free to object.) (reported by Martin A. on github)
I did not have A80 pinctrl enabled for some reason, so I did not catch this sooner.
- dropped brcm firmware patch (was already applied)
- dropped the wifi dts patch (will re-send after H6 RTC gets merged, along with bluetooth support, in a separate series)

Changes in v3:
- dropped already applied patches
- changed pinctrl I/O bias selection constants to enum and renamed
- added /omit-if-no-ref/ to mmc1_pins
- made mmc1_pins default pinconf for mmc1 in H6 dtsi
- move ddc-supply to HDMI connector node, updated patch descriptions, changed dt-bindings docs

Changes in v2:
- added dt-bindings documentation for the board's compatible string (suggested by Clement)
- addressed checkpatch warnings and code formatting issues (on Maxime's suggestions)
- stmmac: dropped useless parenthesis, reworded description of the patch (suggested by Sergei)
- drop useles dev_info() about the selected io bias voltage
- docummented io voltage bias selection variant macros
- wifi: marked WiFi DTS patch and realted mmc1_pins as "DO NOT MERGE", because wifi depends on H6 RTC support that's not merged yet (suggested by Clement)
- added missing signed-of-bys
- changed &usb2otg dr_mode to otg, and added a note about VBUS
- improved wording of HDMI driver's DDC power supply patch

Icenowy Zheng (2):
net: stmmac: sun8i: add support for Allwinner H6 EMAC
net: stmmac: sun8i: force select external PHY when no internal one

Ondrej Jirman (4):
arm64: dts: allwinner: orange-pi-3: Enable ethernet
dt-bindings: display: hdmi-connector: Support DDC bus enable
drm: sun4i: Add support for enabling DDC I2C bus to sun8i_dw_hdmi glue
arm64: dts: allwinner: orange-pi-3: Enable HDMI output

 .../display/connector/hdmi-connector.txt      |  1 +
 .../dts/allwinner/sun50i-h6-orangepi-3.dts    | 70 +++++++++++++++++++
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c         | 54 ++++++++++++--
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h         |  2 +
 .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 21 ++++++
 5 files changed, 144 insertions(+), 4 deletions(-)
Signature · 1 line
2.22.0
#1 lore raw

PATCH v7 1/6 net: stmmac: sun8i: add support for Allwinner H6 EMAC

From: Icenowy Zheng <[email protected]>

The EMAC on Allwinner H6 is just like the one on A64. The "internal PHY" on H6 is on a co-packaged AC200 chip, and it's not really internal (it's connected via RMII at PA GPIO bank).

Add support for the Allwinner H6 EMAC in the dwmac-sun8i driver.

---
 .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c    | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +16 -0
index b15c6d5dbd38..c3e94104474f 100644
@@ -138,6 +138,20 @@ static const struct emac_variant emac_variant_a64 = {
 	.tx_delay_max = 7,
 };
 
+static const struct emac_variant emac_variant_h6 = {
+	.default_syscon_value = 0x50000,
+	.syscon_field = &sun8i_syscon_reg_field,
+	/* The "Internal PHY" of H6 is not on the die. It's on the
+	 * co-packaged AC200 chip instead.
+	 */
+	.soc_has_internal_phy = false,
+	.support_mii = true,
+	.support_rmii = true,
+	.support_rgmii = true,
+	.rx_delay_max = 31,
+	.tx_delay_max = 7,
+};
+
 #define EMAC_BASIC_CTL0 0x00
 #define EMAC_BASIC_CTL1 0x04
 #define EMAC_INT_STA    0x08
@@ -1216,6 +1230,8 @@ static const struct of_device_id sun8i_dwmac_match[] = {
 		.data = &emac_variant_r40 },
 	{ .compatible = "allwinner,sun50i-a64-emac",
 		.data = &emac_variant_a64 },
+	{ .compatible = "allwinner,sun50i-h6-emac",
+		.data = &emac_variant_h6 },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, sun8i_dwmac_match);
Signature · 1 line
2.22.0
#2 lore raw

PATCH v7 2/6 net: stmmac: sun8i: force select external PHY when no internal one

In reply to [email protected]

From: Icenowy Zheng <[email protected]>

The PHY selection bit also exists on SoCs without an internal PHY; if it's set to 1 (internal PHY, default value) then the MAC will not make use of any PHY on such SoCs.

This problem appears when adapting for H6, which has no real internal PHY (the "internal PHY" on H6 is not on-die, but on a co-packaged AC200 chip, connected via RMII interface at GPIO bank A).

Force the PHY selection bit to 0 when the SOC doesn't have an internal PHY, to address the problem of a wrong default value.

---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +5 -0
index c3e94104474f..6d5cba4075eb 100644
@@ -898,6 +898,11 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv)
 		 * address. No need to mask it again.
 		 */
 		reg |= 1 << H3_EPHY_ADDR_SHIFT;
+	} else {
+		/* For SoCs without internal PHY the PHY selection bit should be
+		 * set to 0 (external PHY).
+		 */
+		reg &= ~H3_EPHY_SELECT;
 	}
 
 	if (!of_property_read_u32(node, "allwinner,tx-delay-ps", &val)) {
Signature · 1 line
2.22.0
#3 lore raw

PATCH v7 3/6 arm64: dts: allwinner: orange-pi-3: Enable ethernet

In reply to [email protected]

From: Ondrej Jirman <megous-5qf/[email protected]>

Orange Pi 3 has two regulators that power the Realtek RTL8211E. According to the phy datasheet, both regulators need to be enabled at the same time, but we can only specify a single phy-supply in the DT.

This can be achieved by making one regulator depedning on the other via vin-supply. While it's not a technically correct description of the hardware, it achieves the purpose.

All values of RX/TX delay were tested exhaustively and a middle one of the working values was chosen.

---
 .../dts/allwinner/sun50i-h6-orangepi-3.dts    | 44 +++++++++++++++++++
 1 file changed, 44 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts +44 -0
index 17d496990108..2c6807b74ff6 100644
@@ -15,6 +15,7 @@
 
 	aliases {
 		serial0 = &uart0;
+		ethernet0 = &emac;
 	};
 
 	chosen {
@@ -44,6 +45,27 @@
 		regulator-max-microvolt = <5000000>;
 		regulator-always-on;
 	};
+
+	/*
+	 * The board uses 2.5V RGMII signalling. Power sequence to enable
+	 * the phy is to enable GMAC-2V5 and GMAC-3V (aldo2) power rails
+	 * at the same time and to wait 100ms.
+	 */
+	reg_gmac_2v5: gmac-2v5 {
+		compatible = "regulator-fixed";
+		regulator-name = "gmac-2v5";
+		regulator-min-microvolt = <2500000>;
+		regulator-max-microvolt = <2500000>;
+		startup-delay-us = <100000>;
+		enable-active-high;
+		gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
+
+		/* The real parent of gmac-2v5 is reg_vcc5v, but we need to
+		 * enable two regulators to power the phy. This is one way
+		 * to achieve that.
+		 */
+		vin-supply = <&reg_aldo2>; /* GMAC-3V */
+	};
 };
 
 &cpu0 {
@@ -58,6 +80,28 @@
 	status = "okay";
 };
 
+&emac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&ext_rgmii_pins>;
+	phy-mode = "rgmii";
+	phy-handle = <&ext_rgmii_phy>;
+	phy-supply = <&reg_gmac_2v5>;
+	allwinner,rx-delay-ps = <1500>;
+	allwinner,tx-delay-ps = <700>;
+	status = "okay";
+};
+
+&mdio {
+	ext_rgmii_phy: ethernet-phy@1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <1>;
+
+		reset-gpios = <&pio 3 14 GPIO_ACTIVE_LOW>; /* PD14 */
+		reset-assert-us = <15000>;
+		reset-deassert-us = <40000>;
+	};
+};
+
 &mmc0 {
 	vmmc-supply = <&reg_cldo1>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
Signature · 1 line
2.22.0
#4 lore raw

PATCH v7 4/6 dt-bindings: display: hdmi-connector: Support DDC bus enable

In reply to [email protected]

From: Ondrej Jirman <megous-5qf/[email protected]>

Some Allwinner SoC using boards (Orange Pi 3 for example) need to enable on-board voltage shifting logic for the DDC bus using a gpio to be able to access DDC bus. Use ddc-en-gpios property on the hdmi-connector to model this.

Add binding documentation for optional ddc-en-gpios property.

---
 .../devicetree/bindings/display/connector/hdmi-connector.txt     | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/connector/hdmi-connector.txt +1 -0
index 508aee461e0d..aeb07c4bd703 100644
@@ -9,6 +9,7 @@ Optional properties:
 - label: a symbolic name for the connector
 - hpd-gpios: HPD GPIO number
 - ddc-i2c-bus: phandle link to the I2C controller used for DDC EDID probing
+- ddc-en-gpios: signal to enable DDC bus
 
 Required nodes:
 - Video port for HDMI input
Signature · 1 line
2.22.0
#5 lore raw

PATCH v7 5/6 drm: sun4i: Add support for enabling DDC I2C bus to sun8i_dw_hdmi glue

In reply to [email protected]

From: Ondrej Jirman <megous-5qf/[email protected]>

Orange Pi 3 board requires enabling a voltage shifting circuit via GPIO for the DDC bus to be usable.

Add support for hdmi-connector node's optional ddc-en-gpios property to support this use case.

---
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 54 +++++++++++++++++++++++++--
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h |  2 +
 2 files changed, 52 insertions(+), 4 deletions(-)
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +50 -4
index 39d8509d96a0..6733bfc9c2d6 100644
@@ -98,10 +98,34 @@ static u32 sun8i_dw_hdmi_find_possible_crtcs(struct drm_device *drm,
 	return crtcs;
 }
 
+static int sun8i_dw_hdmi_find_connector_pdev(struct device *dev,
+					     struct platform_device **pdev_out)
+{
+	struct platform_device *pdev;
+	struct device_node *remote;
+
+	remote = of_graph_get_remote_node(dev->of_node, 1, -1);
+	if (!remote)
+		return -ENODEV;
+
+	if (!of_device_is_compatible(remote, "hdmi-connector")) {
+		of_node_put(remote);
+		return -ENODEV;
+	}
+
+	pdev = of_find_device_by_node(remote);
+	of_node_put(remote);
+	if (!pdev)
+		return -ENODEV;
+
+	*pdev_out = pdev;
+	return 0;
+}
+
 static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master,
 			      void *data)
 {
-	struct platform_device *pdev = to_platform_device(dev);
+	struct platform_device *pdev = to_platform_device(dev), *connector_pdev;
 	struct dw_hdmi_plat_data *plat_data;
 	struct drm_device *drm = data;
 	struct device_node *phy_node;
@@ -151,16 +175,30 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master,
 		return PTR_ERR(hdmi->regulator);
 	}
 
+	ret = sun8i_dw_hdmi_find_connector_pdev(dev, &connector_pdev);
+	if (!ret) {
+		hdmi->ddc_en = gpiod_get_optional(&connector_pdev->dev,
+						  "ddc-en", GPIOD_OUT_HIGH);
+		platform_device_put(connector_pdev);
+
+		if (IS_ERR(hdmi->ddc_en)) {
+			dev_err(dev, "Couldn't get ddc-en gpio\n");
+			return PTR_ERR(hdmi->ddc_en);
+		}
+	}
+
 	ret = regulator_enable(hdmi->regulator);
 	if (ret) {
 		dev_err(dev, "Failed to enable regulator\n");
-		return ret;
+		goto err_unref_ddc_en;
 	}
 
+	gpiod_set_value(hdmi->ddc_en, 1);
+
 	ret = reset_control_deassert(hdmi->rst_ctrl);
 	if (ret) {
 		dev_err(dev, "Could not deassert ctrl reset control\n");
-		goto err_disable_regulator;
+		goto err_disable_ddc_en;
 	}
 
 	ret = clk_prepare_enable(hdmi->clk_tmds);
@@ -213,8 +251,12 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master,
 	clk_disable_unprepare(hdmi->clk_tmds);
 err_assert_ctrl_reset:
 	reset_control_assert(hdmi->rst_ctrl);
-err_disable_regulator:
+err_disable_ddc_en:
+	gpiod_set_value(hdmi->ddc_en, 0);
 	regulator_disable(hdmi->regulator);
+err_unref_ddc_en:
+	if (hdmi->ddc_en)
+		gpiod_put(hdmi->ddc_en);
 
 	return ret;
 }
@@ -228,7 +270,11 @@ static void sun8i_dw_hdmi_unbind(struct device *dev, struct device *master,
 	sun8i_hdmi_phy_remove(hdmi);
 	clk_disable_unprepare(hdmi->clk_tmds);
 	reset_control_assert(hdmi->rst_ctrl);
+	gpiod_set_value(hdmi->ddc_en, 0);
 	regulator_disable(hdmi->regulator);
+
+	if (hdmi->ddc_en)
+		gpiod_put(hdmi->ddc_en);
 }
 
 static const struct component_ops sun8i_dw_hdmi_ops = {
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h +2 -0
index 720c5aa8adc1..d707c9171824 100644
@@ -9,6 +9,7 @@
 #include <drm/bridge/dw_hdmi.h>
 #include <drm/drm_encoder.h>
 #include <linux/clk.h>
+#include <linux/gpio/consumer.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/reset.h>
@@ -190,6 +191,7 @@ struct sun8i_dw_hdmi {
 	struct regulator		*regulator;
 	const struct sun8i_dw_hdmi_quirks *quirks;
 	struct reset_control		*rst_ctrl;
+	struct gpio_desc		*ddc_en;
 };
 
 static inline struct sun8i_dw_hdmi *
Signature · 1 line
2.22.0
maintainer Reviewed-by Jernej Skrabec on v7 5/6
#6 lore raw

Re: [linux-sunxi] [PATCH v7 5/6] drm: sun4i: Add support for enabling DDC I2C bus to sun8i_dw_hdmi glue

Dne četrtek, 20. junij 2019 ob 15:47:47 CEST je megous via linux-sunxi napisal(a):

Quoted 9 lines

From: Ondrej Jirman <[email protected]>

Orange Pi 3 board requires enabling a voltage shifting circuit via GPIO for the DDC bus to be usable.

Add support for hdmi-connector node's optional ddc-en-gpios property to support this use case.

Best regards,
Jernej

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#7 lore raw

PATCH v7 6/6 arm64: dts: allwinner: orange-pi-3: Enable HDMI output

In reply to [email protected]

From: Ondrej Jirman <megous-5qf/[email protected]>

Orange Pi 3 has a DDC_CEC_EN signal connected to PH2, that enables the DDC I2C bus voltage shifter. Before EDID can be read, we need to pull PH2 high. This is realized by the ddc-en-gpios property.

---
 .../dts/allwinner/sun50i-h6-orangepi-3.dts    | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts +26 -0
index 2c6807b74ff6..01bb1bafe284 100644
@@ -22,6 +22,18 @@
 		stdout-path = "serial0:115200n8";
 	};
 
+	connector {
+		compatible = "hdmi-connector";
+		ddc-en-gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>; /* PH2 */
+		type = "a";
+
+		port {
+			hdmi_con_in: endpoint {
+				remote-endpoint = <&hdmi_out_con>;
+			};
+		};
+	};
+
 	leds {
 		compatible = "gpio-leds";
 
@@ -72,6 +84,10 @@
 	cpu-supply = <&reg_dcdca>;
 };
 
+&de {
+	status = "okay";
+};
+
 &ehci0 {
 	status = "okay";
 };
@@ -91,6 +107,16 @@
 	status = "okay";
 };
 
+&hdmi {
+	status = "okay";
+};
+
+&hdmi_out {
+	hdmi_out_con: endpoint {
+		remote-endpoint = <&hdmi_con_in>;
+	};
+};
+
 &mdio {
 	ext_rgmii_phy: ethernet-phy@1 {
 		compatible = "ethernet-phy-ieee802.3-c22";
Signature · 1 line
2.22.0
maintainer
#8 lore raw
In reply to [email protected]

Hi!

Dne četrtek, 20. junij 2019 ob 15:47:42 CEST je megous via linux-sunxi napisal(a):

Quoted 5 lines

From: Ondrej Jirman <[email protected]>

This series implements support for Xunlong Orange Pi 3 board.

- ethernet support (patches 1-3)

Correct me if I'm wrong, but patches 1-2 aren't strictly necessary for OrangePi 3, right? H6 DTSI already has emac node with dual compatible (H6 and A64) and since OrangePi 3 uses gigabit ethernet, quirk introduced by patches 1-2 are not needed.

However, it is nice to have this 100 Mbit fix, because most STB DTS will need it.

Best regards,
Jernej

Quoted 87 lines

- HDMI support (patches 4-6)

For some people, ethernet doesn't work after reboot (but works on cold boot), when the stmmac driver is built into the kernel. It works when the driver is built as a module. It's either some timing issue, or power supply issue or a combination of both. Module build induces a power cycling of the phy.

I encourage people with this issue, to build the driver into the kernel, and try to alter the reset timings for the phy in DTS or startup-delay-us and report the findings.

Please take a look.

thank you and regards,
Ondrej Jirman

Changes in v7:
- dropped stored reference to connector_pdev as suggested by Jernej
- added forgotten dt-bindings reviewed-by tag

Changes in v6:
- added dt-bindings reviewed-by tag
- fix wording in stmmac commit (as suggested by Sergei)

Changes in v5:
- dropped already applied patches (pinctrl patches, mmc1 pinconf patch)
- rename GMAC-3V3 -> GMAC-3V to match the schematic (Jagan)
- changed hdmi-connector's ddc-supply property to ddc-en-gpios (Rob Herring)

Changes in v4:
- fix checkpatch warnings/style issues
- use enum in struct sunxi_desc_function for io_bias_cfg_variant
- collected acked-by's
- fix compile error in drivers/pinctrl/sunxi/pinctrl-sun9i-a80-r.c:156 caused by missing conversion from has_io_bias_cfg struct member (I've kept the acked-by, because it's a trivial change, but feel free to object.) (reported by Martin A. on github)
I did not have A80 pinctrl enabled for some reason, so I did not catch this sooner.
- dropped brcm firmware patch (was already applied)
- dropped the wifi dts patch (will re-send after H6 RTC gets merged, along with bluetooth support, in a separate series)

Changes in v3:
- dropped already applied patches
- changed pinctrl I/O bias selection constants to enum and renamed
- added /omit-if-no-ref/ to mmc1_pins
- made mmc1_pins default pinconf for mmc1 in H6 dtsi
- move ddc-supply to HDMI connector node, updated patch descriptions, changed dt-bindings docs

Changes in v2:
- added dt-bindings documentation for the board's compatible string (suggested by Clement)
- addressed checkpatch warnings and code formatting issues (on Maxime's suggestions)
- stmmac: dropped useless parenthesis, reworded description of the patch (suggested by Sergei)
- drop useles dev_info() about the selected io bias voltage
- docummented io voltage bias selection variant macros
- wifi: marked WiFi DTS patch and realted mmc1_pins as "DO NOT MERGE", because wifi depends on H6 RTC support that's not merged yet (suggested by Clement)
- added missing signed-of-bys
- changed &usb2otg dr_mode to otg, and added a note about VBUS
- improved wording of HDMI driver's DDC power supply patch

Icenowy Zheng (2):
net: stmmac: sun8i: add support for Allwinner H6 EMAC
net: stmmac: sun8i: force select external PHY when no internal one

Ondrej Jirman (4):
arm64: dts: allwinner: orange-pi-3: Enable ethernet
dt-bindings: display: hdmi-connector: Support DDC bus enable
drm: sun4i: Add support for enabling DDC I2C bus to sun8i_dw_hdmi glue
arm64: dts: allwinner: orange-pi-3: Enable HDMI output

 .../display/connector/hdmi-connector.txt      |  1 +
 .../dts/allwinner/sun50i-h6-orangepi-3.dts    | 70 +++++++++++++++++++
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c         | 54 ++++++++++++--
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h         |  2 +
 .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 21 ++++++
 5 files changed, 144 insertions(+), 4 deletions(-)
#9 lore raw

Hi Jernej,

Quoted 6 lines · Jernej Škrabec

Hi!

Dne četrtek, 20. junij 2019 ob 15:47:42 CEST je megous via linux-sunxi napisal(a):

Quoted 2 lines

From: Ondrej Jirman <megous-5qf/[email protected]>

Quoted 8 lines
Quoted 3 lines

This series implements support for Xunlong Orange Pi 3 board.

- ethernet support (patches 1-3)

Correct me if I'm wrong, but patches 1-2 aren't strictly necessary for OrangePi 3, right? H6 DTSI already has emac node with dual compatible (H6 and A64) and since OrangePi 3 uses gigabit ethernet, quirk introduced by patches 1-2 are not needed.

I've checked with u-boot and md.l 0x03000030 (syscon_field) and the actual default value there on cold boot is 0x58000, just like on H3.

H3_EPHY_SELECT is BIT(15)

That means that those patches (1 and 2) are both doing the same thing, basicaly. H3_EPHY_SELECT bit needs to be cleared, and it is cleared either explicitly, or via default_syscon_value = 0x50000. It's also cleared incidentally by using emac_variant_a64, because it has default_syscon_value set to 0.

Meaning of those remaining set bits on H6[1] are the same as on H3. Bit 16 is SHUTDOWN (on 1) and bit 18 is CLK_SEL. At least SHUTDOWN bit should be kept high, as it keeps the EPHY shut down. Normally that would be ensured by the code, but only if soc_has_internal_phy is true, which it is not for emac_variant_a64.

Thus the patch adds the emac_variant_h6 with a different default_syscon_value from A64.

Dose the SHUTDOWN bit matter on H6? I don't know. I'm just trying to keep the default values of these bits unchanged. Maybe it would be nicer to have default_syscon_value be 0x58000 on H6, to avoid the boot warning.

dwmac-sun8i 5020000.ethernet: Current syscon value is not the default 58000 (expect 50000)

The same warning is there with A64 compatible (with "expect 0").

[1] See page 238 in H6 manual.

regards,

	o.
Quoted 97 lines

However, it is nice to have this 100 Mbit fix, because most STB DTS will need it.

Best regards,
Jernej

Quoted 87 lines

- HDMI support (patches 4-6)

For some people, ethernet doesn't work after reboot (but works on cold boot), when the stmmac driver is built into the kernel. It works when the driver is built as a module. It's either some timing issue, or power supply issue or a combination of both. Module build induces a power cycling of the phy.

I encourage people with this issue, to build the driver into the kernel, and try to alter the reset timings for the phy in DTS or startup-delay-us and report the findings.

Please take a look.

thank you and regards,
Ondrej Jirman

Changes in v7:
- dropped stored reference to connector_pdev as suggested by Jernej
- added forgotten dt-bindings reviewed-by tag

Changes in v6:
- added dt-bindings reviewed-by tag
- fix wording in stmmac commit (as suggested by Sergei)

Changes in v5:
- dropped already applied patches (pinctrl patches, mmc1 pinconf patch)
- rename GMAC-3V3 -> GMAC-3V to match the schematic (Jagan)
- changed hdmi-connector's ddc-supply property to ddc-en-gpios (Rob Herring)

Changes in v4:
- fix checkpatch warnings/style issues
- use enum in struct sunxi_desc_function for io_bias_cfg_variant
- collected acked-by's
- fix compile error in drivers/pinctrl/sunxi/pinctrl-sun9i-a80-r.c:156 caused by missing conversion from has_io_bias_cfg struct member (I've kept the acked-by, because it's a trivial change, but feel free to object.) (reported by Martin A. on github)
I did not have A80 pinctrl enabled for some reason, so I did not catch this sooner.
- dropped brcm firmware patch (was already applied)
- dropped the wifi dts patch (will re-send after H6 RTC gets merged, along with bluetooth support, in a separate series)

Changes in v3:
- dropped already applied patches
- changed pinctrl I/O bias selection constants to enum and renamed
- added /omit-if-no-ref/ to mmc1_pins
- made mmc1_pins default pinconf for mmc1 in H6 dtsi
- move ddc-supply to HDMI connector node, updated patch descriptions, changed dt-bindings docs

Changes in v2:
- added dt-bindings documentation for the board's compatible string (suggested by Clement)
- addressed checkpatch warnings and code formatting issues (on Maxime's suggestions)
- stmmac: dropped useless parenthesis, reworded description of the patch (suggested by Sergei)
- drop useles dev_info() about the selected io bias voltage
- docummented io voltage bias selection variant macros
- wifi: marked WiFi DTS patch and realted mmc1_pins as "DO NOT MERGE", because wifi depends on H6 RTC support that's not merged yet (suggested by Clement)
- added missing signed-of-bys
- changed &usb2otg dr_mode to otg, and added a note about VBUS
- improved wording of HDMI driver's DDC power supply patch

Icenowy Zheng (2):
net: stmmac: sun8i: add support for Allwinner H6 EMAC
net: stmmac: sun8i: force select external PHY when no internal one

Ondrej Jirman (4):
arm64: dts: allwinner: orange-pi-3: Enable ethernet
dt-bindings: display: hdmi-connector: Support DDC bus enable
drm: sun4i: Add support for enabling DDC I2C bus to sun8i_dw_hdmi glue
arm64: dts: allwinner: orange-pi-3: Enable HDMI output

 .../display/connector/hdmi-connector.txt      |  1 +
 .../dts/allwinner/sun50i-h6-orangepi-3.dts    | 70 +++++++++++++++++++
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c         | 54 ++++++++++++--
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h         |  2 +
 .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 21 ++++++
 5 files changed, 144 insertions(+), 4 deletions(-)
Signature · 4 lines
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/20190620163436.upg5pkpspyz64brh%40core.my.home.
For more options, visit https://groups.google.com/d/optout.
#10 lore raw
In reply to [email protected]
Quoted 13 lines · verejna

From: Ondrej Jirman <megous-5qf/[email protected]>

This series implements support for Xunlong Orange Pi 3 board.

- ethernet support (patches 1-3)
- HDMI support (patches 4-6)

For some people, ethernet doesn't work after reboot (but works on cold boot), when the stmmac driver is built into the kernel. It works when the driver is built as a module. It's either some timing issue, or power supply issue or a combination of both. Module build induces a power cycling of the phy.

Quoted 3 lines

I encourage people with this issue, to build the driver into the kernel, and try to alter the reset timings for the phy in DTS or startup-delay-us and report the findings.

Other theory to test is that the PHY requires two power supplies to be enabled at the same time, and during reboot one of them (one controlled via GPIO) may be turned off, and ALDO2 controlled by AXP805 may not.

It should be possible to turn off ALDO2 in u-boot via CONFIG_AXP_ALDO2_VOLT=0 (You may need to enable CONFIG_AXP809_POWER and other options too, since it seems AXP805 support is not enabled for orange pi 3 in u-boot)

regards,

	o.
Quoted 84 lines

Please take a look.

thank you and regards,
Ondrej Jirman

Changes in v7:
- dropped stored reference to connector_pdev as suggested by Jernej
- added forgotten dt-bindings reviewed-by tag

Changes in v6:
- added dt-bindings reviewed-by tag
- fix wording in stmmac commit (as suggested by Sergei)

Changes in v5:
- dropped already applied patches (pinctrl patches, mmc1 pinconf patch)
- rename GMAC-3V3 -> GMAC-3V to match the schematic (Jagan)
- changed hdmi-connector's ddc-supply property to ddc-en-gpios (Rob Herring)

Changes in v4:
- fix checkpatch warnings/style issues
- use enum in struct sunxi_desc_function for io_bias_cfg_variant
- collected acked-by's
- fix compile error in drivers/pinctrl/sunxi/pinctrl-sun9i-a80-r.c:156 caused by missing conversion from has_io_bias_cfg struct member (I've kept the acked-by, because it's a trivial change, but feel free to object.) (reported by Martin A. on github)
I did not have A80 pinctrl enabled for some reason, so I did not catch this sooner.
- dropped brcm firmware patch (was already applied)
- dropped the wifi dts patch (will re-send after H6 RTC gets merged, along with bluetooth support, in a separate series)

Changes in v3:
- dropped already applied patches
- changed pinctrl I/O bias selection constants to enum and renamed
- added /omit-if-no-ref/ to mmc1_pins
- made mmc1_pins default pinconf for mmc1 in H6 dtsi
- move ddc-supply to HDMI connector node, updated patch descriptions, changed dt-bindings docs

Changes in v2:
- added dt-bindings documentation for the board's compatible string (suggested by Clement)
- addressed checkpatch warnings and code formatting issues (on Maxime's suggestions)
- stmmac: dropped useless parenthesis, reworded description of the patch (suggested by Sergei)
- drop useles dev_info() about the selected io bias voltage
- docummented io voltage bias selection variant macros
- wifi: marked WiFi DTS patch and realted mmc1_pins as "DO NOT MERGE", because wifi depends on H6 RTC support that's not merged yet (suggested by Clement)
- added missing signed-of-bys
- changed &usb2otg dr_mode to otg, and added a note about VBUS
- improved wording of HDMI driver's DDC power supply patch

Icenowy Zheng (2):
net: stmmac: sun8i: add support for Allwinner H6 EMAC
net: stmmac: sun8i: force select external PHY when no internal one

Ondrej Jirman (4):
arm64: dts: allwinner: orange-pi-3: Enable ethernet
dt-bindings: display: hdmi-connector: Support DDC bus enable
drm: sun4i: Add support for enabling DDC I2C bus to sun8i_dw_hdmi glue
arm64: dts: allwinner: orange-pi-3: Enable HDMI output

 .../display/connector/hdmi-connector.txt      |  1 +
 .../dts/allwinner/sun50i-h6-orangepi-3.dts    | 70 +++++++++++++++++++
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c         | 54 ++++++++++++--
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h         |  2 +
 .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 21 ++++++
 5 files changed, 144 insertions(+), 4 deletions(-)
Signature · 7 lines
2.22.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer
#11 lore raw
In reply to [email protected]

From: [email protected]
Date: Thu, 20 Jun 2019 15:47:42 +0200

Quoted 13 lines

From: Ondrej Jirman <[email protected]>

This series implements support for Xunlong Orange Pi 3 board.

- ethernet support (patches 1-3)
- HDMI support (patches 4-6)

For some people, ethernet doesn't work after reboot (but works on cold boot), when the stmmac driver is built into the kernel. It works when the driver is built as a module. It's either some timing issue, or power supply issue or a combination of both. Module build induces a power cycling of the phy.

Quoted 3 lines

I encourage people with this issue, to build the driver into the kernel, and try to alter the reset timings for the phy in DTS or startup-delay-us and report the findings.

This is a mixture of networking and non-networking changes so it really can't go through my tree.

I wonder how you expect this series to be merged?

Thanks.

#12 lore raw
Quoted 20 lines · David Miller

From: megous-5qf/[email protected]
Date: Thu, 20 Jun 2019 15:47:42 +0200

Quoted 13 lines

From: Ondrej Jirman <megous-5qf/[email protected]>

This series implements support for Xunlong Orange Pi 3 board.

- ethernet support (patches 1-3)
- HDMI support (patches 4-6)

For some people, ethernet doesn't work after reboot (but works on cold boot), when the stmmac driver is built into the kernel. It works when the driver is built as a module. It's either some timing issue, or power supply issue or a combination of both. Module build induces a power cycling of the phy.

Quoted 3 lines

I encourage people with this issue, to build the driver into the kernel, and try to alter the reset timings for the phy in DTS or startup-delay-us and report the findings.

Quoted 6 lines

This is a mixture of networking and non-networking changes so it really can't go through my tree.

I wonder how you expect this series to be merged?

Thanks.

This series was even longer before, with patches all around for various maintainers. I'd expect that relevant maintainers pick the range of patches meant for them. I don't know who's exactly responsible for what, but I think, this should work:

- 2 stmmac patches should go together via some networking tree (is there something specific for stmmac?)
- all DTS patches should go via sunxi
- hdmi patches via some drm tree

thank you and regards,

	o.
maintainer
#13 lore raw

From: Ondřej Jirman <[email protected]>
Date: Mon, 24 Jun 2019 19:46:37 +0200

Quoted 9 lines

This series was even longer before, with patches all around for various maintainers. I'd expect that relevant maintainers pick the range of patches meant for them. I don't know who's exactly responsible for what, but I think, this should work:

- 2 stmmac patches should go together via some networking tree (is there something specific for stmmac?)
- all DTS patches should go via sunxi
- hdmi patches via some drm tree

Thank you. So I'll merge the first two patches that touch the stmmac driver via my net-next tree.

#14 lore raw
Quoted 8 lines · David Miller

From: Ondřej Jirman <[email protected]>
Date: Mon, 24 Jun 2019 19:46:37 +0200

Quoted 5 lines

This series was even longer before, with patches all around for various maintainers. I'd expect that relevant maintainers pick the range of patches meant for them. I don't know who's exactly responsible for what, but I think, this should work:

Quoted 7 lines
Quoted 4 lines

- 2 stmmac patches should go together via some networking tree (is there something specific for stmmac?)
- all DTS patches should go via sunxi
- hdmi patches via some drm tree

Thank you. So I'll merge the first two patches that touch the stmmac driver via my net-next tree.

Thank you.

regards,
Ondrej