From: Jaehoon Chung <jh80.chung@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V4 3/9] DWMMC: Initialise dwmci and resolve EMMC read write issues
Date: Fri, 11 Jan 2013 13:01:58 +0900 [thread overview]
Message-ID: <50EF8EB6.30100@samsung.com> (raw)
In-Reply-To: <CAPnjgZ1pj97a=hY3tLoaW2vY0nEfom2hWuNQo5XLAPyCPuun8A@mail.gmail.com>
On 01/11/2013 12:26 AM, Simon Glass wrote:
> Hi Amar,
>
> On Fri, Jan 4, 2013 at 1:34 AM, Amar <amarendra.xt@samsung.com> wrote:
>> This patch enumerates dwmci and set auto stop command during
>> dwmci initialisation.
>> EMMC read/write is not happening in current implementation
>> due to improper fifo size computation. Hence Modified the fifo size
>> computation to resolve EMMC read write issues.
>>
>> Changes from V1:
>> 1)Created the macros RX_WMARK_SHIFT and RX_WMARK_MASK in header file.
>>
>> Changes from V2:
>> 1)Updation of commit message and resubmition of proper patch set.
>>
>> Changes from V3:
>> 1)Updated to use the macro DWMCI_CTRL_SEND_AS_CCSD instead of
>> the hard coded value (1 << 10).
>
> I suggest you take a look at patman which might simplify your patch
> sending and change logs - see tools/patman/README for details.
>
>>
>> Signed-off-by: Amar <amarendra.xt@samsung.com>
>> ---
>> drivers/mmc/dw_mmc.c | 14 ++++++++++++--
>> 1 file changed, 12 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
>> index 4070d4e..776fdb6 100644
>> --- a/drivers/mmc/dw_mmc.c
>> +++ b/drivers/mmc/dw_mmc.c
>> @@ -136,6 +136,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
>> return TIMEOUT;
>> }
>> timeout--;
>> + mdelay(1);
>
> How long will this delay in total?
i didn't sure why add the mdelay(1)..i think mdelay(1) is too long.
Isn't there other approach to resolve read/write issue?
Best Regards,
Jaehoon Chung
>
>> }
>>
>> dwmci_writel(host, DWMCI_RINTSTS, DWMCI_INTMSK_ALL);
>> @@ -314,7 +315,7 @@ 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, fifoth_val;
>> + u32 fifo_size, fifoth_val, ier;
>>
>> dwmci_writel(host, DWMCI_PWREN, 1);
>>
>> @@ -323,6 +324,14 @@ static int dwmci_init(struct mmc *mmc)
>> return -1;
>> }
>>
>> + /* Enumerate at 400KHz */
>> + dwmci_setup_bus(host, mmc->f_min);
>> +
>> + /* Set auto stop command */
>> + ier = dwmci_readl(host, DWMCI_CTRL);
>> + ier |= DWMCI_CTRL_SEND_AS_CCSD;
>> + dwmci_writel(host, DWMCI_CTRL, ier);
>> +
>> dwmci_writel(host, DWMCI_RINTSTS, 0xFFFFFFFF);
>> dwmci_writel(host, DWMCI_INTMASK, 0);
>>
>> @@ -332,10 +341,11 @@ static int dwmci_init(struct mmc *mmc)
>> dwmci_writel(host, DWMCI_BMOD, 1);
>>
>> fifo_size = dwmci_readl(host, DWMCI_FIFOTH);
>> + fifo_size = ((fifo_size & RX_WMARK_MASK) >> RX_WMARK_SHIFT) + 1;
>> if (host->fifoth_val)
>> fifoth_val = host->fifoth_val;
>> else
>> - fifoth_val = MSIZE(0x2) | RX_WMARK(fifo_size/2 -1) |
>> + fifoth_val = MSIZE(0x2) | RX_WMARK(fifo_size/2 - 1) |
>> TX_WMARK(fifo_size/2);
>
> {} around this else I think. Also space around /
>
>> dwmci_writel(host, DWMCI_FIFOTH, fifoth_val);
>>
>> --
>> 1.8.0
>>
>
> Regards,
> Simon
>
next prev parent reply other threads:[~2013-01-11 4:01 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-04 9:34 [U-Boot] [PATCH V4 0/9] EXYNOS5: Enable DWMMC, add FDT support for DWMMC and Amar
2013-01-04 9:34 ` [U-Boot] [PATCH V4 1/9] FDT: Add compatible string for DWMMC Amar
2013-01-04 9:34 ` [U-Boot] [PATCH V4 2/9] EXYNOS5: FDT: Add DWMMC device node data Amar
2013-01-10 15:21 ` Simon Glass
2013-01-15 9:11 ` Amarendra Reddy
2013-01-04 9:34 ` [U-Boot] [PATCH V4 3/9] DWMMC: Initialise dwmci and resolve EMMC read write issues Amar
2013-01-10 15:26 ` Simon Glass
2013-01-11 4:01 ` Jaehoon Chung [this message]
2013-01-11 5:43 ` Simon Glass
2013-01-15 8:26 ` Amarendra Reddy
2013-01-04 9:34 ` [U-Boot] [PATCH V4 4/9] EXYNOS5: DWMMC: Added FDT support for DWMMC Amar
2013-01-10 15:33 ` Simon Glass
2013-01-11 4:12 ` Jaehoon Chung
2013-01-11 5:44 ` Simon Glass
2013-01-11 13:06 ` Amarendra Reddy
2013-01-22 5:23 ` Joonyoung Shim
2013-01-22 6:41 ` Amarendra Reddy
2013-01-04 9:34 ` [U-Boot] [PATCH V4 5/9] EXYNOS5: DWMMC: API to set mmc clock divisor Amar
2013-01-10 15:35 ` Simon Glass
2013-01-11 3:52 ` Jaehoon Chung
2013-01-11 13:23 ` Amarendra Reddy
2013-01-11 14:28 ` Simon Glass
2013-01-04 9:34 ` [U-Boot] [PATCH V4 6/9] SMDK5250: Initialise and Enable DWMMC, support FDT and non-FDT Amar
2013-01-10 16:57 ` Simon Glass
2013-01-11 17:58 ` Amarendra Reddy
2013-01-12 16:41 ` Simon Glass
2013-01-15 9:16 ` Amarendra Reddy
2013-01-04 9:34 ` [U-Boot] [PATCH V4 7/9] MMC: APIs to support resize of EMMC boot partition Amar
2013-01-04 10:27 ` Jaehoon Chung
2013-01-07 4:19 ` Amarendra Reddy
2013-01-07 4:34 ` Jaehoon Chung
2013-01-07 5:54 ` Amarendra Reddy
2013-01-07 9:23 ` Jaehoon Chung
2013-01-04 9:34 ` [U-Boot] [PATCH V4 8/9] SMDK5250: Enable EMMC booting Amar
2013-01-10 16:39 ` Simon Glass
2013-01-15 9:14 ` Amarendra Reddy
2013-01-04 9:34 ` [U-Boot] [PATCH V4 9/9] COMMON: MMC: Command to support EMMC booting and to Amar
2013-01-10 16:46 ` Simon Glass
2013-01-11 3:54 ` Jaehoon Chung
2013-01-11 5:41 ` Simon Glass
2013-01-11 13:50 ` Amarendra Reddy
2013-01-11 14:31 ` Simon Glass
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=50EF8EB6.30100@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.