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 B4B5CC77B7A for ; Tue, 16 May 2023 18:50:05 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ADAC186183; Tue, 16 May 2023 20:50:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="Iw4Nxo3T"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D54D686196; Tue, 16 May 2023 20:50:00 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (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 8794B8615F for ; Tue, 16 May 2023 20:49:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 78F7063297; Tue, 16 May 2023 18:49:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD58FC433EF; Tue, 16 May 2023 18:49:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684262995; bh=G5cidQra1mz+7T/fvInp6k+Zl7kNU/0Zbw80o8V+isA=; h=From:To:Cc:Subject:Date:From; b=Iw4Nxo3Ts/rdL7SdX6+Bm3RU7kxh3Zd84jZUjYGAeslK6hH7zY7Xy+/GwSigXqgtT 4U9+xuUKnMxKJOMvoc4OAyFvxbDcTHAIN43qmNw/hXTIMtdA+GBhdJtQe1NgRdbJ2v ZR5gWvRsZwi4PStywunQ6EntQj6T3vAiEV/mPgMF0zcD1qUsznnD3MQAzTn5mAgmMq 2jaOyRAcsNf8K913ppjA3z/SvDOQWg94m8hTvp4zcMucPcuxKjjrCX7OEZThULuSqa o5RECTNtql5jqzsLeSiqXeuKWCPMS8iW7mWPdOSYcWdnrUS/+m3nFVBS8oPaUBEau7 at/UG7Es7o9+Q== Received: by pali.im (Postfix) id BF488A47; Tue, 16 May 2023 20:49:52 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Peng Fan , Jaehoon Chung Cc: u-boot@lists.denx.de Subject: [PATCH] mmc: Do not read eMMC partition access bits by default on OMAP2PLUS and BCM283X Date: Tue, 16 May 2023 20:49:43 +0200 Message-Id: <20230516184943.7206-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 OMAP2PLUS and BCM283X mmc controllers do not work correctly with new emmc code which reads partition access bits prior mmc controller reset. So introduce a new config option MMC_ENABLE_PART_ACCESS, which is by default disabled for ARCH_OMAP2PLUS and ARCH_BCM283X; and selected for 32-bit mvebu mmc booting (which requires it). Signed-off-by: Pali Rohár --- arch/arm/mach-mvebu/Kconfig | 1 + drivers/mmc/Kconfig | 12 ++++++++++++ drivers/mmc/mmc.c | 2 ++ 3 files changed, 15 insertions(+) diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig index ac484c73f62d..fe691cd435e7 100644 --- a/arch/arm/mach-mvebu/Kconfig +++ b/arch/arm/mach-mvebu/Kconfig @@ -353,6 +353,7 @@ config MVEBU_SPL_BOOT_DEVICE_MMC imply SPL_GPIO imply SPL_LIBDISK_SUPPORT imply SPL_MMC + select MMC_ENABLE_PART_ACCESS if SPL_MMC select SUPPORT_EMMC_BOOT if SPL_MMC select SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR if SPL_MMC select SPL_BOOTROM_SUPPORT diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index de01b9687bad..ea50dfdb62c5 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -107,6 +107,18 @@ config MMC_HW_PARTITIONING This adds a command and an API to do hardware partitioning on eMMC devices. +config MMC_ENABLE_PART_ACCESS + bool "Support for MMC partition access bits" + default n if ARCH_OMAP2PLUS || ARCH_BCM283X + default y + help + Read partition access bits from partition config register before card reset command + because these bits are reset to default value (User Data Area) during card reset. + This allows us to preserve original value of partition access bits used by the code + which loaded us (for example BootROM) and use it for board specific boot purposes. + . + This is required when U-Boot is using EXT_CSD_EXTRACT_PARTITION_ACCESS macro. + config SUPPORT_EMMC_RPMB bool "Support eMMC replay protected memory block (RPMB)" imply CMD_MMC_RPMB diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 9915610d82b1..fa3c4d1937c1 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -2864,6 +2864,7 @@ int mmc_get_op_cond(struct mmc *mmc, bool quiet) retry: mmc_set_initial_state(mmc); +#ifdef CONFIG_MMC_ENABLE_PART_ACCESS /* * Read partition access bits from partition config register before card reset command * because these bits are reset to default value (User Data Area) during card reset. @@ -2878,6 +2879,7 @@ retry: ext_csd[EXT_CSD_BOOT_MULT])) mmc->part_config = ext_csd[EXT_CSD_PART_CONF] & PART_ACCESS_MASK; } +#endif /* Reset the Card */ err = mmc_go_idle(mmc); -- 2.20.1