From: Florian Fainelli <f.fainelli@gmail.com>
To: Jaedon Shin <jaedon.shin@gmail.com>,
Brian Norris <computersforpeace@gmail.com>,
Tejun Heo <tj@kernel.org>, Kishon Vijay Abraham I <kishon@ti.com>,
Ralf Baechle <ralf@linux-mips.org>
Cc: Rob Herring <robh+dt@kernel.org>,
Kevin Cernekee <cernekee@gmail.com>,
Dragan Stancevic <dragan.stancevic@gmail.com>,
linux-ide@vger.kernel.org, Linux-MIPS <linux-mips@linux-mips.org>,
devicetree@vger.kernel.org
Subject: Re: [v2 01/10] ata: ahci_brcmstb: add quick for broken ncq
Date: Tue, 27 Oct 2015 08:46:26 -0700 [thread overview]
Message-ID: <562F9C52.8060609@gmail.com> (raw)
In-Reply-To: <1445928491-7320-2-git-send-email-jaedon.shin@gmail.com>
On 26/10/15 23:48, Jaedon Shin wrote:
> Add quick for bronken ncq. The chipsets (eg. BCM7439A0, BCM7445A0 and
> BCM7445B0) need a workaround disabling NCQ. and it may need the
> MIPS-based set-top box platforms.
None of these chips are production chips, so at this point, disabling
NCQ should be done based on the compatible string we probed the driver
with, not using a specific property.
There are more comments below
>
> Signed-off-by: Jaedon Shin <jaedon.shin@gmail.com>
> ---
[snip]
>
> +static void brcm_sata_quick(struct platform_device *pdev,
> + struct brcm_ahci_priv *priv)
> +{
> + void __iomem *ahci;
> + struct resource *res;
> + u32 reg;
> +
> + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ahci");
> + ahci = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(ahci))
> + return;
> +
> + if (priv->quicks & BRCM_AHCI_QUICK_NONCQ) {
> + reg = readl(priv->top_ctrl + SATA_TOP_CTRL_BUS_CTRL);
> + reg |= OVERRIDE_HWINIT;
> + writel(reg, priv->top_ctrl + SATA_TOP_CTRL_BUS_CTRL);
> +
> + /* Clear out the NCQ bit so the AHCI driver will not issue
> + * FPDMA/NCQ commands.
> + */
> + reg = readl(ahci + HOST_CAP);
> + reg &= ~HOST_CAP_NCQ;
> + writel(reg, ahci + HOST_CAP);
> +
> + reg = readl(priv->top_ctrl + SATA_TOP_CTRL_BUS_CTRL);
> + reg &= ~OVERRIDE_HWINIT;
> + writel(reg, priv->top_ctrl + SATA_TOP_CTRL_BUS_CTRL);
> + }
In the original BSP, the NCQ disabling occurs prior to initializing the
SATA controller endianess. We would want to keep doing that in the same
order, and use brcm_sata_readreg() and brcm_sata_writereg() which take
care of doing these accesses in the native endianess of the system.
Reference is here:
https://github.com/Broadcom/stblinux-3.3/blob/master/linux/drivers/brcmstb/bchip.c#L254
> +
> + devm_iounmap(&pdev->dev, ahci);
> + devm_release_mem_region(&pdev->dev, res->start, resource_size(res));
> +}
> +
> #ifdef CONFIG_PM_SLEEP
> static int brcm_ahci_suspend(struct device *dev)
> {
> @@ -256,7 +294,11 @@ static int brcm_ahci_probe(struct platform_device *pdev)
> if (IS_ERR(priv->top_ctrl))
> return PTR_ERR(priv->top_ctrl);
>
> + if (of_property_read_bool(dev->of_node, "brcm,broken-ncq"))
> + priv->quicks |= BRCM_AHCI_QUICK_NONCQ;
> +
> brcm_sata_init(priv);
> + brcm_sata_quick(pdev, priv);
Florian
next prev parent reply other threads:[~2015-10-27 15:47 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-27 6:48 [v2 00/10] add support SATA for BMIPS_GENERIC Jaedon Shin
[not found] ` <1445928491-7320-1-git-send-email-jaedon.shin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-27 6:48 ` [v2 01/10] ata: ahci_brcmstb: add quick for broken ncq Jaedon Shin
2015-10-27 6:48 ` Jaedon Shin
2015-10-27 15:46 ` Florian Fainelli [this message]
2015-10-27 6:48 ` [v2 02/10] ata: ahci_brcmstb: add support MIPS-based platforms Jaedon Shin
2015-10-27 6:48 ` Jaedon Shin
[not found] ` <1445928491-7320-3-git-send-email-jaedon.shin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-27 16:35 ` Brian Norris
2015-10-27 16:35 ` Brian Norris
2015-10-27 6:48 ` [v2 10/10] MIPS: BMIPS: brcmstb: add SATA/PHY nodes for bcm7362 Jaedon Shin
2015-10-27 6:48 ` Jaedon Shin
2015-10-27 6:48 ` [v2 03/10] ata: ahci_brcmstb: add quick for broken phy Jaedon Shin
2015-10-27 8:17 ` Rob Herring
2015-10-27 9:55 ` Jaedon Shin
2015-10-27 15:54 ` Florian Fainelli
2015-10-27 6:48 ` [v2 04/10] ata: ahci_brcmstb: remove unused definitions Jaedon Shin
2015-10-27 6:48 ` [v2 05/10] phy: phy_brcmstb_sata: remove duplicate definitions Jaedon Shin
2015-10-27 6:48 ` [v2 06/10] phy: phy_brcmstb_sata: add data for phy version Jaedon Shin
2015-10-31 15:20 ` Arnd Bergmann
2015-10-27 6:48 ` [v2 07/10] phy: phy_brcmstb_sata: add support MIPS-based platforms Jaedon Shin
2015-10-27 19:28 ` Rob Herring
2015-10-27 6:48 ` [v2 08/10] MIPS: BMIPS: brcmstb: add SATA/PHY nodes for bcm7425 Jaedon Shin
2015-10-27 6:48 ` [v2 09/10] MIPS: BMIPS: brcmstb: add SATA/PHY nodes for bcm7346 Jaedon Shin
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=562F9C52.8060609@gmail.com \
--to=f.fainelli@gmail.com \
--cc=cernekee@gmail.com \
--cc=computersforpeace@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dragan.stancevic@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.