Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

m68k: mac: Fix reboot hang on Mac IIci

Calling mac_reset() on a Mac IIci does reset the system, but what
follows is a POST failure that requires a manual reset to resolve.
Avoid that by using the 68030 asm implementation instead of the C
implementation.

Apparently the SE/30 has a similar problem as it has used the asm
implementation since before git. This patch extends that solution to
other systems with a similar ROM.

After this patch, the only systems still using the C implementation are
68040 systems where adb_type is either MAC_ADB_IOP or MAC_ADB_II. This
implies a 1 MiB Quadra ROM.

This now includes the Quadra 900/950, which previously fell through to
the "should never get here" catch-all.

Reported-and-tested-by: Stan Johnson <userm57@yahoo.com>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/480ebd1249d229c6dc1f3f1c6d599b8505483fd8.1714797072.git.fthain@linux-m68k.org
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

authored by

Finn Thain and committed by
Geert Uytterhoeven
265a3b32 da89ce46

+18 -18
+18 -18
arch/m68k/mac/misc.c
··· 453 453 454 454 void mac_reset(void) 455 455 { 456 - if (macintosh_config->adb_type == MAC_ADB_II && 457 - macintosh_config->ident != MAC_MODEL_SE30) { 458 - /* need ROMBASE in booter */ 459 - /* indeed, plus need to MAP THE ROM !! */ 460 - 461 - if (mac_bi_data.rombase == 0) 462 - mac_bi_data.rombase = 0x40800000; 463 - 464 - /* works on some */ 465 - rom_reset = (void *) (mac_bi_data.rombase + 0xa); 466 - 467 - local_irq_disable(); 468 - rom_reset(); 469 456 #ifdef CONFIG_ADB_CUDA 470 - } else if (macintosh_config->adb_type == MAC_ADB_EGRET || 471 - macintosh_config->adb_type == MAC_ADB_CUDA) { 457 + if (macintosh_config->adb_type == MAC_ADB_EGRET || 458 + macintosh_config->adb_type == MAC_ADB_CUDA) { 472 459 cuda_restart(); 460 + } else 473 461 #endif 474 462 #ifdef CONFIG_ADB_PMU 475 - } else if (macintosh_config->adb_type == MAC_ADB_PB2) { 463 + if (macintosh_config->adb_type == MAC_ADB_PB2) { 476 464 pmu_restart(); 465 + } else 477 466 #endif 478 - } else if (CPU_IS_030) { 479 - 467 + if (CPU_IS_030) { 480 468 /* 030-specific reset routine. The idea is general, but the 481 469 * specific registers to reset are '030-specific. Until I 482 470 * have a non-030 machine, I can't test anything else. ··· 512 524 "jmp %/a0@\n\t" /* jump to the reset vector */ 513 525 ".chip 68k" 514 526 : : "r" (offset), "a" (rombase) : "a0"); 527 + } else { 528 + /* need ROMBASE in booter */ 529 + /* indeed, plus need to MAP THE ROM !! */ 530 + 531 + if (mac_bi_data.rombase == 0) 532 + mac_bi_data.rombase = 0x40800000; 533 + 534 + /* works on some */ 535 + rom_reset = (void *)(mac_bi_data.rombase + 0xa); 536 + 537 + local_irq_disable(); 538 + rom_reset(); 515 539 } 516 540 517 541 /* should never get here */