diff options
Diffstat (limited to 'arch/m68k/mac/config.c')
-rw-r--r-- | arch/m68k/mac/config.c | 167 |
1 files changed, 80 insertions, 87 deletions
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 562b38d00180..5fd413246f89 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c | |||
@@ -59,15 +59,15 @@ extern struct mem_info m68k_ramdisk; | |||
59 | 59 | ||
60 | extern char m68k_command_line[CL_SIZE]; | 60 | extern char m68k_command_line[CL_SIZE]; |
61 | 61 | ||
62 | void *mac_env; /* Loaded by the boot asm */ | 62 | void *mac_env; /* Loaded by the boot asm */ |
63 | 63 | ||
64 | /* The phys. video addr. - might be bogus on some machines */ | 64 | /* The phys. video addr. - might be bogus on some machines */ |
65 | unsigned long mac_orig_videoaddr; | 65 | unsigned long mac_orig_videoaddr; |
66 | 66 | ||
67 | /* Mac specific timer functions */ | 67 | /* Mac specific timer functions */ |
68 | extern unsigned long mac_gettimeoffset (void); | 68 | extern unsigned long mac_gettimeoffset(void); |
69 | extern int mac_hwclk (int, struct rtc_time *); | 69 | extern int mac_hwclk(int, struct rtc_time *); |
70 | extern int mac_set_clock_mmss (unsigned long); | 70 | extern int mac_set_clock_mmss(unsigned long); |
71 | extern int show_mac_interrupts(struct seq_file *, void *); | 71 | extern int show_mac_interrupts(struct seq_file *, void *); |
72 | extern void iop_preinit(void); | 72 | extern void iop_preinit(void); |
73 | extern void iop_init(void); | 73 | extern void iop_init(void); |
@@ -82,10 +82,6 @@ extern void mac_mksound(unsigned int, unsigned int); | |||
82 | 82 | ||
83 | extern void nubus_sweep_video(void); | 83 | extern void nubus_sweep_video(void); |
84 | 84 | ||
85 | /* Mac specific debug functions (in debug.c) */ | ||
86 | extern void mac_debug_init(void); | ||
87 | extern void mac_debugging_long(int, long); | ||
88 | |||
89 | static void mac_get_model(char *str); | 85 | static void mac_get_model(char *str); |
90 | 86 | ||
91 | static void mac_sched_init(irq_handler_t vector) | 87 | static void mac_sched_init(irq_handler_t vector) |
@@ -99,51 +95,52 @@ static void mac_sched_init(irq_handler_t vector) | |||
99 | 95 | ||
100 | int __init mac_parse_bootinfo(const struct bi_record *record) | 96 | int __init mac_parse_bootinfo(const struct bi_record *record) |
101 | { | 97 | { |
102 | int unknown = 0; | 98 | int unknown = 0; |
103 | const u_long *data = record->data; | 99 | const u_long *data = record->data; |
104 | 100 | ||
105 | switch (record->tag) { | 101 | switch (record->tag) { |
106 | case BI_MAC_MODEL: | 102 | case BI_MAC_MODEL: |
107 | mac_bi_data.id = *data; | 103 | mac_bi_data.id = *data; |
108 | break; | 104 | break; |
109 | case BI_MAC_VADDR: | 105 | case BI_MAC_VADDR: |
110 | mac_bi_data.videoaddr = *data; | 106 | mac_bi_data.videoaddr = *data; |
111 | break; | 107 | break; |
112 | case BI_MAC_VDEPTH: | 108 | case BI_MAC_VDEPTH: |
113 | mac_bi_data.videodepth = *data; | 109 | mac_bi_data.videodepth = *data; |
114 | break; | 110 | break; |
115 | case BI_MAC_VROW: | 111 | case BI_MAC_VROW: |
116 | mac_bi_data.videorow = *data; | 112 | mac_bi_data.videorow = *data; |
117 | break; | 113 | break; |
118 | case BI_MAC_VDIM: | 114 | case BI_MAC_VDIM: |
119 | mac_bi_data.dimensions = *data; | 115 | mac_bi_data.dimensions = *data; |
120 | break; | 116 | break; |
121 | case BI_MAC_VLOGICAL: | 117 | case BI_MAC_VLOGICAL: |
122 | mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK); | 118 | mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK); |
123 | mac_orig_videoaddr = *data; | 119 | mac_orig_videoaddr = *data; |
124 | break; | 120 | break; |
125 | case BI_MAC_SCCBASE: | 121 | case BI_MAC_SCCBASE: |
126 | mac_bi_data.sccbase = *data; | 122 | mac_bi_data.sccbase = *data; |
127 | break; | 123 | break; |
128 | case BI_MAC_BTIME: | 124 | case BI_MAC_BTIME: |
129 | mac_bi_data.boottime = *data; | 125 | mac_bi_data.boottime = *data; |
130 | break; | 126 | break; |
131 | case BI_MAC_GMTBIAS: | 127 | case BI_MAC_GMTBIAS: |
132 | mac_bi_data.gmtbias = *data; | 128 | mac_bi_data.gmtbias = *data; |
133 | break; | 129 | break; |
134 | case BI_MAC_MEMSIZE: | 130 | case BI_MAC_MEMSIZE: |
135 | mac_bi_data.memsize = *data; | 131 | mac_bi_data.memsize = *data; |
136 | break; | 132 | break; |
137 | case BI_MAC_CPUID: | 133 | case BI_MAC_CPUID: |
138 | mac_bi_data.cpuid = *data; | 134 | mac_bi_data.cpuid = *data; |
139 | break; | 135 | break; |
140 | case BI_MAC_ROMBASE: | 136 | case BI_MAC_ROMBASE: |
141 | mac_bi_data.rombase = *data; | 137 | mac_bi_data.rombase = *data; |
142 | break; | 138 | break; |
143 | default: | 139 | default: |
144 | unknown = 1; | 140 | unknown = 1; |
145 | } | 141 | break; |
146 | return(unknown); | 142 | } |
143 | return unknown; | ||
147 | } | 144 | } |
148 | 145 | ||
149 | /* | 146 | /* |
@@ -155,6 +152,7 @@ int __init mac_parse_bootinfo(const struct bi_record *record) | |||
155 | static void mac_cache_card_flush(int writeback) | 152 | static void mac_cache_card_flush(int writeback) |
156 | { | 153 | { |
157 | unsigned long flags; | 154 | unsigned long flags; |
155 | |||
158 | local_irq_save(flags); | 156 | local_irq_save(flags); |
159 | via_flush_cache(); | 157 | via_flush_cache(); |
160 | local_irq_restore(flags); | 158 | local_irq_restore(flags); |
@@ -162,28 +160,24 @@ static void mac_cache_card_flush(int writeback) | |||
162 | 160 | ||
163 | void __init config_mac(void) | 161 | void __init config_mac(void) |
164 | { | 162 | { |
165 | if (!MACH_IS_MAC) { | 163 | if (!MACH_IS_MAC) |
166 | printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n"); | 164 | printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n"); |
167 | } | ||
168 | 165 | ||
169 | mach_sched_init = mac_sched_init; | 166 | mach_sched_init = mac_sched_init; |
170 | mach_init_IRQ = mac_init_IRQ; | 167 | mach_init_IRQ = mac_init_IRQ; |
171 | mach_get_model = mac_get_model; | 168 | mach_get_model = mac_get_model; |
172 | mach_gettimeoffset = mac_gettimeoffset; | 169 | mach_gettimeoffset = mac_gettimeoffset; |
173 | #warning move to adb/via init | 170 | #warning move to adb/via init |
174 | #if 0 | 171 | #if 0 |
175 | mach_hwclk = mac_hwclk; | 172 | mach_hwclk = mac_hwclk; |
176 | #endif | 173 | #endif |
177 | mach_set_clock_mmss = mac_set_clock_mmss; | 174 | mach_set_clock_mmss = mac_set_clock_mmss; |
178 | mach_reset = mac_reset; | 175 | mach_reset = mac_reset; |
179 | mach_halt = mac_poweroff; | 176 | mach_halt = mac_poweroff; |
180 | mach_power_off = mac_poweroff; | 177 | mach_power_off = mac_poweroff; |
181 | mach_max_dma_address = 0xffffffff; | 178 | mach_max_dma_address = 0xffffffff; |
182 | #if 0 | ||
183 | mach_debug_init = mac_debug_init; | ||
184 | #endif | ||
185 | #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) | 179 | #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) |
186 | mach_beep = mac_mksound; | 180 | mach_beep = mac_mksound; |
187 | #endif | 181 | #endif |
188 | #ifdef CONFIG_HEARTBEAT | 182 | #ifdef CONFIG_HEARTBEAT |
189 | #if 0 | 183 | #if 0 |
@@ -199,21 +193,22 @@ void __init config_mac(void) | |||
199 | mac_identify(); | 193 | mac_identify(); |
200 | mac_report_hardware(); | 194 | mac_report_hardware(); |
201 | 195 | ||
202 | /* AFAIK only the IIci takes a cache card. The IIfx has onboard | 196 | /* |
203 | cache ... someone needs to figure out how to tell if it's on or | 197 | * AFAIK only the IIci takes a cache card. The IIfx has onboard |
204 | not. */ | 198 | * cache ... someone needs to figure out how to tell if it's on or |
199 | * not. | ||
200 | */ | ||
205 | 201 | ||
206 | if (macintosh_config->ident == MAC_MODEL_IICI | 202 | if (macintosh_config->ident == MAC_MODEL_IICI |
207 | || macintosh_config->ident == MAC_MODEL_IIFX) { | 203 | || macintosh_config->ident == MAC_MODEL_IIFX) |
208 | mach_l2_flush = mac_cache_card_flush; | 204 | mach_l2_flush = mac_cache_card_flush; |
209 | } | ||
210 | 205 | ||
211 | /* | 206 | /* |
212 | * Check for machine specific fixups. | 207 | * Check for machine specific fixups. |
213 | */ | 208 | */ |
214 | 209 | ||
215 | #ifdef OLD_NUBUS_CODE | 210 | #ifdef OLD_NUBUS_CODE |
216 | nubus_sweep_video(); | 211 | nubus_sweep_video(); |
217 | #endif | 212 | #endif |
218 | } | 213 | } |
219 | 214 | ||
@@ -233,8 +228,7 @@ void __init config_mac(void) | |||
233 | struct mac_model *macintosh_config; | 228 | struct mac_model *macintosh_config; |
234 | EXPORT_SYMBOL(macintosh_config); | 229 | EXPORT_SYMBOL(macintosh_config); |
235 | 230 | ||
236 | static struct mac_model mac_data_table[]= | 231 | static struct mac_model mac_data_table[] = { |
237 | { | ||
238 | /* | 232 | /* |
239 | * We'll pretend to be a Macintosh II, that's pretty safe. | 233 | * We'll pretend to be a Macintosh II, that's pretty safe. |
240 | */ | 234 | */ |
@@ -784,12 +778,12 @@ void mac_identify(void) | |||
784 | if (!model) { | 778 | if (!model) { |
785 | /* no bootinfo model id -> NetBSD booter was used! */ | 779 | /* no bootinfo model id -> NetBSD booter was used! */ |
786 | /* XXX FIXME: breaks for model > 31 */ | 780 | /* XXX FIXME: breaks for model > 31 */ |
787 | model=(mac_bi_data.cpuid>>2)&63; | 781 | model = (mac_bi_data.cpuid >> 2) & 63; |
788 | printk (KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n"); | 782 | printk(KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n"); |
789 | } | 783 | } |
790 | 784 | ||
791 | macintosh_config = mac_data_table; | 785 | macintosh_config = mac_data_table; |
792 | for (m = macintosh_config ; m->ident != -1 ; m++) { | 786 | for (m = macintosh_config; m->ident != -1; m++) { |
793 | if (m->ident == model) { | 787 | if (m->ident == model) { |
794 | macintosh_config = m; | 788 | macintosh_config = m; |
795 | break; | 789 | break; |
@@ -801,27 +795,26 @@ void mac_identify(void) | |||
801 | /* the serial ports set to "Faster" mode in MacOS. */ | 795 | /* the serial ports set to "Faster" mode in MacOS. */ |
802 | 796 | ||
803 | iop_preinit(); | 797 | iop_preinit(); |
804 | mac_debug_init(); | ||
805 | 798 | ||
806 | printk (KERN_INFO "Detected Macintosh model: %d \n", model); | 799 | printk(KERN_INFO "Detected Macintosh model: %d \n", model); |
807 | 800 | ||
808 | /* | 801 | /* |
809 | * Report booter data: | 802 | * Report booter data: |
810 | */ | 803 | */ |
811 | printk (KERN_DEBUG " Penguin bootinfo data:\n"); | 804 | printk(KERN_DEBUG " Penguin bootinfo data:\n"); |
812 | printk (KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n", | 805 | printk(KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n", |
813 | mac_bi_data.videoaddr, mac_bi_data.videorow, | 806 | mac_bi_data.videoaddr, mac_bi_data.videorow, |
814 | mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, | 807 | mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, |
815 | mac_bi_data.dimensions >> 16); | 808 | mac_bi_data.dimensions >> 16); |
816 | printk (KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n", | 809 | printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n", |
817 | mac_bi_data.videological, mac_orig_videoaddr, | 810 | mac_bi_data.videological, mac_orig_videoaddr, |
818 | mac_bi_data.sccbase); | 811 | mac_bi_data.sccbase); |
819 | printk (KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n", | 812 | printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n", |
820 | mac_bi_data.boottime, mac_bi_data.gmtbias); | 813 | mac_bi_data.boottime, mac_bi_data.gmtbias); |
821 | printk (KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n", | 814 | printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n", |
822 | mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); | 815 | mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); |
823 | #if 0 | 816 | #if 0 |
824 | printk ("Ramdisk: addr 0x%lx size 0x%lx\n", | 817 | printk("Ramdisk: addr 0x%lx size 0x%lx\n", |
825 | m68k_ramdisk.addr, m68k_ramdisk.size); | 818 | m68k_ramdisk.addr, m68k_ramdisk.size); |
826 | #endif | 819 | #endif |
827 | 820 | ||
@@ -830,22 +823,22 @@ void mac_identify(void) | |||
830 | */ | 823 | */ |
831 | switch (macintosh_config->scsi_type) { | 824 | switch (macintosh_config->scsi_type) { |
832 | case MAC_SCSI_OLD: | 825 | case MAC_SCSI_OLD: |
833 | MACHW_SET(MAC_SCSI_80); | 826 | MACHW_SET(MAC_SCSI_80); |
834 | break; | 827 | break; |
835 | case MAC_SCSI_QUADRA: | 828 | case MAC_SCSI_QUADRA: |
836 | case MAC_SCSI_QUADRA2: | 829 | case MAC_SCSI_QUADRA2: |
837 | case MAC_SCSI_QUADRA3: | 830 | case MAC_SCSI_QUADRA3: |
838 | MACHW_SET(MAC_SCSI_96); | 831 | MACHW_SET(MAC_SCSI_96); |
839 | if ((macintosh_config->ident == MAC_MODEL_Q900) || | 832 | if ((macintosh_config->ident == MAC_MODEL_Q900) || |
840 | (macintosh_config->ident == MAC_MODEL_Q950)) | 833 | (macintosh_config->ident == MAC_MODEL_Q950)) |
841 | MACHW_SET(MAC_SCSI_96_2); | 834 | MACHW_SET(MAC_SCSI_96_2); |
842 | break; | 835 | break; |
843 | default: | 836 | default: |
844 | printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n"); | 837 | printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n"); |
845 | MACHW_SET(MAC_SCSI_80); | 838 | MACHW_SET(MAC_SCSI_80); |
846 | break; | 839 | break; |
847 | |||
848 | } | 840 | } |
841 | |||
849 | iop_init(); | 842 | iop_init(); |
850 | via_init(); | 843 | via_init(); |
851 | oss_init(); | 844 | oss_init(); |
@@ -860,6 +853,6 @@ void mac_report_hardware(void) | |||
860 | 853 | ||
861 | static void mac_get_model(char *str) | 854 | static void mac_get_model(char *str) |
862 | { | 855 | { |
863 | strcpy(str,"Macintosh "); | 856 | strcpy(str, "Macintosh "); |
864 | strcat(str, macintosh_config->name); | 857 | strcat(str, macintosh_config->name); |
865 | } | 858 | } |