Changeset d8d5876 in rtems-docs


Ignore:
Timestamp:
Jul 18, 2019, 2:24:30 PM (5 weeks ago)
Author:
Vijay Kumar Banerjee <vijaykumar9597@…>
Branches:
master
Children:
e859242
Parents:
248c708
git-author:
Vijay Kumar Banerjee <vijaykumar9597@…> (07/18/19 14:24:30)
git-committer:
Chris Johns <chrisj@…> (07/20/19 01:13:15)
Message:

user/bsps : Add documentation for Beagle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • user/bsps/arm/beagle.rst

    r248c708 rd8d5876  
    11.. SPDX-License-Identifier: CC-BY-SA-4.0
    22
    3 .. Copyright (C) 2019 TBD
     3.. Copyright (C) 2019 Vijay Kumar Banerjee
    44
    55beagle
    66======
    77
    8 TODO.
     8This BSP supports four variants, `beagleboardorig`, `beagleboardxm`, `beaglebonewhite`
     9and `beagleboneblack`. The basic hardware initialization is not performed by
     10the BSP.  A boot loader with device tree support must be used to start the BSP,
     11e.g. U-Boot.
     12
     13TODO(These drivers are present but not documented yet):
     14
     15 *  Clock driver.
     16 *  Network Interface Driver.
     17 *  SDcard driver.
     18 *  GPIO Driver.
     19 *  Console driver.
     20 *  PWM Driver.
     21 *  RTC driver.
     22
     23Boot via U-Boot
     24---------------
     25To boot via uboot, the ELF must be converted to a U-Boot image like below:
     26
     27.. code-block:: none
     28
     29    arm-rtems5-objcopy hello.exe -O app.bin
     30    gzip 9 app.bin
     31    mkimage -A arm -O linux -T kernel -a 0x80000000 -e 0x80000000 -n RTEMS -d app.bin.gz rtems-app.img
     32
     33Getting the Device Tree Blob
     34----------------------------
     35
     36The Device Tree Blob(dtb) is needed to load the device tree while starting up
     37the kernel. We build the dtb from the FreeBSD source matching the commit hash
     38from the libbsd HEAD of freebsd-org. For example if the HEAD is at
     39"19a6ceb89dbacf74697d493e48c388767126d418"
     40Then the right dts file is:
     41https://github.com/freebsd/freebsd/blob/19a6ceb89dbacf74697d493e48c388767126d418/sys/gnu/dts/arm/am335x-boneblack.dts
     42
     43.. code-block:: none
     44
     45     #building the dtb
     46     #We will use the script from https://github.com/freebsd/freebsd/blob/19a6ceb89dbacf74697d493e48c388767126d418/sys/tools/fdt/make_dtb.sh
     47
     48     export MACHINE='arm' #The make_dtb.sh script uses environment variable MACHINE
     49     SCRIPT_DIR=$HOME/freebsd/sys/tools/fdt
     50     #The arguments to the script are
     51     # $1 -> Build Tree
     52     # $2 -> DTS source file
     53     # $3 -> output path of the DTB file
     54     ${SCRIPT_DIR}/make_dtb.sh ${SCRIPT_DIR}/../../ \
     55     ${SCRIPT_DIR}/../../gnu/dts/arm/am335x-boneblack.dts \
     56     $(pwd)
     57Writing the uEnv.txt file
     58-------------------------
     59
     60The uEnv.txt file is needed to set any environment variable before the kernel is
     61loaded. Each line is a u-boot command that the uboot will execute during
     62starting up.
     63
     64Add the following to a file named uEnv.txt:
     65
     66.. code-block:: none
     67
     68     setenv bootdelay 5
     69     uenvcmd=run boot
     70     boot=fatload mmc 0 0x80800000 rtems-app.img ; fatload mmc 0 0x88000000 am335x-boneblack.dtb ; bootm 0x80800000 - 0x88000000
     71
     72I2C Driver
     73----------
     74
     75This BSP uses the I2C framework and is registered using
     76``am335x_i2c_bus_register()`` the function prototype is given below:
     77
     78.. code-block:: C
     79
     80   int am335x_i2c_bus_register(
     81   const char         *bus_path,
     82   uintptr_t           register_base,
     83   uint32_t            input_clock,
     84   rtems_vector_number irq
     85   );
     86
     87This function is needed only while registering with custom path with custom
     88values. For registering the `/dev/i2c-0` device, a wrapper function is provided,
     89``bbb_register_i2c_0()`` similarly ``bbb_register_i2c_1()`` and
     90``bbb_register_i2c_2()`` are respectively used to register `i2c-1` and `i2c-2`.
     91
     92SPI Driver
     93----------
     94
     95The SPI device `/dev/spi-0` can be registered with ``bbb_register_spi_0()```
Note: See TracChangeset for help on using the changeset viewer.