Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
0002 /*
0003  * Copyright 2013-2016 Freescale Semiconductor Inc.
0004  * Copyright 2016 NXP
0005  *
0006  */
0007 #ifndef __FSL_DPIO_H
0008 #define __FSL_DPIO_H
0009 
0010 struct fsl_mc_io;
0011 
0012 int dpio_open(struct fsl_mc_io  *mc_io,
0013           u32       cmd_flags,
0014           int       dpio_id,
0015           u16       *token);
0016 
0017 int dpio_close(struct fsl_mc_io *mc_io,
0018            u32      cmd_flags,
0019            u16      token);
0020 
0021 /**
0022  * enum dpio_channel_mode - DPIO notification channel mode
0023  * @DPIO_NO_CHANNEL: No support for notification channel
0024  * @DPIO_LOCAL_CHANNEL: Notifications on data availability can be received by a
0025  *  dedicated channel in the DPIO; user should point the queue's
0026  *  destination in the relevant interface to this DPIO
0027  */
0028 enum dpio_channel_mode {
0029     DPIO_NO_CHANNEL = 0,
0030     DPIO_LOCAL_CHANNEL = 1,
0031 };
0032 
0033 /**
0034  * struct dpio_cfg - Structure representing DPIO configuration
0035  * @channel_mode: Notification channel mode
0036  * @num_priorities: Number of priorities for the notification channel (1-8);
0037  *          relevant only if 'channel_mode = DPIO_LOCAL_CHANNEL'
0038  */
0039 struct dpio_cfg {
0040     enum dpio_channel_mode  channel_mode;
0041     u8      num_priorities;
0042 };
0043 
0044 int dpio_enable(struct fsl_mc_io    *mc_io,
0045         u32     cmd_flags,
0046         u16     token);
0047 
0048 int dpio_disable(struct fsl_mc_io   *mc_io,
0049          u32        cmd_flags,
0050          u16        token);
0051 
0052 /**
0053  * struct dpio_attr - Structure representing DPIO attributes
0054  * @id: DPIO object ID
0055  * @qbman_portal_ce_offset: offset of the software portal cache-enabled area
0056  * @qbman_portal_ci_offset: offset of the software portal cache-inhibited area
0057  * @qbman_portal_id: Software portal ID
0058  * @channel_mode: Notification channel mode
0059  * @num_priorities: Number of priorities for the notification channel (1-8);
0060  *          relevant only if 'channel_mode = DPIO_LOCAL_CHANNEL'
0061  * @qbman_version: QBMAN version
0062  * @clk: QBMAN clock frequency value in Hz
0063  */
0064 struct dpio_attr {
0065     int         id;
0066     u64     qbman_portal_ce_offset;
0067     u64     qbman_portal_ci_offset;
0068     u16     qbman_portal_id;
0069     enum dpio_channel_mode  channel_mode;
0070     u8          num_priorities;
0071     u32     qbman_version;
0072     u32     clk;
0073 };
0074 
0075 int dpio_get_attributes(struct fsl_mc_io    *mc_io,
0076             u32     cmd_flags,
0077             u16     token,
0078             struct dpio_attr    *attr);
0079 
0080 int dpio_set_stashing_destination(struct fsl_mc_io *mc_io,
0081                   u32 cmd_flags,
0082                   u16 token,
0083                   u8 dest);
0084 
0085 int dpio_get_api_version(struct fsl_mc_io *mc_io,
0086              u32 cmd_flags,
0087              u16 *major_ver,
0088              u16 *minor_ver);
0089 
0090 int dpio_reset(struct fsl_mc_io *mc_io,
0091            u32 cmd_flags,
0092            u16 token);
0093 
0094 #endif /* __FSL_DPIO_H */