Skip to content

Commit f74faec

Browse files
Finn Thainmpe
authored andcommitted
m68k/mac: Replace via-maciisi driver with via-cuda driver
Change the device probe test in the via-cuda.c driver so it will load on Egret-based machines too. Remove the now redundant via-maciisi.c driver. Tested-by: Stan Johnson <[email protected]> Signed-off-by: Finn Thain <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent d23eee8 commit f74faec

File tree

8 files changed

+30
-776
lines changed

8 files changed

+30
-776
lines changed

arch/m68k/include/asm/macintosh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct mac_model
3838

3939
#define MAC_ADB_NONE 0
4040
#define MAC_ADB_II 1
41-
#define MAC_ADB_IISI 2
41+
#define MAC_ADB_EGRET 2
4242
#define MAC_ADB_CUDA 3
4343
#define MAC_ADB_PB1 4
4444
#define MAC_ADB_PB2 5

arch/m68k/mac/config.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static struct mac_model mac_data_table[] = {
286286
}, {
287287
.ident = MAC_MODEL_IISI,
288288
.name = "IIsi",
289-
.adb_type = MAC_ADB_IISI,
289+
.adb_type = MAC_ADB_EGRET,
290290
.via_type = MAC_VIA_IICI,
291291
.scsi_type = MAC_SCSI_OLD,
292292
.scc_type = MAC_SCC_II,
@@ -295,7 +295,7 @@ static struct mac_model mac_data_table[] = {
295295
}, {
296296
.ident = MAC_MODEL_IIVI,
297297
.name = "IIvi",
298-
.adb_type = MAC_ADB_IISI,
298+
.adb_type = MAC_ADB_EGRET,
299299
.via_type = MAC_VIA_IICI,
300300
.scsi_type = MAC_SCSI_LC,
301301
.scc_type = MAC_SCC_II,
@@ -304,7 +304,7 @@ static struct mac_model mac_data_table[] = {
304304
}, {
305305
.ident = MAC_MODEL_IIVX,
306306
.name = "IIvx",
307-
.adb_type = MAC_ADB_IISI,
307+
.adb_type = MAC_ADB_EGRET,
308308
.via_type = MAC_VIA_IICI,
309309
.scsi_type = MAC_SCSI_LC,
310310
.scc_type = MAC_SCC_II,
@@ -319,7 +319,7 @@ static struct mac_model mac_data_table[] = {
319319
{
320320
.ident = MAC_MODEL_CLII,
321321
.name = "Classic II",
322-
.adb_type = MAC_ADB_IISI,
322+
.adb_type = MAC_ADB_EGRET,
323323
.via_type = MAC_VIA_IICI,
324324
.scsi_type = MAC_SCSI_LC,
325325
.scc_type = MAC_SCC_II,
@@ -352,7 +352,7 @@ static struct mac_model mac_data_table[] = {
352352
{
353353
.ident = MAC_MODEL_LC,
354354
.name = "LC",
355-
.adb_type = MAC_ADB_IISI,
355+
.adb_type = MAC_ADB_EGRET,
356356
.via_type = MAC_VIA_IICI,
357357
.scsi_type = MAC_SCSI_LC,
358358
.scc_type = MAC_SCC_II,
@@ -361,7 +361,7 @@ static struct mac_model mac_data_table[] = {
361361
}, {
362362
.ident = MAC_MODEL_LCII,
363363
.name = "LC II",
364-
.adb_type = MAC_ADB_IISI,
364+
.adb_type = MAC_ADB_EGRET,
365365
.via_type = MAC_VIA_IICI,
366366
.scsi_type = MAC_SCSI_LC,
367367
.scc_type = MAC_SCC_II,
@@ -370,7 +370,7 @@ static struct mac_model mac_data_table[] = {
370370
}, {
371371
.ident = MAC_MODEL_LCIII,
372372
.name = "LC III",
373-
.adb_type = MAC_ADB_IISI,
373+
.adb_type = MAC_ADB_EGRET,
374374
.via_type = MAC_VIA_IICI,
375375
.scsi_type = MAC_SCSI_LC,
376376
.scc_type = MAC_SCC_II,
@@ -498,7 +498,7 @@ static struct mac_model mac_data_table[] = {
498498
{
499499
.ident = MAC_MODEL_P460,
500500
.name = "Performa 460",
501-
.adb_type = MAC_ADB_IISI,
501+
.adb_type = MAC_ADB_EGRET,
502502
.via_type = MAC_VIA_IICI,
503503
.scsi_type = MAC_SCSI_LC,
504504
.scc_type = MAC_SCC_II,
@@ -575,7 +575,7 @@ static struct mac_model mac_data_table[] = {
575575
}, {
576576
.ident = MAC_MODEL_P600,
577577
.name = "Performa 600",
578-
.adb_type = MAC_ADB_IISI,
578+
.adb_type = MAC_ADB_EGRET,
579579
.via_type = MAC_VIA_IICI,
580580
.scsi_type = MAC_SCSI_LC,
581581
.scc_type = MAC_SCC_II,

arch/m68k/mac/misc.c

Lines changed: 8 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -142,54 +142,6 @@ static void pmu_write_pram(int offset, __u8 data)
142142
#define pmu_write_pram NULL
143143
#endif
144144

145-
#if 0 /* def CONFIG_ADB_MACIISI */
146-
extern int maciisi_request(struct adb_request *req,
147-
void (*done)(struct adb_request *), int nbytes, ...);
148-
149-
static long maciisi_read_time(void)
150-
{
151-
struct adb_request req;
152-
long time;
153-
154-
if (maciisi_request(&req, NULL, 2, CUDA_PACKET, CUDA_GET_TIME))
155-
return 0;
156-
157-
time = (req.reply[3] << 24) | (req.reply[4] << 16)
158-
| (req.reply[5] << 8) | req.reply[6];
159-
return time - RTC_OFFSET;
160-
}
161-
162-
static void maciisi_write_time(long data)
163-
{
164-
struct adb_request req;
165-
data += RTC_OFFSET;
166-
maciisi_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME,
167-
(data >> 24) & 0xFF, (data >> 16) & 0xFF,
168-
(data >> 8) & 0xFF, data & 0xFF);
169-
}
170-
171-
static __u8 maciisi_read_pram(int offset)
172-
{
173-
struct adb_request req;
174-
if (maciisi_request(&req, NULL, 4, CUDA_PACKET, CUDA_GET_PRAM,
175-
(offset >> 8) & 0xFF, offset & 0xFF))
176-
return 0;
177-
return req.reply[3];
178-
}
179-
180-
static void maciisi_write_pram(int offset, __u8 data)
181-
{
182-
struct adb_request req;
183-
maciisi_request(&req, NULL, 5, CUDA_PACKET, CUDA_SET_PRAM,
184-
(offset >> 8) & 0xFF, offset & 0xFF, data);
185-
}
186-
#else
187-
#define maciisi_read_time() 0
188-
#define maciisi_write_time(n)
189-
#define maciisi_read_pram NULL
190-
#define maciisi_write_pram NULL
191-
#endif
192-
193145
/*
194146
* VIA PRAM/RTC access routines
195147
*
@@ -458,11 +410,10 @@ void mac_pram_read(int offset, __u8 *buffer, int len)
458410
int i;
459411

460412
switch(macintosh_config->adb_type) {
461-
case MAC_ADB_IISI:
462-
func = maciisi_read_pram; break;
463413
case MAC_ADB_PB1:
464414
case MAC_ADB_PB2:
465415
func = pmu_read_pram; break;
416+
case MAC_ADB_EGRET:
466417
case MAC_ADB_CUDA:
467418
func = cuda_read_pram; break;
468419
default:
@@ -481,11 +432,10 @@ void mac_pram_write(int offset, __u8 *buffer, int len)
481432
int i;
482433

483434
switch(macintosh_config->adb_type) {
484-
case MAC_ADB_IISI:
485-
func = maciisi_write_pram; break;
486435
case MAC_ADB_PB1:
487436
case MAC_ADB_PB2:
488437
func = pmu_write_pram; break;
438+
case MAC_ADB_EGRET:
489439
case MAC_ADB_CUDA:
490440
func = cuda_write_pram; break;
491441
default:
@@ -500,17 +450,13 @@ void mac_pram_write(int offset, __u8 *buffer, int len)
500450

501451
void mac_poweroff(void)
502452
{
503-
/*
504-
* MAC_ADB_IISI may need to be moved up here if it doesn't actually
505-
* work using the ADB packet method. --David Kilzer
506-
*/
507-
508453
if (oss_present) {
509454
oss_shutdown();
510455
} else if (macintosh_config->adb_type == MAC_ADB_II) {
511456
via_shutdown();
512457
#ifdef CONFIG_ADB_CUDA
513-
} else if (macintosh_config->adb_type == MAC_ADB_CUDA) {
458+
} else if (macintosh_config->adb_type == MAC_ADB_EGRET ||
459+
macintosh_config->adb_type == MAC_ADB_CUDA) {
514460
cuda_shutdown();
515461
#endif
516462
#ifdef CONFIG_ADB_PMU68K
@@ -550,7 +496,8 @@ void mac_reset(void)
550496
local_irq_restore(flags);
551497
}
552498
#ifdef CONFIG_ADB_CUDA
553-
} else if (macintosh_config->adb_type == MAC_ADB_CUDA) {
499+
} else if (macintosh_config->adb_type == MAC_ADB_EGRET ||
500+
macintosh_config->adb_type == MAC_ADB_CUDA) {
554501
cuda_restart();
555502
#endif
556503
#ifdef CONFIG_ADB_PMU68K
@@ -699,13 +646,11 @@ int mac_hwclk(int op, struct rtc_time *t)
699646
case MAC_ADB_IOP:
700647
now = via_read_time();
701648
break;
702-
case MAC_ADB_IISI:
703-
now = maciisi_read_time();
704-
break;
705649
case MAC_ADB_PB1:
706650
case MAC_ADB_PB2:
707651
now = pmu_read_time();
708652
break;
653+
case MAC_ADB_EGRET:
709654
case MAC_ADB_CUDA:
710655
now = cuda_read_time();
711656
break;
@@ -737,15 +682,14 @@ int mac_hwclk(int op, struct rtc_time *t)
737682
case MAC_ADB_IOP:
738683
via_write_time(now);
739684
break;
685+
case MAC_ADB_EGRET:
740686
case MAC_ADB_CUDA:
741687
cuda_write_time(now);
742688
break;
743689
case MAC_ADB_PB1:
744690
case MAC_ADB_PB2:
745691
pmu_write_time(now);
746692
break;
747-
case MAC_ADB_IISI:
748-
maciisi_write_time(now);
749693
}
750694
}
751695
return 0;

drivers/macintosh/Kconfig

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ config ADB_MACII
3030
Quadra 610, Quadra 650, Quadra 700, Quadra 800, Centris 610 and
3131
Centris 650.
3232

33-
config ADB_MACIISI
34-
bool "Include Mac IIsi ADB driver"
35-
depends on ADB && MAC && BROKEN
36-
help
37-
Say Y here if want your kernel to support Macintosh systems that use
38-
the Mac IIsi style ADB. This includes the IIsi, IIvi, IIvx, Classic
39-
II, LC, LC II, LC III, Performa 460, and the Performa 600.
40-
4133
config ADB_IOP
4234
bool "Include IOP (IIfx/Quadra 9x0) ADB driver"
4335
depends on ADB && MAC
@@ -60,17 +52,15 @@ config ADB_PMU68K
6052

6153
# we want to change this to something like CONFIG_SYSCTRL_CUDA/PMU
6254
config ADB_CUDA
63-
bool "Support for CUDA based Macs and PowerMacs"
55+
bool "Support for Cuda/Egret based Macs and PowerMacs"
6456
depends on (ADB || PPC_PMAC) && !PPC_PMAC64
6557
help
66-
This provides support for CUDA based Macintosh and Power Macintosh
67-
systems. This includes many m68k based Macs (Color Classic, Mac TV,
68-
Performa 475, Performa 520, Performa 550, Performa 575,
69-
Performa 588, Quadra 605, Quadra 630, Quadra/Centris 660AV, and
70-
Quadra 840AV), most OldWorld PowerMacs, the first generation iMacs,
71-
the Blue&White G3 and the "Yikes" G4 (PCI Graphics). All later
72-
models should use CONFIG_ADB_PMU instead. It is safe to say Y here
73-
even if your machine doesn't have a CUDA.
58+
This provides support for Cuda/Egret based Macintosh and
59+
Power Macintosh systems. This includes most m68k based Macs,
60+
most Old World PowerMacs, the first generation iMacs, the
61+
Blue & White G3 and the "Yikes" G4 (PCI Graphics). All later
62+
models should use CONFIG_ADB_PMU instead. It is safe to say Y
63+
here even if your machine doesn't have a Cuda or Egret device.
7464

7565
If unsure say Y.
7666

drivers/macintosh/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ obj-$(CONFIG_PMAC_SMU) += smu.o
2020

2121
obj-$(CONFIG_ADB) += adb.o
2222
obj-$(CONFIG_ADB_MACII) += via-macii.o
23-
obj-$(CONFIG_ADB_MACIISI) += via-maciisi.o
2423
obj-$(CONFIG_ADB_IOP) += adb-iop.o
2524
obj-$(CONFIG_ADB_PMU68K) += via-pmu68k.o
2625
obj-$(CONFIG_ADB_MACIO) += macio-adb.o

drivers/macintosh/adb.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
EXPORT_SYMBOL(adb_client_list);
4949

5050
extern struct adb_driver via_macii_driver;
51-
extern struct adb_driver via_maciisi_driver;
5251
extern struct adb_driver via_cuda_driver;
5352
extern struct adb_driver adb_iop_driver;
5453
extern struct adb_driver via_pmu_driver;
@@ -59,9 +58,6 @@ static struct adb_driver *adb_driver_list[] = {
5958
#ifdef CONFIG_ADB_MACII
6059
&via_macii_driver,
6160
#endif
62-
#ifdef CONFIG_ADB_MACIISI
63-
&via_maciisi_driver,
64-
#endif
6561
#ifdef CONFIG_ADB_CUDA
6662
&via_cuda_driver,
6763
#endif

drivers/macintosh/via-cuda.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,13 @@ int __init find_via_cuda(void)
205205
struct adb_request req;
206206
int err;
207207

208-
if (macintosh_config->adb_type != MAC_ADB_CUDA)
208+
if (macintosh_config->adb_type != MAC_ADB_CUDA &&
209+
macintosh_config->adb_type != MAC_ADB_EGRET)
209210
return 0;
210211

211212
via = via1;
212213
cuda_state = idle;
213-
mcu_is_egret = false;
214+
mcu_is_egret = macintosh_config->adb_type == MAC_ADB_EGRET;
214215

215216
err = cuda_init_via();
216217
if (err) {
@@ -323,7 +324,8 @@ cuda_probe(void)
323324
if (sys_ctrler != SYS_CTRLER_CUDA)
324325
return -ENODEV;
325326
#else
326-
if (macintosh_config->adb_type != MAC_ADB_CUDA)
327+
if (macintosh_config->adb_type != MAC_ADB_CUDA &&
328+
macintosh_config->adb_type != MAC_ADB_EGRET)
327329
return -ENODEV;
328330
#endif
329331
if (via == NULL)

0 commit comments

Comments
 (0)