Browse Source

drivers: marvell: add CCU driver API for window state checking

Add ccu_is_win_enabled() API for checking the CCU window
state using AP and window indexes.

Change-Id: Ib955a2cac28b2729b0a763f3bbbea28b476a2fe4
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
pull/1979/head
Konstantin Porotchkin 6 years ago
committed by Marcin Wojtas
parent
commit
957a5add63
  1. 10
      drivers/marvell/ccu.c
  2. 1
      include/drivers/marvell/ccu.h

10
drivers/marvell/ccu.c

@ -54,8 +54,8 @@ static void dump_ccu(int ap_index)
win_id));
start = ((uint64_t)alr << ADDRESS_SHIFT);
end = (((uint64_t)ahr + 0x10) << ADDRESS_SHIFT);
printf("\tccu %02x 0x%016llx 0x%016llx\n",
target_id, start, end);
printf("\tccu%d %02x 0x%016llx 0x%016llx\n",
win_id, target_id, start, end);
}
}
win_cr = mmio_read_32(CCU_WIN_GCR_OFFSET(ap_index));
@ -81,6 +81,12 @@ void ccu_win_check(struct addr_map_win *win)
}
}
int ccu_is_win_enabled(int ap_index, uint32_t win_id)
{
return mmio_read_32(CCU_WIN_CR_OFFSET(ap_index, win_id)) &
WIN_ENABLE_BIT;
}
void ccu_enable_win(int ap_index, struct addr_map_win *win, uint32_t win_id)
{
uint32_t ccu_win_reg;

1
include/drivers/marvell/ccu.h

@ -46,6 +46,7 @@ void ccu_dram_win_config(int ap_index, struct addr_map_win *win);
void ccu_dram_target_set(int ap_index, uint32_t target);
void ccu_save_win_all(int ap_id);
void ccu_restore_win_all(int ap_id);
int ccu_is_win_enabled(int ap_index, uint32_t win_id);
#endif
#endif /* CCU_H */

Loading…
Cancel
Save