* [U-Boot] [PATCH] net: designware: Make driver independent from DM_GPIO again
@ 2016-06-27 10:17 Alexey Brodkin
2016-06-29 3:28 ` Simon Glass
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Alexey Brodkin @ 2016-06-27 10:17 UTC (permalink / raw)
To: u-boot
Commit 90b7fc924adf "net: designware: support phy reset device-tree
bindings" made DW GMAC driver dependent on DM_GPIO by unconditional
usage of purely DM_GPIO stuff like:
* dm_gpio_XXX()
* gpio_request_by_name()
But since that driver as of today might be easily used without
DM_GPIO (that's the case for Synopsys AXS10x boards) we're
shielding all DM_GPIO things by ifdefs.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Beniamino Galvani <b.galvani@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Cc: Sonic Zhang <sonic.zhang@analog.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Marek Vasut <marex@denx.de>
---
drivers/net/designware.c | 10 ++++++++--
drivers/net/designware.h | 7 ++++++-
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 8858f07..8ba72e3 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -80,7 +80,7 @@ static int dw_mdio_write(struct mii_dev *bus, int addr, int devad, int reg,
return ret;
}
-#if CONFIG_DM_ETH
+#if defined(CONFIG_DM_ETH) && defined(CONFIG_DM_GPIO)
static int dw_mdio_reset(struct mii_dev *bus)
{
struct udevice *dev = bus->priv;
@@ -126,7 +126,7 @@ static int dw_mdio_init(const char *name, void *priv)
bus->read = dw_mdio_read;
bus->write = dw_mdio_write;
snprintf(bus->name, sizeof(bus->name), "%s", name);
-#ifdef CONFIG_DM_ETH
+#if defined(CONFIG_DM_ETH) && defined(CONFIG_DM_GPIO)
bus->reset = dw_mdio_reset;
#endif
@@ -690,11 +690,15 @@ static const struct eth_ops designware_eth_ops = {
static int designware_eth_ofdata_to_platdata(struct udevice *dev)
{
struct dw_eth_pdata *dw_pdata = dev_get_platdata(dev);
+#ifdef CONFIG_DM_GPIO
struct dw_eth_dev *priv = dev_get_priv(dev);
+#endif
struct eth_pdata *pdata = &dw_pdata->eth_pdata;
const char *phy_mode;
const fdt32_t *cell;
+#ifdef CONFIG_DM_GPIO
int reset_flags = GPIOD_IS_OUT;
+#endif
int ret = 0;
pdata->iobase = dev_get_addr(dev);
@@ -712,6 +716,7 @@ static int designware_eth_ofdata_to_platdata(struct udevice *dev)
if (cell)
pdata->max_speed = fdt32_to_cpu(*cell);
+#ifdef CONFIG_DM_GPIO
if (fdtdec_get_bool(gd->fdt_blob, dev->of_offset,
"snps,reset-active-low"))
reset_flags |= GPIOD_ACTIVE_LOW;
@@ -724,6 +729,7 @@ static int designware_eth_ofdata_to_platdata(struct udevice *dev)
} else if (ret == -ENOENT) {
ret = 0;
}
+#endif
return ret;
}
diff --git a/drivers/net/designware.h b/drivers/net/designware.h
index 51ba769..d345c5b 100644
--- a/drivers/net/designware.h
+++ b/drivers/net/designware.h
@@ -8,7 +8,9 @@
#ifndef _DW_ETH_H
#define _DW_ETH_H
-#include <asm/gpio.h>
+#ifdef CONFIG_DM_GPIO
+#include <asm-generic/gpio.h>
+#endif
#define CONFIG_TX_DESCR_NUM 16
#define CONFIG_RX_DESCR_NUM 16
@@ -234,7 +236,10 @@ struct dw_eth_dev {
#ifndef CONFIG_DM_ETH
struct eth_device *dev;
#endif
+#ifdef CONFIG_DM_GPIO
struct gpio_desc reset_gpio;
+#endif
+
struct phy_device *phydev;
struct mii_dev *bus;
};
--
2.5.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] net: designware: Make driver independent from DM_GPIO again
2016-06-27 10:17 [U-Boot] [PATCH] net: designware: Make driver independent from DM_GPIO again Alexey Brodkin
@ 2016-06-29 3:28 ` Simon Glass
2016-07-04 8:36 ` Alexey Brodkin
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Simon Glass @ 2016-06-29 3:28 UTC (permalink / raw)
To: u-boot
On 27 June 2016 at 03:17, Alexey Brodkin <Alexey.Brodkin@synopsys.com> wrote:
> Commit 90b7fc924adf "net: designware: support phy reset device-tree
> bindings" made DW GMAC driver dependent on DM_GPIO by unconditional
> usage of purely DM_GPIO stuff like:
> * dm_gpio_XXX()
> * gpio_request_by_name()
>
> But since that driver as of today might be easily used without
> DM_GPIO (that's the case for Synopsys AXS10x boards) we're
> shielding all DM_GPIO things by ifdefs.
>
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Beniamino Galvani <b.galvani@gmail.com>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
> Cc: Sonic Zhang <sonic.zhang@analog.com>
> Cc: Bin Meng <bmeng.cn@gmail.com>
> Cc: Marek Vasut <marex@denx.de>
> ---
> drivers/net/designware.c | 10 ++++++++--
> drivers/net/designware.h | 7 ++++++-
> 2 files changed, 14 insertions(+), 3 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] net: designware: Make driver independent from DM_GPIO again
2016-06-27 10:17 [U-Boot] [PATCH] net: designware: Make driver independent from DM_GPIO again Alexey Brodkin
2016-06-29 3:28 ` Simon Glass
@ 2016-07-04 8:36 ` Alexey Brodkin
2016-07-06 15:16 ` Joe Hershberger
2016-07-12 17:28 ` [U-Boot] " Joe Hershberger
3 siblings, 0 replies; 5+ messages in thread
From: Alexey Brodkin @ 2016-07-04 8:36 UTC (permalink / raw)
To: u-boot
Hi?Joe,
On Mon, 2016-06-27 at 13:17 +0300, Alexey Brodkin wrote:
> Commit 90b7fc924adf "net: designware: support phy reset device-tree
> bindings" made DW GMAC driver dependent on DM_GPIO by unconditional
> usage of purely DM_GPIO stuff like:
> ?* dm_gpio_XXX()
> ?* gpio_request_by_name()
>
> But since that driver as of today might be easily used without
> DM_GPIO (that's the case for Synopsys AXS10x boards) we're
> shielding all DM_GPIO things by ifdefs.
>
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Beniamino Galvani <b.galvani@gmail.com>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
> Cc: Sonic Zhang <sonic.zhang@analog.com>
> Cc: Bin Meng <bmeng.cn@gmail.com>
> Cc: Marek Vasut <marex@denx.de>
> ---
Any chance for this one to be applied?
Otherwise U-Boot for axs10x boards is not compilable any longer.
Regards,
Alexey
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] net: designware: Make driver independent from DM_GPIO again
2016-06-27 10:17 [U-Boot] [PATCH] net: designware: Make driver independent from DM_GPIO again Alexey Brodkin
2016-06-29 3:28 ` Simon Glass
2016-07-04 8:36 ` Alexey Brodkin
@ 2016-07-06 15:16 ` Joe Hershberger
2016-07-12 17:28 ` [U-Boot] " Joe Hershberger
3 siblings, 0 replies; 5+ messages in thread
From: Joe Hershberger @ 2016-07-06 15:16 UTC (permalink / raw)
To: u-boot
On Mon, Jun 27, 2016 at 5:17 AM, Alexey Brodkin
<Alexey.Brodkin@synopsys.com> wrote:
> Commit 90b7fc924adf "net: designware: support phy reset device-tree
> bindings" made DW GMAC driver dependent on DM_GPIO by unconditional
> usage of purely DM_GPIO stuff like:
> * dm_gpio_XXX()
> * gpio_request_by_name()
>
> But since that driver as of today might be easily used without
> DM_GPIO (that's the case for Synopsys AXS10x boards) we're
> shielding all DM_GPIO things by ifdefs.
>
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Beniamino Galvani <b.galvani@gmail.com>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
> Cc: Sonic Zhang <sonic.zhang@analog.com>
> Cc: Bin Meng <bmeng.cn@gmail.com>
> Cc: Marek Vasut <marex@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] net: designware: Make driver independent from DM_GPIO again
2016-06-27 10:17 [U-Boot] [PATCH] net: designware: Make driver independent from DM_GPIO again Alexey Brodkin
` (2 preceding siblings ...)
2016-07-06 15:16 ` Joe Hershberger
@ 2016-07-12 17:28 ` Joe Hershberger
3 siblings, 0 replies; 5+ messages in thread
From: Joe Hershberger @ 2016-07-12 17:28 UTC (permalink / raw)
To: u-boot
Hi Alexey,
https://patchwork.ozlabs.org/patch/640922/ was applied to u-boot-net.git.
Thanks!
-Joe
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-07-12 17:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-27 10:17 [U-Boot] [PATCH] net: designware: Make driver independent from DM_GPIO again Alexey Brodkin
2016-06-29 3:28 ` Simon Glass
2016-07-04 8:36 ` Alexey Brodkin
2016-07-06 15:16 ` Joe Hershberger
2016-07-12 17:28 ` [U-Boot] " Joe Hershberger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.