mmc/dwmmc: modify FIFO threshold only if value explicitly set
PATCH v2 1/1 mmc/dwmmc: modify FIFO threshold only if value explicitly set
If platform provides "host->fifoth_val" it will be used for initialization of DWMCI_FIFOTH register. Otherwise default value will be used.
This implementation allows:
* escape unclear and recursive calculations that are currently in use
* use whatever custom value for DWMCI_FIFOTH initialization if any
particular SoC requires it
--- drivers/mmc/dw_mmc.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/mmc/dw_mmc.c +2 -7
@@ -300,7 +300,6 @@ static void dwmci_set_ios(struct mmc *mmc)static int dwmci_init (struct mmc *mmc) {struct dwmci_host *host = (struct dwmci_host *)mmc->priv; -u32 fifo_size;if (host->quirks &DWMCI_QUIRK_DISABLE_SMU ) {dwmci_writel (host,EMMCP_MPSBEGIN0 ,0 );
@@ -330,13 +329,9 @@ static int dwmci_init(struct mmc *mmc)dwmci_writel (host,DWMCI_IDINTEN ,0 );dwmci_writel (host,DWMCI_BMOD ,1 ); -if (!host->fifoth_val) { - fifo_size =dwmci_readl (host,DWMCI_FIFOTH ); - fifo_size = ((fifo_size &RX_WMARK_MASK ) >>RX_WMARK_SHIFT ) +1 ; - host->fifoth_val =MSIZE (0x2 ) |RX_WMARK (fifo_size /2 -1 ) | -TX_WMARK (fifo_size /2 ); +if (host->fifoth_val) { +dwmci_writel (host,DWMCI_FIFOTH , host->fifoth_val); } -dwmci_writel (host,DWMCI_FIFOTH , host->fifoth_val);dwmci_writel (host,DWMCI_CLKENA ,0 );dwmci_writel (host,DWMCI_CLKSRC ,0 );
Signature · 1 line
1.8.4.2
PATCH v2 1/1 mmc/dwmmc: modify FIFO threshold only if value explicitly set
Quoted 54 lines · Alexey Brodkin
If platform provides "
host->fifoth_val" it will be used for initialization ofDWMCI_FIFOTHregister. Otherwise default value will be used.This implementation allows:
* escape unclear and recursive calculations that are currently in use
* use whatever custom value forDWMCI_FIFOTHinitialization if any
particular SoC requires itSigned-off-by Alexey Brodkin <[email protected]>Cc Mischa Jonker <[email protected]>Cc Alim Akhtar <[email protected]>Cc Rajeshwari Shinde <[email protected]>Cc Jaehoon Chung <[email protected]>Cc Amar <[email protected]>Cc Kyungmin Park <[email protected]>Cc Minkyu Kang <[email protected]>Cc Simon Glass <[email protected]>Cc Pantelis Antoniou <[email protected]>Cc Andy Fleming <[email protected]>--- drivers/mmc/dw_mmc.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)drivers/mmc/dw_mmc.c +2
-7@@ -300,7 +300,6 @@ static void dwmci_set_ios(struct mmc *mmc)static int dwmci_init (struct mmc *mmc) {struct dwmci_host *host = (struct dwmci_host *)mmc->priv; -u32 fifo_size;if (host->quirks &DWMCI_QUIRK_DISABLE_SMU ) {dwmci_writel (host,EMMCP_MPSBEGIN0 ,0 );@@ -330,13 +329,9 @@ static int dwmci_init(struct mmc *mmc)dwmci_writel (host,DWMCI_IDINTEN ,0 );dwmci_writel (host,DWMCI_BMOD ,1 ); -if (!host->fifoth_val) { - fifo_size =dwmci_readl (host,DWMCI_FIFOTH ); - fifo_size = ((fifo_size &RX_WMARK_MASK ) >>RX_WMARK_SHIFT ) +1 ; - host->fifoth_val =MSIZE (0x2 ) |RX_WMARK (fifo_size /2 -1 ) | -TX_WMARK (fifo_size /2 ); +if (host->fifoth_val) { +dwmci_writel (host,DWMCI_FIFOTH , host->fifoth_val); } -dwmci_writel (host,DWMCI_FIFOTH , host->fifoth_val);dwmci_writel (host,DWMCI_CLKENA ,0 );dwmci_writel (host,DWMCI_CLKSRC ,0 );
PATCH v2 1/1 mmc/dwmmc: modify FIFO threshold only if value explicitly set
Quoted 1 line · Jaehoon Chung
Acked-by Jaehoon Chung <[email protected]>
Any chance to get this patch applied?
-Alexey
PATCH v2 1/1 mmc/dwmmc: modify FIFO threshold only if value explicitly set
Hi Alexey,
Will do so over the weekend.
Regards
-- Pantelis
Quoted 6 lines · Alexey Brodkin
Quoted 1 line · Jaehoon Chung
Acked-by Jaehoon Chung <[email protected]>Any chance to get this patch applied?
-Alexey
PATCH v2 1/1 mmc/dwmmc: modify FIFO threshold only if value explicitly set
In reply to Alexey BrodkinHi Alexey,
Quoted 56 lines · Alexey Brodkin
If platform provides "
host->fifoth_val" it will be used for initialization ofDWMCI_FIFOTHregister. Otherwise default value will be used.This implementation allows:
* escape unclear and recursive calculations that are currently in use
* use whatever custom value forDWMCI_FIFOTHinitialization if any particular SoC requires itSigned-off-by Alexey Brodkin <[email protected]>Cc Mischa Jonker <[email protected]>Cc Alim Akhtar <[email protected]>Cc Rajeshwari Shinde <[email protected]>Cc Jaehoon Chung <[email protected]>Cc Amar <[email protected]>Cc Kyungmin Park <[email protected]>Cc Minkyu Kang <[email protected]>Cc Simon Glass <[email protected]>Cc Pantelis Antoniou <[email protected]>Cc Andy Fleming <[email protected]>---
drivers/mmc/dw_mmc.c| 9 ++-------1 file changed, 2 insertions(+), 7 deletions(-)drivers/mmc/dw_mmc.c +2
-7@@ -300,7 +300,6 @@ static void dwmci_set_ios(struct mmc *mmc)static int dwmci_init (struct mmc *mmc) {struct dwmci_host *host = (struct dwmci_host *)mmc->priv; -u32 fifo_size;if (host->quirks &DWMCI_QUIRK_DISABLE_SMU ) {dwmci_writel (host,EMMCP_MPSBEGIN0 ,0 );@@ -330,13 +329,9 @@ static int dwmci_init(struct mmc *mmc)dwmci_writel (host,DWMCI_IDINTEN ,0 );dwmci_writel (host,DWMCI_BMOD ,1 ); -if (!host->fifoth_val) { - fifo_size =dwmci_readl (host,DWMCI_FIFOTH ); - fifo_size = ((fifo_size &RX_WMARK_MASK ) >>RX_WMARK_SHIFT ) +1 ; - host->fifoth_val =MSIZE (0x2 ) |RX_WMARK (fifo_size /2 -1 ) | -TX_WMARK (fifo_size /2 ); +if (host->fifoth_val) { +dwmci_writel (host,DWMCI_FIFOTH , host->fifoth_val); } -dwmci_writel (host,DWMCI_FIFOTH , host->fifoth_val);dwmci_writel (host,DWMCI_CLKENA ,0 );dwmci_writel (host,DWMCI_CLKSRC ,0 );Signature · 1 line
1.8.4.2
Thanks
-- Pantelis