Skip to content

Commit 15d371d

Browse files
committed
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: Robert Hancock <robert.hancock@calian.com>
1 parent 346ed0c commit 15d371d

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

boards/sensry/ganymed_bob/ganymed_bob_sy120_gbm.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
reg = <0x0>;
3131
status = "okay";
3232

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

3535
microchip,interface-type = "rgmii";
3636
};

boards/sensry/ganymed_bob/ganymed_bob_sy120_gen1.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
reg = <0x0>;
3131
status = "okay";
3232

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

3535
microchip,interface-type = "rgmii";
3636
};

boards/sensry/ganymed_sk/ganymed_sk_sy120_gbm.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
reg = <0x0b>;
4242
status = "okay";
4343

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

4646
microchip,interface-type = "rgmii";
4747
};

boards/sensry/ganymed_sk/ganymed_sk_sy120_gen1.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
reg = <0x0b>;
4242
status = "okay";
4343

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

4646
microchip,interface-type = "rgmii";
4747
};

drivers/ethernet/phy/phy_microchip_vsc8541.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,14 @@ static int phy_mc_vsc8541_reset(const struct device *dev)
143143
}
144144

145145
/* configure the reset pin */
146-
ret = gpio_pin_configure_dt(&cfg->reset_gpio, GPIO_OUTPUT_ACTIVE);
146+
ret = gpio_pin_configure_dt(&cfg->reset_gpio, GPIO_OUTPUT_INACTIVE);
147147
if (ret < 0) {
148148
return ret;
149149
}
150150

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

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

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

0 commit comments

Comments
 (0)