From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 7/7] stmmac: dwmac-sti: Pass sysconfig register offset via syscon dt property.
Date: Wed, 19 Nov 2014 08:51:02 +0000 [thread overview]
Message-ID: <20141119085102.GH13959@x1> (raw)
In-Reply-To: <1416385632-5832-8-git-send-email-peter.griffin@linaro.org>
On Wed, 19 Nov 2014, Peter Griffin wrote:
> Based on Arnds review comments here https://lkml.org/lkml/2014/11/13/161,
> we should not be mixing address spaces in the reg property like this driver
> currently does. This patch updates the driver, dt docs and also the existing
> dt nodes to pass the sysconfig offset in the syscon dt property.
>
> This patch breaks DT compatibility! But this platform is considered WIP, and is only
> used by a few developers who are upstreaming support for it. This change has been done
> as a single atomic commit to ensure it is bisectable.
>
> Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
> ---
> Documentation/devicetree/bindings/net/sti-dwmac.txt | 14 +++++---------
> arch/arm/boot/dts/stih415.dtsi | 12 ++++++------
> arch/arm/boot/dts/stih416.dtsi | 12 ++++++------
> drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 13 +++++++------
> 4 files changed, 24 insertions(+), 27 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/sti-dwmac.txt b/Documentation/devicetree/bindings/net/sti-dwmac.txt
> index 6762a6b..d05c1e1 100644
> --- a/Documentation/devicetree/bindings/net/sti-dwmac.txt
> +++ b/Documentation/devicetree/bindings/net/sti-dwmac.txt
> @@ -9,14 +9,10 @@ The device node has following properties.
> Required properties:
> - compatible : Can be "st,stih415-dwmac", "st,stih416-dwmac",
> "st,stih407-dwmac", "st,stid127-dwmac".
> - - reg : Offset of the glue configuration register map in system
> - configuration regmap pointed by st,syscon property and size.
Looks like you are removing the reg property description completely?
> - - st,syscon : Should be phandle to system configuration node which
> - encompases this glue registers.
> + - st,syscon : Should be phandle/offset pair. The phandle to the syscon node which
> + encompases the glue register, and the offset of the control register.
> - st,gmac_en: this is to enable the gmac into a dedicated sysctl control
> register available on STiH407 SoC.
> - - sti-ethconf: this is the gmac glue logic register to enable the GMAC,
> - select among the different modes and program the clk retiming.
> - pinctrl-0: pin-control for all the MII mode supported.
[...]
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
> @@ -123,7 +123,7 @@ struct sti_dwmac {
> bool ext_phyclk; /* Clock from external PHY */
> u32 tx_retime_src; /* TXCLK Retiming*/
> struct clk *clk; /* PHY clock */
> - int ctrl_reg; /* GMAC glue-logic control register */
> + u32 ctrl_reg; /* GMAC glue-logic control register */
> int clk_sel_reg; /* GMAC ext clk selection register */
> struct device *dev;
> struct regmap *regmap;
> @@ -286,11 +286,6 @@ static int sti_dwmac_parse_data(struct sti_dwmac *dwmac,
> if (!np)
> return -EINVAL;
>
> - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sti-ethconf");
> - if (!res)
> - return -ENODATA;
> - dwmac->ctrl_reg = res->start;
> -
> /* clk selection from extra syscfg register */
> dwmac->clk_sel_reg = -ENXIO;
> res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sti-clkconf");
> @@ -301,6 +296,12 @@ static int sti_dwmac_parse_data(struct sti_dwmac *dwmac,
> if (IS_ERR(regmap))
> return PTR_ERR(regmap);
>
> + err = of_property_read_u32_index(np, "st,syscon", 1, &dwmac->ctrl_reg);
A few platforms have this format for sysconn now. We should toy with
the idea of either making this a standard call, and/or defining '1'.
> + if (err) {
> + dev_err(dev, "Can't get sysconfig ctrl offset (%d)\n", err);
> + return err;
> + }
> +
> dwmac->dev = dev;
> dwmac->interface = of_get_phy_mode(np);
> dwmac->regmap = regmap;
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
WARNING: multiple messages have this Message-ID (diff)
From: Lee Jones <lee.jones@linaro.org>
To: Peter Griffin <peter.griffin@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, srinivas.kandagatla@gmail.com,
maxime.coquelin@st.com, patrice.chotard@st.com,
peppe.cavallaro@st.com, kishon@ti.com, arnd@arndb.de,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
alexandre.torgue@st.com
Subject: Re: [PATCH 7/7] stmmac: dwmac-sti: Pass sysconfig register offset via syscon dt property.
Date: Wed, 19 Nov 2014 08:51:02 +0000 [thread overview]
Message-ID: <20141119085102.GH13959@x1> (raw)
In-Reply-To: <1416385632-5832-8-git-send-email-peter.griffin@linaro.org>
On Wed, 19 Nov 2014, Peter Griffin wrote:
> Based on Arnds review comments here https://lkml.org/lkml/2014/11/13/161,
> we should not be mixing address spaces in the reg property like this driver
> currently does. This patch updates the driver, dt docs and also the existing
> dt nodes to pass the sysconfig offset in the syscon dt property.
>
> This patch breaks DT compatibility! But this platform is considered WIP, and is only
> used by a few developers who are upstreaming support for it. This change has been done
> as a single atomic commit to ensure it is bisectable.
>
> Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
> ---
> Documentation/devicetree/bindings/net/sti-dwmac.txt | 14 +++++---------
> arch/arm/boot/dts/stih415.dtsi | 12 ++++++------
> arch/arm/boot/dts/stih416.dtsi | 12 ++++++------
> drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 13 +++++++------
> 4 files changed, 24 insertions(+), 27 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/sti-dwmac.txt b/Documentation/devicetree/bindings/net/sti-dwmac.txt
> index 6762a6b..d05c1e1 100644
> --- a/Documentation/devicetree/bindings/net/sti-dwmac.txt
> +++ b/Documentation/devicetree/bindings/net/sti-dwmac.txt
> @@ -9,14 +9,10 @@ The device node has following properties.
> Required properties:
> - compatible : Can be "st,stih415-dwmac", "st,stih416-dwmac",
> "st,stih407-dwmac", "st,stid127-dwmac".
> - - reg : Offset of the glue configuration register map in system
> - configuration regmap pointed by st,syscon property and size.
Looks like you are removing the reg property description completely?
> - - st,syscon : Should be phandle to system configuration node which
> - encompases this glue registers.
> + - st,syscon : Should be phandle/offset pair. The phandle to the syscon node which
> + encompases the glue register, and the offset of the control register.
> - st,gmac_en: this is to enable the gmac into a dedicated sysctl control
> register available on STiH407 SoC.
> - - sti-ethconf: this is the gmac glue logic register to enable the GMAC,
> - select among the different modes and program the clk retiming.
> - pinctrl-0: pin-control for all the MII mode supported.
[...]
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
> @@ -123,7 +123,7 @@ struct sti_dwmac {
> bool ext_phyclk; /* Clock from external PHY */
> u32 tx_retime_src; /* TXCLK Retiming*/
> struct clk *clk; /* PHY clock */
> - int ctrl_reg; /* GMAC glue-logic control register */
> + u32 ctrl_reg; /* GMAC glue-logic control register */
> int clk_sel_reg; /* GMAC ext clk selection register */
> struct device *dev;
> struct regmap *regmap;
> @@ -286,11 +286,6 @@ static int sti_dwmac_parse_data(struct sti_dwmac *dwmac,
> if (!np)
> return -EINVAL;
>
> - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sti-ethconf");
> - if (!res)
> - return -ENODATA;
> - dwmac->ctrl_reg = res->start;
> -
> /* clk selection from extra syscfg register */
> dwmac->clk_sel_reg = -ENXIO;
> res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sti-clkconf");
> @@ -301,6 +296,12 @@ static int sti_dwmac_parse_data(struct sti_dwmac *dwmac,
> if (IS_ERR(regmap))
> return PTR_ERR(regmap);
>
> + err = of_property_read_u32_index(np, "st,syscon", 1, &dwmac->ctrl_reg);
A few platforms have this format for sysconn now. We should toy with
the idea of either making this a standard call, and/or defining '1'.
> + if (err) {
> + dev_err(dev, "Can't get sysconfig ctrl offset (%d)\n", err);
> + return err;
> + }
> +
> dwmac->dev = dev;
> dwmac->interface = of_get_phy_mode(np);
> dwmac->regmap = regmap;
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2014-11-19 8:51 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-19 8:27 [PATCH 0/7] Fix sti drivers whcih mix reg address spaces Peter Griffin
2014-11-19 8:27 ` Peter Griffin
2014-11-19 8:27 ` Peter Griffin
2014-11-19 8:27 ` [PATCH 1/7] phy: phy-stih407-usb: Pass sysconfig register offsets via syscfg property Peter Griffin
2014-11-19 8:27 ` Peter Griffin
2014-11-19 8:27 ` [PATCH 2/7] phy: miphy365x: Pass sysconfig register offsets via syscfg dt property Peter Griffin
2014-11-19 8:27 ` Peter Griffin
2014-11-19 8:27 ` Peter Griffin
2014-11-19 10:42 ` Lee Jones
2014-11-19 10:42 ` Lee Jones
2014-11-19 8:27 ` [PATCH 3/7] ARM: STi: DT: STiH407: Add usb2 picophy dt nodes Peter Griffin
2014-11-19 8:27 ` Peter Griffin
2014-11-19 8:27 ` [PATCH 4/7] ARM: STi: DT: STiH410: " Peter Griffin
2014-11-19 8:27 ` Peter Griffin
2014-12-01 15:40 ` Arnd Bergmann
2014-12-01 15:40 ` Arnd Bergmann
2014-11-19 8:27 ` [PATCH 5/7] ARM: STi: DT: STiH410: Add DT nodes for the ehci and ohci usb controllers Peter Griffin
2014-11-19 8:27 ` Peter Griffin
2014-11-19 8:27 ` [PATCH 6/7] ARM: multi_v7_defconfig: Enable stih407 usb picophy Peter Griffin
2014-11-19 8:27 ` Peter Griffin
2014-11-19 8:27 ` [PATCH 7/7] stmmac: dwmac-sti: Pass sysconfig register offset via syscon dt property Peter Griffin
2014-11-19 8:27 ` Peter Griffin
2014-11-19 8:51 ` Lee Jones [this message]
2014-11-19 8:51 ` Lee Jones
2014-12-01 15:36 ` [PATCH 0/7] Fix sti drivers whcih mix reg address spaces Arnd Bergmann
2014-12-01 15:36 ` Arnd Bergmann
2014-12-01 15:36 ` Arnd Bergmann
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=20141119085102.GH13959@x1 \
--to=lee.jones@linaro.org \
--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.