[PATCH net-next 3/4] stmmac: dwmac-rk: absorb rk_gmac_init into probe

2016-11-05 Thread Joachim Eastwood
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

[PATCH net-next 2/4] stmmac: dwmac-rk: turn exit into standard driver remove callback

2016-11-05 Thread Joachim Eastwood
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

[PATCH net-next 1/4] stmmac: dwmac-rk: turn resume/suspend into standard PM callbacks

2016-11-05 Thread Joachim Eastwood
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

[PATCH net-next 4/4] Revert "net: stmmac: allow to split suspend/resume from init/exit callbacks"

2016-11-05 Thread Joachim Eastwood
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

[PATCH net-next 0/4] stmmac: dwmac-rk: convert to standard PM/remove functions

2016-11-05 Thread Joachim Eastwood
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

[net-next v2 1/7] stmmac: dwmac-sti: remove useless of_node check

2016-11-04 Thread Joachim Eastwood
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

[net-next v2 0/7] stmmac: dwmac-sti refactor+cleanup

2016-11-04 Thread Joachim Eastwood
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

[net-next v2 3/7] stmmac: dwmac-sti: add PM ops and resume function

2016-11-04 Thread Joachim Eastwood
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

[net-next v2 5/7] stmmac: dwmac-sti: move clk_prepare_enable out of init and add error handling

2016-11-04 Thread 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 Acked-by: Giuseppe Cavallaro Tested-by: Giuseppe Cavallaro --- drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 19 +++ 1 file

[net-next v2 6/7] stmmac: dwmac-sti: clean up and rename sti_dwmac_init

2016-11-04 Thread Joachim Eastwood
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

[net-next v2 7/7] stmmac: dwmac-sti: remove unused priv dev member

2016-11-04 Thread Joachim Eastwood
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

[net-next v2 2/7] stmmac: dwmac-sti: remove clk NULL checks

2016-11-04 Thread Joachim Eastwood
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

[net-next v2 4/7] stmmac: dwmac-sti: move st,gmac_en parsing to sti_dwmac_parse_data

2016-11-04 Thread Joachim Eastwood
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

Re: [net-next PATCH 0/7] stmmac: dwmac-sti refactor+cleanup

2016-11-04 Thread Joachim Eastwood
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

Re: [net-next PATCH 3/7] stmmac: dwmac-sti: add PM ops and resume function

2016-11-01 Thread 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

Re: [net-next PATCH 0/7] stmmac: dwmac-sti refactor+cleanup

2016-11-01 Thread Joachim Eastwood
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

Re: [PATCH v2 1/2] net: stmmac: Add OXNAS Glue Driver

2016-10-31 Thread Joachim Eastwood
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) > +{ &

Re: [PATCH] net: stmmac: Add OXNAS Glue Driver

2016-10-31 Thread Joachim Eastwood
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

[net-next PATCH 5/7] stmmac: dwmac-sti: move clk_prepare_enable out of init and add error handling

2016-10-30 Thread 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

[net-next PATCH 7/7] stmmac: dwmac-sti: remove unused priv dev member

2016-10-30 Thread Joachim Eastwood
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

[net-next PATCH 4/7] stmmac: dwmac-sti: move st,gmac_en parsing to sti_dwmac_parse_data

2016-10-30 Thread Joachim Eastwood
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-

[net-next PATCH 6/7] stmmac: dwmac-sti: clean up and rename sti_dwmac_init

2016-10-30 Thread Joachim Eastwood
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

[net-next PATCH 3/7] stmmac: dwmac-sti: add PM ops and resume function

2016-10-30 Thread Joachim Eastwood
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

[net-next PATCH 2/7] stmmac: dwmac-sti: remove clk NULL checks

2016-10-30 Thread Joachim Eastwood
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

[net-next PATCH 1/7] stmmac: dwmac-sti: remove useless of_node check

2016-10-30 Thread Joachim Eastwood
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

[net-next PATCH 0/7] stmmac: dwmac-sti refactor+cleanup

2016-10-30 Thread Joachim Eastwood
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

Re: [PATCH] net: stmmac: Add OXNAS Glue Driver

2016-10-21 Thread Joachim Eastwood
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

Re: [RFC PATCH] net: stmmac: Add OXNAS Glue Driver

2016-10-20 Thread 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

Re: [PATCH v2 3/4] net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC

2016-08-20 Thread 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

Re: [PATCH] stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set

2016-05-16 Thread 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

[PATCH net-next] stmmac: dwmac-socfpga: make socfpga_dwmac_pm_ops static

2016-05-08 Thread 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

[net-next PATCH v2 2/5] stmmac: dwmac-socfpga: add PM ops and resume function

2016-05-01 Thread Joachim Eastwood
. 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

[net-next PATCH v2 5/5] stmmac: dwmac-socfpga: kill init() and rename setup() to set_phy_mode()

2016-05-01 Thread Joachim Eastwood
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

[net-next PATCH v2 3/5] stmmac: dwmac-socfpga: keep a copy of stmmac_rst in driver priv data

2016-05-01 Thread Joachim Eastwood
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

[net-next PATCH v2 1/5] stmmac: let remove/resume/suspend functions take device pointer

2016-05-01 Thread Joachim Eastwood
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

[net-next PATCH v2 0/5] stmmac: dwmac-socfpga refactor+cleanup

2016-05-01 Thread Joachim Eastwood
- 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

[net-next PATCH v2 4/5] stmmac: dwmac-socfpga: call phy_resume() only in resume callback

2016-05-01 Thread Joachim Eastwood
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

[PATCH net-next 0/5] stmmac: dwmac-socfpga refactor+cleanup

2016-04-26 Thread Joachim Eastwood
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

[PATCH net-next 1/5] stmmac: let remove/resume/suspend functions take device pointer

2016-04-26 Thread Joachim Eastwood
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

[PATCH net-next 2/5] stmmac: dwmac-socfpga: add PM ops and resume function

2016-04-26 Thread Joachim Eastwood
. 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

[PATCH net-next 5/5] stmmac: dwmac-socfpga: kill init() and rename setup() to set_phy_mode()

2016-04-26 Thread Joachim Eastwood
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

[PATCH net-next 4/5] stmmac: dwmac-socfpga: call phy_resume() only in resume callback

2016-04-26 Thread Joachim Eastwood
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

[PATCH net-next 3/5] stmmac: dwmac-socfpga: keep a copy of stmmac_rst in driver priv data

2016-04-26 Thread Joachim Eastwood
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

Re: [PATCH V3] net: stmmac: socfpga: Remove re-registration of reset controller

2016-04-26 Thread Joachim Eastwood
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: >>&

Re: [PATCH V3] net: stmmac: socfpga: Remove re-registration of reset controller

2016-04-26 Thread Joachim Eastwood
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

Re: [PATCH V3] net: stmmac: socfpga: Remove re-registration of reset controller

2016-04-25 Thread Joachim Eastwood
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

Re: [RFC][PATCH] net: stmmac: Call custom init from stmmac_dvr_probe

2016-04-24 Thread 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

Re: [PATCH v5 2/4] Documentation: Bindings: Add STM32 DWMAC glue

2016-03-21 Thread 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

Re: [PATCH v5 2/4] Documentation: Bindings: Add STM32 DWMAC glue

2016-03-21 Thread 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

Re: [PATCH v3 1/4] net: ethernet: dwmac: add Ethernet glue logic for stm32 chip

2016-02-26 Thread Joachim Eastwood
. > > Signed-off-by: Alexandre TORGUE Driver looks good now, thanks. Reviewed-by: Joachim Eastwood regards, Joachim Eastwood

Re: [PATCH v3 2/4] Documentation: Bindings: Add STM32 DWMAC glue

2016-02-26 Thread 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

Re: [PATCH v2 2/4] Documentation: Bindings: Add STM32 DWMAC glue

2016-02-23 Thread 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

Re: [PATCH v2 1/4] net: ethernet: dwmac: add Ethernet glue logic for stm32 chip

2016-02-23 Thread 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

Re: [PATCH 1/4] net: ethernet: dwmac: add Ethernet glue logic for stm32 chip

2016-02-23 Thread 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

Re: [PATCH 1/4] net: ethernet: dwmac: add Ethernet glue logic for stm32 chip

2016-02-22 Thread 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 15:54, Alexandre TORGUE >> wrote: >>> + plat_dat->bsp_priv = dwmac; >>> + plat_dat->init = stm32_dwmac_init; >&g

Re: [PATCH 1/4] net: ethernet: dwmac: add Ethernet glue logic for stm32 chip

2016-02-13 Thread Joachim Eastwood
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

[PATCH RESEND net] stmmac: fix missing MODULE_LICENSE in stmmac_platform

2015-07-31 Thread 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

[PATCH net] stmmac: fix missing MODULE_LICENSE in stmmac_platform

2015-07-31 Thread 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

Re: [REGRESSION] stmmac_platform: Unknown symbol devm_kmalloc (err 0)

2015-07-31 Thread Joachim Eastwood
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

[PATCH net-next 05/17] stmmac: dwmac-socfpga: turn setup callback into a probe function

2015-07-28 Thread Joachim Eastwood
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

[PATCH net-next 12/17] stmmac: dwmac-sti: use custom of match structure

2015-07-28 Thread Joachim Eastwood
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

[PATCH net-next 10/17] stmmac: move stmmac_pltfr_probe into dwmac-generic

2015-07-28 Thread Joachim Eastwood
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

[PATCH net-next 09/17] stmmac: dwmac-rk: create a new probe function

2015-07-28 Thread Joachim Eastwood
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

[PATCH net-next 06/17] stmmac: dwmac-sunxi: move sun7i_gmac_setup function

2015-07-28 Thread Joachim Eastwood
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

[PATCH net-next 08/17] stmmac: dwmac-sti: turn setup callback into a probe function

2015-07-28 Thread Joachim Eastwood
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

[PATCH net-next 04/17] stmmac: dwmac-socfpga: move socfpga_dwmac_probe function

2015-07-28 Thread Joachim Eastwood
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

[PATCH net-next 03/17] stmmac: dwmac-ipq806x: turn setup callback into a probe function

2015-07-28 Thread Joachim Eastwood
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

[PATCH net-next 17/17] stmmac: dwmac-sti: refactor the init glue callbacks

2015-07-28 Thread Joachim Eastwood
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

[PATCH net-next 14/17] stmmac: dwmac-rk: use rk_gmac_ops as of match data

2015-07-28 Thread Joachim Eastwood
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

[PATCH net-next 02/17] stmmac: dwmac-ipq806x: move ipq806x_gmac_fix_mac_speed function

2015-07-28 Thread Joachim Eastwood
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

[PATCH net-next 15/17] stmmac: remove unused stmmac_of_data struct

2015-07-28 Thread Joachim Eastwood
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

[PATCH net-next 16/17] stmmac: remove setup/free glue callbacks

2015-07-28 Thread Joachim Eastwood
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

[PATCH net-next 11/17] stmmac: let dwmac-* drivers handle their own match data

2015-07-28 Thread Joachim Eastwood
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

[PATCH net-next 13/17] stmmac: dwmac-rk: make rk_gmac_ops structs static const

2015-07-28 Thread Joachim Eastwood
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

[PATCH net-next 00/17] stmmac clean up for 4.3 part2

2015-07-28 Thread Joachim Eastwood
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

[PATCH net-next 01/17] stmmac: fix ptr_ret.cocci warning

2015-07-28 Thread Joachim Eastwood
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

[PATCH net-next 07/17] stmmac: dwmac-sunxi: turn setup callback into a probe function

2015-07-28 Thread Joachim Eastwood
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

[PATCH net] stmmac: fix setting of driver data in stmmac_dvr_probe

2015-07-17 Thread Joachim Eastwood
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

[PATCH net-next 2/8] stmmac: clean up platform/of_match data retrieval

2015-07-16 Thread Joachim Eastwood
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

[PATCH net-next 5/8] stmmac: export probe_config_dt() and get_platform_resources()

2015-07-16 Thread Joachim Eastwood
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

[PATCH net-next 1/8] stmmac: use of_device_get_match_data to retrieve of match data

2015-07-16 Thread 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

[PATCH net-next 3/8] stmmac: introduce stmmac_get_platform_resources()

2015-07-16 Thread Joachim Eastwood
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

[PATCH net-next 7/8] stmmac: add proper probe function to dwmac-meson

2015-07-16 Thread Joachim Eastwood
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

[PATCH net-next 0/8] stmmac clean up for 4.3 part1

2015-07-16 Thread Joachim Eastwood
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

[PATCH net-next 6/8] stmmac: add proper probe function to dwmac-lpc18xx

2015-07-16 Thread Joachim Eastwood
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

[PATCH net-next 8/8] stmmac: drop custom_* fields from plat_stmmacenet_data

2015-07-16 Thread Joachim Eastwood
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

[PATCH net-next 4/8] stmmac: make stmmac_probe_config_dt return the platform data struct

2015-07-16 Thread Joachim Eastwood
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

[PATCH net-next 2/4] stmmac: let stmmac_dvr_probe take a struct of resources

2015-05-20 Thread Joachim Eastwood
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

[PATCH net-next 4/4] stmmac: drop unnecessary dt checks in stmmac_probe_config_dt

2015-05-20 Thread 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

[PATCH net-next 0/4] stmmac: probe code refactoring and clean up part 1

2015-05-20 Thread Joachim Eastwood
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

[PATCH net-next 3/4] stmmac: change the stmmac_dvr_probe return type to int

2015-05-20 Thread Joachim Eastwood
: 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

[PATCH net-next 1/4] stmmac: move driver data setting into stmmac_dvr_probe

2015-05-20 Thread Joachim Eastwood
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

[PATCH net-next 03/11] stmmac: prepare stmmac platform to support stand alone drivers

2015-05-14 Thread Joachim Eastwood
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

[PATCH net-next 07/11] stmmac: convert dwmac-rk to platform driver

2015-05-14 Thread Joachim Eastwood
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

Re: [PATCH RFC 0/2] stmmac: stand alone platform drivers

2015-05-12 Thread Joachim Eastwood
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

[PATCH 0/2] stmac: add glue for NXP LPC18xx family

2015-05-02 Thread Joachim Eastwood
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