mirror of
https://github.com/suyu-emu/horinux.git
synced 2026-09-21 14:15:21 -07:00
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 <userm57@yahoo.com> Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
committed by
Michael Ellerman
parent
d23eee88b5
commit
f74faec6b3
@@ -38,7 +38,7 @@ struct mac_model
|
||||
|
||||
#define MAC_ADB_NONE 0
|
||||
#define MAC_ADB_II 1
|
||||
#define MAC_ADB_IISI 2
|
||||
#define MAC_ADB_EGRET 2
|
||||
#define MAC_ADB_CUDA 3
|
||||
#define MAC_ADB_PB1 4
|
||||
#define MAC_ADB_PB2 5
|
||||
|
||||
@@ -286,7 +286,7 @@ static struct mac_model mac_data_table[] = {
|
||||
}, {
|
||||
.ident = MAC_MODEL_IISI,
|
||||
.name = "IIsi",
|
||||
.adb_type = MAC_ADB_IISI,
|
||||
.adb_type = MAC_ADB_EGRET,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_OLD,
|
||||
.scc_type = MAC_SCC_II,
|
||||
@@ -295,7 +295,7 @@ static struct mac_model mac_data_table[] = {
|
||||
}, {
|
||||
.ident = MAC_MODEL_IIVI,
|
||||
.name = "IIvi",
|
||||
.adb_type = MAC_ADB_IISI,
|
||||
.adb_type = MAC_ADB_EGRET,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_LC,
|
||||
.scc_type = MAC_SCC_II,
|
||||
@@ -304,7 +304,7 @@ static struct mac_model mac_data_table[] = {
|
||||
}, {
|
||||
.ident = MAC_MODEL_IIVX,
|
||||
.name = "IIvx",
|
||||
.adb_type = MAC_ADB_IISI,
|
||||
.adb_type = MAC_ADB_EGRET,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_LC,
|
||||
.scc_type = MAC_SCC_II,
|
||||
@@ -319,7 +319,7 @@ static struct mac_model mac_data_table[] = {
|
||||
{
|
||||
.ident = MAC_MODEL_CLII,
|
||||
.name = "Classic II",
|
||||
.adb_type = MAC_ADB_IISI,
|
||||
.adb_type = MAC_ADB_EGRET,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_LC,
|
||||
.scc_type = MAC_SCC_II,
|
||||
@@ -352,7 +352,7 @@ static struct mac_model mac_data_table[] = {
|
||||
{
|
||||
.ident = MAC_MODEL_LC,
|
||||
.name = "LC",
|
||||
.adb_type = MAC_ADB_IISI,
|
||||
.adb_type = MAC_ADB_EGRET,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_LC,
|
||||
.scc_type = MAC_SCC_II,
|
||||
@@ -361,7 +361,7 @@ static struct mac_model mac_data_table[] = {
|
||||
}, {
|
||||
.ident = MAC_MODEL_LCII,
|
||||
.name = "LC II",
|
||||
.adb_type = MAC_ADB_IISI,
|
||||
.adb_type = MAC_ADB_EGRET,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_LC,
|
||||
.scc_type = MAC_SCC_II,
|
||||
@@ -370,7 +370,7 @@ static struct mac_model mac_data_table[] = {
|
||||
}, {
|
||||
.ident = MAC_MODEL_LCIII,
|
||||
.name = "LC III",
|
||||
.adb_type = MAC_ADB_IISI,
|
||||
.adb_type = MAC_ADB_EGRET,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_LC,
|
||||
.scc_type = MAC_SCC_II,
|
||||
@@ -498,7 +498,7 @@ static struct mac_model mac_data_table[] = {
|
||||
{
|
||||
.ident = MAC_MODEL_P460,
|
||||
.name = "Performa 460",
|
||||
.adb_type = MAC_ADB_IISI,
|
||||
.adb_type = MAC_ADB_EGRET,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_LC,
|
||||
.scc_type = MAC_SCC_II,
|
||||
@@ -575,7 +575,7 @@ static struct mac_model mac_data_table[] = {
|
||||
}, {
|
||||
.ident = MAC_MODEL_P600,
|
||||
.name = "Performa 600",
|
||||
.adb_type = MAC_ADB_IISI,
|
||||
.adb_type = MAC_ADB_EGRET,
|
||||
.via_type = MAC_VIA_IICI,
|
||||
.scsi_type = MAC_SCSI_LC,
|
||||
.scc_type = MAC_SCC_II,
|
||||
|
||||
+8
-64
@@ -142,54 +142,6 @@ static void pmu_write_pram(int offset, __u8 data)
|
||||
#define pmu_write_pram NULL
|
||||
#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
|
||||
*
|
||||
@@ -458,11 +410,10 @@ void mac_pram_read(int offset, __u8 *buffer, int len)
|
||||
int i;
|
||||
|
||||
switch(macintosh_config->adb_type) {
|
||||
case MAC_ADB_IISI:
|
||||
func = maciisi_read_pram; break;
|
||||
case MAC_ADB_PB1:
|
||||
case MAC_ADB_PB2:
|
||||
func = pmu_read_pram; break;
|
||||
case MAC_ADB_EGRET:
|
||||
case MAC_ADB_CUDA:
|
||||
func = cuda_read_pram; break;
|
||||
default:
|
||||
@@ -481,11 +432,10 @@ void mac_pram_write(int offset, __u8 *buffer, int len)
|
||||
int i;
|
||||
|
||||
switch(macintosh_config->adb_type) {
|
||||
case MAC_ADB_IISI:
|
||||
func = maciisi_write_pram; break;
|
||||
case MAC_ADB_PB1:
|
||||
case MAC_ADB_PB2:
|
||||
func = pmu_write_pram; break;
|
||||
case MAC_ADB_EGRET:
|
||||
case MAC_ADB_CUDA:
|
||||
func = cuda_write_pram; break;
|
||||
default:
|
||||
@@ -500,17 +450,13 @@ void mac_pram_write(int offset, __u8 *buffer, int len)
|
||||
|
||||
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) {
|
||||
oss_shutdown();
|
||||
} else if (macintosh_config->adb_type == MAC_ADB_II) {
|
||||
via_shutdown();
|
||||
#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();
|
||||
#endif
|
||||
#ifdef CONFIG_ADB_PMU68K
|
||||
@@ -550,7 +496,8 @@ void mac_reset(void)
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
#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();
|
||||
#endif
|
||||
#ifdef CONFIG_ADB_PMU68K
|
||||
@@ -699,13 +646,11 @@ int mac_hwclk(int op, struct rtc_time *t)
|
||||
case MAC_ADB_IOP:
|
||||
now = via_read_time();
|
||||
break;
|
||||
case MAC_ADB_IISI:
|
||||
now = maciisi_read_time();
|
||||
break;
|
||||
case MAC_ADB_PB1:
|
||||
case MAC_ADB_PB2:
|
||||
now = pmu_read_time();
|
||||
break;
|
||||
case MAC_ADB_EGRET:
|
||||
case MAC_ADB_CUDA:
|
||||
now = cuda_read_time();
|
||||
break;
|
||||
@@ -737,6 +682,7 @@ int mac_hwclk(int op, struct rtc_time *t)
|
||||
case MAC_ADB_IOP:
|
||||
via_write_time(now);
|
||||
break;
|
||||
case MAC_ADB_EGRET:
|
||||
case MAC_ADB_CUDA:
|
||||
cuda_write_time(now);
|
||||
break;
|
||||
@@ -744,8 +690,6 @@ int mac_hwclk(int op, struct rtc_time *t)
|
||||
case MAC_ADB_PB2:
|
||||
pmu_write_time(now);
|
||||
break;
|
||||
case MAC_ADB_IISI:
|
||||
maciisi_write_time(now);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -30,14 +30,6 @@ config ADB_MACII
|
||||
Quadra 610, Quadra 650, Quadra 700, Quadra 800, Centris 610 and
|
||||
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
|
||||
bool "Include IOP (IIfx/Quadra 9x0) ADB driver"
|
||||
depends on ADB && MAC
|
||||
@@ -60,17 +52,15 @@ config ADB_PMU68K
|
||||
|
||||
# we want to change this to something like CONFIG_SYSCTRL_CUDA/PMU
|
||||
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
|
||||
help
|
||||
This provides support for CUDA based Macintosh and Power Macintosh
|
||||
systems. This includes many m68k based Macs (Color Classic, Mac TV,
|
||||
Performa 475, Performa 520, Performa 550, Performa 575,
|
||||
Performa 588, Quadra 605, Quadra 630, Quadra/Centris 660AV, and
|
||||
Quadra 840AV), most OldWorld PowerMacs, the first generation iMacs,
|
||||
the Blue&White G3 and the "Yikes" G4 (PCI Graphics). All later
|
||||
models should use CONFIG_ADB_PMU instead. It is safe to say Y here
|
||||
even if your machine doesn't have a CUDA.
|
||||
This provides support for Cuda/Egret based Macintosh and
|
||||
Power Macintosh systems. This includes most m68k based Macs,
|
||||
most Old World PowerMacs, the first generation iMacs, the
|
||||
Blue & White G3 and the "Yikes" G4 (PCI Graphics). All later
|
||||
models should use CONFIG_ADB_PMU instead. It is safe to say Y
|
||||
here even if your machine doesn't have a Cuda or Egret device.
|
||||
|
||||
If unsure say Y.
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ obj-$(CONFIG_PMAC_SMU) += smu.o
|
||||
|
||||
obj-$(CONFIG_ADB) += adb.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_PMU68K) += via-pmu68k.o
|
||||
obj-$(CONFIG_ADB_MACIO) += macio-adb.o
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
EXPORT_SYMBOL(adb_client_list);
|
||||
|
||||
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 adb_iop_driver;
|
||||
extern struct adb_driver via_pmu_driver;
|
||||
@@ -59,9 +58,6 @@ static struct adb_driver *adb_driver_list[] = {
|
||||
#ifdef CONFIG_ADB_MACII
|
||||
&via_macii_driver,
|
||||
#endif
|
||||
#ifdef CONFIG_ADB_MACIISI
|
||||
&via_maciisi_driver,
|
||||
#endif
|
||||
#ifdef CONFIG_ADB_CUDA
|
||||
&via_cuda_driver,
|
||||
#endif
|
||||
|
||||
@@ -205,12 +205,13 @@ int __init find_via_cuda(void)
|
||||
struct adb_request req;
|
||||
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;
|
||||
|
||||
via = via1;
|
||||
cuda_state = idle;
|
||||
mcu_is_egret = false;
|
||||
mcu_is_egret = macintosh_config->adb_type == MAC_ADB_EGRET;
|
||||
|
||||
err = cuda_init_via();
|
||||
if (err) {
|
||||
@@ -323,7 +324,8 @@ cuda_probe(void)
|
||||
if (sys_ctrler != SYS_CTRLER_CUDA)
|
||||
return -ENODEV;
|
||||
#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;
|
||||
#endif
|
||||
if (via == NULL)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user