diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2013-10-04 05:41:24 -0400 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2013-11-26 05:09:21 -0500 |
commit | abe48101c17eaf1b5d85270272392e6111562626 (patch) | |
tree | 4cf0f060b2e2efcfa41592be6aaf8a427dc09939 /arch/m68k/mvme16x | |
parent | cf288bd5b122d12476fd7d9825c292daef5dba58 (diff) |
m68k/UAPI: Use proper types (endianness/size) in <asm/bootinfo*.h>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k/mvme16x')
-rw-r--r-- | arch/m68k/mvme16x/config.c | 27 |
1 files changed, 15 insertions, 12 deletions
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 | ||
64 | int __init mvme16x_parse_bootinfo(const struct bi_record *bi) | 65 | int __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 | ||
95 | static void mvme16x_get_hardware_list(struct seq_file *m) | 97 | static 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 | ||
349 | static irqreturn_t mvme16x_abort_int (int irq, void *dev_id) | 352 | static 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 | ||
383 | void mvme16x_sched_init (irq_handler_t timer_routine) | 386 | void 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; |