1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup RTEMSBSPsPowerPCMPC55XX |
---|
5 | * |
---|
6 | * @brief Low-level configuration. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * Copyright (c) 2008-2012 embedded brains GmbH. All rights reserved. |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.org/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #ifndef LIBBSP_POWERPC_MPC55XXEVB_MPC55XX_CONFIG_H |
---|
18 | #define LIBBSP_POWERPC_MPC55XXEVB_MPC55XX_CONFIG_H |
---|
19 | |
---|
20 | #include <stddef.h> |
---|
21 | |
---|
22 | #include <libcpu/powerpc-utility.h> |
---|
23 | |
---|
24 | #include <bsp/start.h> |
---|
25 | |
---|
26 | #include <mpc55xx/regs.h> |
---|
27 | #include <mpc55xx/regs-mmu.h> |
---|
28 | #include <mpc55xx/siu.h> |
---|
29 | |
---|
30 | #ifdef __cplusplus |
---|
31 | extern "C" { |
---|
32 | #endif /* __cplusplus */ |
---|
33 | |
---|
34 | typedef struct { |
---|
35 | uint32_t index : 10; |
---|
36 | uint32_t count : 10; |
---|
37 | uint32_t output : 1; |
---|
38 | union SIU_PCR_tag pcr; |
---|
39 | } mpc55xx_siu_pcr_config; |
---|
40 | |
---|
41 | extern BSP_START_DATA_SECTION const mpc55xx_siu_pcr_config |
---|
42 | mpc55xx_start_config_siu_pcr []; |
---|
43 | |
---|
44 | extern BSP_START_DATA_SECTION const size_t |
---|
45 | mpc55xx_start_config_siu_pcr_count []; |
---|
46 | |
---|
47 | extern BSP_START_DATA_SECTION const struct |
---|
48 | MMU_tag mpc55xx_start_config_mmu_early []; |
---|
49 | |
---|
50 | extern BSP_START_DATA_SECTION const size_t |
---|
51 | mpc55xx_start_config_mmu_early_count []; |
---|
52 | |
---|
53 | extern BSP_START_DATA_SECTION const struct |
---|
54 | MMU_tag mpc55xx_start_config_mmu []; |
---|
55 | |
---|
56 | extern BSP_START_DATA_SECTION const size_t |
---|
57 | mpc55xx_start_config_mmu_count []; |
---|
58 | |
---|
59 | #ifdef MPC55XX_HAS_FMPLL |
---|
60 | typedef struct { |
---|
61 | union FMPLL_SYNCR_tag syncr_tmp; |
---|
62 | union FMPLL_SYNCR_tag syncr_final; |
---|
63 | } mpc55xx_clock_config; |
---|
64 | #endif |
---|
65 | |
---|
66 | #ifdef MPC55XX_HAS_FMPLL_ENHANCED |
---|
67 | typedef struct { |
---|
68 | union FMPLL_ESYNCR2_tag esyncr2_tmp; |
---|
69 | union FMPLL_ESYNCR2_tag esyncr2_final; |
---|
70 | union FMPLL_ESYNCR1_tag esyncr1_final; |
---|
71 | } mpc55xx_clock_config; |
---|
72 | #endif |
---|
73 | |
---|
74 | #ifdef MPC55XX_HAS_MODE_CONTROL |
---|
75 | typedef struct { |
---|
76 | struct { |
---|
77 | PLLD_CR_32B_tag cr; |
---|
78 | PLLD_MR_32B_tag mr; |
---|
79 | } fmpll [2]; |
---|
80 | CGM_OC_EN_32B_tag oc_en; |
---|
81 | CGM_OCDS_SC_32B_tag ocds_sc; |
---|
82 | CGM_SC_DC0_3_32B_tag sc_dc0_3; |
---|
83 | CGM_AUXCLK_tag auxclk [5]; |
---|
84 | } mpc55xx_clock_config; |
---|
85 | #endif |
---|
86 | |
---|
87 | extern BSP_START_DATA_SECTION const mpc55xx_clock_config |
---|
88 | mpc55xx_start_config_clock []; |
---|
89 | |
---|
90 | #ifdef MPC55XX_HAS_EBI |
---|
91 | typedef struct { |
---|
92 | union EBI_MCR_tag ebi_mcr; |
---|
93 | uint32_t siu_eccr_ebdf; |
---|
94 | } mpc55xx_ebi_config; |
---|
95 | |
---|
96 | extern BSP_START_DATA_SECTION const mpc55xx_ebi_config |
---|
97 | mpc55xx_start_config_ebi []; |
---|
98 | |
---|
99 | extern BSP_START_DATA_SECTION const size_t |
---|
100 | mpc55xx_start_config_ebi_count []; |
---|
101 | |
---|
102 | extern BSP_START_DATA_SECTION const struct EBI_CS_tag |
---|
103 | mpc55xx_start_config_ebi_cs []; |
---|
104 | |
---|
105 | extern BSP_START_DATA_SECTION const size_t |
---|
106 | mpc55xx_start_config_ebi_cs_count []; |
---|
107 | |
---|
108 | extern BSP_START_DATA_SECTION const struct EBI_CAL_CS_tag |
---|
109 | mpc55xx_start_config_ebi_cal_cs []; |
---|
110 | |
---|
111 | extern BSP_START_DATA_SECTION const size_t |
---|
112 | mpc55xx_start_config_ebi_cal_cs_count []; |
---|
113 | #endif |
---|
114 | |
---|
115 | /** |
---|
116 | * @brief Start prologue. |
---|
117 | * |
---|
118 | * In case the BSP enabled the MPC55XX_ENABLE_START_PROLOGUE option, then this |
---|
119 | * function will be called directly after the Boot Assist Module (BAM) jumped |
---|
120 | * to the start entry defined by the reset configuration. |
---|
121 | * |
---|
122 | * This function executes in the context initialized by the BAM. There exists |
---|
123 | * no valid stack pointer and the internal RAM has an invalid ECC state. |
---|
124 | * |
---|
125 | * The default implementation does nothing. The application may provide its |
---|
126 | * own implementation. |
---|
127 | */ |
---|
128 | void mpc55xx_start_prologue(void); |
---|
129 | |
---|
130 | void mpc55xx_start_early(void); |
---|
131 | |
---|
132 | void mpc55xx_start_flash(void); |
---|
133 | |
---|
134 | void mpc55xx_start_cache(void); |
---|
135 | |
---|
136 | void mpc55xx_start_clock(void); |
---|
137 | |
---|
138 | void mpc55xx_start_watchdog(void); |
---|
139 | |
---|
140 | void mpc55xx_start_mmu_apply_config(const struct MMU_tag *config, size_t count); |
---|
141 | |
---|
142 | uint32_t mpc55xx_get_system_clock(void); |
---|
143 | |
---|
144 | LINKER_SYMBOL(bsp_ram_start) |
---|
145 | LINKER_SYMBOL(bsp_ram_end) |
---|
146 | LINKER_SYMBOL(bsp_ram_size) |
---|
147 | |
---|
148 | LINKER_SYMBOL(bsp_ram_1_start) |
---|
149 | LINKER_SYMBOL(bsp_ram_1_end) |
---|
150 | LINKER_SYMBOL(bsp_ram_1_size) |
---|
151 | |
---|
152 | LINKER_SYMBOL(bsp_rom_start) |
---|
153 | LINKER_SYMBOL(bsp_rom_end) |
---|
154 | LINKER_SYMBOL(bsp_rom_size) |
---|
155 | |
---|
156 | #ifdef MPC55XX_BOOTFLAGS |
---|
157 | extern uint32_t mpc55xx_bootflag_0 []; |
---|
158 | #endif |
---|
159 | |
---|
160 | #ifdef __cplusplus |
---|
161 | } |
---|
162 | #endif /* __cplusplus */ |
---|
163 | |
---|
164 | #endif /* LIBBSP_POWERPC_MPC55XXEVB_MPC55XX_CONFIG_H */ |
---|