Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934201AbcJUOXf (ORCPT ); Fri, 21 Oct 2016 10:23:35 -0400 Received: from mail-bl2nam02on0071.outbound.protection.outlook.com ([104.47.38.71]:37305 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933922AbcJUOXa (ORCPT ); Fri, 21 Oct 2016 10:23:30 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; From: Stuart Yoder To: CC: , , , , , , Roy Pledge , Stuart Yoder Subject: [PATCH 5/9] bus: fsl-mc: dpio: add global dpaa2 definitions Date: Fri, 21 Oct 2016 09:01:45 -0500 Message-ID: <1477058509-12547-6-git-send-email-stuart.yoder@nxp.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1477058509-12547-1-git-send-email-stuart.yoder@nxp.com> References: <1477058509-12547-1-git-send-email-stuart.yoder@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131215324873691478;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.158.2;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(68736007)(8666005)(305945005)(189998001)(356003)(85426001)(48376002)(19580405001)(7846002)(19580395003)(8936002)(11100500001)(36756003)(50466002)(105606002)(97736004)(86362001)(81156014)(626004)(6666003)(8676002)(5003940100001)(87936001)(81166006)(104016004)(47776003)(229853001)(2351001)(5660300001)(106466001)(76176999)(50986999)(110136003)(69596002)(586003)(77096005)(2950100002)(6916009)(92566002)(50226002)(2906002)(4326007)(33646002)(7059030)(2004002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0301MB1627;H:az84smr01.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD029;1:C7JZh9tOEC2vgduUY4MYkUkYSGVW5jpMioQHHx1R8dWNJB+oiFcjkBVdWqZ4vi+F92CI0uy224SR3Ca4S1mGvzD3djLbnHQJOxbBsDviZmpxrDDcf8xtnKyd057wJ7UpGJ6D35U1cmKtmHea2OeerBqcIXmsesMF1rNNhfxWnuLUvwRe3arPY4TslRps7sMIJHo5Q7al12z0Zmwf87IgWsqfG8oTbvlUioQllJoenFpsJz6kehSBzxxmlg9GVxdCCa/mTogrEMtNEuQEXzjIStFqlpasTxoNAFE0Ambd5wPyLlQhufz9msXIIvcataDt86XQ1Gz2F/wE1uh4Pe5OUt9gBqke+pcaCjMqRd8353RXhiBlSGuu9agGI8EUc7T46Xa/5QE2lqHLKrrVqla2GkGOxI1HLrqvl2SW+WWMpLyWqceeMKbB1w0QPBSqQlxM0lZY4WscrJYzj27+6qJbH/CSkfIOs+Pl18rKOqZ4Ej/a1kuEopcKy/Jz9hCrAc3kdFaZNPn9R1hZlIC3B4gj5ENC953O01LCE//yxGdfak6DuHIG2CCXr+3E3kbQG+cPk6T5m8LkZrC8rqmw1tXKedCV+Mvr0SZVtzwNqqrLvTGfaVGRYUyUy/M6XY3VNu6PDy2SYrLRBrN3uj45cUfl+2k9caVOuCBxgF70da1jd+9sjBMbIb5z2uz6OUR1Qy7IqBQhWV2XPkeCaad8ADLnanCsuWQuL95z9TP0CUADqoc= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 55d380b1-cf78-43df-aff5-08d3f9bbaea3 X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1627;2:4wrzlSR3Xst2NZgkzq0fXUBJ4ZWYv77QJD3olaaaBSkAEUVMBdkhIuMHP3PC07aNdKqD6Sf2i5nbeM2vgs1QGI1FyuxbUV7ryTmr6UzMPMoIBpsIF/U3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xm3qFDQAAvzWM2bzj1RfwxP+uxdkn6WTEZTjqdy+59c+9ouJd4uAkqQgXu8jGDgLLYJKg/o6Xstu+noJc9p/xPiVptRziAwJdRVkaFfGmhHcgYFbrKLnALg==;4:oRJ7K4Gu7MTXbTKWvC3lHfcwRLdT91GabRhib2VhezNPpo4swW5oWlrE+F/QeYhBOmVbFkFIRIsiMA3+N6QyOQ8k3llFVORUEGFDfSVYaeZV2d4lxXOZbtVksOyQkDIPJAXYFoycsLdEZoNk770rWEu9ctFsKAcv1ckFUrcxmGm+dx0Wl4aIa6YEd6F9sc6/zQwrk3zxTPaeDyjixd2KMhQcDsccZrBaD3GDLXNOT2HmfgaYL1Z8kubSV4Y7jE0y7Ox35wVE5ozydNzWVpSnPnoYzTCIsUfz6+q/ee6IkvHKBHbZsivfnw3f2hQgoqbma5dnwFzL3+sNGu7sP3tCUinmCxi1M5eYL2GsDSn9FskOxCGM9nhmnFicW9kmYoojm8B+pl3e3LR+uOMvAQA9ioYUJTnwjK9NisHc4ZSWZTncCTQv1AEwLtK2/pJjQfA4A+MsERjxh+rjxs43UfvW0M5ggWUZOn7vg/c8f+z66Zf6uPQnHeoCdhRmamLFSIGKH1VfGk1M46LgITVr5kBdZ9nJ17YPF4sZuHOCsUgHnzWaCmOyCwu2/pq8BnFaxP4w X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(13023025)(5005006)(8121501046)(13018025)(13024025)(13015025)(13017025)(3002001)(10201501046)(6055026);SRVR:CY1PR0301MB1627;BCL:0;PCL:0;RULEID:(400006);SRVR:CY1PR0301MB1627; X-Forefront-PRVS: 01026E1310 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0301MB1627;23:Hp6T84u9mBdNa5pBxWRQ28BO77ZcGB83kyBy4tM?= =?us-ascii?Q?os4GYNOckB+0wdu8KNH+4a6kt2b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amDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1627;7:3e8G/EaGMk9OGwT26TV1A3EsdqZS/+GWO0eBFLODwtPz0QNnsLA7QzUcWjPmgbn2XaXilL1uQtpDCwAZrWHN6/VUt4WMb9DyiEk6NvimuXVy1MTZfGuOrOin3AsNSpPBsmNPGoFSwFxlVTu6IHRESoKX2mmZThzod4VaLIlZ1UzkWLxeWwZUuLXnywzkKT0t73l0Qj2Jb+WIpbWxVygLuhyLEyuIzCtiTfMhTPxsumQK3RctFGAYOhwPZO5Fdyfrlwyo8H15TfZdLp330IA72nkjkXC110eslw3qhedgU5dIoZ9CQldKIqtM22SSrwKs+/UTTiEHAf4whihgeVSkpiYNOE0za/IPoSM4hzh4JJk= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2016 14:08:07.1351 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB1627 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6384 Lines: 223 From: Roy Pledge Create header for global dpaa2 definitions. Add definitions for dequeue results. Signed-off-by: Roy Pledge Signed-off-by: Stuart Yoder --- include/linux/fsl/dpaa2-global.h | 203 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100644 include/linux/fsl/dpaa2-global.h diff --git a/include/linux/fsl/dpaa2-global.h b/include/linux/fsl/dpaa2-global.h new file mode 100644 index 0000000..3ee3f29 --- /dev/null +++ b/include/linux/fsl/dpaa2-global.h @@ -0,0 +1,203 @@ +/* + * Copyright 2014-2016 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef __FSL_DPAA2_GLOBAL_H +#define __FSL_DPAA2_GLOBAL_H + +#include +#include +#include + +struct dpaa2_dq { + union { + struct common { + u8 verb; + u8 reserved[63]; + } common; + struct dq { + u8 verb; + u8 stat; + __le16 seqnum; + __le16 oprid; + u8 reserved; + u8 tok; + __le32 fqid; + u32 reserved2; + __le32 fq_byte_cnt; + __le32 fq_frm_cnt; + __le64 fqd_ctx; + u8 fd[32]; + } dq; + struct scn { + u8 verb; + u8 stat; + u8 state; + u8 reserved; + __le32 rid_tok; + __le64 ctx; + } scn; + }; +}; + + +/* Parsing frame dequeue results */ +/* FQ empty */ +#define DPAA2_DQ_STAT_FQEMPTY 0x80 +/* FQ held active */ +#define DPAA2_DQ_STAT_HELDACTIVE 0x40 +/* FQ force eligible */ +#define DPAA2_DQ_STAT_FORCEELIGIBLE 0x20 +/* valid frame */ +#define DPAA2_DQ_STAT_VALIDFRAME 0x10 +/* FQ ODP enable */ +#define DPAA2_DQ_STAT_ODPVALID 0x04 +/* volatile dequeue */ +#define DPAA2_DQ_STAT_VOLATILE 0x02 +/* volatile dequeue command is expired */ +#define DPAA2_DQ_STAT_EXPIRED 0x01 + +#define DQ_FQID_MASK 0x00FFFFFF +#define DQ_FRAME_COUNT_MASK 0x00FFFFFF + +/** + * dpaa2_dq_flags() - Get the stat field of dequeue response + * @dq: the dequeue result. + */ +static inline u32 dpaa2_dq_flags(const struct dpaa2_dq *dq) +{ + return dq->dq.stat; +} + +/** + * dpaa2_dq_is_pull() - Check whether the dq response is from a pull + * command. + * @dq: the dequeue result + * + * Return 1 for volatile(pull) dequeue, 0 for static dequeue. + */ +static inline int dpaa2_dq_is_pull(const struct dpaa2_dq *dq) +{ + return (int)(dpaa2_dq_flags(dq) & DPAA2_DQ_STAT_VOLATILE); +} + +/** + * dpaa2_dq_is_pull_complete() - Check whether the pull command is completed. + * @dq: the dequeue result + * + * Return boolean. + */ +static inline int dpaa2_dq_is_pull_complete( + const struct dpaa2_dq *dq) +{ + return (int)(dpaa2_dq_flags(dq) & DPAA2_DQ_STAT_EXPIRED); +} + +/** + * dpaa2_dq_seqnum() - Get the seqnum field in dequeue response + * @dq: the dequeue result + * + * seqnum is valid only if VALIDFRAME flag is TRUE + * + * Return seqnum. + */ +static inline u16 dpaa2_dq_seqnum(const struct dpaa2_dq *dq) +{ + return le16_to_cpu(dq->dq.seqnum); +} + +/** + * dpaa2_dq_odpid() - Get the odpid field in dequeue response + * @dq: the dequeue result + * + * odpid is valid only if ODPVAILD flag is TRUE. + * + * Return odpid. + */ +static inline u16 dpaa2_dq_odpid(const struct dpaa2_dq *dq) +{ + return le16_to_cpu(dq->dq.oprid); +} + +/** + * dpaa2_dq_fqid() - Get the fqid in dequeue response + * @dq: the dequeue result + * + * Return fqid. + */ +static inline u32 dpaa2_dq_fqid(const struct dpaa2_dq *dq) +{ + return le32_to_cpu(dq->dq.fqid) & DQ_FQID_MASK; +} + +/** + * dpaa2_dq_byte_count() - Get the byte count in dequeue response + * @dq: the dequeue result + * + * Return the byte count remaining in the FQ. + */ +static inline u32 dpaa2_dq_byte_count(const struct dpaa2_dq *dq) +{ + return le32_to_cpu(dq->dq.fq_byte_cnt); +} + +/** + * dpaa2_dq_frame_count() - Get the frame count in dequeue response + * @dq: the dequeue result + * + * Return the frame count remaining in the FQ. + */ +static inline u32 dpaa2_dq_frame_count(const struct dpaa2_dq *dq) +{ + return le32_to_cpu(dq->dq.fq_frm_cnt) & DQ_FRAME_COUNT_MASK; +} + +/** + * dpaa2_dq_fd_ctx() - Get the frame queue context in dequeue response + * @dq: the dequeue result + * + * Return the frame queue context. + */ +static inline u64 dpaa2_dq_fqd_ctx(const struct dpaa2_dq *dq) +{ + return le64_to_cpu(dq->dq.fqd_ctx); +} + +/** + * dpaa2_dq_fd() - Get the frame descriptor in dequeue response + * @dq: the dequeue result + * + * Return the frame descriptor. + */ +static inline const struct dpaa2_fd *dpaa2_dq_fd(const struct dpaa2_dq *dq) +{ + return (const struct dpaa2_fd *)&dq->dq.fd[0]; +} + +#endif /* __FSL_DPAA2_GLOBAL_H */ -- 1.9.0