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

MIPS: SGI-IP27: Split kldir.h into generic SN and IP27 parts

SGI-IP35 uses slightly different memory layout, so we move IP27
defines to IP27 specific files and keep the common stuff in kldir.h

Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

authored by

Thomas Bogendoerfer and committed by
Paul Burton
aa2d74f9 e9d2eb99

+192 -187
+6 -187
arch/mips/include/asm/sn/kldir.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 - * Derived from IRIX <sys/SN/kldir.h>, revision 1.21. 7 - * 8 - * Copyright (C) 1992 - 1997, 1999, 2000 Silicon Graphics, Inc. 9 - * Copyright (C) 1999, 2000 by Ralf Baechle 10 - */ 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + 11 3 #ifndef _ASM_SN_KLDIR_H 12 4 #define _ASM_SN_KLDIR_H 13 5 14 - 15 - /* 16 - * The kldir memory area resides at a fixed place in each node's memory and 17 - * provides pointers to most other IP27 memory areas. This allows us to 18 - * resize and/or relocate memory areas at a later time without breaking all 19 - * firmware and kernels that use them. Indices in the array are 20 - * permanently dedicated to areas listed below. Some memory areas (marked 21 - * below) reside at a permanently fixed location, but are included in the 22 - * directory for completeness. 23 - */ 24 - 25 6 #define KLDIR_MAGIC 0x434d5f53505f5357 26 7 27 - /* 28 - * The upper portion of the memory map applies during boot 29 - * only and is overwritten by IRIX/SYMMON. 30 - * 31 - * MEMORY MAP PER NODE 32 - * 33 - * 0x2000000 (32M) +-----------------------------------------+ 34 - * | IO6 BUFFERS FOR FLASH ENET IOC3 | 35 - * 0x1F80000 (31.5M) +-----------------------------------------+ 36 - * | IO6 TEXT/DATA/BSS/stack | 37 - * 0x1C00000 (30M) +-----------------------------------------+ 38 - * | IO6 PROM DEBUG TEXT/DATA/BSS/stack | 39 - * 0x0800000 (28M) +-----------------------------------------+ 40 - * | IP27 PROM TEXT/DATA/BSS/stack | 41 - * 0x1B00000 (27M) +-----------------------------------------+ 42 - * | IP27 CFG | 43 - * 0x1A00000 (26M) +-----------------------------------------+ 44 - * | Graphics PROM | 45 - * 0x1800000 (24M) +-----------------------------------------+ 46 - * | 3rd Party PROM drivers | 47 - * 0x1600000 (22M) +-----------------------------------------+ 48 - * | | 49 - * | Free | 50 - * | | 51 - * +-----------------------------------------+ 52 - * | UNIX DEBUG Version | 53 - * 0x190000 (2M--) +-----------------------------------------+ 54 - * | SYMMON | 55 - * | (For UNIX Debug only) | 56 - * 0x34000 (208K) +-----------------------------------------+ 57 - * | SYMMON STACK [NUM_CPU_PER_NODE] | 58 - * | (For UNIX Debug only) | 59 - * 0x25000 (148K) +-----------------------------------------+ 60 - * | KLCONFIG - II (temp) | 61 - * | | 62 - * | ---------------------------- | 63 - * | | 64 - * | UNIX NON-DEBUG Version | 65 - * 0x19000 (100K) +-----------------------------------------+ 66 - * 67 - * 68 - * The lower portion of the memory map contains information that is 69 - * permanent and is used by the IP27PROM, IO6PROM and IRIX. 70 - * 71 - * 0x19000 (100K) +-----------------------------------------+ 72 - * | | 73 - * | PI Error Spools (32K) | 74 - * | | 75 - * 0x12000 (72K) +-----------------------------------------+ 76 - * | Unused | 77 - * 0x11c00 (71K) +-----------------------------------------+ 78 - * | CPU 1 NMI Eframe area | 79 - * 0x11a00 (70.5K) +-----------------------------------------+ 80 - * | CPU 0 NMI Eframe area | 81 - * 0x11800 (70K) +-----------------------------------------+ 82 - * | CPU 1 NMI Register save area | 83 - * 0x11600 (69.5K) +-----------------------------------------+ 84 - * | CPU 0 NMI Register save area | 85 - * 0x11400 (69K) +-----------------------------------------+ 86 - * | GDA (1k) | 87 - * 0x11000 (68K) +-----------------------------------------+ 88 - * | Early cache Exception stack | 89 - * | and/or | 90 - * | kernel/io6prom nmi registers | 91 - * 0x10800 (66k) +-----------------------------------------+ 92 - * | cache error eframe | 93 - * 0x10400 (65K) +-----------------------------------------+ 94 - * | Exception Handlers (UALIAS copy) | 95 - * 0x10000 (64K) +-----------------------------------------+ 96 - * | | 97 - * | | 98 - * | KLCONFIG - I (permanent) (48K) | 99 - * | | 100 - * | | 101 - * | | 102 - * 0x4000 (16K) +-----------------------------------------+ 103 - * | NMI Handler (Protected Page) | 104 - * 0x3000 (12K) +-----------------------------------------+ 105 - * | ARCS PVECTORS (master node only) | 106 - * 0x2c00 (11K) +-----------------------------------------+ 107 - * | ARCS TVECTORS (master node only) | 108 - * 0x2800 (10K) +-----------------------------------------+ 109 - * | LAUNCH [NUM_CPU] | 110 - * 0x2400 (9K) +-----------------------------------------+ 111 - * | Low memory directory (KLDIR) | 112 - * 0x2000 (8K) +-----------------------------------------+ 113 - * | ARCS SPB (1K) | 114 - * 0x1000 (4K) +-----------------------------------------+ 115 - * | Early cache Exception stack | 116 - * | and/or | 117 - * | kernel/io6prom nmi registers | 118 - * 0x800 (2k) +-----------------------------------------+ 119 - * | cache error eframe | 120 - * 0x400 (1K) +-----------------------------------------+ 121 - * | Exception Handlers | 122 - * 0x0 (0K) +-----------------------------------------+ 123 - */ 124 - 125 - #ifdef __ASSEMBLY__ 126 8 #define KLDIR_OFF_MAGIC 0x00 127 9 #define KLDIR_OFF_OFFSET 0x08 128 10 #define KLDIR_OFF_POINTER 0x10 129 11 #define KLDIR_OFF_SIZE 0x18 130 12 #define KLDIR_OFF_COUNT 0x20 131 13 #define KLDIR_OFF_STRIDE 0x28 132 - #endif /* __ASSEMBLY__ */ 133 - 134 - /* 135 - * This is defined here because IP27_SYMMON_STK_SIZE must be at least what 136 - * we define here. Since it's set up in the prom. We can't redefine it later 137 - * and expect more space to be allocated. The way to find out the true size 138 - * of the symmon stacks is to divide SYMMON_STK_SIZE by SYMMON_STK_STRIDE 139 - * for a particular node. 140 - */ 141 - #define SYMMON_STACK_SIZE 0x8000 142 - 143 - #if defined(PROM) 144 - 145 - /* 146 - * These defines are prom version dependent. No code other than the IP27 147 - * prom should attempt to use these values. 148 - */ 149 - #define IP27_LAUNCH_OFFSET 0x2400 150 - #define IP27_LAUNCH_SIZE 0x400 151 - #define IP27_LAUNCH_COUNT 2 152 - #define IP27_LAUNCH_STRIDE 0x200 153 - 154 - #define IP27_KLCONFIG_OFFSET 0x4000 155 - #define IP27_KLCONFIG_SIZE 0xc000 156 - #define IP27_KLCONFIG_COUNT 1 157 - #define IP27_KLCONFIG_STRIDE 0 158 - 159 - #define IP27_NMI_OFFSET 0x3000 160 - #define IP27_NMI_SIZE 0x40 161 - #define IP27_NMI_COUNT 2 162 - #define IP27_NMI_STRIDE 0x40 163 - 164 - #define IP27_PI_ERROR_OFFSET 0x12000 165 - #define IP27_PI_ERROR_SIZE 0x4000 166 - #define IP27_PI_ERROR_COUNT 1 167 - #define IP27_PI_ERROR_STRIDE 0 168 - 169 - #define IP27_SYMMON_STK_OFFSET 0x25000 170 - #define IP27_SYMMON_STK_SIZE 0xe000 171 - #define IP27_SYMMON_STK_COUNT 2 172 - /* IP27_SYMMON_STK_STRIDE must be >= SYMMON_STACK_SIZE */ 173 - #define IP27_SYMMON_STK_STRIDE 0x7000 174 - 175 - #define IP27_FREEMEM_OFFSET 0x19000 176 - #define IP27_FREEMEM_SIZE -1 177 - #define IP27_FREEMEM_COUNT 1 178 - #define IP27_FREEMEM_STRIDE 0 179 - 180 - #endif /* PROM */ 181 - /* 182 - * There will be only one of these in a partition so the IO6 must set it up. 183 - */ 184 - #define IO6_GDA_OFFSET 0x11000 185 - #define IO6_GDA_SIZE 0x400 186 - #define IO6_GDA_COUNT 1 187 - #define IO6_GDA_STRIDE 0 188 - 189 - /* 190 - * save area of kernel nmi regs in the prom format 191 - */ 192 - #define IP27_NMI_KREGS_OFFSET 0x11400 193 - #define IP27_NMI_KREGS_CPU_SIZE 0x200 194 - /* 195 - * save area of kernel nmi regs in eframe format 196 - */ 197 - #define IP27_NMI_EFRAME_OFFSET 0x11800 198 - #define IP27_NMI_EFRAME_SIZE 0x200 199 14 200 15 #define KLDIR_ENT_SIZE 0x40 201 16 #define KLDIR_MAX_ENTRIES (0x400 / 0x40) ··· 28 213 entry to store partition info. Refer to klpart.h for this. */ 29 214 } kldir_ent_t; 30 215 #endif /* !__ASSEMBLY__ */ 216 + 217 + #ifdef CONFIG_SGI_IP27 218 + #include <asm/sn/sn0/kldir.h> 219 + #endif 31 220 32 221 #endif /* _ASM_SN_KLDIR_H */
+186
arch/mips/include/asm/sn/sn0/kldir.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Derived from IRIX <sys/SN/kldir.h>, revision 1.21. 4 + * 5 + * Copyright (C) 1992 - 1997, 1999, 2000 Silicon Graphics, Inc. 6 + * Copyright (C) 1999, 2000 by Ralf Baechle 7 + */ 8 + #ifndef _ASM_SN_SN0_KLDIR_H 9 + #define _ASM_SN_SN0_KLDIR_H 10 + 11 + 12 + /* 13 + * The kldir memory area resides at a fixed place in each node's memory and 14 + * provides pointers to most other IP27 memory areas. This allows us to 15 + * resize and/or relocate memory areas at a later time without breaking all 16 + * firmware and kernels that use them. Indices in the array are 17 + * permanently dedicated to areas listed below. Some memory areas (marked 18 + * below) reside at a permanently fixed location, but are included in the 19 + * directory for completeness. 20 + */ 21 + 22 + /* 23 + * The upper portion of the memory map applies during boot 24 + * only and is overwritten by IRIX/SYMMON. 25 + * 26 + * MEMORY MAP PER NODE 27 + * 28 + * 0x2000000 (32M) +-----------------------------------------+ 29 + * | IO6 BUFFERS FOR FLASH ENET IOC3 | 30 + * 0x1F80000 (31.5M) +-----------------------------------------+ 31 + * | IO6 TEXT/DATA/BSS/stack | 32 + * 0x1C00000 (30M) +-----------------------------------------+ 33 + * | IO6 PROM DEBUG TEXT/DATA/BSS/stack | 34 + * 0x0800000 (28M) +-----------------------------------------+ 35 + * | IP27 PROM TEXT/DATA/BSS/stack | 36 + * 0x1B00000 (27M) +-----------------------------------------+ 37 + * | IP27 CFG | 38 + * 0x1A00000 (26M) +-----------------------------------------+ 39 + * | Graphics PROM | 40 + * 0x1800000 (24M) +-----------------------------------------+ 41 + * | 3rd Party PROM drivers | 42 + * 0x1600000 (22M) +-----------------------------------------+ 43 + * | | 44 + * | Free | 45 + * | | 46 + * +-----------------------------------------+ 47 + * | UNIX DEBUG Version | 48 + * 0x190000 (2M--) +-----------------------------------------+ 49 + * | SYMMON | 50 + * | (For UNIX Debug only) | 51 + * 0x34000 (208K) +-----------------------------------------+ 52 + * | SYMMON STACK [NUM_CPU_PER_NODE] | 53 + * | (For UNIX Debug only) | 54 + * 0x25000 (148K) +-----------------------------------------+ 55 + * | KLCONFIG - II (temp) | 56 + * | | 57 + * | ---------------------------- | 58 + * | | 59 + * | UNIX NON-DEBUG Version | 60 + * 0x19000 (100K) +-----------------------------------------+ 61 + * 62 + * 63 + * The lower portion of the memory map contains information that is 64 + * permanent and is used by the IP27PROM, IO6PROM and IRIX. 65 + * 66 + * 0x19000 (100K) +-----------------------------------------+ 67 + * | | 68 + * | PI Error Spools (32K) | 69 + * | | 70 + * 0x12000 (72K) +-----------------------------------------+ 71 + * | Unused | 72 + * 0x11c00 (71K) +-----------------------------------------+ 73 + * | CPU 1 NMI Eframe area | 74 + * 0x11a00 (70.5K) +-----------------------------------------+ 75 + * | CPU 0 NMI Eframe area | 76 + * 0x11800 (70K) +-----------------------------------------+ 77 + * | CPU 1 NMI Register save area | 78 + * 0x11600 (69.5K) +-----------------------------------------+ 79 + * | CPU 0 NMI Register save area | 80 + * 0x11400 (69K) +-----------------------------------------+ 81 + * | GDA (1k) | 82 + * 0x11000 (68K) +-----------------------------------------+ 83 + * | Early cache Exception stack | 84 + * | and/or | 85 + * | kernel/io6prom nmi registers | 86 + * 0x10800 (66k) +-----------------------------------------+ 87 + * | cache error eframe | 88 + * 0x10400 (65K) +-----------------------------------------+ 89 + * | Exception Handlers (UALIAS copy) | 90 + * 0x10000 (64K) +-----------------------------------------+ 91 + * | | 92 + * | | 93 + * | KLCONFIG - I (permanent) (48K) | 94 + * | | 95 + * | | 96 + * | | 97 + * 0x4000 (16K) +-----------------------------------------+ 98 + * | NMI Handler (Protected Page) | 99 + * 0x3000 (12K) +-----------------------------------------+ 100 + * | ARCS PVECTORS (master node only) | 101 + * 0x2c00 (11K) +-----------------------------------------+ 102 + * | ARCS TVECTORS (master node only) | 103 + * 0x2800 (10K) +-----------------------------------------+ 104 + * | LAUNCH [NUM_CPU] | 105 + * 0x2400 (9K) +-----------------------------------------+ 106 + * | Low memory directory (KLDIR) | 107 + * 0x2000 (8K) +-----------------------------------------+ 108 + * | ARCS SPB (1K) | 109 + * 0x1000 (4K) +-----------------------------------------+ 110 + * | Early cache Exception stack | 111 + * | and/or | 112 + * | kernel/io6prom nmi registers | 113 + * 0x800 (2k) +-----------------------------------------+ 114 + * | cache error eframe | 115 + * 0x400 (1K) +-----------------------------------------+ 116 + * | Exception Handlers | 117 + * 0x0 (0K) +-----------------------------------------+ 118 + */ 119 + 120 + /* 121 + * This is defined here because IP27_SYMMON_STK_SIZE must be at least what 122 + * we define here. Since it's set up in the prom. We can't redefine it later 123 + * and expect more space to be allocated. The way to find out the true size 124 + * of the symmon stacks is to divide SYMMON_STK_SIZE by SYMMON_STK_STRIDE 125 + * for a particular node. 126 + */ 127 + #define SYMMON_STACK_SIZE 0x8000 128 + 129 + #if defined(PROM) 130 + 131 + /* 132 + * These defines are prom version dependent. No code other than the IP27 133 + * prom should attempt to use these values. 134 + */ 135 + #define IP27_LAUNCH_OFFSET 0x2400 136 + #define IP27_LAUNCH_SIZE 0x400 137 + #define IP27_LAUNCH_COUNT 2 138 + #define IP27_LAUNCH_STRIDE 0x200 139 + 140 + #define IP27_KLCONFIG_OFFSET 0x4000 141 + #define IP27_KLCONFIG_SIZE 0xc000 142 + #define IP27_KLCONFIG_COUNT 1 143 + #define IP27_KLCONFIG_STRIDE 0 144 + 145 + #define IP27_NMI_OFFSET 0x3000 146 + #define IP27_NMI_SIZE 0x40 147 + #define IP27_NMI_COUNT 2 148 + #define IP27_NMI_STRIDE 0x40 149 + 150 + #define IP27_PI_ERROR_OFFSET 0x12000 151 + #define IP27_PI_ERROR_SIZE 0x4000 152 + #define IP27_PI_ERROR_COUNT 1 153 + #define IP27_PI_ERROR_STRIDE 0 154 + 155 + #define IP27_SYMMON_STK_OFFSET 0x25000 156 + #define IP27_SYMMON_STK_SIZE 0xe000 157 + #define IP27_SYMMON_STK_COUNT 2 158 + /* IP27_SYMMON_STK_STRIDE must be >= SYMMON_STACK_SIZE */ 159 + #define IP27_SYMMON_STK_STRIDE 0x7000 160 + 161 + #define IP27_FREEMEM_OFFSET 0x19000 162 + #define IP27_FREEMEM_SIZE -1 163 + #define IP27_FREEMEM_COUNT 1 164 + #define IP27_FREEMEM_STRIDE 0 165 + 166 + #endif /* PROM */ 167 + /* 168 + * There will be only one of these in a partition so the IO6 must set it up. 169 + */ 170 + #define IO6_GDA_OFFSET 0x11000 171 + #define IO6_GDA_SIZE 0x400 172 + #define IO6_GDA_COUNT 1 173 + #define IO6_GDA_STRIDE 0 174 + 175 + /* 176 + * save area of kernel nmi regs in the prom format 177 + */ 178 + #define IP27_NMI_KREGS_OFFSET 0x11400 179 + #define IP27_NMI_KREGS_CPU_SIZE 0x200 180 + /* 181 + * save area of kernel nmi regs in eframe format 182 + */ 183 + #define IP27_NMI_EFRAME_OFFSET 0x11800 184 + #define IP27_NMI_EFRAME_SIZE 0x200 185 + 186 + #endif /* _ASM_SN_SN0_KLDIR_H */