From patchwork Wed May 17 10:49:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 99963 Delivered-To: patch@linaro.org Received: by 10.182.142.97 with SMTP id rv1csp140949obb; Wed, 17 May 2017 03:23:30 -0700 (PDT) X-Received: by 10.84.238.134 with SMTP id v6mr3400510plk.137.1495016610615; Wed, 17 May 2017 03:23:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495016610; cv=none; d=google.com; s=arc-20160816; b=YkAnnQHgBNjT4E00FUjMC31UWRwtf7B38/U1eY8RKLb+MQ6sxH2gy68D1xBNmISRHg jAEByKFYWFuoj7AkpsMjmvnWzG5ncq65XHxVWXku2xD5uPQRnMEU6ti6tdoq2MyhqnnX eLGvYNWKMHi0rr8nOa6hCYJehVGdEKZUiXYX+fd7aLUJsl1tmmMBz+X2Ab0EYgtUCkMa ZvBKTHVxRUOYrbIMKVpGX0LWf9BSDw9huXsWpic9Jp4XFFa/Z9a4okBzgxFA0WbPJYoi PXhmdwj8XF6bplFTjWNAUrgvwtKVxT1fWa60muaVbECrcPatc67q0TuxMPZiXTyGQb97 DsLA== 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=Lr9mzpKaxmDBnxukgi1Lig4a8QsmK0Rvovs7nkUkHss=; b=aLrT7X0IkFRFlaOiyo6xHd0QGS4/Izp2irSRZJ35uZDwUrA3+hcNTGwKcRi7Y/kNpX 67xwEd37m4ylopPisPBP6BLtnIZqcJz5ynrVKuBo+miZEZTwKdTFJsw6bblMKvNL0V6j NYtO16Pwo4+gy2fk7IpKxx6iOhtKsA0x2ApPMMdpXYdcFHPsDNjOf09DQa4MM/+FDZE9 BCCMc9J7frVQd5xmEej+ubX0QLYvHDFl6z5bdpdYWc+aufJQ5cyTGY9FVpvbwb0NGMll S/Z2slzba1jDXa0ifLp6zfjCmKdU3CmN1NYztTvP5DiB58TkKxTtLJFlncmHWKiByv4R LM9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 k62si1674533pge.400.2017.05.17.03.23.30; Wed, 17 May 2017 03:23:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754358AbdEQKW7 (ORCPT + 25 others); Wed, 17 May 2017 06:22:59 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:6323 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754421AbdEQKTs (ORCPT ); Wed, 17 May 2017 06:19:48 -0400 Received: from 172.30.72.55 (EHLO dggeml406-hub.china.huawei.com) ([172.30.72.55]) by dggrg01-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id AOT12441; Wed, 17 May 2017 18:19:46 +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, 17 May 2017 18:19:33 +0800 From: John Garry To: , CC: , , , , , John Garry , Xiang Chen Subject: [PATCH 08/22] scsi: hisi_sas: add bare v3 hw driver Date: Wed, 17 May 2017 18:49:43 +0800 Message-ID: <1495018197-120535-9-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1495018197-120535-1-git-send-email-john.garry@huawei.com> References: <1495018197-120535-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.0A020204.591C23C2.0079, 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: fe38e4a7e51295038a0aa6bb249072d5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add new file hisi_sas_v3_hw.c for hip08 support. The controller design is quite similar to v2 hw in hip07. However key differences include: -All v2 hw bugs are fixed (hopefully), so workarounds are not required -support for device deregistration -some interrupt modifications -configurable max device support Not yet supported: - controller reset Signed-off-by: John Garry Signed-off-by: Xiang Chen --- drivers/scsi/hisi_sas/Makefile | 1 + drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 57 ++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/Makefile b/drivers/scsi/hisi_sas/Makefile index 3a036a8..54774a4 100644 --- a/drivers/scsi/hisi_sas/Makefile +++ b/drivers/scsi/hisi_sas/Makefile @@ -1,3 +1,4 @@ obj-$(CONFIG_SCSI_HISI_SAS) += hisi_sas_main.o obj-$(CONFIG_SCSI_HISI_SAS) += hisi_sas_v1_hw.o hisi_sas_v2_hw.o obj-$(CONFIG_SCSI_HISI_SAS_PCI) += hisi_sas_pci_init.o +obj-$(CONFIG_SCSI_HISI_SAS_PCI) += hisi_sas_v3_hw.o diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c new file mode 100644 index 0000000..80707f6 --- /dev/null +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2017 Hisilicon Limited. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + */ + +#include "hisi_sas.h" +#define DRV_NAME "hisi_sas_v3_hw" + +static const struct hisi_sas_hw hisi_sas_v3_hw = { +}; + +enum { + /* instances of the controller */ + hip08, +}; + +static const struct hisi_sas_pci_hw hisi_sas_pci_hw_info[] = { + [hip08] = {8, 16, &hisi_sas_v3_hw}, +}; + +static const struct pci_device_id sas_v3_pci_table[] = { + { PCI_VDEVICE(HUAWEI, 0xa230), hip08}, + {} +}; + +static int +hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *ent) +{ + const struct hisi_sas_pci_hw *hw; + + hw = &hisi_sas_pci_hw_info[ent->driver_data]; + return hisi_sas_pci_probe(pdev, hw); +} + +static void hisi_sas_v3_remove(struct pci_dev *pdev) +{ + hisi_sas_pci_remove(pdev); +} + +static struct pci_driver sas_v3_pci_driver = { + .name = DRV_NAME, + .id_table = sas_v3_pci_table, + .probe = hisi_sas_v3_probe, + .remove = hisi_sas_v3_remove, +}; + +module_pci_driver(sas_v3_pci_driver); + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("John Garry "); +MODULE_DESCRIPTION("HISILICON SAS controller v3 hw driver"); +MODULE_ALIAS("platform:" DRV_NAME);