Received: by 10.213.65.68 with SMTP id h4csp1079073imn; Sat, 31 Mar 2018 18:44:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx48vB6SiUybdTe0Gu6HAD6ZN1Vw+sGPlvhV5EHiNgG/mAHTvtX2tbIAaW2fhONZUQ9ZupNhc X-Received: by 2002:a17:902:a582:: with SMTP id az2-v6mr4835449plb.37.1522547040440; Sat, 31 Mar 2018 18:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522547040; cv=none; d=google.com; s=arc-20160816; b=Xkt/HcLsNtZ7iGbCuJ67big64y/s4IF3oZF0mPeTf5pGwPVestmi1+/skYwcUb3VG/ JX7ksTIJbugnBhdf/wxk74nLNxT+aj/j8rQFFzp5n2pMUoakLfy4PhTItU1mWB1x5YDn 9CZ5duz5/kMwAfDIuA4dIXtw1QW7cw2uHbd2xWgS+cA4kJCScxn3GLTFLdhzd16lb1MD EgiV3WVxB5qku7k2BrJ0WdDZU9jfB/4i19O/40BOMbmjUSM6rP6bRysqzHCec04UyBA/ +D9KcMSiFGskgJgaaRAnt3s3opnAk/ymE7zjU6P9XnMqCSE1kJ3HX3eoNwF/2j/ajoYz FsZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:from:references:in-reply-to :message-id:cc:to:arc-authentication-results; bh=qkeylKAVowXc+x3Cf7nJ9EXdhQTUfSDmp+50HCpo/C8=; b=RAuPzak9h9UCmBHsFV5T375pW50MAnaWldO1R8hK71mjjUkkAnFvUwiwa0jfvN8nUe 21QLOjeF9FMx88AXFLXVQcj9ECnwSjbVQOkueZs6RcDmL49T8TYZoEPdnrdl1MUi+4Cq YEPPWb+OPkP5L7E4oCld4Dj4xdqCYtxGSaQlXQ5bChw19BsNNb+nPGTrIPdopNlZ0EB1 wAEysO+p2LinyNqxugagUtLJDdx2P5C2YCaj1OPaDNekqvG56odhd1+VJEWsdvCDfuJC mKHSJaYlrxBPlmzKnkW6SSSuqKQhUrOaBB7uawLp1M2CcXVEEWFPCxbWQ/xn/rOEFddW /uGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k17si7776020pgf.534.2018.03.31.18.43.46; Sat, 31 Mar 2018 18:44:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753455AbeDABmO (ORCPT + 99 others); Sat, 31 Mar 2018 21:42:14 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:47370 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753037AbeDABlI (ORCPT ); Sat, 31 Mar 2018 21:41:08 -0400 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id 12A1A22910; Sat, 31 Mar 2018 21:41:05 -0400 (EDT) To: Geert Uytterhoeven Cc: Laurent Vivier , Jens Axboe , linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Message-Id: <98a06aa971599e04715a718abdd83eb5742a36da.1522546571.git.fthain@telegraphics.com.au> In-Reply-To: References: From: Finn Thain Subject: [PATCH 05/12] block/swim: Use HEDSEL bit in ISM mode register Date: Sat, 31 Mar 2018 21:41:05 -0400 (EDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The floppy drive 'HEDSEL' line is normally connected to VIA1 but some models don't do this. According to 'The Guide to Macintosh Family Hardware', on the Mac IIfx the SWIM device has to generate this signal. Cc: Laurent Vivier Cc: Jens Axboe Tested-by: Stan Johnson Signed-off-by: Finn Thain --- arch/m68k/mac/iop.c | 1 + drivers/block/swim.c | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c index 7864dcca5891..23cf89da0c2d 100644 --- a/arch/m68k/mac/iop.c +++ b/arch/m68k/mac/iop.c @@ -130,6 +130,7 @@ /* Non-zero if the IOPs are present */ int iop_scc_present, iop_ism_present; +EXPORT_SYMBOL(iop_ism_present); /* structure for tracking channel listeners */ diff --git a/drivers/block/swim.c b/drivers/block/swim.c index ef4361dc5b26..3e3e72b141d3 100644 --- a/drivers/block/swim.c +++ b/drivers/block/swim.c @@ -27,6 +27,7 @@ #include #include +#include #define CARDNAME "swim" @@ -135,7 +136,8 @@ struct iwm { /* bits in setup register */ -#define S_INV_WDATA 0x01 +#define S_Q3_OUTPUT 0x01 /* SWIM */ +#define S_INV_WDATA 0x01 /* SWIM 2 */ #define S_3_5_SELECT 0x02 #define S_GCR 0x04 #define S_FCLK_DIV2 0x08 @@ -273,8 +275,13 @@ static inline void swim_select(struct swim __iomem *base, int sel) { swim_write(base, phase, RELAX); - via1_set_head(sel & 0x100); - + if (iop_ism_present) { + if (sel & 0x100) + swim_write(base, mode1, HEDSEL); + else + swim_write(base, mode0, HEDSEL); + } else + via1_set_head(sel & 0x100); swim_write(base, phase, sel & CA_MASK); } @@ -644,7 +651,12 @@ static int floppy_open(struct block_device *bdev, fmode_t mode) else fs->ref_count++; - swim_write(base, setup, S_IBM_DRIVE | S_FCLK_DIV2); + if (iop_ism_present) + swim_write(base, setup, S_IBM_DRIVE | S_FCLK_DIV2 | + S_Q3_OUTPUT); + else + swim_write(base, setup, S_IBM_DRIVE | S_FCLK_DIV2); + udelay(10); swim_drive(base, INTERNAL_DRIVE); swim_motor(base, ON); -- 2.16.1