Skip to content

Commit 5cdb8df

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 e3d8296 commit 5cdb8df

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static int phy_mc_vsc8541_reset(const struct device *dev)
170170

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

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

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

0 commit comments

Comments
 (0)