configs/lpcxpresso-lpc54628: Fix SD/MMC clock divisor.

This commit is contained in:
Gregory Nutt 2017-12-19 12:43:44 -06:00
parent ba1301a43a
commit a8933f96bd
2 changed files with 6 additions and 2 deletions

View File

@ -1309,7 +1309,7 @@ static void lpc54_clock(FAR struct sdio_dev_s *dev, enum sdio_clock_e rate)
lpc54_setclock(clkdiv);
/* Enable disable clock */
/* Enable the new clock */
lpc54_sdcard_clock(enabled);
}

View File

@ -196,10 +196,14 @@
/* SD/MMC or SDIO interface
*
* NOTE: The SDIO function clock to the interface can be up to 50 MHZ.
* Example: BOARD_MAIN_CLK=220MHz, CLKDIV=5
*/
#define BOARD_SDMMC_MAXFREQ 50000000
#define BOARD_SDMMC_CEIL(a,b) (((a) + (b) - 1) / (b))
#define BOARD_SDMMC_CLKSRC SYSCON_SDIOCLKSEL_MAINCLK
#define BOARD_SDMMC_CLKDIV (BOARD_MAIN_CLK / 50000000)
#define BOARD_SDMMC_CLKDIV BOARD_SDMMC_CEIL(BOARD_MAIN_CLK, BOARD_SDMMC_MAXFREQ)
#define BOARD_SDMMC_FREQUENCY (BOARD_MAIN_CLK / BOARD_SDMMC_CLKDIV)
/* LED definitions *********************************************************/