Skip to content

Commit 49ac215

Browse files
Linus WalleijRussell King
authored andcommitted
ARM: 6785/1: mmci: separate out ST Micro register defines
The mmci.h header contained a few registers not clearly marked as ST Micro only, rectify this and remove the HWFC magic in the process. The idea is to make the mmci.h header file more ordered so other vendors with PL180 derivates can see where to put in their custom register defines. Includes portions of an earlier patch from Sebastian Rasmussen. Acked-by: Sebastian Rasmussen <sebastian.rasmussen@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 9f381a6 commit 49ac215

2 files changed

Lines changed: 29 additions & 16 deletions

File tree

‎drivers/mmc/host/mmci.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static struct variant_data variant_arm_extended_fifo = {
7777
static struct variant_data variant_u300 = {
7878
.fifosize = 16 * 4,
7979
.fifohalfsize = 8 * 4,
80-
.clkreg_enable = 1 << 13, /* HWFCEN */
80+
.clkreg_enable = MCI_ST_U300_HWFCEN,
8181
.datalength_bits = 16,
8282
.sdio = true,
8383
};
@@ -86,7 +86,7 @@ static struct variant_data variant_ux500 = {
8686
.fifosize = 30 * 4,
8787
.fifohalfsize = 8 * 4,
8888
.clkreg = MCI_CLK_ENABLE,
89-
.clkreg_enable = 1 << 14, /* HWFCEN */
89+
.clkreg_enable = MCI_ST_UX500_HWFCEN,
9090
.datalength_bits = 24,
9191
.sdio = true,
9292
.st_clkdiv = true,

‎drivers/mmc/host/mmci.h‎

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,33 @@
1111
#define MCI_PWR_OFF 0x00
1212
#define MCI_PWR_UP 0x02
1313
#define MCI_PWR_ON 0x03
14-
#define MCI_DATA2DIREN (1 << 2)
15-
#define MCI_CMDDIREN (1 << 3)
16-
#define MCI_DATA0DIREN (1 << 4)
17-
#define MCI_DATA31DIREN (1 << 5)
1814
#define MCI_OD (1 << 6)
1915
#define MCI_ROD (1 << 7)
20-
/* The ST Micro version does not have ROD */
21-
#define MCI_FBCLKEN (1 << 7)
22-
#define MCI_DATA74DIREN (1 << 8)
16+
/*
17+
* The ST Micro version does not have ROD and reuse the voltage registers
18+
* for direction settings
19+
*/
20+
#define MCI_ST_DATA2DIREN (1 << 2)
21+
#define MCI_ST_CMDDIREN (1 << 3)
22+
#define MCI_ST_DATA0DIREN (1 << 4)
23+
#define MCI_ST_DATA31DIREN (1 << 5)
24+
#define MCI_ST_FBCLKEN (1 << 7)
25+
#define MCI_ST_DATA74DIREN (1 << 8)
2326

2427
#define MMCICLOCK 0x004
2528
#define MCI_CLK_ENABLE (1 << 8)
2629
#define MCI_CLK_PWRSAVE (1 << 9)
2730
#define MCI_CLK_BYPASS (1 << 10)
2831
#define MCI_4BIT_BUS (1 << 11)
29-
/* 8bit wide buses supported in ST Micro versions */
32+
/*
33+
* 8bit wide buses, hardware flow contronl, negative edges and clock inversion
34+
* supported in ST Micro U300 and Ux500 versions
35+
*/
3036
#define MCI_ST_8BIT_BUS (1 << 12)
37+
#define MCI_ST_U300_HWFCEN (1 << 13)
38+
#define MCI_ST_UX500_NEG_EDGE (1 << 13)
39+
#define MCI_ST_UX500_HWFCEN (1 << 14)
40+
#define MCI_ST_UX500_CLK_INV (1 << 15)
3141

3242
#define MMCIARGUMENT 0x008
3343
#define MMCICOMMAND 0x00c
@@ -88,8 +98,9 @@
8898
#define MCI_RXFIFOEMPTY (1 << 19)
8999
#define MCI_TXDATAAVLBL (1 << 20)
90100
#define MCI_RXDATAAVLBL (1 << 21)
91-
#define MCI_SDIOIT (1 << 22)
92-
#define MCI_CEATAEND (1 << 23)
101+
/* Extended status bits for the ST Micro variants */
102+
#define MCI_ST_SDIOIT (1 << 22)
103+
#define MCI_ST_CEATAEND (1 << 23)
93104

94105
#define MMCICLEAR 0x038
95106
#define MCI_CMDCRCFAILCLR (1 << 0)
@@ -102,8 +113,9 @@
102113
#define MCI_CMDSENTCLR (1 << 7)
103114
#define MCI_DATAENDCLR (1 << 8)
104115
#define MCI_DATABLOCKENDCLR (1 << 10)
105-
#define MCI_SDIOITC (1 << 22)
106-
#define MCI_CEATAENDC (1 << 23)
116+
/* Extended status bits for the ST Micro variants */
117+
#define MCI_ST_SDIOITC (1 << 22)
118+
#define MCI_ST_CEATAENDC (1 << 23)
107119

108120
#define MMCIMASK0 0x03c
109121
#define MCI_CMDCRCFAILMASK (1 << 0)
@@ -127,8 +139,9 @@
127139
#define MCI_RXFIFOEMPTYMASK (1 << 19)
128140
#define MCI_TXDATAAVLBLMASK (1 << 20)
129141
#define MCI_RXDATAAVLBLMASK (1 << 21)
130-
#define MCI_SDIOITMASK (1 << 22)
131-
#define MCI_CEATAENDMASK (1 << 23)
142+
/* Extended status bits for the ST Micro variants */
143+
#define MCI_ST_SDIOITMASK (1 << 22)
144+
#define MCI_ST_CEATAENDMASK (1 << 23)
132145

133146
#define MMCIMASK1 0x040
134147
#define MMCIFIFOCNT 0x048

0 commit comments

Comments
 (0)