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> |
| 9 | |
Nariman Poushin | c703f90 | 2018-03-07 10:29:57 +0000 | [diff] [blame] | 10 | #include <plat_arm.h> |
| 11 | #include <sgm_plat_config.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 12 | |
Chandni Cherukuri | 61f3a7c | 2018-10-11 14:08:08 +0530 | [diff] [blame] | 13 | #include "../../css/drivers/scmi/scmi.h" |
| 14 | #include "../../css/drivers/mhu/css_mhu_doorbell.h" |
| 15 | |
| 16 | static scmi_channel_plat_info_t sgm775_scmi_plat_info = { |
| 17 | .scmi_mbx_mem = CSS_SCMI_PAYLOAD_BASE, |
| 18 | .db_reg_addr = PLAT_CSS_MHU_BASE + CSS_SCMI_MHU_DB_REG_OFF, |
| 19 | .db_preserve_mask = 0xfffffffe, |
| 20 | .db_modify_mask = 0x1, |
| 21 | .ring_doorbell = &mhu_ring_doorbell, |
| 22 | }; |
| 23 | |
| 24 | scmi_channel_plat_info_t *plat_css_get_scmi_info() |
| 25 | { |
| 26 | return &sgm775_scmi_plat_info; |
| 27 | } |
Nariman Poushin | c703f90 | 2018-03-07 10:29:57 +0000 | [diff] [blame] | 28 | |
| 29 | void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, |
| 30 | u_register_t arg2, u_register_t arg3) |
| 31 | { |
| 32 | uint32_t plat_version; |
| 33 | bl_params_node_t *bl_params; |
| 34 | |
| 35 | bl_params = ((bl_params_t *)arg0)->head; |
| 36 | |
| 37 | /* Initialize the platform configuration structure */ |
| 38 | plat_config_init(); |
| 39 | |
| 40 | while (bl_params) { |
| 41 | if (bl_params->image_id == BL33_IMAGE_ID) { |
| 42 | plat_version = mmio_read_32(SSC_VERSION); |
| 43 | bl_params->ep_info->args.arg2 = plat_version; |
| 44 | break; |
| 45 | } |
| 46 | |
| 47 | bl_params = bl_params->next_params_info; |
| 48 | } |
| 49 | |
| 50 | arm_bl31_early_platform_setup((void *)arg0, arg1, arg2, (void *)arg3); |
| 51 | } |
Chandni Cherukuri | e4bf6a0 | 2018-11-14 13:43:59 +0530 | [diff] [blame] | 52 | |
| 53 | const plat_psci_ops_t *plat_arm_psci_override_pm_ops(plat_psci_ops_t *ops) |
| 54 | { |
| 55 | return css_scmi_override_pm_ops(ops); |
| 56 | } |