<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 19, 2019 at 10:32 PM Christian Mauderer <<a href="mailto:list@c-mauderer.de">list@c-mauderer.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 19/07/2019 18:21, Gedare Bloom wrote:<br>
> Looks good to me. I'm currently not able to apply it, verify the doc<br>
> build, and push it though. (Workstation issues.)<br>
> <br>
<br>
I agree that it looks OK. Thanks from me too for contributing to the<br>
documentation. It's something that most developers don't like to do<br>
therefore it's really great that you wrote that.<br>
<br></blockquote><div>Always glad to contribute. :) </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I didn't find any bugs in the instructions while reading through it. I<br>
can create a PDF out of it on my Arch Linux machine so I think it should<br>
be OK to merge it.<br>
<br>
You have tried quite a bit till you get an overlay working. If you feel<br>
like writing some more documentation, it might would be a good addition<br>
to add some notes regarding that too. I think this patch is fine as it<br>
is so if you add something please create a second patch.<br>
<br></blockquote><div>Sure, I can write about creating and overlay and applying it to the base tree.</div><div>What would be the right place to write it? </div><div>I have also wondered if it would be a good idea to keep the overlays in RTEMS</div><div>or libBSD repo somewhere along with a script that builds a dtb from the freebsd-org</div><div>tree and applies the overlay. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
@Gedare: I don't touch the docs repo that often: Is there some defined<br>
test process before a commit is added? Or is building a PDF on some<br>
random machine enough?<br>
<br>
Best regards<br>
<br>
Christian<br>
<br>
> On Fri, Jul 19, 2019 at 2:07 AM Vijay Kumar Banerjee<br>
> <<a href="mailto:vijaykumar9597@gmail.com" target="_blank">vijaykumar9597@gmail.com</a>> wrote:<br>
>><br>
>> ---<br>
>> user/bsps/arm/beagle.rst | 110 ++++++++++++++++++++++++++++++++++++++-<br>
>> 1 file changed, 108 insertions(+), 2 deletions(-)<br>
>><br>
>> diff --git a/user/bsps/arm/beagle.rst b/user/bsps/arm/beagle.rst<br>
>> index a36efde..eb4ecfb 100644<br>
>> --- a/user/bsps/arm/beagle.rst<br>
>> +++ b/user/bsps/arm/beagle.rst<br>
>> @@ -1,8 +1,114 @@<br>
>> .. SPDX-License-Identifier: CC-BY-SA-4.0<br>
>><br>
>> -.. Copyright (C) 2019 TBD<br>
>> +.. Copyright (C) 2019 Vijay Kumar Banerjee<br>
>><br>
>> beagle<br>
>> ======<br>
>><br>
>> -TODO.<br>
>> +This BSP supports four variants, `beagleboardorig`, `beagleboardxm`,<br>
>> +`beaglebonewhite` and `beagleboneblack`. The basic hardware initialization is<br>
>> +not performed by the BSP. A boot loader with device tree support must be used<br>
>> +to start the BSP, e.g., U-Boot.<br>
>> +<br>
>> +TODO(These drivers are present but not documented yet):<br>
>> +<br>
>> + * Clock driver.<br>
>> + * Network Interface Driver.<br>
>> + * SDcard driver.<br>
>> + * GPIO Driver.<br>
>> + * Console driver.<br>
>> + * PWM Driver.<br>
>> + * RTC driver.<br>
>> +<br>
>> +Boot via U-Boot<br>
>> +---------------<br>
>> +To boot via uboot, the ELF must be converted to a U-Boot image like below:<br>
>> +<br>
>> +.. code-block:: none<br>
>> +<br>
>> + arm-rtems5-objcopy hello.exe -O app.bin<br>
>> + gzip 9 app.bin<br>
>> + mkimage -A arm -O linux -T kernel -a 0x80000000 -e 0x80000000 -n RTEMS -d app.bin.gz rtems-app.img<br>
>> +<br>
>> +Getting the Device Tree Blob<br>
>> +----------------------------<br>
>> +<br>
>> +The Device Tree Blob (DTB) is needed to load the device tree while starting up<br>
>> +the kernel. We build the dtb from the FreeBSD source matching the commit hash<br>
>> +from the libbsd HEAD of freebsd-org. For example if the HEAD is at<br>
>> +"19a6ceb89dbacf74697d493e48c388767126d418"<br>
>> +Then the right Device Tree Source (DTS) file is:<br>
>> +<a href="https://github.com/freebsd/freebsd/blob/19a6ceb89dbacf74697d493e48c388767126d418/sys/gnu/dts/arm/am335x-boneblack.dts" rel="noreferrer" target="_blank">https://github.com/freebsd/freebsd/blob/19a6ceb89dbacf74697d493e48c388767126d418/sys/gnu/dts/arm/am335x-boneblack.dts</a><br>
>> +<br>
>> +.. code-block:: shell<br>
>> + :linenos:<br>
>> +<br>
>> + #building the dtb<br>
>> + #We will use the script from <a href="https://github.com/freebsd/freebsd/blob/19a6ceb89dbacf74697d493e48c388767126d418/sys/tools/fdt/make_dtb.sh" rel="noreferrer" target="_blank">https://github.com/freebsd/freebsd/blob/19a6ceb89dbacf74697d493e48c388767126d418/sys/tools/fdt/make_dtb.sh</a><br>
>> +<br>
>> + #The make_dtb.sh script uses environment variable MACHINE<br>
>> + export MACHINE='arm'<br>
>> +<br>
>> + SCRIPT_DIR=$HOME/freebsd/sys/tools/fdt<br>
>> +<br>
>> + #The arguments to the script are<br>
>> + # $1 -> Build Tree<br>
>> + # $2 -> DTS source file<br>
>> + # $3 -> output path of the DTB file<br>
>> +<br>
>> + ${SCRIPT_DIR}/make_dtb.sh ${SCRIPT_DIR}/../../ \<br>
>> + ${SCRIPT_DIR}/../../gnu/dts/arm/am335x-boneblack.dts \<br>
>> + $(pwd)<br>
>> +<br>
>> +Writing the uEnv.txt file<br>
>> +-------------------------<br>
>> +<br>
>> +The uEnv.txt file is needed to set any environment variable before the kernel is<br>
>> +loaded. Each line is a u-boot command that the uboot will execute during start<br>
>> +up.<br>
>> +<br>
>> +Add the following to a file named uEnv.txt:<br>
>> +<br>
>> +.. code-block:: none<br>
>> +<br>
>> + setenv bootdelay 5<br>
>> + uenvcmd=run boot<br>
>> + boot=fatload mmc 0 0x80800000 rtems-app.img ; fatload mmc 0 0x88000000 am335x-boneblack.dtb ; bootm 0x80800000 - 0x88000000<br>
>> +<br>
>> +I2C Driver<br>
>> +----------<br>
>> +<br>
>> +For registering the `/dev/i2c-0` device, a wrapper function is provided,<br>
>> +``bbb_register_i2c_0()`` similarly ``bbb_register_i2c_1()`` and<br>
>> +``bbb_register_i2c_2()`` are respectively used to register `i2c-1` and `i2c-2`.<br>
>> +<br>
>> +For registering an I2C device with a custom path (say `/dev/i2c-3`) the<br>
>> +function ``am335x_i2c_bus_register()`` has to be used.<br>
>> +<br>
>> +The function prototype is given below:<br>
>> +<br>
>> +.. code-block:: C<br>
>> +<br>
>> + int am335x_i2c_bus_register(<br>
>> + const char *bus_path,<br>
>> + uintptr_t register_base,<br>
>> + uint32_t input_clock,<br>
>> + rtems_vector_number irq<br>
>> + );<br>
>> +<br>
>> +SPI Driver<br>
>> +----------<br>
>> +<br>
>> +The SPI device `/dev/spi-0` can be registered with ``bbb_register_spi_0()``<br>
>> +<br>
>> +For registering with a custom path, the ``bsp_register_spi()`` can be used.<br>
>> +<br>
>> +The function prototype is given below:<br>
>> +<br>
>> +.. code-block:: C<br>
>> +<br>
>> + rtems_status_code bsp_register_spi(<br>
>> + const char *bus_path,<br>
>> + uintptr_t register_base,<br>
>> + rtems_vector_number irq<br>
>> + );<br>
>> --<br>
>> 2.20.1<br>
>><br>
>> _______________________________________________<br>
>> devel mailing list<br>
>> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
>> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
> _______________________________________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
> <br>
</blockquote></div></div>