Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
f4grx
NuttX RTOS
Commits
ce9eb714
Commit
ce9eb714
authored
11 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
SAMA5: A few early, easy bug fixes. The rest will all be difficult
parent
fa011d9a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
arch/arm/src/sama5/sam_hsmci.c
+36
-30
36 additions, 30 deletions
arch/arm/src/sama5/sam_hsmci.c
configs/sama5d3x-ek/src/sam_hsmci.c
+10
-10
10 additions, 10 deletions
configs/sama5d3x-ek/src/sam_hsmci.c
drivers/mmcsd/mmcsd_sdio.c
+1
-0
1 addition, 0 deletions
drivers/mmcsd/mmcsd_sdio.c
with
47 additions
and
40 deletions
arch/arm/src/sama5/sam_hsmci.c
+
36
−
30
View file @
ce9eb714
...
...
@@ -494,38 +494,37 @@ static void sam_callback(void *arg);
* Private Data
****************************************************************************/
struct
sam_dev_s
g_sdiodev
=
/* Callbacks */
static
const
struct
sdio_dev_s
g_callbacks
=
{
.
dev
=
{
.
reset
=
sam_reset
,
.
status
=
sam_status
,
.
widebus
=
sam_widebus
,
.
clock
=
sam_clock
,
.
attach
=
sam_attach
,
.
sendcmd
=
sam_sendcmd
,
.
blocksetup
=
sam_blocksetup
,
.
recvsetup
=
sam_dmarecvsetup
,
.
sendsetup
=
sam_dmasendsetup
,
.
cancel
=
sam_cancel
,
.
waitresponse
=
sam_waitresponse
,
.
recvR1
=
sam_recvshort
,
.
recvR2
=
sam_recvlong
,
.
recvR3
=
sam_recvshort
,
.
recvR4
=
sam_recvnotimpl
,
.
recvR5
=
sam_recvnotimpl
,
.
recvR6
=
sam_recvshort
,
.
recvR7
=
sam_recvshort
,
.
waitenable
=
sam_waitenable
,
.
eventwait
=
sam_eventwait
,
.
callbackenable
=
sam_callbackenable
,
.
registercallback
=
sam_registercallback
,
.
reset
=
sam_reset
,
.
status
=
sam_status
,
.
widebus
=
sam_widebus
,
.
clock
=
sam_clock
,
.
attach
=
sam_attach
,
.
sendcmd
=
sam_sendcmd
,
.
blocksetup
=
sam_blocksetup
,
.
recvsetup
=
sam_dmarecvsetup
,
.
sendsetup
=
sam_dmasendsetup
,
.
cancel
=
sam_cancel
,
.
waitresponse
=
sam_waitresponse
,
.
recvR1
=
sam_recvshort
,
.
recvR2
=
sam_recvlong
,
.
recvR3
=
sam_recvshort
,
.
recvR4
=
sam_recvnotimpl
,
.
recvR5
=
sam_recvnotimpl
,
.
recvR6
=
sam_recvshort
,
.
recvR7
=
sam_recvshort
,
.
waitenable
=
sam_waitenable
,
.
eventwait
=
sam_eventwait
,
.
callbackenable
=
sam_callbackenable
,
.
registercallback
=
sam_registercallback
,
#ifdef CONFIG_SDIO_DMA
.
dmasupported
=
sam_dmasupported
,
.
dmarecvsetup
=
sam_dmarecvsetup
,
.
dmasendsetup
=
sam_dmasendsetup
,
.
dmasupported
=
sam_dmasupported
,
.
dmarecvsetup
=
sam_dmarecvsetup
,
.
dmasendsetup
=
sam_dmasendsetup
,
#endif
},
};
/* Pre-allocate memory for each HSMCI device */
...
...
@@ -2809,12 +2808,19 @@ FAR struct sdio_dev_s *sdio_initialize(int slotno)
return
NULL
;
}
fvdbg
(
"priv: %p base: %08x hsmci: %d dmac: %d pid: %d
\n
"
,
priv
,
priv
->
base
,
priv
->
hsmci
,
dmac
,
pid
);
/* Initialize the HSMCI slot structure */
sem_init
(
&
priv
->
waitsem
,
0
,
0
);
priv
->
waitwdog
=
wd_create
();
DEBUGASSERT
(
priv
->
waitwdog
);
/* Initialize the callbacks */
memcpy
(
&
priv
->
dev
,
&
g_callbacks
,
sizeof
(
struct
sdio_dev_s
));
/* Allocate a DMA channel */
priv
->
dma
=
sam_dmachannel
(
dmac
,
DMA_FLAGS
(
pid
));
...
...
@@ -2825,7 +2831,7 @@ FAR struct sdio_dev_s *sdio_initialize(int slotno)
*/
sam_reset
(
&
priv
->
dev
);
return
&
g_sdiodev
.
dev
;
return
&
priv
->
dev
;
}
/****************************************************************************
...
...
This diff is collapsed.
Click to expand it.
configs/sama5d3x-ek/src/sam_hsmci.c
+
10
−
10
View file @
ce9eb714
...
...
@@ -136,10 +136,10 @@
struct
sam_hsmci_info_s
{
pio_pinset_t
pincfg
;
uint8_t
irq
;
xcpt_t
handler
;
struct
sdio_dev_s
**
hsmci
;
pio_pinset_t
pincfg
;
/* Card detect PIO pin configuratin */
uint8_t
irq
;
/* Interrupt number (same as pid) */
xcpt_t
handler
;
/* Interrupt handler */
struct
sdio_dev_s
**
hsmci
;
/* R/W device handle */
};
/****************************************************************************
...
...
@@ -264,9 +264,9 @@ int sam_hsmci_initialize(int slotno, int minor)
/* Get the HSMI description */
info
=
sam_hsmci_info
(
slotno
);
if
(
info
)
if
(
!
info
)
{
fdbg
(
"No info for slotno
&
d
\n
"
,
slotno
);
fdbg
(
"No info for slotno
%
d
\n
"
,
slotno
);
return
-
EINVAL
;
}
...
...
@@ -325,16 +325,16 @@ bool sam_cardinserted(int slotno)
/* Get the HSMI description */
info
=
sam_hsmci_info
(
slotno
);
if
(
info
)
if
(
!
info
)
{
fdbg
(
"No info for slotno
&
d
\n
"
,
slotno
);
fdbg
(
"No info for slotno
%
d
\n
"
,
slotno
);
return
false
;
}
/* Get the state of the PIO pin */
inserted
=
sam_pioread
(
PIO_MCI0_CD
);
fvdbg
(
"Slot
0
inserted: %s
\n
"
,
slotno
,
inserted
?
"NO"
:
"YES"
);
inserted
=
sam_pioread
(
info
->
pincfg
);
fvdbg
(
"Slot
%d
inserted: %s
\n
"
,
slotno
,
inserted
?
"NO"
:
"YES"
);
return
!
inserted
;
#else
/* HAVE_MMCSD */
...
...
This diff is collapsed.
Click to expand it.
drivers/mmcsd/mmcsd_sdio.c
+
1
−
0
View file @
ce9eb714
...
...
@@ -2982,6 +2982,7 @@ static int mmcsd_hwinitialize(FAR struct mmcsd_state_s *priv)
mmcsd_givesem
(
priv
);
return
-
EBUSY
;
}
fvdbg
(
"Attached MMC/SD interrupts
\n
"
);
/* Register a callback so that we get informed if media is inserted or
...
...
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