From patchwork Mon Oct 12 15:20:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 54774 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id 0AB1823001 for ; Mon, 12 Oct 2015 15:05:33 +0000 (UTC) Received: by wibzt1 with SMTP id zt1sf16719884wib.0 for ; Mon, 12 Oct 2015 08:05:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=w0Iu+IXndFiYFnmJgUJ6KwPWXjLpX+Fx+BxfoCcYiAY=; b=OtAJNcQFFbVADhiKtu84yDlmtQoHVnmbGOHZ90TIeePt6tDyy3TUPs3SKtmc44uCMK xUkDrA22Cndbx9lxV/dqjJWEzjZjFrd4r8Zt/L9O06sMLaDRuSoh35T/30uRWqKCERrG sp0Bx8SaVeTUVK6UkbWsAwql3YOk+ks3unQZ9EsT6EeUUERqXSzWq8mMPrRjF20v29De ArOVN9ZfqLz0jZHd21g1kbBYfxmfXvsJ/msuCXZUWF0vwbKId/lPFvxPYigdzti6Sd+2 D0C5C0guppLJHfZr2dn2dyqRPFWshiGPwVT64jRRlevdMPhz/T4yW6XG9KQgwf9fziWI 6RKQ== X-Gm-Message-State: ALoCoQnWcMzkp62W4FbrarW8syN9tfzA9Pjd9WwyBoju1kin4s+zB9/nIvI6BypD2soOfZR9KyUb X-Received: by 10.112.55.69 with SMTP id q5mr5725842lbp.24.1444662331659; Mon, 12 Oct 2015 08:05:31 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.164.135 with SMTP id n129ls558831lfe.7.gmail; Mon, 12 Oct 2015 08:05:31 -0700 (PDT) X-Received: by 10.112.55.2 with SMTP id n2mr13048941lbp.59.1444662331443; Mon, 12 Oct 2015 08:05:31 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id jh5si11508778lbc.136.2015.10.12.08.05.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Oct 2015 08:05:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbcao8 with SMTP id ao8so146184378lbc.3 for ; Mon, 12 Oct 2015 08:05:31 -0700 (PDT) X-Received: by 10.112.139.201 with SMTP id ra9mr12606830lbb.29.1444662331287; Mon, 12 Oct 2015 08:05:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1599175lbq; Mon, 12 Oct 2015 08:05:30 -0700 (PDT) X-Received: by 10.60.139.97 with SMTP id qx1mr17227194oeb.32.1444662330263; Mon, 12 Oct 2015 08:05:30 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n64si9012969oih.79.2015.10.12.08.05.30 for ; Mon, 12 Oct 2015 08:05:30 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752052AbbJLPF2 (ORCPT ); Mon, 12 Oct 2015 11:05:28 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:11744 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751576AbbJLPF1 (ORCPT ); Mon, 12 Oct 2015 11:05:27 -0400 Received: from 172.24.1.51 (EHLO szxeml432-hub.china.huawei.com) ([172.24.1.51]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CUB61522; Mon, 12 Oct 2015 23:05:12 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by szxeml432-hub.china.huawei.com (10.82.67.209) with Microsoft SMTP Server id 14.3.235.1; Mon, 12 Oct 2015 23:05:00 +0800 From: John Garry To: CC: , , , , , , , , , John Garry Subject: [PATCH 03/25] scsi: hisi_sas: add initial bare driver Date: Mon, 12 Oct 2015 23:20:15 +0800 Message-ID: <1444663237-238302-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444663237-238302-1-git-send-email-john.garry@huawei.com> References: <1444663237-238302-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.garry@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch adds the initial bare driver for the HiSilicon SAS HBA. The driver includes no HW interaction, but only the changes to build and load the driver module. The HBA is a platform device. Signed-off-by: John Garry --- drivers/scsi/Kconfig | 1 + drivers/scsi/Makefile | 1 + drivers/scsi/hisi_sas/Kconfig | 5 +++ drivers/scsi/hisi_sas/Makefile | 2 ++ drivers/scsi/hisi_sas/hisi_sas.h | 24 +++++++++++++++ drivers/scsi/hisi_sas/hisi_sas_init.c | 58 +++++++++++++++++++++++++++++++++++ 6 files changed, 91 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_init.c 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..a7f47a2 --- /dev/null +++ b/drivers/scsi/hisi_sas/Kconfig @@ -0,0 +1,5 @@ +config SCSI_HISI_SAS + tristate "HiSilicon SAS" + select SCSI_SAS_LIBSAS + 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..63c3c4d --- /dev/null +++ b/drivers/scsi/hisi_sas/Makefile @@ -0,0 +1,2 @@ +obj-$(CONFIG_SCSI_HISI_SAS) += hisi_sas.o +hisi_sas-y+= hisi_sas_init.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..50204a2 --- /dev/null +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -0,0 +1,24 @@ +/* + * 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 + +#define DRV_NAME "hisi_sas" +#define DRV_VERSION "v1.0" + +#endif diff --git a/drivers/scsi/hisi_sas/hisi_sas_init.c b/drivers/scsi/hisi_sas/hisi_sas_init.c new file mode 100644 index 0000000..dd83430 --- /dev/null +++ b/drivers/scsi/hisi_sas/hisi_sas_init.c @@ -0,0 +1,58 @@ +/* + * 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" + +static const struct of_device_id sas_of_match[] = { + { .compatible = "hisilicon,sas-controller-v1",}, + {}, +}; +MODULE_DEVICE_TABLE(of, sas_of_match); +static int hisi_sas_probe(struct platform_device *pdev) +{ + + return 0; +} + +static int hisi_sas_remove(struct platform_device *pdev) +{ + return 0; +} + +static struct platform_driver hisi_sas_driver = { + .probe = hisi_sas_probe, + .remove = hisi_sas_remove, + .driver = { + .name = DRV_NAME, + .of_match_table = sas_of_match, + }, +}; + +static __init int hisi_sas_init(void) +{ + pr_info("hisi_sas: driver version %s\n", DRV_VERSION); + + return platform_driver_register(&hisi_sas_driver); +} + +static __exit void hisi_sas_exit(void) +{ + platform_driver_unregister(&hisi_sas_driver); +} + +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);