summaryrefstree
path: root/kernel/drivers/scsi/ufs/ufs-exynos-fmp.h
blob: 3c9230643fe7290300b194e7727af85ac5c468d2 (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
58
59
60
61
62
63
64
65
66
67
68
69
/*
 * Copyright (C) 2013-2014 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 _UFS_EXYNOS_FMP_H_
#define _UFS_EXYNOS_FMP_H_

#include "ufshcd.h"
#include "ufs-exynos.h"

#if defined(CONFIG_SCSI_UFS_EXYNOS_FMP)
int exynos_ufs_fmp_cfg(struct ufs_hba *hba,
				struct ufshcd_lrb *lrbp,
				struct scatterlist *sg,
				uint32_t index,
				int sector_offset, int page_index);
int exynos_ufs_fmp_clear(struct ufs_hba *hba, struct ufshcd_lrb *lrbp);
int exynos_ufs_fmp_sec_cfg(struct exynos_ufs *ufs);
#else
inline int exynos_ufs_fmp_cfg(struct ufs_hba *hba,
				struct ufshcd_lrb *lrbp,
				struct scatterlist *sg,
				uint32_t index,
				int sector_offset, int page_index)
{
	return 0;
}

int exynos_ufs_fmp_clear(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
{
	return 0;
}

int exynos_ufs_fmp_sec_cfg(struct exynos_ufs *ufs)
{
	return 0;
}
#endif /* CONFIG_SCSI_UFS_EXYNOS_FMP */
#if defined(CONFIG_SCSI_UFS_EXYNOS_SMU)
int exynos_ufs_smu_init(struct exynos_ufs *ufs);
int exynos_ufs_smu_resume(struct exynos_ufs *ufs);
int exynos_ufs_smu_abort(struct exynos_ufs *ufs);
#else
inline int exynos_ufs_smu_init(struct exynos_ufs *ufs)
{
	writel(0x0, ufs->reg_ufsp + UFSPSBEGIN0);
	writel(0xffffffff, ufs->reg_ufsp + UFSPSEND0);
	writel(0xff, ufs->reg_ufsp + UFSPSLUN0);
	writel(0xf1, ufs->reg_ufsp + UFSPSCTRL0);

	return 0;
}

inline int exynos_ufs_smu_resume(struct exynos_ufs *ufs)
{
	return exynos_ufs_smu_init(ufs);
}

inline int exynos_ufs_smu_abort(struct exynos_ufs *ufs)
{
	return 0;
}
#endif
#endif /* _UFS_EXYNOS_FMP_H_ */