cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
855 Views
Registered: ‎09-10-2018

Zynq-7000 - Initialize BRAM from FSBL.

In this post @ryserp mentioned that a Zynq can execute code from BRAM.

Does this indicate that the BRAM can be used in place of DDR by the FSBL to hold the application?

If so, could someone provide some pointers on how to do that?

 

0 Kudos
9 Replies
Highlighted
Contributor
Contributor
840 Views
Registered: ‎09-10-2018

Re: Zynq-7000 FSBL load and execute application from BRAM.

Did some testing where an application was set to only use BRAM. Surprise surprise, it didn't work out.

I found the following in image_mover.c:

if ((PSPartitionFlag == 1) && (PartitionLoadAddr < DDR_START_ADDR)) {
	if ((PartitionLoadAddr == 0) &&
			(!((SignedPartitionFlag == 1) ||
					(EncryptedPartitionFlag == 1)))) {
		break;
	} else {
		fsbl_printf(DEBUG_GENERAL,
				"INVALID_LOAD_ADDRESS_FAIL\r\n");
		OutputStatus(INVALID_LOAD_ADDRESS_FAIL);
		FsblFallback();
	}
}

if (PSPartitionFlag && (PartitionLoadAddr > DDR_END_ADDR)) {
	fsbl_printf(DEBUG_GENERAL,
			"INVALID_LOAD_ADDRESS_FAIL\r\n");
	OutputStatus(INVALID_LOAD_ADDRESS_FAIL);
	FsblFallback();
}

Obviously this stops the FSBL from writing an application to anywhere else than DDR.

I tried commenting that out, which resulted in the FSBL stalling before returning the status 0xA00B = Partition Move Fail. No surprise there.

Now I'm wondering: Can I initialize the BRAM from the FSBL? That should lead me somewhat closer to running my apps off BRAM.

 

0 Kudos
Highlighted
Moderator
Moderator
759 Views
Registered: ‎03-19-2014

Re: Zynq-7000 FSBL load and execute application from BRAM.

If you want to initialize BRAM in the FSBL it has to be after the PL is configured.   Look at this WIKI, maybe it'll help you out.

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Contributor
Contributor
748 Views
Registered: ‎09-10-2018

Re: Zynq-7000 FSBL load and execute application from BRAM.

Exactly. I see that the FSBL has some hooks, including

u32 FsblHookAfterBitstreamDload(void)

which I thought I could use for BRAM initalization.

I was wondering though, is it necessary to do any initialization of BRAM at all? I've used BRAM before and can't remember having to do much initialization.

0 Kudos
Highlighted
Moderator
Moderator
738 Views
Registered: ‎03-19-2014

Re: Zynq-7000 - Initialize BRAM from FSBL.

What are you trying to put in BRAM?   Typically the FSBL is used to load the elf into BRAM.

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Contributor
Contributor
733 Views
Registered: ‎09-10-2018

Re: Zynq-7000 - Initialize BRAM from FSBL.

I'm looking into a few different solutions for a DDR-less design using both ARM Cores and the PL of the Zynq-7000.

In this case, I am trying to load the PS application.elfs into the BRAM and executing from the BRAM.

0 Kudos
Highlighted
Moderator
Moderator
727 Views
Registered: ‎03-19-2014

Re: Zynq-7000 - Initialize BRAM from FSBL.

That would be done by an elf from the FSBL

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Contributor
Contributor
716 Views
Registered: ‎09-10-2018

Re: Zynq-7000 - Initialize BRAM from FSBL.

How?

In my second post of this thread I show the code where the default FSBL does not allow a PS Partition to be written anywhere else than to DDR.

Also in the second post I tried removing the DDR region guard which causes FSBL partition move to time out.

0 Kudos
Highlighted
Moderator
Moderator
707 Views
Registered: ‎03-19-2014

Re: Zynq-7000 - Initialize BRAM from FSBL.

this is done in the bif  it would contain the FSBL, bitstream, then the elf.   Your elf would be linked to the BRAM

 

//arch = zynq; split = false; format = BIN
the_ROM_image:
{
[bootloader]fsbl.elf
base_zynq_wrapper.bit
bram_code.elf
}

 

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
672 Views
Registered: ‎10-11-2011

Re: Zynq-7000 - Initialize BRAM from FSBL.

Be sure the PL is accessible from the PS when FSBL is loading the .elf.

In past releases we saw this https://www.xilinx.com/support/answers/55488.html

I am not sure if it's still applicable.

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos