Back to home page

LXR

 
 

    


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

0001 /**
0002  * @file
0003  *
0004  * @ingroup RTEMSBSPsM68kMCF5206Elite
0005  *
0006  * @brief Global BSP definitions.
0007  */
0008 
0009 /*
0010  * Board Support Package for MCF5206eLITE evaluation board
0011  * BSP definitions
0012  *
0013  * Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russia
0014  * Author: Victor V. Vengerov <vvv@oktet.ru>
0015  *
0016  * The license and distribution terms for this file may be
0017  * found in the file LICENSE in this distribution or at
0018  *
0019  * http://www.rtems.org/license/LICENSE.
0020  */
0021 
0022 #ifndef LIBBSP_M68K_MCF5206ELITE_BSP_H
0023 #define LIBBSP_M68K_MCF5206ELITE_BSP_H
0024 
0025 /**
0026  * @defgroup RTEMSBSPsM68kMCF5206Elite MCF5206eLite
0027  *
0028  * @ingroup RTEMSBSPsM68k
0029  *
0030  * @brief MCF5206eLite Board Support Package.
0031  *
0032  * @{
0033  */
0034 
0035 #include "mcf5206/mcf5206e.h"
0036 
0037 /*** Board resources allocation ***/
0038 
0039 /*
0040  * To achieve some compatibility with dBUG monitor, we use the same
0041  * memory resources allocation as it is used in dBUG.
0042  *
0043  * If this definitions will be changed, change the linker script also.
0044  */
0045 
0046 /* Memory mapping */
0047 /* CS0: Boot Flash */
0048 #define BSP_MEM_ADDR_FLASH    (0xFFE00000)
0049 #define BSP_MEM_SIZE_FLASH    (1*1024*1024)
0050 #define BSP_MEM_MASK_FLASH    (MCF5206E_CSMR_MASK_1M)
0051 
0052 /* CS2: External SRAM */
0053 #define BSP_MEM_ADDR_ESRAM    (0x30000000)
0054 #define BSP_MEM_SIZE_ESRAM    (1*1024*1024)
0055 #define BSP_MEM_MASK_ESRAM    (MCF5206E_CSMR_MASK_1M)
0056 
0057 /* CS3: General-Purpose I/O register */
0058 #define BSP_MEM_ADDR_GPIO     (0x40000000)
0059 #define BSP_MEM_SIZE_GPIO     (64*1024)
0060 #define BSP_MEM_MASK_GPIO     (MCF5206E_CSMR_MASK_64K)
0061 
0062 /* DRAM0: Dynamic RAM */
0063 #define BSP_MEM_ADDR_DRAM     (0x00000000)
0064 #define BSP_MEM_SIZE_DRAM     (16*1024*1024)
0065 #define BSP_MEM_MASK_DRAM     (MCF5206E_DCMR_MASK_16M)
0066 
0067 /* On-chip SRAM */
0068 #define BSP_MEM_ADDR_SRAM     (0x20000000)
0069 #define BSP_MEM_SIZE_SRAM     (8*1024)
0070 
0071 /* On-chip peripherial registers */
0072 #define BSP_MEM_ADDR_IMM      (0x10000000)
0073 #define BSP_MEM_SIZE_IMM      (1*1024)
0074 #define MBAR BSP_MEM_ADDR_IMM
0075 
0076 /* Interrupt vector assignment */
0077 #define BSP_INTVEC_AVEC1    (25)
0078 #define BSP_INTLVL_AVEC1    (1)
0079 #define BSP_INTPRIO_AVEC1   (3)
0080 
0081 #define BSP_INTVEC_AVEC2    (26)
0082 #define BSP_INTLVL_AVEC2    (2)
0083 #define BSP_INTPRIO_AVEC2   (3)
0084 
0085 #define BSP_INTVEC_AVEC3    (27)
0086 #define BSP_INTLVL_AVEC3    (3)
0087 #define BSP_INTPRIO_AVEC3   (3)
0088 
0089 #define BSP_INTVEC_AVEC4    (28)
0090 #define BSP_INTLVL_AVEC4    (4)
0091 #define BSP_INTPRIO_AVEC4   (3)
0092 
0093 #define BSP_INTVEC_AVEC5    (29)
0094 #define BSP_INTLVL_AVEC5    (5)
0095 #define BSP_INTPRIO_AVEC5   (3)
0096 
0097 #define BSP_INTVEC_AVEC6    (30)
0098 #define BSP_INTLVL_AVEC6    (6)
0099 #define BSP_INTPRIO_AVEC6   (3)
0100 
0101 #define BSP_INTVEC_AVEC7    (31)
0102 #define BSP_INTLVL_AVEC7    (7)
0103 #define BSP_INTPRIO_AVEC7   (3)
0104 
0105 #define BSP_INTVEC_TIMER1   (BSP_INTVEC_AVEC5)
0106 #define BSP_INTLVL_TIMER1   (BSP_INTLVL_AVEC5)
0107 #define BSP_INTPRIO_TIMER1  (2)
0108 
0109 #define BSP_INTVEC_TIMER2    (BSP_INTVEC_AVEC6)
0110 #define BSP_INTLVL_TIMER2    (BSP_INTLVL_AVEC6)
0111 #define BSP_INTPRIO_TIMER2   (2)
0112 
0113 #define BSP_INTVEC_MBUS     (BSP_INTVEC_AVEC4)
0114 #define BSP_INTLVL_MBUS     (BSP_INTLVL_AVEC4)
0115 #define BSP_INTPRIO_MBUS    (2)
0116 
0117 #define BSP_INTVEC_UART1    (64)
0118 #define BSP_INTLVL_UART1    (4)
0119 #define BSP_INTPRIO_UART1   (0)
0120 
0121 #define BSP_INTVEC_UART2    (65)
0122 #define BSP_INTLVL_UART2    (4)
0123 #define BSP_INTPRIO_UART2   (1)
0124 
0125 #define BSP_INTVEC_DMA0     (66)
0126 #define BSP_INTLVL_DMA0     (3)
0127 #define BSP_INTPRIO_DMA0    (1)
0128 
0129 #define BSP_INTVEC_DMA1     (67)
0130 #define BSP_INTLVL_DMA1     (3)
0131 #define BSP_INTPRIO_DMA1    (2)
0132 
0133 /* Location of DS1307 Real-Time Clock/NVRAM chip */
0134 #define DS1307_I2C_BUS_NUMBER (0)
0135 
0136 #ifndef ASM
0137 
0138 #include <bspopts.h>
0139 #include <rtems.h>
0140 #include <bsp/default-initial-extension.h>
0141 
0142 #ifdef __cplusplus
0143 extern "C" {
0144 #endif
0145 
0146 /* System frequency */
0147 #define BSP_SYSTEM_FREQUENCY ((unsigned int)&_SYS_CLOCK_FREQUENCY)
0148 extern char _SYS_CLOCK_FREQUENCY; /* Don't use this variable directly!!! */
0149 
0150 /* MBUS I2C bus clock default frequency */
0151 #define BSP_MBUS_FREQUENCY (16000)
0152 
0153 /* Number of I2C buses supported in this board */
0154 #define I2C_NUMBER_OF_BUSES (1)
0155 
0156 /* I2C bus selection */
0157 #define I2C_SELECT_BUS(bus)
0158 
0159 /*
0160  *  Simple spin delay in microsecond units for device drivers.
0161  *  This is very dependent on the clock speed of the target.
0162  */
0163 
0164 #define rtems_bsp_delay( microseconds ) \
0165   { register uint32_t         _delay=(microseconds); \
0166     register uint32_t         _tmp=123; \
0167     __asm__ volatile( "0: \
0168                      nbcd      %0 ; \
0169                      nbcd      %0 ; \
0170                      dbf       %1,0b" \
0171                   : "=d" (_tmp), "=d" (_delay) \
0172                   : "0"  (_tmp), "1"  (_delay) ); \
0173   }
0174 
0175 
0176 extern rtems_isr_entry M68Kvec[];   /* vector table address */
0177 
0178 extern rtems_isr (*rtems_clock_hook)(rtems_vector_number);
0179 
0180 /* functions */
0181 
0182 rtems_isr_entry set_vector(
0183   rtems_isr_entry     handler,
0184   rtems_vector_number vector,
0185   int                 type
0186 );
0187 
0188 /*
0189  * Prototypes for BSP methods that cross file boundaries
0190  */
0191 void Init5206e(void);
0192 
0193 #ifdef __cplusplus
0194 }
0195 #endif
0196 
0197 #endif /* ASM */
0198 
0199 /** @} */
0200 
0201 #endif