blob: 7e92ac8350097a78a17fe0104a040149f2d08f04 [file] [log] [blame]
Nariman Poushinc703f902018-03-07 10:29:57 +00001/*
2 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00007#include <common/bl_common.h>
8#include <common/debug.h>
Antonio Nino Diaz1b0c6f12019-01-23 21:08:43 +00009#include <drivers/arm/css/css_mhu_doorbell.h>
Antonio Nino Diazc30db5b2019-01-23 20:37:32 +000010#include <drivers/arm/css/scmi.h>
Antonio Nino Diazbd7b7402019-01-25 14:30:04 +000011#include <plat/arm/common/plat_arm.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000012
Nariman Poushinc703f902018-03-07 10:29:57 +000013#include <sgm_plat_config.h>
Chandni Cherukuri61f3a7c2018-10-11 14:08:08 +053014
15static scmi_channel_plat_info_t sgm775_scmi_plat_info = {
16 .scmi_mbx_mem = CSS_SCMI_PAYLOAD_BASE,
17 .db_reg_addr = PLAT_CSS_MHU_BASE + CSS_SCMI_MHU_DB_REG_OFF,
18 .db_preserve_mask = 0xfffffffe,
19 .db_modify_mask = 0x1,
20 .ring_doorbell = &mhu_ring_doorbell,
21};
22
23scmi_channel_plat_info_t *plat_css_get_scmi_info()
24{
25 return &sgm775_scmi_plat_info;
26}
Nariman Poushinc703f902018-03-07 10:29:57 +000027
28void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
29 u_register_t arg2, u_register_t arg3)
30{
31 uint32_t plat_version;
32 bl_params_node_t *bl_params;
33
34 bl_params = ((bl_params_t *)arg0)->head;
35
36 /* Initialize the platform configuration structure */
37 plat_config_init();
38
39 while (bl_params) {
40 if (bl_params->image_id == BL33_IMAGE_ID) {
41 plat_version = mmio_read_32(SSC_VERSION);
42 bl_params->ep_info->args.arg2 = plat_version;
43 break;
44 }
45
46 bl_params = bl_params->next_params_info;
47 }
48
49 arm_bl31_early_platform_setup((void *)arg0, arg1, arg2, (void *)arg3);
50}
Chandni Cherukurie4bf6a02018-11-14 13:43:59 +053051
52const plat_psci_ops_t *plat_arm_psci_override_pm_ops(plat_psci_ops_t *ops)
53{
54 return css_scmi_override_pm_ops(ops);
55}