Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7050675rwl; Mon, 9 Jan 2023 17:15:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXsWX75aiqNPDHVpranj6PT9a90h1q5d7R8aZjqxSfarytyWhxcx8E+UwZmNonTckMw4nbVL X-Received: by 2002:a17:90b:a12:b0:227:1b37:50c9 with SMTP id gg18-20020a17090b0a1200b002271b3750c9mr4134931pjb.5.1673313315474; Mon, 09 Jan 2023 17:15:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673313315; cv=none; d=google.com; s=arc-20160816; b=GEddtMxY78FwOjjeEIRBCx/rV1eGRbKNk7ttFnUQ8FegoIwYez3xv06ZByF6MMBSpn RI4EkT7F3aE4cRoUl263X4Tf5gggJpNF0B74nnfC17HoYp4Z3U1Gt3jvsuS20JFOPanm RkvTz/VLS3EG67RL0rGFjdYJk+P3QcuofxftQ8Nvmj5DlwmtmgV9uOc+DWI7cVQ3lwKj rVMRTyCtyVjfxXeUTB5tynx93cBKkLIKonZLwiNG+5ldAFUPiI0Ad8mMjvb497KTYYTu 93E3fK2kMIJ4U+3IG7YQi9onzK76UgX9gACuPJGw1nwke6ZlI13CkpCFTnxycmk1+Hpr RUfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4TPDv/0PnT0HVkGcy6ThpoAkGiNIXvzFb+E+8+337aQ=; b=MRSt2tl8iJIhQt9LJvvYTkU4WVCp4bbPylprJQxxvNGboRNbfFJhY2vB/CFAMZeD1u iHT5bo2pnL34Yg+TGuAODLgnAVM93O1Epz6pQtT0pWx2nZ37F9jX3/T4QRW+KKuzUfaD hjk4s0LsONMDQpMG3TV1SGvyeXDFmWu4YEtHUWNSfKmBs40zpW7td8ns5ZNLpWd8FOLa O2uqfrTNNZcdJiUSmB++w/b5QQIXQ36auw7faoh+Az9ET2sIfD0lXXgY4uypYUqLHAQc jwZyQiG2IHGTPvgHjnuNQR/IozJ7v8dQxSWK99ri5OvCwIDLCNyTEec5faLGDp+/lUto i6fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cfjSN26K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 133-20020a63028b000000b0047769403088si10543490pgc.627.2023.01.09.17.15.08; Mon, 09 Jan 2023 17:15:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cfjSN26K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237854AbjAJAaH (ORCPT + 54 others); Mon, 9 Jan 2023 19:30:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237022AbjAJA35 (ORCPT ); Mon, 9 Jan 2023 19:29:57 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20D003E0F5; Mon, 9 Jan 2023 16:29:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673310596; x=1704846596; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=97E2BSirr4B+fKCh/DPTUyzjDzPfoMnNZocI//RrRj0=; b=cfjSN26KHT5HuX1ttfgFOyU4CQRTj4ort2jydFqctEfukUOVSUKrkhtr IvYCXhYJKesYjXO8asatUOoXKWYvSr6CkB/s+42JKZUg8/27szFrjIIcp zrDAKCg6b41aV4ac8tTX4KQ2NpeHTAWIJ1oFTFvJgIFCkwmBkFcCCA7NT iRPxc6kgtvr+wwehrC5O2DaWc05xgbp48h6/h+Flz28QiUm3O96qmJspd 1kMzHcPbI4P12LjLDXkv6hFoX71rh0WC1lqlDJph/XpmkPfZd3+cEJeTr nO3bG44PiyA1EacOhs0jJ86k1wOIPvjFJyPCQq+IOHAHCsGrouhOMYlZO g==; X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="324265548" X-IronPort-AV: E=Sophos;i="5.96,313,1665471600"; d="scan'208";a="324265548" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2023 16:29:53 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="687381578" X-IronPort-AV: E=Sophos;i="5.96,313,1665471600"; d="scan'208";a="687381578" Received: from rhweight-wrk1.ra.intel.com ([137.102.106.43]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2023 16:29:53 -0800 From: matthew.gerlach@linux.intel.com To: hao.wu@intel.com, yilun.xu@intel.com, russell.h.weight@intel.com, basheer.ahmed.muddebihal@intel.com, trix@redhat.com, mdf@kernel.org, linux-fpga@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, tianfei.zhang@intel.com, corbet@lwn.net, gregkh@linuxfoundation.org, linux-serial@vger.kernel.org, jirislaby@kernel.org, geert+renesas@glider.be, andriy.shevchenko@linux.intel.com, niklas.soderlund+renesas@ragnatech.se, macro@orcam.me.uk, johan@kernel.org, lukas@wunner.de, ilpo.jarvinen@linux.intel.com, marpagan@redhat.com, bagasdotme@gmail.com Cc: Basheer Ahmed Muddebihal , Matthew Gerlach Subject: [PATCH v10 2/4] fpga: dfl: Add DFHv1 Register Definitions Date: Mon, 9 Jan 2023 16:30:27 -0800 Message-Id: <20230110003029.806022-3-matthew.gerlach@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110003029.806022-1-matthew.gerlach@linux.intel.com> References: <20230110003029.806022-1-matthew.gerlach@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Basheer Ahmed Muddebihal This patch adds the definitions for DFHv1 header and related register bitfields. Signed-off-by: Basheer Ahmed Muddebihal Co-developed-by: Matthew Gerlach Signed-off-by: Matthew Gerlach Reviewed-by: Ilpo Järvinen Reviewed-by: Andy Shevchenko --- v10: no change v9: no change v8: add Rb Andy Shevchenko v7: no change v6: remove parameter definitions from include/linux/dfl.h v5: consistently use fields for parameter data s/EOL/EOP/ to match doc remove unneeded mask added Co-developed-by v4: s/MSIX/MSI_X/g move kerneldoc to implementation don't change copyright date v3: keep DFHv1 definitions "hidden" in drivers/fpga/dfl.h v2: clean up white space and one line comments remove extra space in commit use uniform number of digits in constants don't change copyright date because of removed content --- drivers/fpga/dfl.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/fpga/dfl.h b/drivers/fpga/dfl.h index 06cfcd5e84bb..fc59f33367ee 100644 --- a/drivers/fpga/dfl.h +++ b/drivers/fpga/dfl.h @@ -74,11 +74,43 @@ #define DFH_REVISION GENMASK_ULL(15, 12) /* Feature revision */ #define DFH_NEXT_HDR_OFST GENMASK_ULL(39, 16) /* Offset to next DFH */ #define DFH_EOL BIT_ULL(40) /* End of list */ +#define DFH_VERSION GENMASK_ULL(59, 52) /* DFH version */ #define DFH_TYPE GENMASK_ULL(63, 60) /* Feature type */ #define DFH_TYPE_AFU 1 #define DFH_TYPE_PRIVATE 3 #define DFH_TYPE_FIU 4 +/* + * DFHv1 Register Offset definitons + * In DHFv1, DFH + GUID + CSR_START + CSR_SIZE_GROUP + PARAM_HDR + PARAM_DATA + * as common header registers + */ +#define DFHv1_CSR_ADDR 0x18 /* CSR Register start address */ +#define DFHv1_CSR_SIZE_GRP 0x20 /* Size of Reg Block and Group/tag */ +#define DFHv1_PARAM_HDR 0x28 /* Optional First Param header */ + +/* + * CSR Rel Bit, 1'b0 = relative (offset from feature DFH start), + * 1'b1 = absolute (ARM or other non-PCIe use) + */ +#define DFHv1_CSR_ADDR_REL BIT_ULL(0) + +/* CSR Header Register Bit Definitions */ +#define DFHv1_CSR_ADDR_MASK GENMASK_ULL(63, 1) /* 63:1 of CSR address */ + +/* CSR SIZE Goup Register Bit Definitions */ +#define DFHv1_CSR_SIZE_GRP_INSTANCE_ID GENMASK_ULL(15, 0) /* Enumeration instantiated IP */ +#define DFHv1_CSR_SIZE_GRP_GROUPING_ID GENMASK_ULL(30, 16) /* Group Features/interfaces */ +#define DFHv1_CSR_SIZE_GRP_HAS_PARAMS BIT_ULL(31) /* Presence of Parameters */ +#define DFHv1_CSR_SIZE_GRP_SIZE GENMASK_ULL(63, 32) /* Size of CSR Block in bytes */ + +/* PARAM Header Register Bit Definitions */ +#define DFHv1_PARAM_HDR_ID GENMASK_ULL(15, 0) /* Id of this Param */ +#define DFHv1_PARAM_HDR_VER GENMASK_ULL(31, 16) /* Version Param */ +#define DFHv1_PARAM_HDR_NEXT_OFFSET GENMASK_ULL(63, 35) /* Offset of next Param */ +#define DFHv1_PARAM_HDR_NEXT_EOP BIT_ULL(32) +#define DFHv1_PARAM_DATA 0x08 /* Offset of Param data from Param header */ + /* Next AFU Register Bitfield */ #define NEXT_AFU_NEXT_DFH_OFST GENMASK_ULL(23, 0) /* Offset to next AFU */ -- 2.25.1