Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:22:48

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /**
0004  * @file
0005  *
0006  * @ingroup RTEMSBSPsARMAtsam
0007  */
0008 
0009 /*
0010  * Copyright (c) 2016 embedded brains GmbH & Co. KG
0011  *
0012  * Redistribution and use in source and binary forms, with or without
0013  * modification, are permitted provided that the following conditions
0014  * are met:
0015  * 1. Redistributions of source code must retain the above copyright
0016  *    notice, this list of conditions and the following disclaimer.
0017  * 2. Redistributions in binary form must reproduce the above copyright
0018  *    notice, this list of conditions and the following disclaimer in the
0019  *    documentation and/or other materials provided with the distribution.
0020  *
0021  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0022  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0023  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0024  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0025  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0026  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0027  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0028  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0029  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0030  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0031  * POSSIBILITY OF SUCH DAMAGE.
0032  */
0033 
0034 #ifndef LIBBSP_ARM_ATSAM_BSP_H
0035 #define LIBBSP_ARM_ATSAM_BSP_H
0036 
0037 /**
0038  * @defgroup RTEMSBSPsARMAtsam Atmel/Microchip SAM E70, S70, V70 and V71
0039  *
0040  * @ingroup RTEMSBSPsARM
0041  *
0042  * @brief Atmel/Microchip SAM E70, S70, V70 and V71 Board Support Package.
0043  *
0044  * @{
0045  */
0046 
0047 #include <bspopts.h>
0048 #include <bsp/default-initial-extension.h>
0049 #include <sys/ioccom.h>
0050 
0051 #include <rtems.h>
0052 
0053 #ifdef __cplusplus
0054 extern "C" {
0055 #endif /* __cplusplus */
0056 
0057 #define BSP_FEATURE_IRQ_EXTENSION
0058 
0059 #define BSP_ARMV7M_IRQ_PRIORITY_DEFAULT (13 << 4)
0060 
0061 #define BSP_ARMV7M_SYSTICK_PRIORITY (14 << 4)
0062 
0063 uint32_t atsam_systick_frequency(void);
0064 
0065 #define BSP_ARMV7M_SYSTICK_FREQUENCY atsam_systick_frequency()
0066 
0067 struct rtems_bsdnet_ifconfig;
0068 
0069 int if_atsam_attach(struct rtems_bsdnet_ifconfig *config, int attaching);
0070 
0071 #define RTEMS_BSP_NETWORK_DRIVER_NAME "atsam0"
0072 
0073 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH if_atsam_attach
0074 
0075 /**
0076  * @brief Interface driver configuration.
0077  */
0078 typedef struct {
0079   /**
0080    * @brief Maximum retries for MDIO communication.
0081    */
0082   uint32_t mdio_retries;
0083 
0084   /**
0085    * @brief Address of PHY.
0086    *
0087    * Use 0xff to search for a PHY.
0088    */
0089   uint8_t phy_addr;
0090 } if_atsam_config;
0091 
0092 extern char atsam_memory_null_begin[];
0093 extern char atsam_memory_null_end[];
0094 extern char atsam_memory_null_size[];
0095 
0096 extern char atsam_memory_dtcm_begin[];
0097 extern char atsam_memory_dtcm_end[];
0098 extern char atsam_memory_dtcm_size[];
0099 
0100 extern char atsam_memory_intflash_begin[];
0101 extern char atsam_memory_intflash_end[];
0102 extern char atsam_memory_intflash_size[];
0103 
0104 extern char atsam_memory_intsram_begin[];
0105 extern char atsam_memory_intsram_end[];
0106 extern char atsam_memory_intsram_size[];
0107 
0108 extern char atsam_memory_itcm_begin[];
0109 extern char atsam_memory_itcm_end[];
0110 extern char atsam_memory_itcm_size[];
0111 
0112 extern char atsam_memory_nocache_begin[];
0113 extern char atsam_memory_nocache_end[];
0114 extern char atsam_memory_nocache_size[];
0115 
0116 extern char atsam_memory_qspiflash_begin[];
0117 extern char atsam_memory_qspiflash_end[];
0118 extern char atsam_memory_qspiflash_size[];
0119 
0120 extern char atsam_memory_sdram_begin[];
0121 extern char atsam_memory_sdram_end[];
0122 extern char atsam_memory_sdram_size[];
0123 
0124 void atsam_rtc_get_time(rtems_time_of_day *tod);
0125 
0126 
0127 
0128 void bsp_restart( const void *const addr );
0129 
0130 /*
0131  * This ioctl enables the receive DMA for an UART. The DMA can be usefull if you
0132  * loose characters in high interrupt load situations.
0133  *
0134  * Disabling the DMA again is only possible by closing all file descriptors of
0135  * that UART.
0136  *
0137  * Note that every UART needs one DMA channel and the system has only a limited
0138  * amount of DMAs. So only use it if you need it.
0139  */
0140 #define ATSAM_UART_ENABLE_RX_DMA _IO('d', 0)
0141 
0142 #ifdef __cplusplus
0143 }
0144 #endif /* __cplusplus */
0145 
0146 /** @} */
0147 
0148 #endif /* LIBBSP_ARM_ATSAM_BSP_H */