aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/include/asm/arch-stih410/sdhci.h
blob: 928614326b5bf26901cd13593e205b1b5dd60aa1 (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) 2017, STMicroelectronics - All Rights Reserved
 * Author(s): Patrice Chotard, <patrice.chotard@st.com> for STMicroelectronics.
 *
 * SPDX-License-Identifier:	GPL-2.0+
 */

#ifndef __STI_SDHCI_H__
#define __STI_SDHCI_H__

#define FLASHSS_MMC_CORE_CONFIG_1			0x400
#define FLASHSS_MMC_CORECFG_TIMEOUT_CLK_UNIT_MHZ	BIT(24)
#define FLASHSS_MMC_CORECFG_TIMEOUT_CLK_FREQ_MIN	BIT(12)

#define STI_FLASHSS_MMC_CORE_CONFIG_1			\
	(FLASHSS_MMC_CORECFG_TIMEOUT_CLK_UNIT_MHZ	| \
	 FLASHSS_MMC_CORECFG_TIMEOUT_CLK_FREQ_MIN)

#define FLASHSS_MMC_CORE_CONFIG_2			0x404
#define FLASHSS_MMC_CORECFG_HIGH_SPEED			BIT(28)
#define FLASHSS_MMC_CORECFG_8BIT_EMMC			BIT(20)
#define MAX_BLK_LENGTH_1024				BIT(16)
#define BASE_CLK_FREQ_200				0xc8

#define STI_FLASHSS_MMC_CORE_CONFIG2	\
	(FLASHSS_MMC_CORECFG_HIGH_SPEED	| \
	 FLASHSS_MMC_CORECFG_8BIT_EMMC	| \
	 MAX_BLK_LENGTH_1024		| \
	 BASE_CLK_FREQ_200 << 0)

#define STI_FLASHSS_SDCARD_CORE_CONFIG2			\
	(FLASHSS_MMC_CORECFG_HIGH_SPEED			| \
	 MAX_BLK_LENGTH_1024				| \
	 BASE_CLK_FREQ_200)

#define FLASHSS_MMC_CORE_CONFIG_3			0x408
#define FLASHSS_MMC_CORECFG_SLOT_TYPE_EMMC		BIT(28)
#define FLASHSS_MMC_CORECFG_ASYNCH_INTR_SUPPORT		BIT(20)
#define FLASHSS_MMC_CORECFG_3P3_VOLT			BIT(8)
#define FLASHSS_MMC_CORECFG_SUSP_RES_SUPPORT		BIT(4)
#define FLASHSS_MMC_CORECFG_SDMA			BIT(0)

#define STI_FLASHSS_MMC_CORE_CONFIG3			\
	 (FLASHSS_MMC_CORECFG_SLOT_TYPE_EMMC		| \
	 FLASHSS_MMC_CORECFG_ASYNCH_INTR_SUPPORT	| \
	 FLASHSS_MMC_CORECFG_3P3_VOLT			| \
	 FLASHSS_MMC_CORECFG_SUSP_RES_SUPPORT		| \
	 FLASHSS_MMC_CORECFG_SDMA)

#define STI_FLASHSS_SDCARD_CORE_CONFIG3			\
	 (FLASHSS_MMC_CORECFG_ASYNCH_INTR_SUPPORT	| \
	 FLASHSS_MMC_CORECFG_3P3_VOLT			| \
	 FLASHSS_MMC_CORECFG_SUSP_RES_SUPPORT		| \
	 FLASHSS_MMC_CORECFG_SDMA)

#define FLASHSS_MMC_CORE_CONFIG_4			0x40c
#define FLASHSS_MMC_CORECFG_D_DRIVER_SUPPORT		BIT(20)
#define FLASHSS_MMC_CORECFG_C_DRIVER_SUPPORT		BIT(16)
#define FLASHSS_MMC_CORECFG_A_DRIVER_SUPPORT		BIT(12)

#define STI_FLASHSS_MMC_CORE_CONFIG4			\
	(FLASHSS_MMC_CORECFG_D_DRIVER_SUPPORT		| \
	 FLASHSS_MMC_CORECFG_C_DRIVER_SUPPORT		| \
	 FLASHSS_MMC_CORECFG_A_DRIVER_SUPPORT)

#define ST_MMC_CCONFIG_REG_5		0x210
#define SYSCONF_MMC1_ENABLE_BIT		3

#endif	/* _STI_SDHCI_H_ */