aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/amiga/bootinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ppc/amiga/bootinfo.c')
-rw-r--r--arch/ppc/amiga/bootinfo.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/arch/ppc/amiga/bootinfo.c b/arch/ppc/amiga/bootinfo.c
new file mode 100644
index 000000000000..e2e965661d03
--- /dev/null
+++ b/arch/ppc/amiga/bootinfo.c
@@ -0,0 +1,80 @@
1/*
2 * arch/ppc/amiga/bootinfo.c
3 *
4 * Extracted from arch/m68k/kernel/setup.c.
5 * Should be properly generalized and put somewhere else.
6 * Jesper
7 */
8
9#include <linux/types.h>
10#include <linux/kernel.h>
11#include <linux/string.h>
12#include <linux/init.h>
13
14#include <asm/setup.h>
15#include <asm/bootinfo.h>
16
17extern char cmd_line[CL_SIZE];
18
19extern int num_memory;
20extern int m68k_realnum_memory;
21extern struct mem_info memory[NUM_MEMINFO];
22extern struct mem_info m68k_memory[NUM_MEMINFO];
23extern struct mem_info ramdisk;
24
25extern int amiga_parse_bootinfo(const struct bi_record *);
26extern int atari_parse_bootinfo(const struct bi_record *);
27extern int mac_parse_bootinfo(const struct bi_record *);
28
29void __init parse_bootinfo(const struct bi_record *record)
30{
31 while (record->tag != BI_LAST) {
32 int unknown = 0;
33 const u_long *data = record->data;
34 switch (record->tag) {
35 case BI_MACHTYPE:
36 case BI_CPUTYPE:
37 case BI_FPUTYPE:
38 case BI_MMUTYPE:
39 /* Already set up by head.S */
40 break;
41
42 case BI_MEMCHUNK:
43 if (num_memory < NUM_MEMINFO) {
44 memory[num_memory].addr = data[0];
45 memory[num_memory].size = data[1];
46 num_memory++;
47
48 /* FIXME: duplicate for m68k drivers. */
49 m68k_memory[m68k_realnum_memory].addr = data[0];
50 m68k_memory[m68k_realnum_memory].size = data[1];
51 m68k_realnum_memory++;
52 } else
53 printk("parse_bootinfo: too many memory chunks\n");
54 break;
55
56 case BI_RAMDISK:
57 ramdisk.addr = data[0];
58 ramdisk.size = data[1];
59 break;
60
61 case BI_COMMAND_LINE:
62 strlcpy(cmd_line, (const char *)data, sizeof(cmd_line));
63 break;
64
65 default:
66 if (MACH_IS_AMIGA)
67 unknown = amiga_parse_bootinfo(record);
68 else if (MACH_IS_ATARI)
69 unknown = atari_parse_bootinfo(record);
70 else if (MACH_IS_MAC)
71 unknown = mac_parse_bootinfo(record);
72 else
73 unknown = 1;
74 }
75 if (unknown)
76 printk("parse_bootinfo: unknown tag 0x%04x ignored\n",
77 record->tag);
78 record = (struct bi_record *)((u_long)record+record->size);
79 }
80}