diff options
Diffstat (limited to 'bsp-howto')
-rw-r--r-- | bsp-howto/clock.rst | 38 | ||||
-rw-r--r-- | bsp-howto/coding-doxygen-bsp.rst | 7 | ||||
-rw-r--r-- | bsp-howto/getentropy.rst | 2 | ||||
-rw-r--r-- | bsp-howto/i2c.rst | 2 | ||||
-rw-r--r-- | bsp-howto/index.rst | 3 | ||||
-rw-r--r-- | bsp-howto/initilization_code.rst | 2 | ||||
-rw-r--r-- | bsp-howto/miscellanous_support.rst | 38 | ||||
-rw-r--r-- | bsp-howto/spi.rst | 2 | ||||
-rw-r--r-- | bsp-howto/target-hash.rst | 17 |
9 files changed, 50 insertions, 61 deletions
diff --git a/bsp-howto/clock.rst b/bsp-howto/clock.rst index f3d30ce..ed83472 100644 --- a/bsp-howto/clock.rst +++ b/bsp-howto/clock.rst @@ -65,8 +65,8 @@ Clock Tick Only Initialization ============== -The clock driver is initialized by a dedicated system initialization handler if -requested by the application configuration option +The clock driver is initialized by the ``_Clock_Initialize()`` system +initialization handler if requested by the application configuration option ``CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER``. The clock driver does not use the legacy IO driver framework. @@ -139,6 +139,9 @@ Simple Timecounter Variant For an example see the `ERC32 clock driver <https://git.rtems.org/rtems/tree/bsps/sparc/erc32/clock/ckinit.c>`_. +The argument parameter of ``Clock_driver_timecounter_tick( arg )`` is the +argument used to install the clock interrupt handler. Device drivers may use +this argument to access their control state. .. code-block:: c @@ -165,9 +168,9 @@ For an example see the `ERC32 clock driver ); } - static void some_tc_tick( void ) + static void some_tc_tick( rtems_timecounter_simple *tc ) { - rtems_timecounter_simple_downcounter_tick( &some_tc, some_tc_get ); + rtems_timecounter_simple_downcounter_tick( tc, some_tc_get ); } static void some_support_initialize_hardware( void ) @@ -193,8 +196,8 @@ For an example see the `ERC32 clock driver #define Clock_driver_support_initialize_hardware() \ some_support_initialize_hardware() - #define Clock_driver_timecounter_tick() \ - some_tc_tick() + #define Clock_driver_timecounter_tick( arg ) \ + some_tc_tick( arg ) #include "../../../shared/dev/clock/clockimpl.h" @@ -224,15 +227,20 @@ Install Clock Tick Interrupt Service Routine ============================================ The clock driver may provide a function to install the clock tick interrupt -service routine via ``Clock_driver_support_install_isr()``. The clock tick -interrupt service routine is passed as the one and only parameter to this -macro. The default implementation will do nothing. +service routine via ``Clock_driver_support_install_isr( isr )``. The clock +tick interrupt service routine is passed as the one and only parameter to this +macro. The default implementation will do nothing. The argument parameter (in +the code below ``&some_instance``) for the installed interrupt handler is +available in the ``Clock_driver_support_at_tick( arg )`` and +``Clock_driver_support_initialize_hardware( arg )`` customization macros. .. code-block:: c #include <bsp/irq.h> #include <bsp/fatal.h> + static some_control some_instance; + static void some_support_install_isr( rtems_interrupt_handler isr ) { rtems_status_code sc; @@ -241,7 +249,7 @@ macro. The default implementation will do nothing. "Clock", RTEMS_INTERRUPT_UNIQUE, isr, - NULL + &some_instance ); if ( sc != RTEMS_SUCCESSFUL ) { bsp_fatal( SOME_FATAL_IRQ_INSTALL ); @@ -257,17 +265,19 @@ Support At Tick =============== The hardware-specific support at tick is specified by -``Clock_driver_support_at_tick()``. +``Clock_driver_support_at_tick( arg )``. The ``arg`` is the argument used to +install the clock interrupt handler. Device drivers may use this argument to +access their control state. .. code-block:: c - static void some_support_at_tick( void ) + static void some_support_at_tick( some_control *arg ) { /* Clear interrupt */ } - #define Clock_driver_support_at_tick() \ - some_support_at_tick() + #define Clock_driver_support_at_tick( arg ) \ + some_support_at_tick( arg ) #include "../../../shared/dev/clock/clockimpl.h" diff --git a/bsp-howto/coding-doxygen-bsp.rst b/bsp-howto/coding-doxygen-bsp.rst index 59c0e0b..5f3b46a 100644 --- a/bsp-howto/coding-doxygen-bsp.rst +++ b/bsp-howto/coding-doxygen-bsp.rst @@ -151,8 +151,8 @@ directories contain implementations of these features. $ cd raspberrypi $ ls - bsp_specs configure.ac include make misc README - clock console irq Makefile.am preinstall.am startup + include misc README clock console irq + start Another way to get an idea of the structure of bsps/ is to navigate to a directory and execute the "tree -f" command. This outputs a nice @@ -164,8 +164,7 @@ directory. $ pwd ~/rtems/bsps/arm/raspberrypi $ tree -f - . - |-- ./bsp_specs + . |-- ./clock | `-- ./clock/clockdrv.c |-- ./configure.ac diff --git a/bsp-howto/getentropy.rst b/bsp-howto/getentropy.rst index decc2af..cf8471a 100644 --- a/bsp-howto/getentropy.rst +++ b/bsp-howto/getentropy.rst @@ -1,6 +1,6 @@ .. SPDX-License-Identifier: CC-BY-SA-4.0 -.. Copyright (C) 2017 embedded brains GmbH <rtems@embedded-brains.de> +.. Copyright (C) 2017 embedded brains GmbH & Co. KG Entropy Source ************** diff --git a/bsp-howto/i2c.rst b/bsp-howto/i2c.rst index 66d6653..af1cfe2 100644 --- a/bsp-howto/i2c.rst +++ b/bsp-howto/i2c.rst @@ -1,6 +1,6 @@ .. SPDX-License-Identifier: CC-BY-SA-4.0 -.. Copyright (C) 2016, 2019 embedded brains GmbH <rtems@embedded-brains.de> +.. Copyright (C) 2016, 2019 embedded brains GmbH & Co. KG I2C Driver ********** diff --git a/bsp-howto/index.rst b/bsp-howto/index.rst index e95c1b8..d8ff326 100644 --- a/bsp-howto/index.rst +++ b/bsp-howto/index.rst @@ -9,7 +9,7 @@ RTEMS BSP and Driver Guide (|version|). .. topic:: Copyrights and License | |copy| 2017 Christian Mauderer - | |copy| 2016, 2020 embedded brains GmbH + | |copy| 2016, 2020 embedded brains GmbH & Co. KG | |copy| 2016, 2020 Sebastian Huber | |copy| 1988, 2017 On-Line Applications Research Corporation (OAR) @@ -28,6 +28,7 @@ RTEMS BSP and Driver Guide (|version|). initilization_code console clock + target-hash getentropy i2c spi diff --git a/bsp-howto/initilization_code.rst b/bsp-howto/initilization_code.rst index b1fcb0d..deb70a5 100644 --- a/bsp-howto/initilization_code.rst +++ b/bsp-howto/initilization_code.rst @@ -1,6 +1,6 @@ .. SPDX-License-Identifier: CC-BY-SA-4.0 -.. Copyright (C) 2020 embedded brains GmbH +.. Copyright (C) 2020 embedded brains GmbH & Co. KG .. Copyright (C) 2020 Sebastian Huber .. Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR) diff --git a/bsp-howto/miscellanous_support.rst b/bsp-howto/miscellanous_support.rst index 015adb4..10b45f7 100644 --- a/bsp-howto/miscellanous_support.rst +++ b/bsp-howto/miscellanous_support.rst @@ -10,44 +10,6 @@ Miscellaneous Support Files This chapter contains outdated and confusing information. -GCC Compiler Specifications File -================================ - -The file ``bsp_specs`` defines the start files and libraries that are always -used with this BSP. The format of this file is admittedly cryptic and this -document will make no attempt to explain it completely. Below is the -``bsp_specs`` file from the PowerPC psim BSP: - -.. code-block:: c - - %rename endfile old_endfile - %rename startfile old_startfile - %rename link old_link - *startfile: - %{!qrtems: %(old_startfile)} \ - %{!nostdlib: %{qrtems: ecrti%O%s rtems_crti%O%s crtbegin.o%s start.o%s}} - *link: - %{!qrtems: %(old_link)} %{qrtems: -Qy -dp -Bstatic -e _start -u __vectors} - *endfile: - %{!qrtems: %(old_endfile)} %{qrtems: crtend.o%s ecrtn.o%s} - -The first section of this file renames the built-in definition of some -specification variables so they can be augmented without embedded their -original definition. The subsequent sections specify what behavior is expected -when the ``-qrtems`` option is specified. - -The ``*startfile`` section specifies that the BSP specific file ``start.o`` -will be used instead of ``crt0.o``. In addition, various EABI support files -(``ecrti.o`` etc.) will be linked in with the executable. - -The ``*link`` section adds some arguments to the linker when it is invoked by -GCC to link an application for this BSP. - -The format of this file is specific to the GNU Compiler Suite. The argument -used to override and extend the compiler built-in specifications is available -in all recent GCC versions. The ``-specs`` option is present in all ``egcs`` -distributions and ``gcc`` distributions starting with version 2.8.0. - README Files ============ diff --git a/bsp-howto/spi.rst b/bsp-howto/spi.rst index 1da5fa0..cf7918a 100644 --- a/bsp-howto/spi.rst +++ b/bsp-howto/spi.rst @@ -1,6 +1,6 @@ .. SPDX-License-Identifier: CC-BY-SA-4.0 -.. Copyright (C) 2016, 2019 embedded brains GmbH <rtems@embedded-brains.de> +.. Copyright (C) 2016, 2019 embedded brains GmbH & Co. KG SPI Driver ********** diff --git a/bsp-howto/target-hash.rst b/bsp-howto/target-hash.rst new file mode 100644 index 0000000..af73ae3 --- /dev/null +++ b/bsp-howto/target-hash.rst @@ -0,0 +1,17 @@ +.. SPDX-License-Identifier: CC-BY-SA-4.0 + +.. Copyright (C) 2021 embedded brains GmbH & Co. KG + +Target Hash +*********** + +Each BSP must provide an implementation of the :c:func:`rtems_get_target_hash` +directive. The +`default implementation <https://git.rtems.org/rtems/tree/bsps/shared/start/gettargethash-default.c>`_ +is based on the CPU counter frequency. A BSP-specific implementation may be +provided which covers also for example the device tree, settings of the memory +controller, processor and bus frequencies, a serial number of a chip, etc. For +a BSP-specific implementation start with the default implementation and add +more values to the target hash using the functions :c:func:`_Hash_Add_data` and +:c:func:`_Hash_Add_string`. The target hash can be used to distinguish test +suite results obtained from different target systems. |