1 /*
2  * Copyright (c) 2019-2020, Broadcom
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef SCP_UTILS_H
8 #define SCP_UTILS_H
9 
10 #include <common/bl_common.h>
11 #include <lib/mmio.h>
12 
13 #include <m0_cfg.h>
14 
15 int plat_bcm_bl2_plat_handle_scp_bl2(image_info_t *scp_bl2_image_info);
16 
17 bool is_crmu_alive(void);
18 bool bcm_scp_issue_sys_reset(void);
19 
20 #define SCP_READ_CFG(cfg) mmio_read_32(CRMU_CFG_BASE + \
21 		offsetof(M0CFG, cfg))
22 #define SCP_WRITE_CFG(cfg, value) mmio_write_32(CRMU_CFG_BASE + \
23 		offsetof(M0CFG, cfg), value)
24 
25 #define SCP_READ_CFG16(cfg) mmio_read_16(CRMU_CFG_BASE + \
26 		offsetof(M0CFG, cfg))
27 #define SCP_WRITE_CFG16(cfg, value) mmio_write_16(CRMU_CFG_BASE + \
28 		offsetof(M0CFG, cfg), value)
29 
30 #define SCP_READ_CFG8(cfg) mmio_read_8(CRMU_CFG_BASE + \
31 		offsetof(M0CFG, cfg))
32 #define SCP_WRITE_CFG8(cfg, value) mmio_write_8(CRMU_CFG_BASE + \
33 		offsetof(M0CFG, cfg), value)
34 #endif
35