aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2013-10-02 15:50:56 -0400
committerGeert Uytterhoeven <geert@linux-m68k.org>2013-11-26 05:09:16 -0500
commit799300840c18e7fdc0a3dace70d9b56a189fd1ab (patch)
treed26513a11a09c256a9ae62d17c2f656ae9502f01 /arch/m68k
parent4c3c522bcebe16a717d7a809fd14b11823794027 (diff)
m68k/UAPI: Move generic definitions to <asm/bootinfo.h>
Move generic definitions used by bootstraps to uapi/asm/bootinfo.h: - Machine types, - CPU, FPU, and MMU types, - struct mem_info. Keep a copy of struct mem_info for in-kernel use, and rename it to struct m68k_mem_info, as the exported one will be modified later. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/include/asm/setup.h5
-rw-r--r--arch/m68k/include/uapi/asm/bootinfo.h80
-rw-r--r--arch/m68k/include/uapi/asm/setup.h87
-rw-r--r--arch/m68k/kernel/setup_mm.c4
-rw-r--r--arch/m68k/mm/init.c2
-rw-r--r--arch/m68k/mm/motorola.c2
6 files changed, 85 insertions, 95 deletions
diff --git a/arch/m68k/include/asm/setup.h b/arch/m68k/include/asm/setup.h
index 65e78a2dad64..8f2023f8c1c4 100644
--- a/arch/m68k/include/asm/setup.h
+++ b/arch/m68k/include/asm/setup.h
@@ -22,6 +22,7 @@
22#ifndef _M68K_SETUP_H 22#ifndef _M68K_SETUP_H
23#define _M68K_SETUP_H 23#define _M68K_SETUP_H
24 24
25#include <uapi/asm/bootinfo.h>
25#include <uapi/asm/setup.h> 26#include <uapi/asm/setup.h>
26 27
27 28
@@ -297,14 +298,14 @@ extern int m68k_is040or060;
297#define NUM_MEMINFO 4 298#define NUM_MEMINFO 4
298 299
299#ifndef __ASSEMBLY__ 300#ifndef __ASSEMBLY__
300struct mem_info { 301struct m68k_mem_info {
301 unsigned long addr; /* physical address of memory chunk */ 302 unsigned long addr; /* physical address of memory chunk */
302 unsigned long size; /* length of memory chunk (in bytes) */ 303 unsigned long size; /* length of memory chunk (in bytes) */
303}; 304};
304 305
305extern int m68k_num_memory; /* # of memory blocks found (and used) */ 306extern int m68k_num_memory; /* # of memory blocks found (and used) */
306extern int m68k_realnum_memory; /* real # of memory blocks found */ 307extern int m68k_realnum_memory; /* real # of memory blocks found */
307extern struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */ 308extern struct m68k_mem_info m68k_memory[NUM_MEMINFO];/* memory description */
308#endif 309#endif
309 310
310#endif /* _M68K_SETUP_H */ 311#endif /* _M68K_SETUP_H */
diff --git a/arch/m68k/include/uapi/asm/bootinfo.h b/arch/m68k/include/uapi/asm/bootinfo.h
index 74a6fae2a5bf..9d64599d7bf5 100644
--- a/arch/m68k/include/uapi/asm/bootinfo.h
+++ b/arch/m68k/include/uapi/asm/bootinfo.h
@@ -11,8 +11,6 @@
11#ifndef _UAPI_ASM_M68K_BOOTINFO_H 11#ifndef _UAPI_ASM_M68K_BOOTINFO_H
12#define _UAPI_ASM_M68K_BOOTINFO_H 12#define _UAPI_ASM_M68K_BOOTINFO_H
13 13
14#include <linux/types.h>
15
16 14
17#ifndef __ASSEMBLY__ 15#ifndef __ASSEMBLY__
18 16
@@ -35,6 +33,12 @@ struct bi_record {
35 unsigned long data[0]; /* data */ 33 unsigned long data[0]; /* data */
36}; 34};
37 35
36
37struct mem_info {
38 unsigned long addr; /* physical address of memory chunk */
39 unsigned long size; /* length of memory chunk (in bytes) */
40};
41
38#endif /* __ASSEMBLY__ */ 42#endif /* __ASSEMBLY__ */
39 43
40 44
@@ -59,6 +63,78 @@ struct bi_record {
59 63
60 64
61 /* 65 /*
66 * Linux/m68k Architectures (BI_MACHTYPE)
67 */
68
69#define MACH_AMIGA 1
70#define MACH_ATARI 2
71#define MACH_MAC 3
72#define MACH_APOLLO 4
73#define MACH_SUN3 5
74#define MACH_MVME147 6
75#define MACH_MVME16x 7
76#define MACH_BVME6000 8
77#define MACH_HP300 9
78#define MACH_Q40 10
79#define MACH_SUN3X 11
80#define MACH_M54XX 12
81
82
83 /*
84 * CPU, FPU and MMU types (BI_CPUTYPE, BI_FPUTYPE, BI_MMUTYPE)
85 *
86 * Note: we may rely on the following equalities:
87 *
88 * CPU_68020 == MMU_68851
89 * CPU_68030 == MMU_68030
90 * CPU_68040 == FPU_68040 == MMU_68040
91 * CPU_68060 == FPU_68060 == MMU_68060
92 */
93
94#define CPUB_68020 0
95#define CPUB_68030 1
96#define CPUB_68040 2
97#define CPUB_68060 3
98#define CPUB_COLDFIRE 4
99
100#define CPU_68020 (1 << CPUB_68020)
101#define CPU_68030 (1 << CPUB_68030)
102#define CPU_68040 (1 << CPUB_68040)
103#define CPU_68060 (1 << CPUB_68060)
104#define CPU_COLDFIRE (1 << CPUB_COLDFIRE)
105
106#define FPUB_68881 0
107#define FPUB_68882 1
108#define FPUB_68040 2 /* Internal FPU */
109#define FPUB_68060 3 /* Internal FPU */
110#define FPUB_SUNFPA 4 /* Sun-3 FPA */
111#define FPUB_COLDFIRE 5 /* ColdFire FPU */
112
113#define FPU_68881 (1 << FPUB_68881)
114#define FPU_68882 (1 << FPUB_68882)
115#define FPU_68040 (1 << FPUB_68040)
116#define FPU_68060 (1 << FPUB_68060)
117#define FPU_SUNFPA (1 << FPUB_SUNFPA)
118#define FPU_COLDFIRE (1 << FPUB_COLDFIRE)
119
120#define MMUB_68851 0
121#define MMUB_68030 1 /* Internal MMU */
122#define MMUB_68040 2 /* Internal MMU */
123#define MMUB_68060 3 /* Internal MMU */
124#define MMUB_APOLLO 4 /* Custom Apollo */
125#define MMUB_SUN3 5 /* Custom Sun-3 */
126#define MMUB_COLDFIRE 6 /* Internal MMU */
127
128#define MMU_68851 (1 << MMUB_68851)
129#define MMU_68030 (1 << MMUB_68030)
130#define MMU_68040 (1 << MMUB_68040)
131#define MMU_68060 (1 << MMUB_68060)
132#define MMU_SUN3 (1 << MMUB_SUN3)
133#define MMU_APOLLO (1 << MMUB_APOLLO)
134#define MMU_COLDFIRE (1 << MMUB_COLDFIRE)
135
136
137 /*
62 * Stuff for bootinfo interface versioning 138 * Stuff for bootinfo interface versioning
63 * 139 *
64 * At the start of kernel code, a 'struct bootversion' is located. 140 * At the start of kernel code, a 'struct bootversion' is located.
diff --git a/arch/m68k/include/uapi/asm/setup.h b/arch/m68k/include/uapi/asm/setup.h
index 85579bff455c..6a6dc636761e 100644
--- a/arch/m68k/include/uapi/asm/setup.h
+++ b/arch/m68k/include/uapi/asm/setup.h
@@ -6,98 +6,11 @@
6** This file is subject to the terms and conditions of the GNU General Public 6** This file is subject to the terms and conditions of the GNU General Public
7** License. See the file COPYING in the main directory of this archive 7** License. See the file COPYING in the main directory of this archive
8** for more details. 8** for more details.
9**
10** Created 09/29/92 by Greg Harp
11**
12** 5/2/94 Roman Hodek:
13** Added bi_atari part of the machine dependent union bi_un; for now it
14** contains just a model field to distinguish between TT and Falcon.
15** 26/7/96 Roman Zippel:
16** Renamed to setup.h; added some useful macros to allow gcc some
17** optimizations if possible.
18** 5/10/96 Geert Uytterhoeven:
19** Redesign of the boot information structure; moved boot information
20** structure to bootinfo.h
21*/ 9*/
22 10
23#ifndef _UAPI_M68K_SETUP_H 11#ifndef _UAPI_M68K_SETUP_H
24#define _UAPI_M68K_SETUP_H 12#define _UAPI_M68K_SETUP_H
25 13
26
27
28 /*
29 * Linux/m68k Architectures
30 */
31
32#define MACH_AMIGA 1
33#define MACH_ATARI 2
34#define MACH_MAC 3
35#define MACH_APOLLO 4
36#define MACH_SUN3 5
37#define MACH_MVME147 6
38#define MACH_MVME16x 7
39#define MACH_BVME6000 8
40#define MACH_HP300 9
41#define MACH_Q40 10
42#define MACH_SUN3X 11
43#define MACH_M54XX 12
44
45#define COMMAND_LINE_SIZE 256 14#define COMMAND_LINE_SIZE 256
46 15
47
48
49 /*
50 * CPU, FPU and MMU types
51 *
52 * Note: we may rely on the following equalities:
53 *
54 * CPU_68020 == MMU_68851
55 * CPU_68030 == MMU_68030
56 * CPU_68040 == FPU_68040 == MMU_68040
57 * CPU_68060 == FPU_68060 == MMU_68060
58 */
59
60#define CPUB_68020 0
61#define CPUB_68030 1
62#define CPUB_68040 2
63#define CPUB_68060 3
64#define CPUB_COLDFIRE 4
65
66#define CPU_68020 (1<<CPUB_68020)
67#define CPU_68030 (1<<CPUB_68030)
68#define CPU_68040 (1<<CPUB_68040)
69#define CPU_68060 (1<<CPUB_68060)
70#define CPU_COLDFIRE (1<<CPUB_COLDFIRE)
71
72#define FPUB_68881 0
73#define FPUB_68882 1
74#define FPUB_68040 2 /* Internal FPU */
75#define FPUB_68060 3 /* Internal FPU */
76#define FPUB_SUNFPA 4 /* Sun-3 FPA */
77#define FPUB_COLDFIRE 5 /* ColdFire FPU */
78
79#define FPU_68881 (1<<FPUB_68881)
80#define FPU_68882 (1<<FPUB_68882)
81#define FPU_68040 (1<<FPUB_68040)
82#define FPU_68060 (1<<FPUB_68060)
83#define FPU_SUNFPA (1<<FPUB_SUNFPA)
84#define FPU_COLDFIRE (1<<FPUB_COLDFIRE)
85
86#define MMUB_68851 0
87#define MMUB_68030 1 /* Internal MMU */
88#define MMUB_68040 2 /* Internal MMU */
89#define MMUB_68060 3 /* Internal MMU */
90#define MMUB_APOLLO 4 /* Custom Apollo */
91#define MMUB_SUN3 5 /* Custom Sun-3 */
92#define MMUB_COLDFIRE 6 /* Internal MMU */
93
94#define MMU_68851 (1<<MMUB_68851)
95#define MMU_68030 (1<<MMUB_68030)
96#define MMU_68040 (1<<MMUB_68040)
97#define MMU_68060 (1<<MMUB_68060)
98#define MMU_SUN3 (1<<MMUB_SUN3)
99#define MMU_APOLLO (1<<MMUB_APOLLO)
100#define MMU_COLDFIRE (1<<MMUB_COLDFIRE)
101
102
103#endif /* _UAPI_M68K_SETUP_H */ 16#endif /* _UAPI_M68K_SETUP_H */
diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c
index 18423a843379..cff9845708c0 100644
--- a/arch/m68k/kernel/setup_mm.c
+++ b/arch/m68k/kernel/setup_mm.c
@@ -71,10 +71,10 @@ EXPORT_SYMBOL(m68k_num_memory);
71int m68k_realnum_memory; 71int m68k_realnum_memory;
72EXPORT_SYMBOL(m68k_realnum_memory); 72EXPORT_SYMBOL(m68k_realnum_memory);
73unsigned long m68k_memoffset; 73unsigned long m68k_memoffset;
74struct mem_info m68k_memory[NUM_MEMINFO]; 74struct m68k_mem_info m68k_memory[NUM_MEMINFO];
75EXPORT_SYMBOL(m68k_memory); 75EXPORT_SYMBOL(m68k_memory);
76 76
77static struct mem_info m68k_ramdisk __initdata; 77static struct m68k_mem_info m68k_ramdisk __initdata;
78 78
79static char m68k_command_line[CL_SIZE] __initdata; 79static char m68k_command_line[CL_SIZE] __initdata;
80 80
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index 6b4baa6e4d31..acaff6a49e35 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -59,7 +59,7 @@ EXPORT_SYMBOL(pg_data_table);
59void __init m68k_setup_node(int node) 59void __init m68k_setup_node(int node)
60{ 60{
61#ifndef CONFIG_SINGLE_MEMORY_CHUNK 61#ifndef CONFIG_SINGLE_MEMORY_CHUNK
62 struct mem_info *info = m68k_memory + node; 62 struct m68k_mem_info *info = m68k_memory + node;
63 int i, end; 63 int i, end;
64 64
65 i = (unsigned long)phys_to_virt(info->addr) >> __virt_to_node_shift(); 65 i = (unsigned long)phys_to_virt(info->addr) >> __virt_to_node_shift();
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index 251c5437787b..7d4024432163 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -233,7 +233,7 @@ void __init paging_init(void)
233 printk("Fix your bootloader or use a memfile to make use of this area!\n"); 233 printk("Fix your bootloader or use a memfile to make use of this area!\n");
234 m68k_num_memory--; 234 m68k_num_memory--;
235 memmove(m68k_memory + i, m68k_memory + i + 1, 235 memmove(m68k_memory + i, m68k_memory + i + 1,
236 (m68k_num_memory - i) * sizeof(struct mem_info)); 236 (m68k_num_memory - i) * sizeof(struct m68k_mem_info));
237 continue; 237 continue;
238 } 238 }
239 addr = m68k_memory[i].addr + m68k_memory[i].size; 239 addr = m68k_memory[i].addr + m68k_memory[i].size;