public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@xilinx.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 12/14] net: gem: Move driver to DM
Date: Tue, 1 Dec 2015 08:08:01 +0100	[thread overview]
Message-ID: <565D4751.6000901@xilinx.com> (raw)
In-Reply-To: <CAPnjgZ301ChAMYQoN5DReXfe7N8tMi4Ckz+Nos40RthHN6PMJQ@mail.gmail.com>

Hi Simon,

On 1.12.2015 00:17, Simon Glass wrote:
> Hi Michal,
> 

...

>> diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
>> index e169b774932a..5ea992a3ce65 100644
>> --- a/drivers/mmc/zynq_sdhci.c
>> +++ b/drivers/mmc/zynq_sdhci.c
>> @@ -33,6 +33,23 @@ int zynq_sdhci_init(phys_addr_t regbase)
>>         return 0;
>>  }
>>
>> +
>> +
>> +static const struct udevice_id arasan_sdhci_ids[] = {
>> +       { .compatible = "arasan,sdhci-8.9a" },
>> +       { }
>> +};
>> +
>> +U_BOOT_DRIVER(arasan_sdhci_drv) = {
>> +       .name           = "rockchip_dwmmc",
>> +       .id             = UCLASS_MMC,
>> +       .of_match       = rockchip_dwmmc_ids,
>> +       .ofdata_to_platdata = rockchip_dwmmc_ofdata_to_platdata,
>> +       .probe          = rockchip_dwmmc_probe,
>> +       .priv_auto_alloc_size = sizeof(struct rockchip_dwmmc_priv),
>> +};
>> +
>> +
> 
> This seems unrelated / also rockchip stuff.

I reported it in my reply that this was added by accident. As you know I
am playing with SD DM and rockchip was that guy I use for inspiration.


> 
>>  #if CONFIG_IS_ENABLED(OF_CONTROL)
>>  int zynq_sdhci_of_init(const void *blob)
>>  {
>> diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
>> index 4e93707c7ab1..f2a14938036f 100644
>> --- a/drivers/net/zynq_gem.c
>> +++ b/drivers/net/zynq_gem.c
>> @@ -13,6 +13,7 @@
>>  #include <net.h>
>>  #include <netdev.h>
>>  #include <config.h>
>> +#include <dm.h>
> 
> Can you put <dm.h> up higher so that these are in order?

sure

...

>>
>> -       miiphy_register(dev->name, zynq_gem_miiphy_read, zynq_gem_miiphy_write);
>> -       priv->bus = miiphy_get_dev_by_name(dev->name);
>> +static int zynq_gem_ofdata_to_platdata(struct udevice *dev)
>> +{
>> +       struct eth_pdata *pdata = dev_get_platdata(dev);
>> +       struct zynq_gem_priv *priv = dev_get_priv(dev);
>> +       int offset = 0;
>>
>> -       ret = zynq_phy_init(dev);
>> -       if (ret)
>> -               return ret;
>> +       pdata->iobase = (phys_addr_t)dev_get_addr(dev);
>> +       priv->iobase = (struct zynq_gem_regs *)dev_get_addr(dev);
> 
> Better to use:
> 
> priv->iobase = (struct zynq_gem_regs *)pdata->iobase
> 
> I think. But is pdata->iobase ever used?

That was one think I wanted to check. There is eth_pdata structure which
has iobase, enetaddr and phy_interface.

I do fill them here but driver is using iobase saved in private
structure. I do need more information from private structure that's why
I don't need to load it from pdata structure.

I probably also miss to allocate pdata. Is this required?
.platdata_auto_alloc_size = sizeof(struct eth_pdata)

Can you please check logic around pdata if I use it right?


>> +       /* Hardcode for now */
>> +       priv->emio = 0;
>> +
>> +       offset = fdtdec_lookup_phandle(gd->fdt_blob, dev->of_offset,
>> +                                      "phy-handle");
>> +       if (offset != -1)
> 
> I think this should be:
> 
> offset > 0

ok. Will fix it.

Thanks,
Michal

  reply	other threads:[~2015-12-01  7:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-30 15:05 [U-Boot] [PATCH 01/14] ARM: zynq: Remove PHYLIB from config to defconfig Michal Simek
2015-11-30 15:05 ` [U-Boot] [PATCH 02/14] ARM: zynq: Remove CONFIG_API Michal Simek
2015-11-30 15:05 ` [U-Boot] [PATCH 03/14] net: gem: Do not continue if phy is not found Michal Simek
2015-11-30 15:05 ` [U-Boot] [PATCH 04/14] net: gem: Change mdio_wait prototype to pass regs Michal Simek
2015-11-30 15:05 ` [U-Boot] [PATCH 05/14] net: gem: Change mii function not to use eth_device structure Michal Simek
2015-11-30 15:05 ` [U-Boot] [PATCH 06/14] net: gem: Remove phydev variable Michal Simek
2015-11-30 15:05 ` [U-Boot] [PATCH 07/14] net: gem: Extract phy init code Michal Simek
2015-11-30 15:05 ` [U-Boot] [PATCH 08/14] net: gem: Check if priv->phydev is valid Michal Simek
2015-11-30 15:05 ` [U-Boot] [PATCH 09/14] net: gem: Enable MDIO bus earlier Michal Simek
2015-11-30 15:05 ` [U-Boot] [PATCH 10/14] net: gem: Remove zynq_gem_of_init() Michal Simek
2015-11-30 23:17   ` Simon Glass
2015-11-30 15:05 ` [U-Boot] [PATCH 11/14] net: gem: Fix miiphy_read name Michal Simek
2015-11-30 15:05 ` [U-Boot] [PATCH 12/14] net: gem: Move driver to DM Michal Simek
2015-11-30 15:08   ` Michal Simek
2015-11-30 23:17   ` Simon Glass
2015-12-01  7:08     ` Michal Simek [this message]
2015-12-01 15:18       ` Simon Glass
2015-11-30 15:05 ` [U-Boot] [PATCH 13/14] net: gem: Read information about interface from DT Michal Simek
2015-11-30 15:05 ` [U-Boot] [PATCH 14/14] net: gem: Move gem to Kconfig Michal Simek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=565D4751.6000901@xilinx.com \
    --to=michal.simek@xilinx.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox