162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright (c) 2023, Linaro Limited 462306a36Sopenharmony_ci */ 562306a36Sopenharmony_ci 662306a36Sopenharmony_ci#ifndef __QCOM_ICE_H__ 762306a36Sopenharmony_ci#define __QCOM_ICE_H__ 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci#include <linux/types.h> 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_cistruct qcom_ice; 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_cienum qcom_ice_crypto_key_size { 1462306a36Sopenharmony_ci QCOM_ICE_CRYPTO_KEY_SIZE_INVALID = 0x0, 1562306a36Sopenharmony_ci QCOM_ICE_CRYPTO_KEY_SIZE_128 = 0x1, 1662306a36Sopenharmony_ci QCOM_ICE_CRYPTO_KEY_SIZE_192 = 0x2, 1762306a36Sopenharmony_ci QCOM_ICE_CRYPTO_KEY_SIZE_256 = 0x3, 1862306a36Sopenharmony_ci QCOM_ICE_CRYPTO_KEY_SIZE_512 = 0x4, 1962306a36Sopenharmony_ci}; 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_cienum qcom_ice_crypto_alg { 2262306a36Sopenharmony_ci QCOM_ICE_CRYPTO_ALG_AES_XTS = 0x0, 2362306a36Sopenharmony_ci QCOM_ICE_CRYPTO_ALG_BITLOCKER_AES_CBC = 0x1, 2462306a36Sopenharmony_ci QCOM_ICE_CRYPTO_ALG_AES_ECB = 0x2, 2562306a36Sopenharmony_ci QCOM_ICE_CRYPTO_ALG_ESSIV_AES_CBC = 0x3, 2662306a36Sopenharmony_ci}; 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ciint qcom_ice_enable(struct qcom_ice *ice); 2962306a36Sopenharmony_ciint qcom_ice_resume(struct qcom_ice *ice); 3062306a36Sopenharmony_ciint qcom_ice_suspend(struct qcom_ice *ice); 3162306a36Sopenharmony_ciint qcom_ice_program_key(struct qcom_ice *ice, 3262306a36Sopenharmony_ci u8 algorithm_id, u8 key_size, 3362306a36Sopenharmony_ci const u8 crypto_key[], u8 data_unit_size, 3462306a36Sopenharmony_ci int slot); 3562306a36Sopenharmony_ciint qcom_ice_evict_key(struct qcom_ice *ice, int slot); 3662306a36Sopenharmony_cistruct qcom_ice *of_qcom_ice_get(struct device *dev); 3762306a36Sopenharmony_ci#endif /* __QCOM_ICE_H__ */ 38