From patchwork Mon Nov 16 13:05:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 56617 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1315197lbb; Mon, 16 Nov 2015 05:29:48 -0800 (PST) X-Received: by 10.68.251.170 with SMTP id zl10mr53739201pbc.106.1447680588751; Mon, 16 Nov 2015 05:29:48 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xi10si50311825pab.18.2015.11.16.05.29.48; Mon, 16 Nov 2015 05:29:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752446AbbKPN3r (ORCPT + 6 others); Mon, 16 Nov 2015 08:29:47 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:30222 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752194AbbKPN3q (ORCPT ); Mon, 16 Nov 2015 08:29:46 -0500 Received: from 172.24.1.50 (EHLO szxeml430-hub.china.huawei.com) ([172.24.1.50]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BRC38343; Mon, 16 Nov 2015 20:53:06 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by szxeml430-hub.china.huawei.com (10.82.67.185) with Microsoft SMTP Server id 14.3.235.1; Mon, 16 Nov 2015 20:52:50 +0800 From: John Garry To: , , , , , , CC: , , , , , , , , Subject: [PATCH v4 11/32] scsi: hisi_sas: add phy SAS ADDR initialization Date: Mon, 16 Nov 2015 21:05:57 +0800 Message-ID: <1447679178-220222-12-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447679178-220222-1-git-send-email-john.garry@huawei.com> References: <1447679178-220222-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.0A090203.5649D9DD.0092, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: e09735cd92a6a9139941b3a385afdc18 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The SAS address for the HBA comes from the device tree. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 1 + drivers/scsi/hisi_sas/hisi_sas_main.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index 315fe46..c50384f 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -39,6 +39,7 @@ struct hisi_sas_phy { struct asd_sas_phy sas_phy; + u64 dev_sas_addr; }; struct hisi_sas_port { diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index d10bf24..8cd1b55 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -281,6 +281,16 @@ err_out: return NULL; } +static void hisi_sas_init_add(struct hisi_hba *hisi_hba) +{ + int i; + + for (i = 0; i < hisi_hba->n_phy; i++) + memcpy(&hisi_hba->phy[i].dev_sas_addr, + hisi_hba->sas_addr, + SAS_ADDR_SIZE); +} + int hisi_sas_probe(struct platform_device *pdev, const struct hisi_sas_hw *hw) { @@ -334,6 +344,8 @@ int hisi_sas_probe(struct platform_device *pdev, sha->sas_port[i] = &hisi_hba->port[i].sas_port; } + hisi_sas_init_add(hisi_hba); + rc = scsi_add_host(shost, &pdev->dev); if (rc) goto err_out_ha;