From patchwork Wed Jan 4 23:22:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthew Gerlach X-Patchwork-Id: 39153 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp18161wrt; Wed, 4 Jan 2023 15:23:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXsuHcA1pb58kOcyQ14UbDbBfZaCeFSFpKX1v1iVYTjRX9IPH/7S8siywsm62vdEQuU2CSJO X-Received: by 2002:a05:6a20:a027:b0:b4:9a94:af57 with SMTP id p39-20020a056a20a02700b000b49a94af57mr16355615pzj.0.1672874617985; Wed, 04 Jan 2023 15:23:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672874617; cv=none; d=google.com; s=arc-20160816; b=C+ln89kAiOTLZnlzfGagn6Us2Rs4Djd4s9Kzigv+PeYNiLF7NlimaU1dYFIqohM+w+ tD80n4oJQU0FEdU0FiOLZbcoaFWTw1YAO88liQo9kYMGloYAqs6GC5PodAUlw2ngZJrx IDbRgGzv6dDfkMbr8ZneDWWC43WpbMfQ3NpcEv2zNo2pbLSCjDi499ql1yFZL+FTQRtu JvCHZ6NUpLYggVOUI3YJPvoAdilBBIJ/Kn8u1ge29Q7Vll1biZlOY/55msGn70qc1qTq LXvx7NsH/LtDSljycLra+8UnpqYBaG4J1IEb/82QI3MianOQATZCuOxwAwESjOo/u80h ySwg== 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=gf8tn3owrMX9Jw7l0ZWj3Ir8adD29BqwKOvVtwK6V44=; b=bFhqBvGALbi9owdhDIKAMWhB6UDFI3Oyx2WnZ+jYqLh6wFp3gcmhyAtip4Jwi7YOzp MZ78NqpCoG3Z5ZE5fAwQcuwdLX4f4iYu1M1WFriZYDXJfqhD4Ix0Twq26XskKTArXJxG PA5YetY4wmTVhAVnSRLiTBMnIgPTxbrzfWcZS4f1YofAncUGuB7gYDDKVHoKwZl0M0yV wz43me9drU2JvFn4fT1Q59N3hJrx6aW1iz9puVVY+igOfADoudivIzbEQioqFoCZIKre ELLWKPKIMHhPVgfbbQTowYjtSdZnsmOPpm5G5cJvnaGkDtOZNoCQclr0UdwMXGoKWt0W S/4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Sk/jeoA7"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q3-20020a654943000000b00473c36e3b85si36912603pgs.678.2023.01.04.15.23.24; Wed, 04 Jan 2023 15:23:37 -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="Sk/jeoA7"; 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 S234918AbjADXWj (ORCPT + 99 others); Wed, 4 Jan 2023 18:22:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230283AbjADXWZ (ORCPT ); Wed, 4 Jan 2023 18:22:25 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 366AE3B91E; Wed, 4 Jan 2023 15:22:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672874544; x=1704410544; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Crv4U/swTbZWmrUSePIJDIFMWSiytti4NOwT80rtXd8=; b=Sk/jeoA7M7kIKV+1YB+zwg76eKfl8ofshQXBsxz38DCI7J5Yg9ONXKP7 D9LcMkendkVWqgM5C3yrcgQygPHbvLBSqWyUVx5Jv1E2hQU6PTEYk45JQ kPQrYAM1Jeu1FFZP2gCBCP+NvAZi099Yhv0ZqpOjonYNacpJxYxswtw9n hudzydssgOG+rwrr9N7qrzha6qW4KJTvGqB6wRcaASyoWLS+s4GztkKpq 4bFDUC/eqWwISqujQJH68EHg8iGmD2U7v7vs1mutqnUHE0pjyygOn0NrF tsUWGfwATr3Zl6O60mhwvI3YFbAx8yVW5fmTJskUPCwmlDWdcmvv3VbVu Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="301762132" X-IronPort-AV: E=Sophos;i="5.96,301,1665471600"; d="scan'208";a="301762132" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 15:22:23 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10580"; a="900739370" X-IronPort-AV: E=Sophos;i="5.96,301,1665471600"; d="scan'208";a="900739370" Received: from rhweight-wrk1.ra.intel.com ([137.102.106.43]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2023 15:22:21 -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 v9 2/4] fpga: dfl: Add DFHv1 Register Definitions Date: Wed, 4 Jan 2023 15:22:51 -0800 Message-Id: <20230104232253.24743-3-matthew.gerlach@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230104232253.24743-1-matthew.gerlach@linux.intel.com> References: <20230104232253.24743-1-matthew.gerlach@linux.intel.com> MIME-Version: 1.0 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,SPF_HELO_PASS, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754136175541527550?= X-GMAIL-MSGID: =?utf-8?q?1754136175541527550?= 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 --- 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 */