diff --git a/drivers/marvell/ccu.c b/drivers/marvell/ccu.c index 1e4ab44da..c73516eae 100644 --- a/drivers/marvell/ccu.c +++ b/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; diff --git a/include/drivers/marvell/ccu.h b/include/drivers/marvell/ccu.h index b0d1ec984..413ffb972 100644 --- a/include/drivers/marvell/ccu.h +++ b/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 */