ARC: [plat-hsdk] Increase SDIO CIU frequency to 50000000Hz
With current SDIO CIU clock frequency (12500000Hz) DW MMC controller fails to initialize some SD cards (which don't support slow mode). So increase SDIO CIU frequency from 12500000Hz to 50000000Hz by switching from the default divisor value (div-by-8) to the minimum possible value of the divisor (div-by-2) in HSDK platform code. Reported-by: Vineet Gupta <vgupta@synopsys.com> Tested-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
This commit is contained in:
parent
a528629dfd
commit
753affba96
@ -137,14 +137,15 @@
|
|||||||
/*
|
/*
|
||||||
* DW sdio controller has external ciu clock divider
|
* DW sdio controller has external ciu clock divider
|
||||||
* controlled via register in SDIO IP. Due to its
|
* controlled via register in SDIO IP. Due to its
|
||||||
* unexpected default value (it should devide by 1
|
* unexpected default value (it should divide by 1
|
||||||
* but it devides by 8) SDIO IP uses wrong clock and
|
* but it divides by 8) SDIO IP uses wrong clock and
|
||||||
* works unstable (see STAR 9001204800)
|
* works unstable (see STAR 9001204800)
|
||||||
|
* We switched to the minimum possible value of the
|
||||||
|
* divisor (div-by-2) in HSDK platform code.
|
||||||
* So add temporary fix and change clock frequency
|
* So add temporary fix and change clock frequency
|
||||||
* from 100000000 to 12500000 Hz until we fix dw sdio
|
* to 50000000 Hz until we fix dw sdio driver itself.
|
||||||
* driver itself.
|
|
||||||
*/
|
*/
|
||||||
clock-frequency = <12500000>;
|
clock-frequency = <50000000>;
|
||||||
#clock-cells = <0>;
|
#clock-cells = <0>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -74,6 +74,10 @@ static void __init hsdk_set_cpu_freq_1ghz(void)
|
|||||||
pr_err("Failed to setup CPU frequency to 1GHz!");
|
pr_err("Failed to setup CPU frequency to 1GHz!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define SDIO_BASE (ARC_PERIPHERAL_BASE + 0xA000)
|
||||||
|
#define SDIO_UHS_REG_EXT (SDIO_BASE + 0x108)
|
||||||
|
#define SDIO_UHS_REG_EXT_DIV_2 (2 << 30)
|
||||||
|
|
||||||
static void __init hsdk_init_early(void)
|
static void __init hsdk_init_early(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -89,6 +93,12 @@ static void __init hsdk_init_early(void)
|
|||||||
/* Really apply settings made above */
|
/* Really apply settings made above */
|
||||||
writel(1, (void __iomem *) CREG_PAE_UPDATE);
|
writel(1, (void __iomem *) CREG_PAE_UPDATE);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Switch SDIO external ciu clock divider from default div-by-8 to
|
||||||
|
* minimum possible div-by-2.
|
||||||
|
*/
|
||||||
|
iowrite32(SDIO_UHS_REG_EXT_DIV_2, (void __iomem *) SDIO_UHS_REG_EXT);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Setup CPU frequency to 1GHz.
|
* Setup CPU frequency to 1GHz.
|
||||||
* TODO: remove it after smart hsdk pll driver will be introduced.
|
* TODO: remove it after smart hsdk pll driver will be introduced.
|
||||||
|
Loading…
Reference in New Issue
Block a user