Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:40

0001 /**
0002  * @file
0003  *
0004  * @ingroup RTEMSBSPsBfinBF537Stamp
0005  *
0006  * @brief Global BSP definitions.
0007  */
0008 
0009 /*  bsp.h
0010  *
0011  *  This include file contains all board IO definitions for bf537Stamp.
0012  *
0013  *  Copyright (c) 2006 by Atos Automacao Industrial Ltda.
0014  *             written by Alain Schaefer <alain.schaefer@easc.ch>
0015  *                    and Antonio Giovanini <antonio@atos.com.br>
0016  *
0017  *  The license and distribution terms for this file may be
0018  *  found in the file LICENSE in this distribution or at
0019  *  http://www.rtems.org/license/LICENSE.
0020  */
0021 
0022 
0023 #ifndef LIBBSP_BFIN_BF537STAMP_BSP_H
0024 #define LIBBSP_BFIN_BF537STAMP_BSP_H
0025 
0026 /**
0027  * @defgroup RTEMSBSPsBfinBF537Stamp BF537-STAMP
0028  *
0029  * @ingroup RTEMSBSPsBfin
0030  *
0031  * @brief BF537-STAMP Board Support Package.
0032  *
0033  * @{
0034  */
0035 
0036 #ifndef ASM
0037 
0038 #include <bspopts.h>
0039 #include <bsp/default-initial-extension.h>
0040 
0041 #include <rtems.h>
0042 
0043 #include <libcpu/bf537.h>
0044 #include <libcpu/memoryRegs.h>
0045 
0046 #ifdef __cplusplus
0047 extern "C" {
0048 #endif
0049 
0050 /* configure data cache to use 16K of each SRAM bank when enabled */
0051 #define BSP_DATA_CACHE_CONFIG  (3 << DMEM_CONTROL_DMC_SHIFT)
0052 
0053 
0054 /*
0055  * PLL and clock setup values:
0056  */
0057 
0058 /*
0059  *  PLL configuration for bf533Stamp
0060  *
0061  *  XTL   =  27 MHz
0062  *  CLKIN =  13 MHz
0063  *  VCO   = 391 MHz
0064  *  CCLK  = 391 MHz
0065  *  SCLK  = 130 MHz
0066  */
0067 
0068 #define PLL_CSEL    0x0000      /* CCLK = VCO      */
0069 #define PLL_SSEL    0x0003      /* SCLK = CCLK/3   */
0070 #define PLL_MSEL    0x3A00      /* VCO = 29xCLKIN  */
0071 #define PLL_DF      0x0001      /* CLKIN = XTL/2   */
0072 
0073 #define CCLK        500000000   /* CORE CLOCK     */
0074 #define SCLK        100000000   /* SYSTEM CLOCK   */
0075 
0076 #define CONSOLE_FORCE_BAUD   57600
0077 
0078 /*
0079  * Blackfin environment memory map
0080  */
0081 #define L1_DATA_SRAM_A 0xff800000L
0082 
0083 #define FIFOLENGTH 0x100
0084 
0085 /*
0086  *  Simple spin delay in microsecond units for device drivers.
0087  *  This is very dependent on the clock speed of the target.
0088  */
0089 
0090 #define rtems_bsp_delay( microseconds ) \
0091   { \
0092   }
0093 
0094 /* Constants */
0095 
0096 #define RAM_START 0
0097 #define RAM_END   0x4000000
0098 
0099 /* functions */
0100 
0101 /*
0102  * Helper Function to use the EzKits LEDS.
0103  * Can be used by the Application.
0104  */
0105 void setLED(uint8_t value);
0106 
0107 /*
0108  * Helper Function to use the EzKits LEDS
0109  */
0110 uint8_t getLEDs(void);
0111 void setLEDs(uint8_t value);
0112 uint8_t getButtons(void);
0113 
0114 rtems_isr_entry set_vector(                     /* returns old vector */
0115   rtems_isr_entry     handler,                  /* isr routine        */
0116   rtems_vector_number vector,                   /* vector number      */
0117   int                 type                      /* RTEMS or RAW intr  */
0118 );
0119 
0120 /*
0121  *  Internal BSP methods that are used across file boundaries
0122  */
0123 void Init_RTC(void);
0124 
0125 /*
0126  * Network driver configuration
0127  */
0128 struct rtems_bsdnet_ifconfig;
0129 extern int bf537Stamp_network_driver_attach(struct rtems_bsdnet_ifconfig *, int);
0130 
0131 #define RTEMS_BSP_NETWORK_DRIVER_NAME   "eth1"
0132 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH bf537Stamp_network_driver_attach
0133 
0134 #ifdef __cplusplus
0135 }
0136 #endif
0137 
0138 #endif /* !ASM */
0139 
0140 /* @} */
0141 
0142 #endif