Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2826789yba; Mon, 15 Apr 2019 21:49:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjHBPdprDaTDQtpM5hlncsiSYVBZ6l497I12Vgz0DXIe4xzz6RTPnvAN7bC9J00BTp6vBp X-Received: by 2002:a63:d713:: with SMTP id d19mr18077682pgg.145.1555390142960; Mon, 15 Apr 2019 21:49:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555390142; cv=none; d=google.com; s=arc-20160816; b=AOFdZuNEgHfRbVnqLxqH06rbxsYVSqjxD5Dqo59YWukZiDI2NiH2wi434SRoiLYoZ3 FcOv6mf1sfb2bPycpAhTdwlXzGhxcxatPxF0dPiKhEt9EEgoJ1SAJjgMU4F/dfLfSlcI oDFpxLsfyedpwC913CE3l3ne7Kc1dRRdqBqXZNl6Q5IqBBu9N0SNViayLx4BACQhPwGS kcVJPCkX7J5MDBwbB5yf7GDC5FVBg0HN4MIAvNi3uTmzS5iv/a2Lwt1yI18xxemZlxtC LWV9RPw/HKRI3JNOk3ATaU6pqVbixA0eWA1BcEJayncbT11EyEtk58PzplIdnqPhGk74 z4fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:cc:subject:date:to:from; bh=BO93O/9ikUZ8jt0v6EhehpIftIS7KICNa50bB9mV7YI=; b=eKMO0zA8rTIB4Y+MYtXbI/uZo0iOHztRCx0RQHTKlAHTIamp1odg2ukHFuy/vNezuo hHmNQN2AmOH10+HJETB21qBPZHcuwGMOcHi+LriuiWIwZSfRMmX/1au48Y7BcMMCeerj LhGim1ynfXvJNH8pEWYH9hsEamLPwPUcgYEviBRGO9OiGpB1g+ABKlTaAACW0tFZU6wj R3c1pjYoFkcZ8gChfRNzZeYfWV50nj0CmqH5GckvTYqyKsXu0D1coJg+xkCwIt0POoeZ wZRvA3qtx8Or4ogjY2kH8dL8JnGXGOQ96gcl3uMVDtbzfZRvgWFkUE3j2Da1FZF8gFTe mYUw== 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 cv9si51298660plb.371.2019.04.15.21.48.43; Mon, 15 Apr 2019 21:49:02 -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 S1726016AbfDPEsH (ORCPT + 99 others); Tue, 16 Apr 2019 00:48:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:59482 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725770AbfDPEsG (ORCPT ); Tue, 16 Apr 2019 00:48:06 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 86254AD56; Tue, 16 Apr 2019 04:48:05 +0000 (UTC) From: NeilBrown To: Ulf Hansson , Chaotian Jing Date: Tue, 16 Apr 2019 14:47:29 +1000 Subject: [PATCH 0/5] mtk-sd enhancement to support MT7621 Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, thirtythreeforty@gmail.com Message-ID: <155538933003.25108.3338569916935462285.stgit@noble.brown> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The MT7621 MIPS-based SOC contains an sdhci unit that is much the same as the units supported by mtk-sd.c. These patches enhance the driver so that I can use it on my MT7621 board (gnubee.org). Some thoughts: - I wonder if voltage-ranges should be a standard option, processed by mmc_of_parse(), rather than requiring mmc_of_parse_voltage() to be called as well? - the "compatible" name "ralink,mt7620-sdhci" doesn't fit the pattern of other names. It is a name I found in openwrt - I was previously using a driver from there. I have no objection to changing it, but I have no way to determine what the "correct" name it. - I have tested the card-detect logic but not the write-protect, as that doesn't seem to be wired on this board. - My SOC doesn't have software-controlled clocks (that I can find). To get the clocks that the driver requires, I define a "fixed-clock" with the appropriate frequency and use that for both "source" and "hclk". Many these clocks should be optional - at least hclk ?? - I don't need to reconfigure the pins for "uhs" so I just use the same pinctrl setting for "default" and for "state_uhs". Maybe "state_uhs" should be optional? For reference, excerpts from my dts file are below. Thanks, NeilBrown mmc_clock: mmc_clock@0 { #clock-cells = <0>; compatible = "fixed-clock"; clock-frequency = <48000000>; }; and sdhci: sdhci@1E130000 { status = "disabled"; compatible = "ralink,mt7620-sdhci"; reg = <0x1E130000 0x4000>; bus-width = <4>; max-frequency = <48000000>; cap-sd-highspeed; cap-mmc-highspeed; voltage-ranges = <2800 3300>; pinctrl-names = "default", "state_uhs"; pinctrl-0 = <&sdhci_pins>; pinctrl-1 = <&sdhci_pins>; clocks = <&mmc_clock &mmc_clock>; clock-names = "source", "hclk"; interrupt-parent = <&gic>; interrupts = ; }; --- NeilBrown (5): mmc: mtk-sd: support "voltage-ranges" setting. mmc: mtk-sd: don't hard-code interrupt trigger type mmc: mtk-sd: add support for config found in mt7620 family SOCs. mmc: mtk-sd: enable internal card-detect logic. mmc: mtk-sd: enable internal write-protect logic. Documentation/devicetree/bindings/mmc/mtk-sd.txt | 7 + drivers/mmc/host/mtk-sd.c | 105 +++++++++++++++++++++- 2 files changed, 104 insertions(+), 8 deletions(-) -- Signature