source: rtems/bsps/arm/atsam/include/bsp.h @ aa95122

Last change on this file since aa95122 was aa95122, checked in by Christian Mauderer <christian.mauderer@…>, on 01/13/22 at 07:38:07

bsp/atsam: Optionally use DMA for UART Rx

If the system is busy with other interrupts and the UART is set to a
fast baud rate, it's possible to loose UART interrupts and therefore
characters. This allows to optionally enable a DMA for the UARTs so that
a number of lost interrupts can be tolerated.

The number of DMAs on this chip is limited and not not all applications
need that feature. Therefore the DMA is disabled by default.

Close #4578

  • Property mode set to 100644
File size: 2.9 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup RTEMSBSPsARMAtsam
5 */
6
7/*
8 * Copyright (c) 2016 embedded brains GmbH.  All rights reserved.
9 *
10 *  embedded brains GmbH
11 *  Dornierstr. 4
12 *  82178 Puchheim
13 *  Germany
14 *  <rtems@embedded-brains.de>
15 *
16 * The license and distribution terms for this file may be
17 * found in the file LICENSE in this distribution or at
18 * http://www.rtems.org/license/LICENSE.
19 */
20
21#ifndef LIBBSP_ARM_ATSAM_BSP_H
22#define LIBBSP_ARM_ATSAM_BSP_H
23
24/**
25 * @defgroup RTEMSBSPsARMAtsam Atmel/Microchip SAM E70, S70, V70 and V71
26 *
27 * @ingroup RTEMSBSPsARM
28 *
29 * @brief Atmel/Microchip SAM E70, S70, V70 and V71 Board Support Package.
30 *
31 * @{
32 */
33
34#include <bspopts.h>
35#include <bsp/default-initial-extension.h>
36#include <sys/ioccom.h>
37
38#include <rtems.h>
39
40#ifdef __cplusplus
41extern "C" {
42#endif /* __cplusplus */
43
44#define BSP_FEATURE_IRQ_EXTENSION
45
46#define BSP_ARMV7M_IRQ_PRIORITY_DEFAULT (13 << 4)
47
48#define BSP_ARMV7M_SYSTICK_PRIORITY (14 << 4)
49
50uint32_t atsam_systick_frequency(void);
51
52#define BSP_ARMV7M_SYSTICK_FREQUENCY atsam_systick_frequency()
53
54struct rtems_bsdnet_ifconfig;
55
56int if_atsam_attach(struct rtems_bsdnet_ifconfig *config, int attaching);
57
58#define RTEMS_BSP_NETWORK_DRIVER_NAME "atsam0"
59
60#define RTEMS_BSP_NETWORK_DRIVER_ATTACH if_atsam_attach
61
62/**
63 * @brief Interface driver configuration.
64 */
65typedef struct {
66  /**
67   * @brief Maximum retries for MDIO communication.
68   */
69  uint32_t mdio_retries;
70
71  /**
72   * @brief Address of PHY.
73   *
74   * Use 0xff to search for a PHY.
75   */
76  uint8_t phy_addr;
77} if_atsam_config;
78
79extern char atsam_memory_dtcm_begin[];
80extern char atsam_memory_dtcm_end[];
81extern char atsam_memory_dtcm_size[];
82
83extern char atsam_memory_intflash_begin[];
84extern char atsam_memory_intflash_end[];
85extern char atsam_memory_intflash_size[];
86
87extern char atsam_memory_intsram_begin[];
88extern char atsam_memory_intsram_end[];
89extern char atsam_memory_intsram_size[];
90
91extern char atsam_memory_itcm_begin[];
92extern char atsam_memory_itcm_end[];
93extern char atsam_memory_itcm_size[];
94
95extern char atsam_memory_nocache_begin[];
96extern char atsam_memory_nocache_end[];
97extern char atsam_memory_nocache_size[];
98
99extern char atsam_memory_qspiflash_begin[];
100extern char atsam_memory_qspiflash_end[];
101extern char atsam_memory_qspiflash_size[];
102
103extern char atsam_memory_sdram_begin[];
104extern char atsam_memory_sdram_end[];
105extern char atsam_memory_sdram_size[];
106
107void atsam_rtc_get_time(rtems_time_of_day *tod);
108
109
110
111void bsp_restart( const void *const addr );
112
113/*
114 * This ioctl enables the receive DMA for an UART. The DMA can be usefull if you
115 * loose characters in high interrupt load situations.
116 *
117 * Disabling the DMA again is only possible by closing all file descriptors of
118 * that UART.
119 *
120 * Note that every UART needs one DMA channel and the system has only a limited
121 * amount of DMAs. So only use it if you need it.
122 */
123#define ATSAM_UART_ENABLE_RX_DMA _IO('d', 0)
124
125#ifdef __cplusplus
126}
127#endif /* __cplusplus */
128
129/** @} */
130
131#endif /* LIBBSP_ARM_ATSAM_BSP_H */
Note: See TracBrowser for help on using the repository browser.