From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753474AbcBEP0V (ORCPT ); Fri, 5 Feb 2016 10:26:21 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:33138 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751798AbcBEP0T convert rfc822-to-8bit (ORCPT ); Fri, 5 Feb 2016 10:26:19 -0500 MIME-Version: 1.0 In-Reply-To: <1454639113-16748-1-git-send-email-xuejiancheng@huawei.com> References: <1454639113-16748-1-git-send-email-xuejiancheng@huawei.com> Date: Fri, 5 Feb 2016 12:26:18 -0300 Message-ID: Subject: Re: [PATCH v6] mtd: spi-nor: add hisilicon spi-nor flash controller driver From: Ezequiel Garcia To: Jiancheng Xue Cc: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , David Woodhouse , Brian Norris , shijie.huang@intel.com, pengbinquan@huawei.com, han.xu@freescale.com, fabio.estevam@freescale.com, Joachim Eastwood , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mtd@lists.infradead.org" , yanhaifeng@hisilicon.com, yanghongwei@hisilicon.com, suwenping@hisilicon.com, raojun@hisilicon.com, ml.yang@hisilicon.com, gaofei@hisilicon.com, zhangzhenxing@hisilicon.com, xuejiancheng@hisilicon.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4 February 2016 at 23:25, Jiancheng Xue wrote: > Add hisilicon spi-nor flash controller driver > > Signed-off-by: Jiancheng Xue > Acked-by: Rob Herring > --- > change log > v6: > Based on v4.5-rc2 > Fixed issues pointed by Ezequiel Garcia. > v5: > Fixed a compile error. > v4: > Rebased to v4.5-rc1 > v3: > Added a compatible string "hisilicon,hi3519-sfc". > v2: > Fixed some compiling warings. > > .../devicetree/bindings/spi/spi-hisi-sfc.txt | 25 ++ > This file has already been acked by Rob Herring . > drivers/mtd/spi-nor/Kconfig | 6 + > drivers/mtd/spi-nor/Makefile | 1 + > drivers/mtd/spi-nor/hisi-sfc.c | 494 +++++++++++++++++++++ > 4 files changed, 526 insertions(+) > create mode 100644 Documentation/devicetree/bindings/spi/spi-hisi-sfc.txt > create mode 100644 drivers/mtd/spi-nor/hisi-sfc.c > > diff --git a/Documentation/devicetree/bindings/spi/spi-hisi-sfc.txt b/Documentation/devicetree/bindings/spi/spi-hisi-sfc.txt > new file mode 100644 > index 0000000..7407147 > --- /dev/null > +++ b/Documentation/devicetree/bindings/spi/spi-hisi-sfc.txt > @@ -0,0 +1,25 @@ > +HiSilicon SPI-NOR Flash Controller > + > +Required properties: > +- compatible : Should be "hisilicon,hisi-sfc" and one of the following strings: > + "hisilicon,hi3519-sfc" > +- address-cells : number of cells required to define a chip select > + address on the SPI bus. Should be set to 1. See spi-bus.txt. > +- size-cells : Should be 0. > +- reg : Offset and length of the register set for the controller device. > +- reg-names : Must include the following two entries: "control", "memory". > +- clocks : handle to spi-nor flash controller clock. > + > +Example: > +spi-nor-controller@10000000 { > + compatible = "hisilicon,hi3519-sfc", "hisilicon,hisi-sfc"; > + #address-cells = <1>; > + #size-cells = <0>; > + reg = <0x10000000 0x1000>, <0x14000000 0x1000000>; > + reg-names = "control", "memory"; > + clocks = <&clock HI3519_FMC_CLK>; > + spi-nor@0 { > + compatible = "jedec,spi-nor"; > + reg = <0>; > + }; > +}; > diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig > index 0dc9275..763e48a 100644 > --- a/drivers/mtd/spi-nor/Kconfig > +++ b/drivers/mtd/spi-nor/Kconfig > @@ -37,6 +37,12 @@ config SPI_FSL_QUADSPI > This controller does not support generic SPI. It only supports > SPI NOR. > > +config SPI_HISI_SFC > + tristate "Hisilicon SPI-NOR Flash Controller(SFC)" > + depends on ARCH_HISI I believe that using COMPILE_TEST would allow the build bots to pick up your driver and report any issues. See how NXP_SPIFI does it below. > + help > + This enables support for hisilicon SPI-NOR flash controller. > + > config SPI_NXP_SPIFI > tristate "NXP SPI Flash Interface (SPIFI)" > depends on OF && (ARCH_LPC18XX || COMPILE_TEST) > diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile > index 0bf3a7f8..8a6fa69 100644 > --- a/drivers/mtd/spi-nor/Makefile > +++ b/drivers/mtd/spi-nor/Makefile > @@ -1,4 +1,5 @@ > obj-$(CONFIG_MTD_SPI_NOR) += spi-nor.o > obj-$(CONFIG_SPI_FSL_QUADSPI) += fsl-quadspi.o > +obj-$(CONFIG_SPI_HISI_SFC) += hisi-sfc.o > obj-$(CONFIG_MTD_MT81xx_NOR) += mtk-quadspi.o > obj-$(CONFIG_SPI_NXP_SPIFI) += nxp-spifi.o [..] > + > + ret = mtd_device_register(mtd, NULL, 0); > + if (ret) > + goto fail; > + > + i++; > + host->num_chip++; > + if (i == HIFMC_MAX_CHIP_NUM) { > + dev_dbg(dev, "Flash device number exceeds the maxinum chipselect number\n"); > + break; Maybe dev_warn(FW_WARN ...) since it's a warning about a devicetree (firmware) issue ? Also: s/maxinum/maximum Otherwise, looks fine: Reviewed-by: Ezequiel Garcia -- Ezequiel GarcĂ­a, VanguardiaSur www.vanguardiasur.com.ar