Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0C21C433F5 for ; Wed, 27 Oct 2021 11:28:26 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 16E2E6103C for ; Wed, 27 Oct 2021 11:28:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 16E2E6103C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 37EA983409; Wed, 27 Oct 2021 13:28:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=linux.intel.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id D15B0834A3; Wed, 27 Oct 2021 13:28:22 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CD26D80D28 for ; Wed, 27 Oct 2021 13:28:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=linux.intel.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=andriy.shevchenko@linux.intel.com X-IronPort-AV: E=McAfee;i="6200,9189,10149"; a="230086177" X-IronPort-AV: E=Sophos;i="5.87,186,1631602800"; d="scan'208";a="230086177" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2021 04:28:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,186,1631602800"; d="scan'208";a="579592736" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 27 Oct 2021 04:28:14 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3B1B3E7; Wed, 27 Oct 2021 14:28:14 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Bin Meng , Simon Glass , u-boot@lists.denx.de Subject: [PATCH v2 2/2] x86: edison: Don't take SD card detect pin into consideration Date: Wed, 27 Oct 2021 14:28:10 +0300 Message-Id: <20211027112810.12947-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211027112810.12947-1-andriy.shevchenko@linux.intel.com> References: <20211027112810.12947-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean There are two PCB designs in the wild which use the opposite signaling for SD card detection. This makes U-Boot working in one case and failing in the other. Quirk this out by disconnecting SD card detection pin from the PCB by switching it to mode 3. In the disconnected state the read value is always the same and inverted to what we are expecting in the code. BugLink: https://github.com/edison-fw/meta-intel-edison/issues/136 Signed-off-by: Andy Shevchenko Reviewed-by: Bin Meng --- v2: added tag, updated commit message and comments in DTS (Bin) arch/x86/dts/edison.dts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/x86/dts/edison.dts b/arch/x86/dts/edison.dts index 2c8cf6c07102..b3658b8c3049 100644 --- a/arch/x86/dts/edison.dts +++ b/arch/x86/dts/edison.dts @@ -94,6 +94,12 @@ sdcard: mmc@ff3fa000 { compatible = "intel,sdhci-tangier"; reg = <0xff3fa000 0x1000>; + /* + * In the disconnected state of the SD Card Detection pin + * the read value is always the same and inverted to what + * we are expecting in the code. + */ + cd-inverted; }; pmu: power@ff00b000 { @@ -131,6 +137,17 @@ compatible = "intel,pinctrl-tangier"; reg = <0xff0c0000 0x8000>; + /* + * Disconnect SD card detection pin, so it won't affect + * the reality on two different PCB designs where it's + * using the opposite signaling: Edison/Arduino uses + * Active Low, while SparkFun went with Active High. + */ + sd_cd@0 { + pad-offset = <37>; + mode-func = <3>; + }; + /* * Initial configuration came from the firmware. * Which quite likely has been used in the phones, where I2C #8, -- 2.33.0