From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chee, Tien Fong Date: Thu, 1 Feb 2018 07:06:28 +0000 Subject: [U-Boot] [PATCH v7 3/3] common: Generic firmware loader for file system In-Reply-To: References: <1517310984-71347-1-git-send-email-tien.fong.chee@intel.com> <1517310984-71347-4-git-send-email-tien.fong.chee@intel.com> Message-ID: <1517468787.2520.2.camel@intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de On Tue, 2018-01-30 at 13:12 +0100, Marek Vasut wrote: > On 01/30/2018 12:16 PM, tien.fong.chee at intel.com wrote: > > > > From: Tien Fong Chee > > > > This is file system generic loader which can be used to load > > the file image from the storage into target such as memory. > > The consumer driver would then use this loader to program whatever, > > ie. the FPGA device. > > > > Signed-off-by: Tien Fong Chee > > Reviewed-by: Lothar Waßmann > > --- > >  common/Kconfig             |   9 ++ > >  common/Makefile            |   1 + > >  common/fs_loader.c         | 326 > > +++++++++++++++++++++++++++++++++++++++++++++ > >  doc/README.firmware_loader |  76 +++++++++++ > >  include/fs_loader.h        |  28 ++++ > >  5 files changed, 440 insertions(+) > >  create mode 100644 common/fs_loader.c > >  create mode 100644 doc/README.firmware_loader > >  create mode 100644 include/fs_loader.h > [...] > > > > > +#ifdef CONFIG_CMD_UBIFS > > +static int mount_ubifs(struct device_location *location) > > +{ > > + int ret; > > + char cmd[32]; > > + > > + snprintf(cmd, sizeof(location->mtdpart), "ubi part %s", > > +  location->mtdpart); > > + > > + ret = run_command(cmd, 0); > Can you call the UBI functions directly instead of invoking the U- > Boot > command parser ? > Okay. > > > > + if (ret) > > + return ret; > > + > > + snprintf(cmd, sizeof(location->ubivol), "ubifsmount %s", > > +  location->ubivol); > > + > > + ret = run_command(cmd, 0); > DTTO here ... > Okay. Could i submit the next version immediately for this minor change? > > > > + return ret; > > +} > > + > > +static int umount_ubifs(void) > > +{ > > + return cmd_ubifs_umount(); > > +} > > +#else > > +static int mount_ubifs(struct device_location *location) > > +{ > > + debug("Error: Cannot load image: no UBIFS support\n"); > > + return -ENOSYS; > > +} > > +#endif > [...]