[U-Boot] [PATCH v5 24/26] cmd: nand/sf: isolate legacy code

Miquel Raynal miquel.raynal at bootlin.com
Fri Oct 25 17:38:56 UTC 2019


Hi Jagan,

Jagan Teki <jagan at amarulasolutions.com> wrote on Fri, 25 Oct 2019
15:16:38 +0530:

> On Fri, Oct 25, 2019 at 3:06 PM Miquel Raynal <miquel.raynal at bootlin.com> wrote:
> >
> > Hi Jagan,
> >
> > Jagan Teki <jagan at amarulasolutions.com> wrote on Fri, 25 Oct 2019
> > 14:57:36 +0530:
> >  
> > > Hi Miquel,
> > >
> > > On Fri, Oct 25, 2019 at 2:55 PM Miquel Raynal <miquel.raynal at bootlin.com> wrote:  
> > > >
> > > > Hi Jagan,
> > > >
> > > > Jagan Teki <jagan at amarulasolutions.com> wrote on Fri, 25 Oct 2019
> > > > 14:44:38 +0530:
> > > >  
> > > > > On Thu, Oct 3, 2019 at 11:21 PM Miquel Raynal <miquel.raynal at bootlin.com> wrote:  
> > > > > >
> > > > > > The 'sf' command is not supposed to rely on the MTD stack, but both
> > > > > > 'sf' and 'nand' commands use helpers located in mtd_uboot.c. Despite
> > > > > > their location, these functions do not depend at all on the MTD
> > > > > > stack.
> > > > > >
> > > > > > This file (drivers/mtd/mtd_uboot.c) is only compiled if CONFIG_MTD is
> > > > > > selected, which is inconsistent with the current situation. Solve this
> > > > > > by moving these three functions (which are only used by the above two
> > > > > > commands) out of mtd_uboot.c and put them in a C file only compiled
> > > > > > with cmd/sf.c and cmd/nand.c.
> > > > > >
> > > > > > Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
> > > > > > ---
> > > > > >  cmd/Makefile            |  3 ++
> > > > > >  cmd/legacy-mtd-utils.c  | 99 +++++++++++++++++++++++++++++++++++++++++
> > > > > >  cmd/legacy-mtd-utils.h  | 14 ++++++
> > > > > >  cmd/nand.c              |  2 +
> > > > > >  cmd/sf.c                |  2 +
> > > > > >  drivers/mtd/mtd_uboot.c | 94 --------------------------------------  
> > > > >
> > > > > Better to drop CMD_SF, CMD_NAND in makefile so-that it can't build
> > > > > this file in this patch.  
> > > >
> > > > I don't understand what you mean. Can you please detail what you have
> > > > in mind for this patch?
> > > >
> > > > Is it something blocking for you? Or is it something that should be
> > > > taken care of after?  
> > >
> > > I think it is simple rebase, this patch is moving code from
> > > mtd_uboot.c to legacy-mtd-utils.c but mtd_uboot still building. I'm
> > > saying to make change on drivers/mtd/Makefile to drop SF, NAND
> > > dependency.  
> >
> > What do you mean by "mtd_uboot still building"? Do you mean it is a
> > problem? Or did I forgot something?
> >
> > I don't see what CMD_SF/CMD_NAND dependency you are referring to. Can
> > you please share a snippet of code?  
> 
> -ifneq (,$(findstring
> y,$(CONFIG_MTD_DEVICE)$(CONFIG_CMD_NAND)$(CONFIG_CMD_ONENAND)$(CONFIG_CMD_SF)$(CONFIG_CMD_MTD)))
> +ifneq (,$(findstring
> y,$(CONFIG_MTD_DEVICE)$(CONFIG_CMD_ONENAND)$(CONFIG_CMD_MTD)))
>  obj-y += mtdcore.o mtd_uboot.o
>  endif
>  obj-$(CONFIG_MTD) += mtd-uclass.o


Indeed! Thanks for the clarification.
Please apply patches 1 to 23 of this series, I am resending 24-26
corrected.

Thanks,
Miquèl


More information about the U-Boot mailing list