aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/mac
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2008-07-17 15:16:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-20 20:24:39 -0400
commit8dfbdf4abad6e5a7bbd097bf7e2c0ec41e0c54b4 (patch)
tree37e8208051453eb1bb85d0602161e827d95cf38e /arch/m68k/mac
parent5575d0a3c9676b2886adad67dd4b2ac126a49f1f (diff)
m68k/mac/: possible cleanups
This patch contains the following possible cleanups: - make the following needlessly global code (always) static: - baboon.c: struct baboon - baboon.c: baboon_irq() - config.c: mac_orig_videoaddr - config.c: mac_identify() - config.c: mac_report_hardware() - config.c: mac_debug_console_write() - config.c: mac_sccb_console_write() - config.c: mac_scca_console_write() - config.c: mac_init_scc_port() - oss.c: oss_irq() - oss.c: oss_nubus_irq() - psc.c: psc_debug_dump() - psc.c: psc_dma_die_die_die() - via.c: rbv_clear - remove the unused bootparse.c - #if 0 the following unused functions: - config.c: mac_debugging_short() - config.c: mac_debugging_long() - remove the following unused code: - config.c: mac_bisize - config.c: mac_env - config.c: mac_SCC_init_done - config.c: mac_SCC_reset_done - config.c: mac_init_scca_port() - config.c: mac_init_sccb_port() Signed-off-by: Adrian Bunk <bunk@kernel.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')
-rw-r--r--arch/m68k/mac/Makefile2
-rw-r--r--arch/m68k/mac/baboon.c26
-rw-r--r--arch/m68k/mac/bootparse.c122
-rw-r--r--arch/m68k/mac/config.c11
-rw-r--r--arch/m68k/mac/debug.c41
-rw-r--r--arch/m68k/mac/oss.c8
-rw-r--r--arch/m68k/mac/psc.c4
-rw-r--r--arch/m68k/mac/via.c2
8 files changed, 35 insertions, 181 deletions
diff --git a/arch/m68k/mac/Makefile b/arch/m68k/mac/Makefile
index 1d265ba365ad..daebd80bdef0 100644
--- a/arch/m68k/mac/Makefile
+++ b/arch/m68k/mac/Makefile
@@ -2,5 +2,5 @@
2# Makefile for Linux arch/m68k/mac source directory 2# Makefile for Linux arch/m68k/mac source directory
3# 3#
4 4
5obj-y := config.o bootparse.o macints.o iop.o via.o oss.o psc.o \ 5obj-y := config.o macints.o iop.o via.o oss.o psc.o \
6 baboon.o macboing.o debug.o misc.o 6 baboon.o macboing.o debug.o misc.o
diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c
index 673a1085984d..dae9c982aa89 100644
--- a/arch/m68k/mac/baboon.c
+++ b/arch/m68k/mac/baboon.c
@@ -23,9 +23,7 @@
23/* #define DEBUG_IRQS */ 23/* #define DEBUG_IRQS */
24 24
25int baboon_present; 25int baboon_present;
26volatile struct baboon *baboon; 26static volatile struct baboon *baboon;
27
28irqreturn_t baboon_irq(int, void *);
29 27
30#if 0 28#if 0
31extern int macide_ack_intr(struct ata_channel *); 29extern int macide_ack_intr(struct ata_channel *);
@@ -50,20 +48,10 @@ void __init baboon_init(void)
50} 48}
51 49
52/* 50/*
53 * Register the Baboon interrupt dispatcher on nubus slot $C.
54 */
55
56void __init baboon_register_interrupts(void)
57{
58 request_irq(IRQ_NUBUS_C, baboon_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
59 "baboon", (void *) baboon);
60}
61
62/*
63 * Baboon interrupt handler. This works a lot like a VIA. 51 * Baboon interrupt handler. This works a lot like a VIA.
64 */ 52 */
65 53
66irqreturn_t baboon_irq(int irq, void *dev_id) 54static irqreturn_t baboon_irq(int irq, void *dev_id)
67{ 55{
68 int irq_bit, irq_num; 56 int irq_bit, irq_num;
69 unsigned char events; 57 unsigned char events;
@@ -95,6 +83,16 @@ irqreturn_t baboon_irq(int irq, void *dev_id)
95 return IRQ_HANDLED; 83 return IRQ_HANDLED;
96} 84}
97 85
86/*
87 * Register the Baboon interrupt dispatcher on nubus slot $C.
88 */
89
90void __init baboon_register_interrupts(void)
91{
92 request_irq(IRQ_NUBUS_C, baboon_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
93 "baboon", (void *) baboon);
94}
95
98void baboon_irq_enable(int irq) { 96void baboon_irq_enable(int irq) {
99#ifdef DEBUG_IRQUSE 97#ifdef DEBUG_IRQUSE
100 printk("baboon_irq_enable(%d)\n", irq); 98 printk("baboon_irq_enable(%d)\n", irq);
diff --git a/arch/m68k/mac/bootparse.c b/arch/m68k/mac/bootparse.c
deleted file mode 100644
index 36d223609823..000000000000
--- a/arch/m68k/mac/bootparse.c
+++ /dev/null
@@ -1,122 +0,0 @@
1#include <linux/string.h>
2#include <linux/kernel.h>
3#include <linux/sched.h>
4#include <asm/irq.h>
5#include <asm/setup.h>
6#include <asm/bootinfo.h>
7#include <asm/macintosh.h>
8
9/*
10 * Booter vars
11 */
12
13int boothowto;
14int _boothowto;
15
16/*
17 * Called early to parse the environment (passed to us from the booter)
18 * into a bootinfo struct. Will die as soon as we have our own booter
19 */
20
21#define atol(x) simple_strtoul(x,NULL,0)
22
23void parse_booter(char *env)
24{
25 char *name;
26 char *value;
27#if 0
28 while(0 && *env)
29#else
30 while(*env)
31#endif
32 {
33 name=env;
34 value=name;
35 while(*value!='='&&*value)
36 value++;
37 if(*value=='=')
38 *value++=0;
39 env=value;
40 while(*env)
41 env++;
42 env++;
43#if 0
44 if(strcmp(name,"VIDEO_ADDR")==0)
45 mac_mch.videoaddr=atol(value);
46 if(strcmp(name,"ROW_BYTES")==0)
47 mac_mch.videorow=atol(value);
48 if(strcmp(name,"SCREEN_DEPTH")==0)
49 mac_mch.videodepth=atol(value);
50 if(strcmp(name,"DIMENSIONS")==0)
51 mac_mch.dimensions=atol(value);
52#endif
53 if(strcmp(name,"BOOTTIME")==0)
54 mac_bi_data.boottime=atol(value);
55 if(strcmp(name,"GMTBIAS")==0)
56 mac_bi_data.gmtbias=atol(value);
57 if(strcmp(name,"BOOTERVER")==0)
58 mac_bi_data.bootver=atol(value);
59 if(strcmp(name,"MACOS_VIDEO")==0)
60 mac_bi_data.videological=atol(value);
61 if(strcmp(name,"MACOS_SCC")==0)
62 mac_bi_data.sccbase=atol(value);
63 if(strcmp(name,"MACHINEID")==0)
64 mac_bi_data.id=atol(value);
65 if(strcmp(name,"MEMSIZE")==0)
66 mac_bi_data.memsize=atol(value);
67 if(strcmp(name,"SERIAL_MODEM_FLAGS")==0)
68 mac_bi_data.serialmf=atol(value);
69 if(strcmp(name,"SERIAL_MODEM_HSKICLK")==0)
70 mac_bi_data.serialhsk=atol(value);
71 if(strcmp(name,"SERIAL_MODEM_GPICLK")==0)
72 mac_bi_data.serialgpi=atol(value);
73 if(strcmp(name,"SERIAL_PRINT_FLAGS")==0)
74 mac_bi_data.printmf=atol(value);
75 if(strcmp(name,"SERIAL_PRINT_HSKICLK")==0)
76 mac_bi_data.printhsk=atol(value);
77 if(strcmp(name,"SERIAL_PRINT_GPICLK")==0)
78 mac_bi_data.printgpi=atol(value);
79 if(strcmp(name,"PROCESSOR")==0)
80 mac_bi_data.cpuid=atol(value);
81 if(strcmp(name,"ROMBASE")==0)
82 mac_bi_data.rombase=atol(value);
83 if(strcmp(name,"TIMEDBRA")==0)
84 mac_bi_data.timedbra=atol(value);
85 if(strcmp(name,"ADBDELAY")==0)
86 mac_bi_data.adbdelay=atol(value);
87 }
88#if 0 /* XXX: TODO with m68k_mach_* */
89 /* Fill in the base stuff */
90 boot_info.machtype=MACH_MAC;
91 /* Read this from the macinfo we got ! */
92/* boot_info.cputype=CPU_68020|FPUB_68881;*/
93/* boot_info.memory[0].addr=0;*/
94/* boot_info.memory[0].size=((mac_bi_data.id>>7)&31)<<20;*/
95 boot_info.num_memory=1; /* On a MacII */
96 boot_info.ramdisk_size=0; /* For now */
97 *boot_info.command_line=0;
98#endif
99 }
100
101
102void print_booter(char *env)
103{
104 char *name;
105 char *value;
106 while(*env)
107 {
108 name=env;
109 value=name;
110 while(*value!='='&&*value)
111 value++;
112 if(*value=='=')
113 *value++=0;
114 env=value;
115 while(*env)
116 env++;
117 env++;
118 printk("%s=%s\n", name,value);
119 }
120 }
121
122
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index ad3e3bacae39..c45e18449f32 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -46,7 +46,6 @@
46/* Mac bootinfo struct */ 46/* Mac bootinfo struct */
47 47
48struct mac_booter_data mac_bi_data; 48struct mac_booter_data mac_bi_data;
49int mac_bisize = sizeof mac_bi_data;
50 49
51/* New m68k bootinfo stuff and videobase */ 50/* New m68k bootinfo stuff and videobase */
52 51
@@ -55,10 +54,8 @@ extern struct mem_info m68k_memory[NUM_MEMINFO];
55 54
56extern struct mem_info m68k_ramdisk; 55extern struct mem_info m68k_ramdisk;
57 56
58void *mac_env; /* Loaded by the boot asm */
59
60/* The phys. video addr. - might be bogus on some machines */ 57/* The phys. video addr. - might be bogus on some machines */
61unsigned long mac_orig_videoaddr; 58static unsigned long mac_orig_videoaddr;
62 59
63/* Mac specific timer functions */ 60/* Mac specific timer functions */
64extern unsigned long mac_gettimeoffset(void); 61extern unsigned long mac_gettimeoffset(void);
@@ -79,6 +76,8 @@ extern void mac_mksound(unsigned int, unsigned int);
79extern void nubus_sweep_video(void); 76extern void nubus_sweep_video(void);
80 77
81static void mac_get_model(char *str); 78static void mac_get_model(char *str);
79static void mac_identify(void);
80static void mac_report_hardware(void);
82 81
83static void __init mac_sched_init(irq_handler_t vector) 82static void __init mac_sched_init(irq_handler_t vector)
84{ 83{
@@ -765,7 +764,7 @@ static struct mac_model mac_data_table[] = {
765 } 764 }
766}; 765};
767 766
768void __init mac_identify(void) 767static void __init mac_identify(void)
769{ 768{
770 struct mac_model *m; 769 struct mac_model *m;
771 770
@@ -821,7 +820,7 @@ void __init mac_identify(void)
821 baboon_init(); 820 baboon_init();
822} 821}
823 822
824void __init mac_report_hardware(void) 823static void __init mac_report_hardware(void)
825{ 824{
826 printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name); 825 printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name);
827} 826}
diff --git a/arch/m68k/mac/debug.c b/arch/m68k/mac/debug.c
index e8a57138b4a6..2165740786a5 100644
--- a/arch/m68k/mac/debug.c
+++ b/arch/m68k/mac/debug.c
@@ -51,6 +51,8 @@ extern void mac_serial_print(const char *);
51static int peng, line; 51static int peng, line;
52#endif 52#endif
53 53
54#if 0
55
54void mac_debugging_short(int pos, short num) 56void mac_debugging_short(int pos, short num)
55{ 57{
56#ifdef DEBUG_SCREEN 58#ifdef DEBUG_SCREEN
@@ -125,6 +127,8 @@ void mac_debugging_long(int pos, long addr)
125#endif 127#endif
126} 128}
127 129
130#endif /* 0 */
131
128#ifdef DEBUG_SERIAL 132#ifdef DEBUG_SERIAL
129/* 133/*
130 * TODO: serial debug code 134 * TODO: serial debug code
@@ -142,12 +146,6 @@ struct mac_SCC {
142 146
143# define scc (*((volatile struct mac_SCC*)mac_bi_data.sccbase)) 147# define scc (*((volatile struct mac_SCC*)mac_bi_data.sccbase))
144 148
145/* Flag that serial port is already initialized and used */
146int mac_SCC_init_done;
147/* Can be set somewhere, if a SCC master reset has already be done and should
148 * not be repeated; used by kgdb */
149int mac_SCC_reset_done;
150
151static int scc_port = -1; 149static int scc_port = -1;
152 150
153static struct console mac_console_driver = { 151static struct console mac_console_driver = {
@@ -171,8 +169,8 @@ static struct console mac_console_driver = {
171 * this driver if Mac. 169 * this driver if Mac.
172 */ 170 */
173 171
174void mac_debug_console_write(struct console *co, const char *str, 172static void mac_debug_console_write(struct console *co, const char *str,
175 unsigned int count) 173 unsigned int count)
176{ 174{
177 mac_serial_print(str); 175 mac_serial_print(str);
178} 176}
@@ -209,8 +207,8 @@ static inline void mac_scca_out(char c)
209 scc.cha_a_data = c; 207 scc.cha_a_data = c;
210} 208}
211 209
212void mac_sccb_console_write(struct console *co, const char *str, 210static void mac_sccb_console_write(struct console *co, const char *str,
213 unsigned int count) 211 unsigned int count)
214{ 212{
215 while (count--) { 213 while (count--) {
216 if (*str == '\n') 214 if (*str == '\n')
@@ -219,8 +217,8 @@ void mac_sccb_console_write(struct console *co, const char *str,
219 } 217 }
220} 218}
221 219
222void mac_scca_console_write(struct console *co, const char *str, 220static void mac_scca_console_write(struct console *co, const char *str,
223 unsigned int count) 221 unsigned int count)
224{ 222{
225 while (count--) { 223 while (count--) {
226 if (*str == '\n') 224 if (*str == '\n')
@@ -265,14 +263,8 @@ void mac_scca_console_write(struct console *co, const char *str,
265 barrier(); \ 263 barrier(); \
266 } while(0) 264 } while(0)
267 265
268#ifndef CONFIG_SERIAL_CONSOLE
269static void __init mac_init_scc_port(int cflag, int port) 266static void __init mac_init_scc_port(int cflag, int port)
270#else
271void mac_init_scc_port(int cflag, int port)
272#endif
273{ 267{
274 extern int mac_SCC_reset_done;
275
276 /* 268 /*
277 * baud rates: 1200, 1800, 2400, 4800, 9600, 19.2k, 38.4k, 57.6k, 115.2k 269 * baud rates: 1200, 1800, 2400, 4800, 9600, 19.2k, 38.4k, 57.6k, 115.2k
278 */ 270 */
@@ -340,22 +332,9 @@ void mac_init_scc_port(int cflag, int port)
340 SCCA_WRITE(3, reg3 | 1); 332 SCCA_WRITE(3, reg3 | 1);
341 SCCA_WRITE(5, reg5 | 8); 333 SCCA_WRITE(5, reg5 | 8);
342 } 334 }
343
344 mac_SCC_reset_done = 1;
345 mac_SCC_init_done = 1;
346} 335}
347#endif /* DEBUG_SERIAL */ 336#endif /* DEBUG_SERIAL */
348 337
349void mac_init_scca_port(int cflag)
350{
351 mac_init_scc_port(cflag, 0);
352}
353
354void mac_init_sccb_port(int cflag)
355{
356 mac_init_scc_port(cflag, 1);
357}
358
359static int __init mac_debug_setup(char *arg) 338static int __init mac_debug_setup(char *arg)
360{ 339{
361 if (!MACH_IS_MAC) 340 if (!MACH_IS_MAC)
diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c
index 3c943d2ec570..43d83e054b8e 100644
--- a/arch/m68k/mac/oss.c
+++ b/arch/m68k/mac/oss.c
@@ -30,8 +30,8 @@
30int oss_present; 30int oss_present;
31volatile struct mac_oss *oss; 31volatile struct mac_oss *oss;
32 32
33irqreturn_t oss_irq(int, void *); 33static irqreturn_t oss_irq(int, void *);
34irqreturn_t oss_nubus_irq(int, void *); 34static irqreturn_t oss_nubus_irq(int, void *);
35 35
36extern irqreturn_t via1_irq(int, void *); 36extern irqreturn_t via1_irq(int, void *);
37extern irqreturn_t mac_scc_dispatch(int, void *); 37extern irqreturn_t mac_scc_dispatch(int, void *);
@@ -92,7 +92,7 @@ void __init oss_nubus_init(void)
92 * and SCSI; everything else is routed to its own autovector IRQ. 92 * and SCSI; everything else is routed to its own autovector IRQ.
93 */ 93 */
94 94
95irqreturn_t oss_irq(int irq, void *dev_id) 95static irqreturn_t oss_irq(int irq, void *dev_id)
96{ 96{
97 int events; 97 int events;
98 98
@@ -126,7 +126,7 @@ irqreturn_t oss_irq(int irq, void *dev_id)
126 * Unlike the VIA/RBV this is on its own autovector interrupt level. 126 * Unlike the VIA/RBV this is on its own autovector interrupt level.
127 */ 127 */
128 128
129irqreturn_t oss_nubus_irq(int irq, void *dev_id) 129static irqreturn_t oss_nubus_irq(int irq, void *dev_id)
130{ 130{
131 int events, irq_bit, i; 131 int events, irq_bit, i;
132 132
diff --git a/arch/m68k/mac/psc.c b/arch/m68k/mac/psc.c
index d66f723b17c3..f84a4dd64f94 100644
--- a/arch/m68k/mac/psc.c
+++ b/arch/m68k/mac/psc.c
@@ -36,7 +36,7 @@ irqreturn_t psc_irq(int, void *);
36 * Debugging dump, used in various places to see what's going on. 36 * Debugging dump, used in various places to see what's going on.
37 */ 37 */
38 38
39void psc_debug_dump(void) 39static void psc_debug_dump(void)
40{ 40{
41 int i; 41 int i;
42 42
@@ -55,7 +55,7 @@ void psc_debug_dump(void)
55 * expanded to cover what I think are the other 7 channels. 55 * expanded to cover what I think are the other 7 channels.
56 */ 56 */
57 57
58void psc_dma_die_die_die(void) 58static void psc_dma_die_die_die(void)
59{ 59{
60 int i; 60 int i;
61 61
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c
index fa485df4160e..f3b27d04a31f 100644
--- a/arch/m68k/mac/via.c
+++ b/arch/m68k/mac/via.c
@@ -45,7 +45,7 @@ volatile long *via_memory_bogon=(long *)&via_memory_bogon;
45int rbv_present; 45int rbv_present;
46int via_alt_mapping; 46int via_alt_mapping;
47EXPORT_SYMBOL(via_alt_mapping); 47EXPORT_SYMBOL(via_alt_mapping);
48__u8 rbv_clear; 48static __u8 rbv_clear;
49 49
50/* 50/*
51 * Globals for accessing the VIA chip registers without having to 51 * Globals for accessing the VIA chip registers without having to