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 2B34AEB64DA for ; Mon, 10 Jul 2023 12:47:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 32C3E86689; Mon, 10 Jul 2023 14:47:10 +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="U9Ca4mON"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E0E12865DD; Mon, 10 Jul 2023 13:08:28 +0200 (CEST) Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (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 2DF0A86301 for ; Mon, 10 Jul 2023 13:08:26 +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-wr1-x42f.google.com with SMTP id ffacd0b85a97d-313fb7f0f80so4343557f8f.2 for ; Mon, 10 Jul 2023 04:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688987305; x=1691579305; 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=YICqu2VAlxEht4DbiqVzie4p9NovZJwjZVGPKMzYPhI=; b=U9Ca4mONGOyu8lPdrOfaaewR1AyRV6cPU8CmmDEWT2WikKH1t6tAmcQMvjZlXt1Jwe fFLKPc6YkbfoiPeUd40bT53N9fev8+YDdS0gnGfP1Uyx1TvXAt0FvomD3UDhO7ylH6sa RjU2PtaC1MmqY8lrEneai9+BqsXzfiY31fvUStAbCXR7XfhcpglF4LiOHWsSp16CiTNR +Cc1gBr4vavebx+LNJAe+4Ggbgvq9xmM4suJyGSWrWZbnc/ieU3fUKS8HWWKvVNl3Lk3 xvpMx7lF60yn3fksj1ii94ZfQHGR0exrWg2RzafM+eUqArecj2LfohlSNviaI/AJPH2i E8jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688987305; x=1691579305; 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=YICqu2VAlxEht4DbiqVzie4p9NovZJwjZVGPKMzYPhI=; b=BWjxEZPr4qygF3Y5ndlg+jEQZFL6T3X/lBrDOQN284gK79oWNgeD2wBx2RsvMU8+j6 li1jMblqcxkKj63E3yyK4Wc838aayO9oeTBWZv7fu6N2i4tatJLVh130u5hfqBoo2Iyt Plca8m/nEBwpo7Z4GFqCYQQq71oVAvBnmDl6wYjrp/aq7r7qHxH55VNJlu7kS+34CWRW PyHBoZSH3DmdV+c9ULN2ie5T+mFiW+HGSIPms/ifLp8GJZjg6IQqON/KeVu5KaIVhmbB TqjHrJ1Fpe3BADrSul8kKrPkZBIWy27riPc3OGTy048xVPadeND4KVIw2GslTBs39SSB b31Q== X-Gm-Message-State: ABy/qLbRf8ieJyaBRisOMNAOAIUNPhiha93dZfj4w4/YO+lthYoKzJka wm6waMYO25wgcU4VsaU2LBP3RI5FnFiYi6VF X-Google-Smtp-Source: APBJJlGS6x5xIqK3B6FomGYPxCeg4VVeUhcZBuc3AfM9apPbfGAQhY9YI3gqaoftRt/hhwIlnmhTWw== X-Received: by 2002:adf:f84d:0:b0:313:ee33:c28d with SMTP id d13-20020adff84d000000b00313ee33c28dmr9669405wrq.17.1688987305313; Mon, 10 Jul 2023 04:08:25 -0700 (PDT) Received: from elementary-workstation.broadband ([90.240.170.103]) by smtp.gmail.com with ESMTPSA id v8-20020a05600c214800b003fc06169abdsm6670714wml.2.2023.07.10.04.08.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 04:08:24 -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 2/2] mmc: Add quirk to disable PWREN for dw_mmc Date: Mon, 10 Jul 2023 12:05:58 +0100 Message-Id: <20230710110558.61852-3-davidmhewitt@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230710110558.61852-1-davidmhewitt@gmail.com> References: <20230710110558.61852-1-davidmhewitt@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 10 Jul 2023 14:47:04 +0200 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 --- drivers/mmc/dw_mmc.c | 3 ++- drivers/mmc/rockchip_dw_mmc.c | 3 +++ include/configs/rk3568_common.h | 4 ++-- include/dwmmc.h | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) 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/configs/rk3568_common.h b/include/configs/rk3568_common.h index 1b7d3437b1..fb9897ff2e 100644 --- a/include/configs/rk3568_common.h +++ b/include/configs/rk3568_common.h @@ -20,10 +20,10 @@ "script_offset_f=0xffe000\0" \ "script_size_f=0x2000\0" \ "pxefile_addr_r=0x00e00000\0" \ - "fdt_addr_r=0x0a100000\0" \ + "fdt_addr_r=0x0c000000\0" \ "fdtoverlay_addr_r=0x02000000\0" \ "kernel_addr_r=0x02080000\0" \ - "ramdisk_addr_r=0x0a200000\0" \ + "ramdisk_addr_r=0x0c100000\0" \ "kernel_comp_addr_r=0x08000000\0" \ "kernel_comp_size=0x2000000\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