From patchwork Wed Apr 5 19:05:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Gerlach X-Patchwork-Id: 9665505 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1160B602B5 for ; Wed, 5 Apr 2017 19:06:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F28C6206AC for ; Wed, 5 Apr 2017 19:06:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E72EB285A3; Wed, 5 Apr 2017 19:06:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 852E4206AC for ; Wed, 5 Apr 2017 19:06:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754403AbdDETGJ (ORCPT ); Wed, 5 Apr 2017 15:06:09 -0400 Received: from mga07.intel.com ([134.134.136.100]:7957 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754311AbdDETGI (ORCPT ); Wed, 5 Apr 2017 15:06:08 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP; 05 Apr 2017 12:06:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,280,1488873600"; d="scan'208";a="952285701" Received: from mgerlach-mobl.amr.corp.intel.com (HELO mgerlach-VirtualBox.amr.corp.intel.com) ([10.254.56.23]) by orsmga003.jf.intel.com with ESMTP; 05 Apr 2017 12:06:01 -0700 From: matthew.gerlach@linux.intel.com To: atull@kernel.org, moritz.fischer@ettus.com, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Matthew Gerlach Subject: [PATCH] fpga fr br: fix warning for unexpected version number Date: Wed, 5 Apr 2017 12:05:55 -0700 Message-Id: <1491419155-17440-1-git-send-email-matthew.gerlach@linux.intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Matthew Gerlach The value in the version register of the altera freeze bridge controller changed from the beta value of 2 to the value of 0xad000003 in the official release of the IP. This patch supports the old and new version numbers without printing an warning. Signed-off-by: Matthew Gerlach --- drivers/fpga/altera-freeze-bridge.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/fpga/altera-freeze-bridge.c b/drivers/fpga/altera-freeze-bridge.c index 8dcd9fb..bdfd5eb 100644 --- a/drivers/fpga/altera-freeze-bridge.c +++ b/drivers/fpga/altera-freeze-bridge.c @@ -28,6 +28,7 @@ #define FREEZE_CSR_REG_VERSION 12 #define FREEZE_CSR_SUPPORTED_VERSION 2 +#define FREEZE_CSR_OFFICIAL_VERSION 0xad000003 #define FREEZE_CSR_STATUS_FREEZE_REQ_DONE BIT(0) #define FREEZE_CSR_STATUS_UNFREEZE_REQ_DONE BIT(1) @@ -241,10 +242,12 @@ static int altera_freeze_br_probe(struct platform_device *pdev) priv->enable = 1; revision = readl(priv->base_addr + FREEZE_CSR_REG_VERSION); - if (revision != FREEZE_CSR_SUPPORTED_VERSION) + if ((revision != FREEZE_CSR_SUPPORTED_VERSION) && + (revision != FREEZE_CSR_OFFICIAL_VERSION)) dev_warn(dev, - "%s Freeze Controller unexpected revision %d != %d\n", - __func__, revision, FREEZE_CSR_SUPPORTED_VERSION); + "%s unexpected revision 0x%x != 0x%x != 0x%x\n", + __func__, revision, FREEZE_CSR_SUPPORTED_VERSION, + FREEZE_CSR_OFFICIAL_VERSION); return fpga_bridge_register(dev, FREEZE_BRIDGE_NAME, &altera_freeze_br_br_ops, priv);