You might need to install `u-boot-tools` package to build the template application.
You might need to install `u-boot-tools` package to build the template application.
## BeagleV-Fire Internal eMMC Boot
## BeagleV-Fire Internal eMMC RTEMS Boot
The BeagleV-Fire boots applications from eMMC soldered on the board. The actual boot process starts by starting Microchip's HSS (Hart Software Services) loaded from eNVM. The HSS software can establish OpenSBI environment and start HSS payload from eMMC on specified RV64 cores (the HARTs u54_1, u54_2, u54_3 and u54_4 are complete RV64GC cores then there is one management RV63IMAC core). The payload is started in specified mode, for the Linux kernel or U-boot typically in M-mode.
The BeagleV-Fire boots applications from eMMC soldered on the board. The actual boot process starts by starting Microchip's HSS (Hart Software Services) loaded from eNVM. The HSS software can establish OpenSBI environment and start HSS payload from eMMC on specified RV64 cores (the HARTs u54_1, u54_2, u54_3 and u54_4 are complete RV64GC cores then there is one management RV63IMAC core). The payload is started in specified mode, for the Linux kernel or U-boot typically in M-mode.
WARNING: Be VERY CAREFULL there to chose correct device the mistake can lead to overwrite of your host system and make it unbootable.
WARNING: Be VERY CAREFULL there to chose correct device the mistake can lead to overwrite of your host system and make it unbootable.
## BeagleV-Fire TFTP Boot
## BeagleV-Fire TFTP RTEMS Boot
U-boot with networking support is required to boot RTEMS over TFTP. U=boot has to be build to be loaded and run in M-mode because RTEMS has to be booted in M-mode and I am not aware of o way to switch to M/mode from U-boot running in the standard S-mode.
Next steps has been used to achieve the goal:
The load and build of M-mode U-boot. The Microchip development repository has been used
The RTEMS application in plain binary format can be converted to U-boot image by
```
mkimage -A riscv -O rtems -T kernel -a 0x1000000000 -e 0x1000000000 -n "RTEMS" -C none -d app.bin app.img
```
Problem is that legacy image stores only low 32-bits from the load and entry addresses. Attempt to use FIT image where
```
load = /bits/ 64 <0x1000000000>;
entry = /bits/ 64 <0x1000000000>;
```
does not work for me. U-boot fails when attempting to analyze FIT image on Store/AMO Unaligned fail...
But even legacy image with incorrect entry can be used with some workarounds.
The used setup is prepared in `/srv/tftp/beglev-fire` directory.
The next control script (`autoscr.scr.txt`) source is prepared for U-boot
```
setenv fdt_high 0xffffffffffffffff
setenv initrd_high 0xffffffffffffffff
img_path=beglev-fire/rtems/app.img
img_addr=0x8e010000
tftpboot ${img_addr} ${tftpserverip}:${img_path}
cp 8e010040 1000000000 ${filesize}
go 1000000000
```
The script is converted to U-boot image by
```
mkimage -A riscv -O linux -T script -C none -a 0 -e 0 \
-n "autoscr example script" \
-d autoscr.scr.txt autoscr.scr
```
When prepared and RETMS application image is placed into `/srv/tftp/beglev-fire/rtems/app.img` the whole application can be started from U-bbot prompt by