mbox series

[v3,0/5] net: dwc_eth_qos: Add glue driver for Intel MAC

Message ID 20240717122906.117861-1-pro@denx.de
Headers show
Series net: dwc_eth_qos: Add glue driver for Intel MAC | expand

Message

Philip Oberfichtner July 17, 2024, 12:29 p.m. UTC
This patch series implements the dwc_eth_qos glue driver for Intel SOCs.
Before doing that, a few general adaptions to the dwc_eth_qos.c main
driver are required. Most notably, the preparation for PCI based driver
instances, which do not necessarily use a device tree.

This patch series depends on: "net: dwc_eth_qos: mdio: Implement clause 45":
https://patchwork.ozlabs.org/project/uboot/patch/20240507094237.168238-1-pro@denx.de/

Changes in V3:
	- Replace mfence() with mb()
	- Clean-up eqos_get_base_addr()
	- Several style fixes for dwc_eth_qos_intel

Philip Oberfichtner (5):
  x86: provide mb() macro
  net: dwc_eth_qos: Fix header to be self-contained
  net: dwc_eth_qos: Adapt probe() for PCI devices
  net: dwc_eth_qos: Implement bind() for PCI devices
  net: dwc_eth_qos: Add glue driver for Intel MAC

 arch/x86/cpu/mp_init.c             |  10 +-
 arch/x86/include/asm/cpu.h         |   5 -
 arch/x86/include/asm/io.h          |   1 +
 drivers/net/Kconfig                |   7 +
 drivers/net/Makefile               |   1 +
 drivers/net/dwc_eth_qos.c          |  79 ++++-
 drivers/net/dwc_eth_qos.h          |   8 +-
 drivers/net/dwc_eth_qos_imx.c      |   6 +
 drivers/net/dwc_eth_qos_intel.c    | 449 +++++++++++++++++++++++++++++
 drivers/net/dwc_eth_qos_intel.h    |  57 ++++
 drivers/net/dwc_eth_qos_qcom.c     |   6 +
 drivers/net/dwc_eth_qos_rockchip.c |   6 +
 drivers/net/dwc_eth_qos_starfive.c |   6 +
 drivers/net/dwc_eth_qos_stm32.c    |   6 +
 include/pci_ids.h                  |   9 +
 15 files changed, 637 insertions(+), 19 deletions(-)
 create mode 100644 drivers/net/dwc_eth_qos_intel.c
 create mode 100644 drivers/net/dwc_eth_qos_intel.h

Comments

Philip Oberfichtner July 30, 2024, 5:31 a.m. UTC | #1
Hi Ramon,

Any comments on this series?

On Wed, Jul 17, 2024 at 02:29:01PM +0200, Philip Oberfichtner wrote:
> This patch series implements the dwc_eth_qos glue driver for Intel SOCs.
> Before doing that, a few general adaptions to the dwc_eth_qos.c main
> driver are required. Most notably, the preparation for PCI based driver
> instances, which do not necessarily use a device tree.
> 
> This patch series depends on: "net: dwc_eth_qos: mdio: Implement clause 45":
> https://patchwork.ozlabs.org/project/uboot/patch/20240507094237.168238-1-pro@denx.de/
> 
> Changes in V3:
> 	- Replace mfence() with mb()
> 	- Clean-up eqos_get_base_addr()
> 	- Several style fixes for dwc_eth_qos_intel
> 
> Philip Oberfichtner (5):
>   x86: provide mb() macro
>   net: dwc_eth_qos: Fix header to be self-contained
>   net: dwc_eth_qos: Adapt probe() for PCI devices
>   net: dwc_eth_qos: Implement bind() for PCI devices
>   net: dwc_eth_qos: Add glue driver for Intel MAC
> 
>  arch/x86/cpu/mp_init.c             |  10 +-
>  arch/x86/include/asm/cpu.h         |   5 -
>  arch/x86/include/asm/io.h          |   1 +
>  drivers/net/Kconfig                |   7 +
>  drivers/net/Makefile               |   1 +
>  drivers/net/dwc_eth_qos.c          |  79 ++++-
>  drivers/net/dwc_eth_qos.h          |   8 +-
>  drivers/net/dwc_eth_qos_imx.c      |   6 +
>  drivers/net/dwc_eth_qos_intel.c    | 449 +++++++++++++++++++++++++++++
>  drivers/net/dwc_eth_qos_intel.h    |  57 ++++
>  drivers/net/dwc_eth_qos_qcom.c     |   6 +
>  drivers/net/dwc_eth_qos_rockchip.c |   6 +
>  drivers/net/dwc_eth_qos_starfive.c |   6 +
>  drivers/net/dwc_eth_qos_stm32.c    |   6 +
>  include/pci_ids.h                  |   9 +
>  15 files changed, 637 insertions(+), 19 deletions(-)
>  create mode 100644 drivers/net/dwc_eth_qos_intel.c
>  create mode 100644 drivers/net/dwc_eth_qos_intel.h
> 
> -- 
> 2.39.2
>
Tom Rini Aug. 1, 2024, 2:20 p.m. UTC | #2
On Wed, Jul 17, 2024 at 02:29:01PM +0200, Philip Oberfichtner wrote:

> This patch series implements the dwc_eth_qos glue driver for Intel SOCs.
> Before doing that, a few general adaptions to the dwc_eth_qos.c main
> driver are required. Most notably, the preparation for PCI based driver
> instances, which do not necessarily use a device tree.
> 
> This patch series depends on: "net: dwc_eth_qos: mdio: Implement clause 45":
> https://patchwork.ozlabs.org/project/uboot/patch/20240507094237.168238-1-pro@denx.de/
> 
> Changes in V3:
> 	- Replace mfence() with mb()
> 	- Clean-up eqos_get_base_addr()
> 	- Several style fixes for dwc_eth_qos_intel

This adds a failure to build on stm32mp15_dhcor_basic and all of the
other stm32mp15 platforms that use this driver:
+(stm32mp15_dhcor_basic) drivers/net/dwc_eth_qos.c: In function 'eqos_get_base_addr_common':
+(stm32mp15_dhcor_basic) drivers/net/dwc_eth_qos.c:1415:30: error: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type 'fdt_addr_t' {aka 'unsigned int'} [-Werror=format=]
+(stm32mp15_dhcor_basic)  1415 |                 dev_err(dev, "addr=0x%llx is invalid.\n", addr);
+(stm32mp15_dhcor_basic)       |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~
+(stm32mp15_dhcor_basic)       |                                                           |
+(stm32mp15_dhcor_basic)       |                                                           fdt_addr_t {aka unsigned int}
+(stm32mp15_dhcor_basic) include/dm/device_compat.h:51:24: note: in definition of macro 'dev_printk_emit'
+(stm32mp15_dhcor_basic)    51 |                 printf(fmt, ##__VA_ARGS__); \
+(stm32mp15_dhcor_basic)       |                        ^~~
+(stm32mp15_dhcor_basic) include/dm/device_compat.h:110:9: note: in expansion of macro '__dev_printk'
+(stm32mp15_dhcor_basic)   110 |         __dev_printk(LOGL_ERR, dev, fmt, ##__VA_ARGS__)
+(stm32mp15_dhcor_basic)       |         ^~~~~~~~~~~~
+(stm32mp15_dhcor_basic) drivers/net/dwc_eth_qos.c:1415:17: note: in expansion of macro 'dev_err'
+(stm32mp15_dhcor_basic)       |                 ^~~~~~~
+(stm32mp15_dhcor_basic) drivers/net/dwc_eth_qos.c:1415:41: note: format string is defined here
+(stm32mp15_dhcor_basic)       |                                      ~~~^
+(stm32mp15_dhcor_basic)       |                                         |
+(stm32mp15_dhcor_basic)       |                                         long long unsigned int
+(stm32mp15_dhcor_basic)       |                                      %x
+(stm32mp15_dhcor_basic) In file included from include/linux/printk.h:4,
+(stm32mp15_dhcor_basic)                  from include/linux/kernel.h:5,
+(stm32mp15_dhcor_basic)                  from include/linux/libfdt_env.h:13,
+(stm32mp15_dhcor_basic)                  from include/linux/libfdt.h:6,
+(stm32mp15_dhcor_basic)                  from include/fdtdec.h:17,
+(stm32mp15_dhcor_basic)                  from include/dm/ofnode.h:11,
+(stm32mp15_dhcor_basic)                  from include/clk.h:11,
+(stm32mp15_dhcor_basic)                  from drivers/net/dwc_eth_qos.c:32:
+(stm32mp15_dhcor_basic) include/log.h:224:24: note: in definition of macro 'log'
+(stm32mp15_dhcor_basic)   224 |                 printf(_fmt, ##_args); \
+(stm32mp15_dhcor_basic)       |                        ^~~~
+(stm32mp15_dhcor_basic) include/dm/device_compat.h:86:17: note: in expansion of macro 'dev_printk_emit'
+(stm32mp15_dhcor_basic)    86 |                 dev_printk_emit(LOG_CATEGORY, level, fmt, ##__VA_ARGS__); \
+(stm32mp15_dhcor_basic)       |                 ^~~~~~~~~~~~~~~
+(stm32mp15_dhcor_basic) include/dm/device_compat.h:55:24: note: in definition of macro 'dev_printk_emit'
+(stm32mp15_dhcor_basic)    55 |                 printf(fmt, ##__VA_ARGS__); \
+(stm32mp15_dhcor_basic) include/dm/device_compat.h:92:41: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'fdt_addr_t' {aka 'unsigned int'} [-Werror=format=]
+(stm32mp15_dhcor_basic)    92 |                                         "%s %s: " fmt, \
+(stm32mp15_dhcor_basic)       |                                         ^~~~~~~~~
+(stm32mp15_dhcor_basic) include/dm/device_compat.h:91:25: note: in expansion of macro 'dev_printk_emit'
+(stm32mp15_dhcor_basic)    91 |                         dev_printk_emit(__dev->driver->id, level, \
+(stm32mp15_dhcor_basic)       |                         ^~~~~~~~~~~~~~~
+(stm32mp15_dhcor_basic) include/dm/device_compat.h:97:41: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'fdt_addr_t' {aka 'unsigned int'} [-Werror=format=]
+(stm32mp15_dhcor_basic)    97 |                                         "%s %s: " fmt, \
+(stm32mp15_dhcor_basic) include/dm/device_compat.h:96:25: note: in expansion of macro 'dev_printk_emit'
+(stm32mp15_dhcor_basic)    96 |                         dev_printk_emit(LOG_CATEGORY, level, \
+(stm32mp15_dhcor_basic) cc1: all warnings being treated as errors
+(stm32mp15_dhcor_basic) make[3]: *** [scripts/Makefile.build:256: drivers/net/dwc_eth_qos.o] Error 1
+(stm32mp15_dhcor_basic) make[2]: *** [scripts/Makefile.build:397: drivers/net] Error 2
+(stm32mp15_dhcor_basic) make[1]: *** [Makefile:1895: drivers] Error 2
+(stm32mp15_dhcor_basic) make: *** [Makefile:177: sub-make] Error 2
Philip Oberfichtner Aug. 2, 2024, 9:23 a.m. UTC | #3
On Thu, Aug 01, 2024 at 08:20:17AM -0600, Tom Rini wrote:
> On Wed, Jul 17, 2024 at 02:29:01PM +0200, Philip Oberfichtner wrote:
> 
> > This patch series implements the dwc_eth_qos glue driver for Intel SOCs.
> > Before doing that, a few general adaptions to the dwc_eth_qos.c main
> > driver are required. Most notably, the preparation for PCI based driver
> > instances, which do not necessarily use a device tree.
> > 
> > This patch series depends on: "net: dwc_eth_qos: mdio: Implement clause 45":
> > https://patchwork.ozlabs.org/project/uboot/patch/20240507094237.168238-1-pro@denx.de/
> > 
> > Changes in V3:
> > 	- Replace mfence() with mb()
> > 	- Clean-up eqos_get_base_addr()
> > 	- Several style fixes for dwc_eth_qos_intel
> 
> This adds a failure to build on stm32mp15_dhcor_basic and all of the

Thanks for the feedback!

I added some #if CONFIG_IS_ENABLED(FDT_64BIT) to catch this case. It
should be fine in V4 then.


Best regards,
Philip