Commit bbf53507 authored by Matt Porter's avatar Matt Porter Committed by Linus Torvalds

[PATCH] ppc32: fix io_remap_page_range for 36-bit phys platforms

Fixes io_remap_page_range() to use the 32-bit address translator similar to
ioremap().  Someday u64 start/end resources should make this unnecessary.
Fixes set_pte() to handle a long long pte_t properly.
Signed-off-by: default avatarMatt Porter <mporter@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 34b7c669
...@@ -97,6 +97,11 @@ config PTE_64BIT ...@@ -97,6 +97,11 @@ config PTE_64BIT
depends on 44x depends on 44x
default y default y
config PHYS_64BIT
bool
depends on 44x
default y
config ALTIVEC config ALTIVEC
bool "AltiVec Support" bool "AltiVec Support"
depends on 6xx || POWER4 depends on 6xx || POWER4
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/time.h> #include <linux/time.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/module.h>
#include <asm/ibm44x.h> #include <asm/ibm44x.h>
#include <asm/mmu.h> #include <asm/mmu.h>
...@@ -47,6 +48,7 @@ phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size) ...@@ -47,6 +48,7 @@ phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size)
return (page_4gb | addr); return (page_4gb | addr);
}; };
EXPORT_SYMBOL(fixup_bigphys_addr);
void __init ibm44x_calibrate_decr(unsigned int freq) void __init ibm44x_calibrate_decr(unsigned int freq)
{ {
......
...@@ -433,7 +433,7 @@ extern unsigned long bad_call_to_PMD_PAGE_SIZE(void); ...@@ -433,7 +433,7 @@ extern unsigned long bad_call_to_PMD_PAGE_SIZE(void);
#define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT) #define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT)
#define pte_page(x) pfn_to_page(pte_pfn(x)) #define pte_page(x) pfn_to_page(pte_pfn(x))
#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) #define pfn_pte(pfn, prot) __pte(((pte_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot) #define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)
/* /*
...@@ -716,8 +716,22 @@ extern void kernel_set_cachemode (unsigned long address, unsigned long size, ...@@ -716,8 +716,22 @@ extern void kernel_set_cachemode (unsigned long address, unsigned long size,
/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */
#define kern_addr_valid(addr) (1) #define kern_addr_valid(addr) (1)
#ifdef CONFIG_PHYS_64BIT
extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
unsigned long paddr, unsigned long size, pgprot_t prot);
static inline int io_remap_page_range(struct vm_area_struct *vma,
unsigned long vaddr,
unsigned long paddr,
unsigned long size,
pgprot_t prot)
{
phys_addr_t paddr64 = fixup_bigphys_addr(paddr, size);
return remap_pfn_range(vma, vaddr, paddr64 >> PAGE_SHIFT, size, prot);
}
#else
#define io_remap_page_range(vma, vaddr, paddr, size, prot) \ #define io_remap_page_range(vma, vaddr, paddr, size, prot) \
remap_pfn_range(vma, vaddr, (paddr) >> PAGE_SHIFT, size, prot) remap_pfn_range(vma, vaddr, (paddr) >> PAGE_SHIFT, size, prot)
#endif
/* /*
* No page table caches to initialise * No page table caches to initialise
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment