diff options
author | Hanna Hawa <hannah@marvell.com> | 2017-08-28 18:16:29 +0300 |
---|---|---|
committer | Kostya Porotchkin <kostap@marvell.com> | 2017-08-29 10:07:03 +0300 |
commit | 9222f3209a9fb3bd3302ee805035fc686df35e21 (patch) | |
tree | 7b3e790768d21662b92c70cbb0f76b6c7cc86e9a | |
parent | 0a488dab524124f75f11f8ce43e04c94439becf7 (diff) |
fix: mvebu: ccu: remove skip window function
Skip window function as we don't use it any more,
this function was added to skip the SRAM window in
old u-boot revision, since we move all the window
configuration to ATF, no need for it.
Skip window #1, because it configured by default
to internal registers.
Change-Id: I9ad3fedfb3ac770652430db3c8679ebefda4fae2
Signed-off-by: Hanna Hawa <hannah@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/43465
Tested-by: iSoC Platform CI <ykjenk@marvell.com>
Reviewed-by: Kostya Porotchkin <kostap@marvell.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
-rw-r--r-- | drivers/marvell/ccu.c | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/drivers/marvell/ccu.c b/drivers/marvell/ccu.c index f68447d0..9c2f9f9e 100644 --- a/drivers/marvell/ccu.c +++ b/drivers/marvell/ccu.c @@ -178,22 +178,6 @@ void ccu_enable_win(struct ccu_win *win, uint32_t win_id) mmio_write_32(CCU_WIN_CR_OFFSET(win_id), ccu_win_reg); } -static int skip_ccu_window(uint32_t win_reg) -{ - uint8_t target_id; - - /* avoid overriding internal register and SRAM windows - At SPL stage BootROM open the SRAM window and close it - at the end of the SPL stage */ - if (win_reg & WIN_ENABLE_BIT) { - target_id = (win_reg >> CCU_TARGET_ID_OFFSET) & CCU_TARGET_ID_MASK; - if (((target_id) == SRAM_TID) || ((target_id) == CFG_REG_TID)) - return 1; - } - - return 0; -} - int init_ccu(int ap_index) { struct ccu_win *win; @@ -223,11 +207,9 @@ int init_ccu(int ap_index) win_reg = (marvell_get_ccu_gcr_target(ap_index) & CCU_GCR_TARGET_MASK) << CCU_GCR_TARGET_OFFSET; mmio_write_32(CCU_WIN_GCR_OFFSET, win_reg); - /* disable AP windows */ - for (win_id = 0; win_id < ccu_info->max_win; win_id++) { + /* disable all AP windows, start from 1 to avoid overriding internal registers */ + for (win_id = 1; win_id < ccu_info->max_win; win_id++) { win_reg = mmio_read_32(CCU_WIN_CR_OFFSET(win_id)); - if (skip_ccu_window(win_reg)) - continue; win_reg &= ~WIN_ENABLE_BIT; mmio_write_32(CCU_WIN_CR_OFFSET(win_id), win_reg); @@ -237,15 +219,10 @@ int init_ccu(int ap_index) mmio_write_32(CCU_WIN_SCR_OFFSET(win_id), win_reg); } - for (win_id = 0, array_id = 0; + /* win_id is the index of the current ccu window + ** array_id is the index of the current memory map window entry */ + for (win_id = 1, array_id = 0; ((win_id < ccu_info->max_win) && (array_id < win_count)); win_id++) { - /* win_id is the index of the current ccu window - array_id is the index of the current FDT window entry */ - - win_reg = mmio_read_32(CCU_WIN_CR_OFFSET(win_id)); - if (skip_ccu_window(win_reg)) - continue; - ccu_win_check(win, win_id); ccu_enable_win(win, win_id); |