drives/soc/fsl: Move DPIO driver out of staging
Subsystems (5)
v4 cover drives/soc/fsl: Move DPIO driver out of staging
This patchset moves the NXP DPIO (Datapath I/O Driver) out of the drivers/staging directory and into the drivers/soc/fsl directory.
The DPIO driver enables access to Queue and Buffer Manager (QBMAN) hardware on NXP DPAA2 devices. This is a prerequisite to moving the DPAA2 Ethernet driver out of staging.
Changes in v4:
- Remove unneeded dev_kfree() and dev_set_drvdata()
- Use devm_memremap() and devm_ioremap() for device mappings
Changes in v3:
- Update caam files that use dpaa2 frame header files
- Fix sparse errors and memory leak
- Remove empty staging/drivers/fsl-mc directory
Changes in v2:
- Fix minor conflict in latest linux-next branch
- Generate patch using -M
Roy Pledge (4):
drivers/staging/fsl-mc: Use devm_memremap/devm_ioremap for DPIO drivers/staging/fsl-mc: Fix DPIO error path issue staging:fsl-mc: Move DPIO from staging to drivers/soc/fsl drivers/staging: Remove fsl-mc driver from staging
MAINTAINERS | 2 +-
drivers/crypto/caam/sg_sw_qm2.h | 2 +-
drivers/crypto/caam/sg_sw_sec4.h | 2 +-
drivers/soc/fsl/Kconfig | 10 ++++++++
drivers/soc/fsl/Makefile | 1 +
.../{staging/fsl-mc/bus => soc/fsl}/dpio/Makefile | 0
.../fsl-mc/bus => soc/fsl}/dpio/dpio-cmd.h | 0
.../fsl-mc/bus => soc/fsl}/dpio/dpio-driver.c | 27 ++++++++++++++--------
.../fsl-mc/bus => soc/fsl}/dpio/dpio-driver.txt | 0
.../fsl-mc/bus => soc/fsl}/dpio/dpio-service.c | 2 +-
.../{staging/fsl-mc/bus => soc/fsl}/dpio/dpio.c | 0
.../{staging/fsl-mc/bus => soc/fsl}/dpio/dpio.h | 0
.../fsl-mc/bus => soc/fsl}/dpio/qbman-portal.c | 2 +-
.../fsl-mc/bus => soc/fsl}/dpio/qbman-portal.h | 6 ++---
drivers/staging/Kconfig | 2 --
drivers/staging/Makefile | 1 -
drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h | 4 ++--
drivers/staging/fsl-mc/Kconfig | 2 --
drivers/staging/fsl-mc/Makefile | 3 ---
drivers/staging/fsl-mc/bus/Kconfig | 16 -------------
drivers/staging/fsl-mc/bus/Makefile | 9 --------
.../fsl-mc/include => include/soc/fsl}/dpaa2-fd.h | 0
.../include => include/soc/fsl}/dpaa2-global.h | 0
.../fsl-mc/include => include/soc/fsl}/dpaa2-io.h | 2 +-
24 files changed, 39 insertions(+), 54 deletions(-)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/Makefile (100%)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio-cmd.h (100%)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio-driver.c (92%)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio-driver.txt (100%)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio-service.c (99%)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio.c (100%)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio.h (100%)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/qbman-portal.c (99%)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/qbman-portal.h (99%)
delete mode 100644 drivers/staging/fsl-mc/Kconfig
delete mode 100644 drivers/staging/fsl-mc/Makefile
delete mode 100644 drivers/staging/fsl-mc/bus/Kconfig
delete mode 100644 drivers/staging/fsl-mc/bus/Makefile
rename {drivers/staging/fsl-mc/include => include/soc/fsl}/dpaa2-fd.h (100%)
rename {drivers/staging/fsl-mc/include => include/soc/fsl}/dpaa2-global.h (100%)
rename {drivers/staging/fsl-mc/include => include/soc/fsl}/dpaa2-io.h (99%)--
2.7.4
PATCH v4 1/4 drivers/staging/fsl-mc: Use devm_memremap/devm_ioremap for DPIO
Change the mapping of the QBMan cache enabled area from using ioremap_wc() to devm_memremap(). This allows the __iomem attribute to be removed from the pointer (which makes sense as accesses treat this as cacheable memory not IO memory). These changes allow sparse checks to pass.
Also use devm_ioremap() for the cache inhibited area so unmap occurs automatically when the device is released.
--- drivers/staging/fsl-mc/bus/dpio/dpio-driver.c | 19 +++++++++++++++---- drivers/staging/fsl-mc/bus/dpio/qbman-portal.h | 4 ++-- drivers/staging/fsl-mc/include/dpaa2-io.h | 2 +- 3 files changed, 18 insertions(+), 7 deletions(-)
drivers/staging/fsl-mc/bus/dpio/dpio-driver.c +15 -4
@@ -13,6 +13,7 @@#include <linux/msi.h> #include <linux/dma-mapping.h> #include <linux/delay.h> +#include <linux/io.h> #include <linux/fsl/mc.h> #include "../../include/dpaa2-io.h"
@@ -146,10 +147,20 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev)* Set the CENA regs to be the cache inhibited area of the portal to * avoid coherency issues if a user migrates to another core. */ - desc.regs_cena =ioremap_wc (dpio_dev->regions[1 ].start, -resource_size (&dpio_dev->regions[1 ])); - desc.regs_cinh =ioremap (dpio_dev->regions[1 ].start, -resource_size (&dpio_dev->regions[1 ])); + desc.regs_cena =devm_memremap (dev, dpio_dev->regions[1 ].start, +resource_size (&dpio_dev->regions[1 ]), +MEMREMAP_WC ); +if (!desc.regs_cena) { +dev_err (dev,"devm_memremap failed\n" ); + goto err_allocate_irqs; + } + + desc.regs_cinh =devm_ioremap (dev, dpio_dev->regions[1 ].start, +resource_size (&dpio_dev->regions[1 ])); +if (!desc.regs_cinh) { +dev_err (dev,"devm_ioremap failed\n" ); + goto err_allocate_irqs; + } err =fsl_mc_allocate_irqs (dpio_dev);if (err) {
drivers/staging/fsl-mc/bus/dpio/qbman-portal.h +2 -2
@@ -15,7 +15,7 @@ struct qbman_swp;/* qbman software portal descriptor structure */ struct qbman_swp_desc {void *cena_bar;/* Cache-enabled portal base address */ -void *cinh_bar;/* Cache-inhibited portal base address */ +void __iomem *cinh_bar;/* Cache-inhibited portal base address */ u32 qman_version; };
@@ -102,7 +102,7 @@ struct qbman_release_desc {/* portal data structure */ struct qbman_swp {const struct qbman_swp_desc *desc; -void __iomem *addr_cena; +void *addr_cena;void __iomem *addr_cinh;/* Management commands */
drivers/staging/fsl-mc/include/dpaa2-io.h +1 -1
@@ -52,7 +52,7 @@ struct dpaa2_io_desc {int has_8prio;int cpu;void *regs_cena; -void *regs_cinh; +void __iomem *regs_cinh;int dpio_id;u32 qman_version; };
Signature · 1 line
2.7.4
PATCH v4 2/4 drivers/staging/fsl-mc: Fix DPIO error path issue
In reply to Roy PledgeRemove unneeded call to dev_set_drvdata(dev, NULL) since the device will be deallocated in any case.
--- drivers/staging/fsl-mc/bus/dpio/dpio-driver.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/staging/fsl-mc/bus/dpio/dpio-driver.c +1 -5
@@ -101,7 +101,7 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev)if (err) {dev_dbg (dev,"MC portal allocation failed\n" ); err = -EPROBE_DEFER ; - goto err_mcportal; + goto err_priv_alloc; } err = dpio_open(dpio_dev->mc_io, 0, dpio_dev->obj_desc.id,
@@ -196,8 +196,6 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev)dpio_close (dpio_dev->mc_io,0 , dpio_dev->mc_handle); err_open:fsl_mc_portal_free (dpio_dev->mc_io); -err_mcportal: -dev_set_drvdata (dev,NULL ); err_priv_alloc:return err; }
@@ -241,8 +239,6 @@ static int dpaa2_dpio_remove(struct fsl_mc_device *dpio_dev)fsl_mc_portal_free (dpio_dev->mc_io); -dev_set_drvdata (dev,NULL ); -return 0 ; err_open:
Signature · 1 line
2.7.4
PATCH v4 3/4 staging:fsl-mc: Move DPIO from staging to drivers/soc/fsl
In reply to Roy PledgeMove the NXP DPIO (Datapath I/O Driver) out of the drivers/staging directory and into the drivers/soc/fsl directory.
The DPIO driver enables access to Queue and Buffer Manager (QBMAN) hardware on NXP DPAA2 devices. This is a prerequisite to moving the DPAA2 Ethernet driver out of staging.
---
MAINTAINERS | 2 +-
drivers/crypto/caam/sg_sw_qm2.h | 2 +-
drivers/crypto/caam/sg_sw_sec4.h | 2 +-
drivers/soc/fsl/Kconfig | 10 ++++++++++
drivers/soc/fsl/Makefile | 1 +
drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/Makefile | 0
drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio-cmd.h | 0
drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio-driver.c | 2 +-
drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio-driver.txt | 0
drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio-service.c | 2 +-
drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio.c | 0
drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio.h | 0
drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/qbman-portal.c | 2 +-
drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/qbman-portal.h | 2 +-
drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h | 4 ++--
drivers/staging/fsl-mc/bus/Kconfig | 9 ---------
drivers/staging/fsl-mc/bus/Makefile | 2 --
{drivers/staging/fsl-mc/include => include/soc/fsl}/dpaa2-fd.h | 0
.../staging/fsl-mc/include => include/soc/fsl}/dpaa2-global.h | 0
{drivers/staging/fsl-mc/include => include/soc/fsl}/dpaa2-io.h | 0
20 files changed, 20 insertions(+), 20 deletions(-)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/Makefile (100%)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio-cmd.h (100%)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio-driver.c (99%)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio-driver.txt (100%)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio-service.c (99%)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio.c (100%)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/dpio.h (100%)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/qbman-portal.c (99%)
rename drivers/{staging/fsl-mc/bus => soc/fsl}/dpio/qbman-portal.h (99%)
rename {drivers/staging/fsl-mc/include => include/soc/fsl}/dpaa2-fd.h (100%)
rename {drivers/staging/fsl-mc/include => include/soc/fsl}/dpaa2-global.h (100%)
rename {drivers/staging/fsl-mc/include => include/soc/fsl}/dpaa2-io.h (100%)MAINTAINERS +1 -1
@@ -4375,7 +4375,7 @@ DPAA2 DATAPATH I/O (DPIO) DRIVER M: Roy Pledge <[email protected]> L: linux-kernel at vger.kernel.org S: Maintained -F: drivers/staging/fsl-mc/bus/dpio +F: drivers/soc/fsl/dpio DPAA2 ETHERNET DRIVER M: Ioana Radulescu <[email protected]>
drivers/crypto/caam/sg_sw_qm2.h +1 -1
@@ -35,7 +35,7 @@#ifndef _SG_SW_QM2_H_#define _SG_SW_QM2_H_ -#include "../../../drivers/staging/fsl-mc/include/dpaa2-fd.h" +#include <soc/fsl/dpaa2-fd.h> static inline void dma_to_qm_sg_one (struct dpaa2_sg_entry *qm_sg_ptr,dma_addr_t dma,u32 len,u16 offset)
drivers/crypto/caam/sg_sw_sec4.h +1 -1
@@ -12,7 +12,7 @@#include "ctrl.h" #include "regs.h" #include "sg_sw_qm2.h" -#include "../../../drivers/staging/fsl-mc/include/dpaa2-fd.h" +#include <soc/fsl/dpaa2-fd.h> struct sec4_sg_entry {u64 ptr;
drivers/soc/fsl/Kconfig +10 -0
@@ -16,3 +16,13 @@ config FSL_GUTS Initially only reading SVR and registering soc device are supported. Other guts accesses, such as reading RCW, should eventually be moved into this driver as well. + +config FSL_MC_DPIO + tristate "QorIQ DPAA2 DPIO driver" + depends on FSL_MC_BUS + help + Driver for the DPAA2 DPIO object. A DPIO provides queue and + buffer management facilities for software to interact with + other DPAA2 objects. This driver does not expose the DPIO + objects individually, but groups them under a service layer + API.
drivers/soc/fsl/Makefile +1 -0
@@ -6,3 +6,4 @@ obj-$(CONFIG_FSL_DPAA) += qbman/ obj-$(CONFIG_QUICC_ENGINE) += qe/ obj-$(CONFIG_CPM) += qe/ obj-$(CONFIG_FSL_GUTS) += guts.o +obj-$(CONFIG_FSL_MC_DPIO) += dpio/
drivers/soc/fsl/dpio/Makefile renamed from drivers/staging/fsl-mc/bus/dpio/Makefile +0 -0
drivers/soc/fsl/dpio/dpio-cmd.h renamed from drivers/staging/fsl-mc/bus/dpio/dpio-cmd.h +0 -0
drivers/soc/fsl/dpio/dpio-driver.c renamed from drivers/staging/fsl-mc/bus/dpio/dpio-driver.c +1 -1
@@ -16,7 +16,7 @@#include <linux/io.h> #include <linux/fsl/mc.h> -#include "../../include/dpaa2-io.h" +#include <soc/fsl/dpaa2-io.h> #include "qbman-portal.h" #include "dpio.h"
drivers/soc/fsl/dpio/dpio-driver.txt renamed from drivers/staging/fsl-mc/bus/dpio/dpio-driver.txt +0 -0
drivers/soc/fsl/dpio/dpio-service.c renamed from drivers/staging/fsl-mc/bus/dpio/dpio-service.c +1 -1
@@ -6,7 +6,7 @@*/ #include <linux/types.h> #include <linux/fsl/mc.h> -#include "../../include/dpaa2-io.h" +#include <soc/fsl/dpaa2-io.h> #include <linux/init.h> #include <linux/module.h> #include <linux/platform_device.h>
drivers/soc/fsl/dpio/dpio.c renamed from drivers/staging/fsl-mc/bus/dpio/dpio.c +0 -0
drivers/soc/fsl/dpio/dpio.h renamed from drivers/staging/fsl-mc/bus/dpio/dpio.h +0 -0
drivers/soc/fsl/dpio/qbman-portal.c renamed from drivers/staging/fsl-mc/bus/dpio/qbman-portal.c +1 -1
@@ -8,7 +8,7 @@#include <asm/cacheflush.h> #include <linux/io.h> #include <linux/slab.h> -#include "../../include/dpaa2-global.h" +#include <soc/fsl/dpaa2-global.h> #include "qbman-portal.h"
drivers/soc/fsl/dpio/qbman-portal.h renamed from drivers/staging/fsl-mc/bus/dpio/qbman-portal.h +1 -1
@@ -7,7 +7,7 @@#ifndef __FSL_QBMAN_PORTAL_H#define __FSL_QBMAN_PORTAL_H -#include "../../include/dpaa2-fd.h" +#include <soc/fsl/dpaa2-fd.h> struct dpaa2_dq ;struct qbman_swp ;
drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h +2 -2
@@ -37,8 +37,8 @@#include <linux/if_vlan.h> #include <linux/fsl/mc.h> -#include "../../fsl-mc/include/dpaa2-io.h" -#include "../../fsl-mc/include/dpaa2-fd.h" +#include <soc/fsl/dpaa2-io.h> +#include <soc/fsl/dpaa2-fd.h> #include "dpni.h" #include "dpni-cmd.h"
drivers/staging/fsl-mc/bus/Kconfig +0 -9
@@ -5,12 +5,3 @@ # Copyright (C) 2014-2016 Freescale Semiconductor, Inc. # -config FSL_MC_DPIO - tristate "QorIQ DPAA2 DPIO driver" - depends on FSL_MC_BUS - help - Driver for the DPAA2 DPIO object. A DPIO provides queue and - buffer management facilities for software to interact with - other DPAA2 objects. This driver does not expose the DPIO - objects individually, but groups them under a service layer - API.
drivers/staging/fsl-mc/bus/Makefile +0 -2
@@ -5,5 +5,3 @@ # Copyright (C) 2014 Freescale Semiconductor, Inc. # -# MC DPIO driver -obj-$(CONFIG_FSL_MC_DPIO) += dpio/
include/soc/fsl/dpaa2-fd.h renamed from drivers/staging/fsl-mc/include/dpaa2-fd.h +0 -0
include/soc/fsl/dpaa2-global.h renamed from drivers/staging/fsl-mc/include/dpaa2-global.h +0 -0
include/soc/fsl/dpaa2-io.h renamed from drivers/staging/fsl-mc/include/dpaa2-io.h +0 -0
Signature · 1 line
2.7.4
Greg KH
maintainerRe: [PATCH v4 3/4] staging:fsl-mc: Move DPIO from staging to drivers/soc/fsl
Quoted 8 lines · Roy Pledge
Move the NXP DPIO (Datapath I/O Driver) out of the
drivers/stagingdirectory and into thedrivers/soc/fsldirectory.The DPIO driver enables access to Queue and Buffer Manager (QBMAN) hardware on NXP DPAA2 devices. This is a prerequisite to moving the DPAA2 Ethernet driver out of staging.
Signed-off-by Roy Pledge <[email protected]>
Ah, this needs to go in before the ethernet driver can move out, sorry about that.
Can you redo these last two patches against my staging-next branch so that we have a chance that they will apply?
thanks,
greg k-h
PATCH v4 4/4 drivers/staging: Remove fsl-mc driver from staging
In reply to Roy PledgeRemove the staging/drivers/fsl-mc directory from the staging area now that all the components have been moved to the main kernel areas.
--- drivers/staging/Kconfig | 2 -- drivers/staging/Makefile | 1 - drivers/staging/fsl-mc/Kconfig | 2 -- drivers/staging/fsl-mc/Makefile | 3 --- drivers/staging/fsl-mc/bus/Kconfig | 7 ------- drivers/staging/fsl-mc/bus/Makefile | 7 ------- 6 files changed, 22 deletions(-) delete mode 100644 drivers/staging/fsl-mc/Kconfig delete mode 100644 drivers/staging/fsl-mc/Makefile delete mode 100644 drivers/staging/fsl-mc/bus/Kconfig delete mode 100644 drivers/staging/fsl-mc/bus/Makefile
drivers/staging/Kconfig +0 -2
@@ -98,8 +98,6 @@ source "drivers/staging/clocking-wizard/Kconfig" source "drivers/staging/fbtft/Kconfig" -source "drivers/staging/fsl-mc/Kconfig" - source "drivers/staging/fsl-dpaa2/Kconfig" source "drivers/staging/wilc1000/Kconfig"
drivers/staging/Makefile +0 -1
@@ -40,7 +40,6 @@ obj-$(CONFIG_CRYPTO_SKEIN) += skein/ obj-$(CONFIG_UNISYSSPAR) += unisys/ obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += clocking-wizard/ obj-$(CONFIG_FB_TFT) += fbtft/ -obj-$(CONFIG_FSL_MC_BUS) += fsl-mc/ obj-$(CONFIG_FSL_DPAA2) += fsl-dpaa2/ obj-$(CONFIG_WILC1000) += wilc1000/ obj-$(CONFIG_MOST) += most/
drivers/staging/fsl-mc/Kconfig deleted +0 -2
@@ -1,2 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -source "drivers/staging/fsl-mc/bus/Kconfig"
drivers/staging/fsl-mc/Makefile deleted +0 -3
@@ -1,3 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# Freescale Management Complex (MC) bus drivers -obj-$(CONFIG_FSL_MC_BUS) += bus/
drivers/staging/fsl-mc/bus/Kconfig deleted +0 -7
@@ -1,7 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# DPAA2 fsl-mc bus -# -# Copyright (C) 2014-2016 Freescale Semiconductor, Inc. -# -
drivers/staging/fsl-mc/bus/Makefile deleted +0 -7
@@ -1,7 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# -# Freescale Management Complex (MC) bus drivers -# -# Copyright (C) 2014 Freescale Semiconductor, Inc. -# -
Signature · 1 line
2.7.4