[61f8fb0e] | 1 | /* bsp.h |
---|
[3495c57] | 2 | * |
---|
[61f8fb0e] | 3 | * This include file contains all board IO definitions for bf537Stamp. |
---|
| 4 | * |
---|
| 5 | * Copyright (c) 2006 by Atos Automacao Industrial Ltda. |
---|
| 6 | * written by Alain Schaefer <alain.schaefer@easc.ch> |
---|
| 7 | * and Antonio Giovanini <antonio@atos.com.br> |
---|
| 8 | * |
---|
| 9 | * The license and distribution terms for this file may be |
---|
| 10 | * found in the file LICENSE in this distribution or at |
---|
[c499856] | 11 | * http://www.rtems.org/license/LICENSE. |
---|
[61f8fb0e] | 12 | */ |
---|
[3495c57] | 13 | |
---|
[61f8fb0e] | 14 | |
---|
[9cff822a] | 15 | #ifndef LIBBSP_BFIN_BF537STAMP_BSP_H |
---|
| 16 | #define LIBBSP_BFIN_BF537STAMP_BSP_H |
---|
[61f8fb0e] | 17 | |
---|
[ed6365a] | 18 | #ifndef ASM |
---|
| 19 | |
---|
[61f8fb0e] | 20 | #include <bspopts.h> |
---|
[a052181] | 21 | #include <bsp/default-initial-extension.h> |
---|
[61f8fb0e] | 22 | |
---|
| 23 | #include <rtems.h> |
---|
| 24 | |
---|
| 25 | #include <libcpu/bf537.h> |
---|
| 26 | #include <libcpu/memoryRegs.h> |
---|
| 27 | |
---|
[46dde0fc] | 28 | #ifdef __cplusplus |
---|
| 29 | extern "C" { |
---|
| 30 | #endif |
---|
| 31 | |
---|
[61f8fb0e] | 32 | /* configure data cache to use 16K of each SRAM bank when enabled */ |
---|
| 33 | #define BSP_DATA_CACHE_CONFIG (3 << DMEM_CONTROL_DMC_SHIFT) |
---|
| 34 | |
---|
| 35 | |
---|
[3495c57] | 36 | /* |
---|
[61f8fb0e] | 37 | * PLL and clock setup values: |
---|
| 38 | */ |
---|
| 39 | |
---|
| 40 | /* |
---|
| 41 | * PLL configuration for bf533Stamp |
---|
| 42 | * |
---|
| 43 | * XTL = 27 MHz |
---|
| 44 | * CLKIN = 13 MHz |
---|
| 45 | * VCO = 391 MHz |
---|
| 46 | * CCLK = 391 MHz |
---|
| 47 | * SCLK = 130 MHz |
---|
| 48 | */ |
---|
| 49 | |
---|
| 50 | #define PLL_CSEL 0x0000 /* CCLK = VCO */ |
---|
| 51 | #define PLL_SSEL 0x0003 /* SCLK = CCLK/3 */ |
---|
| 52 | #define PLL_MSEL 0x3A00 /* VCO = 29xCLKIN */ |
---|
| 53 | #define PLL_DF 0x0001 /* CLKIN = XTL/2 */ |
---|
| 54 | |
---|
| 55 | #define CCLK 500000000 /* CORE CLOCK */ |
---|
| 56 | #define SCLK 100000000 /* SYSTEM CLOCK */ |
---|
| 57 | |
---|
| 58 | #define CONSOLE_FORCE_BAUD 57600 |
---|
| 59 | |
---|
| 60 | /* |
---|
| 61 | * Blackfin environment memory map |
---|
| 62 | */ |
---|
| 63 | #define L1_DATA_SRAM_A 0xff800000L |
---|
| 64 | |
---|
| 65 | #define FIFOLENGTH 0x100 |
---|
| 66 | |
---|
| 67 | /* |
---|
| 68 | * Simple spin delay in microsecond units for device drivers. |
---|
| 69 | * This is very dependent on the clock speed of the target. |
---|
| 70 | */ |
---|
| 71 | |
---|
| 72 | #define rtems_bsp_delay( microseconds ) \ |
---|
| 73 | { \ |
---|
| 74 | } |
---|
| 75 | |
---|
| 76 | /* Constants */ |
---|
| 77 | |
---|
| 78 | #define RAM_START 0 |
---|
| 79 | #define RAM_END 0x4000000 |
---|
| 80 | |
---|
| 81 | /* functions */ |
---|
| 82 | |
---|
| 83 | /* |
---|
| 84 | * Helper Function to use the EzKits LEDS. |
---|
| 85 | * Can be used by the Application. |
---|
| 86 | */ |
---|
| 87 | void setLED(uint8_t value); |
---|
| 88 | |
---|
| 89 | /* |
---|
| 90 | * Helper Function to use the EzKits LEDS |
---|
| 91 | */ |
---|
[ed6365a] | 92 | uint8_t getLEDs(void); |
---|
| 93 | void setLEDs(uint8_t value); |
---|
| 94 | uint8_t getButtons(void); |
---|
[61f8fb0e] | 95 | |
---|
| 96 | rtems_isr_entry set_vector( /* returns old vector */ |
---|
| 97 | rtems_isr_entry handler, /* isr routine */ |
---|
| 98 | rtems_vector_number vector, /* vector number */ |
---|
| 99 | int type /* RTEMS or RAW intr */ |
---|
| 100 | ); |
---|
| 101 | |
---|
[ed6365a] | 102 | /* |
---|
| 103 | * Internal BSP methods that are used across file boundaries |
---|
| 104 | */ |
---|
| 105 | void Init_RTC(void); |
---|
| 106 | |
---|
[61f8fb0e] | 107 | /* |
---|
| 108 | * Network driver configuration |
---|
| 109 | */ |
---|
| 110 | struct rtems_bsdnet_ifconfig; |
---|
| 111 | extern int bf537Stamp_network_driver_attach(struct rtems_bsdnet_ifconfig *, int); |
---|
| 112 | |
---|
| 113 | #define RTEMS_BSP_NETWORK_DRIVER_NAME "eth1" |
---|
| 114 | #define RTEMS_BSP_NETWORK_DRIVER_ATTACH bf537Stamp_network_driver_attach |
---|
| 115 | |
---|
| 116 | #ifdef __cplusplus |
---|
| 117 | } |
---|
| 118 | #endif |
---|
| 119 | |
---|
[ed6365a] | 120 | #endif /* !ASM */ |
---|
| 121 | |
---|
[61f8fb0e] | 122 | #endif |
---|