ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / ppc / syslib / ibm44x_common.c
1 /*
2  * arch/ppc/syslib/ibm44x_common.c
3  *
4  * PPC44x system library
5  *
6  * Matt Porter <mporter@mvista.com>
7  * Copyright 2002-2003 MontaVista Software Inc.
8  *
9  * This program is free software; you can redistribute  it and/or modify it
10  * under  the terms of  the GNU General  Public License as published by the
11  * Free Software Foundation;  either version 2 of the  License, or (at your
12  * option) any later version.
13  *
14  */
15 #include <linux/config.h>
16 #include <linux/types.h>
17 #include <asm/ibm44x.h>
18 #include <asm/mmu.h>
19
20 phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size)
21 {
22         phys_addr_t page_4gb = 0;
23
24         /*
25          * Trap the least significant 32-bit portions of an
26          * address in the 440's 36-bit address space.  Fix
27          * them up with the appropriate ERPN
28          */
29         if ((addr >= PPC44x_IO_LO) && (addr < PPC44x_IO_HI))
30                 page_4gb = PPC44x_IO_PAGE;
31         else if ((addr >= PPC44x_PCICFG_LO) && (addr < PPC44x_PCICFG_HI))
32                 page_4gb = PPC44x_PCICFG_PAGE;
33         else if ((addr >= PPC44x_PCIMEM_LO) && (addr < PPC44x_PCIMEM_HI))
34                 page_4gb = PPC44x_PCIMEM_PAGE;
35
36         return (page_4gb | addr);
37 };