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=-17.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 95EF2C07E96 for ; Thu, 8 Jul 2021 10:10:02 +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 E62D7619BE for ; Thu, 8 Jul 2021 10:10:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E62D7619BE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=foss.st.com 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 0E3A783172; Thu, 8 Jul 2021 12:10:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.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=foss.st.com header.i=@foss.st.com header.b="4Gtu4dW8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E7A8F83173; Thu, 8 Jul 2021 12:09:58 +0200 (CEST) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CC0B583172 for ; Thu, 8 Jul 2021 12:09:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=1823935de6=patrice.chotard@foss.st.com Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 168A71GT032167; Thu, 8 Jul 2021 12:09:54 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=MrI0pH6swk6SdvhTl+NkFLOls1rgWOWuA8HquOsxZIc=; b=4Gtu4dW8YZQn7d+GxRUZjapuSGlTu7uXaQqgqmZKwTt2YxNEmAACxSBsEZt1Zo1GvJLs bTuBwMjHr3i2JG6WeKGGAaatxD6wEXecYfrrHVVMrgC7T3RzNRfBbh/S92Kz/Em5nmg2 r9uIK2qxIGtlQuYw/3IBHBBMfmA+fPNnMHF0wr1o+usBXG0XOaH+7mi3yJCM8miT4JBV KoY6dJ4b8S/Xv6FCfiI/45PJWPZtPdSbUJESLRswQlvTn2AHvJKg+RQpcqENTuYg+/wA lmqXdS7Uwzj/aa/eubR+4CYFZu+i9+l6oQNq91cePGD5pQqCW/PMPSh2RvftLVVc2/8g Ag== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 39nwkf0ttm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Jul 2021 12:09:54 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1951010002A; Thu, 8 Jul 2021 12:09:54 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag2node3.st.com [10.75.127.6]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 0DECB21B51C; Thu, 8 Jul 2021 12:09:54 +0200 (CEST) Received: from lmecxl0573.lme.st.com (10.75.127.49) by SFHDAG2NODE3.st.com (10.75.127.6) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 8 Jul 2021 12:09:53 +0200 Subject: Re: [PATCH 4/4] mmc: arm_pl180_mmci: Add configuration for ST-Ericsson Ux500v2 To: Stephan Gerhold , CC: Linus Walleij , Patrice Chotard , Jaehoon Chung , Peng Fan References: <20210706145436.165037-1-stephan@gerhold.net> <20210706145436.165037-5-stephan@gerhold.net> From: Patrice CHOTARD Message-ID: Date: Thu, 8 Jul 2021 12:09:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210706145436.165037-5-stephan@gerhold.net> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.49] X-ClientProxiedBy: SFHDAG2NODE1.st.com (10.75.127.4) To SFHDAG2NODE3.st.com (10.75.127.6) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-08_04:2021-07-06, 2021-07-08 signatures=0 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 Hi Stephan On 7/6/21 4:54 PM, Stephan Gerhold wrote: > 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*/ > Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard on stm32f769-disco Thanks Patrice