device-tree example for altera-cyclone-v bsp
Christian Spindeldreier
spindeldreier at ims.uni-hannover.de
Wed Feb 13 18:14:38 UTC 2019
Hi Ian,
thank you for the insight into the rtems development with fdt.
As we did not manage to debug the boot process properly, my suspicion on
the device tree was incorrect. Actually our u-boot image generation and
boot commands were wrong. After searching through the rtems-kernel
repository as well as different sources from the web and checking
various combinations we now use the following commands to create a
running hello-world image from a elf-file:
arm-rtems5-objcopy -R -S -O binary hello.exe hello.bin
gzip -9 -f -c hello.bin > hello.bin.gz
mkimage -A arm -O linux -T kernel -a 0x00300000 -e 0x00300040 -n RTEMS
-d hello.bin.gz hello.img
The entry-point (-e) and the start address (-e) values can be obtained
using the elf reader:
arm-rtems5-readelf -l hello.exe
Furthermore one has to compile the device tree blob using the
device-tree-compiler, preprocessing is required if the device-tree
source (ours is taken from kernel.org's linux-4.14 branch) contains
includes:
cpp -nostdinc -I include -I arch -undef -x assembler-with-cpp
devtree.dts devtree.dts.preprocessed
dtc -I dts -O dtb devtree.dts.preprocessed -o devtree.dtb
Loading this image as well as the device-tree-blob and finally booting
it on u-boot has to be done as follows:
load mmc 0:2 0x10000000 devtree.dtb
load mmc 0:2 0x20000000 hello.img
bootm 0x10800000 - 0x18000000
Additionally we tried to build a FIT image containing the rtems-app as
well as the device tree in one file, but we were not able to create a
bootable one yet. Maybe one could add the build instructions to the
README within the altera-cyclone-v bsp or maybe to the wiki, making it
easier for other guys trying similar things.
Best regards,
Christian
On 13.02.19 02:40, Ian Caddy wrote:
> Hi Christian,
>
> I am not familiar with the Cyclone, but we recently went through the
> device tree learning curve moving to RTEMS5 and the creating a BPS for
> the imx6ULL processor.
>
> The thing with device tree is that what ever your BSP needs, is how
> you have to name your device tree. Search your BSP for the following
> string: fdt_
>
> In the example cyclone BSP, there were a number of functions:
>
> fdt_path_offset_namelen
>
> fdt_getprop
>
> etc.
>
> Check how each of these calls is made, and the names used. For
> example the first one I came across was in adjust_memory_size
>
> with memory_path = "/memory" and reserved_memory_path =
> "/reserved-memory"
>
> Both these need to be defined in your device tree for it to work. Look
> through all your other instances and ensure that your names line up.
>
> regards,
>
> Ian Caddy
>
>
> On 12/02/2019 11:14 pm, Christian Spindeldreier wrote:
>
>> Hi all,
>>
>> we are trying to run rtems-5 on the Terasic DE10 Standard board
>> containing an Intel (former Altera) Cyclone V SoC-FPGA, which is
>> identical the the one on the one on the DK-DEV-5CSXC6N.
>>
>> As there is the altcycv_devkit bsp within the rtems kernel we tried
>> simply to run a simple hello-world application based on this bsp.
>>
>> We managed to build a u-boot image (FIT) containing rtems and a dtb
>> which starts to run, but freezes without any output. We assume this
>> issue to be related to the dtb which u-boot has to provide, but there
>> is no example dts within the bsp. At the moment we use a slightly
>> modified version of the socfpga_cyclone5_socdk device tree from the
>> linux-4.14 kernel working fine with the linux kernel, but this does
>> not seem to provide the required information for rtems.
>>
>> Can someone maybe provide an example dts file, which shows how the
>> nodes should be named, and what information has to be provided by the
>> device tree? Any information on the usage of the altera-cyclone-v bsp
>> might be helpful.
>>
>> Kind regards,
>>
>> Christian
>>
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users
--
Dipl.-Ing. Christian Spindeldreier
Leibniz University Hannover (LUH)
Institute of Microelectronic Systems
Architectures and Systems Group
Appelstr. 4, 30167 Hannover, Germany
voice : +49-511-762-5039
fax : +49-511-762-19601
mail : spindeldreier at ims.uni-hannover.de
web : http://www.ims.uni-hannover.de/spindeldreier
More information about the users
mailing list