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