From mboxrd@z Thu Jan 1 00:00:00 1970 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D480CEB64DC for ; Mon, 10 Jul 2023 13:00:53 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D5F5186655; Mon, 10 Jul 2023 15:00:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PKJMblXz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4C5C386661; Mon, 10 Jul 2023 15:00:50 +0200 (CEST) Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8BDF9865EC for ; Mon, 10 Jul 2023 15:00:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=davidmhewitt@gmail.com Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3fbf1b82d9cso46610655e9.2 for ; Mon, 10 Jul 2023 06:00:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688994047; x=1691586047; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=W7FLxjfGQfmOIr3vNGDQpzRw+sN2R2Cx+zoUI9uTNUQ=; b=PKJMblXzy1WAQC0j5/juNdlHsx/AyDP0J2YJIge+1aEYksqhqkJ3OTZyS0SjtKJxG+ f4yCa9cjOi8OKZlBwwMXHBETo0lddka1XFu7GC14jNWUKb5yC0CJHRmHG6OvqkIJgHIN 4aVTdKf9jYc7Ceu7hBDmFM/oV7DKI+nWjPf7XdrGkJ4E1jl6b6H/I5x09kbiHDIUulaN eU5+nT9zvv3nsJJMAUoQRLE7EnTsSBqUUj9XlNne3TBLQYUDBC8klkiSzLtngxyHG4za g6a5Xg+EBc/D38p5ccWNw9kHWSOS5s0S/P+x3xzVnz8AKAKv1k3zd3xo6eTDXmb3qJLB 9tMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688994047; x=1691586047; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=W7FLxjfGQfmOIr3vNGDQpzRw+sN2R2Cx+zoUI9uTNUQ=; b=HV8xJI0rf1Kugc2QJAGNjbmM/5v5hSvZXISQO3f13c0EfDT3+B80TO/NYpacm0IBDn A+C4JpgKklud+hxSsPfftXj61+88Cfce/xXBHFy7Zer+Bgs/IYvmj0g/BoAe3OZenlDq TRYGAhkW1u7UiOUB/BfIWpf7/algUXgDNMeHOPhvcq0tV5MiHFVrjM69mj5xFUrIHFOX h3ILnEUhZSuthyi1FJPxx9oOm6/fs6/6TAa0mom62sjBIfQgb/K1UKC9Jrz0zmkIMYrE aUYG+OfLdyCkD7HwJsX3ijQlOnkEI72LmqL9j8myHDi+p/ef1AgWQAXvS5Go8moPSPZg p9UA== X-Gm-Message-State: ABy/qLZarv3xzD/WZ5hjN6Zp2CQ/EM3DE0+0sfuDTbV9uD5uYMWH9wIr 8b6qztAJIWJP2N4EBuENESio7NgvyurU32ZT X-Google-Smtp-Source: APBJJlFsTzBu1862gIEl2JOEk/VHqWGPdfrNBZoSi8Ew6u5e+J6U+sZoMZIHZfSMSkfJqO5Sq7I+Dw== X-Received: by 2002:a7b:c8c9:0:b0:3fc:9ed:daad with SMTP id f9-20020a7bc8c9000000b003fc09eddaadmr5251461wml.36.1688994045245; Mon, 10 Jul 2023 06:00:45 -0700 (PDT) Received: from elementary-workstation.broadband ([90.240.170.103]) by smtp.gmail.com with ESMTPSA id n15-20020a5d420f000000b00314145e6d61sm11713876wrq.6.2023.07.10.06.00.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 06:00:44 -0700 (PDT) From: David Hewitt To: u-boot@lists.denx.de Cc: David Hewitt , Simon Glass , Philipp Tomsich , Kever Yang , Peng Fan , Jaehoon Chung Subject: [PATCH v2 2/2] mmc: Add quirk to disable PWREN for dw_mmc Date: Mon, 10 Jul 2023 14:00:30 +0100 Message-Id: <20230710130030.69085-1-davidmhewitt@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean This is required for correct booting of the PINE64 PineTab2. If PWREN is pulled high on this device, the SD card cannot be detected. This is required in other PINE64 devices (e.g. Quartz64 Model A) too. See commit ba33172a36f298641f51a5e6b855c3e89e3f5d3e in https://github.com/CounterPillow/u-boot-quartz64 Signed-off-by: David Hewitt Cc: Simon Glass Cc: Philipp Tomsich Cc: Kever Yang Cc: Peng Fan Cc: Jaehoon Chung --- Changes for v2: - Removed an unrelated change drivers/mmc/dw_mmc.c | 3 ++- drivers/mmc/rockchip_dw_mmc.c | 3 +++ include/dwmmc.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index 5085a3b491..cb1d99132f 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -530,7 +530,8 @@ static int dwmci_init(struct mmc *mmc) if (host->board_init) host->board_init(host); - dwmci_writel(host, DWMCI_PWREN, 1); + if (!(host->quirks & DWMCI_QUIRK_DISABLE_PWREN)) + dwmci_writel(host, DWMCI_PWREN, 1); if (!dwmci_wait_reset(host, DWMCI_RESET_ALL)) { debug("%s[%d] Fail-reset!!\n", __func__, __LINE__); diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c index 72c820ee63..af6ac59a46 100644 --- a/drivers/mmc/rockchip_dw_mmc.c +++ b/drivers/mmc/rockchip_dw_mmc.c @@ -78,6 +78,9 @@ static int rockchip_dwmmc_of_to_plat(struct udevice *dev) else host->dev_index = 1; + if (dev_read_bool(dev, "rockchip,disable-pwren-quirk")) + host->quirks |= DWMCI_QUIRK_DISABLE_PWREN; + priv->fifo_depth = dev_read_u32_default(dev, "fifo-depth", 0); if (priv->fifo_depth < 0) diff --git a/include/dwmmc.h b/include/dwmmc.h index 136a95b8cd..98aebb46f1 100644 --- a/include/dwmmc.h +++ b/include/dwmmc.h @@ -141,6 +141,7 @@ /* quirks */ #define DWMCI_QUIRK_DISABLE_SMU (1 << 0) +#define DWMCI_QUIRK_DISABLE_PWREN (1 << 1) /** * struct dwmci_host - Information about a designware MMC host -- 2.34.1