Subject: howto disable dcache (on a MPC8313)

From: Norbert van Bolhuis <[email-masked]>
Date: Thu, 07 May 2009 17:06:45 +0200

We have a network-switch connected via PCI which comes with 3rd
party (kernel) software.
The frames trapped by the switch and sent to CPU (with DMA)
are corrupt.
To rule out any data cache problems (which probably isn't causing
our problem) I thought I "quickly" disable the data cache.

we use a pretty standard linux-2.6.28 kernel (on our custom MPC8313E
board).

I first tried to mark the one BAT entry that the kernel setups as
cache_inhibit. I replaced setbat(..., _PAGE_RAM) by
setbat(..., _PAGE_IO) (in mmu_mapin_ram). This results in the
kernel not booting at all.

I also tried to not set DCE in HID0 in u-boot, this results in
the board not booting up at all.
I couldn't find the kernel source for setting HID0. It's not
op_powerpc_cpu_setup since CONFIG_OPROFILE isn't set (but
CONFIG_HAVE_OPROFILE is ?)

Is there a way to (simply) disable dcache for MPC8313 ?

Btw. some other architecturs (e.g. blackfin) have a kernel config option
to disable DCACHE.

---
N. van Bolhuis.