aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/mac/config.c
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2007-05-01 16:32:43 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-04 20:59:06 -0400
commit6ff5801acbb643e81d3420ac0f37c96089309063 (patch)
tree2406744e75f7cd06e96d8cd62ba82970a0f79922 /arch/m68k/mac/config.c
parentb3e2fd9cebcf4e82d0306fe7e796eeca5aac0614 (diff)
m68k: reformat various m68k files
Reformat various m68k files, so they actually look like Linux sources. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68k/mac/config.c')
-rw-r--r--arch/m68k/mac/config.c161
1 files changed, 81 insertions, 80 deletions
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index 562b38d00180..d2fbf436a1fb 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
60extern char m68k_command_line[CL_SIZE]; 60extern char m68k_command_line[CL_SIZE];
61 61
62void *mac_env; /* Loaded by the boot asm */ 62void *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 */
65unsigned long mac_orig_videoaddr; 65unsigned long mac_orig_videoaddr;
66 66
67/* Mac specific timer functions */ 67/* Mac specific timer functions */
68extern unsigned long mac_gettimeoffset (void); 68extern unsigned long mac_gettimeoffset(void);
69extern int mac_hwclk (int, struct rtc_time *); 69extern int mac_hwclk(int, struct rtc_time *);
70extern int mac_set_clock_mmss (unsigned long); 70extern int mac_set_clock_mmss(unsigned long);
71extern int show_mac_interrupts(struct seq_file *, void *); 71extern int show_mac_interrupts(struct seq_file *, void *);
72extern void iop_preinit(void); 72extern void iop_preinit(void);
73extern void iop_init(void); 73extern void iop_init(void);
@@ -99,51 +99,52 @@ static void mac_sched_init(irq_handler_t vector)
99 99
100int __init mac_parse_bootinfo(const struct bi_record *record) 100int __init mac_parse_bootinfo(const struct bi_record *record)
101{ 101{
102 int unknown = 0; 102 int unknown = 0;
103 const u_long *data = record->data; 103 const u_long *data = record->data;
104 104
105 switch (record->tag) { 105 switch (record->tag) {
106 case BI_MAC_MODEL: 106 case BI_MAC_MODEL:
107 mac_bi_data.id = *data; 107 mac_bi_data.id = *data;
108 break; 108 break;
109 case BI_MAC_VADDR: 109 case BI_MAC_VADDR:
110 mac_bi_data.videoaddr = *data; 110 mac_bi_data.videoaddr = *data;
111 break; 111 break;
112 case BI_MAC_VDEPTH: 112 case BI_MAC_VDEPTH:
113 mac_bi_data.videodepth = *data; 113 mac_bi_data.videodepth = *data;
114 break; 114 break;
115 case BI_MAC_VROW: 115 case BI_MAC_VROW:
116 mac_bi_data.videorow = *data; 116 mac_bi_data.videorow = *data;
117 break; 117 break;
118 case BI_MAC_VDIM: 118 case BI_MAC_VDIM:
119 mac_bi_data.dimensions = *data; 119 mac_bi_data.dimensions = *data;
120 break; 120 break;
121 case BI_MAC_VLOGICAL: 121 case BI_MAC_VLOGICAL:
122 mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK); 122 mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK);
123 mac_orig_videoaddr = *data; 123 mac_orig_videoaddr = *data;
124 break; 124 break;
125 case BI_MAC_SCCBASE: 125 case BI_MAC_SCCBASE:
126 mac_bi_data.sccbase = *data; 126 mac_bi_data.sccbase = *data;
127 break; 127 break;
128 case BI_MAC_BTIME: 128 case BI_MAC_BTIME:
129 mac_bi_data.boottime = *data; 129 mac_bi_data.boottime = *data;
130 break; 130 break;
131 case BI_MAC_GMTBIAS: 131 case BI_MAC_GMTBIAS:
132 mac_bi_data.gmtbias = *data; 132 mac_bi_data.gmtbias = *data;
133 break; 133 break;
134 case BI_MAC_MEMSIZE: 134 case BI_MAC_MEMSIZE:
135 mac_bi_data.memsize = *data; 135 mac_bi_data.memsize = *data;
136 break; 136 break;
137 case BI_MAC_CPUID: 137 case BI_MAC_CPUID:
138 mac_bi_data.cpuid = *data; 138 mac_bi_data.cpuid = *data;
139 break; 139 break;
140 case BI_MAC_ROMBASE: 140 case BI_MAC_ROMBASE:
141 mac_bi_data.rombase = *data; 141 mac_bi_data.rombase = *data;
142 break; 142 break;
143 default: 143 default:
144 unknown = 1; 144 unknown = 1;
145 } 145 break;
146 return(unknown); 146 }
147 return unknown;
147} 148}
148 149
149/* 150/*
@@ -155,6 +156,7 @@ int __init mac_parse_bootinfo(const struct bi_record *record)
155static void mac_cache_card_flush(int writeback) 156static void mac_cache_card_flush(int writeback)
156{ 157{
157 unsigned long flags; 158 unsigned long flags;
159
158 local_irq_save(flags); 160 local_irq_save(flags);
159 via_flush_cache(); 161 via_flush_cache();
160 local_irq_restore(flags); 162 local_irq_restore(flags);
@@ -162,28 +164,27 @@ static void mac_cache_card_flush(int writeback)
162 164
163void __init config_mac(void) 165void __init config_mac(void)
164{ 166{
165 if (!MACH_IS_MAC) { 167 if (!MACH_IS_MAC)
166 printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n"); 168 printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n");
167 }
168 169
169 mach_sched_init = mac_sched_init; 170 mach_sched_init = mac_sched_init;
170 mach_init_IRQ = mac_init_IRQ; 171 mach_init_IRQ = mac_init_IRQ;
171 mach_get_model = mac_get_model; 172 mach_get_model = mac_get_model;
172 mach_gettimeoffset = mac_gettimeoffset; 173 mach_gettimeoffset = mac_gettimeoffset;
173#warning move to adb/via init 174#warning move to adb/via init
174#if 0 175#if 0
175 mach_hwclk = mac_hwclk; 176 mach_hwclk = mac_hwclk;
176#endif 177#endif
177 mach_set_clock_mmss = mac_set_clock_mmss; 178 mach_set_clock_mmss = mac_set_clock_mmss;
178 mach_reset = mac_reset; 179 mach_reset = mac_reset;
179 mach_halt = mac_poweroff; 180 mach_halt = mac_poweroff;
180 mach_power_off = mac_poweroff; 181 mach_power_off = mac_poweroff;
181 mach_max_dma_address = 0xffffffff; 182 mach_max_dma_address = 0xffffffff;
182#if 0 183#if 0
183 mach_debug_init = mac_debug_init; 184 mach_debug_init = mac_debug_init;
184#endif 185#endif
185#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) 186#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
186 mach_beep = mac_mksound; 187 mach_beep = mac_mksound;
187#endif 188#endif
188#ifdef CONFIG_HEARTBEAT 189#ifdef CONFIG_HEARTBEAT
189#if 0 190#if 0
@@ -199,21 +200,22 @@ void __init config_mac(void)
199 mac_identify(); 200 mac_identify();
200 mac_report_hardware(); 201 mac_report_hardware();
201 202
202 /* AFAIK only the IIci takes a cache card. The IIfx has onboard 203 /*
203 cache ... someone needs to figure out how to tell if it's on or 204 * AFAIK only the IIci takes a cache card. The IIfx has onboard
204 not. */ 205 * cache ... someone needs to figure out how to tell if it's on or
206 * not.
207 */
205 208
206 if (macintosh_config->ident == MAC_MODEL_IICI 209 if (macintosh_config->ident == MAC_MODEL_IICI
207 || macintosh_config->ident == MAC_MODEL_IIFX) { 210 || macintosh_config->ident == MAC_MODEL_IIFX)
208 mach_l2_flush = mac_cache_card_flush; 211 mach_l2_flush = mac_cache_card_flush;
209 }
210 212
211 /* 213 /*
212 * Check for machine specific fixups. 214 * Check for machine specific fixups.
213 */ 215 */
214 216
215#ifdef OLD_NUBUS_CODE 217#ifdef OLD_NUBUS_CODE
216 nubus_sweep_video(); 218 nubus_sweep_video();
217#endif 219#endif
218} 220}
219 221
@@ -233,8 +235,7 @@ void __init config_mac(void)
233struct mac_model *macintosh_config; 235struct mac_model *macintosh_config;
234EXPORT_SYMBOL(macintosh_config); 236EXPORT_SYMBOL(macintosh_config);
235 237
236static struct mac_model mac_data_table[]= 238static struct mac_model mac_data_table[] = {
237{
238 /* 239 /*
239 * We'll pretend to be a Macintosh II, that's pretty safe. 240 * We'll pretend to be a Macintosh II, that's pretty safe.
240 */ 241 */
@@ -784,12 +785,12 @@ void mac_identify(void)
784 if (!model) { 785 if (!model) {
785 /* no bootinfo model id -> NetBSD booter was used! */ 786 /* no bootinfo model id -> NetBSD booter was used! */
786 /* XXX FIXME: breaks for model > 31 */ 787 /* XXX FIXME: breaks for model > 31 */
787 model=(mac_bi_data.cpuid>>2)&63; 788 model = (mac_bi_data.cpuid >> 2) & 63;
788 printk (KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n"); 789 printk(KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n");
789 } 790 }
790 791
791 macintosh_config = mac_data_table; 792 macintosh_config = mac_data_table;
792 for (m = macintosh_config ; m->ident != -1 ; m++) { 793 for (m = macintosh_config; m->ident != -1; m++) {
793 if (m->ident == model) { 794 if (m->ident == model) {
794 macintosh_config = m; 795 macintosh_config = m;
795 break; 796 break;
@@ -803,25 +804,25 @@ void mac_identify(void)
803 iop_preinit(); 804 iop_preinit();
804 mac_debug_init(); 805 mac_debug_init();
805 806
806 printk (KERN_INFO "Detected Macintosh model: %d \n", model); 807 printk(KERN_INFO "Detected Macintosh model: %d \n", model);
807 808
808 /* 809 /*
809 * Report booter data: 810 * Report booter data:
810 */ 811 */
811 printk (KERN_DEBUG " Penguin bootinfo data:\n"); 812 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", 813 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, 814 mac_bi_data.videoaddr, mac_bi_data.videorow,
814 mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, 815 mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
815 mac_bi_data.dimensions >> 16); 816 mac_bi_data.dimensions >> 16);
816 printk (KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n", 817 printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n",
817 mac_bi_data.videological, mac_orig_videoaddr, 818 mac_bi_data.videological, mac_orig_videoaddr,
818 mac_bi_data.sccbase); 819 mac_bi_data.sccbase);
819 printk (KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n", 820 printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n",
820 mac_bi_data.boottime, mac_bi_data.gmtbias); 821 mac_bi_data.boottime, mac_bi_data.gmtbias);
821 printk (KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n", 822 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); 823 mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
823#if 0 824#if 0
824 printk ("Ramdisk: addr 0x%lx size 0x%lx\n", 825 printk("Ramdisk: addr 0x%lx size 0x%lx\n",
825 m68k_ramdisk.addr, m68k_ramdisk.size); 826 m68k_ramdisk.addr, m68k_ramdisk.size);
826#endif 827#endif
827 828
@@ -830,22 +831,22 @@ void mac_identify(void)
830 */ 831 */
831 switch (macintosh_config->scsi_type) { 832 switch (macintosh_config->scsi_type) {
832 case MAC_SCSI_OLD: 833 case MAC_SCSI_OLD:
833 MACHW_SET(MAC_SCSI_80); 834 MACHW_SET(MAC_SCSI_80);
834 break; 835 break;
835 case MAC_SCSI_QUADRA: 836 case MAC_SCSI_QUADRA:
836 case MAC_SCSI_QUADRA2: 837 case MAC_SCSI_QUADRA2:
837 case MAC_SCSI_QUADRA3: 838 case MAC_SCSI_QUADRA3:
838 MACHW_SET(MAC_SCSI_96); 839 MACHW_SET(MAC_SCSI_96);
839 if ((macintosh_config->ident == MAC_MODEL_Q900) || 840 if ((macintosh_config->ident == MAC_MODEL_Q900) ||
840 (macintosh_config->ident == MAC_MODEL_Q950)) 841 (macintosh_config->ident == MAC_MODEL_Q950))
841 MACHW_SET(MAC_SCSI_96_2); 842 MACHW_SET(MAC_SCSI_96_2);
842 break; 843 break;
843 default: 844 default:
844 printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n"); 845 printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n");
845 MACHW_SET(MAC_SCSI_80); 846 MACHW_SET(MAC_SCSI_80);
846 break; 847 break;
847
848 } 848 }
849
849 iop_init(); 850 iop_init();
850 via_init(); 851 via_init();
851 oss_init(); 852 oss_init();
@@ -860,6 +861,6 @@ void mac_report_hardware(void)
860 861
861static void mac_get_model(char *str) 862static void mac_get_model(char *str)
862{ 863{
863 strcpy(str,"Macintosh "); 864 strcpy(str, "Macintosh ");
864 strcat(str, macintosh_config->name); 865 strcat(str, macintosh_config->name);
865} 866}