[Linux-stm32] [PATCH] net: stmmac: Support gpio high-level reset for devices requiring it
lizhe
sensor1010 at 163.com
Wed Jul 9 16:05:05 UTC 2025
Hi,
if i add the following code to this function, the gpio outputs a high level
without this code, it outputs a low level,
the function currently drivers the reset GPIO to a low state, failing to account
for devices requiring an active-high reset.
i invited our hardware engineer to measure the voltage level on this GPIO pin,
without adding this code, the voltage at this GPIO pin remains at 0V
+ int current_value;
+ keep_high = device_property_read_bool(priv->device,
+ "snps,reset-keep-high");
+ if (keep_high) {
+ gpiod_set_value_cansleep(reset_gpio, 1);
+ current_value = gpiod_get_value_cansleep(reset_gpio);
+ pr_info("current_value: %d\n", current_value);
+ }
in the RK3588 system, i am using ,there are many DTS node configured link this:
snps, reset-gpio = <&gpioX RK_PXX GPIO_ACTIVE_HIGH>;
All of them correctly parse the GPIO pin's state are described in the DTS
Thx !
Lizhe
At 2025-07-09 22:29:46, "Russell King (Oracle)" <linux at armlinux.org.uk> wrote:
>On Wed, Jul 09, 2025 at 07:42:55PM +0800, lizhe wrote:
>> Hi,
>> i have already declared it in the DTS.
>>
>> &gmac {
>> snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_HIGH>;
>> };
>
>Active high means that the reset is in effect when the output is at the
>logic '1' state. So, gpiod_get_value*() will return the same as
>gpiod_get_raw_value*().
>
>Active low means that the reset is in effect when the output is at the
>logic '0' state, and in that case the return value of
>gpiod_get_value*() will return true when the reset is active (at logic
>'0' state) whereas gpiod_get_raw_value*() will return zero.
>
>--
>RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
>FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://st-md-mailman.stormreply.com/pipermail/linux-stm32/attachments/20250710/fd9ca34a/attachment.html>
More information about the Linux-stm32
mailing list