2020-04-17 16:13:39 +01:00
|
|
|
/*
|
2021-08-17 17:57:10 +01:00
|
|
|
* Copyright (c) 2020-2021, ARM Limited and Contributors. All rights reserved.
|
2020-04-17 16:13:39 +01:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
#include <libfdt.h>
|
2021-04-09 17:07:41 +01:00
|
|
|
#include <tc_plat.h>
|
2020-04-17 16:13:39 +01:00
|
|
|
|
|
|
|
#include <common/bl_common.h>
|
|
|
|
#include <common/debug.h>
|
|
|
|
#include <drivers/arm/css/css_mhu_doorbell.h>
|
|
|
|
#include <drivers/arm/css/scmi.h>
|
2021-08-17 17:57:10 +01:00
|
|
|
#include <lib/fconf/fconf.h>
|
|
|
|
#include <lib/fconf/fconf_dyn_cfg_getter.h>
|
2020-04-17 16:13:39 +01:00
|
|
|
#include <plat/arm/common/plat_arm.h>
|
|
|
|
#include <plat/common/platform.h>
|
|
|
|
|
2021-04-09 17:07:41 +01:00
|
|
|
static scmi_channel_plat_info_t tc_scmi_plat_info[] = {
|
2020-04-17 16:13:39 +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,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
void bl31_platform_setup(void)
|
|
|
|
{
|
2021-04-09 17:07:41 +01:00
|
|
|
tc_bl31_common_platform_setup();
|
2020-04-17 16:13:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
scmi_channel_plat_info_t *plat_css_get_scmi_info(int channel_id)
|
|
|
|
{
|
|
|
|
|
2021-04-09 17:07:41 +01:00
|
|
|
return &tc_scmi_plat_info[channel_id];
|
2020-04-17 16:13:39 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
|
|
|
|
u_register_t arg2, u_register_t arg3)
|
|
|
|
{
|
|
|
|
arm_bl31_early_platform_setup((void *)arg0, arg1, arg2, (void *)arg3);
|
2021-08-17 17:57:10 +01:00
|
|
|
|
|
|
|
/* Fill the properties struct with the info from the config dtb */
|
|
|
|
fconf_populate("FW_CONFIG", arg1);
|
2020-04-17 16:13:39 +01:00
|
|
|
}
|
|
|
|
|
2021-04-09 17:07:41 +01:00
|
|
|
void tc_bl31_common_platform_setup(void)
|
2020-04-17 16:13:39 +01:00
|
|
|
{
|
|
|
|
arm_bl31_platform_setup();
|
|
|
|
}
|
|
|
|
|
|
|
|
const plat_psci_ops_t *plat_arm_psci_override_pm_ops(plat_psci_ops_t *ops)
|
|
|
|
{
|
|
|
|
return css_scmi_override_pm_ops(ops);
|
|
|
|
}
|
2021-08-17 17:57:10 +01:00
|
|
|
|
|
|
|
void __init bl31_plat_arch_setup(void)
|
|
|
|
{
|
|
|
|
arm_bl31_plat_arch_setup();
|
|
|
|
|
|
|
|
/* HW_CONFIG was also loaded by BL2 */
|
|
|
|
const struct dyn_cfg_dtb_info_t *hw_config_info;
|
|
|
|
|
|
|
|
hw_config_info = FCONF_GET_PROPERTY(dyn_cfg, dtb, HW_CONFIG_ID);
|
|
|
|
assert(hw_config_info != NULL);
|
|
|
|
|
|
|
|
fconf_populate("HW_CONFIG", hw_config_info->config_addr);
|
|
|
|
}
|