From: Jaehoon Chung <jh80.chung@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] dwmmc: make driver usable for non-exynos platforms
Date: Fri, 29 Nov 2013 19:00:53 +0900 [thread overview]
Message-ID: <529865D5.8070309@samsung.com> (raw)
In-Reply-To: <1385717996-9838-1-git-send-email-abrodkin@synopsys.com>
Hi Alexey,
I have replied the previous patch.
On 11/29/2013 06:39 PM, Alexey Brodkin wrote:
> There's no point in having of "dwmmc.h" per architecure - we're talking
> about device driver (DesignWare MMC controller) which is expected to
> work with any CPU it is attached to.
>
> Actually this change should have been an essential part of commit:
> =======
> 6f0b7caa671f92c2d4676c84381d17fb90f7d2cd
> DWMMC: SMDK5420: Disable SMU for eMMC
> =======
>
> Or even better I'd prefer all non pure DW MMC functionality (those item
> in ifdefs) to be moved to corresponding files like "exynos_dw_mmc.c" via
> call-backs etc. This will keep DW MMC driver clean and simple.
>
> As it is said in http://www.denx.de/wiki/U-Boot/DesignPrinciples:
> =======
> 8. Keep it Maintainable
> Avoid #ifdefs where possible
> =======
>
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
>
> Cc: Mischa Jonker <mjonker@synopsys.com>
> Cc: Jaehoon Chung <jh80.chung@samsung.com>
> Cc: Andy Fleming <afleming@gmail.com>
> Cc: Alim Akhtar <alim.akhtar@samsung.com>
> Cc: Rajeshwari Shinde <rajeshwari.s@samsung.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
>
> Changes compared to initial version:
> Instead of modification of headers only disable some parts of code with
> ifdefs.
> ---
> drivers/mmc/dw_mmc.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
> index 1e0f72b..fdae40b 100644
> --- a/drivers/mmc/dw_mmc.c
> +++ b/drivers/mmc/dw_mmc.c
> @@ -11,7 +11,9 @@
> #include <mmc.h>
> #include <dwmmc.h>
> #include <asm-generic/errno.h>
> +#ifdef CONFIG_EXYNOS5420
> #include <asm/arch/dwmmc.h>
> +#endif
Just remove this.
>
> #define PAGE_SIZE 4096
>
> @@ -302,6 +304,7 @@ static int dwmci_init(struct mmc *mmc)
> struct dwmci_host *host = (struct dwmci_host *)mmc->priv;
> u32 fifo_size;
>
> +#ifdef CONFIG_EXYNOS5420
> if (host->quirks & DWMCI_QUIRK_DISABLE_SMU) {
> dwmci_writel(host, EMMCP_MPSBEGIN0, 0);
> dwmci_writel(host, EMMCP_SEND0, 0);
> @@ -311,6 +314,7 @@ static int dwmci_init(struct mmc *mmc)
> MPSCTRL_NON_SECURE_READ_BIT |
> MPSCTRL_NON_SECURE_WRITE_BIT | MPSCTRL_VALID);
> }
> +#endif
remove this and use callback function like the host->board_init()?
if (host->board_init())
host->board_init(host);
Then we can reuse the this function for board specific code.
Anyway, I think that exynos code didn't exist at here(dw-mmc.c).
Best Regards,
Jaehoon Chung
>
> dwmci_writel(host, DWMCI_PWREN, 1);
>
>
next prev parent reply other threads:[~2013-11-29 10:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-29 9:39 [U-Boot] [PATCH v2] dwmmc: make driver usable for non-exynos platforms Alexey Brodkin
2013-11-29 10:00 ` Jaehoon Chung [this message]
2013-11-29 10:08 ` Alexey Brodkin
2013-11-29 12:02 ` Pantelis Antoniou
2013-11-29 12:16 ` Alexey Brodkin
2013-12-02 5:39 ` Rajeshwari Birje
2013-12-02 5:45 ` Jaehoon Chung
2013-12-02 10:55 ` Alexey Brodkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=529865D5.8070309@samsung.com \
--to=jh80.chung@samsung.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.