2018-02-26 06:52:04 +00:00
|
|
|
/*
|
2019-02-27 08:29:11 +00:00
|
|
|
* Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
|
2018-02-26 06:52:04 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*/
|
|
|
|
|
2018-10-04 12:02:03 +01:00
|
|
|
#include <assert.h>
|
2018-12-14 00:18:21 +00:00
|
|
|
|
2018-10-04 12:02:03 +01:00
|
|
|
#include <libfdt.h>
|
2018-12-14 00:18:21 +00:00
|
|
|
|
|
|
|
#include <common/bl_common.h>
|
|
|
|
#include <common/debug.h>
|
2019-01-23 21:08:43 +00:00
|
|
|
#include <drivers/arm/css/css_mhu_doorbell.h>
|
2019-01-23 20:37:32 +00:00
|
|
|
#include <drivers/arm/css/scmi.h>
|
2019-01-25 14:30:04 +00:00
|
|
|
#include <plat/arm/common/plat_arm.h>
|
2019-02-13 15:58:00 +00:00
|
|
|
#include <plat/common/platform.h>
|
2018-12-14 00:18:21 +00:00
|
|
|
|
2018-05-16 12:52:35 +01:00
|
|
|
#include <sgi_ras.h>
|
2018-10-04 12:02:03 +01:00
|
|
|
#include <sgi_variant.h>
|
2018-12-14 00:18:21 +00:00
|
|
|
|
2018-10-04 12:02:03 +01:00
|
|
|
sgi_platform_info_t sgi_plat_info;
|
|
|
|
|
2018-10-11 09:38:08 +01:00
|
|
|
static scmi_channel_plat_info_t sgi575_scmi_plat_info = {
|
|
|
|
.scmi_mbx_mem = CSS_SCMI_PAYLOAD_BASE,
|
|
|
|
.db_reg_addr = PLAT_CSS_MHU_BASE + CSS_SCMI_MHU_DB_REG_OFF,
|
|
|
|
.db_preserve_mask = 0xfffffffe,
|
|
|
|
.db_modify_mask = 0x1,
|
|
|
|
.ring_doorbell = &mhu_ring_doorbell,
|
|
|
|
};
|
|
|
|
|
2019-02-27 08:29:11 +00:00
|
|
|
static scmi_channel_plat_info_t rd_n1e1_edge_scmi_plat_info = {
|
2018-10-04 12:02:03 +01:00
|
|
|
.scmi_mbx_mem = CSS_SCMI_PAYLOAD_BASE,
|
|
|
|
.db_reg_addr = PLAT_CSS_MHU_BASE + SENDER_REG_SET(0),
|
|
|
|
.db_preserve_mask = 0xfffffffe,
|
|
|
|
.db_modify_mask = 0x1,
|
|
|
|
.ring_doorbell = &mhuv2_ring_doorbell,
|
|
|
|
};
|
|
|
|
|
2019-02-13 15:58:00 +00:00
|
|
|
scmi_channel_plat_info_t *plat_css_get_scmi_info(void)
|
2018-10-11 09:38:08 +01:00
|
|
|
{
|
2019-02-27 08:29:11 +00:00
|
|
|
if (sgi_plat_info.platform_id == RD_N1E1_EDGE_SID_VER_PART_NUM)
|
|
|
|
return &rd_n1e1_edge_scmi_plat_info;
|
2018-10-04 12:02:03 +01:00
|
|
|
else if (sgi_plat_info.platform_id == SGI575_SSC_VER_PART_NUM)
|
|
|
|
return &sgi575_scmi_plat_info;
|
|
|
|
else
|
|
|
|
panic();
|
2019-02-13 15:58:00 +00:00
|
|
|
}
|
2018-10-04 12:02:03 +01:00
|
|
|
|
2018-02-26 06:52:04 +00:00
|
|
|
void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
|
|
|
|
u_register_t arg2, u_register_t arg3)
|
|
|
|
{
|
2018-11-28 06:01:51 +00:00
|
|
|
sgi_plat_info.platform_id = plat_arm_sgi_get_platform_id();
|
|
|
|
sgi_plat_info.config_id = plat_arm_sgi_get_config_id();
|
2018-10-04 12:02:03 +01:00
|
|
|
|
2018-02-26 06:52:04 +00:00
|
|
|
arm_bl31_early_platform_setup((void *)arg0, arg1, arg2, (void *)arg3);
|
|
|
|
}
|
2018-05-16 12:52:35 +01:00
|
|
|
|
|
|
|
void bl31_platform_setup(void)
|
|
|
|
{
|
|
|
|
arm_bl31_platform_setup();
|
|
|
|
|
|
|
|
#if RAS_EXTENSION
|
|
|
|
sgi_ras_intr_handler_setup();
|
|
|
|
#endif
|
|
|
|
}
|
2018-11-14 08:13:59 +00:00
|
|
|
|
|
|
|
const plat_psci_ops_t *plat_arm_psci_override_pm_ops(plat_psci_ops_t *ops)
|
|
|
|
{
|
2019-02-27 08:29:11 +00:00
|
|
|
/* For RD-E1-Edge platform only CPU ON/OFF is supported */
|
|
|
|
if ((sgi_plat_info.platform_id == RD_N1E1_EDGE_SID_VER_PART_NUM) &&
|
|
|
|
(sgi_plat_info.config_id == RD_E1_EDGE_CONFIG_ID)) {
|
2018-11-22 04:45:25 +00:00
|
|
|
ops->cpu_standby = NULL;
|
|
|
|
ops->system_off = NULL;
|
|
|
|
ops->system_reset = NULL;
|
|
|
|
ops->get_sys_suspend_power_state = NULL;
|
|
|
|
ops->pwr_domain_suspend = NULL;
|
|
|
|
ops->pwr_domain_suspend_finish = NULL;
|
|
|
|
}
|
|
|
|
|
2018-11-14 08:13:59 +00:00
|
|
|
return css_scmi_override_pm_ops(ops);
|
|
|
|
}
|