Re: Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others

2020-11-03 Thread 赵仪峰
Hi Johan, On 2020/10/31 19:58, Johan Jonker wrote: >Hi Yifeng, ... >> + >> +static int rk_nfc_read_page_hwecc(struct nand_chip *chip, u8 *buf, int >> oob_on, >> +  int page) >> +{ >> +struct mtd_info *mtd = nand_to_mtd(chip); >> +struct rk_nfc *nfc = nand_get_controller_data(chip);

Re: Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others

2020-11-03 Thread 赵仪峰
On 2020/11/3 1:11, Johan Jonker wrote: >On 11/2/20 6:00 PM, Miquel Raynal wrote: >> Hi Johan, >> >> Johan Jonker wrote on Mon, 2 Nov 2020 17:31:18 >> +0100: >> >>> On 11/2/20 2:11 PM, Johan Jonker wrote: Hi, On 11/2/20 2:07 PM, Miquel Raynal wrote: > Hi Johan, Yifeng >

Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others

2020-11-02 Thread Johan Jonker
On 11/2/20 6:00 PM, Miquel Raynal wrote: > Hi Johan, > > Johan Jonker wrote on Mon, 2 Nov 2020 17:31:18 > +0100: > >> On 11/2/20 2:11 PM, Johan Jonker wrote: >>> Hi, >>> >>> On 11/2/20 2:07 PM, Miquel Raynal wrote: Hi Johan, Yifeng Johan Jonker wrote on Mon, 2 Nov 2020 13:57:56

Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others

2020-11-02 Thread Miquel Raynal
Hi Johan, Johan Jonker wrote on Mon, 2 Nov 2020 17:31:18 +0100: > On 11/2/20 2:11 PM, Johan Jonker wrote: > > Hi, > > > > On 11/2/20 2:07 PM, Miquel Raynal wrote: > >> Hi Johan, Yifeng > >> > >> Johan Jonker wrote on Mon, 2 Nov 2020 13:57:56 > >> +0100: > >> > >>> Hi Yifeng, > >>> > >>> Don't

Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others

2020-11-02 Thread Johan Jonker
On 11/2/20 2:11 PM, Johan Jonker wrote: > Hi, > > On 11/2/20 2:07 PM, Miquel Raynal wrote: >> Hi Johan, Yifeng >> >> Johan Jonker wrote on Mon, 2 Nov 2020 13:57:56 >> +0100: >> >>> Hi Yifeng, >>> >>> Don't poke with "ecc->bytes" ones it is set in rk_nfc_ecc_init(). It >>> will not be noted by

Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others

2020-11-02 Thread Johan Jonker
Hi, On 11/2/20 2:07 PM, Miquel Raynal wrote: > Hi Johan, Yifeng > > Johan Jonker wrote on Mon, 2 Nov 2020 13:57:56 > +0100: > >> Hi Yifeng, >> >> Don't poke with "ecc->bytes" ones it is set in rk_nfc_ecc_init(). It >> will not be noted by the MTD frame work or userspace. I think there's >>

Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others

2020-11-02 Thread Miquel Raynal
Hi Johan, Yifeng Johan Jonker wrote on Mon, 2 Nov 2020 13:57:56 +0100: > Hi Yifeng, > > Don't poke with "ecc->bytes" ones it is set in rk_nfc_ecc_init(). It > will not be noted by the MTD frame work or userspace. I think there's > currently no way to let the user know that a different ECC must

Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others

2020-11-02 Thread Johan Jonker
Hi Yifeng, Don't poke with "ecc->bytes" ones it is set in rk_nfc_ecc_init(). It will not be noted by the MTD frame work or userspace. I think there's currently no way to let the user know that a different ECC must be used. Neither can the user set ECC on the fly. Example R/W flow:

Re: Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others

2020-11-02 Thread 赵仪峰
Hi Miquel, The nand_base.c will call nand_deselect_target after NAND read/program... ops done, and set variable chip->cur_cs = -1, but the nand controller do nothing and the cs of the NAND device is still selected, so the NAND device  will not enter auto power save mode. --

Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others

2020-11-02 Thread Miquel Raynal
Hi Yifeng, 赵仪峰 wrote on Mon, 2 Nov 2020 16:14:01 +0800: > Hi Miquel, > > The nand_base.c will call nand_deselect_target after NAND read/program... ops > done, and set variable chip->cur_cs = -1, > but the nand controller do nothing and the cs of the NAND device is still > selected, > so the

Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others

2020-11-01 Thread Miquel Raynal
Hello, 赵仪峰 wrote on Mon, 2 Nov 2020 11:46:04 +0800: > Hi Johan, > > void nand_deselect_target(struct nand_chip *chip) > { > if (chip->legacy.select_chip) > chip->legacy.select_chip(chip, -1); > > chip->cur_cs = -1; > } > > I need add the code below and it work. >

Re: Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others

2020-11-01 Thread 赵仪峰
Hi Johan, void nand_deselect_target(struct nand_chip *chip) { if (chip->legacy.select_chip) chip->legacy.select_chip(chip, -1); chip->cur_cs = -1; } I need add the code below and it work.    chip->legacy.select_chip = rk_nfc_select_chip; But I found almost all

Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others

2020-10-31 Thread Johan Jonker
Hi Yifeng, In some functions you deselect the chips. The MTD frame work has a functions for that and also keeps track of its select status, so I think that you shouldn't poke with that yourself and should therefore remove the deselections from your driver. /** * nand_deselect_target() -

Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others

2020-10-31 Thread Johan Jonker
Hi Yifeng, Some comments, have a look if it's usefull. On 10/28/20 10:53 AM, Yifeng Zhao wrote: > This driver supports Rockchip NFC (NAND Flash Controller) found on RK3308, > RK2928, RKPX30, RV1108 and other SOCs. The driver has been tested using > 8-bit NAND interface on the ARM based RK3308

Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others

2020-10-30 Thread Miquel Raynal
Hi 赵仪峰, 赵仪峰 wrote on Fri, 30 Oct 2020 18:12:52 +0800: > Hi Miquel, > > >Hi Yifeng, > > > >A few more comments below, but overall looks better. > > > >Yifeng Zhao wrote on Wed, 28 Oct 2020 > >17:53:24 +0800: > > > >> This driver supports Rockchip NFC (NAND Flash Controller) found on RK3308,

Re: Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others

2020-10-30 Thread 赵仪峰
Hi Miquel, >Hi Yifeng, > >A few more comments below, but overall looks better. > >Yifeng Zhao wrote on Wed, 28 Oct 2020 >17:53:24 +0800: > >> This driver supports Rockchip NFC (NAND Flash Controller) found on RK3308, >> RK2928, RKPX30, RV1108 and other SOCs. The driver has been tested using >>

Re: [PATCH v13 2/8] mtd: rawnand: rockchip: NFC drivers for RK3308, RK2928 and others

2020-10-28 Thread Miquel Raynal
Hi Yifeng, A few more comments below, but overall looks better. Yifeng Zhao wrote on Wed, 28 Oct 2020 17:53:24 +0800: > This driver supports Rockchip NFC (NAND Flash Controller) found on RK3308, > RK2928, RKPX30, RV1108 and other SOCs. The driver has been tested using > 8-bit NAND interface on