Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
litex
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jonathan Currier
litex
Commits
e473c6f2
Commit
e473c6f2
authored
Jul 06, 2020
by
Florent Kermarrec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
liblitesdcard/sdcard: add timeout when waiting card to be ready.
parent
31d4d7c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
litex/soc/software/liblitesdcard/sdcard.c
litex/soc/software/liblitesdcard/sdcard.c
+6
-2
No files found.
litex/soc/software/liblitesdcard/sdcard.c
View file @
e473c6f2
...
...
@@ -448,6 +448,7 @@ void sdcard_decode_csd(void) {
int
sdcard_init
(
void
)
{
unsigned
short
rca
;
uint16_t
timeout
;
/* initialize freq */
sdcard_set_clk_freq
(
16000000
);
...
...
@@ -461,15 +462,18 @@ int sdcard_init(void) {
busy_wait
(
1
);
sdcard_send_ext_csd
();
/* wait for card to be ready */
/* FIXME: 1.8v support */
for
(;;
)
{
timeout
=
10
;
while
(
timeout
)
{
sdcard_app_cmd
(
0
);
sdcard_app_send_op_cond
(
1
,
0
);
if
(
sdcard_response
[
3
]
&
0x80000000
)
{
break
;
}
busy_wait
(
1
);
timeout
--
;
}
if
(
timeout
==
0
)
return
0
;
/* send identification */
sdcard_all_send_cid
();
...
...
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