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 |
---|
41 | extern "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 | |
---|
50 | uint32_t atsam_systick_frequency(void); |
---|
51 | |
---|
52 | #define BSP_ARMV7M_SYSTICK_FREQUENCY atsam_systick_frequency() |
---|
53 | |
---|
54 | struct rtems_bsdnet_ifconfig; |
---|
55 | |
---|
56 | int 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 | */ |
---|
65 | typedef 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 | |
---|
79 | extern char atsam_memory_dtcm_begin[]; |
---|
80 | extern char atsam_memory_dtcm_end[]; |
---|
81 | extern char atsam_memory_dtcm_size[]; |
---|
82 | |
---|
83 | extern char atsam_memory_intflash_begin[]; |
---|
84 | extern char atsam_memory_intflash_end[]; |
---|
85 | extern char atsam_memory_intflash_size[]; |
---|
86 | |
---|
87 | extern char atsam_memory_intsram_begin[]; |
---|
88 | extern char atsam_memory_intsram_end[]; |
---|
89 | extern char atsam_memory_intsram_size[]; |
---|
90 | |
---|
91 | extern char atsam_memory_itcm_begin[]; |
---|
92 | extern char atsam_memory_itcm_end[]; |
---|
93 | extern char atsam_memory_itcm_size[]; |
---|
94 | |
---|
95 | extern char atsam_memory_nocache_begin[]; |
---|
96 | extern char atsam_memory_nocache_end[]; |
---|
97 | extern char atsam_memory_nocache_size[]; |
---|
98 | |
---|
99 | extern char atsam_memory_qspiflash_begin[]; |
---|
100 | extern char atsam_memory_qspiflash_end[]; |
---|
101 | extern char atsam_memory_qspiflash_size[]; |
---|
102 | |
---|
103 | extern char atsam_memory_sdram_begin[]; |
---|
104 | extern char atsam_memory_sdram_end[]; |
---|
105 | extern char atsam_memory_sdram_size[]; |
---|
106 | |
---|
107 | void atsam_rtc_get_time(rtems_time_of_day *tod); |
---|
108 | |
---|
109 | |
---|
110 | |
---|
111 | void 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 */ |
---|