summaryrefslogtreecommitdiffstats
path: root/user/bsps/bsps-arm.rst
blob: eb972c6141916fbb883f3060c64e1c382e988678 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
.. SPDX-License-Identifier: CC-BY-SA-4.0

.. Copyright (C) 2017, 2019 embedded brains GmbH
.. Copyright (C) 2017, 2019 Sebastian Huber

arm (ARM)
*********

altera-cyclone-v (Intel Cyclone V)
==================================

This BSP offers only one variant, the `altcycv_devkit`.  This variant supports
the Intel Cyclone V system on chip.  The basic hardware initialization is not
performed by the BSP.  A boot loader with device tree support must be used to
start the BSP, e.g. U-Boot.

The BSP is known to run on these boards:

* `Cyclone V SoC Development Kit <https://www.intel.com/content/www/us/en/programmable/products/boards_and_kits/dev-kits/altera/kit-cyclone-v-soc.html>`_

* `Enclustra Mars MA3 SoC Module <https://www.enclustra.com/en/products/system-on-chip-modules/mars-ma3/>`_

* `Terasic DE10-Standard Development Kit <https://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=165&No=1081>`_

Boot via U-Boot
---------------

The application executable file (ELF file) must be converted to an U-Boot
image.  Use the following commands:

.. code-block:: none

    arm-rtems5-objcopy -O binary app.exe app.bin
    gzip -9 -f -c app.bin > app.bin.gz
    mkimage -A arm -O linux -T kernel -a 0x00300000 -e 0x00300000 -n RTEMS -d app.bin.gz app.img

Use the following U-Boot commands to boot an application via TFTP download:

.. code-block:: none

    tftpboot ${loadaddr} app.img && run loadfdt && bootm ${loadaddr} - ${fdt_addr} ; reset

The ``loadfdt`` command may be not defined in your U-Boot environment.  Just
replace it with the appropriate commands to load the device tree at
``${fdt_addr}``.

Clock Driver
------------

The clock driver uses the `Cortex-A9 MPCore Global Timer`.

Console Driver
--------------

The console driver supports up to two on-chip NS16550 UARTs.  The console
driver does not configure the pins.

I2C Driver
----------

There is a legacy I2C driver.  It should be converted to the I2C driver framework.

Network Interface Driver
------------------------

The network interface driver is provided by the `libbsd`.  It is initialized
according to the device tree.  It supports checksum offload.

MMC/SDCard Driver
-----------------

The MMC/SDCard driver is provided by the `libbsd`.  It is
initialized according to the device tree.  Pin re-configuration according to
the serial clock frequency is not supported.  DMA transfers are supported.

USB Host Driver
---------------

The USB host driver is provided by the `libbsd`.  It is initialized according
to the device tree.  The driver works in polled mode.

Caveats
-------

The clock and pin configuration support is quite rudimentary and mostly relies
on the boot loader.

atsam
=====

TODO.

beagle
======

TODO.

csb336
======

TODO.

csb337
======

TODO.

edb7312
=======

TODO.

gdbarmsim
=========

TODO.

gumstix
=======

TODO.

imx (NXP i.MX)
==============

This BSP offers only one variant, the `imx7`.  This variant supports the i.MX
7Dual processor.  The basic hardware initialization is not performed by the
BSP.  A boot loader with device tree support must be used to start the BSP,
e.g. U-Boot.

Build Configuration Options
---------------------------

The following options are available at the configure command line.

``BSP_PRESS_KEY_FOR_RESET``
    If defined to a non-zero value, then print a message and wait until pressed
    before resetting board when application terminates.

``BSP_RESET_BOARD_AT_EXIT``
    If defined to a non-zero value, then reset the board when the application
    terminates.

``BSP_PRINT_EXCEPTION_CONTEXT``
    If defined to a non-zero value, then print the exception context when an
    unexpected exception occurs.

``BSP_FDT_BLOB_SIZE_MAX``
    The maximum size of the device tree blob in bytes (default is 262144).

``CONSOLE_USE_INTERRUPTS``
    Use interrupt driven mode for console devices (enabled by default).

``IMX_CCM_IPG_HZ``
   The IPG clock frequency in Hz (default is 67500000).

``IMX_CCM_UART_HZ``
   The UART clock frequency in Hz (default is 24000000).

``IMX_CCM_AHB_HZ``
   The AHB clock frequency in Hz (default is 135000000).

Boot via U-Boot
---------------

The application executable file (ELF file) must be converted to an U-Boot
image.  Use the following commands:

.. code-block:: none

    arm-rtems5-objcopy -O binary app.exe app.bin
    gzip -9 -f -c app.bin > app.bin.gz
    mkimage -A arm -O linux -T kernel -a 0x80200000 -e 0x80200000 -n RTEMS -d app.bin.gz app.img

Use the following U-Boot commands to boot an application via TFTP download:

.. code-block:: none

    tftpboot ${loadaddr} app.img && run loadfdt && bootm ${loadaddr} - ${fdt_addr} ; reset

The ``loadfdt`` command may be not defined in your U-Boot environment.  Just
replace it with the appropriate commands to load the device tree at
``${fdt_addr}``.

Clock Driver
------------

The clock driver uses the `ARMv7-AR Generic Timer`.

Console Driver
--------------

The console driver supports up to seven on-chip UARTs.  They are initialized
according to the device tree.  The console driver does not configure the pins.

I2C Driver
----------

I2C drivers are registered by the ``i2c_bus_register_imx()`` function.  The I2C
driver does not configure the pins.

.. code-block:: c

    #include <assert.h>
    #include <bsp.h>

    void i2c_init(void)
    {
      int rv;

      rv = i2c_bus_register_imx("/dev/i2c-0", "i2c0");
      assert(rv == 0);
    }

SPI Driver
----------

SPI drivers are registered by the ``spi_bus_register_imx()`` function.  The SPI
driver configures the pins according to the ``pinctrl-0`` device tree property.
SPI transfers with a continuous chip select are limited by the FIFO size of 64
bytes.  The driver has no DMA support.

.. code-block:: c

    #include <assert.h>
    #include <bsp.h>

    void spi_init(void)
    {
      int rv;

      rv =  spi_bus_register_imx("/dev/spi-0", "spi0");
      assert(rv == 0);
    }

Network Interface Driver
------------------------

The network interface driver is provided by the `libbsd`.  It is initialized
according to the device tree.  It supports checksum offload and interrupt
coalescing.  IPv6 transmit checksum offload is not implemented.  The interrupt
coalescing uses the MII/GMII clocks and can be controlled by the following
system controls:

 * ``dev.ffec.<unit>.int_coal.rx_time``
 * ``dev.ffec.<unit>.int_coal.rx_count``
 * ``dev.ffec.<unit>.int_coal.tx_time``
 * ``dev.ffec.<unit>.int_coal.tx_count``

A value of zero for the time or count disables the interrupt coalescing in the
corresponding direction.

MMC/SDCard Driver
-----------------

The MMC/SDCard driver (uSDHC module) is provided by the `libbsd`.  It is
initialized according to the device tree.  Pin re-configuration according to
the serial clock frequency is not supported.  Data transfers are extremely
slow.  This is probably due to the missing DMA support.

Caveats
-------

The clock and pin configuration support is quite rudimentary and mostly relies
on the boot loader.  For a pin group configuration see
``imx_iomux_configure_pins()``.  There is no power management support.

lm3s69xx
========

TODO.

lpc176x
=======

TODO.

lpc24xx (NXP LPC17XX/LPC24XX/LPC40XX)
=====================================

This BSP offers only several variants.  The following variants support the
`Embedded Artits LPC4088 Developer's Kit <https://www.embeddedartists.com/products/lpc4088-developers-kit/>`_
and earlier board generations:

* lpc17xx_ea_ram

* lpc17xx_ea_rom_int

* lpc24xx_ea

* lpc40xx_ea_ram

* lpc40xx_ea_rom_int

They can be used as a base line for customization.  The basic hardware
initialization is performed by the BSP.  It can be customized via configuration
options and configuration tables.  See also
`<bsp/start-config.h> <https://git.rtems.org/rtems/tree/bsps/arm/lpc24xx/include/bsp/start-config.h>`_.

Clock Driver
------------

The clock driver of the Cortex-M variants uses the `ARMv7-M Systick`.  The
older ARM7TDMI variants use the `TMR0` timer module.

Console Driver
--------------

The console driver supports up to four on-chip UARTs.  Initialization can be
customized via the ``lpc24xx_uart_probe_1()``, ``lpc24xx_uart_probe_2()`` and
``lpc24xx_uart_probe_3()`` functions.

I2C Bus Driver
--------------

I2C bus drivers are registered by the ``lpc24xx_register_i2c_0()``,
``lpc24xx_register_i2c_1()`` and ``lpc24xx_register_i2c_2()`` functions.  The
I2C driver does not configure the pins.  See also
`<bsp/i2c.h> <https://git.rtems.org/rtems/tree/bsps/arm/lpc24xx/include/bsp/i2c.h>`_.

SPI Bus Driver
--------------

SPI bus drivers are registered by the ``lpc24xx_register_ssp_0()``,
``lpc24xx_register_ssp_1()`` and ``lpc24xx_register_ssp_2()`` functions.  The
SSP driver does not configure the pins.  See also
`<bsp/ssp.h> <https://git.rtems.org/rtems/tree/bsps/arm/lpc24xx/include/bsp/ssp.h>`_.

Network Interface Driver
------------------------

Only a legacy network driver is support.  For a `libbsd` base driver the
platform support is missing, see
`if_lpe.c <https://git.rtems.org/rtems-libbsd/tree/rtemsbsd/sys/arm/lpc/if_lpe.c>`_.

USB Driver
----------

The USB host driver (OHCI) is provided by the `libbsd`.

Framebuffer Driver
------------------

For a custom framebuffer driver see
`<bsp/lcd.h> <https://git.rtems.org/rtems/tree/bsps/arm/lpc24xx/include/bsp/lcd.h>`_.

RTC Driver
----------

There is a standard RTC driver available using the on-chip RTC module.

lpc32xx
=======

TODO.

raspberrypi
===========

TODO.

realview-pbx-a9
===============

TODO.

rtl22xx
=======

TODO.

smdk2410
========

TODO.

stm32f4
=======

TODO.

tms570
======

TODO.

xilinx-zynq
===========

TODO.