[U-Boot] [PATCH] arm: socfpga: fix SPL booting from fpga OnChip RAM

Marek Vasut marex at denx.de
Mon Oct 8 13:22:38 UTC 2018


On 10/08/2018 03:17 PM, Simon Goldschmidt wrote:
> On Mon, Oct 8, 2018 at 1:42 PM Marek Vasut <marex at denx.de> wrote:
>>
>> On 10/08/2018 06:04 AM, Simon Goldschmidt wrote:
>>>
>>>
>>> Marek Vasut <marex at denx.de <mailto:marex at denx.de>> schrieb am Mo., 8.
>>> Okt. 2018, 02:20:
>>>
>>>     On 10/07/2018 01:08 PM, Simon Goldschmidt wrote:
>>>     > On 06.10.2018 22:38, Tom Rini wrote:
>>>     >> On Sat, Oct 06, 2018 at 10:33:42PM +0200, Simon Goldschmidt wrote:
>>>     >>
>>>     >>> This patch prevents disabling the FPGA bridges when
>>>     >>> SPL or U-Boot is executed from FPGA onchip RAM.
>>>     >>>
>>>     >>> Signed-off-by: Simon Goldschmidt
>>>     <simon.k.r.goldschmidt at gmail.com
>>>     <mailto:simon.k.r.goldschmidt at gmail.com>>
>>>     >>> ---
>>>     >>>
>>>     >>>
>>>     >>> There are other patches required to make boot from
>>>     >>> FPGA work correctly:
>>>     >>> - CONFIG_SPL_TEXT_BASE needs to be set to 0xC0000000
>>>     >>>    ideally this is done by moving SPL_TEXT_BASE to Kconfig:
>>>     >>>    https://patchwork.ozlabs.org/patch/976918/
>>>     >>> - spl_ram.c needs this patch by Michal Simek:
>>>     >>>    https://patchwork.ozlabs.org/patch/978694/
>>>     >>> - For U-Boot to be run from FPGA onchip RAM, either
>>>     >>>    CONFIG_SYS_EXTRA_ENV_RELOC needs to be used or this patch
>>>     >>>    is required to relocate gd->env_addr:
>>>     >>>    https://patchwork.ozlabs.org/patch/975702/
>>>     >> For the record, I'm currently reviewing the last two parts here.  The
>>>     >> first one will come soon (I do Kconfig migrations separate so I
>>>     can see
>>>     >> a lack of size change).
>>>     >
>>>     >
>>>     > OK, after Tom merged the last to parts, I can confirm I can
>>>     successfully
>>>     > boot from FPGA by adapting CONFIG_SYS_TEXT_BASE via config and hacking
>>>     > CONFIG_SPL_TEXT_BASE to 0xC0000000 (as moving this to Kconfig is still
>>>     > missing).
>>>
>>>     So is this patch still needed ?
>>>
>>>
>>> Yes, sorry for being unclear there.
>>
>> Can we do what this patch does with less ifdeffery ? Maybe with simple
>> if (address > FOO && < bar) remap() ?
> 
> Hmm, I can try, but the change in misc_gen5.c depends on whether we build SPL or
> U-Boot, I'm not sure how to do that without ifdef...
> 
> Does 'if (CONFIG_IS_ENABLED(SPL_BUILD))' work? Does it look nice? It's not
> used anywhere else like that.

That's fine, I had those address range checks in mind.

-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list