aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2014-11-12 00:12:07 -0500
committerChristoph Hellwig <hch@lst.de>2014-11-20 03:11:13 -0500
commitcbad48deb38d8e442db9760ca1f950cd24429707 (patch)
tree526c09f77110834e13c959762c895545d3e26a2f /arch/m68k
parentffdede67d670e507d5202b8b08733c7a3b8e7fa0 (diff)
mac_scsi: Convert to platform device
Convert mac_scsi to platform device and eliminate scsi_register(). Platform resources for chip registers now follow the documentation. This should fix issues with the Mac IIci (and possibly other models too). Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Reviewed-by: Hannes Reinecke <hare@suse.de> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/include/asm/macintosh.h4
-rw-r--r--arch/m68k/mac/config.c146
2 files changed, 136 insertions, 14 deletions
diff --git a/arch/m68k/include/asm/macintosh.h b/arch/m68k/include/asm/macintosh.h
index d323b2c2d07d..29c7c6c3a5f2 100644
--- a/arch/m68k/include/asm/macintosh.h
+++ b/arch/m68k/include/asm/macintosh.h
@@ -53,6 +53,10 @@ struct mac_model
53#define MAC_SCSI_QUADRA 2 53#define MAC_SCSI_QUADRA 2
54#define MAC_SCSI_QUADRA2 3 54#define MAC_SCSI_QUADRA2 3
55#define MAC_SCSI_QUADRA3 4 55#define MAC_SCSI_QUADRA3 4
56#define MAC_SCSI_IIFX 5
57#define MAC_SCSI_DUO 6
58#define MAC_SCSI_CCL 7
59#define MAC_SCSI_LATE 8
56 60
57#define MAC_IDE_NONE 0 61#define MAC_IDE_NONE 0
58#define MAC_IDE_QUADRA 1 62#define MAC_IDE_QUADRA 1
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index a471eab1a4dd..e9c3756139fc 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -278,7 +278,7 @@ static struct mac_model mac_data_table[] = {
278 .name = "IIfx", 278 .name = "IIfx",
279 .adb_type = MAC_ADB_IOP, 279 .adb_type = MAC_ADB_IOP,
280 .via_type = MAC_VIA_IICI, 280 .via_type = MAC_VIA_IICI,
281 .scsi_type = MAC_SCSI_OLD, 281 .scsi_type = MAC_SCSI_IIFX,
282 .scc_type = MAC_SCC_IOP, 282 .scc_type = MAC_SCC_IOP,
283 .nubus_type = MAC_NUBUS, 283 .nubus_type = MAC_NUBUS,
284 .floppy_type = MAC_FLOPPY_SWIM_IOP, 284 .floppy_type = MAC_FLOPPY_SWIM_IOP,
@@ -329,7 +329,7 @@ static struct mac_model mac_data_table[] = {
329 .name = "Color Classic", 329 .name = "Color Classic",
330 .adb_type = MAC_ADB_CUDA, 330 .adb_type = MAC_ADB_CUDA,
331 .via_type = MAC_VIA_IICI, 331 .via_type = MAC_VIA_IICI,
332 .scsi_type = MAC_SCSI_OLD, 332 .scsi_type = MAC_SCSI_CCL,
333 .scc_type = MAC_SCC_II, 333 .scc_type = MAC_SCC_II,
334 .nubus_type = MAC_NUBUS, 334 .nubus_type = MAC_NUBUS,
335 .floppy_type = MAC_FLOPPY_SWIM_ADDR2, 335 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
@@ -338,7 +338,7 @@ static struct mac_model mac_data_table[] = {
338 .name = "Color Classic II", 338 .name = "Color Classic II",
339 .adb_type = MAC_ADB_CUDA, 339 .adb_type = MAC_ADB_CUDA,
340 .via_type = MAC_VIA_IICI, 340 .via_type = MAC_VIA_IICI,
341 .scsi_type = MAC_SCSI_OLD, 341 .scsi_type = MAC_SCSI_CCL,
342 .scc_type = MAC_SCC_II, 342 .scc_type = MAC_SCC_II,
343 .nubus_type = MAC_NUBUS, 343 .nubus_type = MAC_NUBUS,
344 .floppy_type = MAC_FLOPPY_SWIM_ADDR2, 344 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
@@ -526,7 +526,7 @@ static struct mac_model mac_data_table[] = {
526 .name = "Performa 520", 526 .name = "Performa 520",
527 .adb_type = MAC_ADB_CUDA, 527 .adb_type = MAC_ADB_CUDA,
528 .via_type = MAC_VIA_IICI, 528 .via_type = MAC_VIA_IICI,
529 .scsi_type = MAC_SCSI_OLD, 529 .scsi_type = MAC_SCSI_CCL,
530 .scc_type = MAC_SCC_II, 530 .scc_type = MAC_SCC_II,
531 .nubus_type = MAC_NUBUS, 531 .nubus_type = MAC_NUBUS,
532 .floppy_type = MAC_FLOPPY_SWIM_ADDR2, 532 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
@@ -535,7 +535,7 @@ static struct mac_model mac_data_table[] = {
535 .name = "Performa 550", 535 .name = "Performa 550",
536 .adb_type = MAC_ADB_CUDA, 536 .adb_type = MAC_ADB_CUDA,
537 .via_type = MAC_VIA_IICI, 537 .via_type = MAC_VIA_IICI,
538 .scsi_type = MAC_SCSI_OLD, 538 .scsi_type = MAC_SCSI_CCL,
539 .scc_type = MAC_SCC_II, 539 .scc_type = MAC_SCC_II,
540 .nubus_type = MAC_NUBUS, 540 .nubus_type = MAC_NUBUS,
541 .floppy_type = MAC_FLOPPY_SWIM_ADDR2, 541 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
@@ -567,7 +567,7 @@ static struct mac_model mac_data_table[] = {
567 .name = "TV", 567 .name = "TV",
568 .adb_type = MAC_ADB_CUDA, 568 .adb_type = MAC_ADB_CUDA,
569 .via_type = MAC_VIA_IICI, 569 .via_type = MAC_VIA_IICI,
570 .scsi_type = MAC_SCSI_OLD, 570 .scsi_type = MAC_SCSI_CCL,
571 .scc_type = MAC_SCC_II, 571 .scc_type = MAC_SCC_II,
572 .nubus_type = MAC_NUBUS, 572 .nubus_type = MAC_NUBUS,
573 .floppy_type = MAC_FLOPPY_SWIM_ADDR2, 573 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
@@ -712,7 +712,7 @@ static struct mac_model mac_data_table[] = {
712 .name = "PowerBook 190", 712 .name = "PowerBook 190",
713 .adb_type = MAC_ADB_PB2, 713 .adb_type = MAC_ADB_PB2,
714 .via_type = MAC_VIA_QUADRA, 714 .via_type = MAC_VIA_QUADRA,
715 .scsi_type = MAC_SCSI_OLD, 715 .scsi_type = MAC_SCSI_LATE,
716 .ide_type = MAC_IDE_BABOON, 716 .ide_type = MAC_IDE_BABOON,
717 .scc_type = MAC_SCC_QUADRA, 717 .scc_type = MAC_SCC_QUADRA,
718 .nubus_type = MAC_NUBUS, 718 .nubus_type = MAC_NUBUS,
@@ -722,7 +722,7 @@ static struct mac_model mac_data_table[] = {
722 .name = "PowerBook 520", 722 .name = "PowerBook 520",
723 .adb_type = MAC_ADB_PB2, 723 .adb_type = MAC_ADB_PB2,
724 .via_type = MAC_VIA_QUADRA, 724 .via_type = MAC_VIA_QUADRA,
725 .scsi_type = MAC_SCSI_OLD, 725 .scsi_type = MAC_SCSI_LATE,
726 .scc_type = MAC_SCC_QUADRA, 726 .scc_type = MAC_SCC_QUADRA,
727 .ether_type = MAC_ETHER_SONIC, 727 .ether_type = MAC_ETHER_SONIC,
728 .nubus_type = MAC_NUBUS, 728 .nubus_type = MAC_NUBUS,
@@ -740,7 +740,7 @@ static struct mac_model mac_data_table[] = {
740 .name = "PowerBook Duo 210", 740 .name = "PowerBook Duo 210",
741 .adb_type = MAC_ADB_PB2, 741 .adb_type = MAC_ADB_PB2,
742 .via_type = MAC_VIA_IICI, 742 .via_type = MAC_VIA_IICI,
743 .scsi_type = MAC_SCSI_OLD, 743 .scsi_type = MAC_SCSI_DUO,
744 .scc_type = MAC_SCC_QUADRA, 744 .scc_type = MAC_SCC_QUADRA,
745 .nubus_type = MAC_NUBUS, 745 .nubus_type = MAC_NUBUS,
746 .floppy_type = MAC_FLOPPY_SWIM_ADDR2, 746 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
@@ -749,7 +749,7 @@ static struct mac_model mac_data_table[] = {
749 .name = "PowerBook Duo 230", 749 .name = "PowerBook Duo 230",
750 .adb_type = MAC_ADB_PB2, 750 .adb_type = MAC_ADB_PB2,
751 .via_type = MAC_VIA_IICI, 751 .via_type = MAC_VIA_IICI,
752 .scsi_type = MAC_SCSI_OLD, 752 .scsi_type = MAC_SCSI_DUO,
753 .scc_type = MAC_SCC_QUADRA, 753 .scc_type = MAC_SCC_QUADRA,
754 .nubus_type = MAC_NUBUS, 754 .nubus_type = MAC_NUBUS,
755 .floppy_type = MAC_FLOPPY_SWIM_ADDR2, 755 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
@@ -758,7 +758,7 @@ static struct mac_model mac_data_table[] = {
758 .name = "PowerBook Duo 250", 758 .name = "PowerBook Duo 250",
759 .adb_type = MAC_ADB_PB2, 759 .adb_type = MAC_ADB_PB2,
760 .via_type = MAC_VIA_IICI, 760 .via_type = MAC_VIA_IICI,
761 .scsi_type = MAC_SCSI_OLD, 761 .scsi_type = MAC_SCSI_DUO,
762 .scc_type = MAC_SCC_QUADRA, 762 .scc_type = MAC_SCC_QUADRA,
763 .nubus_type = MAC_NUBUS, 763 .nubus_type = MAC_NUBUS,
764 .floppy_type = MAC_FLOPPY_SWIM_ADDR2, 764 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
@@ -767,7 +767,7 @@ static struct mac_model mac_data_table[] = {
767 .name = "PowerBook Duo 270c", 767 .name = "PowerBook Duo 270c",
768 .adb_type = MAC_ADB_PB2, 768 .adb_type = MAC_ADB_PB2,
769 .via_type = MAC_VIA_IICI, 769 .via_type = MAC_VIA_IICI,
770 .scsi_type = MAC_SCSI_OLD, 770 .scsi_type = MAC_SCSI_DUO,
771 .scc_type = MAC_SCC_QUADRA, 771 .scc_type = MAC_SCC_QUADRA,
772 .nubus_type = MAC_NUBUS, 772 .nubus_type = MAC_NUBUS,
773 .floppy_type = MAC_FLOPPY_SWIM_ADDR2, 773 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
@@ -776,7 +776,7 @@ static struct mac_model mac_data_table[] = {
776 .name = "PowerBook Duo 280", 776 .name = "PowerBook Duo 280",
777 .adb_type = MAC_ADB_PB2, 777 .adb_type = MAC_ADB_PB2,
778 .via_type = MAC_VIA_IICI, 778 .via_type = MAC_VIA_IICI,
779 .scsi_type = MAC_SCSI_OLD, 779 .scsi_type = MAC_SCSI_DUO,
780 .scc_type = MAC_SCC_QUADRA, 780 .scc_type = MAC_SCC_QUADRA,
781 .nubus_type = MAC_NUBUS, 781 .nubus_type = MAC_NUBUS,
782 .floppy_type = MAC_FLOPPY_SWIM_ADDR2, 782 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
@@ -785,7 +785,7 @@ static struct mac_model mac_data_table[] = {
785 .name = "PowerBook Duo 280c", 785 .name = "PowerBook Duo 280c",
786 .adb_type = MAC_ADB_PB2, 786 .adb_type = MAC_ADB_PB2,
787 .via_type = MAC_VIA_IICI, 787 .via_type = MAC_VIA_IICI,
788 .scsi_type = MAC_SCSI_OLD, 788 .scsi_type = MAC_SCSI_DUO,
789 .scc_type = MAC_SCC_QUADRA, 789 .scc_type = MAC_SCC_QUADRA,
790 .nubus_type = MAC_NUBUS, 790 .nubus_type = MAC_NUBUS,
791 .floppy_type = MAC_FLOPPY_SWIM_ADDR2, 791 .floppy_type = MAC_FLOPPY_SWIM_ADDR2,
@@ -929,6 +929,70 @@ static struct platform_device swim_pdev = {
929 .resource = &swim_rsrc, 929 .resource = &swim_rsrc,
930}; 930};
931 931
932static const struct resource mac_scsi_iifx_rsrc[] __initconst = {
933 {
934 .flags = IORESOURCE_IRQ,
935 .start = IRQ_MAC_SCSI,
936 .end = IRQ_MAC_SCSI,
937 }, {
938 .flags = IORESOURCE_MEM,
939 .start = 0x50008000,
940 .end = 0x50009FFF,
941 },
942};
943
944static const struct resource mac_scsi_duo_rsrc[] __initconst = {
945 {
946 .flags = IORESOURCE_MEM,
947 .start = 0xFEE02000,
948 .end = 0xFEE03FFF,
949 },
950};
951
952static const struct resource mac_scsi_old_rsrc[] __initconst = {
953 {
954 .flags = IORESOURCE_IRQ,
955 .start = IRQ_MAC_SCSI,
956 .end = IRQ_MAC_SCSI,
957 }, {
958 .flags = IORESOURCE_MEM,
959 .start = 0x50010000,
960 .end = 0x50011FFF,
961 }, {
962 .flags = IORESOURCE_MEM,
963 .start = 0x50006000,
964 .end = 0x50007FFF,
965 },
966};
967
968static const struct resource mac_scsi_late_rsrc[] __initconst = {
969 {
970 .flags = IORESOURCE_IRQ,
971 .start = IRQ_MAC_SCSI,
972 .end = IRQ_MAC_SCSI,
973 }, {
974 .flags = IORESOURCE_MEM,
975 .start = 0x50010000,
976 .end = 0x50011FFF,
977 },
978};
979
980static const struct resource mac_scsi_ccl_rsrc[] __initconst = {
981 {
982 .flags = IORESOURCE_IRQ,
983 .start = IRQ_MAC_SCSI,
984 .end = IRQ_MAC_SCSI,
985 }, {
986 .flags = IORESOURCE_MEM,
987 .start = 0x50F10000,
988 .end = 0x50F11FFF,
989 }, {
990 .flags = IORESOURCE_MEM,
991 .start = 0x50F06000,
992 .end = 0x50F07FFF,
993 },
994};
995
932static struct platform_device esp_0_pdev = { 996static struct platform_device esp_0_pdev = {
933 .name = "mac_esp", 997 .name = "mac_esp",
934 .id = 0, 998 .id = 0,
@@ -1000,6 +1064,60 @@ int __init mac_platform_init(void)
1000 (macintosh_config->ident == MAC_MODEL_Q950)) 1064 (macintosh_config->ident == MAC_MODEL_Q950))
1001 platform_device_register(&esp_1_pdev); 1065 platform_device_register(&esp_1_pdev);
1002 break; 1066 break;
1067 case MAC_SCSI_IIFX:
1068 /* Addresses from The Guide to Mac Family Hardware.
1069 * $5000 8000 - $5000 9FFF: SCSI DMA
1070 * $5000 C000 - $5000 DFFF: Alternate SCSI (DMA)
1071 * $5000 E000 - $5000 FFFF: Alternate SCSI (Hsk)
1072 * The SCSI DMA custom IC embeds the 53C80 core. mac_scsi does
1073 * not make use of its DMA or hardware handshaking logic.
1074 */
1075 platform_device_register_simple("mac_scsi", 0,
1076 mac_scsi_iifx_rsrc, ARRAY_SIZE(mac_scsi_iifx_rsrc));
1077 break;
1078 case MAC_SCSI_DUO:
1079 /* Addresses from the Duo Dock II Developer Note.
1080 * $FEE0 2000 - $FEE0 3FFF: normal mode
1081 * $FEE0 4000 - $FEE0 5FFF: pseudo DMA without /DRQ
1082 * $FEE0 6000 - $FEE0 7FFF: pseudo DMA with /DRQ
1083 * The NetBSD code indicates that both 5380 chips share
1084 * an IRQ (?) which would need careful handling (see mac_esp).
1085 */
1086 platform_device_register_simple("mac_scsi", 1,
1087 mac_scsi_duo_rsrc, ARRAY_SIZE(mac_scsi_duo_rsrc));
1088 /* fall through */
1089 case MAC_SCSI_OLD:
1090 /* Addresses from Developer Notes for Duo System,
1091 * PowerBook 180 & 160, 140 & 170, Macintosh IIsi
1092 * and also from The Guide to Mac Family Hardware for
1093 * SE/30, II, IIx, IIcx, IIci.
1094 * $5000 6000 - $5000 7FFF: pseudo-DMA with /DRQ
1095 * $5001 0000 - $5001 1FFF: normal mode
1096 * $5001 2000 - $5001 3FFF: pseudo-DMA without /DRQ
1097 * GMFH says that $5000 0000 - $50FF FFFF "wraps
1098 * $5000 0000 - $5001 FFFF eight times" (!)
1099 * mess.org says IIci and Color Classic do not alias
1100 * I/O address space.
1101 */
1102 platform_device_register_simple("mac_scsi", 0,
1103 mac_scsi_old_rsrc, ARRAY_SIZE(mac_scsi_old_rsrc));
1104 break;
1105 case MAC_SCSI_LATE:
1106 /* PDMA logic in 68040 PowerBooks is somehow different to
1107 * '030 models. It's probably more like Quadras (see mac_esp).
1108 */
1109 platform_device_register_simple("mac_scsi", 0,
1110 mac_scsi_late_rsrc, ARRAY_SIZE(mac_scsi_late_rsrc));
1111 break;
1112 case MAC_SCSI_CCL:
1113 /* Addresses from the Color Classic Developer Note.
1114 * $50F0 6000 - $50F0 7FFF: SCSI handshake
1115 * $50F1 0000 - $50F1 1FFF: SCSI
1116 * $50F1 2000 - $50F1 3FFF: SCSI DMA
1117 */
1118 platform_device_register_simple("mac_scsi", 0,
1119 mac_scsi_ccl_rsrc, ARRAY_SIZE(mac_scsi_ccl_rsrc));
1120 break;
1003 } 1121 }
1004 1122
1005 /* 1123 /*