Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7D41C07E96 for ; Tue, 6 Jul 2021 14:55:15 +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 0276061289 for ; Tue, 6 Jul 2021 14:55:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0276061289 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gerhold.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BCD4782D4B; Tue, 6 Jul 2021 16:55:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gerhold.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gerhold.net header.i=@gerhold.net header.b="IhWrDiw2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B4C7B82D2D; Tue, 6 Jul 2021 16:55:04 +0200 (CEST) Received: from mo4-p02-ob.smtp.rzone.de (mo4-p02-ob.smtp.rzone.de [85.215.255.81]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 66FEE82CC1 for ; Tue, 6 Jul 2021 16:55:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gerhold.net Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=stephan@gerhold.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1625583295; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=tMwLgcBelwpYrut2mVXo3/VFx6lRIeD8fO5e+8JTupE=; b=IhWrDiw29EmVagwhDO86es2nyEYpqmTmXgxdM3eeGwSwt3vuu/2jBq+OaVE4owsv0U F89U432a52f7RUlbMymw0DfALe4xnQK5G2urs9tV+CU4xdR4hAmsdLeLgsgoyM1BWE9h d6/Yh3M8OeivsuGxR7a1KJDr20rmZ8VhZqQktbMCDBALB0A26XoAbUVRMXTAU0ZTGwsV iVoh92CbntTbR+oXJqxZamzadxTwwjMkV/oYGEsI2LDuzgDUMn0fOO517lMFges1Y/8h 4/y7/ogF3SqK1igexqVyd75rdgDiY3useVXqImNmMnIJZcibBA/Yy0u7+xSX2rBvUBLG QE7Q== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB426NnXO3" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.28.1 DYNA|AUTH) with ESMTPSA id Y070ccx66EssbL8 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 6 Jul 2021 16:54:54 +0200 (CEST) From: Stephan Gerhold To: u-boot@lists.denx.de Cc: Linus Walleij , Patrice Chotard , Stephan Gerhold , Jaehoon Chung , Peng Fan Subject: [PATCH 4/4] mmc: arm_pl180_mmci: Add configuration for ST-Ericsson Ux500v2 Date: Tue, 6 Jul 2021 16:54:36 +0200 Message-Id: <20210706145436.165037-5-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210706145436.165037-1-stephan@gerhold.net> References: <20210706145436.165037-1-stephan@gerhold.net> 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 For the eMMC on ST-Ericsson Ux500v2 we need slightly different configuration values. Use the existing switch statement to match the peripheral ID of Ux500v2 (0x10480180) and override the necessary values to make the eMMC work on devices with ST-Ericsson Ux500. Cc: Linus Walleij Signed-off-by: Stephan Gerhold --- drivers/mmc/arm_pl180_mmci.c | 22 +++++++++++++++------- drivers/mmc/arm_pl180_mmci.h | 1 + 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c index 809b86570a..f99b5f997e 100644 --- a/drivers/mmc/arm_pl180_mmci.c +++ b/drivers/mmc/arm_pl180_mmci.c @@ -443,22 +443,30 @@ static int arm_pl180_mmc_probe(struct udevice *dev) SDI_CLKCR_HWFC_EN; host->clock_in = clk_get_rate(&clk); + cfg->name = dev->name; + cfg->voltages = VOLTAGE_WINDOW_SD; + cfg->host_caps = 0; + cfg->f_min = host->clock_in / (2 * (SDI_CLKCR_CLKDIV_INIT_V1 + 1)); + cfg->f_max = MMC_CLOCK_MAX; + cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT; + periphid = dev_read_u32_default(dev, "arm,primecell-periphid", 0); switch (periphid) { case STM32_MMCI_ID: /* stm32 variant */ host->version2 = false; break; + case UX500V2_MMCI_ID: + host->pwr_init = SDI_PWR_OPD | SDI_PWR_PWRCTRL_ON; + host->clkdiv_init = SDI_CLKCR_CLKDIV_INIT_V2 | SDI_CLKCR_CLKEN | + SDI_CLKCR_HWFC_EN; + cfg->voltages = VOLTAGE_WINDOW_MMC; + cfg->f_min = host->clock_in / (2 + SDI_CLKCR_CLKDIV_INIT_V2); + host->version2 = true; + break; default: host->version2 = true; } - cfg->name = dev->name; - cfg->voltages = VOLTAGE_WINDOW_SD; - cfg->host_caps = 0; - cfg->f_min = host->clock_in / (2 * (SDI_CLKCR_CLKDIV_INIT_V1 + 1)); - cfg->f_max = MMC_CLOCK_MAX; - cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT; - gpio_request_by_name(dev, "cd-gpios", 0, &host->cd_gpio, GPIOD_IS_IN); ret = mmc_of_parse(dev, cfg); diff --git a/drivers/mmc/arm_pl180_mmci.h b/drivers/mmc/arm_pl180_mmci.h index 61ee96a112..15c29beadb 100644 --- a/drivers/mmc/arm_pl180_mmci.h +++ b/drivers/mmc/arm_pl180_mmci.h @@ -142,6 +142,7 @@ #define SDI_FIFO_BURST_SIZE 8 #define STM32_MMCI_ID 0x00880180 +#define UX500V2_MMCI_ID 0x10480180 struct sdi_registers { u32 power; /* 0x00*/ -- 2.32.0