diff -u --new-file --recursive linux-2.2.14/drivers/block/Config.in linux-2.2.14-human/drivers/block/Config.in --- linux-2.2.14/drivers/block/Config.in Wed Jan 5 03:12:14 2000 +++ linux-2.2.14-human/drivers/block/Config.in Wed Mar 22 17:16:19 2000 @@ -11,6 +11,18 @@ if [ "$CONFIG_ATARI" = "y" ]; then tristate 'Atari floppy support' CONFIG_ATARI_FLOPPY fi +if [ "$CONFIG_BLK_DEV_FD" != "n" ]; then + bool ' 1232KB (1.25MB) format support' CONFIG_FD1232 + if [ "$CONFIG_FD1232" = "y" ]; then + comment ' Please select *one* or *none* of the followings' + bool ' 3mode fdd support for FMV-BIBLO NUVI23 series' CONFIG_FUJITSU_NU623 + bool ' 3mode fdd support for TOMCAT 3MODE FDD' CONFIG_FDD_TOMCAT + bool ' 3mode fdd support for SMC/SMSC FDC37C663,664,665,666,669' CONFIG_FDC_SMC66X + bool ' 3mode fdd support for SMSC FDC37C67x,68x,93x,957,FDC37B80x' CONFIG_FDC_SMCNOT66X + bool ' 3mode fdd support for Winbond W83877' CONFIG_FDC_W83877 + bool ' 3mode fdd support for Winbond W83977' CONFIG_FDC_W83977 + fi +fi tristate 'Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support' CONFIG_BLK_DEV_IDE comment 'Please see Documentation/ide.txt for help/info on IDE drives' diff -u --new-file --recursive linux-2.2.14/drivers/block/floppy.c linux-2.2.14-human/drivers/block/floppy.c --- linux-2.2.14/drivers/block/floppy.c Thu Aug 26 09:29:46 1999 +++ linux-2.2.14-human/drivers/block/floppy.c Wed Mar 22 17:18:11 2000 @@ -364,14 +364,24 @@ {{1, 300, 16, 16, 8000, 1*HZ, 3*HZ, 0, SEL_DLY, 5, 40, 3*HZ, 17, {3,1,2,0,2}, 0, 0, { 1, 0, 0, 0, 0, 0, 0, 0}, 3*HZ/2, 1 }, "360K PC" }, /*5 1/4 360 KB PC*/ +#ifdef CONFIG_FD1232 +{{2, 500, 16, 16, 6000, 4*HZ/10, 3*HZ, 14, SEL_DLY, 6, 83, 3*HZ, 17, {3,1,2,0,2}, 0, + 0, { 2,31, 5, 6,23,10,20,12}, 3*HZ/2, 2 }, "1.2M" }, /*5 1/4 HD AT*/ +#else {{2, 500, 16, 16, 6000, 4*HZ/10, 3*HZ, 14, SEL_DLY, 6, 83, 3*HZ, 17, {3,1,2,0,2}, 0, 0, { 2, 5, 6,23,10,20,12, 0}, 3*HZ/2, 2 }, "1.2M" }, /*5 1/4 HD AT*/ +#endif {{3, 250, 16, 16, 3000, 1*HZ, 3*HZ, 0, SEL_DLY, 5, 83, 3*HZ, 20, {3,1,2,0,2}, 0, 0, { 4,22,21,30, 3, 0, 0, 0}, 3*HZ/2, 4 }, "720k" }, /*3 1/2 DD*/ +#ifdef CONFIG_FD1232 +{{4, 500, 16, 16, 4000, 4*HZ/10, 3*HZ, 10, SEL_DLY, 5, 83, 3*HZ, 20, {3,1,2,0,2}, 0, + 0, { 7,31, 4,25,22,31,21,29}, 3*HZ/2, 7 }, "1.44M" }, /*3 1/2 HD*/ +#else {{4, 500, 16, 16, 4000, 4*HZ/10, 3*HZ, 10, SEL_DLY, 5, 83, 3*HZ, 20, {3,1,2,0,2}, 0, 0, { 7, 4,25,22,31,21,29,11}, 3*HZ/2, 7 }, "1.44M" }, /*3 1/2 HD*/ +#endif {{5, 1000, 15, 8, 3000, 4*HZ/10, 3*HZ, 10, SEL_DLY, 5, 83, 3*HZ, 40, {3,1,2,0,2}, 0, 0, { 7, 8, 4,25,28,22,31,21}, 3*HZ/2, 8 }, "2.88M AMI BIOS" }, /*3 1/2 ED*/ @@ -438,7 +448,11 @@ { 3680,23,2,80,0,0x1C,0x10,0xCF,0x00,"H1840" }, /* 29 1.84MB 3.5" */ { 1600,10,2,80,0,0x25,0x02,0xDF,0x2E,"D800" }, /* 30 800KB 3.5" */ +#ifdef CONFIG_FD1232 + { 2464,16,2,77,0,0x35,0x08,0xDF,0x74,"h1232" }, /* 31 1.25MB 3.5/5" */ +#else { 3200,20,2,80,0,0x1C,0x00,0xCF,0x2C,"H1600" }, /* 31 1.6MB 3.5" */ +#endif }; #define NUMBER(x) (sizeof(x) / sizeof(*(x))) @@ -1900,6 +1914,87 @@ } /*typedef void (*timeout_fn)(unsigned long);*/ +#ifdef CONFIG_FD1232 +/* change rpm for 1232KB format disk */ +static void rpm_change(int rpm360) +{ + int i, j; + cli(); +#ifdef CONFIG_FUJITSU_NU623 + outb(0x15, 0xfd64); + i = inb(0xfd65); + if (rpm360) i |= 0x80; + else i &= ~0x80; + outb(i, 0xfd65); +#endif /* CONFIG_FUJITSU_NU623 */ +#ifdef CONFIG_TOMCAT_FDD + i = FDCS->dor; + j = 0x10 << UNIT(current_drive); + outb(i & ~j, FD_DOR); + outb(i | j, FD_DOR); + outb(i & ~j, FD_DOR); + outb(i | j, FD_DOR); + outb(i & ~j, FD_DOR); + outb(i | j, FD_DOR); + outb(i & ~j, FD_DOR); + outb(i | j, FD_DOR); + outb(i & ~j, FD_DOR); + outb(i | j, FD_DOR); + if (!rpm360) { + outb(i & ~j, FD_DOR); + outb(i | j, FD_DOR); + } +#endif /* CONFIG_TOMCAT_FDD */ +#ifdef CONFIG_FDC_SMC66X + outb(0x55, FDCS->address); + outb(0x55, FDCS->address); + outb(0x5, FDCS->address); + i = inb(FDCS->address + 1); + if (rpm360) i |= 0x18; + else i &= ~0x18; + outb(i, FDCS->address + 1); + outb(0xaa, FDCS->address); +#endif /* CONFIG_FDC_SMC66X */ +#ifdef CONFIG_FDC_SMCNOT66X + outb(0x55, FDCS->address); + outb(0x7, FDCS->address); + outb(0x0, FDCS->address + 1); + outb(0xf1, FDCS->address); + i = inb(FDCS->address + 1); + if (rpm360) i |= 0x0c; + else i &= ~0x0c; + outb(i, FDCS->address + 1); + outb(0xaa, FDCS->address); +#endif /* CONFIG_FDC_SMCNOT66X */ +#ifdef CONFIG_FDC_W83877 + outb(0x87, FDCS->address); + outb(0x87, FDCS->address); + i = inb(FDCS->address + 1); + if (rpm360) i |= 0x20; + else i &= ~0x20; + outb(i, FDCS->address + 1); + outb(0x07, FDCS->address); + outb(((rpm360)? 0x55:0), FDCS->address + 1); + outb(0xaa, FDCS->address); +#endif /* CONFIG_FDC_W83877 */ +#ifdef CONFIG_FDC_W83977 + outb(0x87, FDCS->address); + outb(0x87, FDCS->address); + outb(0x07, FDCS->address); + outb(0x00, FDCS->address + 1); + outb(0xf0, FDCS->address); + i = inb(FDCS->address + 1); + if (rpm360) i |= 0x01; + else i &= ~0x01; + outb(i, FDCS->address + 1); + outb(0xf2, FDCS->address); + outb(((rpm360)? 0x55:0), FDCS->address + 1); + outb(0xaa, FDCS->address); +#endif /* CONFIG_FDC_W83977 */ + sti(); +} +#endif /* CONFIG_FD1232 */ + /* start motor, check media-changed condition and write protection */ static int start_motor(void (*function)(void) ) { @@ -1924,6 +2019,13 @@ del_timer(motor_off_timer + current_drive); set_dor(fdc, mask, data); +#ifdef CONFIG_FD1232 + if ((DP->cmos == 4)&&(_floppy == floppy_type + 31)) { + rpm_change(1); + } else { + rpm_change(0); + } +#endif /* wait_for_completion also schedules reset if needed. */ return(wait_for_completion(DRS->select_date+DP->select_delay, (timeout_fn) function)); @@ -2878,13 +2980,6 @@ set_floppy(device); raw_cmd = & default_raw_cmd; raw_cmd->flags = 0; - if (start_motor(redo_fd_request)) return; - disk_change(current_drive); - if (test_bit(current_drive, &fake_change) || - TESTF(FD_DISK_CHANGED)){ - DPRINT("disk absent or changed during operation\n"); - REPEAT; - } if (!_floppy) { /* Autodetection */ if (!probing){ DRS->probed_format = 0; @@ -2898,6 +2993,13 @@ _floppy = floppy_type+DP->autodetect[DRS->probed_format]; } else probing = 0; + if (start_motor(redo_fd_request)) return; + disk_change(current_drive); + if (test_bit(current_drive, &fake_change) || + TESTF(FD_DISK_CHANGED)){ + DPRINT("disk absent or changed during operation\n"); + REPEAT; + } errors = & (CURRENT->errors); tmp = make_raw_rw_request(); if (tmp < 2){ diff -u --new-file --recursive linux-2.2.14/drivers/block/mkfd1232dev linux-2.2.14-human/drivers/block/mkfd1232dev --- linux-2.2.14/drivers/block/mkfd1232dev Thu Jan 1 09:00:00 1970 +++ linux-2.2.14-human/drivers/block/mkfd1232dev Wed Jan 5 15:15:36 2000 @@ -0,0 +1,30 @@ +#!/bin/sh + +FORMATNO=${1-31} +MINOR0=`eval echo "\$(($FORMATNO*4))"` +MINOR1=`eval echo "\$(($FORMATNO*4+1))"` +MINOR2=`eval echo "\$(($FORMATNO*4+2))"` +MINOR3=`eval echo "\$(($FORMATNO*4+3))"` +DEV0=/dev/fd0h1232 +DEV1=/dev/fd1h1232 +DEV2=/dev/fd2h1232 +DEV3=/dev/fd3h1232 + +if [ -b $DEV0 ]; then + rm -f $DEV0 +fi +if [ -b $DEV1 ]; then + rm -f $DEV1 +fi +if [ -b $DEV2 ]; then + rm -f $DEV2 +fi +if [ -b $DEV3 ]; then + rm -f $DEV3 +fi +mknod $DEV0 b 2 $MINOR0 +mknod $DEV1 b 2 $MINOR1 +mknod $DEV2 b 2 $MINOR2 +mknod $DEV3 b 2 $MINOR3 +chmod 660 $DEV0 $DEV1 $DEV2 $DEV3 +chown root:floppy $DEV0 $DEV1 $DEV2 $DEV3