From: xiaolei li <xiaolei.li@mediatek.com>
To: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: <richard@nod.at>, <linux-mtd@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>,
<srv_heupstream@mediatek.com>
Subject: Re: [PATCH v2 4/4] mtd: rawnand: mtk: Add new nfc capability maximize_fdm_ecc
Date: Mon, 23 Apr 2018 10:04:51 +0800 [thread overview]
Message-ID: <1524449091.14673.50.camel@mhfsdcap03> (raw)
In-Reply-To: <20180420222350.620e4db7@bbrezillon>
Hi Boris
On Fri, 2018-04-20 at 22:23 +0200, Boris Brezillon wrote:
> On Mon, 16 Apr 2018 15:41:04 +0800
> Xiaolei Li <xiaolei.li@mediatek.com> wrote:
>
> > For some MTK NAND chips, BootROM will access more than one byte
> > ECC protected FDM data, but now we fix ECC protected FDM byte as 1.
> > This will make some chips be failed to boot up.
> >
> > This patch adds one new nfc capability maximize_fdm_ecc to maximize ECC
> > protected FDM bytes if it is true.
> >
> > Signed-off-by: Xiaolei Li <xiaolei.li@mediatek.com>
> > ---
> > drivers/mtd/nand/raw/mtk_nand.c | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> > mode change 100644 => 100755 drivers/mtd/nand/raw/mtk_nand.c
> >
> > diff --git a/drivers/mtd/nand/raw/mtk_nand.c b/drivers/mtd/nand/raw/mtk_nand.c
> > old mode 100644
> > new mode 100755
> > index 03a4df2..7025132
> > --- a/drivers/mtd/nand/raw/mtk_nand.c
> > +++ b/drivers/mtd/nand/raw/mtk_nand.c
> > @@ -111,6 +111,7 @@ struct mtk_nfc_caps {
> > u8 pageformat_spare_shift;
> > u8 nfi_clk_div;
> > u8 max_sector;
> > + bool maximize_fdm_ecc;
> > };
> >
> > struct mtk_nfc_bad_mark_ctl {
> > @@ -1151,8 +1152,8 @@ static void mtk_nfc_set_fdm(struct mtk_nfc_fdm *fdm, struct mtd_info *mtd)
> > if (fdm->reg_size > NFI_FDM_MAX_SIZE)
> > fdm->reg_size = NFI_FDM_MAX_SIZE;
> >
> > - /* bad block mark storage */
> > - fdm->ecc_size = 1;
> > + /* Reserve at least one byte for bad mark */
> > + fdm->ecc_size = nfc->caps->maximize_fdm_ecc ? fdm->reg_size : 1;
> > }
> >
> > static void mtk_nfc_set_bad_mark_ctl(struct mtk_nfc_bad_mark_ctl *bm_ctl,
> > @@ -1413,6 +1414,7 @@ static int mtk_nfc_nand_chips_init(struct device *dev, struct mtk_nfc *nfc)
> > .pageformat_spare_shift = 4,
> > .nfi_clk_div = 1,
> > .max_sector = 16,
> > + .maximize_fdm_ecc = false,
> > };
> >
> > static const struct mtk_nfc_caps mtk_nfc_caps_mt2712 = {
> > @@ -1423,6 +1425,7 @@ static int mtk_nfc_nand_chips_init(struct device *dev, struct mtk_nfc *nfc)
> > .pageformat_spare_shift = 16,
> > .nfi_clk_div = 2,
> > .max_sector = 16,
> > + .maximize_fdm_ecc = false,
> > };
> >
> > static const struct mtk_nfc_caps mtk_nfc_caps_mt7622 = {
> > @@ -1433,6 +1436,7 @@ static int mtk_nfc_nand_chips_init(struct device *dev, struct mtk_nfc *nfc)
> > .pageformat_spare_shift = 4,
> > .nfi_clk_div = 1,
> > .max_sector = 8,
> > + .maximize_fdm_ecc = false,
> > };
>
> So, you introduce a new flag, but all existing SoCs are setting it to
> false. Can you please send a patch series containing all the
OK. Because some MTK SoCs that will apply "true" setting have not been
upstreamed now, so I think it is better to send a patch series in the
future as your advice.
I will remove this patch in v3. Sorry for making you confused.
Thanks.
Xiaolei
> modifications, or at least point to a branch containing all the changes
> you intend to push so that we know why the changes are required?
> Your first version of this patchset was better in this regard.
>
> >
> > static const struct of_device_id mtk_nfc_id_table[] = {
>
prev parent reply other threads:[~2018-04-23 2:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-16 7:41 [PATCH v2 0/4] Improve MTK NAND driver Xiaolei Li
2018-04-16 7:41 ` [PATCH v2 1/4] dt-bindings: mtd: mtk-nand: Update properties description Xiaolei Li
2018-04-20 20:15 ` Boris Brezillon
2018-04-23 1:43 ` xiaolei li
2018-04-16 7:41 ` [PATCH v2 2/4] MAINTAINERS: Add entry for Mediatek NAND controller driver Xiaolei Li
2018-04-20 20:24 ` Boris Brezillon
2018-04-22 17:28 ` Boris Brezillon
2018-04-23 1:44 ` xiaolei li
2018-04-16 7:41 ` [PATCH v2 3/4] mtd: rawnand: mtk: Replace max_sector_size with sector size array Xiaolei Li
2018-04-20 20:18 ` Boris Brezillon
2018-04-23 1:49 ` xiaolei li
2018-04-16 7:41 ` [PATCH v2 4/4] mtd: rawnand: mtk: Add new nfc capability maximize_fdm_ecc Xiaolei Li
2018-04-20 20:23 ` Boris Brezillon
2018-04-23 2:04 ` xiaolei li [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=1524449091.14673.50.camel@mhfsdcap03 \
--to=xiaolei.li@mediatek.com \
--cc=boris.brezillon@bootlin.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
--cc=srv_heupstream@mediatek.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