From patchwork Thu Jan 25 04:23:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Linus_L=C3=BCssing?= X-Patchwork-Id: 10183619 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E409560383 for ; Thu, 25 Jan 2018 04:24:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D498428753 for ; Thu, 25 Jan 2018 04:24:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C91CC2892A; Thu, 25 Jan 2018 04:24:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A8D2328753 for ; Thu, 25 Jan 2018 04:24:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=mknvFE55PUn6MEtJXuOta0p90t0oPcFWsKJjwUm3jv0=; b=n4niIJ5lxO5pIJ SxTn61Ly5J2sv7KU0R4rm7zpx+AJaU0aKl6j53BYxk9QzEz/ptyfXcDTxfmF3Aw9583DWLUlhfE20 O0NJiggNx6EKsYaUj17RptfrWakGN0zHBqCBxI4YmuQDHU2WaHoY8W9t2W1ZrOQts3QWrs9GpLILv gaB9mT2suB0NKfG0FqhtDdwKj9/2slcAjYsWs4XCkC7NLDov/4WHh9mOc1Eok6KQkLEuHiNC0gpg0 tp6UCj+J+ZUbcFbsTlVE1Np4o+ubjYhoo1gbmlJt1Byzb5C+rYmUHBYQ/ttD33IaaKlYQXUjqQw2S v0Ttyq3sDCGqmXu1txnA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eeZ4q-0003zJ-Aw; Thu, 25 Jan 2018 04:23:52 +0000 Received: from mail.aperture-lab.de ([2a01:4f8:171:314c::100:a1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eeZ4m-0003yC-RQ for linux-amlogic@lists.infradead.org; Thu, 25 Jan 2018 04:23:50 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.aperture-lab.de (Postfix) with ESMTP id BD64CE8A9F; Thu, 25 Jan 2018 05:23:22 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aperture-lab.de Received: from mail.aperture-lab.de ([127.0.0.1]) by localhost (mail.aperture-lab.de [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id rsMFTHGBeCNA; Thu, 25 Jan 2018 05:23:22 +0100 (CET) Received: from localhost (unknown [IPv6:2a01:170:1112:0:c85:8cff:fe0f:63fe]) (Authenticated sender: linus.luessing@c0d3.blue) by mail.aperture-lab.de (Postfix) with ESMTPSA; Thu, 25 Jan 2018 05:23:22 +0100 (CET) From: =?UTF-8?q?Linus=20L=C3=BCssing?= To: linux-amlogic@lists.infradead.org Subject: [RFC PATCH] ARM: dts: meson8b-odroidc1: add microSD support Date: Thu, 25 Jan 2018 05:23:13 +0100 Message-Id: <20180125042313.20927-1-linus.luessing@c0d3.blue> X-Mailer: git-send-email 2.15.1 MIME-Version: 1.0 X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Linus=20L=C3=BCssing?= Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The Odroid C1 features a microSD slot. This patch adds the necessary DT bindings to support it. Signed-off-by: Linus Lüssing --- This patch only worked after Martin's attempt to fix the pinctrl issues for meson8b: https://patchwork.kernel.org/patch/10181185/ Another note: I was seeing the following error message in dmesg after writing a 64MB file to the microSD card and right after typing "$ sync": [ 512.584687] mmcblk0: error -84 sending status command, retrying [ 512.586985] mmcblk0: timed out sending r/w cmd command, card status 0xd00 [ 512.591756] mmcblk0: status not valid, retrying timeout However read/write operations seemed unaffected. The file seemed fine afterwards, even after unmounting, replugging and remounting the microSD card. Not sure whether this error message could potentially point to some error in the changes in here. arch/arm/boot/dts/meson8b-odroidc1.dts | 58 ++++++++++++++++++++++++++++++++++ arch/arm/boot/dts/meson8b.dtsi | 8 +++++ 2 files changed, 66 insertions(+) diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts index d5e83051bb54..3a5603d95b70 100644 --- a/arch/arm/boot/dts/meson8b-odroidc1.dts +++ b/arch/arm/boot/dts/meson8b-odroidc1.dts @@ -54,6 +54,7 @@ aliases { serial0 = &uart_AO; + mmc0 = &sd_card_slot; }; memory { @@ -69,6 +70,37 @@ default-state = "off"; }; }; + + tflash_vdd: regulator-tflash_vdd { + /* + * signal name from schematics: TFLASH_VDD_EN + */ + compatible = "regulator-fixed"; + + regulator-name = "TFLASH_VDD"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + + gpio = <&gpio GPIOY_12 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + + tf_io: gpio-regulator-tf_io { + compatible = "regulator-gpio"; + + regulator-name = "TF_IO"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + + /* + * signal name from schematics: TF_3V3N_1V8_EN + */ + gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_HIGH>; + gpios-states = <0>; + + states = <3300000 0 + 1800000 1>; + }; }; &uart_AO { @@ -100,6 +132,32 @@ status = "okay"; }; +&sdio { + status = "okay"; + + pinctrl-0 = <&sd_b_pins>; + pinctrl-names = "default"; + + /* SD card */ + sd_card_slot: slot@1 { + compatible = "mmc-slot"; + reg = <1>; + status = "okay"; + + bus-width = <4>; + no-sdio; + cap-mmc-highspeed; + cap-sd-highspeed; + disable-wp; + + cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>; + cd-inverted; + + vmmc-supply = <&tflash_vdd>; + vqmmc-supply = <&tf_io>; + }; +}; + ðmac { status = "okay"; diff --git a/arch/arm/boot/dts/meson8b.dtsi b/arch/arm/boot/dts/meson8b.dtsi index fa5274aa370b..87687c09ca3f 100644 --- a/arch/arm/boot/dts/meson8b.dtsi +++ b/arch/arm/boot/dts/meson8b.dtsi @@ -206,6 +206,14 @@ function = "ethernet"; }; }; + + sd_b_pins: sd-b { + mux { + groups = "sd_d0_b", "sd_d1_b", "sd_d2_b", + "sd_d3_b", "sd_clk_b", "sd_cmd_b"; + function = "sd_b"; + }; + }; }; };