From 93edd023a7de1ea4fe6e5de631982b96156eef03 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 24 Oct 2011 01:11:12 +1100 Subject: m68k/mac: early console Revive the old mac_serial_print() routine as mac_early_print(). mac_serial_print() did not function because it did not use the right offsets for its stack arguments. Fix this and make compilation conditional on CONFIG_EARLY_PRINTK instead of the obscure MAC_SERIAL_DEBUG macro. Give mac_early_print() a new string length parameter to fit the early console API. Send output to the framebuffer as well as serial ports. Change the line rate to 38400 baud to match the default for the real (pmac_zilog) serial console. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/mac/config.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'arch/m68k/mac/config.c') diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index c247de0..55db101 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -71,6 +71,31 @@ static void mac_get_model(char *str); static void mac_identify(void); static void mac_report_hardware(void); +#ifdef CONFIG_EARLY_PRINTK +asmlinkage void __init mac_early_print(const char *s, unsigned n); + +static void __init mac_early_cons_write(struct console *con, + const char *s, unsigned n) +{ + mac_early_print(s, n); +} + +static struct console __initdata mac_early_cons = { + .name = "early", + .write = mac_early_cons_write, + .flags = CON_PRINTBUFFER | CON_BOOT, + .index = -1 +}; + +int __init mac_unregister_early_cons(void) +{ + /* mac_early_print can't be used after init sections are discarded */ + return unregister_console(&mac_early_cons); +} + +late_initcall(mac_unregister_early_cons); +#endif + static void __init mac_sched_init(irq_handler_t vector) { via_init_clock(vector); @@ -164,6 +189,10 @@ void __init config_mac(void) mach_beep = mac_mksound; #endif +#ifdef CONFIG_EARLY_PRINTK + register_console(&mac_early_cons); +#endif + /* * Determine hardware present */ -- cgit v1.1 From 8d9f014ad16711d79c8a575f2d3d009d2a16c7b7 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 24 Oct 2011 01:11:16 +1100 Subject: m68k/mac: enable via_alt_mapping on performa 580 Enable via_alt_mapping on the Performa 588 and tidy up related documentation. I'm betting that remapped IRQs work just fine on the Performa 580 series since it works on the LC 630 and the logic board part numbers are reputedly the same. And the consensus seems to be that the Mac TV is essentially a Performa 550, not dissimilar to the Performa 520, so set the via_type accordingly. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/mac/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/m68k/mac/config.c') diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 55db101..12e564c 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -594,7 +594,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_TV, .name = "TV", .adb_type = MAC_ADB_CUDA, - .via_type = MAC_VIA_QUADRA, + .via_type = MAC_VIA_IIci, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, -- cgit v1.1 From da3fb3c9aaa357421ade92910303af82340c2ff5 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 24 Oct 2011 01:11:18 +1100 Subject: m68k/mac: oss irq fixes The IOP driver calls into the OSS driver to enable its IRQ. This undesirable coupling between drivers only exists because the OSS driver doesn't correctly handle all of its machspec IRQs. Fix OSS handling of enable/disable for VIA1 IRQs (8 thru 15) which includes MAC_IRQ_ADB. Back when I implemented pmac_zilog support I redefined IRQ_MAC_SCC incorrectly. Change this to a machspec IRQ so that it works on OSS. Clean up the unused OSS audio IRQ and OSS_IRQLEV_* cruft that only confuses things. Fix the OSS description in macints.c and remove an obsolete comment. Don't enable the VIA1 irq before registering the handler. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/mac/config.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'arch/m68k/mac/config.c') diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 12e564c..101a8b7 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -893,8 +893,14 @@ static void __init mac_identify(void) scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B; break; default: - scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC; - scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC; + /* On non-PSC machines, the serial ports share an IRQ. */ + if (macintosh_config->ident == MAC_MODEL_IIFX) { + scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC; + scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC; + } else { + scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_AUTO_4; + scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_AUTO_4; + } break; } -- cgit v1.1 From 4107c459fe4075c5a2d552fd8d9d5fea10c1ff93 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 24 Oct 2011 01:11:20 +1100 Subject: m68k/mac: fix powerbook 150 adb_type The PowerBook 150 is a actually a Duo underneath. Fix the adb_type. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/mac/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/m68k/mac/config.c') diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 101a8b7..b20b131 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -674,7 +674,7 @@ static struct mac_model mac_data_table[] = { }, { .ident = MAC_MODEL_PB150, .name = "PowerBook 150", - .adb_type = MAC_ADB_PB1, + .adb_type = MAC_ADB_PB2, .via_type = MAC_VIA_IIci, .scsi_type = MAC_SCSI_OLD, .ide_type = MAC_IDE_PB, -- cgit v1.1 From 608e287b0591789ecd851b05db6f0ba37807fadc Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 24 Oct 2011 01:11:22 +1100 Subject: m68k/mac: cleanup macro case Code style convention has macro names in uppercase. Change MAC_VIA_IIci to MAC_VIA_IICI. Also remove an obsolete comment. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- arch/m68k/mac/config.c | 52 +++++++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 28 deletions(-) (limited to 'arch/m68k/mac/config.c') diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index b20b131..f60ff5f 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -221,7 +221,7 @@ void __init config_mac(void) * inaccurate, so look here if a new Mac model won't run. Example: if * a Mac crashes immediately after the VIA1 registers have been dumped * to the screen, it probably died attempting to read DirB on a RBV. - * Meaning it should have MAC_VIA_IIci here :-) + * Meaning it should have MAC_VIA_IICI here :-) */ struct mac_model *macintosh_config; @@ -296,7 +296,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_IICI, .name = "IIci", .adb_type = MAC_ADB_II, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -305,7 +305,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_IIFX, .name = "IIfx", .adb_type = MAC_ADB_IOP, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_IOP, .nubus_type = MAC_NUBUS, @@ -314,7 +314,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_IISI, .name = "IIsi", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -323,7 +323,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_IIVI, .name = "IIvi", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -332,7 +332,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_IIVX, .name = "IIvx", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -347,7 +347,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_CLII, .name = "Classic II", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -356,7 +356,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_CCL, .name = "Color Classic", .adb_type = MAC_ADB_CUDA, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -365,7 +365,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_CCLII, .name = "Color Classic II", .adb_type = MAC_ADB_CUDA, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -380,7 +380,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_LC, .name = "LC", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -389,7 +389,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_LCII, .name = "LC II", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -398,7 +398,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_LCIII, .name = "LC III", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -526,7 +526,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_P460, .name = "Performa 460", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -553,7 +553,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_P520, .name = "Performa 520", .adb_type = MAC_ADB_CUDA, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -562,7 +562,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_P550, .name = "Performa 550", .adb_type = MAC_ADB_CUDA, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -594,7 +594,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_TV, .name = "TV", .adb_type = MAC_ADB_CUDA, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -603,7 +603,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_P600, .name = "Performa 600", .adb_type = MAC_ADB_IISI, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_II, .nubus_type = MAC_NUBUS, @@ -675,7 +675,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_PB150, .name = "PowerBook 150", .adb_type = MAC_ADB_PB2, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .ide_type = MAC_IDE_PB, .scc_type = MAC_SCC_QUADRA, @@ -761,17 +761,13 @@ static struct mac_model mac_data_table[] = { * PowerBook Duos are pretty much like normal PowerBooks * All of these probably have onboard SONIC in the Dock which * means we'll have to probe for it eventually. - * - * Are these really MAC_VIA_IIci? The developer notes for the - * Duos show pretty much the same custom parts as in most of - * the other PowerBooks which would imply MAC_VIA_QUADRA. */ { .ident = MAC_MODEL_PB210, .name = "PowerBook Duo 210", .adb_type = MAC_ADB_PB2, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_QUADRA, .nubus_type = MAC_NUBUS, @@ -780,7 +776,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_PB230, .name = "PowerBook Duo 230", .adb_type = MAC_ADB_PB2, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_QUADRA, .nubus_type = MAC_NUBUS, @@ -789,7 +785,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_PB250, .name = "PowerBook Duo 250", .adb_type = MAC_ADB_PB2, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_QUADRA, .nubus_type = MAC_NUBUS, @@ -798,7 +794,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_PB270C, .name = "PowerBook Duo 270c", .adb_type = MAC_ADB_PB2, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_QUADRA, .nubus_type = MAC_NUBUS, @@ -807,7 +803,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_PB280, .name = "PowerBook Duo 280", .adb_type = MAC_ADB_PB2, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_QUADRA, .nubus_type = MAC_NUBUS, @@ -816,7 +812,7 @@ static struct mac_model mac_data_table[] = { .ident = MAC_MODEL_PB280C, .name = "PowerBook Duo 280c", .adb_type = MAC_ADB_PB2, - .via_type = MAC_VIA_IIci, + .via_type = MAC_VIA_IICI, .scsi_type = MAC_SCSI_OLD, .scc_type = MAC_SCC_QUADRA, .nubus_type = MAC_NUBUS, -- cgit v1.1