Commit 211e9ea6 authored by Robert Hancock's avatar Robert Hancock Committed by Benjamin Cabé
Browse files

drivers: ethernet: vsc8541: Fixed inverted reset GPIO

For GPIOs driving active-low signals, such as the VSC8541's reset pin,
they are supposed to be declared as active low in the device tree, and
set to 1 to assert and 0 to clear. Change the driver as such so that it
does not leave the PHY stuck in reset when so configured.

Also changed all in-tree board DTS files for this PHY to properly
declare the reset GPIO as active low.

Signed-off-by: default avatarRobert Hancock <robert.hancock@calian.com>
parent 07f45204
Loading
Loading
Loading
Loading
+1 −1
Changes for boards/sensry/ganymed_bob/ganymed_bob_sy120_gbm.dts: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@
		reg = <0x0>;
		status = "okay";

		reset-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
		reset-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;

		microchip,interface-type = "rgmii";
	};
+1 −1
Changes for boards/sensry/ganymed_bob/ganymed_bob_sy120_gen1.dts: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@
		reg = <0x0>;
		status = "okay";

		reset-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
		reset-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;

		microchip,interface-type = "rgmii";
	};
+1 −1
Changes for boards/sensry/ganymed_sk/ganymed_sk_sy120_gbm.dts: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@
		reg = <0x0b>;
		status = "okay";

		reset-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
		reset-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;

		microchip,interface-type = "rgmii";
	};
+1 −1
Changes for boards/sensry/ganymed_sk/ganymed_sk_sy120_gen1.dts: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@
		reg = <0x0b>;
		status = "okay";

		reset-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
		reset-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;

		microchip,interface-type = "rgmii";
	};
+3 −3
Changes for drivers/ethernet/phy/phy_microchip_vsc8541.c: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -143,14 +143,14 @@ static int phy_mc_vsc8541_reset(const struct device *dev)
	}

	/* configure the reset pin */
	ret = gpio_pin_configure_dt(&cfg->reset_gpio, GPIO_OUTPUT_ACTIVE);
	ret = gpio_pin_configure_dt(&cfg->reset_gpio, GPIO_OUTPUT_INACTIVE);
	if (ret < 0) {
		return ret;
	}

	for (uint32_t i = 0; i < 2; i++) {
		/* Start reset */
		ret = gpio_pin_set_dt(&cfg->reset_gpio, 0);
		ret = gpio_pin_set_dt(&cfg->reset_gpio, 1);
		if (ret < 0) {
			LOG_WRN("failed to set reset gpio");
			return -EINVAL;
@@ -160,7 +160,7 @@ static int phy_mc_vsc8541_reset(const struct device *dev)
		k_sleep(K_MSEC(200));

		/* Reset over */
		gpio_pin_set_dt(&cfg->reset_gpio, 1);
		gpio_pin_set_dt(&cfg->reset_gpio, 0);

		/* After de-asserting reset, must wait before using the config interface */
		k_sleep(K_MSEC(200));