lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAEAJfDnA5zkvHgqOkSjPZTJQp41N6_U=oO_OmR-4BSb7dUKoQ@mail.gmail.com>
Date:	Fri, 5 Feb 2016 12:26:18 -0300
From:	Ezequiel Garcia <ezequiel@...guardiasur.com.ar>
To:	Jiancheng Xue <xuejiancheng@...wei.com>
Cc:	Rob Herring <robh+dt@...nel.org>, Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	David Woodhouse <dwmw2@...radead.org>,
	Brian Norris <computersforpeace@...il.com>,
	shijie.huang@...el.com, pengbinquan@...wei.com,
	han.xu@...escale.com, fabio.estevam@...escale.com,
	Joachim Eastwood <manabian@...il.com>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
	yanhaifeng@...ilicon.com, yanghongwei@...ilicon.com,
	suwenping@...ilicon.com, raojun@...ilicon.com,
	ml.yang@...ilicon.com, gaofei@...ilicon.com,
	zhangzhenxing@...ilicon.com, xuejiancheng@...ilicon.com
Subject: Re: [PATCH v6] mtd: spi-nor: add hisilicon spi-nor flash controller driver

On 4 February 2016 at 23:25, Jiancheng Xue <xuejiancheng@...wei.com> wrote:
> Add hisilicon spi-nor flash controller driver
>
> Signed-off-by: Jiancheng Xue <xuejiancheng@...wei.com>
> Acked-by: Rob Herring <robh@...nel.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@...nel.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@...00000 {
> +       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@...guardiasur.com.ar>
-- 
Ezequiel GarcĂ­a, VanguardiaSur
www.vanguardiasur.com.ar

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ