LKML Archive mirror
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
To: Jiancheng Xue <xuejiancheng@huawei.com>
Cc: Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	shijie.huang@intel.com, pengbinquan@huawei.com,
	han.xu@freescale.com, fabio.estevam@freescale.com,
	Joachim Eastwood <manabian@gmail.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mtd@lists.infradead.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
Subject: Re: [PATCH v6] mtd: spi-nor: add hisilicon spi-nor flash controller driver
Date: Fri, 5 Feb 2016 12:26:18 -0300	[thread overview]
Message-ID: <CAAEAJfDnA5zkvHgqOkSjPZTJQp41N6_U=oO_OmR-4BSb7dUKoQ@mail.gmail.com> (raw)
In-Reply-To: <1454639113-16748-1-git-send-email-xuejiancheng@huawei.com>

On 4 February 2016 at 23:25, Jiancheng Xue <xuejiancheng@huawei.com> wrote:
> Add hisilicon spi-nor flash controller driver
>
> Signed-off-by: Jiancheng Xue <xuejiancheng@huawei.com>
> Acked-by: Rob Herring <robh@kernel.org>
> ---
> 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 <robh@kernel.org>.
>  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@vanguardiasur.com.ar>
-- 
Ezequiel García, VanguardiaSur
www.vanguardiasur.com.ar

      reply	other threads:[~2016-02-05 15:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05  2:25 [PATCH v6] mtd: spi-nor: add hisilicon spi-nor flash controller driver Jiancheng Xue
2016-02-05 15:26 ` Ezequiel Garcia [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAEAJfDnA5zkvHgqOkSjPZTJQp41N6_U=oO_OmR-4BSb7dUKoQ@mail.gmail.com' \
    --to=ezequiel@vanguardiasur.com.ar \
    --cc=computersforpeace@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=fabio.estevam@freescale.com \
    --cc=galak@codeaurora.org \
    --cc=gaofei@hisilicon.com \
    --cc=han.xu@freescale.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=manabian@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=ml.yang@hisilicon.com \
    --cc=pawel.moll@arm.com \
    --cc=pengbinquan@huawei.com \
    --cc=raojun@hisilicon.com \
    --cc=robh+dt@kernel.org \
    --cc=shijie.huang@intel.com \
    --cc=suwenping@hisilicon.com \
    --cc=xuejiancheng@hisilicon.com \
    --cc=xuejiancheng@huawei.com \
    --cc=yanghongwei@hisilicon.com \
    --cc=yanhaifeng@hisilicon.com \
    --cc=zhangzhenxing@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).