Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-19 Thread Liang Yang
On 2018/10/19 16:42, Boris Brezillon wrote: On Fri, 19 Oct 2018 16:29:40 +0800 Liang Yang wrote: On 2018/10/19 4:50, Boris Brezillon wrote: On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: +static int meson_nfc_buffer_init(struct mtd_info *mtd) +{ + struct nand_chip *nand

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-19 Thread Liang Yang
On 2018/10/19 16:42, Boris Brezillon wrote: On Fri, 19 Oct 2018 16:29:40 +0800 Liang Yang wrote: On 2018/10/19 4:50, Boris Brezillon wrote: On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: +static int meson_nfc_buffer_init(struct mtd_info *mtd) +{ + struct nand_chip *nand

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-19 Thread Boris Brezillon
On Fri, 19 Oct 2018 16:29:40 +0800 Liang Yang wrote: > On 2018/10/19 4:50, Boris Brezillon wrote: > > On Thu, 18 Oct 2018 13:09:05 +0800 > > Jianxin Pan wrote: > > > >> +static int meson_nfc_buffer_init(struct mtd_info *mtd) > >> +{ > >> + struct nand_chip *nand = mtd_to_nand(mtd); > >> +

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-19 Thread Boris Brezillon
On Fri, 19 Oct 2018 16:29:40 +0800 Liang Yang wrote: > On 2018/10/19 4:50, Boris Brezillon wrote: > > On Thu, 18 Oct 2018 13:09:05 +0800 > > Jianxin Pan wrote: > > > >> +static int meson_nfc_buffer_init(struct mtd_info *mtd) > >> +{ > >> + struct nand_chip *nand = mtd_to_nand(mtd); > >> +

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-19 Thread Liang Yang
On 2018/10/19 16:10, Boris Brezillon wrote: On Fri, 19 Oct 2018 15:29:05 +0800 Liang Yang wrote: How about defining that the HW returns an array of __le64 instead and then define the following macros which you can use after converting in the CPU endianness #define

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-19 Thread Liang Yang
On 2018/10/19 16:10, Boris Brezillon wrote: On Fri, 19 Oct 2018 15:29:05 +0800 Liang Yang wrote: How about defining that the HW returns an array of __le64 instead and then define the following macros which you can use after converting in the CPU endianness #define

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-19 Thread Liang Yang
On 2018/10/19 4:50, Boris Brezillon wrote: On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: +static int meson_nfc_buffer_init(struct mtd_info *mtd) +{ + struct nand_chip *nand = mtd_to_nand(mtd); + struct meson_nfc *nfc = nand_get_controller_data(nand); + static int

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-19 Thread Liang Yang
On 2018/10/19 4:50, Boris Brezillon wrote: On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: +static int meson_nfc_buffer_init(struct mtd_info *mtd) +{ + struct nand_chip *nand = mtd_to_nand(mtd); + struct meson_nfc *nfc = nand_get_controller_data(nand); + static int

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-19 Thread Boris Brezillon
On Fri, 19 Oct 2018 15:29:05 +0800 Liang Yang wrote: > > How about defining that the HW returns an array of __le64 instead and then > > define the following macros which you can use after converting in the > > CPU endianness > > > > #define ECC_GET_PROTECTED_OOB_BYTE(x, y)(((x) >> (8 * (1 +

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-19 Thread Boris Brezillon
On Fri, 19 Oct 2018 15:29:05 +0800 Liang Yang wrote: > > How about defining that the HW returns an array of __le64 instead and then > > define the following macros which you can use after converting in the > > CPU endianness > > > > #define ECC_GET_PROTECTED_OOB_BYTE(x, y)(((x) >> (8 * (1 +

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-19 Thread Liang Yang
On 2018/10/19 4:39, Boris Brezillon wrote: On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: +static int meson_nfc_calc_set_timing(struct meson_nfc *nfc, +const struct nand_sdr_timings *timings) +{ + struct nand_timing *timing = >timing; +

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-19 Thread Liang Yang
On 2018/10/19 4:39, Boris Brezillon wrote: On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: +static int meson_nfc_calc_set_timing(struct meson_nfc *nfc, +const struct nand_sdr_timings *timings) +{ + struct nand_timing *timing = >timing; +

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-19 Thread Liang Yang
On 2018/10/19 3:33, Boris Brezillon wrote: On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: From: Liang Yang Add initial support for the Amlogic NAND flash controller which found in the Meson-GXBB/GXL/AXG SoCs. Signed-off-by: Liang Yang Signed-off-by: Yixun Lan Signed-off-by:

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-19 Thread Liang Yang
On 2018/10/19 3:33, Boris Brezillon wrote: On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: From: Liang Yang Add initial support for the Amlogic NAND flash controller which found in the Meson-GXBB/GXL/AXG SoCs. Signed-off-by: Liang Yang Signed-off-by: Yixun Lan Signed-off-by:

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-19 Thread Liang Yang
On 2018/10/18 22:24, Boris Brezillon wrote: On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: +static int meson_nfc_exec_op(struct nand_chip *chip, +const struct nand_operation *op, bool check_only) +{ + struct mtd_info *mtd = nand_to_mtd(chip); +

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-19 Thread Liang Yang
On 2018/10/18 22:24, Boris Brezillon wrote: On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: +static int meson_nfc_exec_op(struct nand_chip *chip, +const struct nand_operation *op, bool check_only) +{ + struct mtd_info *mtd = nand_to_mtd(chip); +

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-18 Thread Boris Brezillon
On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: > +static int meson_nfc_buffer_init(struct mtd_info *mtd) > +{ > + struct nand_chip *nand = mtd_to_nand(mtd); > + struct meson_nfc *nfc = nand_get_controller_data(nand); > + static int max_page_bytes, max_info_bytes; > + int

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-18 Thread Boris Brezillon
On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: > +static int meson_nfc_buffer_init(struct mtd_info *mtd) > +{ > + struct nand_chip *nand = mtd_to_nand(mtd); > + struct meson_nfc *nfc = nand_get_controller_data(nand); > + static int max_page_bytes, max_info_bytes; > + int

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-18 Thread Boris Brezillon
On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: > +static int meson_nfc_calc_set_timing(struct meson_nfc *nfc, > + const struct nand_sdr_timings *timings) > +{ > + struct nand_timing *timing = >timing; > + int div, bt_min, bt_max, bus_timing; > +

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-18 Thread Boris Brezillon
On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: > +static int meson_nfc_calc_set_timing(struct meson_nfc *nfc, > + const struct nand_sdr_timings *timings) > +{ > + struct nand_timing *timing = >timing; > + int div, bt_min, bt_max, bus_timing; > +

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-18 Thread Boris Brezillon
On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: > +static int meson_nand_bch_mode(struct nand_chip *nand) > +{ > + struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); > + struct meson_nand_ecc meson_ecc[] = { > + MESON_ECC_DATA(NFC_ECC_BCH8_1K, 8), > +

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-18 Thread Boris Brezillon
On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: > +static int meson_nand_bch_mode(struct nand_chip *nand) > +{ > + struct meson_nfc_nand_chip *meson_chip = to_meson_nand(nand); > + struct meson_nand_ecc meson_ecc[] = { > + MESON_ECC_DATA(NFC_ECC_BCH8_1K, 8), > +

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-18 Thread Boris Brezillon
On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: > From: Liang Yang > > Add initial support for the Amlogic NAND flash controller which found > in the Meson-GXBB/GXL/AXG SoCs. > > Signed-off-by: Liang Yang > Signed-off-by: Yixun Lan > Signed-off-by: Jianxin Pan > --- >

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-18 Thread Boris Brezillon
On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: > From: Liang Yang > > Add initial support for the Amlogic NAND flash controller which found > in the Meson-GXBB/GXL/AXG SoCs. > > Signed-off-by: Liang Yang > Signed-off-by: Yixun Lan > Signed-off-by: Jianxin Pan > --- >

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-18 Thread Boris Brezillon
On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: > +static int meson_nfc_exec_op(struct nand_chip *chip, > + const struct nand_operation *op, bool check_only) > +{ > + struct mtd_info *mtd = nand_to_mtd(chip); > + struct meson_nfc *nfc =

Re: [PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-18 Thread Boris Brezillon
On Thu, 18 Oct 2018 13:09:05 +0800 Jianxin Pan wrote: > +static int meson_nfc_exec_op(struct nand_chip *chip, > + const struct nand_operation *op, bool check_only) > +{ > + struct mtd_info *mtd = nand_to_mtd(chip); > + struct meson_nfc *nfc =

[PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-17 Thread Jianxin Pan
From: Liang Yang Add initial support for the Amlogic NAND flash controller which found in the Meson-GXBB/GXL/AXG SoCs. Signed-off-by: Liang Yang Signed-off-by: Yixun Lan Signed-off-by: Jianxin Pan --- drivers/mtd/nand/raw/Kconfig | 10 + drivers/mtd/nand/raw/Makefile |1 +

[PATCH v5 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller

2018-10-17 Thread Jianxin Pan
From: Liang Yang Add initial support for the Amlogic NAND flash controller which found in the Meson-GXBB/GXL/AXG SoCs. Signed-off-by: Liang Yang Signed-off-by: Yixun Lan Signed-off-by: Jianxin Pan --- drivers/mtd/nand/raw/Kconfig | 10 + drivers/mtd/nand/raw/Makefile |1 +