aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/m68k/amiga/config.c18
-rw-r--r--arch/m68k/apollo/config.c15
-rw-r--r--arch/m68k/atari/config.c9
-rw-r--r--arch/m68k/bvme6000/config.c3
-rw-r--r--arch/m68k/hp300/config.c9
-rw-r--r--arch/m68k/include/uapi/asm/bootinfo-amiga.h14
-rw-r--r--arch/m68k/include/uapi/asm/bootinfo-apollo.h2
-rw-r--r--arch/m68k/include/uapi/asm/bootinfo-atari.h4
-rw-r--r--arch/m68k/include/uapi/asm/bootinfo-hp300.h6
-rw-r--r--arch/m68k/include/uapi/asm/bootinfo-mac.h2
-rw-r--r--arch/m68k/include/uapi/asm/bootinfo-vme.h17
-rw-r--r--arch/m68k/include/uapi/asm/bootinfo.h29
-rw-r--r--arch/m68k/kernel/setup_mm.c31
-rw-r--r--arch/m68k/mac/config.c32
-rw-r--r--arch/m68k/mvme147/config.c4
-rw-r--r--arch/m68k/mvme16x/config.c27
16 files changed, 124 insertions, 98 deletions
diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
index 0c92c1baf9bf..06920e85fac9 100644
--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -145,37 +145,37 @@ static struct resource ram_resource[NUM_MEMINFO];
145int __init amiga_parse_bootinfo(const struct bi_record *record) 145int __init amiga_parse_bootinfo(const struct bi_record *record)
146{ 146{
147 int unknown = 0; 147 int unknown = 0;
148 const unsigned long *data = record->data; 148 const void *data = record->data;
149 149
150 switch (record->tag) { 150 switch (be16_to_cpu(record->tag)) {
151 case BI_AMIGA_MODEL: 151 case BI_AMIGA_MODEL:
152 amiga_model = *data; 152 amiga_model = be32_to_cpup(data);
153 break; 153 break;
154 154
155 case BI_AMIGA_ECLOCK: 155 case BI_AMIGA_ECLOCK:
156 amiga_eclock = *data; 156 amiga_eclock = be32_to_cpup(data);
157 break; 157 break;
158 158
159 case BI_AMIGA_CHIPSET: 159 case BI_AMIGA_CHIPSET:
160 amiga_chipset = *data; 160 amiga_chipset = be32_to_cpup(data);
161 break; 161 break;
162 162
163 case BI_AMIGA_CHIP_SIZE: 163 case BI_AMIGA_CHIP_SIZE:
164 amiga_chip_size = *(const int *)data; 164 amiga_chip_size = be32_to_cpup(data);
165 break; 165 break;
166 166
167 case BI_AMIGA_VBLANK: 167 case BI_AMIGA_VBLANK:
168 amiga_vblank = *(const unsigned char *)data; 168 amiga_vblank = *(const __u8 *)data;
169 break; 169 break;
170 170
171 case BI_AMIGA_PSFREQ: 171 case BI_AMIGA_PSFREQ:
172 amiga_psfreq = *(const unsigned char *)data; 172 amiga_psfreq = *(const __u8 *)data;
173 break; 173 break;
174 174
175 case BI_AMIGA_AUTOCON: 175 case BI_AMIGA_AUTOCON:
176#ifdef CONFIG_ZORRO 176#ifdef CONFIG_ZORRO
177 if (zorro_num_autocon < ZORRO_NUM_AUTO) { 177 if (zorro_num_autocon < ZORRO_NUM_AUTO) {
178 const struct ConfigDev *cd = (struct ConfigDev *)data; 178 const struct ConfigDev *cd = data;
179 struct zorro_dev_init *dev = &zorro_autocon_init[zorro_num_autocon++]; 179 struct zorro_dev_init *dev = &zorro_autocon_init[zorro_num_autocon++];
180 dev->rom = cd->cd_Rom; 180 dev->rom = cd->cd_Rom;
181 dev->slotaddr = be16_to_cpu(cd->cd_SlotAddr); 181 dev->slotaddr = be16_to_cpu(cd->cd_SlotAddr);
diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c
index c90c19e904bc..9268c0f96376 100644
--- a/arch/m68k/apollo/config.c
+++ b/arch/m68k/apollo/config.c
@@ -11,6 +11,7 @@
11#include <asm/setup.h> 11#include <asm/setup.h>
12#include <asm/bootinfo.h> 12#include <asm/bootinfo.h>
13#include <asm/bootinfo-apollo.h> 13#include <asm/bootinfo-apollo.h>
14#include <asm/byteorder.h>
14#include <asm/pgtable.h> 15#include <asm/pgtable.h>
15#include <asm/apollohw.h> 16#include <asm/apollohw.h>
16#include <asm/irq.h> 17#include <asm/irq.h>
@@ -48,15 +49,15 @@ static const char *apollo_models[] = {
48int __init apollo_parse_bootinfo(const struct bi_record *record) 49int __init apollo_parse_bootinfo(const struct bi_record *record)
49{ 50{
50 int unknown = 0; 51 int unknown = 0;
51 const unsigned long *data = record->data; 52 const void *data = record->data;
52 53
53 switch(record->tag) { 54 switch (be16_to_cpu(record->tag)) {
54 case BI_APOLLO_MODEL: 55 case BI_APOLLO_MODEL:
55 apollo_model=*data; 56 apollo_model = be32_to_cpup(data);
56 break; 57 break;
57 58
58 default: 59 default:
59 unknown=1; 60 unknown=1;
60 } 61 }
61 62
62 return unknown; 63 return unknown;
diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c
index 9159195505d5..01a62161b08a 100644
--- a/arch/m68k/atari/config.c
+++ b/arch/m68k/atari/config.c
@@ -38,6 +38,7 @@
38 38
39#include <asm/bootinfo.h> 39#include <asm/bootinfo.h>
40#include <asm/bootinfo-atari.h> 40#include <asm/bootinfo-atari.h>
41#include <asm/byteorder.h>
41#include <asm/setup.h> 42#include <asm/setup.h>
42#include <asm/atarihw.h> 43#include <asm/atarihw.h>
43#include <asm/atariints.h> 44#include <asm/atariints.h>
@@ -130,14 +131,14 @@ static int __init scc_test(volatile char *ctla)
130int __init atari_parse_bootinfo(const struct bi_record *record) 131int __init atari_parse_bootinfo(const struct bi_record *record)
131{ 132{
132 int unknown = 0; 133 int unknown = 0;
133 const u_long *data = record->data; 134 const void *data = record->data;
134 135
135 switch (record->tag) { 136 switch (be16_to_cpu(record->tag)) {
136 case BI_ATARI_MCH_COOKIE: 137 case BI_ATARI_MCH_COOKIE:
137 atari_mch_cookie = *data; 138 atari_mch_cookie = be32_to_cpup(data);
138 break; 139 break;
139 case BI_ATARI_MCH_TYPE: 140 case BI_ATARI_MCH_TYPE:
140 atari_mch_type = *data; 141 atari_mch_type = be32_to_cpup(data);
141 break; 142 break;
142 default: 143 default:
143 unknown = 1; 144 unknown = 1;
diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c
index 4d1b403822fa..478623dbb209 100644
--- a/arch/m68k/bvme6000/config.c
+++ b/arch/m68k/bvme6000/config.c
@@ -29,6 +29,7 @@
29 29
30#include <asm/bootinfo.h> 30#include <asm/bootinfo.h>
31#include <asm/bootinfo-vme.h> 31#include <asm/bootinfo-vme.h>
32#include <asm/byteorder.h>
32#include <asm/pgtable.h> 33#include <asm/pgtable.h>
33#include <asm/setup.h> 34#include <asm/setup.h>
34#include <asm/irq.h> 35#include <asm/irq.h>
@@ -53,7 +54,7 @@ static irq_handler_t tick_handler;
53 54
54int __init bvme6000_parse_bootinfo(const struct bi_record *bi) 55int __init bvme6000_parse_bootinfo(const struct bi_record *bi)
55{ 56{
56 if (bi->tag == BI_VME_TYPE) 57 if (be16_to_cpu(bi->tag) == BI_VME_TYPE)
57 return 0; 58 return 0;
58 else 59 else
59 return 1; 60 return 1;
diff --git a/arch/m68k/hp300/config.c b/arch/m68k/hp300/config.c
index 892d0794fc0b..2e5a787ea11b 100644
--- a/arch/m68k/hp300/config.c
+++ b/arch/m68k/hp300/config.c
@@ -15,6 +15,7 @@
15 15
16#include <asm/bootinfo.h> 16#include <asm/bootinfo.h>
17#include <asm/bootinfo-hp300.h> 17#include <asm/bootinfo-hp300.h>
18#include <asm/byteorder.h>
18#include <asm/machdep.h> 19#include <asm/machdep.h>
19#include <asm/blinken.h> 20#include <asm/blinken.h>
20#include <asm/io.h> /* readb() and writeb() */ 21#include <asm/io.h> /* readb() and writeb() */
@@ -71,15 +72,15 @@ extern int hp300_setup_serial_console(void) __init;
71int __init hp300_parse_bootinfo(const struct bi_record *record) 72int __init hp300_parse_bootinfo(const struct bi_record *record)
72{ 73{
73 int unknown = 0; 74 int unknown = 0;
74 const unsigned long *data = record->data; 75 const void *data = record->data;
75 76
76 switch (record->tag) { 77 switch (be16_to_cpu(record->tag)) {
77 case BI_HP300_MODEL: 78 case BI_HP300_MODEL:
78 hp300_model = *data; 79 hp300_model = be32_to_cpup(data);
79 break; 80 break;
80 81
81 case BI_HP300_UART_SCODE: 82 case BI_HP300_UART_SCODE:
82 hp300_uart_scode = *data; 83 hp300_uart_scode = be32_to_cpup(data);
83 break; 84 break;
84 85
85 case BI_HP300_UART_ADDR: 86 case BI_HP300_UART_ADDR:
diff --git a/arch/m68k/include/uapi/asm/bootinfo-amiga.h b/arch/m68k/include/uapi/asm/bootinfo-amiga.h
index 28b6da07874a..daad3c58d2da 100644
--- a/arch/m68k/include/uapi/asm/bootinfo-amiga.h
+++ b/arch/m68k/include/uapi/asm/bootinfo-amiga.h
@@ -10,15 +10,15 @@
10 * Amiga-specific tags 10 * Amiga-specific tags
11 */ 11 */
12 12
13#define BI_AMIGA_MODEL 0x8000 /* model (u_long) */ 13#define BI_AMIGA_MODEL 0x8000 /* model (__be32) */
14#define BI_AMIGA_AUTOCON 0x8001 /* AutoConfig device */ 14#define BI_AMIGA_AUTOCON 0x8001 /* AutoConfig device */
15 /* (AmigaOS struct ConfigDev) */ 15 /* (AmigaOS struct ConfigDev) */
16#define BI_AMIGA_CHIP_SIZE 0x8002 /* size of Chip RAM (u_long) */ 16#define BI_AMIGA_CHIP_SIZE 0x8002 /* size of Chip RAM (__be32) */
17#define BI_AMIGA_VBLANK 0x8003 /* VBLANK frequency (u_char) */ 17#define BI_AMIGA_VBLANK 0x8003 /* VBLANK frequency (__u8) */
18#define BI_AMIGA_PSFREQ 0x8004 /* power supply frequency (u_char) */ 18#define BI_AMIGA_PSFREQ 0x8004 /* power supply frequency (__u8) */
19#define BI_AMIGA_ECLOCK 0x8005 /* EClock frequency (u_long) */ 19#define BI_AMIGA_ECLOCK 0x8005 /* EClock frequency (__be32) */
20#define BI_AMIGA_CHIPSET 0x8006 /* native chipset present (u_long) */ 20#define BI_AMIGA_CHIPSET 0x8006 /* native chipset present (__be32) */
21#define BI_AMIGA_SERPER 0x8007 /* serial port period (u_short) */ 21#define BI_AMIGA_SERPER 0x8007 /* serial port period (__be16) */
22 22
23 23
24 /* 24 /*
diff --git a/arch/m68k/include/uapi/asm/bootinfo-apollo.h b/arch/m68k/include/uapi/asm/bootinfo-apollo.h
index 69923697e131..a93e0af1c6fe 100644
--- a/arch/m68k/include/uapi/asm/bootinfo-apollo.h
+++ b/arch/m68k/include/uapi/asm/bootinfo-apollo.h
@@ -10,7 +10,7 @@
10 * Apollo-specific tags 10 * Apollo-specific tags
11 */ 11 */
12 12
13#define BI_APOLLO_MODEL 0x8000 /* model (u_long) */ 13#define BI_APOLLO_MODEL 0x8000 /* model (__be32) */
14 14
15 15
16 /* 16 /*
diff --git a/arch/m68k/include/uapi/asm/bootinfo-atari.h b/arch/m68k/include/uapi/asm/bootinfo-atari.h
index cca0a83fc0e5..a817854049bb 100644
--- a/arch/m68k/include/uapi/asm/bootinfo-atari.h
+++ b/arch/m68k/include/uapi/asm/bootinfo-atari.h
@@ -10,8 +10,8 @@
10 * Atari-specific tags 10 * Atari-specific tags
11 */ 11 */
12 12
13#define BI_ATARI_MCH_COOKIE 0x8000 /* _MCH cookie from TOS (u_long) */ 13#define BI_ATARI_MCH_COOKIE 0x8000 /* _MCH cookie from TOS (__be32) */
14#define BI_ATARI_MCH_TYPE 0x8001 /* special machine type (u_long) */ 14#define BI_ATARI_MCH_TYPE 0x8001 /* special machine type (__be32) */
15 15
16 16
17 /* 17 /*
diff --git a/arch/m68k/include/uapi/asm/bootinfo-hp300.h b/arch/m68k/include/uapi/asm/bootinfo-hp300.h
index 08530e12d4c3..c90cb71ed89a 100644
--- a/arch/m68k/include/uapi/asm/bootinfo-hp300.h
+++ b/arch/m68k/include/uapi/asm/bootinfo-hp300.h
@@ -10,9 +10,9 @@
10 * HP9000/300-specific tags 10 * HP9000/300-specific tags
11 */ 11 */
12 12
13#define BI_HP300_MODEL 0x8000 /* model (u_long) */ 13#define BI_HP300_MODEL 0x8000 /* model (__be32) */
14#define BI_HP300_UART_SCODE 0x8001 /* UART select code (u_long) */ 14#define BI_HP300_UART_SCODE 0x8001 /* UART select code (__be32) */
15#define BI_HP300_UART_ADDR 0x8002 /* phys. addr of UART (u_long) */ 15#define BI_HP300_UART_ADDR 0x8002 /* phys. addr of UART (__be32) */
16 16
17 17
18 /* 18 /*
diff --git a/arch/m68k/include/uapi/asm/bootinfo-mac.h b/arch/m68k/include/uapi/asm/bootinfo-mac.h
index 971046f49bb9..b44ff73898a9 100644
--- a/arch/m68k/include/uapi/asm/bootinfo-mac.h
+++ b/arch/m68k/include/uapi/asm/bootinfo-mac.h
@@ -7,7 +7,7 @@
7 7
8 8
9 /* 9 /*
10 * Macintosh-specific tags (all u_long) 10 * Macintosh-specific tags (all __be32)
11 */ 11 */
12 12
13#define BI_MAC_MODEL 0x8000 /* Mac Gestalt ID (model type) */ 13#define BI_MAC_MODEL 0x8000 /* Mac Gestalt ID (model type) */
diff --git a/arch/m68k/include/uapi/asm/bootinfo-vme.h b/arch/m68k/include/uapi/asm/bootinfo-vme.h
index 13ba5e19fe24..a135eb41d672 100644
--- a/arch/m68k/include/uapi/asm/bootinfo-vme.h
+++ b/arch/m68k/include/uapi/asm/bootinfo-vme.h
@@ -6,11 +6,14 @@
6#define _UAPI_ASM_M68K_BOOTINFO_VME_H 6#define _UAPI_ASM_M68K_BOOTINFO_VME_H
7 7
8 8
9#include <linux/types.h>
10
11
9 /* 12 /*
10 * VME-specific tags 13 * VME-specific tags
11 */ 14 */
12 15
13#define BI_VME_TYPE 0x8000 /* VME sub-architecture (u_long) */ 16#define BI_VME_TYPE 0x8000 /* VME sub-architecture (__be32) */
14#define BI_VME_BRDINFO 0x8001 /* VME board information (struct) */ 17#define BI_VME_BRDINFO 0x8001 /* VME board information (struct) */
15 18
16 19
@@ -43,13 +46,13 @@
43 46
44typedef struct { 47typedef struct {
45 char bdid[4]; 48 char bdid[4];
46 u_char rev, mth, day, yr; 49 __u8 rev, mth, day, yr;
47 u_short size, reserved; 50 __be16 size, reserved;
48 u_short brdno; 51 __be16 brdno;
49 char brdsuffix[2]; 52 char brdsuffix[2];
50 u_long options; 53 __be32 options;
51 u_short clun, dlun, ctype, dnum; 54 __be16 clun, dlun, ctype, dnum;
52 u_long option2; 55 __be32 option2;
53} t_bdid, *p_bdid; 56} t_bdid, *p_bdid;
54 57
55#endif /* __ASSEMBLY__ */ 58#endif /* __ASSEMBLY__ */
diff --git a/arch/m68k/include/uapi/asm/bootinfo.h b/arch/m68k/include/uapi/asm/bootinfo.h
index 9d64599d7bf5..cdeb26a015b0 100644
--- a/arch/m68k/include/uapi/asm/bootinfo.h
+++ b/arch/m68k/include/uapi/asm/bootinfo.h
@@ -12,6 +12,9 @@
12#define _UAPI_ASM_M68K_BOOTINFO_H 12#define _UAPI_ASM_M68K_BOOTINFO_H
13 13
14 14
15#include <linux/types.h>
16
17
15#ifndef __ASSEMBLY__ 18#ifndef __ASSEMBLY__
16 19
17 /* 20 /*
@@ -28,15 +31,15 @@
28 */ 31 */
29 32
30struct bi_record { 33struct bi_record {
31 unsigned short tag; /* tag ID */ 34 __be16 tag; /* tag ID */
32 unsigned short size; /* size of record (in bytes) */ 35 __be16 size; /* size of record (in bytes) */
33 unsigned long data[0]; /* data */ 36 __be32 data[0]; /* data */
34}; 37};
35 38
36 39
37struct mem_info { 40struct mem_info {
38 unsigned long addr; /* physical address of memory chunk */ 41 __be32 addr; /* physical address of memory chunk */
39 unsigned long size; /* length of memory chunk (in bytes) */ 42 __be32 size; /* length of memory chunk (in bytes) */
40}; 43};
41 44
42#endif /* __ASSEMBLY__ */ 45#endif /* __ASSEMBLY__ */
@@ -50,10 +53,10 @@ struct mem_info {
50 */ 53 */
51 54
52#define BI_LAST 0x0000 /* last record (sentinel) */ 55#define BI_LAST 0x0000 /* last record (sentinel) */
53#define BI_MACHTYPE 0x0001 /* machine type (u_long) */ 56#define BI_MACHTYPE 0x0001 /* machine type (__be32) */
54#define BI_CPUTYPE 0x0002 /* cpu type (u_long) */ 57#define BI_CPUTYPE 0x0002 /* cpu type (__be32) */
55#define BI_FPUTYPE 0x0003 /* fpu type (u_long) */ 58#define BI_FPUTYPE 0x0003 /* fpu type (__be32) */
56#define BI_MMUTYPE 0x0004 /* mmu type (u_long) */ 59#define BI_MMUTYPE 0x0004 /* mmu type (__be32) */
57#define BI_MEMCHUNK 0x0005 /* memory chunk address and size */ 60#define BI_MEMCHUNK 0x0005 /* memory chunk address and size */
58 /* (struct mem_info) */ 61 /* (struct mem_info) */
59#define BI_RAMDISK 0x0006 /* ramdisk address and size */ 62#define BI_RAMDISK 0x0006 /* ramdisk address and size */
@@ -157,11 +160,11 @@ struct mem_info {
157#ifndef __ASSEMBLY__ 160#ifndef __ASSEMBLY__
158 161
159struct bootversion { 162struct bootversion {
160 unsigned short branch; 163 __be16 branch;
161 unsigned long magic; 164 __be32 magic;
162 struct { 165 struct {
163 unsigned long machtype; 166 __be32 machtype;
164 unsigned long version; 167 __be32 version;
165 } machversions[0]; 168 } machversions[0];
166} __packed; 169} __packed;
167 170
diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c
index cff9845708c0..0191485d7b7d 100644
--- a/arch/m68k/kernel/setup_mm.c
+++ b/arch/m68k/kernel/setup_mm.c
@@ -26,6 +26,7 @@
26#include <linux/initrd.h> 26#include <linux/initrd.h>
27 27
28#include <asm/bootinfo.h> 28#include <asm/bootinfo.h>
29#include <asm/byteorder.h>
29#include <asm/sections.h> 30#include <asm/sections.h>
30#include <asm/setup.h> 31#include <asm/setup.h>
31#include <asm/fpu.h> 32#include <asm/fpu.h>
@@ -143,11 +144,14 @@ extern void paging_init(void);
143 144
144static void __init m68k_parse_bootinfo(const struct bi_record *record) 145static void __init m68k_parse_bootinfo(const struct bi_record *record)
145{ 146{
146 while (record->tag != BI_LAST) { 147 uint16_t tag;
148
149 while ((tag = be16_to_cpu(record->tag)) != BI_LAST) {
147 int unknown = 0; 150 int unknown = 0;
148 const unsigned long *data = record->data; 151 const void *data = record->data;
152 uint16_t size = be16_to_cpu(record->size);
149 153
150 switch (record->tag) { 154 switch (tag) {
151 case BI_MACHTYPE: 155 case BI_MACHTYPE:
152 case BI_CPUTYPE: 156 case BI_CPUTYPE:
153 case BI_FPUTYPE: 157 case BI_FPUTYPE:
@@ -157,8 +161,11 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
157 161
158 case BI_MEMCHUNK: 162 case BI_MEMCHUNK:
159 if (m68k_num_memory < NUM_MEMINFO) { 163 if (m68k_num_memory < NUM_MEMINFO) {
160 m68k_memory[m68k_num_memory].addr = data[0]; 164 const struct mem_info *m = data;
161 m68k_memory[m68k_num_memory].size = data[1]; 165 m68k_memory[m68k_num_memory].addr =
166 be32_to_cpu(m->addr);
167 m68k_memory[m68k_num_memory].size =
168 be32_to_cpu(m->size);
162 m68k_num_memory++; 169 m68k_num_memory++;
163 } else 170 } else
164 pr_warn("%s: too many memory chunks\n", 171 pr_warn("%s: too many memory chunks\n",
@@ -166,12 +173,15 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
166 break; 173 break;
167 174
168 case BI_RAMDISK: 175 case BI_RAMDISK:
169 m68k_ramdisk.addr = data[0]; 176 {
170 m68k_ramdisk.size = data[1]; 177 const struct mem_info *m = data;
178 m68k_ramdisk.addr = be32_to_cpu(m->addr);
179 m68k_ramdisk.size = be32_to_cpu(m->size);
180 }
171 break; 181 break;
172 182
173 case BI_COMMAND_LINE: 183 case BI_COMMAND_LINE:
174 strlcpy(m68k_command_line, (const char *)data, 184 strlcpy(m68k_command_line, data,
175 sizeof(m68k_command_line)); 185 sizeof(m68k_command_line));
176 break; 186 break;
177 187
@@ -199,9 +209,8 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
199 } 209 }
200 if (unknown) 210 if (unknown)
201 pr_warn("%s: unknown tag 0x%04x ignored\n", __func__, 211 pr_warn("%s: unknown tag 0x%04x ignored\n", __func__,
202 record->tag); 212 tag);
203 record = (struct bi_record *)((unsigned long)record + 213 record = (struct bi_record *)((unsigned long)record + size);
204 record->size);
205 } 214 }
206 215
207 m68k_realnum_memory = m68k_num_memory; 216 m68k_realnum_memory = m68k_num_memory;
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index e48069da04ed..982c3fe73c4a 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -29,6 +29,7 @@
29#include <asm/setup.h> 29#include <asm/setup.h>
30#include <asm/bootinfo.h> 30#include <asm/bootinfo.h>
31#include <asm/bootinfo-mac.h> 31#include <asm/bootinfo-mac.h>
32#include <asm/byteorder.h>
32 33
33#include <asm/io.h> 34#include <asm/io.h>
34#include <asm/irq.h> 35#include <asm/irq.h>
@@ -107,45 +108,46 @@ static void __init mac_sched_init(irq_handler_t vector)
107int __init mac_parse_bootinfo(const struct bi_record *record) 108int __init mac_parse_bootinfo(const struct bi_record *record)
108{ 109{
109 int unknown = 0; 110 int unknown = 0;
110 const u_long *data = record->data; 111 const void *data = record->data;
111 112
112 switch (record->tag) { 113 switch (be16_to_cpu(record->tag)) {
113 case BI_MAC_MODEL: 114 case BI_MAC_MODEL:
114 mac_bi_data.id = *data; 115 mac_bi_data.id = be32_to_cpup(data);
115 break; 116 break;
116 case BI_MAC_VADDR: 117 case BI_MAC_VADDR:
117 mac_bi_data.videoaddr = *data; 118 mac_bi_data.videoaddr = be32_to_cpup(data);
118 break; 119 break;
119 case BI_MAC_VDEPTH: 120 case BI_MAC_VDEPTH:
120 mac_bi_data.videodepth = *data; 121 mac_bi_data.videodepth = be32_to_cpup(data);
121 break; 122 break;
122 case BI_MAC_VROW: 123 case BI_MAC_VROW:
123 mac_bi_data.videorow = *data; 124 mac_bi_data.videorow = be32_to_cpup(data);
124 break; 125 break;
125 case BI_MAC_VDIM: 126 case BI_MAC_VDIM:
126 mac_bi_data.dimensions = *data; 127 mac_bi_data.dimensions = be32_to_cpup(data);
127 break; 128 break;
128 case BI_MAC_VLOGICAL: 129 case BI_MAC_VLOGICAL:
129 mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK); 130 mac_orig_videoaddr = be32_to_cpup(data);
130 mac_orig_videoaddr = *data; 131 mac_bi_data.videological =
132 VIDEOMEMBASE + (mac_orig_videoaddr & ~VIDEOMEMMASK);
131 break; 133 break;
132 case BI_MAC_SCCBASE: 134 case BI_MAC_SCCBASE:
133 mac_bi_data.sccbase = *data; 135 mac_bi_data.sccbase = be32_to_cpup(data);
134 break; 136 break;
135 case BI_MAC_BTIME: 137 case BI_MAC_BTIME:
136 mac_bi_data.boottime = *data; 138 mac_bi_data.boottime = be32_to_cpup(data);
137 break; 139 break;
138 case BI_MAC_GMTBIAS: 140 case BI_MAC_GMTBIAS:
139 mac_bi_data.gmtbias = *data; 141 mac_bi_data.gmtbias = be32_to_cpup(data);
140 break; 142 break;
141 case BI_MAC_MEMSIZE: 143 case BI_MAC_MEMSIZE:
142 mac_bi_data.memsize = *data; 144 mac_bi_data.memsize = be32_to_cpup(data);
143 break; 145 break;
144 case BI_MAC_CPUID: 146 case BI_MAC_CPUID:
145 mac_bi_data.cpuid = *data; 147 mac_bi_data.cpuid = be32_to_cpup(data);
146 break; 148 break;
147 case BI_MAC_ROMBASE: 149 case BI_MAC_ROMBASE:
148 mac_bi_data.rombase = *data; 150 mac_bi_data.rombase = be32_to_cpup(data);
149 break; 151 break;
150 default: 152 default:
151 unknown = 1; 153 unknown = 1;
diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c
index 3a1d47564e52..1bb3ce6634d3 100644
--- a/arch/m68k/mvme147/config.c
+++ b/arch/m68k/mvme147/config.c
@@ -27,6 +27,7 @@
27 27
28#include <asm/bootinfo.h> 28#include <asm/bootinfo.h>
29#include <asm/bootinfo-vme.h> 29#include <asm/bootinfo-vme.h>
30#include <asm/byteorder.h>
30#include <asm/pgtable.h> 31#include <asm/pgtable.h>
31#include <asm/setup.h> 32#include <asm/setup.h>
32#include <asm/irq.h> 33#include <asm/irq.h>
@@ -54,7 +55,8 @@ irq_handler_t tick_handler;
54 55
55int __init mvme147_parse_bootinfo(const struct bi_record *bi) 56int __init mvme147_parse_bootinfo(const struct bi_record *bi)
56{ 57{
57 if (bi->tag == BI_VME_TYPE || bi->tag == BI_VME_BRDINFO) 58 uint16_t tag = be16_to_cpu(bi->tag);
59 if (tag == BI_VME_TYPE || tag == BI_VME_BRDINFO)
58 return 0; 60 return 0;
59 else 61 else
60 return 1; 62 return 1;
diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c
index e05994fd048c..eab7d342757e 100644
--- a/arch/m68k/mvme16x/config.c
+++ b/arch/m68k/mvme16x/config.c
@@ -30,6 +30,7 @@
30 30
31#include <asm/bootinfo.h> 31#include <asm/bootinfo.h>
32#include <asm/bootinfo-vme.h> 32#include <asm/bootinfo-vme.h>
33#include <asm/byteorder.h>
33#include <asm/pgtable.h> 34#include <asm/pgtable.h>
34#include <asm/setup.h> 35#include <asm/setup.h>
35#include <asm/irq.h> 36#include <asm/irq.h>
@@ -63,7 +64,8 @@ EXPORT_SYMBOL(mvme16x_config);
63 64
64int __init mvme16x_parse_bootinfo(const struct bi_record *bi) 65int __init mvme16x_parse_bootinfo(const struct bi_record *bi)
65{ 66{
66 if (bi->tag == BI_VME_TYPE || bi->tag == BI_VME_BRDINFO) 67 uint16_t tag = be16_to_cpu(bi->tag);
68 if (tag == BI_VME_TYPE || tag == BI_VME_BRDINFO)
67 return 0; 69 return 0;
68 else 70 else
69 return 1; 71 return 1;
@@ -88,15 +90,15 @@ static void mvme16x_get_model(char *model)
88 suf[3] = '\0'; 90 suf[3] = '\0';
89 suf[0] = suf[1] ? '-' : '\0'; 91 suf[0] = suf[1] ? '-' : '\0';
90 92
91 sprintf(model, "Motorola MVME%x%s", p->brdno, suf); 93 sprintf(model, "Motorola MVME%x%s", be16_to_cpu(p->brdno), suf);
92} 94}
93 95
94 96
95static void mvme16x_get_hardware_list(struct seq_file *m) 97static void mvme16x_get_hardware_list(struct seq_file *m)
96{ 98{
97 p_bdid p = &mvme_bdid; 99 uint16_t brdno = be16_to_cpu(mvme_bdid.brdno);
98 100
99 if (p->brdno == 0x0162 || p->brdno == 0x0172) 101 if (brdno == 0x0162 || brdno == 0x0172)
100 { 102 {
101 unsigned char rev = *(unsigned char *)MVME162_VERSION_REG; 103 unsigned char rev = *(unsigned char *)MVME162_VERSION_REG;
102 104
@@ -286,6 +288,7 @@ void __init config_mvme16x(void)
286{ 288{
287 p_bdid p = &mvme_bdid; 289 p_bdid p = &mvme_bdid;
288 char id[40]; 290 char id[40];
291 uint16_t brdno = be16_to_cpu(p->brdno);
289 292
290 mach_max_dma_address = 0xffffffff; 293 mach_max_dma_address = 0xffffffff;
291 mach_sched_init = mvme16x_sched_init; 294 mach_sched_init = mvme16x_sched_init;
@@ -307,18 +310,18 @@ void __init config_mvme16x(void)
307 } 310 }
308 /* Board type is only set by newer versions of vmelilo/tftplilo */ 311 /* Board type is only set by newer versions of vmelilo/tftplilo */
309 if (vme_brdtype == 0) 312 if (vme_brdtype == 0)
310 vme_brdtype = p->brdno; 313 vme_brdtype = brdno;
311 314
312 mvme16x_get_model(id); 315 mvme16x_get_model(id);
313 printk ("\nBRD_ID: %s BUG %x.%x %02x/%02x/%02x\n", id, p->rev>>4, 316 printk ("\nBRD_ID: %s BUG %x.%x %02x/%02x/%02x\n", id, p->rev>>4,
314 p->rev&0xf, p->yr, p->mth, p->day); 317 p->rev&0xf, p->yr, p->mth, p->day);
315 if (p->brdno == 0x0162 || p->brdno == 0x172) 318 if (brdno == 0x0162 || brdno == 0x172)
316 { 319 {
317 unsigned char rev = *(unsigned char *)MVME162_VERSION_REG; 320 unsigned char rev = *(unsigned char *)MVME162_VERSION_REG;
318 321
319 mvme16x_config = rev | MVME16x_CONFIG_GOT_SCCA; 322 mvme16x_config = rev | MVME16x_CONFIG_GOT_SCCA;
320 323
321 printk ("MVME%x Hardware status:\n", p->brdno); 324 printk ("MVME%x Hardware status:\n", brdno);
322 printk (" CPU Type 68%s040\n", 325 printk (" CPU Type 68%s040\n",
323 rev & MVME16x_CONFIG_GOT_FPU ? "" : "LC"); 326 rev & MVME16x_CONFIG_GOT_FPU ? "" : "LC");
324 printk (" CPU clock %dMHz\n", 327 printk (" CPU clock %dMHz\n",
@@ -348,12 +351,12 @@ void __init config_mvme16x(void)
348 351
349static irqreturn_t mvme16x_abort_int (int irq, void *dev_id) 352static irqreturn_t mvme16x_abort_int (int irq, void *dev_id)
350{ 353{
351 p_bdid p = &mvme_bdid;
352 unsigned long *new = (unsigned long *)vectors; 354 unsigned long *new = (unsigned long *)vectors;
353 unsigned long *old = (unsigned long *)0xffe00000; 355 unsigned long *old = (unsigned long *)0xffe00000;
354 volatile unsigned char uc, *ucp; 356 volatile unsigned char uc, *ucp;
357 uint16_t brdno = be16_to_cpu(mvme_bdid.brdno);
355 358
356 if (p->brdno == 0x0162 || p->brdno == 0x172) 359 if (brdno == 0x0162 || brdno == 0x172)
357 { 360 {
358 ucp = (volatile unsigned char *)0xfff42043; 361 ucp = (volatile unsigned char *)0xfff42043;
359 uc = *ucp | 8; 362 uc = *ucp | 8;
@@ -367,7 +370,7 @@ static irqreturn_t mvme16x_abort_int (int irq, void *dev_id)
367 *(new+9) = *(old+9); /* Trace */ 370 *(new+9) = *(old+9); /* Trace */
368 *(new+47) = *(old+47); /* Trap #15 */ 371 *(new+47) = *(old+47); /* Trap #15 */
369 372
370 if (p->brdno == 0x0162 || p->brdno == 0x172) 373 if (brdno == 0x0162 || brdno == 0x172)
371 *(new+0x5e) = *(old+0x5e); /* ABORT switch */ 374 *(new+0x5e) = *(old+0x5e); /* ABORT switch */
372 else 375 else
373 *(new+0x6e) = *(old+0x6e); /* ABORT switch */ 376 *(new+0x6e) = *(old+0x6e); /* ABORT switch */
@@ -382,7 +385,7 @@ static irqreturn_t mvme16x_timer_int (int irq, void *dev_id)
382 385
383void mvme16x_sched_init (irq_handler_t timer_routine) 386void mvme16x_sched_init (irq_handler_t timer_routine)
384{ 387{
385 p_bdid p = &mvme_bdid; 388 uint16_t brdno = be16_to_cpu(mvme_bdid.brdno);
386 int irq; 389 int irq;
387 390
388 tick_handler = timer_routine; 391 tick_handler = timer_routine;
@@ -395,7 +398,7 @@ void mvme16x_sched_init (irq_handler_t timer_routine)
395 "timer", mvme16x_timer_int)) 398 "timer", mvme16x_timer_int))
396 panic ("Couldn't register timer int"); 399 panic ("Couldn't register timer int");
397 400
398 if (p->brdno == 0x0162 || p->brdno == 0x172) 401 if (brdno == 0x0162 || brdno == 0x172)
399 irq = MVME162_IRQ_ABORT; 402 irq = MVME162_IRQ_ABORT;
400 else 403 else
401 irq = MVME167_IRQ_ABORT; 404 irq = MVME167_IRQ_ABORT;