summaryrefstree
path: root/kernel/include/crypto/smu.h
blob: d9fa4f0c10a2a1b039b59887b493e7927dca51ab (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
 * 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.
 */

#ifndef _EXYNOS_SMU_H_
#define _EXYNOS_SMU_H_

#include <linux/platform_device.h>

#define CFG_DESCTYPE_0	0x0
#define CFG_DESCTYPE_1	0x1
#define CFG_DESCTYPE_2	0x2
#define CFG_DESCTYPE_3	0x3

#if defined(CONFIG_EXYNOS_FMP)
#define CFG_DESCTYPE	CFG_DESCTYPE_3
#else
#define CFG_DESCTYPE	CFG_DESCTYPE_0
#endif

#define ACCESS_CONTROL_ABORT	0x14

enum smu_id {
	SMU_EMBEDDED = 0,
	SMU_UFSCARD = 1,
	SMU_SDCARD = 2,
};

enum smu_command {
	SMU_INIT = 0,
	SMU_SET = 1,
	SMU_ABORT = 2,
};

struct smu_data_setting {
	int id;
	int command;
	int desc_type;
};

struct exynos_smu_variant_ops {
	const char *name;
	int	(*init)(struct platform_device *, struct smu_data_setting *);
	int	(*sec_config)(struct platform_device *, struct smu_data_setting *);
	int	(*resume)(struct platform_device *, struct smu_data_setting *);
	int	(*abort)(struct platform_device *, struct smu_data_setting *);
};

struct exynos_smu_variant_ops *exynos_smu_get_variant_ops(struct device_node *node);
struct platform_device *exynos_smu_get_pdevice(struct device_node *node);

#endif /* _EXYNOS_SMU_H_ */