Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp541502ybk; Fri, 15 May 2020 07:22:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzME4zBj+zPEzZQkif5cuGXbrbuCZNVzapF0ipY54uT2IPZY1QIJovvLxBEpCu+tIGeEEs0 X-Received: by 2002:a05:6402:946:: with SMTP id h6mr3236132edz.245.1589552520485; Fri, 15 May 2020 07:22:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589552520; cv=none; d=google.com; s=arc-20160816; b=R7vQ89dnyXYMoSl/CWhhK+DeN2drxQJyQdHItuV8U+pyPggMcsRAMnjPlJx9m/5wyj 7dR28QGrotZa2gIaC429ef2saxnLZhd0Ys5ES5hCj2VgIuqMU97k7vKG9w0M44i8VctQ Jg5ufyEMh821QXYPfj5/aYpOx8NlCnaj1QK/cSuE3CIQV8AfMLVMEjTWXheqz3bnG3pc tRyY2FwTPSIayC1V/5t+xqnnfsdlQf0uR3tbEgjrGJQRWgbMle93D9/BCMt375VbgzbG kjiZw5Esq/bzIvNlfamk1+FTQtoxFR8gXYWmP6roCM6pZ7sO7cThtTbxsB2YEJNqNe1+ QyeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=MoZI3VYYdqj0vVt0abreQGY6/kSlKRkX4GISszm9R38=; b=N39Q9UwsMtLPdtYBp8hNyX3PxL9tZPBl6AsFHAjZ9IFaEaRRVowEp3p7V9l/z2RguD L+8IQkx1An3O01FyavtouIjU4beUuBP8Oescip0pkFTwHD8VUJUZiNeOqrdpkJeqarKI dTxomkvViNfinqDLKwdO3m1jMlHXgZQ04TTvyG5UbKpa+0DBaU4etqaS8+SjHRRdyj6W 93lF/JcNcMdTZ+a4RJPWklcyOREfQC713Nu90c478gMuIlhoDxnEvP68DMyVUJrl8nY/ 7adRQEakyP0ggn25S1utEJD3QXgf8hR26L3BTlq0YMcM8Dot5W8hqhXLs4H9SfR40U6L 1uVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w14si1185106edl.600.2020.05.15.07.21.36; Fri, 15 May 2020 07:22:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726217AbgEOOTl (ORCPT + 99 others); Fri, 15 May 2020 10:19:41 -0400 Received: from mga17.intel.com ([192.55.52.151]:33489 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726140AbgEOOTl (ORCPT ); Fri, 15 May 2020 10:19:41 -0400 IronPort-SDR: VbmSNRgpC1pktixqmSk0+ubFnnD+nYzK5kGxs0WGSip2lsy8HhqsZ05ekLATbzvjXlzExyx1Yn r1leke1GbS8g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2020 07:19:41 -0700 IronPort-SDR: X806o53qBM8MjR9VttUyfi0cXh5zmXgMlCiMmkMbtxsD8FcSWu76betx4xBGcK+BDkMubjUgtd gTSBZRcOTssg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,395,1583222400"; d="scan'208";a="252388959" Received: from marshy.an.intel.com ([10.122.105.159]) by fmsmga007.fm.intel.com with ESMTP; 15 May 2020 07:19:40 -0700 From: richard.gong@linux.intel.com To: mdf@kernel.org Cc: linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, dinguyen@kernel.org, richard.gong@linux.intel.com, Richard Gong Subject: [PATCHv2] fpga: stratix10-soc: remove the pre-set reconfiguration condition Date: Fri, 15 May 2020 09:35:03 -0500 Message-Id: <1589553303-7341-1-git-send-email-richard.gong@linux.intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Richard Gong The reconfiguration mode is pre-set by driver as the full reconfiguration. As a result, user have to change code and recompile the drivers if he or she wants to perform a partial reconfiguration. Removing the pre-set reconfiguration condition so that user can select full or partial reconfiguration via overlay device tree without recompiling the drivers. Also add an error message if the configuration request is failure. Signed-off-by: Richard Gong --- v2: define and use constant values --- drivers/fpga/stratix10-soc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c index 44b7c56..4d52a80 100644 --- a/drivers/fpga/stratix10-soc.c +++ b/drivers/fpga/stratix10-soc.c @@ -14,9 +14,13 @@ /* * FPGA programming requires a higher level of privilege (EL3), per the SoC * design. + * SoC firmware supports full and partial reconfiguration. */ #define NUM_SVC_BUFS 4 #define SVC_BUF_SIZE SZ_512K +#define FULL_RECONFIG_FLAG 0 +#define PARTIAL_RECONFIG_FLAG 1 + /* Indicates buffer is in use if set */ #define SVC_BUF_LOCK 0 @@ -182,12 +186,12 @@ static int s10_ops_write_init(struct fpga_manager *mgr, uint i; int ret; - ctype.flags = 0; if (info->flags & FPGA_MGR_PARTIAL_RECONFIG) { dev_dbg(dev, "Requesting partial reconfiguration.\n"); - ctype.flags |= BIT(COMMAND_RECONFIG_FLAG_PARTIAL); + ctype.flags = PARTIAL_RECONFIG_FLAG; } else { dev_dbg(dev, "Requesting full reconfiguration.\n"); + ctype.flags = FULL_RECONFIG_FLAG; } reinit_completion(&priv->status_return_completion); @@ -210,6 +214,7 @@ static int s10_ops_write_init(struct fpga_manager *mgr, ret = 0; if (!test_and_clear_bit(SVC_STATUS_OK, &priv->status)) { + dev_err(dev, "RECONFIG_REQUEST failed\n"); ret = -ETIMEDOUT; goto init_done; } -- 2.7.4