linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Li Chen <lchen@ambarella.com>
Cc: "Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"Li Chen" <me@linux.beauty>, "Roger Quadros" <rogerq@kernel.org>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Chuanhong Guo" <gch981213@gmail.com>,
	"Liang Yang" <liang.yang@amlogic.com>,
	"Jean Delvare" <jdelvare@suse.de>,
	"Andreas Böhler" <dev@aboehler.at>,
	"Christian Lamparter" <chunkeey@gmail.com>,
	"Rickard x Andersson" <rickaran@axis.com>,
	linux-kernel@vger.kernel.org (open list),
	linux-mtd@lists.infradead.org (open list:NAND FLASH SUBSYSTEM),
	linux-arm-kernel@lists.infradead.org (moderated
	list:ARM/Ambarella SoC support)
Subject: Re: [PATCH 12/15] mtd: nand: add Ambarella nand support
Date: Mon, 23 Jan 2023 09:32:09 +0100	[thread overview]
Message-ID: <20230123093209.770995cf@xps-13> (raw)
In-Reply-To: <20230123073305.149940-13-lchen@ambarella.com>

Hi Li,

I'm sorry, this is not going to work at all.

> +	ambarella_nand_init(host);
> +
> +	mtd = nand_to_mtd(&host->chip);
> +	mtd->name = "amba_nand";
> +
> +	nand_controller_init(&host->controller);
> +	nand_set_controller_data(&host->chip, host);
> +	nand_set_flash_node(&host->chip, dev->of_node);
> +
> +	host->chip.controller = &host->controller;
> +	host->chip.controller->ops = &ambarella_controller_ops;
> +	host->chip.legacy.chip_delay = 0;
> +	host->chip.legacy.read_byte = ambarella_nand_read_byte;
> +	host->chip.legacy.write_buf = ambarella_nand_write_buf;
> +	host->chip.legacy.read_buf = ambarella_nand_read_buf;
> +	host->chip.legacy.select_chip = ambarella_nand_select_chip;
> +	host->chip.legacy.cmd_ctrl = ambarella_nand_cmd_ctrl;
> +	host->chip.legacy.dev_ready = ambarella_nand_dev_ready;
> +	host->chip.legacy.waitfunc = ambarella_nand_waitfunc;
> +	host->chip.legacy.cmdfunc = ambarella_nand_cmdfunc;
> +	host->chip.legacy.set_features = nand_get_set_features_notsupp;
> +	host->chip.legacy.get_features = nand_get_set_features_notsupp;

Please be aware that we no longer accept legacy introductions upstream.

You can look for ->exec_op() conversions using git-log.

> +	host->chip.options |= NAND_NO_SUBPAGE_WRITE | NAND_USES_DMA;
> +
> +	rval = nand_scan(&host->chip, 1);
> +	if (rval < 0)
> +		return rval;
> +
> +	rval = mtd_device_register(mtd, NULL, 0);
> +	if (rval < 0)
> +		nand_cleanup(&host->chip);
> +
> +	return rval;
> +}

[...]

> diff --git a/drivers/mtd/nand/raw/nand_ids.c
b/drivers/mtd/nand/raw/nand_ids.c
> index dacc5529b3df..9f264e2a6484 100644
> --- a/drivers/mtd/nand/raw/nand_ids.c
> +++ b/drivers/mtd/nand/raw/nand_ids.c
> @@ -62,6 +62,10 @@ struct nand_flash_dev nand_flash_ids[] = {
>  		{ .id = {0x98, 0xd3, 0x91, 0x26, 0x76} },
>  		  SZ_4K, SZ_1K, SZ_256K, 0, 5, 256, NAND_ECC_INFO(8, SZ_512)},
>  
> +	{"MT29F2G01ABAGD SPINAND 2G 3.3V 8-bit",
> +		{ .id = {0x2c, 0x24, 0x00, 0x00, 0x00} },
> +		  SZ_2K, SZ_256, SZ_128K, 0, 2, 128},
> +

Raw NAND != SPI-NAND. I don't get what you're doing here but either you
want to drive SPI-NANDs and this is a SPI controller driver that
implements spi-mem ops and should be located under drivers/spi/, or
this is a plain raw NAND controller which is wired to a parallel NAND
and this should be under drivers/mtd/nand/raw/.

ECC controllers can be shared with the ECC engine abstraction though.

>  	LEGACY_ID_NAND("NAND 4MiB 5V 8-bit",   0x6B, 4, SZ_8K, SP_OPTIONS),
>  	LEGACY_ID_NAND("NAND 4MiB 3,3V 8-bit", 0xE3, 4, SZ_8K, SP_OPTIONS),
>  	LEGACY_ID_NAND("NAND 4MiB 3,3V 8-bit", 0xE5, 4, SZ_8K, SP_OPTIONS),


Thanks,
Miquèl

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2023-01-23  8:33 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23  7:32 [PATCH 00/15] Ambarella S6LM SoC bring-up Li Chen
2023-01-23  7:32 ` [PATCH 05/15] arm64: Kconfig: Introduce CONFIG_ARCH_AMBARELLA Li Chen
2023-01-23  8:32   ` Arnd Bergmann
     [not found] ` <20230123073305.149940-4-lchen@ambarella.com>
2023-01-23  8:03   ` [PATCH 03/15] dt-bindings: arm: ambarella: Add binding for Ambarella ARM platforms Krzysztof Kozlowski
2023-01-23 13:58     ` Li Chen
     [not found] ` <20230123073305.149940-5-lchen@ambarella.com>
2023-01-23  8:07   ` [PATCH 04/15] dt-bindings: arm: add support for Ambarella SoC Krzysztof Kozlowski
2023-01-23 15:09     ` Li Chen
2023-01-23 15:52       ` Krzysztof Kozlowski
     [not found] ` <20230123073305.149940-8-lchen@ambarella.com>
2023-01-23  8:11   ` [PATCH 07/15] dt-bindings: clock: Add Ambarella clock bindings Krzysztof Kozlowski
2023-01-25  9:28     ` Li Chen
2023-01-25  9:55       ` Krzysztof Kozlowski
2023-01-25 12:06         ` Li Chen
2023-01-25 12:14           ` Krzysztof Kozlowski
2023-01-25 13:40             ` Li Chen
2023-01-26 11:29               ` Krzysztof Kozlowski
2023-01-27 14:48                 ` Li Chen
2023-01-27 15:08                   ` Krzysztof Kozlowski
2023-01-28  9:42                     ` Li Chen
2023-01-28 10:08                       ` Krzysztof Kozlowski
2023-01-28 10:11                         ` Li Chen
2023-02-06 11:28                     ` Li Chen
2023-02-06 13:41                       ` Krzysztof Kozlowski
2023-02-06 14:57                         ` Li Chen
2023-02-08 10:27                           ` Krzysztof Kozlowski
2023-01-27 15:11                   ` Krzysztof Kozlowski
2023-01-28  9:45                     ` Li Chen
     [not found] ` <20230123073305.149940-10-lchen@ambarella.com>
2023-01-23  8:11   ` [PATCH 09/15] dt-bindings: serial: add support for Ambarella Krzysztof Kozlowski
2023-01-25  9:54     ` Li Chen
2023-01-25  9:56       ` Krzysztof Kozlowski
2023-01-28  9:22         ` Li Chen
     [not found] ` <20230123073305.149940-12-lchen@ambarella.com>
2023-01-23  8:13   ` [PATCH 11/15] dt-bindings: mtd: Add binding " Krzysztof Kozlowski
     [not found] ` <20230123073305.149940-14-lchen@ambarella.com>
2023-01-23  8:13   ` [PATCH 13/15] dt-bindings: pinctrl: add support " Krzysztof Kozlowski
2023-01-23 12:32   ` Linus Walleij
2023-01-28 10:05     ` Li Chen
     [not found] ` <20230123073305.149940-16-lchen@ambarella.com>
2023-01-23  8:20   ` [PATCH 15/15] arm64: dts: ambarella: introduce Ambarella s6lm SoC Krzysztof Kozlowski
     [not found] ` <20230123073305.149940-7-lchen@ambarella.com>
2023-01-23  8:29   ` [PATCH 06/15] soc: add Ambarella driver Arnd Bergmann
2023-01-24  7:58     ` Li Chen
2023-01-24 15:46       ` Arnd Bergmann
2023-01-29  7:21         ` Li Chen
2023-01-23 11:48   ` Conor.Dooley
2023-01-24  8:27     ` Li Chen
2023-01-24  8:46       ` Conor.Dooley
2023-01-24 14:24         ` Li Chen
     [not found] ` <20230123073305.149940-13-lchen@ambarella.com>
2023-01-23  8:32   ` Miquel Raynal [this message]
2023-01-23  8:39 ` [PATCH 00/15] Ambarella S6LM SoC bring-up Arnd Bergmann
2023-01-24  2:08   ` Bagas Sanjaya
2023-01-25  2:24   ` Li Chen
     [not found] ` <20230123073305.149940-11-lchen@ambarella.com>
2023-01-23  9:50   ` [PATCH 10/15] serial: ambarella: add support for Ambarella uart_port Greg Kroah-Hartman
2023-01-23  9:51   ` Greg Kroah-Hartman
2023-01-25 10:01     ` Li Chen

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=20230123093209.770995cf@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=chunkeey@gmail.com \
    --cc=dev@aboehler.at \
    --cc=f.fainelli@gmail.com \
    --cc=gch981213@gmail.com \
    --cc=jdelvare@suse.de \
    --cc=krzk@kernel.org \
    --cc=lchen@ambarella.com \
    --cc=liang.yang@amlogic.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=me@linux.beauty \
    --cc=richard@nod.at \
    --cc=rickaran@axis.com \
    --cc=rogerq@kernel.org \
    --cc=vigneshr@ti.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 NNTP newsgroup(s).