Lines Matching +full:2 +full:- +full:win
4 * SPDX-License-Identifier: BSD-3-Clause
25 #define ADDRESS_SHIFT (20 - 4)
32 * Unit Id bits [5:2] = 2
34 * 0x37f9b809 - 11011111111 0011011100000 0010 0 1
41 * Unit Id bits [5:2] = 2
43 * 0x7ffa0009 - 111111111111 0100000000000 0010 0 1
50 * Unit Id bits [5:2] = 2
52 * 0xfffc000d - 1111111111111 1000000000000 0011 0 1
60 #define CCU_RGF(win) (MVEBU_CCU_BASE(MVEBU_AP0) + \ argument
61 0x90 + 4 * (win))
75 printf("\t----------------------------------------------------\n"); in dump_ccu()
93 printf("\tccu GCR %d - all other transactions\n", target_id); in dump_ccu()
97 void ccu_win_check(struct addr_map_win *win) in ccu_win_check() argument
100 if (IS_NOT_ALIGN(win->base_addr, CCU_WIN_ALIGNMENT)) { in ccu_win_check()
101 win->base_addr = ALIGN_UP(win->base_addr, CCU_WIN_ALIGNMENT); in ccu_win_check()
103 __func__, win->base_addr); in ccu_win_check()
107 if (IS_NOT_ALIGN(win->win_size, CCU_WIN_ALIGNMENT)) { in ccu_win_check()
108 win->win_size = ALIGN_UP(win->win_size, CCU_WIN_ALIGNMENT); in ccu_win_check()
110 __func__, win->win_size); in ccu_win_check()
120 void ccu_enable_win(int ap_index, struct addr_map_win *win, uint32_t win_id) in ccu_enable_win() argument
131 end_addr = (win->base_addr + win->win_size - 1); in ccu_enable_win()
132 alr = (uint32_t)((win->base_addr >> ADDRESS_SHIFT) & ADDRESS_MASK); in ccu_enable_win()
139 ccu_win_reg |= (win->target_id & CCU_TARGET_ID_MASK) in ccu_enable_win()
158 /* Insert/Remove temporary window for using the out-of reset default
166 void ccu_temp_win_insert(int ap_index, struct addr_map_win *win, int size) in ccu_temp_win_insert() argument
171 win_id = MVEBU_CCU_MAX_WINS - 1 - i; in ccu_temp_win_insert()
172 ccu_win_check(win); in ccu_temp_win_insert()
173 ccu_enable_win(ap_index, win, win_id); in ccu_temp_win_insert()
174 win++; in ccu_temp_win_insert()
182 void ccu_temp_win_remove(int ap_index, struct addr_map_win *win, int size) in ccu_temp_win_remove() argument
190 win_id = MVEBU_CCU_MAX_WINS - 1 - i; in ccu_temp_win_remove()
199 if ((win->target_id != target) || (win->base_addr != base)) { in ccu_temp_win_remove()
200 ERROR("%s: Trying to remove bad window-%d!\n", in ccu_temp_win_remove()
205 win++; in ccu_temp_win_remove()
211 * The AP0 DRAM window is located at index 2 only at the BL31 execution start.
217 /* On BLE stage the AP0 DRAM window is opened by the BootROM at index 2. in ccu_dram_target_get()
219 * The AP0 DRAM window is moved from index 2 to 1 during in ccu_dram_target_get()
222 const uint32_t win_id = (ap_index == 0) ? 2 : 1; in ccu_dram_target_get()
234 /* On BLE stage the AP0 DRAM window is opened by the BootROM at index 2. in ccu_dram_target_set()
236 * The AP0 DRAM window is moved from index 2 to 1 in ccu_dram_target_set()
239 const uint32_t win_id = (ap_index == 0) ? 2 : 1; in ccu_dram_target_set()
249 void ccu_dram_win_config(int ap_index, struct addr_map_win *win) in ccu_dram_win_config() argument
252 /* On BLE stage the AP0 DRAM window is opened by the BootROM at index 2. in ccu_dram_win_config()
256 const uint32_t win_id = (ap_index == 0) ? 2 : 1; in ccu_dram_win_config()
260 * The AP0 still has the old window BootROM DRAM at index 2, so in ccu_dram_win_config()
261 * the window-1 can be safely disabled without breaking the DRAM access. in ccu_dram_win_config()
270 ccu_win_check(win); in ccu_dram_win_config()
271 ccu_enable_win(ap_index, win, win_id); in ccu_dram_win_config()
306 ccu_save_win_range(ap_id, 0, MVEBU_CCU_MAX_WINS - 1, ccu_regs_save); in ccu_save_win_all()
311 ccu_restore_win_range(ap_id, 0, MVEBU_CCU_MAX_WINS - 1, ccu_regs_save); in ccu_restore_win_all()
316 struct addr_map_win *win, *dram_win; in init_ccu() local
321 /* In BootROM context CCU Window-1 in init_ccu()
324 const uint32_t win_start = 2; in init_ccu()
332 marvell_get_ccu_memory_map(ap_index, &win, &win_count); in init_ccu()
335 } else if (win_count > (MVEBU_CCU_MAX_WINS - 1)) { in init_ccu()
355 for (dram_win = win, array_id = 0; array_id < win_count; in init_ccu()
357 if (IS_DRAM_TARGET(dram_win->target_id)) { in init_ccu()
358 dram_win->target_id = dram_target; in init_ccu()
364 * Window-0 is always bypassed since it already contains in init_ccu()
380 ccu_win_check(win); in init_ccu()
381 ccu_enable_win(ap_index, win, win_id); in init_ccu()
382 win++; in init_ccu()
403 * EERATA ID: RES-3033912 - Internal Address Space Init state causes in errata_wa_init()