MMU on MPC860

MMU on MPC860

Post by Arn » Wed, 05 Mar 2003 19:41:25



Hi,

I have used the MMU light example (from Motorola) just to get my code
on the MPC860 working, but now need to map the 512Mb PCI Memory Space.
For that MMU light is not suitable. I guess I need to implement a
dynamic MMU, and downloaded the full MMU code from the Motorola
website. Now I have been reading on this newsgroup that there are lots
of bugs in the code. Has anybody since 1998 (from when the source code
originated) fixed these bugs or has a list of them? Or is there some
other source code flying around.

About the full MMU example: in mmu.h, can anybody explain the
following macros to me:

#define ADR2PDI(x)      (((unsigned)(x)>>PAGE_SHIFT) & 0x3ffL)
#define ADR2SDI(x)      (((unsigned)(x)>>22) & 0x3ffL)

What I don't understand is where the bit shifts come from. Why a 22
bit shift value for ADR2SDI and a 12(PAGE_SHIFT) bit shift for
ADR2PDI? I looked through the MMU chapter 9 of the MPC860UM, but am
not able to figure out where that comes from.

Any help will be greatly appreciated.

Regards
Arne