Commit ed3ce16c authored by Leonid Yegoshin's avatar Leonid Yegoshin Committed by Ralf Baechle

Revert "MIPS: make CAC_ADDR and UNCAC_ADDR account for PHYS_OFFSET"

This reverts commit 3f4579252aa166641861a64f1c2883365ca126c2. It is
invalid because the macros CAC_ADDR and UNCAC_ADDR have a kernel
virtual address as an argument and also returns a kernel virtual
address. Using and physical address PHYS_OFFSET is blatantly wrong
for a macro common to multiple platforms.
Signed-off-by: default avatarLeonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Acked-by: default avatarSteven J. Hill <Steven.Hill@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: Florian Fainelli <florian@openwrt.org>
Patchwork: https://patchwork.linux-mips.org/patch/5528/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 4287f791
...@@ -14,8 +14,11 @@ ...@@ -14,8 +14,11 @@
* This handles the memory map. * This handles the memory map.
* We handle pages at KSEG0 for kernels with 32 bit address space. * We handle pages at KSEG0 for kernels with 32 bit address space.
*/ */
#define PAGE_OFFSET 0x94000000UL #define PAGE_OFFSET _AC(0x94000000, UL)
#define PHYS_OFFSET 0x14000000UL #define PHYS_OFFSET _AC(0x14000000, UL)
#define UNCAC_BASE _AC(0xb4000000, UL) /* 0xa0000000 + PHYS_OFFSET */
#define IO_BASE UNCAC_BASE
#include <asm/mach-generic/spaces.h> #include <asm/mach-generic/spaces.h>
......
...@@ -11,12 +11,15 @@ ...@@ -11,12 +11,15 @@
#ifndef _ASM_MACH_IP28_SPACES_H #ifndef _ASM_MACH_IP28_SPACES_H
#define _ASM_MACH_IP28_SPACES_H #define _ASM_MACH_IP28_SPACES_H
#define CAC_BASE 0xa800000000000000 #define CAC_BASE _AC(0xa800000000000000, UL)
#define HIGHMEM_START (~0UL) #define HIGHMEM_START (~0UL)
#define PHYS_OFFSET _AC(0x20000000, UL) #define PHYS_OFFSET _AC(0x20000000, UL)
#define UNCAC_BASE _AC(0xc0000000, UL) /* 0xa0000000 + PHYS_OFFSET */
#define IO_BASE UNCAC_BASE
#include <asm/mach-generic/spaces.h> #include <asm/mach-generic/spaces.h>
#endif /* _ASM_MACH_IP28_SPACES_H */ #endif /* _ASM_MACH_IP28_SPACES_H */
...@@ -205,10 +205,8 @@ extern int __virt_addr_valid(const volatile void *kaddr); ...@@ -205,10 +205,8 @@ extern int __virt_addr_valid(const volatile void *kaddr);
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
#define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE + \ #define UNCAC_ADDR(addr) ((addr) - PAGE_OFFSET + UNCAC_BASE)
PHYS_OFFSET) #define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET)
#define CAC_ADDR(addr) ((addr) - UNCAC_BASE + PAGE_OFFSET - \
PHYS_OFFSET)
#include <asm-generic/memory_model.h> #include <asm-generic/memory_model.h>
#include <asm-generic/getorder.h> #include <asm-generic/getorder.h>
......
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