From: Stephen Neuendorffer <stephen.neuendorffer@xilinx•com>
To: grant.likely@secretlab•ca, simekm2@fel•cvut.cz,
jwilliams@itee•uq.edu.au, linuxppc-dev@ozlabs•org
Subject: [PATCH 2/7] [POWERPC] Xilinx: clear data caches.
Date: Thu, 13 Dec 2007 15:43:28 -0800 [thread overview]
Message-ID: <20071213234240.F3CC3AD805D@mail122-sin.bigfish.com> (raw)
In-Reply-To: <1197589413-5965-1-git-send-email-stephen.neuendorffer@xilinx.com>
This code is needed to boot without a boot loader.
Grant: I'm not sure where the right place to put this is. I'm assuming we'll actually need some boot code that is not generic? Also, note that there is a V4FX errata workaround in arch/ppc/boot/head.S, which probably also needs to get pulled to powerpc.
Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx•com>
---
arch/powerpc/boot/raw-platform.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/boot/raw-platform.c b/arch/powerpc/boot/raw-platform.c
index b9caeee..2a5e493 100644
--- a/arch/powerpc/boot/raw-platform.c
+++ b/arch/powerpc/boot/raw-platform.c
@@ -24,6 +24,28 @@ void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7)
{
u64 memsize64 = memsize[0];
+ static const unsigned long line_size = 32;
+ static const unsigned long congruence_classes = 256;
+ unsigned long addr;
+ unsigned long dccr;
+
+ /*
+ * Invalidate the data cache if the data cache is turned off.
+ * - The 405 core does not invalidate the data cache on power-up
+ * or reset but does turn off the data cache. We cannot assume
+ * that the cache contents are valid.
+ * - If the data cache is turned on this must have been done by
+ * a bootloader and we assume that the cache contents are
+ * valid.
+ */
+ __asm__("mfdccr %0": "=r" (dccr));
+ if (dccr == 0) {
+ for (addr = 0;
+ addr < (congruence_classes * line_size);
+ addr += line_size) {
+ __asm__("dccci 0,%0": :"b"(addr));
+ }
+ }
if (mem_size_cells == 2) {
memsize64 <<= 32;
--
1.5.3.4
next parent reply other threads:[~2007-12-13 23:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1197589413-5965-1-git-send-email-stephen.neuendorffer@xilinx.com>
2007-12-13 23:43 ` Stephen Neuendorffer [this message]
2007-12-14 0:07 ` [PATCH 2/7] [POWERPC] Xilinx: clear data caches Benjamin Herrenschmidt
2007-12-14 0:09 ` Benjamin Herrenschmidt
2007-12-14 0:36 ` Stephen Neuendorffer
2008-02-01 20:40 ` Grant Likely
[not found] ` <1197589413-5965-2-git-send-email-stephen.neuendorffer@xilinx.com>
2007-12-13 23:43 ` [PATCH 3/7] [POWERPC] Xilinx: Uartlite: Make console output actually work Stephen Neuendorffer
[not found] ` <1197589413-5965-3-git-send-email-stephen.neuendorffer@xilinx.com>
2007-12-13 23:43 ` [PATCH 4/7] [POWERPC] Xilinx: update compatible list for interrupt controller Stephen Neuendorffer
[not found] ` <1197589413-5965-4-git-send-email-stephen.neuendorffer@xilinx.com>
2007-12-13 23:43 ` [PATCH 5/7] [POWERPC] Xilinx: Update compatible to use values generated by BSP generator Stephen Neuendorffer
[not found] ` <1197589413-5965-5-git-send-email-stephen.neuendorffer@xilinx.com>
2007-12-13 23:43 ` [PATCH 6/7] [POWERPC] Xilinx: Add correct compatible list for device tree bus bindings Stephen Neuendorffer
[not found] ` <1197589413-5965-6-git-send-email-stephen.neuendorffer@xilinx.com>
2007-12-13 23:43 ` [PATCH 7/7] [POWERPC] Xilinx: Update booting-without-of Stephen Neuendorffer
2007-12-17 4:14 ` David Gibson
2007-12-17 4:30 ` Grant Likely
2007-12-17 4:48 ` Stephen Neuendorffer
2007-12-17 11:57 ` Peter Korsgaard
2007-12-17 15:27 ` Grant Likely
2007-12-17 15:19 ` Grant Likely
2007-12-17 18:24 ` Stephen Neuendorffer
2007-12-17 18:40 ` Grant Likely
2007-12-18 0:22 ` Stephen Neuendorffer
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=20071213234240.F3CC3AD805D@mail122-sin.bigfish.com \
--to=stephen.neuendorffer@xilinx$(echo .)com \
--cc=grant.likely@secretlab$(echo .)ca \
--cc=jwilliams@itee$(echo .)uq.edu.au \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=simekm2@fel$(echo .)cvut.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox