From patchwork Mon Oct 26 14:14:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 55554 Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1224121lbq; Mon, 26 Oct 2015 07:07:28 -0700 (PDT) X-Received: by 10.68.201.200 with SMTP id kc8mr22172171pbc.18.1445868448278; Mon, 26 Oct 2015 07:07:28 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tw1si53426533pab.195.2015.10.26.07.07.27; Mon, 26 Oct 2015 07:07:28 -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 S964782AbbJZOHX (ORCPT + 28 others); Mon, 26 Oct 2015 10:07:23 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:6733 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932272AbbJZOBv (ORCPT ); Mon, 26 Oct 2015 10:01:51 -0400 Received: from 172.24.1.47 (EHLO szxeml430-hub.china.huawei.com) ([172.24.1.47]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BPR32591; Mon, 26 Oct 2015 22:01:39 +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, 26 Oct 2015 22:01:24 +0800 From: John Garry To: , , , , , , CC: , , , , , , , , John Garry Subject: [PATCH v2 03/32] scsi: hisi_sas: add initial bare main driver Date: Mon, 26 Oct 2015 22:14:34 +0800 Message-ID: <1445868903-183817-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445868903-183817-1-git-send-email-john.garry@huawei.com> References: <1445868903-183817-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.0A020206.562E3244.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: f5583bfe80579469c54804b3f61cb50a Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds the initial bare main driver for the HiSilicon SAS HBA. This only introduces the changes to build and load the main driver module. The complete driver consists of the core main module and also a module platform driver for driving the hw. The HBA is a platform device. Signed-off-by: John Garry --- drivers/scsi/Kconfig | 1 + drivers/scsi/Makefile | 1 + drivers/scsi/hisi_sas/Kconfig | 6 +++++ drivers/scsi/hisi_sas/Makefile | 1 + drivers/scsi/hisi_sas/hisi_sas.h | 26 +++++++++++++++++++++ drivers/scsi/hisi_sas/hisi_sas_main.c | 44 +++++++++++++++++++++++++++++++++++ 6 files changed, 79 insertions(+) create mode 100644 drivers/scsi/hisi_sas/Kconfig create mode 100644 drivers/scsi/hisi_sas/Makefile create mode 100644 drivers/scsi/hisi_sas/hisi_sas.h create mode 100644 drivers/scsi/hisi_sas/hisi_sas_main.c -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 95f7a76..5c345f9 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig @@ -1774,5 +1774,6 @@ source "drivers/scsi/pcmcia/Kconfig" source "drivers/scsi/device_handler/Kconfig" source "drivers/scsi/osd/Kconfig" +source "drivers/scsi/hisi_sas/Kconfig" endmenu diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile index 1a8c9b5..03c30de 100644 --- a/drivers/scsi/Makefile +++ b/drivers/scsi/Makefile @@ -158,6 +158,7 @@ obj-$(CONFIG_CHR_DEV_SCH) += ch.o obj-$(CONFIG_SCSI_ENCLOSURE) += ses.o obj-$(CONFIG_SCSI_OSD_INITIATOR) += osd/ +obj-$(CONFIG_SCSI_HISI_SAS) += hisi_sas/ # This goes last, so that "real" scsi devices probe earlier obj-$(CONFIG_SCSI_DEBUG) += scsi_debug.o diff --git a/drivers/scsi/hisi_sas/Kconfig b/drivers/scsi/hisi_sas/Kconfig new file mode 100644 index 0000000..37a0c71 --- /dev/null +++ b/drivers/scsi/hisi_sas/Kconfig @@ -0,0 +1,6 @@ +config SCSI_HISI_SAS + tristate "HiSilicon SAS" + select SCSI_SAS_LIBSAS + select BLK_DEV_INTEGRITY + help + This driver supports HiSilicon's SAS HBA diff --git a/drivers/scsi/hisi_sas/Makefile b/drivers/scsi/hisi_sas/Makefile new file mode 100644 index 0000000..d86b05e --- /dev/null +++ b/drivers/scsi/hisi_sas/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_SCSI_HISI_SAS) += hisi_sas_main.o diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h new file mode 100644 index 0000000..a5cec22 --- /dev/null +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2015 Linaro Ltd. + * Copyright (c) 2015 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. + * + */ + +#ifndef _HISI_SAS_H_ +#define _HISI_SAS_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define DRV_VERSION "v1.0" + +#endif diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c new file mode 100644 index 0000000..67977a3 --- /dev/null +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015 Linaro Ltd. + * Copyright (c) 2015 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" + + +static struct scsi_transport_template *hisi_sas_stt; + +static struct sas_domain_function_template hisi_sas_transport_ops = { +}; + +static __init int hisi_sas_init(void) +{ + pr_info("hisi_sas: driver version %s\n", DRV_VERSION); + + hisi_sas_stt = sas_domain_attach_transport(&hisi_sas_transport_ops); + if (!hisi_sas_stt) + return -ENOMEM; + + return 0; +} + +static __exit void hisi_sas_exit(void) +{ + sas_release_transport(hisi_sas_stt); +} + +module_init(hisi_sas_init); +module_exit(hisi_sas_exit); + +MODULE_VERSION(DRV_VERSION); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("John Garry "); +MODULE_DESCRIPTION("HISILICON SAS controller driver"); +MODULE_ALIAS("platform:" DRV_NAME);