Skip to content

Commit 9c692d5

Browse files
Bogdan Purcareatagregkh
authored andcommitted
staging: fsl-mc: Move DPBP out of staging
Move the source files out of staging into their final locations: - dpbp.c goes to drivers/bus/fsl-mc/, next to the core infrastructure - dpbp-cmd.h gets merged into drivers/bus/fsl-mc/fsl-mc-private.h, next to the other internally used APIs - dpbp.h gets merged into include/linux/fsl/mc.h, exposing the public API Update references in the dpaa2-eth staging driver. DPBP stands for Data Path Buffer Pool - you can read more about the object in Documentation/networking/dpaa2/overview.rst Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com> Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d64c2a7 commit 9c692d5

8 files changed

Lines changed: 86 additions & 102 deletions

File tree

‎drivers/bus/fsl-mc/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ obj-$(CONFIG_FSL_MC_BUS) += mc-bus-driver.o
99
mc-bus-driver-objs := fsl-mc-bus.o \
1010
mc-sys.o \
1111
mc-io.o \
12+
dpbp.o \
1213
dprc.o \
1314
dprc-driver.o \
1415
fsl-mc-allocator.o \
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
*/
66
#include <linux/kernel.h>
77
#include <linux/fsl/mc.h>
8-
#include "../include/dpbp.h"
8+
#include <linux/fsl/mc.h>
99

10-
#include "dpbp-cmd.h"
10+
#include "fsl-mc-private.h"
1111

1212
/**
1313
* dpbp_open() - Open a control session for the specified object.

‎drivers/bus/fsl-mc/fsl-mc-private.h‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,45 @@ int dprc_get_container_id(struct fsl_mc_io *mc_io,
379379
u32 cmd_flags,
380380
int *container_id);
381381

382+
/*
383+
* Data Path Buffer Pool (DPBP) API
384+
*/
385+
386+
/* DPBP Version */
387+
#define DPBP_VER_MAJOR 3
388+
#define DPBP_VER_MINOR 2
389+
390+
/* Command versioning */
391+
#define DPBP_CMD_BASE_VERSION 1
392+
#define DPBP_CMD_ID_OFFSET 4
393+
394+
#define DPBP_CMD(id) (((id) << DPBP_CMD_ID_OFFSET) | DPBP_CMD_BASE_VERSION)
395+
396+
/* Command IDs */
397+
#define DPBP_CMDID_CLOSE DPBP_CMD(0x800)
398+
#define DPBP_CMDID_OPEN DPBP_CMD(0x804)
399+
400+
#define DPBP_CMDID_ENABLE DPBP_CMD(0x002)
401+
#define DPBP_CMDID_DISABLE DPBP_CMD(0x003)
402+
#define DPBP_CMDID_GET_ATTR DPBP_CMD(0x004)
403+
#define DPBP_CMDID_RESET DPBP_CMD(0x005)
404+
405+
struct dpbp_cmd_open {
406+
__le32 dpbp_id;
407+
};
408+
409+
#define DPBP_ENABLE 0x1
410+
411+
struct dpbp_rsp_get_attributes {
412+
/* response word 0 */
413+
__le16 pad;
414+
__le16 bpid;
415+
__le32 id;
416+
/* response word 1 */
417+
__le16 version_major;
418+
__le16 version_minor;
419+
};
420+
382421
/**
383422
* Maximum number of total IRQs that can be pre-allocated for an MC bus'
384423
* IRQ pool

‎drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535

3636
#include <linux/netdevice.h>
3737
#include <linux/if_vlan.h>
38+
#include <linux/fsl/mc.h>
3839

3940
#include "../../fsl-mc/include/dpaa2-io.h"
4041
#include "../../fsl-mc/include/dpaa2-fd.h"
41-
#include "../../fsl-mc/include/dpbp.h"
4242
#include "../../fsl-mc/include/dpcon.h"
4343
#include "dpni.h"
4444
#include "dpni-cmd.h"

‎drivers/staging/fsl-mc/bus/Makefile‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
#
55
# Copyright (C) 2014 Freescale Semiconductor, Inc.
66
#
7-
obj-$(CONFIG_FSL_MC_BUS) += dpbp.o \
8-
dpcon.o
7+
obj-$(CONFIG_FSL_MC_BUS) += dpcon.o
98

109
# MC DPIO driver
1110
obj-$(CONFIG_FSL_MC_DPIO) += dpio/

‎drivers/staging/fsl-mc/bus/dpbp-cmd.h‎

Lines changed: 0 additions & 44 deletions
This file was deleted.

‎drivers/staging/fsl-mc/include/dpbp.h‎

Lines changed: 0 additions & 53 deletions
This file was deleted.

‎include/linux/fsl/mc.h‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,4 +451,46 @@ static inline bool is_fsl_mc_bus_dprtc(const struct fsl_mc_device *mc_dev)
451451
return mc_dev->dev.type == &fsl_mc_bus_dprtc_type;
452452
}
453453

454+
/*
455+
* Data Path Buffer Pool (DPBP) API
456+
* Contains initialization APIs and runtime control APIs for DPBP
457+
*/
458+
459+
int dpbp_open(struct fsl_mc_io *mc_io,
460+
u32 cmd_flags,
461+
int dpbp_id,
462+
u16 *token);
463+
464+
int dpbp_close(struct fsl_mc_io *mc_io,
465+
u32 cmd_flags,
466+
u16 token);
467+
468+
int dpbp_enable(struct fsl_mc_io *mc_io,
469+
u32 cmd_flags,
470+
u16 token);
471+
472+
int dpbp_disable(struct fsl_mc_io *mc_io,
473+
u32 cmd_flags,
474+
u16 token);
475+
476+
int dpbp_reset(struct fsl_mc_io *mc_io,
477+
u32 cmd_flags,
478+
u16 token);
479+
480+
/**
481+
* struct dpbp_attr - Structure representing DPBP attributes
482+
* @id: DPBP object ID
483+
* @bpid: Hardware buffer pool ID; should be used as an argument in
484+
* acquire/release operations on buffers
485+
*/
486+
struct dpbp_attr {
487+
int id;
488+
u16 bpid;
489+
};
490+
491+
int dpbp_get_attributes(struct fsl_mc_io *mc_io,
492+
u32 cmd_flags,
493+
u16 token,
494+
struct dpbp_attr *attr);
495+
454496
#endif /* _FSL_MC_H_ */

0 commit comments

Comments
 (0)