From: Brian Norris <computersforpeace@gmail.com>
To: Jaedon Shin <jaedon.shin@gmail.com>
Cc: Tejun Heo <tj@kernel.org>, Kishon Vijay Abraham I <kishon@ti.com>,
Ralf Baechle <ralf@linux-mips.org>,
Florian Fainelli <f.fainelli@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
linux-ide@vger.kernel.org, linux-mips@linux-mips.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH 07/10] phy: phy_brcmstb_sata: add support 40nm platforms
Date: Fri, 23 Oct 2015 14:09:09 -0700 [thread overview]
Message-ID: <20151023210909.GP13239@google.com> (raw)
In-Reply-To: <1445564663-66824-8-git-send-email-jaedon.shin@gmail.com>
On Fri, Oct 23, 2015 at 10:44:20AM +0900, Jaedon Shin wrote:
> Add offsets for 40nm BMIPS based set-top box platforms.
>
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
> ---
> drivers/phy/phy-brcmstb-sata.c | 21 ++++++++++++++-------
> 1 file changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/phy/phy-brcmstb-sata.c b/drivers/phy/phy-brcmstb-sata.c
> index 41c7535d706b..1cc80743b1b6 100644
> --- a/drivers/phy/phy-brcmstb-sata.c
> +++ b/drivers/phy/phy-brcmstb-sata.c
> @@ -30,7 +30,8 @@
> #define MAX_PORTS 2
>
> /* Register offset between PHYs in PCB space */
> -#define SATA_MDIO_REG_SPACE_SIZE 0x1000
> +#define SATA_MDIO_REG_28NM_SPACE_SIZE 0x1000
> +#define SATA_MDIO_REG_40NM_SPACE_SIZE 0x10
Hmm, I thought there were other differences than just the offsets
between ports when rev'ing from 40nm to 28nm. But revisiting the only
documentation I have [1], this looks OK. I'd recommend double checking
the other registers, even if they're currently unused though.
>
> struct brcm_sata_port {
> int portnum;
> @@ -47,7 +48,7 @@ struct brcm_sata_phy {
> struct brcm_sata_port phys[MAX_PORTS];
> };
>
> -enum sata_mdio_phy_regs_28nm {
> +enum sata_mdio_phy_regs {
> PLL_REG_BANK_0 = 0x50,
> PLL_REG_BANK_0_PLLCONTROL_0 = 0x81,
>
> @@ -85,7 +86,7 @@ static void brcm_sata_mdio_wr(void __iomem *addr, u32 bank, u32 ofs,
> #define FMAX_VAL_DEFAULT 0x3df
> #define FMAX_VAL_SSC 0x83
>
> -static void brcm_sata_cfg_ssc_28nm(struct brcm_sata_port *port)
> +static void brcm_sata_cfg_ssc(struct brcm_sata_port *port)
> {
> void __iomem *base = brcm_sata_phy_base(port);
> struct brcm_sata_phy *priv = port->phy_priv;
> @@ -116,19 +117,25 @@ static int brcm_sata_phy_init(struct phy *phy)
> {
> struct brcm_sata_port *port = phy_get_drvdata(phy);
>
> - brcm_sata_cfg_ssc_28nm(port);
> + brcm_sata_cfg_ssc(port);
>
> return 0;
> }
>
> -static const struct phy_ops phy_ops_28nm = {
> +static const struct phy_ops phy_ops = {
> .init = brcm_sata_phy_init,
> .owner = THIS_MODULE,
> };
>
> static const struct of_device_id brcm_sata_phy_of_match[] = {
> { .compatible = "brcm,bcm7445-sata-phy",
> - .data = (void *)SATA_MDIO_REG_SPACE_SIZE },
> + .data = (void *)SATA_MDIO_REG_28NM_SPACE_SIZE },
> + { .compatible = "brcm,bcm7346-sata-phy",
> + .data = (void *)SATA_MDIO_REG_40NM_SPACE_SIZE },
> + { .compatible = "brcm,bcm7360-sata-phy",
> + .data = (void *)SATA_MDIO_REG_40NM_SPACE_SIZE },
> + { .compatible = "brcm,bcm7362-sata-phy",
> + .data = (void *)SATA_MDIO_REG_40NM_SPACE_SIZE },
Like Florian suggested, this should probably be consolidated to the
first SoC that had this core on it. I think bcm7425, but I could be
wrong.
> {},
> };
> MODULE_DEVICE_TABLE(of, brcm_sata_phy_of_match);
> @@ -185,7 +192,7 @@ static int brcm_sata_phy_probe(struct platform_device *pdev)
> port = &priv->phys[id];
> port->portnum = id;
> port->phy_priv = priv;
> - port->phy = devm_phy_create(dev, child, &phy_ops_28nm);
> + port->phy = devm_phy_create(dev, child, &phy_ops);
> port->ssc_en = of_property_read_bool(child, "brcm,enable-ssc");
> if (IS_ERR(port->phy)) {
> dev_err(dev, "failed to create PHY\n");
> --
> 2.6.2
>
With that:
Reviewed-by: Brian Norris <computersforpeace@gmail.com>
[1] https://github.com/Broadcom/stblinux-3.8/blob/master/linux/drivers/ata/sata_brcmstb_phy.c
https://github.com/Broadcom/stblinux-3.8/blob/master/linux/drivers/ata/sata_brcmstb.h
next prev parent reply other threads:[~2015-10-23 21:09 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-23 1:44 [PATCH 00/10] add support SATA for BMIPS_GENERIC Jaedon Shin
2015-10-23 1:44 ` [PATCH 01/10] ata: ahci_brcmstb: make the driver buildable on BMIPS_GENERIC Jaedon Shin
2015-10-23 4:52 ` Florian Fainelli
2015-10-23 21:26 ` Brian Norris
2015-10-23 1:44 ` [PATCH 03/10] ata: ahci_brcmstb: add support 40nm platforms Jaedon Shin
2015-10-23 5:01 ` Florian Fainelli
2015-10-23 21:25 ` Brian Norris
[not found] ` <20151023212558.GS13239-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2015-10-24 4:50 ` Jaedon Shin
2015-10-24 4:50 ` Jaedon Shin
2015-10-26 17:47 ` Brian Norris
2015-10-23 1:44 ` [PATCH 04/10] phy: phy_brcmstb_sata: make the driver buildable on BMIPS_GENERIC Jaedon Shin
[not found] ` <1445564663-66824-5-git-send-email-jaedon.shin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-23 5:01 ` Florian Fainelli
2015-10-23 5:01 ` Florian Fainelli
2015-10-23 14:47 ` Kishon Vijay Abraham I
2015-10-23 14:47 ` Kishon Vijay Abraham I
2015-10-23 21:10 ` Brian Norris
2015-10-23 1:44 ` [PATCH 05/10] phy: phy_brcmstb_sata: remove unused definitions Jaedon Shin
2015-10-23 5:02 ` Florian Fainelli
2015-10-23 20:40 ` Brian Norris
[not found] ` <1445564663-66824-1-git-send-email-jaedon.shin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-23 1:44 ` [PATCH 02/10] ata: ahch_brcmstb: add data for port offset Jaedon Shin
2015-10-23 1:44 ` Jaedon Shin
2015-10-23 4:54 ` Florian Fainelli
2015-10-23 21:28 ` Brian Norris
2015-10-23 1:44 ` [PATCH 06/10] phy: phy_brcmstb_sata: add data for phy offset Jaedon Shin
2015-10-23 1:44 ` Jaedon Shin
2015-10-23 5:04 ` Florian Fainelli
2015-10-23 21:09 ` Brian Norris
2015-10-23 1:44 ` [PATCH 07/10] phy: phy_brcmstb_sata: add support 40nm platforms Jaedon Shin
[not found] ` <1445564663-66824-8-git-send-email-jaedon.shin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-23 5:06 ` Florian Fainelli
2015-10-23 5:06 ` Florian Fainelli
2015-10-23 21:09 ` Brian Norris [this message]
2015-10-23 1:44 ` [PATCH 08/10] MIPS: BMIPS: brcmstb: add SATA nodes for bcm7346 Jaedon Shin
2015-10-23 1:44 ` [PATCH 09/10] MIPS: BMIPS: brcmstb: add SATA nodes for bcm7360 Jaedon Shin
2015-10-23 1:44 ` [PATCH 10/10] MIPS: BMIPS: brcmstb: add SATA nodes for bcm7362 Jaedon Shin
2015-10-23 3:58 ` [PATCH 00/10] add support SATA for BMIPS_GENERIC Tejun Heo
2015-10-23 4:51 ` Florian Fainelli
2015-10-23 20:35 ` Brian Norris
[not found] ` <20151023203511.GN13239-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2015-10-23 21:30 ` Kevin Cernekee
2015-10-23 21:30 ` Kevin Cernekee
2015-10-24 4:51 ` Jaedon Shin
2015-10-24 20:43 ` Florian Fainelli
2015-10-27 10:21 ` Ralf Baechle
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=20151023210909.GP13239@google.com \
--to=computersforpeace@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=jaedon.shin@gmail.com \
--cc=kishon@ti.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=robh+dt@kernel.org \
--cc=tj@kernel.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.