summaryrefstree
path: root/kernel/drivers/crypto/fmp/smu.c
blob: 237485543b8ed48ecf2461258d26c347973b4129 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * SMU (Secure Management Unit) driver for Exynos
 *
 * Copyright (C) 2016 Samsung Electronics Co., Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 */
#include <linux/printk.h>
#include <linux/smc.h>
#include <crypto/smu.h>

int exynos_smu_init(int id, int smu_cmd)
{
	int ret = exynos_smc(SMC_CMD_SMU, smu_cmd, id, 0);

	if (ret)
		pr_err("%s: Fail smc call for SMU init. ret(%d)\n",
				__func__, ret);
	return ret;
}

int exynos_smu_resume(int id)
{
	int ret = exynos_smc(SMC_CMD_FMP_SMU_RESUME, 0, id, 0);

	if (ret)
		pr_err("%s: Fail smc call for SMU resume. ret(%d)\n",
				__func__, ret);
	return ret;
}

int exynos_smu_abort(int id, int smu_cmd)
{
	int ret = exynos_smc(SMC_CMD_SMU, smu_cmd, id, 0);

	if (ret)
		pr_err("%s: Fail smc call for SMU abort. ret(%d)\n",
			__func__, ret);
	return ret;
}