1 /* 2 * Copyright (c) 2025, MediaTek Inc. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef __MTK_BL31_INTERFACE_H__ 8 #define __MTK_BL31_INTERFACE_H__ 9 10 #include <stdbool.h> 11 #include <stdint.h> 12 13 /* UFS definitions */ 14 enum ufs_mtk_mphy_op { 15 UFS_MPHY_BACKUP = 0, 16 UFS_MPHY_RESTORE, 17 }; 18 19 enum ufs_notify_change_status { 20 PRE_CHANGE, 21 POST_CHANGE, 22 }; 23 24 /* UFS interfaces */ 25 void ufs_mphy_va09_cg_ctrl(bool enable); 26 void ufs_device_reset_ctrl(bool rst_n); 27 void ufs_crypto_hie_init(void); 28 void ufs_ref_clk_status(uint32_t on, enum ufs_notify_change_status stage); 29 void ufs_sram_pwr_ctrl(bool on); 30 void ufs_device_pwr_ctrl(bool vcc_on, uint64_t ufs_version); 31 void ufs_mphy_ctrl(enum ufs_mtk_mphy_op op); 32 void ufs_mtcmos_ctrl(bool on); 33 34 /* UFS functions implemented in the public ATF repo */ 35 int ufs_rsc_ctrl_mem(bool hold); 36 int ufs_rsc_ctrl_pmic(bool hold); 37 void ufs_device_pwr_ctrl_soc(bool vcc_on, uint64_t ufs_version); 38 int ufs_spm_mtcmos_power(bool on); 39 int ufs_phy_spm_mtcmos_power(bool on); 40 bool ufs_is_clk_status_off(void); 41 void ufs_set_clk_status(bool on); 42 43 #endif /* __MTK_BL31_INTERFACE_H__ */ 44