All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] i.MX: fsl_esdhc: allow use with cache enabled.
Date: Sun, 25 Mar 2012 12:32:48 +0200	[thread overview]
Message-ID: <4F6EF450.90308@denx.de> (raw)
In-Reply-To: <4F6E4C5E.4030007@boundarydevices.com>

On 24/03/2012 23:36, Eric Nelson wrote:
> Hi Stefano,
> 

Hi Eric,

> Sorry I let this linger.
> 
> On 03/17/2012 03:50 AM, Stefano Babic wrote:
>> On 03/03/2012 23:37, Eric Nelson wrote:
>>> Signed-off-by: Eric Nelson<eric.nelson@boundarydevices.com>
>>> ---
>>
>> Hi Eric,
>>
>> I have added Andy in CC as MMC Maintainer
>>
>>>   drivers/mmc/fsl_esdhc.c |   12 +++++++++++-
>>>   1 files changed, 11 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
>>> index a2f35e3..8e4bcef 100644
>>> --- a/drivers/mmc/fsl_esdhc.c
>>> +++ b/drivers/mmc/fsl_esdhc.c
>>> @@ -190,6 +190,8 @@ static int esdhc_setup_data(struct mmc *mmc,
>>> struct mmc_data *data)
>>>           esdhc_clrsetbits32(&regs->wml, WML_RD_WML_MASK, wml_value);
>>>           esdhc_write32(&regs->dsaddr, (u32)data->dest);
>>>       } else {
>>> +               
>>> flush_dcache_range((ulong)data->src,(ulong)data->src+data->blocks*data->blocksize);
>>>
>>
>> This breaks PowerPC boards.
>>
> 
> Can you tell me how?


./MAKEALL MPC8536DS
Configuring for MPC8536DS board...
fsl_esdhc.c: In function 'check_and_invalidate_dcache_range':
fsl_esdhc.c:255:19: warning: initialization makes integer from pointer
without a cast [enabled by default]
drivers/mmc/libmmc.o: In function `esdhc_setup_data':
/home/stefano/Projects/imx/u-boot-imx/drivers/mmc/fsl_esdhc.c:193:
undefined reference to `flush_dcache_range'
drivers/mmc/libmmc.o: In function `check_and_invalidate_dcache_range':
/home/stefano/Projects/imx/u-boot-imx/drivers/mmc/fsl_esdhc.c:258:
undefined reference to `invalidate_dcache_range'
make: *** [u-boot] Fehler 1

Main reason is that PowerPC (this is a PowerQuickIII) has a "snooping"
mechanism, and it is enough to set a bit in the SOC to make things working.

Maybe can we add these functions as empty in 85xx ? Or we can add an
intermediate layer in fsl_eshc.h that manage this, such as
fsl_esdhc_flush_dcache_range. This was already done to solve the
endianess problem (PowerPC is big endian).

Andy, what do you think about ?

> 
> AFAIK, blocksize needs to be a multiple of 512 so this should be
> cache-safe with
> any cacheline size.

Yes, I think your changes are correct in the i.MX case.

Best regards,
Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

  reply	other threads:[~2012-03-25 10:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-03 22:37 [U-Boot] [PATCH] i.MX: fsl_esdhc: allow use with cache enabled Eric Nelson
2012-03-17 10:50 ` Stefano Babic
2012-03-24 22:36   ` Eric Nelson
2012-03-25 10:32     ` Stefano Babic [this message]
2012-04-21  5:56       ` Dirk Behme

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=4F6EF450.90308@denx.de \
    --to=sbabic@denx.de \
    --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.