ned-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 10 +-
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index 8506881..6b787d7 100644
--- a/d
Convert the exit hook into a standard driver remove function as
the hook doesn't really buy us anything extra.
Eventually the exit hook will be deprecated in favor of the driver
remove function.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
Use standard PM resume/suspend callbacks instead of the hooks in
stmmac_platform. This gives the driver more control and flexibility
when implementing PM functionality. The hooks in stmmac_platform
also doesn't buy us anything extra.
Signed-off-by: Joachim Eastwood
---
drivers/net/eth
Instead of adding hooks inside stmmac_platform it is better to just use
the standard PM callbacks within the specific dwmac-driver. This only
used by the dwmac-rk driver.
This reverts commit cecbc5563a02 ("stmmac: allow to split suspend/resume
from init/exit callbacks").
Signed-off-b
callbacks.
This conversion was pretty straight forward, but it would really nice
if some chromium people could test suspend/resume with this patch set.
Joachim Eastwood (4):
stmmac: dwmac-rk: turn resume/suspend into standard PM callbacks
stmmac: dwmac-rk: turn exit into standard driver remove
Since dwmac-sti is a DT only driver checking for OF node is not necessary.
Signed-off-by: Joachim Eastwood
Acked-by: Giuseppe Cavallaro
Tested-by: Giuseppe Cavallaro
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/ethernet
will be
refactored to use standard PM and remove callbacks.
Changes since v2:
- add missing static to sti_dwmac_pm_ops
- s/sti_dwmac_set_phy_mode/sti_dwmac_set_mode
- acked/tested by Giuseppe
Joachim Eastwood (7):
stmmac: dwmac-sti: remove useless of_node check
stmmac: dwmac-sti: remove
function.
Signed-off-by: Joachim Eastwood
Acked-by: Giuseppe Cavallaro
Tested-by: Giuseppe Cavallaro
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 47 +++--
1 file changed, 37 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
Add clock error handling to probe and in the process move clock enabling
out of sti_dwmac_init() to make this easier.
Signed-off-by: Joachim Eastwood
Acked-by: Giuseppe Cavallaro
Tested-by: Giuseppe Cavallaro
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 19 +++
1 file
Rename sti_dwmac_init to sti_dwmac_set_mode which is a better
description for what it really does.
Signed-off-by: Joachim Eastwood
Acked-by: Giuseppe Cavallaro
Tested-by: Giuseppe Cavallaro
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 10 --
1 file changed, 4 insertions(+), 6
The dev member of struct sti_dwmac is not used anywhere in the driver
so lets just remove it.
Signed-off-by: Joachim Eastwood
Acked-by: Giuseppe Cavallaro
Tested-by: Giuseppe Cavallaro
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 2 --
1 file changed, 2 deletions(-)
diff --git a
Since sti_dwmac_parse_data() sets dwmac->clk to NULL if not clock was
provided in DT and NULL is a valid clock there is no need to check for
NULL before using this clock.
Signed-off-by: Joachim Eastwood
Acked-by: Giuseppe Cavallaro
Tested-by: Giuseppe Cavallaro
---
drivers/net/ether
The sti_dwmac_init() function is called both from probe and resume.
Since DT properties doesn't change between suspend/resume cycles move
parsing of this parameter into sti_dwmac_parse_data() where it belongs.
Signed-off-by: Joachim Eastwood
Acked-by: Giuseppe Cavallaro
Tested-by: Giu
sk you, when rename the sti_dwmac_init in sti_dwmac_set_phy_mode
> to use another name: sti_dwmac_set_mode could be good, IMO.
Sure thing.
regards,
Joachim Eastwood
On 30 October 2016 at 21:05, Joachim Eastwood wrote:
> Implement PM callbacks and driver remove in the driver instead
> of relying on the init/exit hooks in stmmac_platform. This gives
> the driver more flexibility in how the code is organized.
>
> Eventually the init/exit ca
Hi,
On 1 November 2016 at 16:56, David Miller wrote:
> From: David Miller
> Date: Mon, 31 Oct 2016 15:47:26 -0400 (EDT)
>
>> From: Joachim Eastwood
>> Date: Sun, 30 Oct 2016 21:05:00 +0100
>>
>>> This patch set aims to remove the init/exit callbacks from
Hi Neil,
On 31 October 2016 at 11:54, Neil Armstrong wrote:
> Add Synopsys Designware MAC Glue layer for the Oxford Semiconductor OX820.
>
> Acked-by: Joachim Eastwood
> Signed-off-by: Neil Armstrong
> ---
> +static int oxnas_dwmac_init(struct oxnas_dwmac *dwmac)
> +{
&
3.242253] stmmac - user ID: 0x11, Synopsys ID: 0x36
[3.247653] Ring mode enabled
[3.251491] DMA HW capability register supported
[3.256336] Enhanced/Alternate descriptors
[3.261537] Enabled extended descriptors
[3.265968] RX Checksum Offload Engine supported (type 2)
[3.272249] TX Checksum insertion supported
[3.276874] Wake-Up On Lan supported
[3.283743] Enable RX Mitigation via HW Watchdog Timer
[3.326701] libphy: stmmac: probed
Synopsys ID: 0x36 and user UD: 0x11, gives us DWMAC version 3.611
regards,
Joachim Eastwood
Add clock error handling to probe and in the process move clock enabling
out of sti_dwmac_init() to make this easier.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 19 +++
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a
The dev member of struct sti_dwmac is not used anywhere in the driver
so lets just remove it.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
b/drivers/net
The sti_dwmac_init() function is called both from probe and resume.
Since DT properties doesn't change between suspend/resume cycles move
parsing of this parameter into sti_dwmac_parse_data() where it belongs.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-
Rename sti_dwmac_init to sti_dwmac_set_phy_mode which is a better
description for what it really does.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 10 --
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/stmicro
function.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 46 +++--
1 file changed, 36 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
index
Since sti_dwmac_parse_data() sets dwmac->clk to NULL if not clock was
provided in DT and NULL is a valid clock there is no need to check for
NULL before using this clock.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 10 --
1 file changed
Since dwmac-sti is a DT only driver checking for OF node is not necessary.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
b/drivers/net/ethernet/stmicro
will be
refactored to use standard PM and remove callbacks.
Note that this patch set has only been test compiled and no functional
change is intended.
Joachim Eastwood (7):
stmmac: dwmac-sti: remove useless of_node check
stmmac: dwmac-sti: remove clk NULL checks
stmmac: dwmac-sti: add PM
nd(struct device *dev)
> +{
> + struct net_device *ndev = dev_get_drvdata(dev);
> + struct stmmac_priv *priv = netdev_priv(ndev);
> + struct oxnas_dwmac *dwmac = priv->plat->bsp_priv;
get_stmmac_bsp_priv()
> + int ret;
> +
> + ret = stmmac_suspend(dev);
> + clk_disable_unprepare(dwmac->clk);
> +
> + return ret;
> +}
> +
> +static int oxnas_dwmac_resume(struct device *dev)
> +{
> + struct net_device *ndev = dev_get_drvdata(dev);
> + struct stmmac_priv *priv = netdev_priv(ndev);
> + struct oxnas_dwmac *dwmac = priv->plat->bsp_priv;
get_stmmac_bsp_priv()
> + int ret;
> +
> + ret = oxnas_dwmac_init(dwmac);
> + if (ret)
> + return ret;
> +
> + ret = stmmac_resume(dev);
> +
> + return ret;
> +}
> +#endif /* CONFIG_PM_SLEEP */
With these changes:
Acked-by: Joachim Eastwood
best regards,
Joachim Eastwood
ad. I.e: PM resume/suspend and driver remove.
Shouldn't you call oxnas_dwmac_init() from probe as well?
As it is now it will only be called during PM resume and that can't be right.
> +
> + return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
If stmmac_dvr_probe() fails you should disable your clocks.
regards,
Joachim Eastwood
you must retrieve it from plat_dat->bsp_priv.
I have some code for a helper to retrieve bsp_priv that I have meant
to sent to the ML for a while now.
See:
https://github.com/manabian/linux-lpc/commit/c3e155a6e38b9634e4e61aa4eeb4602ede7e44a6
Feel free to add it to your patch set if you want.
Alternatively take a look at the remove function from dwmac-stm32 here:
https://patchwork.ozlabs.org/patch/619816/
> +
> + return stmmac_pltfr_remove(pdev);
> +}
regards,
Joachim Eastwood
; + priv->plat->tx_coe = priv->dma_cap.tx_coe;
> +
> /* In case of GMAC4 rx_coe is from HW cap register. */
> priv->plat->rx_coe = priv->dma_cap.rx_coe;
Works for me on EA4357 board together with another patch to fix the DT
properties for DWMAC on lpc18xx.
Tested-by: Joachim Eastwood
regards,
Joachim Eastwood
Fix the following sparse warning:
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c:274:1: warning:
symbol 'socfpga_dwmac_pm_ops' was not declared. Should it be static?
Signed-off-by: Joachim Eastwood
---
Hi,
Noticed this sparse warning after my last batch of patches. Not so
ea
.
Signed-off-by: Joachim Eastwood
Tested-by: Marek Vasut
---
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 18 --
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
b/drivers/net/ethernet/stmicro/stmmac
Remove old init callback which now contains only a call to
socfpga_dwmac_setup(). Also rename socfpga_dwmac_setup() to indicate
what the function really does.
Signed-off-by: Joachim Eastwood
Tested-by: Marek Vasut
---
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 17
is located.
Signed-off-by: Joachim Eastwood
Tested-by: Marek Vasut
---
.../net/ethernet/stmicro/stmmac/dwmac-socfpga.c| 33 ++
1 file changed, 22 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
b/drivers/net/ethernet
Change stmmac_remove/resume/suspend to take a device pointer so
they can be used directly by drivers that doesn't need to perform
anything device specific.
This lets us remove the PCI pm functions and later simplifiy the
platform drivers.
Signed-off-by: Joachim Eastwood
Tested-by: Marek
- ret = stmmac_resume(ndev);
+ ret = stmmac_resume(dev);
return ret;
}
Joachim Eastwood (5):
stmmac: let remove/resume/suspend functions take device pointer
stmmac: dwmac-socfpga: add PM ops and resume function
stmmac: dwmac-socfpga: keep a copy of stmmac_rst in driver priv dat
Calling phy_resume() should only be need during driver resume to
workaround a hardware errata.
Signed-off-by: Joachim Eastwood
Tested-by: Marek Vasut
---
.../net/ethernet/stmicro/stmmac/dwmac-socfpga.c| 50 --
1 file changed, 19 insertions(+), 31 deletions(-)
diff
let me know if you have any preferred way of
handling this.
[1] https://patchwork.ozlabs.org/patch/613085/
[2] https://patchwork.ozlabs.org/patch/614405/
Joachim Eastwood (5):
stmmac: let remove/resume/suspend functions take device pointer
stmmac: dwmac-socfpga: add PM ops and resume fun
Change stmmac_remove/resume/suspend to take a device pointer so
they can be used directly by drivers that doesn't need to perform
anything device specific.
This lets us remove the PCI pm functions and later simplifiy the
platform drivers.
Signed-off-by: Joachim Eastwood
Tested-by: Marek
.
Signed-off-by: Joachim Eastwood
Tested-by: Marek Vasut
---
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 18 --
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
b/drivers/net/ethernet/stmicro/stmmac
Remove old init callback which now contains only a call to
socfpga_dwmac_setup(). Also rename socfpga_dwmac_setup() to indicate
what the function really does.
Signed-off-by: Joachim Eastwood
Tested-by: Marek Vasut
---
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 17
Calling phy_resume() should only be need during driver resume to
workaround a hardware errata.
Signed-off-by: Joachim Eastwood
Tested-by: Marek Vasut
---
.../net/ethernet/stmicro/stmmac/dwmac-socfpga.c| 50 --
1 file changed, 19 insertions(+), 31 deletions(-)
diff
is located.
Signed-off-by: Joachim Eastwood
Tested-by: Marek Vasut
---
.../net/ethernet/stmicro/stmmac/dwmac-socfpga.c| 33 ++
1 file changed, 22 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
b/drivers/net/ethernet
On 26 April 2016 at 14:47, Marek Vasut wrote:
> On 04/26/2016 02:26 PM, Joachim Eastwood wrote:
>> On 26 April 2016 at 00:55, Marek Vasut wrote:
>>> On 04/25/2016 08:11 PM, Joachim Eastwood wrote:
>>>> On 21 April 2016 at 14:11, Marek Vasut wrote:
>>&
On 26 April 2016 at 00:55, Marek Vasut wrote:
> On 04/25/2016 08:11 PM, Joachim Eastwood wrote:
>> On 21 April 2016 at 14:11, Marek Vasut wrote:
>>>
>>> Finally, plat_dat->exit and socfpga_dwmac_exit() is no longer necessary,
>>> since the functionality
et controller is
> @@ -245,7 +228,7 @@ static int socfpga_dwmac_init(struct platform_device
> *pdev, void *priv)
> * control register 0, and can be modified by the phy driver
> * framework.
> */
> - if (stpriv && stpriv->phydev)
> + if (stpriv->phydev)
> phy_resume(stpriv->phydev);
Before this change phy_resume() was only called during driver resume
when , but your patches cause phy_resume() to called at probe time as
well. Is this okey?
regards,
Joachim Eastwood
I intend to keep the init/exit callbacks since they are
still used by Blackfin and Loongson, but new DT enabled drivers should
not use these callbacks anymore.
If you are willing to test my patch set for dwmac-socfpga(?). I'll see
if I can create the time to send them to netdev early this week.
regards,
Joachim Eastwood
ould be able to check which clocks
the MAC really needs.
Rockchip bindings have two clocks named "mac_clk_rx" and "mac_clk_tx".
These are probably the same as stm32 needs so maybe use these names
and move them into the main doc and update the rockchip binding.
regards,
Joachim Eastwood
've been better if the versioned strings were
> only used to indicate functionality, and not used to bind
> the drivers. But the bindings were set some time ago.
Since Alexandre has not added "snps,dwmac-3.50a" to dwmac-generic
doesn't he use it as you suggest here?
Note that we can not remove all the generic compatible strings from
dwmac-generic because there is one platform that depend on one of
them.
(see arch/arm/boot/dts/exynos5440.dtsi:190)
So we can not remove "snps,dwmac-3.70a" from the dwmac-generic driver
if we want to keep backwards compatibility with exynos5440. But I
guess we could remove the others if we want to.
regards,
Joachim Eastwood
.
>
> Signed-off-by: Alexandre TORGUE
Driver looks good now, thanks.
Reviewed-by: Joachim Eastwood
regards,
Joachim Eastwood
;macirq", "eth_wake_irq";
> + clock-names = "stmmaceth", "tx-clk", "rx-clk";
> + clocks = <&rcc 0 25>, <&rcc 0 26>, <&rcc 0 27>;
> + st,syscon = <&syscfg 0x4>;
> + snps,pbl = <8>;
> + snps,mixed-burst;
> + dma-ranges;
> + };
Looks just like any other dwmac-driver binding so:
Acked-by: Joachim Eastwood
regards,
Joachim Eastwood
rq", "eth_wake_irq";
> + clock-names = "stmmaceth", "tx-clk", "rx-clk";
> + clocks = <&rcc 0 25>, <&rcc 0 26>, <&rcc 0 27>;
> + st,syscon = <&syscfg 0x4>;
> + snps,pbl = <32>;
Regarding snps,pbl; using 32 here might not give you what you would except.
See comment in dwmac1000_dma_init().
The driver is hard coded to use PBL4X/PBL8X mode. Just a heads up.
regards,
Joachim Eastwood
xit(priv->plat->bsp_priv);
> +
> + return ret;
> +}
> +
> +#ifdef CONFIG_PM_SLEEP
> +static int stm32_dwmac_suspend(struct device *dev)
> +{
> + struct net_device *ndev = dev_get_drvdata(dev);
> + struct stmmac_priv *priv = netdev_priv(ndev);
> + int ret;
> +
> + ret = stmmac_suspend(ndev);
> + stm32_dwmac_exit(priv->plat->bsp_priv);
> +
> + return ret;
> +}
> +
> +static int stm32_dwmac_resume(struct device *dev)
> +{
> + struct net_device *ndev = dev_get_drvdata(dev);
> + struct stmmac_priv *priv = netdev_priv(ndev);
> + int ret;
> +
> + ret = stm32_dwmac_init(priv->plat->bsp_priv);
> + if (ret)
> + goto out_regmap;
> +
> + ret = stmmac_resume(ndev);
> +
> +out_regmap:
> + return ret;
Why the goto?
This could be written:
ret = stm32_dwmac_init(priv->plat->bsp_priv);
if (ret)
return ret;
return stmmac_resume(ndev);
regards,
Joachim Eastwood
On 23 February 2016 at 10:59, Alexandre Torgue
wrote:
> 2016-02-22 22:52 GMT+01:00 Joachim Eastwood :
>> On 22 February 2016 at 15:50, Alexandre Torgue
>> wrote:
>>> 2016-02-13 14:48 GMT+01:00 Joachim Eastwood :
>>>> On 3 February 2016 at
On 22 February 2016 at 15:50, Alexandre Torgue
wrote:
> 2016-02-13 14:48 GMT+01:00 Joachim Eastwood :
>> On 3 February 2016 at 15:54, Alexandre TORGUE
>> wrote:
>>> + plat_dat->bsp_priv = dwmac;
>>> + plat_dat->init = stm32_dwmac_init;
>&g
onst struct of_device_id stm32_dwmac_match[] = {
> + { .compatible = "st,stm32-dwmac"},
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, stm32_dwmac_match);
> +
> +static struct platform_driver stm32_dwmac_driver = {
> + .probe = stm32_dwmac_probe,
> + .remove = stmmac_pltfr_remove,
Could you implement the .remove callback in your driver instead of
using stmmac_pltfr_remove?
Same reasons as above.
> + .driver = {
> + .name = "stm32-dwmac",
> + .pm = &stmmac_pltfr_pm_ops,
> + .of_match_table = stm32_dwmac_match,
> + },
> +};
> +module_platform_driver(stm32_dwmac_driver);
> +
> +MODULE_AUTHOR("Alexandre Torgue ");
> +MODULE_DESCRIPTION("STMicroelectronics MCU DWMAC Specific Glue layer");
> +MODULE_LICENSE("GPL");
Since you state:
> + * License terms: GNU General Public License (GPL), version 2
You might want to switch use: MODULE_LICENSE("GPL v2");
regards,
Joachim Eastwood
tmmac_platform: Unknown symbol of_alias_get_id (err 0)
stmmac_platform: Unknown symbol stmmac_resume (err 0)
stmmac_platform: Unknown symbol stmmac_dvr_probe (err 0)
Fixes: 50649ab14982 ("stmmac: drop driver from stmmac platform code")
Reported-by: Igor Gnatenko
Signed-off-by: Joachim Ea
tmmac_platform: Unknown symbol of_alias_get_id (err 0)
stmmac_platform: Unknown symbol stmmac_resume (err 0)
stmmac_platform: Unknown symbol stmmac_dvr_probe (err 0)
Fixes: 50649ab14982 ("stmmac: drop driver from stmmac platform code")
Reported-by: Igor Gnatenko
Signed-off-by: Joachim Ea
mac_resume (err 0)
> stmmac_platform: Unknown symbol stmmac_dvr_probe (err 0)
I'll look into this as well.
> I've filled bugreport with the same info[1]. What info I would provide
> to help with fixing this?
Thanks for reporting. If you could test patch I will send out soon
tha
By using a few functions from stmmac_platform a proper probe
function can be created from the setup glue callback. This
makes it look more like a standard driver and the OF match
data can also be dropped.
Signed-off-by: Joachim Eastwood
---
.../net/ethernet/stmicro/stmmac/dwmac-socfpga.c
Create a new private structure for OF match data in the
dwmac-sti driver. This enables us to eventually drop the
common OF match data structure which contains a lot of
unused fields.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 11 ---
1 file
As all dwmac-* drivers now have their own probe function move
the common one into dwmac-generic driver and drop the EXPORT.
Signed-off-by: Joachim Eastwood
---
.../net/ethernet/stmicro/stmmac/dwmac-generic.c| 49 ++-
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 55
Create a new probe functions that call the necessary setup
functions. This is done in preparation for a code refactor
in this driver and dropping the common probe function in
stmmac_platform.c.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 40
Move sun7i_gmac_setup in preparation for turning it into
a proper probe function.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c | 58 +++
1 file changed, 29 insertions(+), 29 deletions(-)
diff --git a/drivers/net/ethernet/stmicro
By using a few functions from stmmac_platform a proper probe
function can be created from the setup glue callback. This
makes it look more like a standard driver and prepares the
driver for further clean ups.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
Move socfpga_dwmac_probe in preparation for turning it into
a proper probe function.
Signed-off-by: Joachim Eastwood
---
.../net/ethernet/stmicro/stmmac/dwmac-socfpga.c| 50 +++---
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/drivers/net/ethernet/stmicro
By using a few functions from stmmac_platform a proper probe
function can be created from the setup glue callback. This
makes it look more like a standard driver and the OF match
data can also be dropped.
Signed-off-by: Joachim Eastwood
---
.../net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
Remove the two platform specific init callbacks and make
them use a common one by creating a function member in
the internal data structure. This allow us to remove the
layer of indirection and simplify the code a bit.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac
Remove the setup glue callback and use rk_gmac_ops as OF match
data so it can used directly when calling rk_gmac_setup.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 27 --
1 file changed, 4 insertions(+), 23 deletions(-)
diff
Move ipq806x_gmac_fix_mac_speed in preparation for turning
the setup glue callback in a proper probe function.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net
As dwmac-* drivers that need OF match have been converted
to use their own internal OF match data structure this can
now be removed.
Signed-off-by: Joachim Eastwood
---
Documentation/networking/stmmac.txt | 2 --
include/linux/stmmac.h | 18 --
2 files changed, 20
rdown.
Signed-off-by: Joachim Eastwood
---
Documentation/networking/stmmac.txt | 8 ++--
drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c | 7 ---
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 ---
include/linux/stmmac.h| 2 --
4
Since only a few of the dwmac-* drivers actually need to use
the OF match move handling into the dwmac-* drivers that need
it. This will also allow dwmac-* drivers to use their own
custom match data structure.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
Mark the rk_gmac_ops structures as static const as they should be.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
b/drivers/net
etdev/msg328997.html
http://www.spinics.net/lists/netdev/msg329932.html
http://www.spinics.net/lists/netdev/msg336097.html
Fengguang Wu (1):
stmmac: fix ptr_ret.cocci warning
Joachim Eastwood (16):
stmmac: dwmac-ipq806x: move ipq806x_gmac_fix_mac_speed function
stmmac: dwmac-ipq806x: turn
before return]
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index
By using a few functions from stmmac_platform a proper probe
function can be created from the setup glue callback. This
makes it look more like a standard driver and the OF match
data can also be dropped.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c | 49
g the correct variable.
Fixes: 803f8fc46274b ("stmmac: move driver data setting into stmmac_dvr_probe")
Signed-off-by: Joachim Eastwood
---
Hi,
I have no idea why I didn't notice (or anyone else for that
matter) this issue before now. Looking at 803f8fc46274b
it's pretty obvi
users in mainline does this.
This change will allow dt dwmac-* drivers to call the config_dt()
function from probe to create the needed platform data struct and
retrieve common dt properties.
Signed-off-by: Joachim Eastwood
---
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 50
Export stmmac_probe_config_dt() and stmmac_get_platform_resources()
so they can be used in the dwmac-* drivers themselves. This will
allow us to build more flexible and standalone drivers which just
use stmmac_platform as a library for setup functions.
Signed-off-by: Joachim Eastwood
By using of_device_get_match_data() the code that retrieve
match data can be simplified quite a bit.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 8 +++-
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/stmicro
Refactor all code that deals with platform resources into it's
own get function. This function will later be used in the probe
function in dwmac-* drivers.
Signed-off-by: Joachim Eastwood
---
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 64 +-
1 file change
By using a few functions from stmmac_platform we can now create
a proper probe function in this driver. By doing so we can drop
the OF match data and simplify the overall driver.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c | 31
greatly appreciated.
Previous parts can be found here:
http://www.spinics.net/lists/netdev/msg328997.html
http://www.spinics.net/lists/netdev/msg329932.html
Joachim Eastwood (8):
stmmac: use of_device_get_match_data to retrieve of match data
stmmac: clean up platform/of_match data retrieval
By using a few functions from stmmac_platform we can now create
a proper probe function in this driver. By doing so we can drop
the OF match data and simplify the overall driver.
Signed-off-by: Joachim Eastwood
---
.../net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c| 59
Both of these fields are unused and has been unused since they
were added 3 and 5 years ago. Drop them since they are clearly
not very useful.
Signed-off-by: Joachim Eastwood
---
Documentation/networking/stmmac.txt | 4
include/linux/stmmac.h | 2 --
2 files changed, 6
Since stmmac_probe_config_dt() allocates the platform data structure
it is cleaner if it just returned this structure directly. This
function will later be used in the probe function in dwmac-* drivers.
Signed-off-by: Joachim Eastwood
---
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 28
Creat a struct that contain all the resources that needs to be
assigned to the priv struct in stmmac_dvr_probe. This makes it
possible to factor out more common code from the other probe
functions and also use this struct to hold the resources as
they are fetched.
Signed-off-by: Joachim Eastwood
igned-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 6 --
1 file changed, 6 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 10de9351a1ec..d2bb7907bf61 100644
probe code, hence
part 1, but I need some more time on this.
Joachim Eastwood (4):
stmmac: move driver data setting into stmmac_dvr_probe
stmmac: let stmmac_dvr_probe take a struct of resources
stmmac: change the stmmac_dvr_probe return type to int
stmmac: drop unnecessary dt checks in
: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 6 +++---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 15 +++
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 11 +--
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 11
Move setting of driver data into stmmac_dvr_probe so the
other probe functions don't have to. This will help to
simplify the other probe functions later.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 ++
drivers/net/ethernet/stmicro/s
platform drivers.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 14 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h | 4
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac
Convert platform glue layer into a proper platform
driver and add it to the build system.
Signed-off-by: Joachim Eastwood
---
drivers/net/ethernet/stmicro/stmmac/Kconfig| 11 +
drivers/net/ethernet/stmicro/stmmac/Makefile | 3 ++-
drivers/net/ethernet/stmicro/stmmac/dwmac
On 12 May 2015 at 21:49, Arnd Bergmann wrote:
> On Tuesday 12 May 2015 19:20:45 Joachim Eastwood wrote:
>>
>> I have now created a generic dt dwmac driver which contain all compat
>> strings that doesn't have any match data. As long as this driver is
>> linked
tion via HW Watchdog Timer
[2.923122] libphy: stmmac: probed
[2.927750] eth0: PHY ID 0007c0f1 at 1 IRQ POLL (stmmac-0:01) active
[ 94.735120] No MAC Management Counters available
[ 97.767758] stmmaceth 4001.ethernet eth0: Link is Up - 100Mbps/Full -
flow control off
Joachim Eas
96 matches
Mail list logo