Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
3c652a2d
Unverified
Commit
3c652a2d
authored
6 years ago
by
Dimitris Papastamos
Committed by
GitHub
6 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #1863 from thloh85-intel/mmc_fixes
drivers: mmc: Fix some issues with MMC stack
parents
a6561a28
dd8c03b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
drivers/mmc/mmc.c
+6
-4
drivers/mmc/mmc.c
include/drivers/mmc.h
+1
-0
include/drivers/mmc.h
plat/intel/soc/stratix10/bl2_plat_setup.c
+1
-0
plat/intel/soc/stratix10/bl2_plat_setup.c
with
8 additions
and
4 deletions
+8
-4
drivers/mmc/mmc.c
View file @
3c652a2d
...
...
@@ -29,6 +29,7 @@ static unsigned char mmc_ext_csd[512] __aligned(16);
static
unsigned
int
mmc_flags
;
static
struct
mmc_device_info
*
mmc_dev_info
;
static
unsigned
int
rca
;
static
unsigned
int
scr
[
2
]
__aligned
(
16
)
=
{
0
};
static
const
unsigned
char
tran_speed_base
[
16
]
=
{
0
,
10
,
12
,
13
,
15
,
20
,
26
,
30
,
35
,
40
,
45
,
52
,
55
,
60
,
70
,
80
...
...
@@ -90,7 +91,8 @@ static int mmc_device_state(void)
ret
=
mmc_send_cmd
(
MMC_CMD
(
13
),
rca
<<
RCA_SHIFT_OFFSET
,
MMC_RESPONSE_R1
,
&
resp_data
[
0
]);
if
(
ret
!=
0
)
{
return
ret
;
retries
--
;
continue
;
}
if
((
resp_data
[
0
]
&
STATUS_SWITCH_ERROR
)
!=
0U
)
{
...
...
@@ -129,7 +131,6 @@ static int mmc_sd_switch(unsigned int bus_width)
{
int
ret
;
int
retries
=
MMC_DEFAULT_MAX_RETRIES
;
unsigned
int
scr
[
2
]
=
{
0
};
unsigned
int
bus_width_arg
=
0
;
ret
=
ops
->
prepare
(
0
,
(
uintptr_t
)
&
scr
,
sizeof
(
scr
));
...
...
@@ -341,8 +342,9 @@ static int sd_send_op_cond(void)
}
/* ACMD41: SD_SEND_OP_COND */
ret
=
mmc_send_cmd
(
MMC_ACMD
(
41
),
OCR_HCS
,
MMC_RESPONSE_R3
,
&
resp_data
[
0
]);
ret
=
mmc_send_cmd
(
MMC_ACMD
(
41
),
OCR_HCS
|
mmc_dev_info
->
ocr_voltage
,
MMC_RESPONSE_R3
,
&
resp_data
[
0
]);
if
(
ret
!=
0
)
{
return
ret
;
}
...
...
This diff is collapsed.
Click to expand it.
include/drivers/mmc.h
View file @
3c652a2d
...
...
@@ -220,6 +220,7 @@ struct mmc_device_info {
unsigned
long
long
device_size
;
/* Size of device in bytes */
unsigned
int
block_size
;
/* Block size in bytes */
unsigned
int
max_bus_freq
;
/* Max bus freq in Hz */
unsigned
int
ocr_voltage
;
/* OCR voltage */
enum
mmc_device_type
mmc_dev_type
;
/* Type of MMC */
};
...
...
This diff is collapsed.
Click to expand it.
plat/intel/soc/stratix10/bl2_plat_setup.c
View file @
3c652a2d
...
...
@@ -104,6 +104,7 @@ void bl2_el3_plat_arch_setup(void)
dw_mmc_params_t
params
=
EMMC_INIT_PARAMS
(
0x100000
);
info
.
mmc_dev_type
=
MMC_IS_SD
;
info
.
ocr_voltage
=
OCR_3_3_3_4
|
OCR_3_2_3_3
;
switch
(
boot_source
)
{
case
BOOT_SOURCE_SDMMC
:
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment