+ Scott On Thu, Oct 6, 2016 at 1:27 AM, Sergey Kubushyn <k...@koi8.net> wrote: > This one adds nand_bootupdate command for i.MX6 and similar MCUs. It > generates proper NAND boot structures (FCB, DBBT, etc) and writes those > along with U-Boot mx image to where they belong so system would be able > to boot off of raw NAND. > > As of now the only way to do it is by using user-space kobs-ng utility > that has lots of unnecessary bells and whistles and only runs from > Linux so it is impossible to update raw NAND U-Boot from U-Boot itself. > > It does not give any choice for the actual data placement in NAND but > that is done deliberately -- there is no reason to put it anywhere but > the only location i.MX6 Boot ROM expects it to be. > > This is my THIRD attempt to get it into the main U-Boot tree. I do > really hope it would get applied before I retire. > > Signed-off-by: Sergey Kubushyn <k...@koi8.net> > --- > --- a/cmd/Kconfig > +++ b/cmd/Kconfig > @@ -571,6 +571,16 @@ config CMD_TIME > help > Run commands and summarize execution time. > > +config CMD_NAND_BOOTUPDATE > + bool "Update NAND bootloader on iMX6 and its brethen" > + depends on ARCH_MX6 && NAND_BOOT && CMD_NAND > + help > + Having iMX6 NAND U-Boot image in memory creates all necessary > + structures and writes those where they belong along with that > + U-Boot image so system is able to boot off of raw NAND. Kinda > + like kobs-ng utility but simpler. > + > + > # TODO: rename to CMD_SLEEP > config CMD_MISC > bool "sleep" > > --- a/drivers/mtd/nand/Makefile > +++ b/drivers/mtd/nand/Makefile > @@ -67,6 +67,7 @@ obj-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o > obj-$(CONFIG_NAND_OMAP_ELM) += omap_elm.o > obj-$(CONFIG_NAND_PLAT) += nand_plat.o > obj-$(CONFIG_NAND_SUNXI) += sunxi_nand.o > +obj-$(CONFIG_CMD_NAND_BOOTUPDATE) += mxs_nand_bootupdate.o
The command macro couldn't be part of drivers. and also this isn't a common code or separate driver try to add the most of the code in cmd/ if possible separate file (as it is specific to imx) and if something needed to write on drivers/nand better to add in mxc or mxs driver. Jagan. _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot