* [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup
@ 2023-08-04 13:30 Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 01/10] net: fs_enet: Remove set but not used variable Christophe Leroy
` (11 more replies)
0 siblings, 12 replies; 14+ messages in thread
From: Christophe Leroy @ 2023-08-04 13:30 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Pantelis Antoniou, Eric Dumazet,
Paolo Abeni, Michael Ellerman, Nicholas Piggin, robh
Cc: netdev, linuxppc-dev, linux-kernel
Over the years, platform and driver initialisation have evolved into
more generic ways, and driver or platform specific stuff has gone
away, leaving stale objects behind.
This series aims at cleaning all that up for fs_enet ethernet driver.
Changes in v2:
- Remove a trailing whitespace in the old struct moved in patch 7.
- Include powerpc people and list that I forgot when sending v1
(and Rob as expected by Patchwork for patch 6, not sure why)
Christophe Leroy (10):
net: fs_enet: Remove set but not used variable
net: fs_enet: Fix address space and base types mismatches
net: fs_enet: Remove fs_get_id()
net: fs_enet: Remove unused fields in fs_platform_info struct
net: fs_enet: Remove has_phy field in fs_platform_info struct
net: fs_enet: Remove stale prototypes from fsl_soc.c
net: fs_enet: Move struct fs_platform_info into fs_enet.h
net: fs_enet: Don't include fs_enet_pd.h when not needed
net: fs_enet: Remove linux/fs_enet_pd.h
net: fs_enet: Use cpm_muram_xxx() functions instead of cpm_dpxxx()
macros
MAINTAINERS | 1 -
arch/powerpc/platforms/8xx/adder875.c | 1 -
arch/powerpc/platforms/8xx/mpc885ads_setup.c | 1 -
arch/powerpc/platforms/8xx/tqm8xx_setup.c | 1 -
arch/powerpc/sysdev/fsl_soc.c | 3 -
.../ethernet/freescale/fs_enet/fs_enet-main.c | 2 -
.../net/ethernet/freescale/fs_enet/fs_enet.h | 19 +-
.../net/ethernet/freescale/fs_enet/mac-fcc.c | 4 +-
.../net/ethernet/freescale/fs_enet/mac-fec.c | 14 --
.../net/ethernet/freescale/fs_enet/mac-scc.c | 8 +-
.../ethernet/freescale/fs_enet/mii-bitbang.c | 4 +-
.../net/ethernet/freescale/fs_enet/mii-fec.c | 1 +
include/linux/fs_enet_pd.h | 165 ------------------
13 files changed, 27 insertions(+), 197 deletions(-)
delete mode 100644 include/linux/fs_enet_pd.h
--
2.41.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net-next v2 01/10] net: fs_enet: Remove set but not used variable
2023-08-04 13:30 [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup Christophe Leroy
@ 2023-08-04 13:30 ` Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 02/10] net: fs_enet: Fix address space and base types mismatches Christophe Leroy
` (10 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Christophe Leroy @ 2023-08-04 13:30 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Pantelis Antoniou, Eric Dumazet,
Paolo Abeni, Michael Ellerman, Nicholas Piggin, robh
Cc: netdev, linuxppc-dev, linux-kernel
CC drivers/net/ethernet/freescale/fs_enet/fs_enet-main.o
drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c: In function 'fs_enet_interrupt':
drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c:321:40: warning: variable 'fpi' set but not used [-Wunused-but-set-variable]
Remove that variable.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
index f9f5b28cc72e..a6dfc8807d3d 100644
--- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
+++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
@@ -318,14 +318,12 @@ fs_enet_interrupt(int irq, void *dev_id)
{
struct net_device *dev = dev_id;
struct fs_enet_private *fep;
- const struct fs_platform_info *fpi;
u32 int_events;
u32 int_clr_events;
int nr, napi_ok;
int handled;
fep = netdev_priv(dev);
- fpi = fep->fpi;
nr = 0;
while ((int_events = (*fep->ops->get_int_events)(dev)) != 0) {
--
2.41.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next v2 02/10] net: fs_enet: Fix address space and base types mismatches
2023-08-04 13:30 [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 01/10] net: fs_enet: Remove set but not used variable Christophe Leroy
@ 2023-08-04 13:30 ` Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 03/10] net: fs_enet: Remove fs_get_id() Christophe Leroy
` (9 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Christophe Leroy @ 2023-08-04 13:30 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Pantelis Antoniou, Eric Dumazet,
Paolo Abeni, Michael Ellerman, Nicholas Piggin, robh
Cc: netdev, linuxppc-dev, linux-kernel
CHECK drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
drivers/net/ethernet/freescale/fs_enet/mac-fcc.c:550:9: warning: cast removes address space '__iomem' of expression
drivers/net/ethernet/freescale/fs_enet/mac-fcc.c:550:9: error: subtraction of different types can't work (different address spaces)
CC drivers/net/ethernet/freescale/fs_enet/mii-bitbang.o
CHECK drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c
drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c:95:31: warning: incorrect type in argument 1 (different base types)
drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c:95:31: expected unsigned int [noderef] [usertype] __iomem *p
drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c:95:31: got restricted __be32 [noderef] [usertype] __iomem *dat
...
drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c:63:31: warning: incorrect type in argument 1 (different base types)
drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c:63:31: expected unsigned int [noderef] [usertype] __iomem *p
drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c:63:31: got restricted __be32 [noderef] [usertype] __iomem *dir
...
Fix those address space and base type mismatches reported by sparse.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
drivers/net/ethernet/freescale/fs_enet/mac-fcc.c | 2 +-
drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c b/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
index 925428f1b0c8..ce63fd56df89 100644
--- a/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
+++ b/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
@@ -547,7 +547,7 @@ static void tx_restart(struct net_device *dev)
}
/* Now update the TBPTR and dirty flag to the current buffer */
W32(ep, fen_genfcc.fcc_tbptr,
- (uint) (((void *)recheck_bd - fep->ring_base) +
+ (uint)(((void __iomem *)recheck_bd - fep->ring_base) +
fep->ring_mem_addr));
fep->dirty_tx = recheck_bd;
diff --git a/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c b/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c
index 91a69fc2f7c2..f965a2329055 100644
--- a/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c
+++ b/drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c
@@ -29,8 +29,8 @@
struct bb_info {
struct mdiobb_ctrl ctrl;
- __be32 __iomem *dir;
- __be32 __iomem *dat;
+ u32 __iomem *dir;
+ u32 __iomem *dat;
u32 mdio_msk;
u32 mdc_msk;
};
--
2.41.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next v2 03/10] net: fs_enet: Remove fs_get_id()
2023-08-04 13:30 [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 01/10] net: fs_enet: Remove set but not used variable Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 02/10] net: fs_enet: Fix address space and base types mismatches Christophe Leroy
@ 2023-08-04 13:30 ` Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 04/10] net: fs_enet: Remove unused fields in fs_platform_info struct Christophe Leroy
` (8 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Christophe Leroy @ 2023-08-04 13:30 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Pantelis Antoniou, Eric Dumazet,
Paolo Abeni, Michael Ellerman, Nicholas Piggin, robh
Cc: netdev, linuxppc-dev, linux-kernel
fs_get_id() hasn't been used since commit b219108cbace ("fs_enet:
Remove !CONFIG_PPC_CPM_NEW_BINDING code")
Remove it.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
include/linux/fs_enet_pd.h | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h
index 77d783f71527..2351c3d9404d 100644
--- a/include/linux/fs_enet_pd.h
+++ b/include/linux/fs_enet_pd.h
@@ -151,15 +151,4 @@ struct fs_mii_fec_platform_info {
u32 mii_speed;
};
-static inline int fs_get_id(struct fs_platform_info *fpi)
-{
- if(strstr(fpi->fs_type, "SCC"))
- return fs_scc_index2id(fpi->fs_no);
- if(strstr(fpi->fs_type, "FCC"))
- return fs_fcc_index2id(fpi->fs_no);
- if(strstr(fpi->fs_type, "FEC"))
- return fs_fec_index2id(fpi->fs_no);
- return fpi->fs_no;
-}
-
#endif
--
2.41.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next v2 04/10] net: fs_enet: Remove unused fields in fs_platform_info struct
2023-08-04 13:30 [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup Christophe Leroy
` (2 preceding siblings ...)
2023-08-04 13:30 ` [PATCH net-next v2 03/10] net: fs_enet: Remove fs_get_id() Christophe Leroy
@ 2023-08-04 13:30 ` Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 05/10] net: fs_enet: Remove has_phy field " Christophe Leroy
` (7 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Christophe Leroy @ 2023-08-04 13:30 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Pantelis Antoniou, Eric Dumazet,
Paolo Abeni, Michael Ellerman, Nicholas Piggin, robh
Cc: netdev, linuxppc-dev, linux-kernel
Since commit 3dd82a1ea724 ("[POWERPC] CPM: Always use new binding.")
many fields of fs_platform_info structure are not used anymore.
Remove them.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
include/linux/fs_enet_pd.h | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h
index 2351c3d9404d..a1905e41c167 100644
--- a/include/linux/fs_enet_pd.h
+++ b/include/linux/fs_enet_pd.h
@@ -111,33 +111,14 @@ struct fs_mii_bb_platform_info {
};
struct fs_platform_info {
-
- void(*init_ioports)(struct fs_platform_info *);
/* device specific information */
- int fs_no; /* controller index */
- char fs_type[4]; /* controller type */
-
- u32 cp_page; /* CPM page */
- u32 cp_block; /* CPM sblock */
u32 cp_command; /* CPM page/sblock/mcn */
- u32 clk_trx; /* some stuff for pins & mux configuration*/
- u32 clk_rx;
- u32 clk_tx;
- u32 clk_route;
- u32 clk_mask;
-
- u32 mem_offset;
u32 dpram_offset;
- u32 fcc_regs_c;
- u32 device_flags;
-
struct device_node *phy_node;
- const struct fs_mii_bus_info *bus_info;
int rx_ring, tx_ring; /* number of buffers on rx */
- __u8 macaddr[ETH_ALEN]; /* mac address */
int rx_copybreak; /* limit we copy small frames */
int napi_weight; /* NAPI weight */
--
2.41.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next v2 05/10] net: fs_enet: Remove has_phy field in fs_platform_info struct
2023-08-04 13:30 [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup Christophe Leroy
` (3 preceding siblings ...)
2023-08-04 13:30 ` [PATCH net-next v2 04/10] net: fs_enet: Remove unused fields in fs_platform_info struct Christophe Leroy
@ 2023-08-04 13:30 ` Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 06/10] net: fs_enet: Remove stale prototypes from fsl_soc.c Christophe Leroy
` (6 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Christophe Leroy @ 2023-08-04 13:30 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Pantelis Antoniou, Eric Dumazet,
Paolo Abeni, Michael Ellerman, Nicholas Piggin, robh
Cc: netdev, linuxppc-dev, linux-kernel
Since commit 3dd82a1ea724 ("[POWERPC] CPM: Always use new binding.")
has_phy field is never set.
Remove dead code and remove the field.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
drivers/net/ethernet/freescale/fs_enet/mac-fec.c | 14 --------------
include/linux/fs_enet_pd.h | 1 -
2 files changed, 15 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fs_enet/mac-fec.c b/drivers/net/ethernet/freescale/fs_enet/mac-fec.c
index f609dc112458..cdc89d83cf07 100644
--- a/drivers/net/ethernet/freescale/fs_enet/mac-fec.c
+++ b/drivers/net/ethernet/freescale/fs_enet/mac-fec.c
@@ -339,11 +339,7 @@ static void restart(struct net_device *dev)
static void stop(struct net_device *dev)
{
struct fs_enet_private *fep = netdev_priv(dev);
- const struct fs_platform_info *fpi = fep->fpi;
struct fec __iomem *fecp = fep->fec.fecp;
-
- struct fec_info *feci = dev->phydev->mdio.bus->priv;
-
int i;
if ((FR(fecp, ecntrl) & FEC_ECNTRL_ETHER_EN) == 0)
@@ -363,16 +359,6 @@ static void stop(struct net_device *dev)
FC(fecp, ecntrl, FEC_ECNTRL_ETHER_EN);
fs_cleanup_bds(dev);
-
- /* shut down FEC1? that's where the mii bus is */
- if (fpi->has_phy) {
- FS(fecp, r_cntrl, fpi->use_rmii ?
- FEC_RCNTRL_RMII_MODE :
- FEC_RCNTRL_MII_MODE); /* MII/RMII enable */
- FS(fecp, ecntrl, FEC_ECNTRL_PINMUX | FEC_ECNTRL_ETHER_EN);
- FW(fecp, ievent, FEC_ENET_MII);
- FW(fecp, mii_speed, feci->mii_speed);
- }
}
static void napi_clear_event_fs(struct net_device *dev)
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h
index a1905e41c167..2b351b676467 100644
--- a/include/linux/fs_enet_pd.h
+++ b/include/linux/fs_enet_pd.h
@@ -123,7 +123,6 @@ struct fs_platform_info {
int napi_weight; /* NAPI weight */
int use_rmii; /* use RMII mode */
- int has_phy; /* if the network is phy container as well...*/
struct clk *clk_per; /* 'per' clock for register access */
};
--
2.41.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next v2 06/10] net: fs_enet: Remove stale prototypes from fsl_soc.c
2023-08-04 13:30 [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup Christophe Leroy
` (4 preceding siblings ...)
2023-08-04 13:30 ` [PATCH net-next v2 05/10] net: fs_enet: Remove has_phy field " Christophe Leroy
@ 2023-08-04 13:30 ` Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 07/10] net: fs_enet: Move struct fs_platform_info into fs_enet.h Christophe Leroy
` (5 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Christophe Leroy @ 2023-08-04 13:30 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Pantelis Antoniou, Eric Dumazet,
Paolo Abeni, Michael Ellerman, Nicholas Piggin, robh
Cc: netdev, linuxppc-dev, linux-kernel
Commit 3dd82a1ea724 ("[POWERPC] CPM: Always use new binding.")
removed last use of init_fec_ioports() and init_fcc_ioports().
Remove stale prototypes then don't include anymore fs_enet_pd.h
which was only included to provide fs_platform_info structure
for the prototypes.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
arch/powerpc/sysdev/fsl_soc.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 68709743450e..c11771542bec 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -23,7 +23,6 @@
#include <linux/phy.h>
#include <linux/spi/spi.h>
#include <linux/fsl_devices.h>
-#include <linux/fs_enet_pd.h>
#include <linux/fs_uart_pd.h>
#include <linux/reboot.h>
@@ -37,8 +36,6 @@
#include <asm/cpm2.h>
#include <asm/fsl_hcalls.h> /* For the Freescale hypervisor */
-extern void init_fcc_ioports(struct fs_platform_info*);
-extern void init_fec_ioports(struct fs_platform_info*);
extern void init_smc_ioports(struct fs_uart_platform_info*);
static phys_addr_t immrbase = -1;
--
2.41.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next v2 07/10] net: fs_enet: Move struct fs_platform_info into fs_enet.h
2023-08-04 13:30 [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup Christophe Leroy
` (5 preceding siblings ...)
2023-08-04 13:30 ` [PATCH net-next v2 06/10] net: fs_enet: Remove stale prototypes from fsl_soc.c Christophe Leroy
@ 2023-08-04 13:30 ` Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 08/10] net: fs_enet: Don't include fs_enet_pd.h when not needed Christophe Leroy
` (4 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Christophe Leroy @ 2023-08-04 13:30 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Pantelis Antoniou, Eric Dumazet,
Paolo Abeni, Michael Ellerman, Nicholas Piggin, robh
Cc: netdev, linuxppc-dev, linux-kernel
struct fs_platform_info is only used in fs_enet ethernet driver since
commit 3dd82a1ea724 ("[POWERPC] CPM: Always use new binding.").
Stale prototypes using fs_platform_info were left over in
arch/powerpc/sysdev/fsl_soc.c but they are now removed by
previous patch.
Move struct fs_platform_info into fs_enet.h
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
.../net/ethernet/freescale/fs_enet/fs_enet.h | 19 ++++++++++++++++++-
.../net/ethernet/freescale/fs_enet/mii-fec.c | 1 +
include/linux/fs_enet_pd.h | 16 ----------------
3 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet.h b/drivers/net/ethernet/freescale/fs_enet/fs_enet.h
index cb419aef8d1b..d371072fff60 100644
--- a/drivers/net/ethernet/freescale/fs_enet/fs_enet.h
+++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet.h
@@ -2,6 +2,7 @@
#ifndef FS_ENET_H
#define FS_ENET_H
+#include <linux/clk.h>
#include <linux/mii.h>
#include <linux/netdevice.h>
#include <linux/types.h>
@@ -9,7 +10,6 @@
#include <linux/phy.h>
#include <linux/dma-mapping.h>
-#include <linux/fs_enet_pd.h>
#include <asm/fs_pd.h>
#ifdef CONFIG_CPM1
@@ -118,6 +118,23 @@ struct phy_info {
#define ENET_RX_ALIGN 16
#define ENET_RX_FRSIZE L1_CACHE_ALIGN(PKT_MAXBUF_SIZE + ENET_RX_ALIGN - 1)
+struct fs_platform_info {
+ /* device specific information */
+ u32 cp_command; /* CPM page/sblock/mcn */
+
+ u32 dpram_offset;
+
+ struct device_node *phy_node;
+
+ int rx_ring, tx_ring; /* number of buffers on rx */
+ int rx_copybreak; /* limit we copy small frames */
+ int napi_weight; /* NAPI weight */
+
+ int use_rmii; /* use RMII mode */
+
+ struct clk *clk_per; /* 'per' clock for register access */
+};
+
struct fs_enet_private {
struct napi_struct napi;
struct device *dev; /* pointer back to the device (must be initialized first) */
diff --git a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c
index 1910df250c33..a1e777a4b75f 100644
--- a/drivers/net/ethernet/freescale/fs_enet/mii-fec.c
+++ b/drivers/net/ethernet/freescale/fs_enet/mii-fec.c
@@ -31,6 +31,7 @@
#include <linux/bitops.h>
#include <linux/platform_device.h>
#include <linux/of_address.h>
+#include <linux/of_mdio.h>
#include <linux/of_platform.h>
#include <linux/pgtable.h>
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h
index 2b351b676467..7c9897dab558 100644
--- a/include/linux/fs_enet_pd.h
+++ b/include/linux/fs_enet_pd.h
@@ -110,22 +110,6 @@ struct fs_mii_bb_platform_info {
int irq[32]; /* irqs per phy's */
};
-struct fs_platform_info {
- /* device specific information */
- u32 cp_command; /* CPM page/sblock/mcn */
-
- u32 dpram_offset;
-
- struct device_node *phy_node;
-
- int rx_ring, tx_ring; /* number of buffers on rx */
- int rx_copybreak; /* limit we copy small frames */
- int napi_weight; /* NAPI weight */
-
- int use_rmii; /* use RMII mode */
-
- struct clk *clk_per; /* 'per' clock for register access */
-};
struct fs_mii_fec_platform_info {
u32 irq[32];
u32 mii_speed;
--
2.41.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next v2 08/10] net: fs_enet: Don't include fs_enet_pd.h when not needed
2023-08-04 13:30 [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup Christophe Leroy
` (6 preceding siblings ...)
2023-08-04 13:30 ` [PATCH net-next v2 07/10] net: fs_enet: Move struct fs_platform_info into fs_enet.h Christophe Leroy
@ 2023-08-04 13:30 ` Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 09/10] net: fs_enet: Remove linux/fs_enet_pd.h Christophe Leroy
` (3 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Christophe Leroy @ 2023-08-04 13:30 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Pantelis Antoniou, Eric Dumazet,
Paolo Abeni, Michael Ellerman, Nicholas Piggin, robh
Cc: netdev, linuxppc-dev, linux-kernel
Three platforms in arch/powerpc/platforms/8xx/ include fs_enet_pd.h
but don't use anything from it.
Remove the includes.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
arch/powerpc/platforms/8xx/adder875.c | 1 -
arch/powerpc/platforms/8xx/mpc885ads_setup.c | 1 -
arch/powerpc/platforms/8xx/tqm8xx_setup.c | 1 -
3 files changed, 3 deletions(-)
diff --git a/arch/powerpc/platforms/8xx/adder875.c b/arch/powerpc/platforms/8xx/adder875.c
index 7e83eb6746f4..f6bd232f8323 100644
--- a/arch/powerpc/platforms/8xx/adder875.c
+++ b/arch/powerpc/platforms/8xx/adder875.c
@@ -7,7 +7,6 @@
*/
#include <linux/init.h>
-#include <linux/fs_enet_pd.h>
#include <linux/of_platform.h>
#include <asm/time.h>
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 2fc7cacbcd96..c7c4f082b838 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -21,7 +21,6 @@
#include <linux/device.h>
#include <linux/delay.h>
-#include <linux/fs_enet_pd.h>
#include <linux/fs_uart_pd.h>
#include <linux/fsl_devices.h>
#include <linux/mii.h>
diff --git a/arch/powerpc/platforms/8xx/tqm8xx_setup.c b/arch/powerpc/platforms/8xx/tqm8xx_setup.c
index 7d8eb50bb9cd..6e56be852b2c 100644
--- a/arch/powerpc/platforms/8xx/tqm8xx_setup.c
+++ b/arch/powerpc/platforms/8xx/tqm8xx_setup.c
@@ -24,7 +24,6 @@
#include <linux/device.h>
#include <linux/delay.h>
-#include <linux/fs_enet_pd.h>
#include <linux/fs_uart_pd.h>
#include <linux/fsl_devices.h>
#include <linux/mii.h>
--
2.41.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next v2 09/10] net: fs_enet: Remove linux/fs_enet_pd.h
2023-08-04 13:30 [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup Christophe Leroy
` (7 preceding siblings ...)
2023-08-04 13:30 ` [PATCH net-next v2 08/10] net: fs_enet: Don't include fs_enet_pd.h when not needed Christophe Leroy
@ 2023-08-04 13:30 ` Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 10/10] net: fs_enet: Use cpm_muram_xxx() functions instead of cpm_dpxxx() macros Christophe Leroy
` (2 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Christophe Leroy @ 2023-08-04 13:30 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Pantelis Antoniou, Eric Dumazet,
Paolo Abeni, Michael Ellerman, Nicholas Piggin, robh
Cc: netdev, linuxppc-dev, linux-kernel
linux/fs_enet_pd.h is not used anymore.
Remove it.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
MAINTAINERS | 1 -
include/linux/fs_enet_pd.h | 118 -------------------------------------
2 files changed, 119 deletions(-)
delete mode 100644 include/linux/fs_enet_pd.h
diff --git a/MAINTAINERS b/MAINTAINERS
index 5e2bb1059ab6..5bf1be70e4a9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8371,7 +8371,6 @@ L: linuxppc-dev@lists.ozlabs.org
L: netdev@vger.kernel.org
S: Maintained
F: drivers/net/ethernet/freescale/fs_enet/
-F: include/linux/fs_enet_pd.h
FREESCALE SOC SOUND DRIVERS
M: Shengjiu Wang <shengjiu.wang@gmail.com>
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h
deleted file mode 100644
index 7c9897dab558..000000000000
--- a/include/linux/fs_enet_pd.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Platform information definitions for the
- * universal Freescale Ethernet driver.
- *
- * Copyright (c) 2003 Intracom S.A.
- * by Pantelis Antoniou <panto@intracom.gr>
- *
- * 2005 (c) MontaVista Software, Inc.
- * Vitaly Bordug <vbordug@ru.mvista.com>
- *
- * This file is licensed under the terms of the GNU General Public License
- * version 2. This program is licensed "as is" without any warranty of any
- * kind, whether express or implied.
- */
-
-#ifndef FS_ENET_PD_H
-#define FS_ENET_PD_H
-
-#include <linux/clk.h>
-#include <linux/string.h>
-#include <linux/of_mdio.h>
-#include <linux/if_ether.h>
-#include <asm/types.h>
-
-#define FS_ENET_NAME "fs_enet"
-
-enum fs_id {
- fsid_fec1,
- fsid_fec2,
- fsid_fcc1,
- fsid_fcc2,
- fsid_fcc3,
- fsid_scc1,
- fsid_scc2,
- fsid_scc3,
- fsid_scc4,
-};
-
-#define FS_MAX_INDEX 9
-
-static inline int fs_get_fec_index(enum fs_id id)
-{
- if (id >= fsid_fec1 && id <= fsid_fec2)
- return id - fsid_fec1;
- return -1;
-}
-
-static inline int fs_get_fcc_index(enum fs_id id)
-{
- if (id >= fsid_fcc1 && id <= fsid_fcc3)
- return id - fsid_fcc1;
- return -1;
-}
-
-static inline int fs_get_scc_index(enum fs_id id)
-{
- if (id >= fsid_scc1 && id <= fsid_scc4)
- return id - fsid_scc1;
- return -1;
-}
-
-static inline int fs_fec_index2id(int index)
-{
- int id = fsid_fec1 + index - 1;
- if (id >= fsid_fec1 && id <= fsid_fec2)
- return id;
- return FS_MAX_INDEX;
- }
-
-static inline int fs_fcc_index2id(int index)
-{
- int id = fsid_fcc1 + index - 1;
- if (id >= fsid_fcc1 && id <= fsid_fcc3)
- return id;
- return FS_MAX_INDEX;
-}
-
-static inline int fs_scc_index2id(int index)
-{
- int id = fsid_scc1 + index - 1;
- if (id >= fsid_scc1 && id <= fsid_scc4)
- return id;
- return FS_MAX_INDEX;
-}
-
-enum fs_mii_method {
- fsmii_fixed,
- fsmii_fec,
- fsmii_bitbang,
-};
-
-enum fs_ioport {
- fsiop_porta,
- fsiop_portb,
- fsiop_portc,
- fsiop_portd,
- fsiop_porte,
-};
-
-struct fs_mii_bit {
- u32 offset;
- u8 bit;
- u8 polarity;
-};
-struct fs_mii_bb_platform_info {
- struct fs_mii_bit mdio_dir;
- struct fs_mii_bit mdio_dat;
- struct fs_mii_bit mdc_dat;
- int delay; /* delay in us */
- int irq[32]; /* irqs per phy's */
-};
-
-struct fs_mii_fec_platform_info {
- u32 irq[32];
- u32 mii_speed;
-};
-
-#endif
--
2.41.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next v2 10/10] net: fs_enet: Use cpm_muram_xxx() functions instead of cpm_dpxxx() macros
2023-08-04 13:30 [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup Christophe Leroy
` (8 preceding siblings ...)
2023-08-04 13:30 ` [PATCH net-next v2 09/10] net: fs_enet: Remove linux/fs_enet_pd.h Christophe Leroy
@ 2023-08-04 13:30 ` Christophe Leroy
2023-08-06 15:37 ` Simon Horman
2023-08-06 15:37 ` [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup Simon Horman
2023-08-08 22:10 ` patchwork-bot+netdevbpf
11 siblings, 1 reply; 14+ messages in thread
From: Christophe Leroy @ 2023-08-04 13:30 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Pantelis Antoniou, Eric Dumazet,
Paolo Abeni, Michael Ellerman, Nicholas Piggin, robh
Cc: netdev, linuxppc-dev, linux-kernel
cpm_dpxxx() macros are now always referring to cpm_muram_xxx() fonctions
directly since commit 3dd82a1ea724 ("[POWERPC] CPM: Always use new
binding.")
Use cpm_muram_xxx() functions directly so that the cpm_dpxxx() macros
can be removed in the near future.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
drivers/net/ethernet/freescale/fs_enet/mac-fcc.c | 2 +-
drivers/net/ethernet/freescale/fs_enet/mac-scc.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c b/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
index ce63fd56df89..d903a9012db0 100644
--- a/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
+++ b/drivers/net/ethernet/freescale/fs_enet/mac-fcc.c
@@ -105,7 +105,7 @@ static int do_pd_setup(struct fs_enet_private *fep)
goto out_ep;
fep->fcc.mem = (void __iomem *)cpm2_immr;
- fpi->dpram_offset = cpm_dpalloc(128, 32);
+ fpi->dpram_offset = cpm_muram_alloc(128, 32);
if (IS_ERR_VALUE(fpi->dpram_offset)) {
ret = fpi->dpram_offset;
goto out_fcccp;
diff --git a/drivers/net/ethernet/freescale/fs_enet/mac-scc.c b/drivers/net/ethernet/freescale/fs_enet/mac-scc.c
index 66d40da5cde0..a64cb6270515 100644
--- a/drivers/net/ethernet/freescale/fs_enet/mac-scc.c
+++ b/drivers/net/ethernet/freescale/fs_enet/mac-scc.c
@@ -133,13 +133,13 @@ static int allocate_bd(struct net_device *dev)
struct fs_enet_private *fep = netdev_priv(dev);
const struct fs_platform_info *fpi = fep->fpi;
- fep->ring_mem_addr = cpm_dpalloc((fpi->tx_ring + fpi->rx_ring) *
- sizeof(cbd_t), 8);
+ fep->ring_mem_addr = cpm_muram_alloc((fpi->tx_ring + fpi->rx_ring) *
+ sizeof(cbd_t), 8);
if (IS_ERR_VALUE(fep->ring_mem_addr))
return -ENOMEM;
fep->ring_base = (void __iomem __force*)
- cpm_dpram_addr(fep->ring_mem_addr);
+ cpm_muram_addr(fep->ring_mem_addr);
return 0;
}
@@ -149,7 +149,7 @@ static void free_bd(struct net_device *dev)
struct fs_enet_private *fep = netdev_priv(dev);
if (fep->ring_base)
- cpm_dpfree(fep->ring_mem_addr);
+ cpm_muram_free(fep->ring_mem_addr);
}
static void cleanup_data(struct net_device *dev)
--
2.41.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH net-next v2 10/10] net: fs_enet: Use cpm_muram_xxx() functions instead of cpm_dpxxx() macros
2023-08-04 13:30 ` [PATCH net-next v2 10/10] net: fs_enet: Use cpm_muram_xxx() functions instead of cpm_dpxxx() macros Christophe Leroy
@ 2023-08-06 15:37 ` Simon Horman
0 siblings, 0 replies; 14+ messages in thread
From: Simon Horman @ 2023-08-06 15:37 UTC (permalink / raw)
To: Christophe Leroy
Cc: robh, linux-kernel, Nicholas Piggin, Eric Dumazet, netdev,
Jakub Kicinski, Paolo Abeni, linuxppc-dev, David S. Miller
On Fri, Aug 04, 2023 at 03:30:20PM +0200, Christophe Leroy wrote:
> cpm_dpxxx() macros are now always referring to cpm_muram_xxx() fonctions
nit: fonctions -> functions
Thanks Christophe,
This minor nit notwithstanding, this series looks good to me.
I'll send a reviewed-by tag for the whole series in response
to the cover letter.
...
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup
2023-08-04 13:30 [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup Christophe Leroy
` (9 preceding siblings ...)
2023-08-04 13:30 ` [PATCH net-next v2 10/10] net: fs_enet: Use cpm_muram_xxx() functions instead of cpm_dpxxx() macros Christophe Leroy
@ 2023-08-06 15:37 ` Simon Horman
2023-08-08 22:10 ` patchwork-bot+netdevbpf
11 siblings, 0 replies; 14+ messages in thread
From: Simon Horman @ 2023-08-06 15:37 UTC (permalink / raw)
To: Christophe Leroy
Cc: robh, linux-kernel, Nicholas Piggin, Eric Dumazet, netdev,
Jakub Kicinski, Paolo Abeni, linuxppc-dev, David S. Miller
On Fri, Aug 04, 2023 at 03:30:10PM +0200, Christophe Leroy wrote:
> Over the years, platform and driver initialisation have evolved into
> more generic ways, and driver or platform specific stuff has gone
> away, leaving stale objects behind.
>
> This series aims at cleaning all that up for fs_enet ethernet driver.
>
> Changes in v2:
> - Remove a trailing whitespace in the old struct moved in patch 7.
> - Include powerpc people and list that I forgot when sending v1
> (and Rob as expected by Patchwork for patch 6, not sure why)
Thanks, this looks good to me.
For the series,
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup
2023-08-04 13:30 [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup Christophe Leroy
` (10 preceding siblings ...)
2023-08-06 15:37 ` [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup Simon Horman
@ 2023-08-08 22:10 ` patchwork-bot+netdevbpf
11 siblings, 0 replies; 14+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-08 22:10 UTC (permalink / raw)
To: Christophe Leroy
Cc: robh, linux-kernel, npiggin, edumazet, netdev, kuba, pabeni,
linuxppc-dev, davem
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 4 Aug 2023 15:30:10 +0200 you wrote:
> Over the years, platform and driver initialisation have evolved into
> more generic ways, and driver or platform specific stuff has gone
> away, leaving stale objects behind.
>
> This series aims at cleaning all that up for fs_enet ethernet driver.
>
> Changes in v2:
> - Remove a trailing whitespace in the old struct moved in patch 7.
> - Include powerpc people and list that I forgot when sending v1
> (and Rob as expected by Patchwork for patch 6, not sure why)
>
> [...]
Here is the summary with links:
- [net-next,v2,01/10] net: fs_enet: Remove set but not used variable
https://git.kernel.org/netdev/net-next/c/78d3902795f0
- [net-next,v2,02/10] net: fs_enet: Fix address space and base types mismatches
https://git.kernel.org/netdev/net-next/c/ae9e78a9dc88
- [net-next,v2,03/10] net: fs_enet: Remove fs_get_id()
https://git.kernel.org/netdev/net-next/c/26bbbef8ff40
- [net-next,v2,04/10] net: fs_enet: Remove unused fields in fs_platform_info struct
https://git.kernel.org/netdev/net-next/c/caaf482e2654
- [net-next,v2,05/10] net: fs_enet: Remove has_phy field in fs_platform_info struct
https://git.kernel.org/netdev/net-next/c/9359a48c65a3
- [net-next,v2,06/10] net: fs_enet: Remove stale prototypes from fsl_soc.c
https://git.kernel.org/netdev/net-next/c/62e106c802c5
- [net-next,v2,07/10] net: fs_enet: Move struct fs_platform_info into fs_enet.h
https://git.kernel.org/netdev/net-next/c/7a76918371fe
- [net-next,v2,08/10] net: fs_enet: Don't include fs_enet_pd.h when not needed
https://git.kernel.org/netdev/net-next/c/33deffc9f19f
- [net-next,v2,09/10] net: fs_enet: Remove linux/fs_enet_pd.h
https://git.kernel.org/netdev/net-next/c/7149b38dc7cb
- [net-next,v2,10/10] net: fs_enet: Use cpm_muram_xxx() functions instead of cpm_dpxxx() macros
https://git.kernel.org/netdev/net-next/c/5e6cb39a256d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2023-08-08 22:11 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-04 13:30 [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 01/10] net: fs_enet: Remove set but not used variable Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 02/10] net: fs_enet: Fix address space and base types mismatches Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 03/10] net: fs_enet: Remove fs_get_id() Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 04/10] net: fs_enet: Remove unused fields in fs_platform_info struct Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 05/10] net: fs_enet: Remove has_phy field " Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 06/10] net: fs_enet: Remove stale prototypes from fsl_soc.c Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 07/10] net: fs_enet: Move struct fs_platform_info into fs_enet.h Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 08/10] net: fs_enet: Don't include fs_enet_pd.h when not needed Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 09/10] net: fs_enet: Remove linux/fs_enet_pd.h Christophe Leroy
2023-08-04 13:30 ` [PATCH net-next v2 10/10] net: fs_enet: Use cpm_muram_xxx() functions instead of cpm_dpxxx() macros Christophe Leroy
2023-08-06 15:37 ` Simon Horman
2023-08-06 15:37 ` [PATCH net-next v2 00/10] net: fs_enet: Driver cleanup Simon Horman
2023-08-08 22:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).