public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] mmc: dw_mmc: remove the exynos specific code in dw-mmc.c
@ 2013-11-29 11:08 Jaehoon Chung
  2013-11-29 11:23 ` Alexey Brodkin
  2013-11-29 12:01 ` Pantelis Antoniou
  0 siblings, 2 replies; 5+ messages in thread
From: Jaehoon Chung @ 2013-11-29 11:08 UTC (permalink / raw)
  To: u-boot

dw-mmc.c is the general driver file.
So, remove the exynos specific code at dw-mmc.c.
Instead, exynos specific cod can be move into exynos-dw_mmc.c.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
 drivers/mmc/dw_mmc.c        |   12 ++----------
 drivers/mmc/exynos_dw_mmc.c |   14 ++++++++++++++
 include/dwmmc.h             |    1 +
 3 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
index 1e0f72b..38f50ce 100644
--- a/drivers/mmc/dw_mmc.c
+++ b/drivers/mmc/dw_mmc.c
@@ -11,7 +11,6 @@
 #include <mmc.h>
 #include <dwmmc.h>
 #include <asm-generic/errno.h>
-#include <asm/arch/dwmmc.h>
 
 #define PAGE_SIZE 4096
 
@@ -302,15 +301,8 @@ 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);
-		dwmci_writel(host, EMMCP_SEND0, 0);
-		dwmci_writel(host, EMMCP_CTRL0,
-			     MPSCTRL_SECURE_READ_BIT |
-			     MPSCTRL_SECURE_WRITE_BIT |
-			     MPSCTRL_NON_SECURE_READ_BIT |
-			     MPSCTRL_NON_SECURE_WRITE_BIT | MPSCTRL_VALID);
-	}
+	if (host->board_init)
+		host->board_init(host);
 
 	dwmci_writel(host, DWMCI_PWREN, 1);
 
diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
index a0f1511..b3e5c5e 100644
--- a/drivers/mmc/exynos_dw_mmc.c
+++ b/drivers/mmc/exynos_dw_mmc.c
@@ -34,6 +34,19 @@ unsigned int exynos_dwmci_get_clk(int dev_index)
 	return get_mmc_clk(dev_index);
 }
 
+static void exynos_dwmci_board_init(struct dwmci_host *host)
+{
+	if (host->quirks & DWMCI_QUIRK_DISABLE_SMU) {
+		dwmci_writel(host, EMMCP_MPSBEGIN0, 0);
+		dwmci_writel(host, EMMCP_SEND0, 0);
+		dwmci_writel(host, EMMCP_CTRL0,
+			     MPSCTRL_SECURE_READ_BIT |
+			     MPSCTRL_SECURE_WRITE_BIT |
+			     MPSCTRL_NON_SECURE_READ_BIT |
+			     MPSCTRL_NON_SECURE_WRITE_BIT | MPSCTRL_VALID);
+	}
+}
+
 /*
  * This function adds the mmc channel to be registered with mmc core.
  * index -	mmc channel number.
@@ -65,6 +78,7 @@ int exynos_dwmci_add_port(int index, u32 regbase, int bus_width, u32 clksel)
 #ifdef CONFIG_EXYNOS5420
 	host->quirks = DWMCI_QUIRK_DISABLE_SMU;
 #endif
+	host->board_init = exynos_dwmci_board_init;
 
 	if (clksel) {
 		host->clksel_val = clksel;
diff --git a/include/dwmmc.h b/include/dwmmc.h
index 6c91143..a02dd67 100644
--- a/include/dwmmc.h
+++ b/include/dwmmc.h
@@ -141,6 +141,7 @@ struct dwmci_host {
 	struct mmc *mmc;
 
 	void (*clksel)(struct dwmci_host *host);
+	void (*board_init)(struct dwmci_host *host);
 	unsigned int (*get_mmc_clk)(int dev_index);
 };
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] mmc: dw_mmc: remove the exynos specific code in dw-mmc.c
  2013-11-29 11:08 [U-Boot] [PATCH] mmc: dw_mmc: remove the exynos specific code in dw-mmc.c Jaehoon Chung
@ 2013-11-29 11:23 ` Alexey Brodkin
  2013-11-29 11:59   ` Rajeshwari Birje
  2013-11-29 12:01 ` Pantelis Antoniou
  1 sibling, 1 reply; 5+ messages in thread
From: Alexey Brodkin @ 2013-11-29 11:23 UTC (permalink / raw)
  To: u-boot

Acked-by: Alexey Brodkin <abrodkin@synopsys.com>

On Fri, 2013-11-29 at 20:08 +0900, Jaehoon Chung wrote:
> dw-mmc.c is the general driver file.
> So, remove the exynos specific code at dw-mmc.c.
> Instead, exynos specific cod can be move into exynos-dw_mmc.c.
> 
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] mmc: dw_mmc: remove the exynos specific code in dw-mmc.c
  2013-11-29 11:23 ` Alexey Brodkin
@ 2013-11-29 11:59   ` Rajeshwari Birje
  0 siblings, 0 replies; 5+ messages in thread
From: Rajeshwari Birje @ 2013-11-29 11:59 UTC (permalink / raw)
  To: u-boot

Hi,

Had raised this point when I had got comments for the patch
"[10/10,V4] DWMMC: SMDK5420: Disable SMU for eMMC"
https://patches.linaro.org/20666/

Acked-by:Rajeshwari Shinde <rajeshwari.s@samsung.com>

Regards,
Rajeshwari Shinde

On Fri, Nov 29, 2013 at 4:53 PM, Alexey Brodkin
<Alexey.Brodkin@synopsys.com> wrote:
> Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
>
> On Fri, 2013-11-29 at 20:08 +0900, Jaehoon Chung wrote:
>> dw-mmc.c is the general driver file.
>> So, remove the exynos specific code at dw-mmc.c.
>> Instead, exynos specific cod can be move into exynos-dw_mmc.c.
>>
>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot



-- 
Regards,
Rajeshwari Shinde

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] mmc: dw_mmc: remove the exynos specific code in dw-mmc.c
  2013-11-29 11:08 [U-Boot] [PATCH] mmc: dw_mmc: remove the exynos specific code in dw-mmc.c Jaehoon Chung
  2013-11-29 11:23 ` Alexey Brodkin
@ 2013-11-29 12:01 ` Pantelis Antoniou
  2013-12-02  9:45   ` Minkyu Kang
  1 sibling, 1 reply; 5+ messages in thread
From: Pantelis Antoniou @ 2013-11-29 12:01 UTC (permalink / raw)
  To: u-boot

Hi Jaehoon,

Looks good

On Nov 29, 2013, at 1:08 PM, Jaehoon Chung wrote:

> dw-mmc.c is the general driver file.
> So, remove the exynos specific code at dw-mmc.c.
> Instead, exynos specific cod can be move into exynos-dw_mmc.c.
> 
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
> drivers/mmc/dw_mmc.c        |   12 ++----------
> drivers/mmc/exynos_dw_mmc.c |   14 ++++++++++++++
> include/dwmmc.h             |    1 +
> 3 files changed, 17 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
> index 1e0f72b..38f50ce 100644
> --- a/drivers/mmc/dw_mmc.c
> +++ b/drivers/mmc/dw_mmc.c
> @@ -11,7 +11,6 @@
> #include <mmc.h>
> #include <dwmmc.h>
> #include <asm-generic/errno.h>
> -#include <asm/arch/dwmmc.h>
> 
> #define PAGE_SIZE 4096
> 
> @@ -302,15 +301,8 @@ 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);
> -		dwmci_writel(host, EMMCP_SEND0, 0);
> -		dwmci_writel(host, EMMCP_CTRL0,
> -			     MPSCTRL_SECURE_READ_BIT |
> -			     MPSCTRL_SECURE_WRITE_BIT |
> -			     MPSCTRL_NON_SECURE_READ_BIT |
> -			     MPSCTRL_NON_SECURE_WRITE_BIT | MPSCTRL_VALID);
> -	}
> +	if (host->board_init)
> +		host->board_init(host);
> 
> 	dwmci_writel(host, DWMCI_PWREN, 1);
> 
> diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
> index a0f1511..b3e5c5e 100644
> --- a/drivers/mmc/exynos_dw_mmc.c
> +++ b/drivers/mmc/exynos_dw_mmc.c
> @@ -34,6 +34,19 @@ unsigned int exynos_dwmci_get_clk(int dev_index)
> 	return get_mmc_clk(dev_index);
> }
> 
> +static void exynos_dwmci_board_init(struct dwmci_host *host)
> +{
> +	if (host->quirks & DWMCI_QUIRK_DISABLE_SMU) {
> +		dwmci_writel(host, EMMCP_MPSBEGIN0, 0);
> +		dwmci_writel(host, EMMCP_SEND0, 0);
> +		dwmci_writel(host, EMMCP_CTRL0,
> +			     MPSCTRL_SECURE_READ_BIT |
> +			     MPSCTRL_SECURE_WRITE_BIT |
> +			     MPSCTRL_NON_SECURE_READ_BIT |
> +			     MPSCTRL_NON_SECURE_WRITE_BIT | MPSCTRL_VALID);
> +	}
> +}
> +
> /*
>  * This function adds the mmc channel to be registered with mmc core.
>  * index -	mmc channel number.
> @@ -65,6 +78,7 @@ int exynos_dwmci_add_port(int index, u32 regbase, int bus_width, u32 clksel)
> #ifdef CONFIG_EXYNOS5420
> 	host->quirks = DWMCI_QUIRK_DISABLE_SMU;
> #endif
> +	host->board_init = exynos_dwmci_board_init;
> 
> 	if (clksel) {
> 		host->clksel_val = clksel;
> diff --git a/include/dwmmc.h b/include/dwmmc.h
> index 6c91143..a02dd67 100644
> --- a/include/dwmmc.h
> +++ b/include/dwmmc.h
> @@ -141,6 +141,7 @@ struct dwmci_host {
> 	struct mmc *mmc;
> 
> 	void (*clksel)(struct dwmci_host *host);
> +	void (*board_init)(struct dwmci_host *host);
> 	unsigned int (*get_mmc_clk)(int dev_index);
> };
> 
> -- 
> 1.7.9.5

Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] mmc: dw_mmc: remove the exynos specific code in dw-mmc.c
  2013-11-29 12:01 ` Pantelis Antoniou
@ 2013-12-02  9:45   ` Minkyu Kang
  0 siblings, 0 replies; 5+ messages in thread
From: Minkyu Kang @ 2013-12-02  9:45 UTC (permalink / raw)
  To: u-boot

On 29/11/13 21:01, Pantelis Antoniou wrote:
> Hi Jaehoon,
> 
> Looks good
> 
> On Nov 29, 2013, at 1:08 PM, Jaehoon Chung wrote:
> 
>> dw-mmc.c is the general driver file.
>> So, remove the exynos specific code at dw-mmc.c.
>> Instead, exynos specific cod can be move into exynos-dw_mmc.c.
>>
>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>> ---
>> drivers/mmc/dw_mmc.c        |   12 ++----------
>> drivers/mmc/exynos_dw_mmc.c |   14 ++++++++++++++
>> include/dwmmc.h             |    1 +
>> 3 files changed, 17 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
>> index 1e0f72b..38f50ce 100644
>> --- a/drivers/mmc/dw_mmc.c
>> +++ b/drivers/mmc/dw_mmc.c
>> @@ -11,7 +11,6 @@
>> #include <mmc.h>
>> #include <dwmmc.h>
>> #include <asm-generic/errno.h>
>> -#include <asm/arch/dwmmc.h>
>>
>> #define PAGE_SIZE 4096
>>
>> @@ -302,15 +301,8 @@ 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);
>> -		dwmci_writel(host, EMMCP_SEND0, 0);
>> -		dwmci_writel(host, EMMCP_CTRL0,
>> -			     MPSCTRL_SECURE_READ_BIT |
>> -			     MPSCTRL_SECURE_WRITE_BIT |
>> -			     MPSCTRL_NON_SECURE_READ_BIT |
>> -			     MPSCTRL_NON_SECURE_WRITE_BIT | MPSCTRL_VALID);
>> -	}
>> +	if (host->board_init)
>> +		host->board_init(host);
>>
>> 	dwmci_writel(host, DWMCI_PWREN, 1);
>>
>> diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
>> index a0f1511..b3e5c5e 100644
>> --- a/drivers/mmc/exynos_dw_mmc.c
>> +++ b/drivers/mmc/exynos_dw_mmc.c
>> @@ -34,6 +34,19 @@ unsigned int exynos_dwmci_get_clk(int dev_index)
>> 	return get_mmc_clk(dev_index);
>> }
>>
>> +static void exynos_dwmci_board_init(struct dwmci_host *host)
>> +{
>> +	if (host->quirks & DWMCI_QUIRK_DISABLE_SMU) {
>> +		dwmci_writel(host, EMMCP_MPSBEGIN0, 0);
>> +		dwmci_writel(host, EMMCP_SEND0, 0);
>> +		dwmci_writel(host, EMMCP_CTRL0,
>> +			     MPSCTRL_SECURE_READ_BIT |
>> +			     MPSCTRL_SECURE_WRITE_BIT |
>> +			     MPSCTRL_NON_SECURE_READ_BIT |
>> +			     MPSCTRL_NON_SECURE_WRITE_BIT | MPSCTRL_VALID);
>> +	}
>> +}
>> +
>> /*
>>  * This function adds the mmc channel to be registered with mmc core.
>>  * index -	mmc channel number.
>> @@ -65,6 +78,7 @@ int exynos_dwmci_add_port(int index, u32 regbase, int bus_width, u32 clksel)
>> #ifdef CONFIG_EXYNOS5420
>> 	host->quirks = DWMCI_QUIRK_DISABLE_SMU;
>> #endif
>> +	host->board_init = exynos_dwmci_board_init;
>>
>> 	if (clksel) {
>> 		host->clksel_val = clksel;
>> diff --git a/include/dwmmc.h b/include/dwmmc.h
>> index 6c91143..a02dd67 100644
>> --- a/include/dwmmc.h
>> +++ b/include/dwmmc.h
>> @@ -141,6 +141,7 @@ struct dwmci_host {
>> 	struct mmc *mmc;
>>
>> 	void (*clksel)(struct dwmci_host *host);
>> +	void (*board_init)(struct dwmci_host *host);
>> 	unsigned int (*get_mmc_clk)(int dev_index);
>> };
>>
>> -- 
>> 1.7.9.5
> 
> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
> 

Acked-by: Minkyu Kang <mk7.kang@samsung.com>

Thanks,
Minkyu Kang.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-12-02  9:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-29 11:08 [U-Boot] [PATCH] mmc: dw_mmc: remove the exynos specific code in dw-mmc.c Jaehoon Chung
2013-11-29 11:23 ` Alexey Brodkin
2013-11-29 11:59   ` Rajeshwari Birje
2013-11-29 12:01 ` Pantelis Antoniou
2013-12-02  9:45   ` Minkyu Kang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox