2 * Copyright (C) 2018 Marvell International Ltd.
4 * SPDX-License-Identifier: BSD-3-Clause
5 * https://spdx.org/licenses
8 /* CCU unit device driver for Marvell AP807, AP807 and AP810 SoCs */
14 #include <drivers/marvell/addr_map.h>
17 /* CCU registers definitions */
18 #define CCU_WIN_CR_OFFSET(ap, win) (MVEBU_CCU_BASE(ap) + 0x0 + \
20 #define CCU_TARGET_ID_OFFSET (8)
21 #define CCU_TARGET_ID_MASK (0x7F)
23 #define CCU_WIN_SCR_OFFSET(ap, win) (MVEBU_CCU_BASE(ap) + 0x4 + \
25 #define CCU_WIN_ENA_WRITE_SECURE (0x1)
26 #define CCU_WIN_ENA_READ_SECURE (0x2)
28 #define CCU_WIN_ALR_OFFSET(ap, win) (MVEBU_CCU_BASE(ap) + 0x8 + \
30 #define CCU_WIN_AHR_OFFSET(ap, win) (MVEBU_CCU_BASE(ap) + 0xC + \
33 #define CCU_WIN_GCR_OFFSET(ap) (MVEBU_CCU_BASE(ap) + 0xD0)
34 #define CCU_GCR_TARGET_OFFSET (8)
35 #define CCU_GCR_TARGET_MASK (0xFF)
37 #define CCU_SRAM_WIN_CR CCU_WIN_CR_OFFSET(MVEBU_AP0, 1)
41 void ccu_win_check(struct addr_map_win
*win
);
42 void ccu_enable_win(int ap_index
, struct addr_map_win
*win
, uint32_t win_id
);
43 void ccu_temp_win_insert(int ap_index
, struct addr_map_win
*win
, int size
);
44 void ccu_temp_win_remove(int ap_index
, struct addr_map_win
*win
, int size
);
45 void ccu_dram_win_config(int ap_index
, struct addr_map_win
*win
);
46 void ccu_dram_target_set(int ap_index
, uint32_t target
);
47 void ccu_save_win_all(int ap_id
);
48 void ccu_restore_win_all(int ap_id
);