@@ -0,0 +1,41 @@+STMicroelectronics STM32 / MCU DWMAC glue layer controller++This file documents platform glue layer for stmmac.+Please see stmmac.txt for the other unchanged properties.++The device node has following properties.++Required properties:+- compatible: Should be "st,stm32-dwmac" to select glue, and+ "snps,dwmac-3.50a" to select IP vesrion.+- clocks: Should contain the GMAC main clock, and tx clock+- compatible: Should be "st,stm32-dwmac" to select glue and+ "snps,dwmac-3.50a" to select IP version.+- clocks: Should contain the MAC main clock+- clock-names: Should contain the clock names "stmmaceth".+- 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.++Optional properties:+- clocks: Could contain:+ - the tx clock,+ - the rx clock+- clock-names: Could contain the clock names "tx-clk", "rx-clk"++Example:++ ethernet0: dwmac at 40028000 {+ device_type = "network";+ compatible = "st,stm32-dwmac", "snps,dwmac-3.50a";+ status = "disabled";+ reg = <0x40028000 0x8000>;+ reg-names = "stmmaceth";+ interrupts = <0 61 0>, <0 62 0>;+ interrupt-names = "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 = <32>;+ snps,mixed-burst;+ dma-ranges;+ };
stm324xx family chips support Synopsys MAC 3.510 IP.
This patch adds settings for logical glue logic:
-clocks
-mode selection MII or RMII.
Signed-off-by: Alexandre TORGUE <redacted>
From: kbuild test robot <hidden> Date: 2016-02-04 00:29:40
Hi Alexandre,
[auto build test WARNING on net/master]
[also build test WARNING on v4.5-rc2 next-20160203]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/Alexandre-TORGUE/Add-Ethernet-support-on-STM32F429/20160203-225940
config: um-allyesconfig (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=um
All warnings (new ones prefixed by >>):
warning: (ST_IRQCHIP && HIP04_ETH && STMMAC_PLATFORM && DWMAC_IPQ806X && DWMAC_LPC18XX && DWMAC_ROCKCHIP && DWMAC_SOCFPGA && DWMAC_STI && DWMAC_STM32 && TI_CPSW && PINCTRL_ROCKCHIP && PINCTRL_DOVE && POWER_RESET_KEYSTONE && POWER_RESET_SYSCON && POWER_RESET_SYSCON_POWEROFF && S3C2410_WATCHDOG && VIDEO_OMAP3 && VIDEO_S5P_FIMC && USB_XHCI_MTK && RTC_DRV_AT91SAM9 && LPC18XX_DMAMUX && VIDEO_OMAP4 && HWSPINLOCK_QCOM && ATMEL_ST && QCOM_GSBI && PHY_HI6220_USB) selects MFD_SYSCON which has unmet direct dependencies (HAS_IOMEM)
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 17523 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160204/cb3c4c9a/attachment-0001.obj>
From: kbuild test robot <hidden> Date: 2016-02-12 14:29:12
Hi Alexandre,
[auto build test WARNING on net/master]
[also build test WARNING on v4.5-rc3 next-20160212]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/Alexandre-TORGUE/Add-Ethernet-support-on-STM32F429/20160203-225940
config: um-allyesconfig (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=um
All warnings (new ones prefixed by >>):
warning: (ST_IRQCHIP && HIP04_ETH && STMMAC_PLATFORM && DWMAC_IPQ806X && DWMAC_LPC18XX && DWMAC_ROCKCHIP && DWMAC_SOCFPGA && DWMAC_STI && DWMAC_STM32 && TI_CPSW && PINCTRL_ROCKCHIP && PINCTRL_DOVE && POWER_RESET_KEYSTONE && POWER_RESET_SYSCON && POWER_RESET_SYSCON_POWEROFF && S3C2410_WATCHDOG && VIDEO_OMAP3 && VIDEO_S5P_FIMC && USB_XHCI_MTK && RTC_DRV_AT91SAM9 && LPC18XX_DMAMUX && VIDEO_OMAP4 && HWSPINLOCK_QCOM && ATMEL_ST && QCOM_GSBI && PHY_HI6220_USB) selects MFD_SYSCON which has unmet direct dependencies (HAS_IOMEM)
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 17523 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160212/d3544f93/attachment-0001.obj>
From: Joachim Eastwood <hidden> Date: 2016-02-13 13:48:59
On 3 February 2016 at 15:54, Alexandre TORGUE
[off-list ref] wrote:
quoted hunk
stm324xx family chips support Synopsys MAC 3.510 IP.
This patch adds settings for logical glue logic:
-clocks
-mode selection MII or RMII.
Signed-off-by: Alexandre TORGUE <redacted>
Instead of using these callbacks could you rather implement the PM
callbacks directly in this driver?
I don't think it should add much code and it will make it look more
like standard driver. This will also give you some more control and
flexibility in your code.
2016-02-13 14:48 GMT+01:00 Joachim Eastwood [off-list ref]:
On 3 February 2016 at 15:54, Alexandre TORGUE
[off-list ref] wrote:
quoted
stm324xx family chips support Synopsys MAC 3.510 IP.
This patch adds settings for logical glue logic:
-clocks
-mode selection MII or RMII.
Signed-off-by: Alexandre TORGUE <redacted>
Instead of using these callbacks could you rather implement the PM
callbacks directly in this driver?
I don't think it should add much code and it will make it look more
like standard driver. This will also give you some more control and
flexibility in your code.
I prefer to keep the code as it is. Glue layer is directly linked to
stmmac driver and I don't want to brake the link between the glue and
the stmmac driver.
Instead of using these callbacks could you rather implement the PM
callbacks directly in this driver?
I don't think it should add much code and it will make it look more
like standard driver. This will also give you some more control and
flexibility in your code.
I prefer to keep the code as it is. Glue layer is directly linked to
stmmac driver and I don't want to brake the link between the glue and
the stmmac driver.
What do you mean by break the link?
There has been numerous of patch sets to make the stmmac "glue"
drivers into more standard platform drivers.
http://marc.info/?l=linux-netdev&m=143159850631093&w=2http://marc.info/?l=linux-netdev&m=143708560009851&w=2http://marc.info/?l=linux-netdev&m=143812136600541&w=2
Do you see any advantage by using the init and exit hooks in your
driver instead of using the standard driver PM callbacks and remove
function?
The only "cost" I see is slightly more boilerplate code. But since you
already have init/exit functions you could easily make them into PM
resume/suspend so I doubt there would be much increase in code size.
One other thing;
Do you need to have the PHY mode setup code in the init function which
is called each time on resume?
If you could move it to probe you could drop the interface priv data
member and use plat_dat->interface as stmmac_probe_config_dt() has
already done of_get_phy_mode().
regards,
Joachim Eastwood
Instead of using these callbacks could you rather implement the PM
callbacks directly in this driver?
I don't think it should add much code and it will make it look more
like standard driver. This will also give you some more control and
flexibility in your code.
I prefer to keep the code as it is. Glue layer is directly linked to
stmmac driver and I don't want to brake the link between the glue and
the stmmac driver.
What do you mean by break the link?
I thought that you wanted to split stmmac_pltfr_supend (glue part and
stmamc part), but I well understood it is not the case (sorry for
mistake).
If I well understood you want to continue the stmmac glue driver
rework by moving stmmac_pltfr_suspend/resume/remove in each glue
driver (stm32, sun, sti ....).
Each glue driver will call directly stmmac_suspend/resume/remove and
their own init/exit function.
If it is what you meant, I can do it.
One other thing;
Do you need to have the PHY mode setup code in the init function which
is called each time on resume?
I can't guarantee that after a suspend the sysconfig register will
contain same data than before suspend.
Best regards.
Alex
If you could move it to probe you could drop the interface priv data
member and use plat_dat->interface as stmmac_probe_config_dt() has
already done of_get_phy_mode().
regards,
Joachim Eastwood
Instead of using these callbacks could you rather implement the PM
callbacks directly in this driver?
I don't think it should add much code and it will make it look more
like standard driver. This will also give you some more control and
flexibility in your code.
I prefer to keep the code as it is. Glue layer is directly linked to
stmmac driver and I don't want to brake the link between the glue and
the stmmac driver.
What do you mean by break the link?
I thought that you wanted to split stmmac_pltfr_supend (glue part and
stmamc part), but I well understood it is not the case (sorry for
mistake).
If I well understood you want to continue the stmmac glue driver
rework by moving stmmac_pltfr_suspend/resume/remove in each glue
driver (stm32, sun, sti ....).
At least I want to avoid the init/exit callbacks for new drivers like
stm32-dwmac.
Each glue driver will call directly stmmac_suspend/resume/remove and
their own init/exit function.
If it is what you meant, I can do it.
Yes, in your stm32 driver's suspend/resume/remove functions call
stmmac_suspend/stmmac_resume/stmmac_dvr_remove directly. Then you
shouldn't need to use the init/exit callbacks. Just put the need code
in the driver's suspend/resume/remove functions instead of init/exit
functions.
For example:
static int stm32_dwmac_resume(struct device *dev)
{
struct net_device *ndev = dev_get_drvdata(dev);
struct plat_stmmacenet_data *plat_dat = get_stmmac_plat_data(ndev)
struct stm32_dwmac *dwmac =plat_dat->bsp_priv;
/* enable clocks */
/* set phy mode */
return stmmac_resume(ndev);
}
If it makes sense to have the enable clk/phy mode stuff in it's own
function that is fine too.
quoted
One other thing;
Do you need to have the PHY mode setup code in the init function which
is called each time on resume?
I can't guarantee that after a suspend the sysconfig register will
contain same data than before suspend.
Instead of using these callbacks could you rather implement the PM
callbacks directly in this driver?
I don't think it should add much code and it will make it look more
like standard driver. This will also give you some more control and
flexibility in your code.
I prefer to keep the code as it is. Glue layer is directly linked to
stmmac driver and I don't want to brake the link between the glue and
the stmmac driver.
What do you mean by break the link?
I thought that you wanted to split stmmac_pltfr_supend (glue part and
stmamc part), but I well understood it is not the case (sorry for
mistake).
If I well understood you want to continue the stmmac glue driver
rework by moving stmmac_pltfr_suspend/resume/remove in each glue
driver (stm32, sun, sti ....).
At least I want to avoid the init/exit callbacks for new drivers like
stm32-dwmac.
quoted
Each glue driver will call directly stmmac_suspend/resume/remove and
their own init/exit function.
If it is what you meant, I can do it.
Yes, in your stm32 driver's suspend/resume/remove functions call
stmmac_suspend/stmmac_resume/stmmac_dvr_remove directly. Then you
shouldn't need to use the init/exit callbacks. Just put the need code
in the driver's suspend/resume/remove functions instead of init/exit
functions.
For example:
static int stm32_dwmac_resume(struct device *dev)
{
struct net_device *ndev = dev_get_drvdata(dev);
struct plat_stmmacenet_data *plat_dat = get_stmmac_plat_data(ndev)
struct stm32_dwmac *dwmac =plat_dat->bsp_priv;
/* enable clocks */
/* set phy mode */
return stmmac_resume(ndev);
}
If it makes sense to have the enable clk/phy mode stuff in it's own
function that is fine too.
Ok. I will send v2 with this approach. After this series I could
provide a new series to change all glues with this approach ? (but I
will not able to test on each platform).
Best regards
Alexandre
quoted
quoted
One other thing;
Do you need to have the PHY mode setup code in the init function which
is called each time on resume?
I can't guarantee that after a suspend the sysconfig register will
contain same data than before suspend.
@@ -33,11 +33,20 @@ CONFIG_XIP_PHYS_ADDR=0x08008000 CONFIG_BINFMT_FLAT=y CONFIG_BINFMT_SHARED_FLAT=y # CONFIG_COREDUMP is not set+CONFIG_NET=y+CONFIG_INET=y+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set+# CONFIG_INET_XFRM_MODE_TUNNEL is not set+# CONFIG_INET_XFRM_MODE_BEET is not set+# CONFIG_IPV6 is not set CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y # CONFIG_FW_LOADER is not set # CONFIG_BLK_DEV is not set CONFIG_EEPROM_93CX6=y+CONFIG_NETDEVICES=y+CONFIG_STMMAC_ETH=y+# CONFIG_WLAN is not set # CONFIG_INPUT is not set # CONFIG_SERIO is not set # CONFIG_VT is not set
@@ -178,6 +178,7 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)*onceneededonotherplatforms.*/if(of_device_is_compatible(np,"st,spear600-gmac")||+of_device_is_compatible(np,"snps,dwmac-3.50a")||of_device_is_compatible(np,"snps,dwmac-3.70a")||of_device_is_compatible(np,"snps,dwmac")){/* Note that the max-frame-size parameter as defined in the
From: Giuseppe CAVALLARO <hidden> Date: 2016-02-03 15:22:14
Hello Alex
On 2/3/2016 3:54 PM, Alexandre TORGUE wrote:
STM32F429 Chip embeds a Synopsys 3.50a MAC IP.
This series:
-enhance current stmmac driver to control it (code already available) and
adds basic glue for STM32F429 chip.
-Enable basic Net config in kernel.
Note that DT patches are not present because STM32 pinctrl code is not
yet avalaible.
patches look ok for me
Acked-by: Giuseppe Cavallaro <redacted>
STM32F429 Chip embeds a Synopsys 3.50a MAC IP.
This series:
-enhance current stmmac driver to control it (code already available) and
adds basic glue for STM32F429 chip.
-Enable basic Net config in kernel.
Note that DT patches are not present because STM32 pinctrl code is not
yet avalaible.
Looks like this needs to be respun to deal with the warnings the kbuild
robot reported.
Thanks.
Hi David,
I will fix it in next patch version.
I just find a corruption issue in stmmac driver, I will also fix it in
next version.
Best regards
Alex
2016-02-09 10:52 GMT+01:00 David Miller [off-list ref]:
STM32F429 Chip embeds a Synopsys 3.50a MAC IP.
This series:
-enhance current stmmac driver to control it (code already available) and
adds basic glue for STM32F429 chip.
-Enable basic Net config in kernel.
Note that DT patches are not present because STM32 pinctrl code is not
yet avalaible.
Looks like this needs to be respun to deal with the warnings the kbuild
robot reported.
Thanks.