All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCHv5] arm: socfpga: Add initial support for Altera's SOCFPGA HW
Date: Thu, 19 Jul 2012 08:15:40 +0000	[thread overview]
Message-ID: <201207190815.40871.arnd@arndb.de> (raw)
In-Reply-To: <1342649238-1044-1-git-send-email-dinguyen@altera.com>

On Wednesday 18 July 2012, dinguyen at altera.com wrote:
> @@ -49,7 +49,9 @@ static int __devinit stmmac_probe_config_dt(struct platform_device *pdev,
>          * are provided. All other properties should be added
>          * once needed on other platforms.
>          */
> -       if (of_device_is_compatible(np, "st,spear600-gmac")) {
> +       if (of_device_is_compatible(np, "st,spear600-gmac") ||
> +               of_device_is_compatible(np, "snps,dwmac-3.70a") ||
> +               of_device_is_compatible(np, "snps,dwmac")) {
>                 plat->has_gmac = 1;
>                 plat->pmt = 1;
>         }

My guess from looking at the driver is that the "pmt" flag is not
set on all versions, but is on 3.50 or higher, so I would make it

       if (of_device_is_compatible(np, "st,spear600-gmac") ||
           of_device_is_compatible(np, "snps,dwmac-3.70a"))
		plat->pmt = 1;

I'm also guessing that the availability of the gmac is not a property
of the dwmac version but of the way the dwmac macro is used, so that
should probably be instead

       if (of_device_is_compatible(np, "st,spear600-gmac") ||
           of_device_is_compatible(np, "altr,socfpga-stmmac"))
		plat->has_gmac = 1;

For a device that just claims compatibility with "snps,dwmac" but
no specific version, it probably makes more sense to assume that
those features are not available.

Rather than checking the version here, we can also add an empty property
"snps,gmac" or similar to show the presence of the gmac in the device
tree.

The other alternative that I've brought up with Deepak and Vipul from ST
is to add a template for each version of the dwmac so you don't have
to check the specific compatible string separately for each property.

> @@ -250,7 +252,9 @@ static const struct dev_pm_ops stmmac_pltfr_pm_ops;
>  #endif /* CONFIG_PM */
>  
>  static const struct of_device_id stmmac_dt_ids[] = {
> -       { .compatible = "st,spear600-gmac", },
> +       { .compatible = "st,spear600-gmac"},
> +       { .compatible = "snps,dwmac-3.70a"},
> +       { .compatible = "snps,dwmac"},
>         { /* sentinel */ }
>  };

Yes, this looks good.

	Arnd

      parent reply	other threads:[~2012-07-19  8:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18 22:07 [RFC PATCHv5] arm: socfpga: Add initial support for Altera's SOCFPGA HW dinguyen at altera.com
2012-07-18 22:07 ` [RFC PATCHv5] ARM: socfpga: initial support for Altera's SOCFPGA platform dinguyen at altera.com
2012-07-19  7:32   ` Thomas Petazzoni
2012-07-19  8:55     ` Arnd Bergmann
2012-07-19  8:15 ` Arnd Bergmann [this message]

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=201207190815.40871.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 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.