Commit f74faec6 authored by Finn Thain's avatar Finn Thain Committed by Michael Ellerman

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: default avatarStan Johnson <userm57@yahoo.com>
Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent d23eee88
...@@ -38,7 +38,7 @@ struct mac_model ...@@ -38,7 +38,7 @@ struct mac_model
#define MAC_ADB_NONE 0 #define MAC_ADB_NONE 0
#define MAC_ADB_II 1 #define MAC_ADB_II 1
#define MAC_ADB_IISI 2 #define MAC_ADB_EGRET 2
#define MAC_ADB_CUDA 3 #define MAC_ADB_CUDA 3
#define MAC_ADB_PB1 4 #define MAC_ADB_PB1 4
#define MAC_ADB_PB2 5 #define MAC_ADB_PB2 5
......
...@@ -286,7 +286,7 @@ static struct mac_model mac_data_table[] = { ...@@ -286,7 +286,7 @@ static struct mac_model mac_data_table[] = {
}, { }, {
.ident = MAC_MODEL_IISI, .ident = MAC_MODEL_IISI,
.name = "IIsi", .name = "IIsi",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_EGRET,
.via_type = MAC_VIA_IICI, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_OLD, .scsi_type = MAC_SCSI_OLD,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
...@@ -295,7 +295,7 @@ static struct mac_model mac_data_table[] = { ...@@ -295,7 +295,7 @@ static struct mac_model mac_data_table[] = {
}, { }, {
.ident = MAC_MODEL_IIVI, .ident = MAC_MODEL_IIVI,
.name = "IIvi", .name = "IIvi",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_EGRET,
.via_type = MAC_VIA_IICI, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_LC, .scsi_type = MAC_SCSI_LC,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
...@@ -304,7 +304,7 @@ static struct mac_model mac_data_table[] = { ...@@ -304,7 +304,7 @@ static struct mac_model mac_data_table[] = {
}, { }, {
.ident = MAC_MODEL_IIVX, .ident = MAC_MODEL_IIVX,
.name = "IIvx", .name = "IIvx",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_EGRET,
.via_type = MAC_VIA_IICI, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_LC, .scsi_type = MAC_SCSI_LC,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
...@@ -319,7 +319,7 @@ static struct mac_model mac_data_table[] = { ...@@ -319,7 +319,7 @@ static struct mac_model mac_data_table[] = {
{ {
.ident = MAC_MODEL_CLII, .ident = MAC_MODEL_CLII,
.name = "Classic II", .name = "Classic II",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_EGRET,
.via_type = MAC_VIA_IICI, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_LC, .scsi_type = MAC_SCSI_LC,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
...@@ -352,7 +352,7 @@ static struct mac_model mac_data_table[] = { ...@@ -352,7 +352,7 @@ static struct mac_model mac_data_table[] = {
{ {
.ident = MAC_MODEL_LC, .ident = MAC_MODEL_LC,
.name = "LC", .name = "LC",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_EGRET,
.via_type = MAC_VIA_IICI, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_LC, .scsi_type = MAC_SCSI_LC,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
...@@ -361,7 +361,7 @@ static struct mac_model mac_data_table[] = { ...@@ -361,7 +361,7 @@ static struct mac_model mac_data_table[] = {
}, { }, {
.ident = MAC_MODEL_LCII, .ident = MAC_MODEL_LCII,
.name = "LC II", .name = "LC II",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_EGRET,
.via_type = MAC_VIA_IICI, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_LC, .scsi_type = MAC_SCSI_LC,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
...@@ -370,7 +370,7 @@ static struct mac_model mac_data_table[] = { ...@@ -370,7 +370,7 @@ static struct mac_model mac_data_table[] = {
}, { }, {
.ident = MAC_MODEL_LCIII, .ident = MAC_MODEL_LCIII,
.name = "LC III", .name = "LC III",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_EGRET,
.via_type = MAC_VIA_IICI, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_LC, .scsi_type = MAC_SCSI_LC,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
...@@ -498,7 +498,7 @@ static struct mac_model mac_data_table[] = { ...@@ -498,7 +498,7 @@ static struct mac_model mac_data_table[] = {
{ {
.ident = MAC_MODEL_P460, .ident = MAC_MODEL_P460,
.name = "Performa 460", .name = "Performa 460",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_EGRET,
.via_type = MAC_VIA_IICI, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_LC, .scsi_type = MAC_SCSI_LC,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
...@@ -575,7 +575,7 @@ static struct mac_model mac_data_table[] = { ...@@ -575,7 +575,7 @@ static struct mac_model mac_data_table[] = {
}, { }, {
.ident = MAC_MODEL_P600, .ident = MAC_MODEL_P600,
.name = "Performa 600", .name = "Performa 600",
.adb_type = MAC_ADB_IISI, .adb_type = MAC_ADB_EGRET,
.via_type = MAC_VIA_IICI, .via_type = MAC_VIA_IICI,
.scsi_type = MAC_SCSI_LC, .scsi_type = MAC_SCSI_LC,
.scc_type = MAC_SCC_II, .scc_type = MAC_SCC_II,
......
...@@ -142,54 +142,6 @@ static void pmu_write_pram(int offset, __u8 data) ...@@ -142,54 +142,6 @@ static void pmu_write_pram(int offset, __u8 data)
#define pmu_write_pram NULL #define pmu_write_pram NULL
#endif #endif
#if 0 /* def CONFIG_ADB_MACIISI */
extern int maciisi_request(struct adb_request *req,
void (*done)(struct adb_request *), int nbytes, ...);
static long maciisi_read_time(void)
{
struct adb_request req;
long time;
if (maciisi_request(&req, NULL, 2, CUDA_PACKET, CUDA_GET_TIME))
return 0;
time = (req.reply[3] << 24) | (req.reply[4] << 16)
| (req.reply[5] << 8) | req.reply[6];
return time - RTC_OFFSET;
}
static void maciisi_write_time(long data)
{
struct adb_request req;
data += RTC_OFFSET;
maciisi_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME,
(data >> 24) & 0xFF, (data >> 16) & 0xFF,
(data >> 8) & 0xFF, data & 0xFF);
}
static __u8 maciisi_read_pram(int offset)
{
struct adb_request req;
if (maciisi_request(&req, NULL, 4, CUDA_PACKET, CUDA_GET_PRAM,
(offset >> 8) & 0xFF, offset & 0xFF))
return 0;
return req.reply[3];
}
static void maciisi_write_pram(int offset, __u8 data)
{
struct adb_request req;
maciisi_request(&req, NULL, 5, CUDA_PACKET, CUDA_SET_PRAM,
(offset >> 8) & 0xFF, offset & 0xFF, data);
}
#else
#define maciisi_read_time() 0
#define maciisi_write_time(n)
#define maciisi_read_pram NULL
#define maciisi_write_pram NULL
#endif
/* /*
* VIA PRAM/RTC access routines * VIA PRAM/RTC access routines
* *
...@@ -458,11 +410,10 @@ void mac_pram_read(int offset, __u8 *buffer, int len) ...@@ -458,11 +410,10 @@ void mac_pram_read(int offset, __u8 *buffer, int len)
int i; int i;
switch(macintosh_config->adb_type) { switch(macintosh_config->adb_type) {
case MAC_ADB_IISI:
func = maciisi_read_pram; break;
case MAC_ADB_PB1: case MAC_ADB_PB1:
case MAC_ADB_PB2: case MAC_ADB_PB2:
func = pmu_read_pram; break; func = pmu_read_pram; break;
case MAC_ADB_EGRET:
case MAC_ADB_CUDA: case MAC_ADB_CUDA:
func = cuda_read_pram; break; func = cuda_read_pram; break;
default: default:
...@@ -481,11 +432,10 @@ void mac_pram_write(int offset, __u8 *buffer, int len) ...@@ -481,11 +432,10 @@ void mac_pram_write(int offset, __u8 *buffer, int len)
int i; int i;
switch(macintosh_config->adb_type) { switch(macintosh_config->adb_type) {
case MAC_ADB_IISI:
func = maciisi_write_pram; break;
case MAC_ADB_PB1: case MAC_ADB_PB1:
case MAC_ADB_PB2: case MAC_ADB_PB2:
func = pmu_write_pram; break; func = pmu_write_pram; break;
case MAC_ADB_EGRET:
case MAC_ADB_CUDA: case MAC_ADB_CUDA:
func = cuda_write_pram; break; func = cuda_write_pram; break;
default: default:
...@@ -500,17 +450,13 @@ void mac_pram_write(int offset, __u8 *buffer, int len) ...@@ -500,17 +450,13 @@ void mac_pram_write(int offset, __u8 *buffer, int len)
void mac_poweroff(void) void mac_poweroff(void)
{ {
/*
* MAC_ADB_IISI may need to be moved up here if it doesn't actually
* work using the ADB packet method. --David Kilzer
*/
if (oss_present) { if (oss_present) {
oss_shutdown(); oss_shutdown();
} else if (macintosh_config->adb_type == MAC_ADB_II) { } else if (macintosh_config->adb_type == MAC_ADB_II) {
via_shutdown(); via_shutdown();
#ifdef CONFIG_ADB_CUDA #ifdef CONFIG_ADB_CUDA
} else if (macintosh_config->adb_type == MAC_ADB_CUDA) { } else if (macintosh_config->adb_type == MAC_ADB_EGRET ||
macintosh_config->adb_type == MAC_ADB_CUDA) {
cuda_shutdown(); cuda_shutdown();
#endif #endif
#ifdef CONFIG_ADB_PMU68K #ifdef CONFIG_ADB_PMU68K
...@@ -550,7 +496,8 @@ void mac_reset(void) ...@@ -550,7 +496,8 @@ void mac_reset(void)
local_irq_restore(flags); local_irq_restore(flags);
} }
#ifdef CONFIG_ADB_CUDA #ifdef CONFIG_ADB_CUDA
} else if (macintosh_config->adb_type == MAC_ADB_CUDA) { } else if (macintosh_config->adb_type == MAC_ADB_EGRET ||
macintosh_config->adb_type == MAC_ADB_CUDA) {
cuda_restart(); cuda_restart();
#endif #endif
#ifdef CONFIG_ADB_PMU68K #ifdef CONFIG_ADB_PMU68K
...@@ -699,13 +646,11 @@ int mac_hwclk(int op, struct rtc_time *t) ...@@ -699,13 +646,11 @@ int mac_hwclk(int op, struct rtc_time *t)
case MAC_ADB_IOP: case MAC_ADB_IOP:
now = via_read_time(); now = via_read_time();
break; break;
case MAC_ADB_IISI:
now = maciisi_read_time();
break;
case MAC_ADB_PB1: case MAC_ADB_PB1:
case MAC_ADB_PB2: case MAC_ADB_PB2:
now = pmu_read_time(); now = pmu_read_time();
break; break;
case MAC_ADB_EGRET:
case MAC_ADB_CUDA: case MAC_ADB_CUDA:
now = cuda_read_time(); now = cuda_read_time();
break; break;
...@@ -737,6 +682,7 @@ int mac_hwclk(int op, struct rtc_time *t) ...@@ -737,6 +682,7 @@ int mac_hwclk(int op, struct rtc_time *t)
case MAC_ADB_IOP: case MAC_ADB_IOP:
via_write_time(now); via_write_time(now);
break; break;
case MAC_ADB_EGRET:
case MAC_ADB_CUDA: case MAC_ADB_CUDA:
cuda_write_time(now); cuda_write_time(now);
break; break;
...@@ -744,8 +690,6 @@ int mac_hwclk(int op, struct rtc_time *t) ...@@ -744,8 +690,6 @@ int mac_hwclk(int op, struct rtc_time *t)
case MAC_ADB_PB2: case MAC_ADB_PB2:
pmu_write_time(now); pmu_write_time(now);
break; break;
case MAC_ADB_IISI:
maciisi_write_time(now);
} }
} }
return 0; return 0;
......
...@@ -30,14 +30,6 @@ config ADB_MACII ...@@ -30,14 +30,6 @@ config ADB_MACII
Quadra 610, Quadra 650, Quadra 700, Quadra 800, Centris 610 and Quadra 610, Quadra 650, Quadra 700, Quadra 800, Centris 610 and
Centris 650. Centris 650.
config ADB_MACIISI
bool "Include Mac IIsi ADB driver"
depends on ADB && MAC && BROKEN
help
Say Y here if want your kernel to support Macintosh systems that use
the Mac IIsi style ADB. This includes the IIsi, IIvi, IIvx, Classic
II, LC, LC II, LC III, Performa 460, and the Performa 600.
config ADB_IOP config ADB_IOP
bool "Include IOP (IIfx/Quadra 9x0) ADB driver" bool "Include IOP (IIfx/Quadra 9x0) ADB driver"
depends on ADB && MAC depends on ADB && MAC
...@@ -60,17 +52,15 @@ config ADB_PMU68K ...@@ -60,17 +52,15 @@ config ADB_PMU68K
# we want to change this to something like CONFIG_SYSCTRL_CUDA/PMU # we want to change this to something like CONFIG_SYSCTRL_CUDA/PMU
config ADB_CUDA config ADB_CUDA
bool "Support for CUDA based Macs and PowerMacs" bool "Support for Cuda/Egret based Macs and PowerMacs"
depends on (ADB || PPC_PMAC) && !PPC_PMAC64 depends on (ADB || PPC_PMAC) && !PPC_PMAC64
help help
This provides support for CUDA based Macintosh and Power Macintosh This provides support for Cuda/Egret based Macintosh and
systems. This includes many m68k based Macs (Color Classic, Mac TV, Power Macintosh systems. This includes most m68k based Macs,
Performa 475, Performa 520, Performa 550, Performa 575, most Old World PowerMacs, the first generation iMacs, the
Performa 588, Quadra 605, Quadra 630, Quadra/Centris 660AV, and Blue & White G3 and the "Yikes" G4 (PCI Graphics). All later
Quadra 840AV), most OldWorld PowerMacs, the first generation iMacs, models should use CONFIG_ADB_PMU instead. It is safe to say Y
the Blue&White G3 and the "Yikes" G4 (PCI Graphics). All later here even if your machine doesn't have a Cuda or Egret device.
models should use CONFIG_ADB_PMU instead. It is safe to say Y here
even if your machine doesn't have a CUDA.
If unsure say Y. If unsure say Y.
......
...@@ -20,7 +20,6 @@ obj-$(CONFIG_PMAC_SMU) += smu.o ...@@ -20,7 +20,6 @@ obj-$(CONFIG_PMAC_SMU) += smu.o
obj-$(CONFIG_ADB) += adb.o obj-$(CONFIG_ADB) += adb.o
obj-$(CONFIG_ADB_MACII) += via-macii.o obj-$(CONFIG_ADB_MACII) += via-macii.o
obj-$(CONFIG_ADB_MACIISI) += via-maciisi.o
obj-$(CONFIG_ADB_IOP) += adb-iop.o obj-$(CONFIG_ADB_IOP) += adb-iop.o
obj-$(CONFIG_ADB_PMU68K) += via-pmu68k.o obj-$(CONFIG_ADB_PMU68K) += via-pmu68k.o
obj-$(CONFIG_ADB_MACIO) += macio-adb.o obj-$(CONFIG_ADB_MACIO) += macio-adb.o
......
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
EXPORT_SYMBOL(adb_client_list); EXPORT_SYMBOL(adb_client_list);
extern struct adb_driver via_macii_driver; extern struct adb_driver via_macii_driver;
extern struct adb_driver via_maciisi_driver;
extern struct adb_driver via_cuda_driver; extern struct adb_driver via_cuda_driver;
extern struct adb_driver adb_iop_driver; extern struct adb_driver adb_iop_driver;
extern struct adb_driver via_pmu_driver; extern struct adb_driver via_pmu_driver;
...@@ -59,9 +58,6 @@ static struct adb_driver *adb_driver_list[] = { ...@@ -59,9 +58,6 @@ static struct adb_driver *adb_driver_list[] = {
#ifdef CONFIG_ADB_MACII #ifdef CONFIG_ADB_MACII
&via_macii_driver, &via_macii_driver,
#endif #endif
#ifdef CONFIG_ADB_MACIISI
&via_maciisi_driver,
#endif
#ifdef CONFIG_ADB_CUDA #ifdef CONFIG_ADB_CUDA
&via_cuda_driver, &via_cuda_driver,
#endif #endif
......
...@@ -205,12 +205,13 @@ int __init find_via_cuda(void) ...@@ -205,12 +205,13 @@ int __init find_via_cuda(void)
struct adb_request req; struct adb_request req;
int err; int err;
if (macintosh_config->adb_type != MAC_ADB_CUDA) if (macintosh_config->adb_type != MAC_ADB_CUDA &&
macintosh_config->adb_type != MAC_ADB_EGRET)
return 0; return 0;
via = via1; via = via1;
cuda_state = idle; cuda_state = idle;
mcu_is_egret = false; mcu_is_egret = macintosh_config->adb_type == MAC_ADB_EGRET;
err = cuda_init_via(); err = cuda_init_via();
if (err) { if (err) {
...@@ -323,7 +324,8 @@ cuda_probe(void) ...@@ -323,7 +324,8 @@ cuda_probe(void)
if (sys_ctrler != SYS_CTRLER_CUDA) if (sys_ctrler != SYS_CTRLER_CUDA)
return -ENODEV; return -ENODEV;
#else #else
if (macintosh_config->adb_type != MAC_ADB_CUDA) if (macintosh_config->adb_type != MAC_ADB_CUDA &&
macintosh_config->adb_type != MAC_ADB_EGRET)
return -ENODEV; return -ENODEV;
#endif #endif
if (via == NULL) if (via == NULL)
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment