Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
reform-boundary-uboot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jack Humbert
reform-boundary-uboot
Commits
d8a97f93
Commit
d8a97f93
authored
10 years ago
by
Tom Rini
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
git://git.denx.de/u-boot-mmc
parents
6736ec15
3d6a5a4d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
common/cmd_mmc.c
+23
-28
23 additions, 28 deletions
common/cmd_mmc.c
disk/part.c
+3
-3
3 additions, 3 deletions
disk/part.c
drivers/mmc/kona_sdhci.c
+6
-2
6 additions, 2 deletions
drivers/mmc/kona_sdhci.c
drivers/mmc/mmc.c
+4
-3
4 additions, 3 deletions
drivers/mmc/mmc.c
with
36 additions
and
36 deletions
common/cmd_mmc.c
+
23
−
28
View file @
d8a97f93
...
...
@@ -92,7 +92,7 @@ static void print_mmcinfo(struct mmc *mmc)
printf
(
"Bus Width: %d-bit
\n
"
,
mmc
->
bus_width
);
}
static
struct
mmc
*
init_mmc_device
(
int
dev
)
static
struct
mmc
*
init_mmc_device
(
int
dev
,
bool
force_init
)
{
struct
mmc
*
mmc
;
mmc
=
find_mmc_device
(
dev
);
...
...
@@ -100,6 +100,8 @@ static struct mmc *init_mmc_device(int dev)
printf
(
"no mmc device at slot %x
\n
"
,
dev
);
return
NULL
;
}
if
(
force_init
)
mmc
->
has_init
=
0
;
if
(
mmc_init
(
mmc
))
return
NULL
;
return
mmc
;
...
...
@@ -117,7 +119,7 @@ static int do_mmcinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
}
mmc
=
init_mmc_device
(
curr_device
);
mmc
=
init_mmc_device
(
curr_device
,
false
);
if
(
!
mmc
)
return
CMD_RET_FAILURE
;
...
...
@@ -247,7 +249,7 @@ static int do_mmcrpmb(cmd_tbl_t *cmdtp, int flag,
if
(
flag
==
CMD_FLAG_REPEAT
&&
!
cp
->
repeatable
)
return
CMD_RET_SUCCESS
;
mmc
=
init_mmc_device
(
curr_device
);
mmc
=
init_mmc_device
(
curr_device
,
false
);
if
(
!
mmc
)
return
CMD_RET_FAILURE
;
...
...
@@ -292,7 +294,7 @@ static int do_mmc_read(cmd_tbl_t *cmdtp, int flag,
blk
=
simple_strtoul
(
argv
[
2
],
NULL
,
16
);
cnt
=
simple_strtoul
(
argv
[
3
],
NULL
,
16
);
mmc
=
init_mmc_device
(
curr_device
);
mmc
=
init_mmc_device
(
curr_device
,
false
);
if
(
!
mmc
)
return
CMD_RET_FAILURE
;
...
...
@@ -320,7 +322,7 @@ static int do_mmc_write(cmd_tbl_t *cmdtp, int flag,
blk
=
simple_strtoul
(
argv
[
2
],
NULL
,
16
);
cnt
=
simple_strtoul
(
argv
[
3
],
NULL
,
16
);
mmc
=
init_mmc_device
(
curr_device
);
mmc
=
init_mmc_device
(
curr_device
,
false
);
if
(
!
mmc
)
return
CMD_RET_FAILURE
;
...
...
@@ -348,7 +350,7 @@ static int do_mmc_erase(cmd_tbl_t *cmdtp, int flag,
blk
=
simple_strtoul
(
argv
[
1
],
NULL
,
16
);
cnt
=
simple_strtoul
(
argv
[
2
],
NULL
,
16
);
mmc
=
init_mmc_device
(
curr_device
);
mmc
=
init_mmc_device
(
curr_device
,
false
);
if
(
!
mmc
)
return
CMD_RET_FAILURE
;
...
...
@@ -369,16 +371,10 @@ static int do_mmc_rescan(cmd_tbl_t *cmdtp, int flag,
{
struct
mmc
*
mmc
;
mmc
=
find_mmc_device
(
curr_device
);
if
(
!
mmc
)
{
printf
(
"no mmc device at slot %x
\n
"
,
curr_device
);
mmc
=
init_mmc_device
(
curr_device
,
true
);
if
(
!
mmc
)
return
CMD_RET_FAILURE
;
}
mmc
->
has_init
=
0
;
if
(
mmc_init
(
mmc
))
return
CMD_RET_FAILURE
;
return
CMD_RET_SUCCESS
;
}
static
int
do_mmc_part
(
cmd_tbl_t
*
cmdtp
,
int
flag
,
...
...
@@ -387,7 +383,7 @@ static int do_mmc_part(cmd_tbl_t *cmdtp, int flag,
block_dev_desc_t
*
mmc_dev
;
struct
mmc
*
mmc
;
mmc
=
init_mmc_device
(
curr_device
);
mmc
=
init_mmc_device
(
curr_device
,
false
);
if
(
!
mmc
)
return
CMD_RET_FAILURE
;
...
...
@@ -403,7 +399,7 @@ static int do_mmc_part(cmd_tbl_t *cmdtp, int flag,
static
int
do_mmc_dev
(
cmd_tbl_t
*
cmdtp
,
int
flag
,
int
argc
,
char
*
const
argv
[])
{
int
dev
,
part
=
-
1
,
ret
;
int
dev
,
part
=
0
,
ret
;
struct
mmc
*
mmc
;
if
(
argc
==
1
)
{
...
...
@@ -422,17 +418,16 @@ static int do_mmc_dev(cmd_tbl_t *cmdtp, int flag,
return
CMD_RET_USAGE
;
}
mmc
=
init_mmc_device
(
dev
);
mmc
=
init_mmc_device
(
dev
,
true
);
if
(
!
mmc
)
return
CMD_RET_FAILURE
;
if
(
part
!=
-
1
)
{
ret
=
mmc_select_hwpart
(
dev
,
part
);
printf
(
"switch to partitions #%d, %s
\n
"
,
part
,
(
!
ret
)
?
"OK"
:
"ERROR"
);
if
(
ret
)
return
1
;
}
curr_device
=
dev
;
if
(
mmc
->
part_config
==
MMCPART_NOAVAILABLE
)
printf
(
"mmc%d is current device
\n
"
,
curr_device
);
...
...
@@ -463,7 +458,7 @@ static int do_mmc_bootbus(cmd_tbl_t *cmdtp, int flag,
reset
=
simple_strtoul
(
argv
[
3
],
NULL
,
10
);
mode
=
simple_strtoul
(
argv
[
4
],
NULL
,
10
);
mmc
=
init_mmc_device
(
dev
);
mmc
=
init_mmc_device
(
dev
,
false
);
if
(
!
mmc
)
return
CMD_RET_FAILURE
;
...
...
@@ -488,7 +483,7 @@ static int do_mmc_boot_resize(cmd_tbl_t *cmdtp, int flag,
bootsize
=
simple_strtoul
(
argv
[
2
],
NULL
,
10
);
rpmbsize
=
simple_strtoul
(
argv
[
3
],
NULL
,
10
);
mmc
=
init_mmc_device
(
dev
);
mmc
=
init_mmc_device
(
dev
,
false
);
if
(
!
mmc
)
return
CMD_RET_FAILURE
;
...
...
@@ -521,7 +516,7 @@ static int do_mmc_partconf(cmd_tbl_t *cmdtp, int flag,
part_num
=
simple_strtoul
(
argv
[
3
],
NULL
,
10
);
access
=
simple_strtoul
(
argv
[
4
],
NULL
,
10
);
mmc
=
init_mmc_device
(
dev
);
mmc
=
init_mmc_device
(
dev
,
false
);
if
(
!
mmc
)
return
CMD_RET_FAILURE
;
...
...
@@ -556,7 +551,7 @@ static int do_mmc_rst_func(cmd_tbl_t *cmdtp, int flag,
return
CMD_RET_USAGE
;
}
mmc
=
init_mmc_device
(
dev
);
mmc
=
init_mmc_device
(
dev
,
false
);
if
(
!
mmc
)
return
CMD_RET_FAILURE
;
...
...
This diff is collapsed.
Click to expand it.
disk/part.c
+
3
−
3
View file @
d8a97f93
...
...
@@ -86,7 +86,7 @@ block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart)
block_dev_desc_t
*
dev_desc
=
reloc_get_dev
(
dev
);
if
(
!
dev_desc
)
return
NULL
;
if
(
hwpart
==
-
1
)
if
(
hwpart
==
0
&&
!
select_hwpart
)
return
dev_desc
;
if
(
!
select_hwpart
)
return
NULL
;
...
...
@@ -102,7 +102,7 @@ block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart)
block_dev_desc_t
*
get_dev
(
const
char
*
ifname
,
int
dev
)
{
return
get_dev_hwpart
(
ifname
,
dev
,
-
1
);
return
get_dev_hwpart
(
ifname
,
dev
,
0
);
}
#else
block_dev_desc_t
*
get_dev_hwpart
(
const
char
*
ifname
,
int
dev
,
int
hwpart
)
...
...
@@ -460,7 +460,7 @@ int get_device(const char *ifname, const char *dev_hwpart_str,
hwpart_str
++
;
}
else
{
dev_str
=
dev_hwpart_str
;
hwpart
=
-
1
;
hwpart
=
0
;
}
dev
=
simple_strtoul
(
dev_str
,
&
ep
,
16
);
...
...
This diff is collapsed.
Click to expand it.
drivers/mmc/kona_sdhci.c
+
6
−
2
View file @
d8a97f93
...
...
@@ -113,16 +113,20 @@ int kona_sdhci_init(int dev_index, u32 min_clk, u32 quirks)
__func__
,
dev_index
);
ret
=
-
EINVAL
;
}
if
(
ret
)
if
(
ret
)
{
free
(
host
);
return
ret
;
}
host
->
name
=
"kona-sdhci"
;
host
->
ioaddr
=
reg_base
;
host
->
quirks
=
quirks
;
host
->
host_caps
=
MMC_MODE_HC
;
if
(
init_kona_mmc_core
(
host
))
if
(
init_kona_mmc_core
(
host
))
{
free
(
host
);
return
-
EINVAL
;
}
if
(
quirks
&
SDHCI_QUIRK_REG32_RW
)
host
->
version
=
sdhci_readl
(
host
,
SDHCI_HOST_VERSION
-
2
)
>>
16
;
...
...
This diff is collapsed.
Click to expand it.
drivers/mmc/mmc.c
+
4
−
3
View file @
d8a97f93
...
...
@@ -10,6 +10,7 @@
#include
<config.h>
#include
<common.h>
#include
<command.h>
#include
<errno.h>
#include
<mmc.h>
#include
<part.h>
#include
<malloc.h>
...
...
@@ -564,19 +565,19 @@ int mmc_select_hwpart(int dev_num, int hwpart)
int
ret
;
if
(
!
mmc
)
return
-
1
;
return
-
ENODEV
;
if
(
mmc
->
part_num
==
hwpart
)
return
0
;
if
(
mmc
->
part_config
==
MMCPART_NOAVAILABLE
)
{
printf
(
"Card doesn't support part_switch
\n
"
);
return
-
1
;
return
-
EMEDIUMTYPE
;
}
ret
=
mmc_switch_part
(
dev_num
,
hwpart
);
if
(
ret
)
return
-
1
;
return
ret
;
mmc
->
part_num
=
hwpart
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment