AFAIK, timing requirements for the various FDHD drive mechanisms aren't well documented. But we do have the UPD72070 spec and secondary sources like swim3.c and mkLinux source code. This patch is needed to satisfy the requirements in the UPD72070 spec and follows mkLinux. Change the LSTRB pulse to 2 microseconds, because this is what mkLinux does. Inside Macintosh says, "Hold LSTRB high for at least one usec but not more than one msec". When a disk is ejected, pause before de-asserting /ENBL. Wait 150 us after the STEP command for valid signalling. Pause for 1 us after setting the step direction before sending the STEP command. Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support") Signed-off-by: Finn Thain --- drivers/block/swim.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/block/swim.c b/drivers/block/swim.c index 77d7ac3765ae..44fe7a79059c 100644 --- a/drivers/block/swim.c +++ b/drivers/block/swim.c @@ -290,7 +290,7 @@ static inline void swim_action(struct swim __iomem *base, int action) swim_select(base, action); udelay(1); swim_write(base, phase, action | LSTRB); - udelay(1); + udelay(2); swim_write(base, phase, action); udelay(1); @@ -340,6 +340,7 @@ static inline void swim_drive(struct swim __iomem *base, swim_write(base, mode0, EXTERNAL_DRIVE); swim_write(base, mode0, MOTON); } + udelay(1); } static inline void swim_motor(struct swim __iomem *base, @@ -358,6 +359,7 @@ static inline void swim_eject(struct swim __iomem *base) { swim_action(base, EJECT); swim_readbit_timeout(base, DISK_IN, false, 2000 * 1000); + msleep(1); } static inline void swim_head(struct swim __iomem *base, enum head head) @@ -371,6 +373,7 @@ static inline void swim_head(struct swim __iomem *base, enum head head) static inline int swim_step(struct swim __iomem *base) { swim_action(base, STEP); + udelay(150); return swim_readbit_timeout_atomic(base, STEP, false, 20 * 1000); } @@ -401,6 +404,7 @@ static inline int swim_seek(struct swim __iomem *base, int step) step = -step; } else if (step > 0) swim_action(base, SEEK_POSITIVE); + udelay(1); swim_READY_timeout(base); -- 2.52.0