Skip to contentSkip to conversation

Unlock cache on mpc824x

PATCH New Gleb Natapov 2 participants 2 messages Sep 2, 2003 – Sep 10, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Unlock cache on mpc824x

Hello,

MPC824x locks way0 of the cache while booting for use as initial RAM, but
it never unlocks it. The cache remains locked even after booting Linux.

Attached patch unlocks cache after relocation to RAM and invalidates locked entries.

--
Gleb.
-------------- next part --------------

cpu/mpc824x/start.S +16 -1
@@ -526,11 +526,26 @@
 	stwu	r0,-4(r7)
 	bdnz	3b
 
+4:
+#if !defined(CONFIG_BMW)
+/* Unlock the data cache and invalidate locked area */
+	xor	r0, r0, r0
+	mtspr	1011, r0
+	lis	r4, CFG_INIT_RAM_ADDR at h
+	ori	r4, r4, CFG_INIT_RAM_ADDR at l
+	li	r0, 128
+	mtctr	r0
+41:
+	dcbi	r0, r4
+	addi	r4, r4, 32
+	bdnz	41b
+#endif
+
 /*
  * Now flush the cache: note that we must start from a cache aligned
  * address. Otherwise we might miss one cache line.
  */
-4:	cmpwi	r6,0
+	cmpwi	r6,0
 	add	r5,r3,r5
 	beq	7f		/* Always flush prefetch queue in any case */
 	subi	r0,r6,1
#1 lore raw

PATCH 1/1 Unlock cache on mpc824x

Dear Gleb,

Quoted 6 lines · in message <[email protected]> you wrote:

MPC824x locks way0 of the cache while booting for use as initial RAM, but
it never unlocks it. The cache remains locked even after booting Linux.

Attached patch unlocks cache after relocation to RAM and invalidates locked entries.

Added, thanks.

Ummm... can you please start attaching CHANGELOG entries with your patches?

Best regards,

Wolfgang Denk

Signature · 6 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
That Microsoft, the Trabant of the operating  system  world,  may  be
glancing  over the Berlin Wall at the Audis and BMWs and Mercedes. In
their own universe Trabants and Ladas were mainstream too...
                                                   -- Evan Leibovitch