From patchwork Thu Feb 27 11:27:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 1245738 X-Patchwork-Delegate: narmstrong@baylibre.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=CVwz9mQt; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Sr5F3wbWz9sR4 for ; Thu, 27 Feb 2020 22:28:16 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 42F1E80E7E; Thu, 27 Feb 2020 12:27:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.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=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="CVwz9mQt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CAE5B80EC2; Thu, 27 Feb 2020 12:27:50 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (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 1D51180829 for ; Thu, 27 Feb 2020 12:27:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbrunet@baylibre.com Received: by mail-wr1-x443.google.com with SMTP id r7so574933wro.2 for ; Thu, 27 Feb 2020 03:27:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YkquPcL5jBD3++tR7QxPPSvL68P8aniN4bVK2eYSeRE=; b=CVwz9mQt9ZsBYrV4LjNRwH6g27B+yEO1VEI7tDKUZoHtcTtfiC54A5+Gv4SnPe2EmA GadJqJGamUKsvf0xkQVdQtbGahZ4iMFdRyzXHZxouda2wWTBsoTOomt63WuzBzJ+IfLC lxJ3m8XjvgmfBu71GVDM1JN8VAHrUuOUcfmGd4LmBRfacxS81aNLIK173ngZR1Nm12E5 SfAVdDsD9iVM1DBpyxKaVl/Df9VMkKM73IQ7CZeKqKTzVZUMe/hdTrM9Yl47ALAw1GRn aC6fdzJGuA8SqFA9WrNbw+EjHDKAWQJiZWUdd1VxeQD8HqsgIJsi8SvjUyYEPPDnLqb4 SEqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YkquPcL5jBD3++tR7QxPPSvL68P8aniN4bVK2eYSeRE=; b=suDazVPR56NPUcUh07KkdMvbETo52aXc3Abnca9y2S7pYtaIlfP60dUNmhDqqs1iu0 gfhpXmVmVE9JVZGokhETWbCNIzupnMA49emOmpsjEP0i/+0UeGzD6nhAr/g3XhjDG86p tTNi7O2CILYNToYekoHRy7PcMvxJy5UjtWy3snHBj0U8w7m5CAqkBVJmA1ZTK067Fv40 DAIuIJp+fW9TBf8ihncmiuYXx3dBWQbydTGfHfHfF4CY0n+LiQ5OcXmg4MJ97gycaI/j DdN2jNtHfWLNjJua3X1UB2yoJM2wgVtKTa13T/R/jusKl2gpLcQYRx3bgTsqaW9nTqVl k2Mg== X-Gm-Message-State: APjAAAUNubO3CNS1Wn2BB+PbemGZc+kNnroRij3rcSaEf92U0Xz3C6Hv 9B6n/NXHv382KW7RxqzUUsHllA== X-Google-Smtp-Source: APXvYqxD70LIcRC8E82KrxFOUXlQ7d/RaijmkxeDAubpn4oLB8e5yef2rHjApQ/tMnkpOsnoNUFn8w== X-Received: by 2002:a5d:61ce:: with SMTP id q14mr4359842wrv.222.1582802863611; Thu, 27 Feb 2020 03:27:43 -0800 (PST) Received: from starbuck.baylibre.local (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id c26sm7161131wmb.8.2020.02.27.03.27.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 03:27:42 -0800 (PST) From: Jerome Brunet To: Neil Armstrong , u-boot@lists.denx.de, u-boot-amlogic@groups.io Cc: Jerome Brunet , Kevin Hilman Subject: [PATCH v2 2/6] mmc: meson-gx: enable input clocks Date: Thu, 27 Feb 2020 12:27:34 +0100 Message-Id: <20200227112738.494579-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200227112738.494579-1-jbrunet@baylibre.com> References: <20200227112738.494579-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.102.2 at phobos.denx.de X-Virus-Status: Clean Until now, the mmc clock was left in a good enough state by the ROM code to be used by the controller. However on some SoC, if the ROM code finds a bootloader on USB or SPI, it might leave the MMC clock in state the controller cannot work with. Enable the input clocks provided to the mmc controller. While the u-boot mmc controller driver is not doing fancy settings like the Linux, it at least needs to make these clocks are running. Reviewed-by: Neil Armstrong Signed-off-by: Jerome Brunet --- drivers/mmc/meson_gx_mmc.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/meson_gx_mmc.c b/drivers/mmc/meson_gx_mmc.c index 031cc79ccb1f..7060f15787f6 100644 --- a/drivers/mmc/meson_gx_mmc.c +++ b/drivers/mmc/meson_gx_mmc.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -240,12 +241,23 @@ static int meson_mmc_probe(struct udevice *dev) struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev); struct mmc *mmc = &pdata->mmc; struct mmc_config *cfg = &pdata->cfg; + struct clk_bulk clocks; uint32_t val; + int ret; + #ifdef CONFIG_PWRSEQ struct udevice *pwr_dev; - int ret; #endif + /* Enable the clocks feeding the MMC controller */ + ret = clk_get_bulk(dev, &clocks); + if (ret) + return ret; + + ret = clk_enable_bulk(&clocks); + if (ret) + return ret; + cfg->voltages = MMC_VDD_33_34 | MMC_VDD_32_33 | MMC_VDD_31_32 | MMC_VDD_165_195; cfg->host_caps = MMC_MODE_8BIT | MMC_MODE_4BIT |