Skip to content

Commit

Permalink
mmc: sdhci-of-esdhc: limit SD clock for ls1012a/ls1046a
Browse files Browse the repository at this point in the history
The ls1046a datasheet specified that the max SD clock frequency
for eSDHC SDR104/HS200 was 167MHz, and the ls1012a datasheet
specified it's 125MHz for ls1012a. So this patch is to add the
limitation.

Signed-off-by: Yangbo Lu <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
  • Loading branch information
yangbolu1991 authored and storulf committed Apr 28, 2017
1 parent e145ac4 commit a627f02
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/mmc/host/sdhci-of-esdhc.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,20 @@ static void esdhc_of_set_clock(struct sdhci_host *host, unsigned int clock)
if (esdhc->vendor_ver < VENDOR_V_23)
pre_div = 2;

/*
* Limit SD clock to 167MHz for ls1046a according to its datasheet
*/
if (clock > 167000000 &&
of_find_compatible_node(NULL, NULL, "fsl,ls1046a-esdhc"))
clock = 167000000;

/*
* Limit SD clock to 125MHz for ls1012a according to its datasheet
*/
if (clock > 125000000 &&
of_find_compatible_node(NULL, NULL, "fsl,ls1012a-esdhc"))
clock = 125000000;

/* Workaround to reduce the clock frequency for p1010 esdhc */
if (of_find_compatible_node(NULL, NULL, "fsl,p1010-esdhc")) {
if (clock > 20000000)
Expand Down

0 comments on commit a627f02

Please sign in to comment.