From: "Pali Rohár" <pali@kernel.org>
To: Peng Fan <peng.fan@nxp.com>, Jaehoon Chung <jh80.chung@samsung.com>
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 [thread overview]
Message-ID: <20230516184943.7206-1-pali@kernel.org> (raw)
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 <pali@kernel.org>
---
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
next reply other threads:[~2023-05-16 18:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-16 18:49 Pali Rohár [this message]
2023-06-11 22:43 ` [PATCH] mmc: Do not read eMMC partition access bits by default on OMAP2PLUS and BCM283X Pali Rohár
2023-06-14 9:42 ` Peng Fan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230516184943.7206-1-pali@kernel.org \
--to=pali@kernel.org \
--cc=jh80.chung@samsung.com \
--cc=peng.fan@nxp.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.