1 | /*===============================================================*\ |
---|
2 | | Project: RTEMS generic mcf548x BSP | |
---|
3 | +-----------------------------------------------------------------+ |
---|
4 | | File: bsp.h | |
---|
5 | +-----------------------------------------------------------------+ |
---|
6 | | The file contains the BSP header of generic MCF548x BSP. | |
---|
7 | +-----------------------------------------------------------------+ |
---|
8 | | Copyright (c) 2007 | |
---|
9 | | Embedded Brains GmbH | |
---|
10 | | Obere Lagerstr. 30 | |
---|
11 | | D-82178 Puchheim | |
---|
12 | | Germany | |
---|
13 | | rtems@embedded-brains.de | |
---|
14 | +-----------------------------------------------------------------+ |
---|
15 | | | |
---|
16 | | Parts of the code has been derived from the "dBUG source code" | |
---|
17 | | package Freescale is providing for M548X EVBs. The usage of | |
---|
18 | | the modified or unmodified code and it's integration into the | |
---|
19 | | generic mcf548x BSP has been done according to the Freescale | |
---|
20 | | license terms. | |
---|
21 | | | |
---|
22 | | The Freescale license terms can be reviewed in the file | |
---|
23 | | | |
---|
24 | | Freescale_license.txt | |
---|
25 | | | |
---|
26 | +-----------------------------------------------------------------+ |
---|
27 | | | |
---|
28 | | The generic mcf548x BSP has been developed on the basic | |
---|
29 | | structures and modules of the av5282 BSP. | |
---|
30 | | | |
---|
31 | +-----------------------------------------------------------------+ |
---|
32 | | | |
---|
33 | | The license and distribution terms for this file may be | |
---|
34 | | found in the file LICENSE in this distribution or at | |
---|
35 | | | |
---|
36 | | http://www.rtems.com/license/LICENSE. | |
---|
37 | | | |
---|
38 | +-----------------------------------------------------------------+ |
---|
39 | | | |
---|
40 | | date history ID | |
---|
41 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
---|
42 | | 12.11.07 1.0 ras | |
---|
43 | | | |
---|
44 | \*===============================================================*/ |
---|
45 | |
---|
46 | #ifndef __GENMCF548X_BSP_H |
---|
47 | #define __GENMCF548X_BSP_H |
---|
48 | |
---|
49 | #ifdef __cplusplus |
---|
50 | extern "C" { |
---|
51 | #endif |
---|
52 | #include <bspopts.h> |
---|
53 | #include <bsp/default-initial-extension.h> |
---|
54 | |
---|
55 | #include <rtems.h> |
---|
56 | #include <rtems/iosupp.h> |
---|
57 | #include <rtems/console.h> |
---|
58 | #include <rtems/clockdrv.h> |
---|
59 | #include <rtems/iosupp.h> |
---|
60 | #include <rtems/bspIo.h> |
---|
61 | |
---|
62 | /***************************************************************************/ |
---|
63 | /** Hardware data structure headers **/ |
---|
64 | #include <mcf548x/mcf548x.h> |
---|
65 | |
---|
66 | /***************************************************************************/ |
---|
67 | /** Network driver configuration **/ |
---|
68 | struct rtems_bsdnet_ifconfig; |
---|
69 | extern int rtems_fec_driver_attach (struct rtems_bsdnet_ifconfig *config, int attaching ); |
---|
70 | #define RTEMS_BSP_NETWORK_DRIVER_NAME "fs1" |
---|
71 | #define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_fec_driver_attach |
---|
72 | |
---|
73 | /***************************************************************************/ |
---|
74 | /** User Definable configuration **/ |
---|
75 | |
---|
76 | /* define which port the console should use - all other ports are then defined as general purpose */ |
---|
77 | #define CONSOLE_PORT 0 |
---|
78 | |
---|
79 | #define RAM_END 0x4000000 /* 64 MB */ |
---|
80 | |
---|
81 | /* functions */ |
---|
82 | |
---|
83 | uint32_t get_CPU_clock_speed(void); |
---|
84 | |
---|
85 | rtems_isr_entry set_vector( |
---|
86 | rtems_isr_entry handler, |
---|
87 | rtems_vector_number vector, |
---|
88 | int type |
---|
89 | ); |
---|
90 | |
---|
91 | /* |
---|
92 | * Interrupt assignments |
---|
93 | * Highest-priority listed first |
---|
94 | */ |
---|
95 | #define SLT0_IRQ_LEVEL 4 |
---|
96 | #define SLT0_IRQ_PRIORITY 0 |
---|
97 | |
---|
98 | #define PSC0_IRQ_LEVEL 3 |
---|
99 | #define PSC0_IRQ_PRIORITY 7 |
---|
100 | #define PSC1_IRQ_LEVEL 3 |
---|
101 | #define PSC1_IRQ_PRIORITY 6 |
---|
102 | #define PSC2_IRQ_LEVEL 3 |
---|
103 | #define PSC2_IRQ_PRIORITY 5 |
---|
104 | #define PSC3_IRQ_LEVEL 3 |
---|
105 | #define PSC3_IRQ_PRIORITY 4 |
---|
106 | |
---|
107 | #define FEC_IRQ_LEVEL 2 |
---|
108 | #define FEC_IRQ_PRIORITY 3 |
---|
109 | |
---|
110 | /* |
---|
111 | * Network driver configuration |
---|
112 | */ |
---|
113 | struct rtems_bsdnet_ifconfig; |
---|
114 | extern int rtems_mcf548x_fec_driver_attach_detach(struct rtems_bsdnet_ifconfig *config,int attaching); |
---|
115 | #define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_mcf548x_fec_driver_attach_detach |
---|
116 | |
---|
117 | #define RTEMS_BSP_NETWORK_DRIVER_NAME "fec1" |
---|
118 | #define RTEMS_BSP_NETWORK_DRIVER_NAME2 "fec2" |
---|
119 | |
---|
120 | #ifdef HAS_DBUG |
---|
121 | typedef struct { |
---|
122 | uint32_t console_baudrate; |
---|
123 | uint8_t server_ip [4]; |
---|
124 | uint8_t client_ip [4]; |
---|
125 | uint8_t gateway_ip[4]; |
---|
126 | uint8_t netmask [4]; |
---|
127 | uint8_t spare[4]; |
---|
128 | uint8_t macaddr [6]; |
---|
129 | uint32_t ethport; /* default fec port: 1 = fec1, 2 = fec2 */ |
---|
130 | uint32_t uartport; /* default fec port: 1 = psc0, 2 = psc1... */ |
---|
131 | } dbug_settings_t; |
---|
132 | |
---|
133 | #define DBUG_SETTINGS (*(const dbug_settings_t *)0xFC020000) |
---|
134 | #endif /* HAS_DBUG */ |
---|
135 | #ifdef __cplusplus |
---|
136 | } |
---|
137 | #endif |
---|
138 | |
---|
139 | #endif |
---|