From: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Hauke Mehrtens <hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
Cc: ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org,
linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org,
john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org,
linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
hauke.mehrtens-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH v8 10/16] reset: Add a reset controller driver for the Lantiq XWAY based SoCs
Date: Thu, 03 Aug 2017 10:33:42 +0200 [thread overview]
Message-ID: <1501749222.23911.4.camel@pengutronix.de> (raw)
In-Reply-To: <20170802225717.24408-11-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
Hi Hauke,
On Thu, 2017-08-03 at 00:57 +0200, Hauke Mehrtens wrote:
> From: Martin Blumenstingl <martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
>
> The reset controllers (on xRX200 and newer SoCs have two of them) are
> provided by the RCU module. This was initially implemented as a simple
> reset controller. However, the RCU module provides more functionality
> (ethernet GPHYs, USB PHY, etc.), which makes it a MFD device.
> The old reset controller driver implementation from
> arch/mips/lantiq/xway/reset.c did not honor this fact.
>
> For some devices the request and the status bits are different.
>
> Signed-off-by: Hauke Mehrtens <hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
> Cc: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Reviewed-by: Andy Shevchenko <andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> .../devicetree/bindings/reset/lantiq,reset.txt | 30 +++
> drivers/reset/Kconfig | 6 +
> drivers/reset/Makefile | 1 +
> drivers/reset/reset-lantiq.c | 224 +++++++++++++++++++++
> 4 files changed, 261 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/reset/lantiq,reset.txt
> create mode 100644 drivers/reset/reset-lantiq.c
>
[...]
> diff --git a/drivers/reset/reset-lantiq.c b/drivers/reset/reset-lantiq.c
> new file mode 100644
> index 000000000000..b84c45e7e6b8
> --- /dev/null
> +++ b/drivers/reset/reset-lantiq.c
> @@ -0,0 +1,224 @@
[...]
> +static int lantiq_rcu_reset_of_probe(struct platform_device *pdev,
> + struct lantiq_rcu_reset_priv *priv)
> +{
> + struct device *dev = &pdev->dev;
> + struct resource *res;
> + struct resource res_parent;
> + int ret;
> +
> + priv->regmap = syscon_node_to_regmap(dev->of_node->parent);
> + if (IS_ERR(priv->regmap)) {
> + dev_err(&pdev->dev, "Failed to lookup RCU regmap\n");
> + return PTR_ERR(priv->regmap);
> + }
> +
> + ret = of_address_to_resource(dev->of_node->parent, 0, &res_parent);
> + if (ret)
> + return ret;
> +
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + if (!res) {
> + dev_err(&pdev->dev, "Failed to get RCU reset offset\n");
> + return ret;
This should return -EINVAL instead of 0.
> + }
> +
> + if (res->start < res_parent.start)
> + return -ENOENT;
> + priv->reset_offset = res->start - res_parent.start;
> +
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> + if (!res) {
> + dev_err(&pdev->dev, "Failed to get RCU status offset\n");
> + return ret;
Same here.
With this fixed,
Acked-by: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
regards
Philipp
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-08-03 8:33 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-02 22:57 [PATCH v8 00/16] MIPS: lantiq: handle RCU register by separate drivers Hauke Mehrtens
[not found] ` <20170802225717.24408-1-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2017-08-02 22:57 ` [PATCH v8 01/16] MIPS: lantiq: Use of_platform_default_populate instead of __dt_register_buses Hauke Mehrtens
2017-08-02 22:57 ` [PATCH v8 02/16] mtd: lantiq-flash: drop check of boot select Hauke Mehrtens
2017-08-02 22:57 ` [PATCH v8 03/16] mtd: spi-falcon: " Hauke Mehrtens
2017-08-02 22:57 ` [PATCH v8 04/16] watchdog: lantiq: access boot cause register through regmap Hauke Mehrtens
2017-08-02 22:57 ` [PATCH v8 05/16] watchdog: lantiq: add device tree binding documentation Hauke Mehrtens
2017-08-02 22:57 ` [PATCH v8 06/16] MIPS: lantiq: Enable MFD_SYSCON to be able to use it for the RCU MFD Hauke Mehrtens
2017-08-02 22:57 ` [PATCH v8 07/16] Documentation: DT: MIPS: lantiq: Add docs for the RCU bindings Hauke Mehrtens
2017-08-02 22:57 ` [PATCH v8 08/16] MIPS: lantiq: Convert the fpi bus driver to a platform_driver Hauke Mehrtens
2017-08-02 22:57 ` [PATCH v8 09/16] MIPS: lantiq: remove ltq_reset_cause() and ltq_boot_select() Hauke Mehrtens
2017-08-02 22:57 ` [PATCH v8 10/16] reset: Add a reset controller driver for the Lantiq XWAY based SoCs Hauke Mehrtens
[not found] ` <20170802225717.24408-11-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2017-08-03 8:33 ` Philipp Zabel [this message]
2017-08-03 21:41 ` Hauke Mehrtens
2017-08-02 22:57 ` [PATCH v8 11/16] MIPS: lantiq: remove old reset controller implementation Hauke Mehrtens
2017-08-02 22:57 ` [PATCH v8 12/16] MIPS: lantiq: Add a GPHY driver which uses the RCU syscon-mfd Hauke Mehrtens
2017-08-02 22:57 ` [PATCH v8 13/16] MIPS: lantiq: remove old GPHY loader code Hauke Mehrtens
2017-08-02 22:57 ` [PATCH v8 14/16] phy: Add an USB PHY driver for the Lantiq SoCs using the RCU module Hauke Mehrtens
[not found] ` <20170802225717.24408-15-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2017-08-07 13:41 ` Hauke Mehrtens
2017-08-08 11:58 ` Kishon Vijay Abraham I
[not found] ` <85db1866-9d8d-e7af-b193-bc329db9129b-l0cyMroinI0@public.gmane.org>
2017-08-08 22:54 ` Hauke Mehrtens
2017-08-02 22:57 ` [PATCH v8 15/16] MIPS: lantiq: remove old USB PHY initialisation Hauke Mehrtens
2017-08-02 22:57 ` [PATCH v8 16/16] MIPS: lantiq: Remove the arch/mips/lantiq/xway/reset.c implementation Hauke Mehrtens
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=1501749222.23911.4.camel@pengutronix.de \
--to=p.zabel-bicnvbalz9megne8c9+irq@public.gmane.org \
--cc=andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org \
--cc=hauke.mehrtens-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org \
--cc=linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
--cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org \
--cc=ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).