]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: Use EXT_CSD_EXTRACT_BOOT_PART() macro for extracting boot part
authorPali Rohár <pali@kernel.org>
Sat, 11 Mar 2023 10:44:27 +0000 (11:44 +0100)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 10 Apr 2023 03:18:17 +0000 (12:18 +0900)
Mask macro PART_ACCESS_MASK filter out access bits of emmc register and
macro EXT_CSD_EXTRACT_BOOT_PART() extracts boot part bits of emmc register.
So use EXT_CSD_EXTRACT_BOOT_PART() when extracting boot partition.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
board/purism/librem5/librem5.c
cmd/mvebu/bubt.c
common/spl/spl_mmc.c

index caa02655fc4934607bbc660d83b26b5a9e33cfc0..386ed1b4fb22d135c495f89adcee4c23ddb654a1 100644 (file)
@@ -41,7 +41,7 @@ int board_early_init_f(void)
 #if IS_ENABLED(CONFIG_LOAD_ENV_FROM_MMC_BOOT_PARTITION)
 uint board_mmc_get_env_part(struct mmc *mmc)
 {
-       uint part = (mmc->part_config >> 3) & PART_ACCESS_MASK;
+       uint part = EXT_CSD_EXTRACT_BOOT_PART(mmc->part_config);
 
        if (part == 7)
                part = 0;
index 49797b23144b3bcac7ca269f137e84be0ab74a28..37ff9c455228805a01c1c8c2ed59a7673f87115a 100644 (file)
@@ -223,8 +223,7 @@ static int mmc_burn_image(size_t image_size)
        orig_part = mmc->block_dev.hwpart;
 #endif
 
-       part = (mmc->part_config >> 3) & PART_ACCESS_MASK;
-
+       part = EXT_CSD_EXTRACT_BOOT_PART(mmc->part_config);
        if (part == 7)
                part = 0;
 
index bd5e6adf1ea6a97deae937694182e2da621ece3e..a0722167044f67d6eeca91ec9fde7488db29c668 100644 (file)
@@ -378,7 +378,7 @@ int default_spl_mmc_emmc_boot_partition(struct mmc *mmc)
         * 1 and 2 match up to boot0 / boot1 and 7 is user data
         * which is the first physical partition (0).
         */
-       part = (mmc->part_config >> 3) & PART_ACCESS_MASK;
+       part = EXT_CSD_EXTRACT_BOOT_PART(mmc->part_config);
        if (part == 7)
                part = 0;
 #endif