From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Agner Date: Mon, 14 Nov 2016 14:44:00 -0800 Subject: [U-Boot] [PATCH v2 1/3] spl: add RAM boot device only if it is actually defined In-Reply-To: References: <20161112191308.22185-1-stefan@agner.ch> <20161112191308.22185-2-stefan@agner.ch> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 2016-11-14 12:44, Simon Glass wrote: > Hi Stefan, > > On 12 November 2016 at 12:13, Stefan Agner wrote: >> From: Stefan Agner >> >> Some devices (e.g. dra7xx) support loading to RAM using DFU without >> having direct boot from RAM support. Make sure the linker list >> does not contain BOOT_DEVICE_RAM if CONFIG_SPL_RAM_SUPPORT is not >> enabled. >> >> Fixes: 98136b2f26fa ("spl: Convert spl_ram_load_image() to use linker list") >> >> Signed-off-by: Stefan Agner >> --- >> >> Changes in v2: >> - Use CONFIG_SPL_RAM_SUPPORT to descide whether to compile the >> function in first place. >> >> common/spl/spl.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) > > Instead of this, how about moving it into its own file and putting > that condition in the Makefile? Generally a good idea. What I don't like to much that we have two orthogonal config options using that same function... We probably should have something like: CONFIG_SPL_RAM_SUPPORT CONFIG_SPL_RAM_ONLY_SUPPORT depends on CONFIG_SPL_RAM_SUPPORT CONFIG_SPL_DFU_SUPPORT depends on CONFIG_SPL_RAM_SUPPORT Then we could use a single config option (CONFIG_SPL_RAM_SUPPORT) for the new file. However, that is beyond bug fixing, and I'd rather prefer to have it in a separate patch, what do you think? -- Stefan