public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-Boot, v6, 2/2] common: Generic firmware loader for file system
Date: Thu, 18 Jan 2018 08:18:44 -0500	[thread overview]
Message-ID: <20180118131844.GK4660@bill-the-cat> (raw)
In-Reply-To: <1516246934.2704.7.camel@intel.com>

On Thu, Jan 18, 2018 at 03:42:14AM +0000, Chee, Tien Fong wrote:
> On Tue, 2018-01-16 at 09:35 -0500, Tom Rini wrote:
> > On Tue, Jan 16, 2018 at 07:58:00AM +0000, Chee, Tien Fong wrote:
> > > 
> > > On Mon, 2018-01-15 at 11:36 -0500, Tom Rini wrote:
> > > > 
> > > > On Wed, Dec 27, 2017 at 01:04:38PM +0800, tien.fong.chee at intel.co
> > > > m
> > > > wrote:
> > > > 
> > > > > 
> > > > > 
> > > > > From: Tien Fong Chee <tien.fong.chee@intel.com>
> > > > > 
> > > > > 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 <tien.fong.chee@intel.com>
> > > > Please add Lothar's Reviewed-by for v7.  There's a number of
> > > > minor
> > > > checkpatch.pl issues that checkpatch.pl can in turn fixup itself,
> > > > please
> > > > correct them.
> > > > 
> > > I have ran the checkpatch.pl on this patch, i didn't see any error.
> > When I ran it, it was pointing out cases where you have:
> > if (foo->bar != NULL)
> > when you can just use:
> > if (foo->bar)
> > 
> It's weird for checkpatch.pl not showing the same. I would fix the code
> with above example.

That is odd.  Are you running it from within the U-Boot tree?

> > [snip]
> > > 
> > > > 
> > > > > 
> > > > > diff --git a/common/fs_loader.c b/common/fs_loader.c
> > > > > new file mode 100644
> > > > > index 0000000..56d29b6
> > > > > --- /dev/null
> > > > > +++ b/common/fs_loader.c
> > > > > @@ -0,0 +1,309 @@
> > > > > +/*
> > > > > + * Copyright (C) 2017 Intel Corporation <www.intel.com>
> > > > > + *
> > > > > + * SPDX-License-Identifier:    GPL-2.0
> > > > > + */
> > > > > +
> > > > > +#include <common.h>
> > > > > +#include <errno.h>
> > > > > +#include <fs.h>
> > > > > +#include <fs_loader.h>
> > > > > +#include <nand.h>
> > > > > +#include <sata.h>
> > > > > +#include <spi.h>
> > > > > +#include <spi_flash.h>
> > > > > +#include <spl.h>
> > > > This wants <asm/spl.h> which is not globally available, so you
> > > > need
> > > > to
> > > > come up with something here.  At least making this Kconfig-
> > > > enabled
> > > > will
> > > > be a start and perhaps OK for now.
> > > > 
> > > I can enable the Kconfig, and put the caution about dependency on
> > > <asm/spl.h> in document.
> > Well, you need to make that part of the code depend on CONFIG_SPL as
> > SPL
> > support requires <asm/spl.h> to exist.   Perhaps part of the code
> > needs
> > to be refactored to more easily deal with SPL not always being
> > present?
> > 
> How about i just move the whole enum { } from line 17 to line 35 in
> asm/spl.h to fs.h, and then enum{} above replaced with #include <fs.h>?
> 
> asm/spl.h
> ----------
> #if defined(CONFIG_ARCH_OMAP2PLUS) \
> 	|| defined(CONFIG_EXYNOS4) || defined(CONFIG_EXYNOS5) \
> 	|| defined(CONFIG_EXYNOS4210)
> /* Platform-specific defines */
> #include <asm/arch/spl.h>
> 
> #else
> #include <fs.h>  <-- replacement
> #endif
> [...]

No, because that's still arch specific code and will blow up some
platforms that do not have asm/spl.h at all and is still non-portable
(look at the various asm/spl.h files that do exist for how
BOOT_DEVICE_xxx is handled in different places).

It's OK to restructure your code to have:
#ifdef CONFIG_SPL
#include <spl.h>
... SPL specific functions
#endif

-- 
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/20180118/0ff5993c/attachment.sig>

  reply	other threads:[~2018-01-18 13:18 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-27  5:04 [U-Boot] [PATCH v6 0/2] Generic firmware loader tien.fong.chee at intel.com
2017-12-27  5:04 ` [U-Boot] [PATCH v6 1/2] spl: Remove static declaration on spl_mmc_find_device function tien.fong.chee at intel.com
2018-01-15 16:35   ` [U-Boot] [U-Boot, v6, " Tom Rini
2017-12-27  5:04 ` [U-Boot] [PATCH v6 2/2] common: Generic firmware loader for file system tien.fong.chee at intel.com
2018-01-15 16:36   ` [U-Boot] [U-Boot, v6, " Tom Rini
2018-01-16  7:58     ` Chee, Tien Fong
2018-01-16 14:35       ` Tom Rini
2018-01-18  3:42         ` Chee, Tien Fong
2018-01-18 13:18           ` Tom Rini [this message]
2018-01-22  6:37             ` Chee, Tien Fong
2018-01-16 14:41   ` [U-Boot] [PATCH v6 " Marek Vasut
2018-01-18  4:33     ` Chee, Tien Fong
2018-01-18 11:12       ` Marek Vasut
2018-01-22  7:11         ` Chee, Tien Fong
2018-01-22  8:44           ` Lothar Waßmann
2018-01-23  4:28             ` Chee, Tien Fong
2018-01-22 12:41           ` Marek Vasut
2018-01-18  5:57   ` Simon Goldschmidt
2018-01-22  8:08     ` Chee, Tien Fong
2018-01-22 11:41       ` Simon Goldschmidt
2018-01-23  6:28         ` Chee, Tien Fong
2018-01-23  7:52           ` Simon Goldschmidt
2018-01-23  7:58   ` Simon Goldschmidt
2018-01-23  8:31     ` Chee, Tien Fong
2018-01-23  9:13       ` Simon Goldschmidt
2018-01-24  5:13         ` Chee, Tien Fong
2018-01-24  5:34           ` Simon Goldschmidt
2018-01-03  8:46 ` [U-Boot] [PATCH v6 0/2] Generic firmware loader Chee, Tien Fong
2018-01-08  8:07   ` Lothar Waßmann
2018-01-09  5:26     ` Chee, Tien Fong
2018-01-15  6:57     ` Chee, Tien Fong
2018-01-15  6:50 ` Chee, Tien Fong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180118131844.GK4660@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox