Nariman Poushin | c703f90 | 2018-03-07 10:29:57 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 7 | #include <common/bl_common.h> |
| 8 | #include <common/debug.h> |
Antonio Nino Diaz | bd7b740 | 2019-01-25 14:30:04 +0000 | [diff] [blame] | 9 | #include <plat/arm/common/plat_arm.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 10 | |
Nariman Poushin | c703f90 | 2018-03-07 10:29:57 +0000 | [diff] [blame] | 11 | #include <sgm_plat_config.h> |
Chandni Cherukuri | 61f3a7c | 2018-10-11 14:08:08 +0530 | [diff] [blame] | 12 | #include "../../css/drivers/scmi/scmi.h" |
| 13 | #include "../../css/drivers/mhu/css_mhu_doorbell.h" |
| 14 | |
| 15 | static 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 | |
| 23 | scmi_channel_plat_info_t *plat_css_get_scmi_info() |
| 24 | { |
| 25 | return &sgm775_scmi_plat_info; |
| 26 | } |
Nariman Poushin | c703f90 | 2018-03-07 10:29:57 +0000 | [diff] [blame] | 27 | |
| 28 | void 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 Cherukuri | e4bf6a0 | 2018-11-14 13:43:59 +0530 | [diff] [blame] | 51 | |
| 52 | const 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 | } |