Skip to content

Commit

Permalink
Merge branch 'master' of github.com:apache/incubator-nuttx
Browse files Browse the repository at this point in the history
  • Loading branch information
gregory-nutt committed Jan 7, 2020
2 parents 0360bb8 + 0b3dac2 commit 65f8cab
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
2 changes: 1 addition & 1 deletion arch/arm/src/imxrt/imxrt_ehci.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/imxrt/imxrt_ehci.c
*
* Copyright (C) 2013-2017 Gregory Nutt. All rights reserved.
* Copyright (C) 2013-2017, 2020 Gregory Nutt. All rights reserved.
* Authors: Gregory Nutt <gnutt@nuttx.org>
* Dave Marples <dave@marples.net>
*
Expand Down
32 changes: 29 additions & 3 deletions arch/arm/src/imxrt/imxrt_usdhc.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

/* Configuration ************************************************************/

#if ((defined(CONFIG_IMXRT_USDHC1) && !defined(CONFIG_IMXRT_USDHC2)) || \
#if ((defined(CONFIG_IMXRT_USDHC1) && !defined(CONFIG_IMXRT_USDHC2)) || \
(defined(CONFIG_IMXRT_USDHC2) && !defined(CONFIG_IMXRT_USDHC1)))
# define IMXRT_MAX_SDHC_DEV_SLOTS 1
#elif (defined(CONFIG_IMXRT_USDHC1) && defined(CONFIG_IMXRT_USDHC2))
Expand Down Expand Up @@ -1232,11 +1232,30 @@ static int imxrt_interrupt(int irq, void *context, FAR void *arg)

/* We don't want any more ints now, so switch it off */

priv->cintints = 0;
regval &= ~USDHC_INT_CINT;
priv->cintints = regval;
putreg32(regval, priv->addr + IMXRT_USDHC_IRQSIGEN_OFFSET);
}

if ((pending & USDHC_INT_CINS) != 0 || (pending & USDHC_INT_CRM) != 0)
{
if (up_interrupt_context())
{
/* Yes.. queue it */

mcinfo("Queuing callback to %p(%p)\n", priv->callback, priv->cbarg);
(void)work_queue(HPWORK, &priv->cbwork, (worker_t)priv->callback,
priv->cbarg, 0);
}
else
{
/* No.. then just call the callback here */

mcinfo("Callback to %p(%p)\n", priv->callback, priv->cbarg);
priv->callback(priv->cbarg);
}
}

/* Handle wait events *****************************************************/

pending = enabled & priv->waitints;
Expand Down Expand Up @@ -3019,7 +3038,14 @@ void imxrt_usdhc_set_sdio_card_isr(FAR struct sdio_dev_s *dev,
priv->cintints = 0;
}

flags = enter_critical_section();
#if defined(CONFIG_MMCSD_HAVE_CARDDETECT)
if (priv->sw_cd_gpio == 0)
{
priv->cintints |= USDHC_INT_CINS | USDHC_INT_CRM;
}
#endif

flags = enter_critical_section();
regval = getreg32(priv->addr + IMXRT_USDHC_IRQSIGEN_OFFSET);
regval = (regval & ~USDHC_INT_CINT) | priv->cintints;
putreg32(regval, priv->addr + IMXRT_USDHC_IRQSIGEN_OFFSET);
Expand Down
5 changes: 4 additions & 1 deletion boards/arm/imxrt/imxrt1060-evk/src/imxrt_bringup.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/****************************************************************************
* boards/arm/imxrt/imxrt1060-evk/src/imxrt_bringup.c
*
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
* Copyright (C) 2018, 2020 Gregory Nutt. All rights reserved.
* Authors: Gregory Nutt <gnutt@nuttx.org>
* David Sidrane <david_s5@nscdg.com>
*
Expand Down Expand Up @@ -121,7 +121,10 @@ static int nsh_sdmmc_initialize(void)
"ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n",
ret);
}

imxrt_usdhc_set_sdio_card_isr(sdmmc, NULL, NULL);
}

return OK;
}
#else
Expand Down

0 comments on commit 65f8cab

Please sign in to comment.