mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v1 1/8] mdio_bus: do reset only on PHY devices
@ 2022-09-26  8:17 Oleksij Rempel
  2022-09-26  8:17 ` [PATCH v1 2/8] driver: add dev_is_probed() helper function Oleksij Rempel
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Oleksij Rempel @ 2022-09-26  8:17 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel

Do not reset MDIO devices. Device drivers should handle it.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/phy/mdio_bus.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index f06ab68f50..a68b0e47c0 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -263,12 +263,13 @@ static int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
 		}
 
 		of_pinctrl_select_state_default(child);
-		of_mdiobus_reset_phy(mdio, child);
 
-		if (of_mdiobus_child_is_phy(child))
+		if (of_mdiobus_child_is_phy(child)) {
+			of_mdiobus_reset_phy(mdio, child);
 			of_mdiobus_register_phy(mdio, child, addr);
-		else
+		} else {
 			of_mdiobus_register_device(mdio, child, addr);
+		}
 	}
 
 	return 0;
-- 
2.30.2




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

* [PATCH v1 2/8] driver: add dev_is_probed() helper function
  2022-09-26  8:17 [PATCH v1 1/8] mdio_bus: do reset only on PHY devices Oleksij Rempel
@ 2022-09-26  8:17 ` Oleksij Rempel
  2022-09-26  8:17 ` [PATCH v1 3/8] net: ksz8873: add device validation to be able to detect missing switch Oleksij Rempel
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Oleksij Rempel @ 2022-09-26  8:17 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel

Add function to get device/driver probe state.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 include/driver.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/driver.h b/include/driver.h
index 543287a276..f48e906fec 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -618,4 +618,9 @@ static inline void *dev_get_priv(struct device_d *dev)
 	return dev->priv;
 }
 
+static inline bool dev_is_probed(struct device_d *dev)
+{
+	return dev->driver ? true : false;
+}
+
 #endif /* DRIVER_H */
-- 
2.30.2




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

* [PATCH v1 3/8] net: ksz8873: add device validation to be able to detect missing switch
  2022-09-26  8:17 [PATCH v1 1/8] mdio_bus: do reset only on PHY devices Oleksij Rempel
  2022-09-26  8:17 ` [PATCH v1 2/8] driver: add dev_is_probed() helper function Oleksij Rempel
@ 2022-09-26  8:17 ` Oleksij Rempel
  2022-09-26  8:17 ` [PATCH v1 4/8] ARM: boards: skov-imx6: free used gpio devices pins Oleksij Rempel
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Oleksij Rempel @ 2022-09-26  8:17 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel

Some board variants do not have ksz8873 chip but still need to use
same devicetree as the board with this chip. So we need to make sure if
switch chip is actually present, before completing the probe sequence.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/ksz8873.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/net/ksz8873.c b/drivers/net/ksz8873.c
index bd8071b872..38f61ed43e 100644
--- a/drivers/net/ksz8873.c
+++ b/drivers/net/ksz8873.c
@@ -10,6 +10,11 @@
 #include <of_device.h>
 #include <regmap.h>
 
+#define KSZ8873_CHIP_ID0		0x00
+#define KSZ8873_CHIP_ID1		0x01
+#define KSZ88_CHIP_ID_M			GENMASK(7, 4)
+#define KSZ88_REV_ID_M			GENMASK(3, 1)
+
 #define KSZ8873_GLOBAL_CTRL_1		0x03
 #define KSZ8873_PASS_ALL_FRAMES		BIT(7)
 #define KSZ8873_P3_TAIL_TAG_EN		BIT(6)
@@ -52,6 +57,8 @@
 struct ksz8873_dcfg {
 	unsigned int num_ports;
 	unsigned int phy_port_cnt;
+	u8 id0;
+	u8 id1;
 };
 
 struct ksz8873_switch {
@@ -363,6 +370,7 @@ static int ksz8873_probe_mdio(struct phy_device *mdiodev)
 	struct ksz8873_switch *priv;
 	struct dsa_switch *ds;
 	int ret, gpio;
+	u8 id0, id1;
 
 	priv = xzalloc(sizeof(*priv));
 
@@ -387,6 +395,18 @@ static int ksz8873_probe_mdio(struct phy_device *mdiodev)
 		gpio_set_active(gpio, false);
 	}
 
+	ret = ksz_read8(priv, KSZ8873_CHIP_ID0, &id0);
+	if (ret)
+		return ret;
+
+	ret = ksz_read8(priv, KSZ8873_CHIP_ID1, &id1);
+	if (ret)
+		return ret;
+
+	if (id0 != dcfg->id0 ||
+	    (id1 & (KSZ88_CHIP_ID_M | KSZ88_REV_ID_M)) != dcfg->id1)
+		return -ENODEV;
+
 	ds = &priv->ds;
 	ds->dev = dev;
 	ds->num_ports = dcfg->num_ports;
@@ -407,6 +427,8 @@ static int ksz8873_probe_mdio(struct phy_device *mdiodev)
 static const struct ksz8873_dcfg ksz8873_dcfg = {
 	.num_ports = 3,
 	.phy_port_cnt = 2,
+	.id0 = 0x88,
+	.id1 = 0x30,
 };
 
 static const struct of_device_id ksz8873_dt_ids[] = {
-- 
2.30.2




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

* [PATCH v1 4/8] ARM: boards: skov-imx6: free used gpio devices pins
  2022-09-26  8:17 [PATCH v1 1/8] mdio_bus: do reset only on PHY devices Oleksij Rempel
  2022-09-26  8:17 ` [PATCH v1 2/8] driver: add dev_is_probed() helper function Oleksij Rempel
  2022-09-26  8:17 ` [PATCH v1 3/8] net: ksz8873: add device validation to be able to detect missing switch Oleksij Rempel
@ 2022-09-26  8:17 ` Oleksij Rempel
  2022-09-26  8:17 ` [PATCH v1 5/8] ARM: boards: skov-imx6: rework switch detection Oleksij Rempel
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Oleksij Rempel @ 2022-09-26  8:17 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel

Free used gpio pins to allow to take over them by actual device nodes

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/boards/skov-imx6/board.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boards/skov-imx6/board.c b/arch/arm/boards/skov-imx6/board.c
index bceb215a01..140689c87b 100644
--- a/arch/arm/boards/skov-imx6/board.c
+++ b/arch/arm/boards/skov-imx6/board.c
@@ -501,11 +501,13 @@ static void skov_init_board(const struct board_description *variant)
 		 */
 		gpio_request(24, "must_be_low");
 		gpio_direction_output(24, 0);
+		gpio_free(24);
 	}
 
 	/* SD card handling */
 	gpio_request(205, "mmc io supply");
 	gpio_direction_output(205, 0); /* select 3.3 V IO voltage */
+	gpio_free(205);
 
 	if (variant->flags & SKOV_ENABLE_MMC_POWER) {
 		/*
@@ -516,6 +518,7 @@ static void skov_init_board(const struct board_description *variant)
 		gpio_direction_output(200, 0); /* switch on */
 		mdelay(1);
 		gpio_direction_output(200, 1); /* switch on */
+		gpio_free(200);
 	}
 
 	if (variant->flags & SKOV_DISPLAY_PARALLEL) {
-- 
2.30.2




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

* [PATCH v1 5/8] ARM: boards: skov-imx6: rework switch detection
  2022-09-26  8:17 [PATCH v1 1/8] mdio_bus: do reset only on PHY devices Oleksij Rempel
                   ` (2 preceding siblings ...)
  2022-09-26  8:17 ` [PATCH v1 4/8] ARM: boards: skov-imx6: free used gpio devices pins Oleksij Rempel
@ 2022-09-26  8:17 ` Oleksij Rempel
  2022-09-26  8:17 ` [PATCH v1 6/8] ARM: boards: Skov-i.MX6: select KSZ8873 switch driver Oleksij Rempel
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Oleksij Rempel @ 2022-09-26  8:17 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel

The KSZ8873 switch supports two ways of communication over MDIO bus:
1. Standard MDIO opcodes to talk with the switch PHYs only.
2. Not standard MDIO opcodes to talk with complete switch management and
   PHYs.

Previous switch detection board code was using option 1. over FEC. Now,
with the switch driver we are using option 2. with GPIO bitbang MDIO
bus, since FEC do not support special opcodes.

To avoid duplicating switch driver functionality, we will let do switch
detection and validation to the switch driver and the board code should
only test if switch driver was probed.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/boards/skov-imx6/board.c | 27 ++++++++++-----------------
 1 file changed, 10 insertions(+), 17 deletions(-)

diff --git a/arch/arm/boards/skov-imx6/board.c b/arch/arm/boards/skov-imx6/board.c
index 140689c87b..3c51b76735 100644
--- a/arch/arm/boards/skov-imx6/board.c
+++ b/arch/arm/boards/skov-imx6/board.c
@@ -133,9 +133,6 @@ copy_mac_from_eth0:
 	return eth_of_fixup_node_from_eth_device(root, node_path, ethname);
 }
 
-#define SKOV_GPIO_MDIO_BUS	0
-#define SKOV_LAN1_PHY_ADDR	1
-
 #define MAX_V_GPIO 8
 
 struct board_description {
@@ -547,29 +544,25 @@ static void skov_init_board(const struct board_description *variant)
 
 static int skov_switch_test(void)
 {
-	struct phy_device *phydev;
+	struct device_d *sw_dev;
 	struct device_d *eth0;
-	struct mii_bus *mii;
 	int ret;
 
 	if (skov_board_no < 0)
 		return 0;
 
-	/* On this boards, we have only one MDIO bus. So, it is enough to take
-	 * the first one.
-	 */
-	mii = mdiobus_get_bus(SKOV_GPIO_MDIO_BUS);
-	/* We can't read the switch ID, but we get get ID of the first PHY,
-	 * which is enough to test if the switch is attached.
+	/* Driver should be able to detect if device do actually
+	 * exist. So, we need only to detect if driver is actually
+	 * probed.
 	 */
-	phydev = get_phy_device(mii, SKOV_LAN1_PHY_ADDR);
-	if (IS_ERR(phydev))
-		goto no_switch;
-
-	if (phydev->phy_id != PHY_ID_KSZ886X)
+	sw_dev = of_find_device_by_node_path("/mdio/switch@0");
+	if (!sw_dev) {
+		pr_err("switch@0 device was not created!\n");
 		goto no_switch;
+	}
 
-	return 0;
+	if (dev_is_probed(sw_dev))
+		return 0;
 
 no_switch:
 	skov_have_switch = false;
-- 
2.30.2




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

* [PATCH v1 6/8] ARM: boards: Skov-i.MX6: select KSZ8873 switch driver
  2022-09-26  8:17 [PATCH v1 1/8] mdio_bus: do reset only on PHY devices Oleksij Rempel
                   ` (3 preceding siblings ...)
  2022-09-26  8:17 ` [PATCH v1 5/8] ARM: boards: skov-imx6: rework switch detection Oleksij Rempel
@ 2022-09-26  8:17 ` Oleksij Rempel
  2022-09-26  8:17 ` [PATCH v1 7/8] ARM: dts: Skov i.MX6: start using mainlined kernel dts Oleksij Rempel
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Oleksij Rempel @ 2022-09-26  8:17 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel

The board code depends now on the switch driver probe functionality. If
this driver is not enabled, we will make wrong decision.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/mach-imx/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index dcb70c8c1a..c78c950357 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -646,6 +646,8 @@ config MACH_SKOV_IMX6
 	select ARCH_IMX6
 	select ARM_USE_COMPRESSED_DTB
 	select MCI_IMX_ESDHC_PBL
+	select DSA
+	select DRIVER_NET_KSZ8873
 
 endif
 
-- 
2.30.2




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

* [PATCH v1 7/8] ARM: dts: Skov i.MX6: start using mainlined kernel dts
  2022-09-26  8:17 [PATCH v1 1/8] mdio_bus: do reset only on PHY devices Oleksij Rempel
                   ` (4 preceding siblings ...)
  2022-09-26  8:17 ` [PATCH v1 6/8] ARM: boards: Skov-i.MX6: select KSZ8873 switch driver Oleksij Rempel
@ 2022-09-26  8:17 ` Oleksij Rempel
  2022-09-26  8:17 ` [PATCH v1 8/8] net: dsa: do not wait for aneg is actually done on the port start Oleksij Rempel
  2022-10-04  7:44 ` [PATCH v1 1/8] mdio_bus: do reset only on PHY devices Sascha Hauer
  7 siblings, 0 replies; 9+ messages in thread
From: Oleksij Rempel @ 2022-09-26  8:17 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel

Skov i.MX6 device tree is mainline now, so now we can start using it in
the barebox.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/arm/dts/imx6q-skov-imx6.dts    |   4 -
 arch/arm/dts/imx6qdl-skov-imx6.dtsi | 233 +++-------------------------
 2 files changed, 25 insertions(+), 212 deletions(-)

diff --git a/arch/arm/dts/imx6q-skov-imx6.dts b/arch/arm/dts/imx6q-skov-imx6.dts
index fea84cb498..a14ddbf6db 100644
--- a/arch/arm/dts/imx6q-skov-imx6.dts
+++ b/arch/arm/dts/imx6q-skov-imx6.dts
@@ -17,10 +17,6 @@
 / {
 	model = "Skov IMX6";
 	compatible = "skov,imx6", "fsl,imx6q";
-
-	chosen {
-		stdout-path = &uart2;
-	};
 };
 
 &i2c2 {
diff --git a/arch/arm/dts/imx6qdl-skov-imx6.dtsi b/arch/arm/dts/imx6qdl-skov-imx6.dtsi
index 371a931e53..f4610ee1e7 100644
--- a/arch/arm/dts/imx6qdl-skov-imx6.dtsi
+++ b/arch/arm/dts/imx6qdl-skov-imx6.dtsi
@@ -9,7 +9,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-#include <dt-bindings/gpio/gpio.h>
+#include <arm/imx6qdl-skov-cpu.dtsi>
 
 / {
 	aliases {
@@ -30,29 +30,6 @@
 		};
 	};
 
-	leds {
-		compatible = "gpio-leds";
-
-		led0: D1 {
-			label = "D1";
-			gpios = <&gpio1 2 0>;
-			default-state = "on";
-			linux,default-trigger = "heartbeat";
-		};
-
-		led1: D2 {
-			label = "D2";
-			gpios = <&gpio1 0 0>;
-			default-state = "off";
-		};
-
-		led2: D3 {
-			label = "D3";
-			gpios = <&gpio1 4 0>;
-			default-state = "on";
-		};
-	};
-
 	/* State: mutable part */
 	state: state {
 		magic = <0x34a0fc27>;
@@ -241,20 +218,6 @@
 	};
 };
 
-&pwm2 {
-	/* used for backlight brightness */
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_pwm2_2>;
-	status = "okay";
-};
-
-&pwm3 {
-	/* used for LCD contrast control */
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_pwm3_2>;
-	status = "okay";
-};
-
 &i2c2 {
 	clock-frequency = <100000>;
 	pinctrl-names = "default";
@@ -278,21 +241,6 @@
 	status = "okay";
 };
 
-/* no usbh2 */
-&usbphynop1 {
-	status = "disabled";
-};
-
-/* no usbh3 */
-&usbphynop2 {
-	status = "disabled";
-};
-
-&usbotg {
-	disable-over-current;
-	status = "okay";
-};
-
 &iomuxc {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_hog>;
@@ -300,10 +248,6 @@
 	pinctrl_hog: hoggrp {
 		/* we need a few pins as GPIOs */
 		fsl,pins = <
-			/* MMC IO voltage select */
-			MX6QDL_PAD_GPIO_18__GPIO7_IO13 0x40000058
-			/* MMC Power Supply Switch (since revision C)
-			MX6QDL_PAD_SD3_RST__GPIO7_IO08 0x40000058
 			/* Backlight Power Supply Switch (since revision B)
 			MX6QDL_PAD_RGMII_TD3__GPIO6_IO23 0x40000058
 			/* Backlight Brightness */
@@ -313,70 +257,6 @@
 		>;
 	};
 
-	pinctrl_uart2: uart2grp {
-		fsl,pins = <
-			MX6QDL_PAD_EIM_D26__UART2_TX_DATA 0x1b0b1
-			MX6QDL_PAD_EIM_D27__UART2_RX_DATA 0x1b0b1
-		>;
-	};
-
-	pinctrl_ecspi1: ecspi1grp {
-		fsl,pins = <
-			MX6QDL_PAD_EIM_D17__ECSPI1_MISO 0x100b1
-			MX6QDL_PAD_EIM_D18__ECSPI1_MOSI 0x100b1
-			MX6QDL_PAD_EIM_D16__ECSPI1_SCLK 0x100b1
-			MX6QDL_PAD_EIM_D24__GPIO3_IO24 0x40000058 /* CS# signal */
-		>;
-	};
-
-	/* pins for eth0 */
-	pinctrl_enet: enetgrp {
-		fsl,pins = <
-			MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x100b0
-			MX6QDL_PAD_ENET_MDC__ENET_MDC 0x100b0
-			MX6QDL_PAD_ENET_CRS_DV__ENET_RX_EN 0x100b0
-			MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN 0x100b0
-			MX6QDL_PAD_ENET_RXD0__ENET_RX_DATA0 0x100b0
-			MX6QDL_PAD_ENET_RXD1__ENET_RX_DATA1 0x100b0
-			MX6QDL_PAD_ENET_TXD0__ENET_TX_DATA0 0x100b0
-			MX6QDL_PAD_ENET_TXD1__ENET_TX_DATA1 0x100b0
-			MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x400000c0
-		>;
-	};
-
-	pinctrl_usdhc3: usdhc3grp {
-		fsl,pins = <
-			MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
-			MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
-			MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
-			MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
-			MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
-			MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
-			MX6QDL_PAD_SD3_DAT4__GPIO7_IO01 0x1b040 /* WP */
-			MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x1b040 /* CD */
-		>;
-	};
-
-	pinctrl_gpmi_nand: gpminandgrp {
-		fsl,pins = <
-			MX6QDL_PAD_NANDF_CLE__NAND_CLE 0xb0b1
-			MX6QDL_PAD_NANDF_ALE__NAND_ALE 0xb0b1
-			MX6QDL_PAD_NANDF_RB0__NAND_READY_B 0xb000
-			MX6QDL_PAD_NANDF_CS0__NAND_CE0_B 0xb0b1
-			MX6QDL_PAD_NANDF_CS1__NAND_CE1_B 0xb0b1
-			MX6QDL_PAD_SD4_CMD__NAND_RE_B 0xb0b1
-			MX6QDL_PAD_SD4_CLK__NAND_WE_B 0xb0b1
-			MX6QDL_PAD_NANDF_D0__NAND_DATA00 0xb0b1
-			MX6QDL_PAD_NANDF_D1__NAND_DATA01 0xb0b1
-			MX6QDL_PAD_NANDF_D2__NAND_DATA02 0xb0b1
-			MX6QDL_PAD_NANDF_D3__NAND_DATA03 0xb0b1
-			MX6QDL_PAD_NANDF_D4__NAND_DATA04 0xb0b1
-			MX6QDL_PAD_NANDF_D5__NAND_DATA05 0xb0b1
-			MX6QDL_PAD_NANDF_D6__NAND_DATA06 0xb0b1
-			MX6QDL_PAD_NANDF_D7__NAND_DATA07 0xb0b1
-		>;
-	};
-
 	pinctrl_i2c2_2: i2c2grp-2 {
 		fsl,pins = <
 			/* internal 22 k pull up required */
@@ -424,18 +304,6 @@
 			MX6QDL_PAD_RGMII_TD3__GPIO6_IO23	0x40000058
 		>;
 	};
-
-	pinctrl_pwm2_2: pwm2grp-2 {
-		fsl,pins = <
-			MX6QDL_PAD_GPIO_1__PWM2_OUT		0x00058
-		>;
-	};
-
-	pinctrl_pwm3_2: pwm3grp-2 {
-		fsl,pins = <
-			MX6QDL_PAD_SD1_DAT1__PWM3_OUT		0x00058
-		>;
-	};
 };
 
 &clks {
@@ -445,43 +313,34 @@
 				 <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>;
 };
 
-/* console */
-&uart2 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_uart2>;
-	status = "okay";
-};
-
 /* spi */
 &ecspi1 {
-	fsl,spi-num-chipselects = <1>;
-	cs-gpios = <&gpio3 24 0>;
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_ecspi1>;
-	status = "okay";
+	flash@0 {
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
 
-	norflash: m25p80@0 {
-		#address-cells = <1>;
-		#size-cells = <1>;
-		compatible = "jedec,spi-nor";
-		spi-max-frequency = <54000000>;
-		reg = <0>;
-	};
-};
+			partition@0 {
+				label = "barebox";
+				reg = <0x0 0x100000>;
+			};
 
-/* eth0 */
-&fec {
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_enet>;
-	phy-mode = "rmii";
-	status = "okay";
-	phy-reset-gpios = <&gpio1 5 0>;
-	phy-reset-duration = <100>;
-	#address-cells = <0>;
-	#size-cells = <1>;
-	fixed-link {
-		speed = <100>;
-		full-duplex;
+			/* space left to let barebox grow */
+
+			/* placed near the end of the NOR memory */
+			barebox_env: partition@780000 {
+				label = "barebox-environment";
+				reg = <0x780000 0x40000>;
+			};
+
+			/* placed at the end of the NOR memory */
+			state_storage: partition@7C0000 {
+				label = "barebox-state";
+				/* four times mirrored */
+				reg = <0x7C0000 0x40000>;
+			};
+		};
 	};
 };
 
@@ -506,21 +365,7 @@
 	status = "okay";
 };
 
-&usdhc3 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_usdhc3>;
-	wp-gpios = <&gpio7 1 0>;
-	cd-gpios = <&gpio7 0 0>;
-	status = "okay";
-	fsl,delay-line;
-};
-
 &gpmi {
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_gpmi_nand>;
-	nand-on-flash-bbt;
-	status = "okay";
-
 	partitions {
 		compatible = "fixed-partitions";
 		#address-cells = <1>;
@@ -533,34 +378,6 @@
 	};
 };
 
-/* define the SPI based 8 MiB NOR flash layout */
-&norflash {
-	partitions {
-		compatible = "fixed-partitions";
-		#address-cells = <1>;
-		#size-cells = <1>;
-
-		partition@0 {
-			label = "barebox";
-			reg = <0x0 0x100000>;
-		};
-
-		/* space left to let barebox grow */
-
-		/* placed near the end of the NOR memory */
-		barebox_env: partition@780000 {
-			label = "barebox-environment";
-			reg = <0x780000 0x40000>;
-		};
-
-		/* placed at the end of the NOR memory */
-		state_storage: partition@7C0000 {
-			label = "barebox-state";
-			reg = <0x7C0000 0x40000>; /* four times mirrored */
-		};
-	};
-};
-
 &ocotp {
 	barebox,provide-mac-address = <&fec 0x620>;
 };
-- 
2.30.2




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

* [PATCH v1 8/8] net: dsa: do not wait for aneg is actually done on the port start
  2022-09-26  8:17 [PATCH v1 1/8] mdio_bus: do reset only on PHY devices Oleksij Rempel
                   ` (5 preceding siblings ...)
  2022-09-26  8:17 ` [PATCH v1 7/8] ARM: dts: Skov i.MX6: start using mainlined kernel dts Oleksij Rempel
@ 2022-09-26  8:17 ` Oleksij Rempel
  2022-10-04  7:44 ` [PATCH v1 1/8] mdio_bus: do reset only on PHY devices Sascha Hauer
  7 siblings, 0 replies; 9+ messages in thread
From: Oleksij Rempel @ 2022-09-26  8:17 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel

Aneg configuration should be done by the eth code, not dsa.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/dsa.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/dsa.c b/drivers/net/dsa.c
index 7a64a79412..040ba897e2 100644
--- a/drivers/net/dsa.c
+++ b/drivers/net/dsa.c
@@ -111,10 +111,6 @@ static int dsa_port_start(struct eth_device *edev)
 
 	dsa_port_set_ethaddr(edev);
 
-	ret = phy_wait_aneg_done(dp->edev.phydev);
-	if (ret)
-		return ret;
-
 	if (ops->port_enable) {
 		ret = ops->port_enable(dp, dp->index, dp->edev.phydev);
 		if (ret)
-- 
2.30.2




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

* Re: [PATCH v1 1/8] mdio_bus: do reset only on PHY devices
  2022-09-26  8:17 [PATCH v1 1/8] mdio_bus: do reset only on PHY devices Oleksij Rempel
                   ` (6 preceding siblings ...)
  2022-09-26  8:17 ` [PATCH v1 8/8] net: dsa: do not wait for aneg is actually done on the port start Oleksij Rempel
@ 2022-10-04  7:44 ` Sascha Hauer
  7 siblings, 0 replies; 9+ messages in thread
From: Sascha Hauer @ 2022-10-04  7:44 UTC (permalink / raw)
  To: Oleksij Rempel; +Cc: barebox

On Mon, Sep 26, 2022 at 10:17:33AM +0200, Oleksij Rempel wrote:
> Do not reset MDIO devices. Device drivers should handle it.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  drivers/net/phy/mdio_bus.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
> index f06ab68f50..a68b0e47c0 100644
> --- a/drivers/net/phy/mdio_bus.c
> +++ b/drivers/net/phy/mdio_bus.c
> @@ -263,12 +263,13 @@ static int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
>  		}
>  
>  		of_pinctrl_select_state_default(child);
> -		of_mdiobus_reset_phy(mdio, child);
>  
> -		if (of_mdiobus_child_is_phy(child))
> +		if (of_mdiobus_child_is_phy(child)) {
> +			of_mdiobus_reset_phy(mdio, child);
>  			of_mdiobus_register_phy(mdio, child, addr);
> -		else
> +		} else {
>  			of_mdiobus_register_device(mdio, child, addr);
> +		}
>  	}
>  
>  	return 0;
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

end of thread, other threads:[~2022-10-04  7:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26  8:17 [PATCH v1 1/8] mdio_bus: do reset only on PHY devices Oleksij Rempel
2022-09-26  8:17 ` [PATCH v1 2/8] driver: add dev_is_probed() helper function Oleksij Rempel
2022-09-26  8:17 ` [PATCH v1 3/8] net: ksz8873: add device validation to be able to detect missing switch Oleksij Rempel
2022-09-26  8:17 ` [PATCH v1 4/8] ARM: boards: skov-imx6: free used gpio devices pins Oleksij Rempel
2022-09-26  8:17 ` [PATCH v1 5/8] ARM: boards: skov-imx6: rework switch detection Oleksij Rempel
2022-09-26  8:17 ` [PATCH v1 6/8] ARM: boards: Skov-i.MX6: select KSZ8873 switch driver Oleksij Rempel
2022-09-26  8:17 ` [PATCH v1 7/8] ARM: dts: Skov i.MX6: start using mainlined kernel dts Oleksij Rempel
2022-09-26  8:17 ` [PATCH v1 8/8] net: dsa: do not wait for aneg is actually done on the port start Oleksij Rempel
2022-10-04  7:44 ` [PATCH v1 1/8] mdio_bus: do reset only on PHY devices Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox