From patchwork Wed Jun 14 15:33:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 105528 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp337816qgd; Wed, 14 Jun 2017 08:04:06 -0700 (PDT) X-Received: by 10.99.189.18 with SMTP id a18mr487308pgf.195.1497452646062; Wed, 14 Jun 2017 08:04:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497452646; cv=none; d=google.com; s=arc-20160816; b=QoPISMRqvYzN6qNZ3UArLE4lqlII16+AgoX91VXGDoYKSWCthqIc1HWOcpQ+xTs341 t3bZcKwLmtb6uCP1v2aCYtwpOApLkK5sdi7yueYGbbEEs/hFXnMEHO4V8K6A9/KCuv+A SqTuQ3/NanzGaL8e1uKj7QeBjoTeNBDIc5hTFXERfTLD7wLhBNXgVjXQtWoG/3bZO/1v qiGaO7MQ6lj670pnHC7RRHlv1CXsAPzArEvY9j0Jvfe223kOWkXn9y2lzrg53egNAiLp vTPWl0R/YA2HJrGrcL2e0au4KXnJsJPAWjpVhxXxTf4qRTzAFy4cj+G20YLsty35jlYY a1EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=07IpN6KoCH9K2NEJkO9P4IxzBgjsDPEyHosR50qIfOU=; b=epISPJjtYD9bzyDHYzmHm7IGEsoURgNFJ113YLm7seht+syVsBGR1TmPayJEJkjBk7 yGcJ4J10syD1F4B0UWXkzO1vnPLAByZMv3s/usRYBRRo63VpWrpPLl51zgynsDST2T1A PHTBzuheqwb4Lq3aDyP3YjizNx0ayvswPmtvAjlt2S3XGtb/yF09yo9Z1OdlSVCB1Edr zUDWUyUz0gawC28STjChOoTEHkocd2D/GBezQDMFUXJy0T4t1goeK9pPtCgjVfyyWDf9 Cu9D3fhC4pdUfJwT1I5rr7QZGypN6RyhSIR+c1X3ocb0tbAcU/+2eujybTETJbiUgCkg ggqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t16si167412pfi.97.2017.06.14.08.04.05; Wed, 14 Jun 2017 08:04:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752450AbdFNPEF (ORCPT + 1 other); Wed, 14 Jun 2017 11:04:05 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:7421 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752310AbdFNPED (ORCPT ); Wed, 14 Jun 2017 11:04:03 -0400 Received: from 172.30.72.54 (EHLO dggeml406-hub.china.huawei.com) ([172.30.72.54]) by dggrg03-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id APJ61006; Wed, 14 Jun 2017 23:03:30 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by dggeml406-hub.china.huawei.com (10.3.17.50) with Microsoft SMTP Server id 14.3.301.0; Wed, 14 Jun 2017 23:03:18 +0800 From: John Garry To: , CC: , , , , , "Xiang Chen" , John Garry Subject: [PATCH v6 20/22] scsi: hisi_sas: add get_wideport_bitmap_v3_hw() Date: Wed, 14 Jun 2017 23:33:30 +0800 Message-ID: <1497454412-91194-21-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497454412-91194-1-git-send-email-john.garry@huawei.com> References: <1497454412-91194-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090204.59415042.01FA, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 9bff9cef5c19c4cd277ea678b6979e7a Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Xiang Chen Add code for interface get_wideport_bitmap. Signed-off-by: John Garry Signed-off-by: Xiang Chen --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index ef5c158..3cd4b9a 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -629,6 +629,18 @@ static void sl_notify_v3_hw(struct hisi_hba *hisi_hba, int phy_no) hisi_sas_phy_write32(hisi_hba, phy_no, SL_CONTROL, sl_control); } +static int get_wideport_bitmap_v3_hw(struct hisi_hba *hisi_hba, int port_id) +{ + int i, bitmap = 0; + u32 phy_port_num_ma = hisi_sas_read32(hisi_hba, PHY_PORT_NUM_MA); + + for (i = 0; i < hisi_hba->n_phy; i++) + if (((phy_port_num_ma >> (i * 4)) & 0xf) == port_id) + bitmap |= 1 << i; + + return bitmap; +} + /** * The callpath to this function and upto writing the write * queue pointer should be safe from interruption. @@ -1550,6 +1562,7 @@ static int hisi_sas_v3_init(struct hisi_hba *hisi_hba) .hw_init = hisi_sas_v3_init, .setup_itct = setup_itct_v3_hw, .max_command_entries = HISI_SAS_COMMAND_ENTRIES_V3_HW, + .get_wideport_bitmap = get_wideport_bitmap_v3_hw, .complete_hdr_size = sizeof(struct hisi_sas_complete_v3_hdr), .free_device = free_device_v3_hw, .sl_notify = sl_notify_v3_hw,