From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Thu, 30 Apr 2020 16:42:05 -0600 Subject: [PATCH 3/8] net: dwc_eth_qos: Add option "snps, reset-gpio" phy-rst gpio for stm32 In-Reply-To: <5429ce30-171a-6ec5-846c-fb5fcb5a5a74@wwwdotorg.org> References: <20200430103656.29728-1-david.wu@rock-chips.com> <20200430103656.29728-4-david.wu@rock-chips.com> <5429ce30-171a-6ec5-846c-fb5fcb5a5a74@wwwdotorg.org> Message-ID: <6f572240-6428-26f3-a403-2f1406a35c1f@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 4/30/20 4:36 PM, Stephen Warren wrote: > On 4/30/20 4:36 AM, David Wu wrote: >> It can be seen that most of the Socs using STM mac, "snps,reset-gpio" >> gpio is used, adding this option makes reset function more general. > >> diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c > >> @@ -1712,11 +1724,29 @@ static int eqos_probe_resources_stm32(struct udevice *dev) >> if (ret) >> pr_warn("gpio_request_by_name(phy reset) not provided %d", >> ret); >> + else >> + eqos->reset_delays[1] = 2; >> >> eqos->phyaddr = ofnode_read_u32_default(phandle_args.node, >> "reg", -1); >> } >> >> + if (!dm_gpio_is_valid(&eqos->phy_reset_gpio)) { >> + int reset_flags = GPIOD_IS_OUT; >> + >> + if (dev_read_bool(dev, "snps,reset-active-low")) >> + reset_flags |= GPIOD_ACTIVE_LOW; >> + >> + ret = gpio_request_by_name(dev, "snps,reset-gpio", 0, >> + &eqos->phy_reset_gpio, reset_flags); > > > The kernel's bindings/net/snps,dwmac.yaml does not mention any > reset-gpios property (which is what the existing code parses just above > the portion that is quoted by this patch as context). I suspect that > this patch should simply change the name of the property that this > function parses to align with the binding, and fix any DTs in U-Boot > that also don't match the binding? Oops, the relevant YAML file is probably ./bindings/net/rockchip-dwmac.txt, although this makes no difference to my statement luckily.