Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[MIPS] Allow generic spaces.h to be included by platform specific ones

Before this patch, when a platform needed to customize one constant in
spaces.h, they need to redefine all of them.

Now they can just redefine one constant and include the generic file
header at the end:

#include <asm/mach-generic/spaces.h>

This patch doesn't allow to redefine CAC_BASE, IO_BASE and UNCAC_BASE
for 32 bits platforms because there's no need to do so.

This will avoid some macro duplications. It's important specially if
we'll add complex macros.

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

delete mode 100644 include/asm-mips/mach-ip32/spaces.h

authored by

Franck Bui-Huu and committed by
Ralf Baechle
09bb9ce1 69ed25b8

+23 -73
+18
include/asm-mips/mach-generic/spaces.h
··· 16 16 #define CAC_BASE 0x80000000 17 17 #define IO_BASE 0xa0000000 18 18 #define UNCAC_BASE 0xa0000000 19 + 20 + #ifndef MAP_BASE 19 21 #define MAP_BASE 0xc0000000 22 + #endif 20 23 21 24 /* 22 25 * This handles the memory map. 23 26 * We handle pages at KSEG0 for kernels with 32 bit address space. 24 27 */ 28 + #ifndef PAGE_OFFSET 25 29 #define PAGE_OFFSET 0x80000000UL 30 + #endif 26 31 27 32 /* 28 33 * Memory above this physical address will be considered highmem. ··· 43 38 /* 44 39 * This handles the memory map. 45 40 */ 41 + #ifndef PAGE_OFFSET 46 42 #ifdef CONFIG_DMA_NONCOHERENT 47 43 #define PAGE_OFFSET 0x9800000000000000UL 48 44 #else 49 45 #define PAGE_OFFSET 0xa800000000000000UL 46 + #endif 50 47 #endif 51 48 52 49 /* ··· 60 53 #define HIGHMEM_START (1UL << 59UL) 61 54 #endif 62 55 56 + #ifndef CAC_BASE 63 57 #ifdef CONFIG_DMA_NONCOHERENT 64 58 #define CAC_BASE 0x9800000000000000UL 65 59 #else 66 60 #define CAC_BASE 0xa800000000000000UL 67 61 #endif 62 + #endif 63 + 64 + #ifndef IO_BASE 68 65 #define IO_BASE 0x9000000000000000UL 66 + #endif 67 + 68 + #ifndef UNCAC_BASE 69 69 #define UNCAC_BASE 0x9000000000000000UL 70 + #endif 71 + 72 + #ifndef MAP_BASE 70 73 #define MAP_BASE 0xc000000000000000UL 74 + #endif 71 75 72 76 #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) 73 77 #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
+3 -30
include/asm-mips/mach-ip22/spaces.h
··· 11 11 #define _ASM_MACH_IP22_SPACES_H 12 12 13 13 14 - #ifdef CONFIG_32BIT 15 - 16 - #define CAC_BASE 0x80000000 17 - #define IO_BASE 0xa0000000 18 - #define UNCAC_BASE 0xa0000000 19 - #define MAP_BASE 0xc0000000 20 - 21 - /* 22 - * This handles the memory map. 23 - * We handle pages at KSEG0 for kernels with 32 bit address space. 24 - */ 25 - #define PAGE_OFFSET 0x80000000UL 26 - 27 - /* 28 - * Memory above this physical address will be considered highmem. 29 - */ 30 - #ifndef HIGHMEM_START 31 - #define HIGHMEM_START 0x20000000UL 32 - #endif 33 - 34 - #endif /* CONFIG_32BIT */ 35 - 36 14 #ifdef CONFIG_64BIT 37 - #define PAGE_OFFSET 0xffffffff80000000UL 38 15 39 - #ifndef HIGHMEM_START 40 - #define HIGHMEM_START (1UL << 59UL) 41 - #endif 16 + #define PAGE_OFFSET 0xffffffff80000000UL 42 17 43 18 #define CAC_BASE 0xffffffff80000000 44 19 #define IO_BASE 0xffffffffa0000000 45 20 #define UNCAC_BASE 0xffffffffa0000000 46 21 #define MAP_BASE 0xc000000000000000 47 22 48 - #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) 49 - #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) 50 - #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) 51 - 52 23 #endif /* CONFIG_64BIT */ 24 + 25 + #include <asm/mach-generic/spaces.h> 53 26 54 27 #endif /* __ASM_MACH_IP22_SPACES_H */
+2 -7
include/asm-mips/mach-ip27/spaces.h
··· 14 14 * IP27 uses the R10000's uncached attribute feature. Attribute 3 selects 15 15 * uncached memory addressing. 16 16 */ 17 - #define CAC_BASE 0xa800000000000000 18 17 19 18 #define HSPEC_BASE 0x9000000000000000 20 19 #define IO_BASE 0x9200000000000000 21 20 #define MSPEC_BASE 0x9400000000000000 22 21 #define UNCAC_BASE 0x9600000000000000 23 - #define MAP_BASE 0xc000000000000000 24 22 25 - #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) 26 - #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) 27 - #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) 28 23 #define TO_MSPEC(x) (MSPEC_BASE | ((x) & TO_PHYS_MASK)) 29 24 #define TO_HSPEC(x) (HSPEC_BASE | ((x) & TO_PHYS_MASK)) 30 25 31 - #define PAGE_OFFSET CAC_BASE 32 - 33 26 #define HIGHMEM_START (~0UL) 27 + 28 + #include <asm/mach-generic/spaces.h> 34 29 35 30 #endif /* _ASM_MACH_IP27_SPACES_H */
-36
include/asm-mips/mach-ip32/spaces.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 1994 - 1999, 2000, 03, 04, 05 Ralf Baechle (ralf@linux-mips.org) 7 - * Copyright (C) 2000, 2002 Maciej W. Rozycki 8 - * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc. 9 - */ 10 - #ifndef _ASM_MACH_IP32_SPACES_H 11 - #define _ASM_MACH_IP32_SPACES_H 12 - 13 - /* 14 - * Memory above this physical address will be considered highmem. 15 - * Fixme: 59 bits is a fictive number and makes assumptions about processors 16 - * in the distant future. Nobody will care for a few years :-) 17 - */ 18 - #ifndef HIGHMEM_START 19 - #define HIGHMEM_START (1UL << 59UL) 20 - #endif 21 - 22 - #define CAC_BASE 0x9800000000000000UL 23 - #define IO_BASE 0x9000000000000000UL 24 - #define UNCAC_BASE 0x9000000000000000UL 25 - #define MAP_BASE 0xc000000000000000UL 26 - 27 - #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) 28 - #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) 29 - #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) 30 - 31 - /* 32 - * This handles the memory map. 33 - */ 34 - #define PAGE_OFFSET CAC_BASE 35 - 36 - #endif /* __ASM_MACH_IP32_SPACES_H */