mtd: nand: lpc32xx mlc: predefine number of NAND chips to support
Subsystems (3)
Vladimir Zapolskiy
maintainerPATCH 1/1 mtd: nand: lpc32xx mlc: predefine number of NAND chips to support
Build option CONFIG_SYS_MAX_NAND_CHIPS is used by NXP LPC32xx NAND MLC driver only, as a preparation for potential removal or replacement of the option the change predefines CONFIG_SYS_MAX_NAND_CHIPS to 1, same value is used by the single user Work Microwave Work 92105 board, thus it will be safe now to remove the option as a board specific one.
--- drivers/mtd/nand/raw/lpc32xx_nand_mlc.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/mtd/nand/raw/lpc32xx_nand_mlc.c +4 -0
@@ -82,6 +82,10 @@ struct lpc32xx_nand_mlc_registers {static struct lpc32xx_nand_mlc_registers __iomem *lpc32xx_nand_mlc_registers = (struct lpc32xx_nand_mlc_registers __iomem *)MLC_NAND_BASE ; +#if !defined(CONFIG_SYS_MAX_NAND_CHIPS ) +#define CONFIG_SYS_MAX_NAND_CHIPS 1 +#endif +#define clkdiv (v, w, o) (((1+(clk/v)) & w) << o)/**
Signature · 1 line
2.17.1
Miquel Raynal
maintainerPATCH 1/1 mtd: nand: lpc32xx mlc: predefine number of NAND chips to support
Hi Vladimir,
Vladimir Zapolskiy <[email protected]> wrote on Fri, 19 Oct 2018 03:21:05 +0300:
Quoted 16 lines
Build option
CONFIG_SYS_MAX_NAND_CHIPSis used by NXP LPC32xx NAND MLC driver only, as a preparation for potential removal or replacement of the option the change predefinesCONFIG_SYS_MAX_NAND_CHIPSto 1, same value is used by the single user Work Microwave Work 92105 board, thus it will be safe now to remove the option as a board specific one.Signed-off-by Vladimir Zapolskiy <[email protected]>--- drivers/mtd/nand/raw/lpc32xx_nand_mlc.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/mtd/nand/raw/lpc32xx_nand_mlc.c +0
-0
drivers/mtd/nand/raw/lpc32xx_nand_mlc.c struct lpc32xx_nand_mlc_registers { · line 91
Quoted 10 lines
drivers/mtd/nand/raw/lpc32xx_nand_mlc.c +4
-0@@ -82,6 +82,10 @@ struct lpc32xx_nand_mlc_registers {static struct lpc32xx_nand_mlc_registers __iomem *lpc32xx_nand_mlc_registers = (struct lpc32xx_nand_mlc_registers __iomem *)MLC_NAND_BASE ; +#if !defined(CONFIG_SYS_MAX_NAND_CHIPS ) +#define CONFIG_SYS_MAX_NAND_CHIPS 1 +#endif +#define clkdiv (v, w, o) (((1+(clk/v)) & w) << o)/**
If it is safe now, can you also remote the CONFIG_ option now?
Thanks,
Miquèl
Vladimir Zapolskiy
maintainerPATCH 1/1 mtd: nand: lpc32xx mlc: predefine number of NAND chips to support
Hi Miquel,
Quoted 30 lines · Miquel Raynal
Hi Vladimir,
Vladimir Zapolskiy <[email protected]> wrote on Fri, 19 Oct 2018 03:21:05 +0300:
Quoted 25 lines
Build option
CONFIG_SYS_MAX_NAND_CHIPSis used by NXP LPC32xx NAND MLC driver only, as a preparation for potential removal or replacement of the option the change predefinesCONFIG_SYS_MAX_NAND_CHIPSto 1, same value is used by the single user Work Microwave Work 92105 board, thus it will be safe now to remove the option as a board specific one.Signed-off-by Vladimir Zapolskiy <[email protected]>--- drivers/mtd/nand/raw/lpc32xx_nand_mlc.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/mtd/nand/raw/lpc32xx_nand_mlc.c +4
-0@@ -82,6 +82,10 @@ struct lpc32xx_nand_mlc_registers {static struct lpc32xx_nand_mlc_registers __iomem *lpc32xx_nand_mlc_registers = (struct lpc32xx_nand_mlc_registers __iomem *)MLC_NAND_BASE ; +#if !defined(CONFIG_SYS_MAX_NAND_CHIPS ) +#define CONFIG_SYS_MAX_NAND_CHIPS 1 +#endif +#define clkdiv (v, w, o) (((1+(clk/v)) & w) << o)
Quoted 4 lines
drivers/mtd/nand/raw/lpc32xx_nand_mlc.c struct lpc32xx_nand_mlc_registers { · line 91
Quoted 1 line
drivers/mtd/nand/raw/lpc32xx_nand_mlc.c +0
-0/** If it is safe now, can you also remote the
CONFIG_option now?
At the moment I plan to remove the CONFIG_SYS_MAX_NAND_CHIPS option from include/configs/work_92105.h as a side activity (concentrate all LPC32xx raw NAND options in arch/arm/include/asm/arch-lpc32xx/config.h, the change is in my queue), and regarding total removal of the option, it shall be considered separately.
For instance you can find it is mentioned in doc/README.nand :
if (nand_scan_ident(mtd, CONFIG_SYS_MAX_NAND_CHIPS, NULL))
error out
and commonly it would be expected to provide it as an argument to nand_scan_ident(), however it is easy to notice that none drivers but LPC32xx NAND MLC does it. Also note that sometimes NAND *chips* number is substituted by a number of NAND *controllers* on SoC...
Generally it sounds like a proper change should be a tree-wide one.
So, while I clearly understand the rationale, I would prefer to shift the task to the MTD maintainers ;)
Quoted 2 lines
Reviewed-by Miquel Raynal <[email protected]>
Thank you for review!
--
Best wishes,
Vladimir
Quoted 8 lines · Vladimir Zapolskiy
Build option
CONFIG_SYS_MAX_NAND_CHIPSis used by NXP LPC32xx NAND MLC driver only, as a preparation for potential removal or replacement of the option the change predefinesCONFIG_SYS_MAX_NAND_CHIPSto 1, same value is used by the single user Work Microwave Work 92105 board, thus it will be safe now to remove the option as a board specific one.Signed-off-by Vladimir Zapolskiy <[email protected]>Reviewed-by Miquel Raynal <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181117/a30ab668/attachment.sig>