All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] disabling d-cache in 'bootelf' for QNX
Date: Thu, 3 Jan 2008 11:16:18 +0100	[thread overview]
Message-ID: <200801031116.18392.sr@denx.de> (raw)
In-Reply-To: <477BCC7F.4030709@semihalf.com>

Hi Rafal,

On Wednesday 02 January 2008, Rafal Jaworowski wrote:
> Currently do_bootelf() disables data cache just before passing control to
> the entry point:
>
>         /*
>          * QNX images require the data cache is disabled.
>          * Data cache is already flushed, so just turn it off.
>          */
>         if (dcache_status ())
>                 dcache_disable ();
>
> With this piece of code present I'm seeing strange effects (corrupt data
> access, hangs) in standalone apps running from the ELF envelope.

What platform are you testing on? PPC? If yes, which one?

> A pure 
> binary made of this same ELF works without problems. Contrary to the
> comment above, there's no quarantee in do_bootelf() code flow that all data
> cache has been flushed and it seems there needs to be flush_data_cache()
> executed before the disable.

dcache_disable() should flush the dcache itself before disabling it. At least 
this is the implementation I have seen on 405 and IIRC other PPC platforms.

> 1. Does it really hold true that QNX requires d-cache disabled upon passing
> control to it?
>
> 2. If so, this is a custom QNX thing that belongs to do_bootm_qnxelf() and
> should be handled there and not at the common ELF handling level.

Hmmm. I think that calling applications and especially OS'es is more safe with 
caches disabled then with caches enabled.

> Any objections to pushing this down to do_bootm_qnxelf()? I can provide a
> patch, but cannot test it with any QNX system. Is there anyone with such
> setup that would give this a try?

It's possible that other OS'es rely on caches being disabled too. I'm not sure 
here, but VxWorks could be one of those. Does anybody know for sure?

Thanks.

Best regards,
Stefan

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

  reply	other threads:[~2008-01-03 10:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-02 17:40 [U-Boot-Users] disabling d-cache in 'bootelf' for QNX Rafal Jaworowski
2008-01-03 10:16 ` Stefan Roese [this message]
2008-01-03 10:30   ` Rafal Jaworowski
2008-01-03 11:12     ` Stefan Roese
2008-01-05 22:18       ` Rafal Jaworowski
2008-01-06  1:58         ` Josh Boyer
2008-01-06 14:11           ` Rafal Jaworowski
2008-01-07  9:14             ` Matthias Fuchs
2008-01-07  9:35               ` Stefan Roese
2008-01-03 16:45     ` Wolfgang Denk

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=200801031116.18392.sr@denx.de \
    --to=sr@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.