[LEDE-DEV] [PATCHv2 3/4] kernel/4.4: add generic spi-nand framework

Weijie Gao hackpascal at gmail.com
Sun Sep 3 22:48:38 PDT 2017


Yes. If I search "spi-nand linux" in Google, Micron's framework is the
first result.
However, Micron's patches are based on higher version of kernel, which
require lots of modifications to port to linux-4.4.
I choose the framework from LEDE's
target/linux/pistachio/patches-4.9/, which requires only few changes.

I've read nearly all datasheets from GigaDevice, Micron, Winbond,
Macronix, and other manufacturers. I found that their chips are not
full compatiable with each other.
For example, the ECC status bits definition. GigaDevice uses one
status to indicate the unrecoverable bits while Winbond uses two
statuses to indicate that.
And stacked die selection command is different between Micron and
Winbond. And Mircon's chip has its own plane selection bit.

Even chips of the same manufacturer, the page size/OOB size and layout
can be different. You can see differences of GigaDevice's chips in
this patch.

So, the mt29f_spinand is not enough, it's designed only for Micron's chips.

The framework I chose from
<https://github.com/lede-project/source/tree/master/target/linux/pistachio/patches-4.9/413-mtd-Introduce-SPI-NAND-framework.patch>
<https://github.com/lede-project/source/tree/master/target/linux/pistachio/patches-4.9/414-mtd-spi-nand-Support-Gigadevice-GD5F.patch>
has two layers, one for generic nand operation and one for
manufacturer-specific operations, such as the ecc status check.

I think this is a good practice.

Sincerely,
Weijie

2017-09-04 1:56 GMT+08:00 Christian Lamparter via Lede-dev
<lede-dev at lists.infradead.org>:
> The sender domain has a DMARC Reject/Quarantine policy which disallows
> sending mailing list messages using the original "From" header.
>
> To mitigate this problem, the original message has been wrapped
> automatically by the mailing list software.
>
> ---------- 已转发邮件 ----------
> From: Christian Lamparter <chunkeey at googlemail.com>
> To: lede-dev at lists.infradead.org
> Cc: hackpascal <hackpascal at gmail.com>
> Bcc:
> Date: Sun, 03 Sep 2017 19:56:22 +0200
> Subject: Re: [LEDE-DEV] [PATCHv2 3/4] kernel/4.4: add generic spi-nand framework
> On Sunday, September 3, 2017 1:43:59 PM CEST hackpascal wrote:
>> From: Weijie Gao <hackpascal at gmail.com>
>>
>> This patch adds generic SPI-NAND framework for linux-4.4.
>>
>> Files come from patches of target pistachio, but have lots of modifications
>> to add full support for GD5F series.
>>
>> Signed-off-by: Weijie Gao <hackpascal at gmail.com>
>> ---
> Hm, from what I know multiple "generic" SPI-NAND driver/framework exist.
>
> The current favourite of linux-mtd seems to be from Micron:
> <http://lists.infradead.org/pipermail/linux-mtd/2017-April/073649.html>
> (Altought, development has sadly stalled as well ;( )
> <http://lists.infradead.org/pipermail/linux-mtd/2017-April/073681.html>
>
> Is this correct? Or was there a recent attempt at upstreaming "this"
> older framework too that I can't find?
>
> Note:
> The kernel had some support for spinand since v3.13 via the
> staging "mt29f_spinand" driver. I had some success with it
> on the RT-AC58U. All I needed there was to add a custom
> definition for the Winbond W25N01GV chip [0] and enable
> CONFIG_MTD_SPINAND_MT29F=y
> CONFIG_MTD_SPINAND_ONDIEECC=y
>
> Maybe you too can get away with something similar to this?
> Until linux-mtd _finally_ knows what they want to merge.
>
> Regards,
> Christian
>
> [0] <https://github.com/lede-project/source/blob/master/target/linux/ipq806x/patches-4.9/104-mtd-nand-add-Winbond-manufacturer-and-chip.patch>
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
>



-- 
_______________________________________________
lede-devel mailing list
lede-devel at lists.infradead.org



More information about the Lede-dev mailing list