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 D3ED7C00528 for ; Mon, 10 Jul 2023 13:09:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CFA1E86691; Mon, 10 Jul 2023 15:09:12 +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="KU6AZJDS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0D88386675; Mon, 10 Jul 2023 15:09:11 +0200 (CEST) Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (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 953E486659 for ; Mon, 10 Jul 2023 15:09:06 +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-x32b.google.com with SMTP id 5b1f17b1804b1-3fbc5d5746cso51815695e9.2 for ; Mon, 10 Jul 2023 06:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688994545; x=1691586545; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W7FLxjfGQfmOIr3vNGDQpzRw+sN2R2Cx+zoUI9uTNUQ=; b=KU6AZJDSBwZGr6Py6qj5AgN4wGYd6CvkQEsI04piJExTKH3q3Rzfn/xU7J50VI7h9x Eh/ISfjrZK0bHvMQ52AS/ftZINzWMtg67T1hl5qF9EfHCe0L1bPrhbXtpLPAEIhAzO6X LQSYZuP0/ExtpvGdhk8MN9eisr+BChcrlCy9SBaP/jmK0STXXke4wrrzYCuSq9ED0HTx FrP9DwSR2DI/KXGUwiL2j9V6b84ObZid/NR0Cpv2Oaw/FloQYZH8iTY8ye96RzRRJqL5 /n6RnFrX9jdTPUVQ9uP7sL3yWIPcaU7lumfMeMLgKi6nMHDynNV+o7K68R9srT49HTtL Dg4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688994545; x=1691586545; h=content-transfer-encoding:mime-version:references:in-reply-to :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=MuN3ouDT5gvtUWWsnNN4gXLb6Zg9vbUnIIuXQgXWs9f3CrcnKerjGrbib+r0gCaZwT dxKRaKWTi3uv6DTfohLLqxYjl5tDzmVWvH3cmTn841hQJItyEXQa24ZX4UFtBnuk3tWR jK5EmBw/YiKKpKfFUFy9C8y0MSt3W7+buvjhyUk0KNdTlc2jI99AdDwPgYUSJG1Unv7B b4arZ7ID1PwCkZsg5jGmVwmMckjOtQg/lrsy0zXd9fMgTwoppS1FJ6vNBtzAHqSA5vcq eaNIBK/bI+0mW8HutUqtruGwzkY15dxOlGinalgyzZYGQr74/DbrH3PNOyfGzeUMyA8X mGrA== X-Gm-Message-State: ABy/qLblKmocy/GkWpM6MICERbtLkZPq6MQKZ+nIT5vulVkNjnXsO7Bi FqDBLqHNivas3iLVFskcxeuG2usWkiLD03nW X-Google-Smtp-Source: APBJJlHY3uD/SHhmBQ/T5+SuxHKMmZ2O3+ex46HQCG63/NCv/RqPt9CjM9T0a8eetvFvotD3dg/8TA== X-Received: by 2002:a1c:7218:0:b0:3fa:9561:3016 with SMTP id n24-20020a1c7218000000b003fa95613016mr10161995wmc.30.1688994545270; Mon, 10 Jul 2023 06:09:05 -0700 (PDT) Received: from elementary-workstation.broadband ([90.240.170.103]) by smtp.gmail.com with ESMTPSA id f6-20020a1c6a06000000b003fc05b89e5bsm7057964wmc.34.2023.07.10.06.09.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 06:09:04 -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:08:43 +0100 Message-Id: <20230710130843.69793-1-davidmhewitt@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230710110558.61852-3-davidmhewitt@gmail.com> References: <20230710110558.61852-3-davidmhewitt@gmail.com> 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