[U-Boot] [PATCH] ARM: socfpga: Remove socfpga_sdram_apply_static_cfg()

Nico Becker n.becker at ic-automation.de
Thu Feb 6 15:13:40 CET 2020

Am 06.02.2020 um 14:00 schrieb Marek Vasut:
> On 2/6/20 1:57 PM, Nico Becker wrote:
>> Am 06.02.2020 um 12:53 schrieb Marek Vasut:
>>> On 2/6/20 11:50 AM, Nico Becker wrote:
>>>> Hello,
>>> Hi,
>>>> after removing the function socfpga_sdram_apply_static_cfg() in
>>>> misc_gen5 we can not use the FPGA2SDRAM bridge.
>>>> Without the apply static cfg the kernel crash every time,
>>>> if we try to write @ the fpga2sdram bridge. After an soft reset
>>>> everything is working.
>>>> If we add the socfpga_sdram_apply_static_cfg() in the
>>>> u-boot source code, everything is fine.
>>>> Now we can use the fpga2sdram bridge after power on.
>>>> Our setup:
>>>> - u-boot v2020.01
>>>>     - load and write fpga firmware
>>>>     - enable bridges
>>>> - boot linux
>>>> I have found some information at
>>>> <https://support.criticallink.com/redmine/projects/mityarm-5cs/wiki/Important_Note_about_FPGAHPS_SDRAM_Bridge>
>>>> <http://u-boot.10912.n7.nabble.com/WG-Linux-hang-td314276.html>
>>> Can you send a patch which fixes this for you, with Fixes: tag ?
>>> Then it would be clear what you changed.
>>> Thanks
>> Hello,
>> the code was removed @ commit c5f4b805.
> Did you read the commit message of that commit and what problem that was
> solving ? Clearly, reverting the commit isn't the way to go. We need to
> find a way to unbreak this for you, while not break other platforms.
>> I attached my patch, sorry for the format, i am new in this.
> [...]
yes i read the commit message.

but i found no other option to enable the sdram bridges,
without crashes/hanging up linux, with the removed source code.

i ve found some more information @intel

Intel talk about an bridge_enable_handoff in my opionion
the cmd set the sram aply cfg

/* add signle command to enable all bridges based on handoff */
	"mw $fpgaintf ${fpgaintf_handoff}; "
	"go $fpga2sdram_apply; "
	"mw $fpga2sdram ${fpga2sdram_handoff}; "
	"mw $axibridge ${axibridge_handoff}; "
	"mw $l3remap ${l3remap_handoff} ");

setenv_addr("fpga2sdram_apply", (void *)sdram_applycfg_uboot);

  * Relocate the sdram_applycfg_ocram function to OCRAM and call it
	PUSH	{r4-r11, lr}		/* save registers per AAPCS */

	ldr	r1, =sdram_applycfg_ocram
	mov	r3, r2
	ldmia	r1!, {r4 - r11}
	stmia	r3!, {r4 - r11}
	ldmia	r1!, {r4 - r11}		/* copy more in case code added */
	stmia	r3!, {r4 - r11}		/* in the future */
	ldmia	r1!, {r4 - r11}		/* copy more in case code added */
	stmia	r3!, {r4 - r11}		/* in the future */
	blx	r2			/* jump to OCRAM */
	POP	{r4-r11, pc}

it could be an option to write the fpga firmware with u-boot,
and do a soft reset.
boot u-boot
check fpga configuration state
not configured write firmware reset
if configured boot linux

i ll check howto to determine the fpga configuration state
and try this.


Nico Becker
ic-automation GmbH
Alexander-Diehl-Straße 2a
D-55130 Mainz

Tel:    +49-(0)6131-62718-24
Fax:    +49-(0)6131-62718-10
email:  n.becker at ic-automation.de
Web:    http://www.ic-automation.de

Geschäftsführer: Dr. Stefan Becker
HRB 7283, Amtsgericht Mainz

More information about the U-Boot mailing list