Lines Matching refs:win
116 unsigned int (*win_cfg_offset)(const int win);
117 unsigned int (*win_remap_offset)(const int win);
191 const int win) in mvebu_mbus_window_is_remappable() argument
193 return mbus->soc->win_remap_offset(win) != MVEBU_MBUS_NO_REMAP; in mvebu_mbus_window_is_remappable()
201 int win, int *enabled, u64 *base, in mvebu_mbus_read_window() argument
206 mbus->soc->win_cfg_offset(win); in mvebu_mbus_read_window()
227 if (mvebu_mbus_window_is_remappable(mbus, win)) { in mvebu_mbus_read_window()
230 mbus->soc->win_remap_offset(win); in mvebu_mbus_read_window()
240 int win) in mvebu_mbus_disable_window() argument
244 addr = mbus->mbuswins_base + mbus->soc->win_cfg_offset(win); in mvebu_mbus_disable_window()
248 if (mvebu_mbus_window_is_remappable(mbus, win)) { in mvebu_mbus_disable_window()
249 addr = mbus->mbuswins_base + mbus->soc->win_remap_offset(win); in mvebu_mbus_disable_window()
258 const int win) in mvebu_mbus_window_is_free() argument
261 mbus->soc->win_cfg_offset(win); in mvebu_mbus_window_is_free()
276 int win; in mvebu_mbus_window_conflicts() local
278 for (win = 0; win < mbus->soc->num_wins; win++) { in mvebu_mbus_window_conflicts()
284 mvebu_mbus_read_window(mbus, win, in mvebu_mbus_window_conflicts()
307 int win; in mvebu_mbus_find_window() local
309 for (win = 0; win < mbus->soc->num_wins; win++) { in mvebu_mbus_find_window()
314 mvebu_mbus_read_window(mbus, win, in mvebu_mbus_find_window()
322 return win; in mvebu_mbus_find_window()
329 int win, phys_addr_t base, size_t size, in mvebu_mbus_setup_window() argument
334 mbus->soc->win_cfg_offset(win); in mvebu_mbus_setup_window()
358 if (mvebu_mbus_window_is_remappable(mbus, win)) { in mvebu_mbus_setup_window()
360 mbus->soc->win_remap_offset(win); in mvebu_mbus_setup_window()
378 int win; in mvebu_mbus_alloc_window() local
381 for (win = 0; win < mbus->soc->num_wins; win++) { in mvebu_mbus_alloc_window()
382 if (mvebu_mbus_window_is_remappable(mbus, win)) in mvebu_mbus_alloc_window()
385 if (mvebu_mbus_window_is_free(mbus, win)) in mvebu_mbus_alloc_window()
386 return mvebu_mbus_setup_window(mbus, win, base, in mvebu_mbus_alloc_window()
392 for (win = 0; win < mbus->soc->num_wins; win++) { in mvebu_mbus_alloc_window()
395 !mvebu_mbus_window_is_remappable(mbus, win)) in mvebu_mbus_alloc_window()
398 if (mvebu_mbus_window_is_free(mbus, win)) in mvebu_mbus_alloc_window()
399 return mvebu_mbus_setup_window(mbus, win, base, size, in mvebu_mbus_alloc_window()
488 int win; in mvebu_devs_debug_show() local
490 for (win = 0; win < mbus->soc->num_wins; win++) { in mvebu_devs_debug_show()
496 mvebu_mbus_read_window(mbus, win, in mvebu_devs_debug_show()
501 seq_printf(seq, "[%02d] disabled\n", win); in mvebu_devs_debug_show()
506 win, (unsigned long long)wbase, in mvebu_devs_debug_show()
513 if (mvebu_mbus_window_is_remappable(mbus, win)) { in mvebu_devs_debug_show()
539 static unsigned int generic_mbus_win_cfg_offset(int win) in generic_mbus_win_cfg_offset() argument
541 return win << 4; in generic_mbus_win_cfg_offset()
544 static unsigned int armada_370_xp_mbus_win_cfg_offset(int win) in armada_370_xp_mbus_win_cfg_offset() argument
558 if (win < 8) in armada_370_xp_mbus_win_cfg_offset()
559 return win << 4; in armada_370_xp_mbus_win_cfg_offset()
561 return 0x90 + ((win - 8) << 3); in armada_370_xp_mbus_win_cfg_offset()
564 static unsigned int mv78xx0_mbus_win_cfg_offset(int win) in mv78xx0_mbus_win_cfg_offset() argument
566 if (win < 8) in mv78xx0_mbus_win_cfg_offset()
567 return win << 4; in mv78xx0_mbus_win_cfg_offset()
569 return 0x900 + ((win - 8) << 4); in mv78xx0_mbus_win_cfg_offset()
572 static unsigned int generic_mbus_win_remap_2_offset(int win) in generic_mbus_win_remap_2_offset() argument
574 if (win < 2) in generic_mbus_win_remap_2_offset()
575 return generic_mbus_win_cfg_offset(win); in generic_mbus_win_remap_2_offset()
580 static unsigned int generic_mbus_win_remap_4_offset(int win) in generic_mbus_win_remap_4_offset() argument
582 if (win < 4) in generic_mbus_win_remap_4_offset()
583 return generic_mbus_win_cfg_offset(win); in generic_mbus_win_remap_4_offset()
588 static unsigned int generic_mbus_win_remap_8_offset(int win) in generic_mbus_win_remap_8_offset() argument
590 if (win < 8) in generic_mbus_win_remap_8_offset()
591 return generic_mbus_win_cfg_offset(win); in generic_mbus_win_remap_8_offset()
596 static unsigned int armada_xp_mbus_win_remap_offset(int win) in armada_xp_mbus_win_remap_offset() argument
598 if (win < 8) in armada_xp_mbus_win_remap_offset()
599 return generic_mbus_win_cfg_offset(win); in armada_xp_mbus_win_remap_offset()
600 else if (win == 13) in armada_xp_mbus_win_remap_offset()
927 int win; in mvebu_mbus_del_window() local
929 win = mvebu_mbus_find_window(&mbus_state, base, size); in mvebu_mbus_del_window()
930 if (win < 0) in mvebu_mbus_del_window()
931 return win; in mvebu_mbus_del_window()
933 mvebu_mbus_disable_window(&mbus_state, win); in mvebu_mbus_del_window()
983 int win; in mvebu_mbus_get_io_win_info() local
985 for (win = 0; win < mbus_state.soc->num_wins; win++) { in mvebu_mbus_get_io_win_info()
989 mvebu_mbus_read_window(&mbus_state, win, &enabled, &wbase, in mvebu_mbus_get_io_win_info()
996 return win; in mvebu_mbus_get_io_win_info()
1032 int win; in mvebu_mbus_suspend() local
1037 for (win = 0; win < s->soc->num_wins; win++) { in mvebu_mbus_suspend()
1039 s->soc->win_cfg_offset(win); in mvebu_mbus_suspend()
1042 s->wins[win].base = readl(addr + WIN_BASE_OFF); in mvebu_mbus_suspend()
1043 s->wins[win].ctrl = readl(addr + WIN_CTRL_OFF); in mvebu_mbus_suspend()
1045 if (!mvebu_mbus_window_is_remappable(s, win)) in mvebu_mbus_suspend()
1049 s->soc->win_remap_offset(win); in mvebu_mbus_suspend()
1051 s->wins[win].remap_lo = readl(addr_rmp + WIN_REMAP_LO_OFF); in mvebu_mbus_suspend()
1052 s->wins[win].remap_hi = readl(addr_rmp + WIN_REMAP_HI_OFF); in mvebu_mbus_suspend()
1066 int win; in mvebu_mbus_resume() local
1073 for (win = 0; win < s->soc->num_wins; win++) { in mvebu_mbus_resume()
1075 s->soc->win_cfg_offset(win); in mvebu_mbus_resume()
1078 writel(s->wins[win].base, addr + WIN_BASE_OFF); in mvebu_mbus_resume()
1079 writel(s->wins[win].ctrl, addr + WIN_CTRL_OFF); in mvebu_mbus_resume()
1081 if (!mvebu_mbus_window_is_remappable(s, win)) in mvebu_mbus_resume()
1085 s->soc->win_remap_offset(win); in mvebu_mbus_resume()
1087 writel(s->wins[win].remap_lo, addr_rmp + WIN_REMAP_LO_OFF); in mvebu_mbus_resume()
1088 writel(s->wins[win].remap_hi, addr_rmp + WIN_REMAP_HI_OFF); in mvebu_mbus_resume()
1106 int win; in mvebu_mbus_common_init() local
1131 for (win = 0; win < mbus->soc->num_wins; win++) in mvebu_mbus_common_init()
1132 mvebu_mbus_disable_window(mbus, win); in mvebu_mbus_common_init()