Not work!
In
http://www.rocketboards.org/foswiki/documentation/preloaderubootcustomization I read:
--- Quote Start ---
HPS Boot Flow The typical HPS boot flow includes the following stages: 1. BootROM. 2. Preloader. 3. U-Boot. 4. Linux.
The BootROM and the Preloader stages are needed for all the applications in which the Cyclone V or Arria V SoCs are used.
The U-Boot and Linux are used by the GSRD, but they are not required for all applications.
The next stage boot image loaded and executed by the Preloader does not necessarily needs to be an U-boot image. For example the Preloader can:
* Load bare-metal applications directly,
* Load RTOS-es or OS-es directly,
* Load another bootloader that can subsequently load the applications.
The only requirement is that the next stage image has the proper mkimage header, that is required for U-boot to recognize the image.
--- Quote End ---
I download cv_soc_devkit_ghrd.tar.gz from
http://releases.rocketboards.org/release/2013.11/gsrd/ghrd, unzip it to
T:\Wit\DS-5\gsrd\cv_soc_devkit_ghrd\, make all "GSRD - Generating and Compiling the Preloader" (
http://www.rocketboards.org/foswiki/documentation/gsrdpreloader), only on Windows 7 and with check option BOOT_FROM_QSPI instead BOOT_FROM_SDMMC or BOOT_FROM_RAM, address QSPI_NEXT_BOOT_IMAGE default set to 0x60000.
After generate and compile all preloaders with call "make" in folder T:/Wit/DS-5/gsrd/cv_soc_devkit_ghrd/software/spl_bsp, result is in preloader-mkpimage.bin ("Preloader image with the BootROM required header"), need to fill in QSPI flash.
I set jumpers to boot from QSPI as
http://www.rocketboards.org/foswiki/documentation/gsrdqspiprogram:
J28 right shorted J29 left shorted J30 left shorted
and rePowrer board.
Intuitively add to Makefile from standard blinking project Altera-SoCFPGA-HardwareLib-FPGA-CV-GNU imported to DS-5 from
C:\altera\13.1\embedded\examples\software\Altera-SoCFPGA-HardwareLib-16550-CV-GNU.tar.gz in making target "$(ELF):" 2 lines:
./objcopy --gap-fill=0xff -O binary hwlib.axf hwlib.bin
./mkimage -A arm -O u-boot -T standalone -C none -a 0x02000000 -e 0x02000000 -n "baremetal image"
-d hwlib.bin T:/Wit/DS-5/gsrd/cv_soc_devkit_ghrd/software/spl_bsp/hwlib.img.bin
to add embedded functionality, fast making binary flash-image from output file hwlib.axf and put result in preloader output folder. It is right in all options ? This may contain errors of flow comprehension.
Near preloader-mkpimage.bin in folder T:/Wit/DS-5/gsrd/cv_soc_devkit_ghrd/software/spl_bsp I create file
2qspi.sh with:
quartus_hps -c 1 -o PV -a 0 preloader-mkpimage.bin
quartus_hps -c 1 -o PV -a 0x60000 hwlib.img.bin
and run it on SoC EDS console with kit, waits 12 min, rePower -- only U-Boot-spl is started:
U-Boot SPL 2013.01.01 (May 16 2014 - 11:19:27)
BOARD : Altera SOCFPGA Cyclone V Board
SDRAM: Initializing MMR registers
SDRAM: Calibrating PHY
SEQ.C: Preparing to start memory calibration
SEQ.C: CALIBRATION PASSED
SF: Read data capture delay calibrated to 3 (0 - 7)
SF: Detected N25Q512 with page size 65536, total: 67108864
and after hang, no diodes are blinked.
Then I run this filled version U-Boot-spl (T:/Wit/DS-5/gsrd/cv_soc_devkit_ghrd/software/spl_bsp/uboot-socfpga/spl/u-boot-spl) direct in DS-5 with debug features after load to hi memory, breakpoint on jump_to_image_no_args(), next image was loaded from 60000 in flash, its CRC checked succsessful.
Then I load it debug info with "file
T:\Wit\DS-5\Altera-SoCFPGA-HardwareLib-FPGA-CV-GNU\hwlib.axf" through Command window, steps and see call to exception vector 02 on 4th command SVC:
S:0x02000040 : B __cs3_start_asm_sim ; 0x200018C
->
S:0x0200018C : ADR r1,{pc}+0x44 ; 0x20001d0
S:0x02000190 : MOV r0,#0x16
S:0x02000194 : SVC # 0x123456
It is trap to hivecs area:
S:0xFFFF0008 : LDR pc, ; = 0xFFFF0024
, and forever cycled in hi address space FFFF0000. This is "Supervisor Call". Him permissible here, on 4th asm-command of application?
Where I bad ? Is too many possible variants in chain to introduce errors. I even don`t know, "J28 right shorted" signify 0 or 1 in BOOTSEL tables ;)
More than -- my application hwlib.axf hang DS-5 download on try debug it direct execution for these jumpers "J29-right, J29-left, J30-left" ! :)
I ask Altera expand ug_soc_eds.pdf in next version of EDS with detail process of preloadering and filling my BareMetal application to flash for succsessful starting, not through Linux, or make one button for all longest chain in DS-5, theirs reaction is undefined :(
Check my chain, please, or display its in details !