解决方案
Yes, with some minor modifications to the FSBL source code to disable the DDR initialization, you can execute the FSBL on a DDR-less system.
The steps to do so are as follows:
For SDK 14.5
- In SDK, create the FSBL.
- Once the FSBL is created, make the following modifications:
- Remove all references to the DDR initialization by commenting out lines 11973,12072,12094,12102 and 12110 in ps7_init.c in the FSBL src folder in SDK.
For SDK 14.6/14.7
- In SDK, create the FSBL. Once the FSBL is created, make the following modifications:
- Add the following lines to line 225 in fsbl.h:
#define XPAR_PS7_DDR_0_S_AXI_BASEADDR 0x00100000 /*dummy base address */
#define XPAR_PS7_DDR_0_S_AXI_HIGHADDR 0x3FFFFFFF /*dummy high address */
- Comment out the call the ps7_ddr_init_data in the ps7_init.c file in the hw_platform folder:
//DDR init
//ret = ps7_config (ps7_ddr_init_data);
//if (ret != PS7_INIT_SUCCESS) return ret;
- Comment out the call to the DDRInitCheck on line 264 of main.c:
//Status = DDRInitCheck();
- Comment out the FsblFallback() on lines 332, and 341 of image_mover.c if loading the application outside of the DDR range.
- Once all the changes are made, create a simple Test application in SDK.
- Place all the sections of the FSBL in ps7_ram_0_S_AXI_BASEADDR:
- Place all the sections of the Application in ps7_ram_1_S_AXI_BASEADDR:
- Clean the complete Project.
Next, create the boot Image using Bootgen, and program the QSPI, or the SD card.
When the QSPI/SD Card is programmed, press the POR_B button on the board, and monitor the serial port.
As a further check, open XMD and try accessing the DDR using the commands below:
XMD% connect arm hw
XMD% stop
XMD% mrd 0x00100000
This should error out, as the DDR is not connected.
Attached to this answer record is a workspace from 14.6, targeting the ZC702 with the changes mentioned above.
Note: if the QSPI is greater than 16MB and if all of the boot code fits into the lower 16MB, then in qspi.c (located in the fsbl application source directory), the following line can be added in the FlashReadID function in qspi.c.
At the end of the "Deduce flash size" code block, before "return XST_SUCCESS" add the following line:
QspiFlashSize = FLASH_SIZE_128M;
This is necessary because to run with no DDR, the QSPI must be in linear mode.
For SDK 2014.4:
1. Create your design in Vivado, do NOT uncheck the "Enable DDR" box, the DDR will be removed in SDK.
2. In SDK edit the ps7_init.c in the hardware definition folder by removing all references to DDR initialization.
This is done by commenting out lines around 13413:
// DDR init
//ret = ps7_config (ps7_ddr_init_data);
//if (ret != PS7_INIT_SUCCESS) return ret;
Also comment lines 13380, 13389, and 13396.
3. In SDK create an FSBL.
4. In main.c comment out line 294:
// Status = DDRInitCheck();
5. In image_mover.c comment out the FsblFallBack() calls in the "load address check" section (line 417 and 425).
6. Place all the sections of the FSBL in ps7_ram_0_S_AXI_BASEADDR:
7. Place all the sections of the Application in ps7_ram_1_S_AXI_BASEADDR:
8. Clean the complete Project.
Next, create the boot Image using Bootgen, and program the QSPI, or the SD card.
When the QSPI/SD Card is programmed, press the POR_B button on the board, and monitor the serial port.