Re: [PATCH] mtd: nand: Allow full NAND framework in SPL

2023-04-17 Thread Dario Binacchi
Hi Jit,

On Fri, Oct 21, 2022 at 5:24 AM Jagan Teki  wrote:
>
> On Mon, Sep 5, 2022 at 7:41 PM Jit Loon Lim  wrote:
> >
> > From: Tien Fong Chee 
> >
> > Add configuration option to compile the entire NAND framework into
> > U-Boot SPL. This is required by some drivers, like the Denali NAND,
> > which use a lot of functionality from the NAND core.
> >
> > Signed-off-by: Marek Vasut 
> > Signed-off-by: Tien Fong Chee 
> > Signed-off-by: Jit Loon Lim 
> > ---
>
> + MTD mainatainers

There are already other implementations like this in u-boot for
different platforms.
The idea is to remove this code and implement a more generic
management so as not
to replicate code.
Could you please change your implementation to a more generic version?

Thanks and regards,
Dario

-- 

Dario Binacchi

Senior Embedded Linux Developer

dario.binac...@amarulasolutions.com

__


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
i...@amarulasolutions.com

www.amarulasolutions.com


Re: [PATCH] mtd: nand: Allow full NAND framework in SPL

2022-10-20 Thread Jagan Teki
On Mon, Sep 5, 2022 at 7:41 PM Jit Loon Lim  wrote:
>
> From: Tien Fong Chee 
>
> Add configuration option to compile the entire NAND framework into
> U-Boot SPL. This is required by some drivers, like the Denali NAND,
> which use a lot of functionality from the NAND core.
>
> Signed-off-by: Marek Vasut 
> Signed-off-by: Tien Fong Chee 
> Signed-off-by: Jit Loon Lim 
> ---

+ MTD mainatainers


[PATCH] mtd: nand: Allow full NAND framework in SPL

2022-09-05 Thread Jit Loon Lim
From: Tien Fong Chee 

Add configuration option to compile the entire NAND framework into
U-Boot SPL. This is required by some drivers, like the Denali NAND,
which use a lot of functionality from the NAND core.

Signed-off-by: Marek Vasut 
Signed-off-by: Tien Fong Chee 
Signed-off-by: Jit Loon Lim 
---
 drivers/mtd/nand/raw/Kconfig  |  7 +++
 drivers/mtd/nand/raw/Makefile | 16 +---
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
index ce67d1abde..a3bd45f24e 100644
--- a/drivers/mtd/nand/raw/Kconfig
+++ b/drivers/mtd/nand/raw/Kconfig
@@ -694,4 +694,11 @@ config SPL_NAND_SIMPLE
  expose the cmd_ctrl() interface.
 endif
 
+config SPL_NAND_FRAMEWORK
+   bool "Compile the entire NAND framework into the SPL"
+   help
+ Some drivers require a lot of functionality from the NAND framework
+ core when used in SPL. This option allows compiling the full NAND
+ framework into the SPL instead of it's reduced version.
+
 endif   # if NAND
diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile
index a398aa9d88..e0f7045fec 100644
--- a/drivers/mtd/nand/raw/Makefile
+++ b/drivers/mtd/nand/raw/Makefile
@@ -3,8 +3,16 @@
 # (C) Copyright 2006
 # Wolfgang Denk, DENX Software Engineering, w...@denx.de.
 
+nand-framework-objs := nand.o nand_bbt.o nand_ids.o nand_util.o \
+   nand_ecc.o nand_base.o nand_timings.o
+
 ifdef CONFIG_SPL_BUILD
 
+ifdef CONFIG_SPL_NAND_FRAMEWORK
+obj-y += $(nand-framework-objs)
+NORMAL_DRIVERS=y
+endif
+
 ifdef CONFIG_SPL_NAND_DRIVERS
 NORMAL_DRIVERS=y
 endif
@@ -27,19 +35,13 @@ else # not spl
 
 NORMAL_DRIVERS=y
 
-obj-y += nand.o
-obj-y += nand_bbt.o
-obj-y += nand_ids.o
-obj-y += nand_util.o
-obj-y += nand_ecc.o
-obj-y += nand_base.o
 obj-y += nand_amd.o
 obj-y += nand_hynix.o
 obj-y += nand_macronix.o
 obj-y += nand_micron.o
 obj-y += nand_samsung.o
 obj-y += nand_toshiba.o
-obj-y += nand_timings.o
+obj-y += $(nand-framework-objs)
 
 endif # not spl
 
-- 
2.26.2