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 B2082C6FD1F for ; Sat, 11 Mar 2023 10:44:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9BDE685966; Sat, 11 Mar 2023 11:44:52 +0100 (CET) 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="Kyz0uOfh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B36D685813; Sat, 11 Mar 2023 11:44:50 +0100 (CET) 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 89AAC859AB for ; Sat, 11 Mar 2023 11:44:48 +0100 (CET) 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 6629660AED; Sat, 11 Mar 2023 10:44:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A555AC433D2; Sat, 11 Mar 2023 10:44:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678531486; bh=4uELJBZg49lVGezb43kDNYciqXZwXOcxFL+c7O/Sp7o=; h=From:To:Cc:Subject:Date:From; b=Kyz0uOfh/o+3TKsmp9wcNvkJrKSYIi5rLt/vR12EqdPXZjZ25DrbHmS1J3cn/9n/q Fj/LfkbNyq49hc8dG3QIKt2kGC2aE36Ast4zmO2OE/A++fg5sSxHwMgjN45jqSrm/S w7S89GP5t/uSSkARidRduOhN098FcljS/thNglUEmRl3PYOB11GxR8JNvN4vnFQ7HZ 0qCaRpPLSbuDy2R0uJqrQKsv6TIDj9RSFXKeFh0IwNe14Md9jxFILiwDV7pK6vQVRS 85d/ciKsLt4xuH2AZPrt4z8sFuuqVKFDJdsMecs+ffH+BLr987DVeEzcXARfGmctp+ Y16wiJPkaU2gA== Received: by pali.im (Postfix) id 4DA5976B; Sat, 11 Mar 2023 11:44:44 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Angus Ainslie , Stefan Roese , Simon Glass Cc: kernel@puri.sm, u-boot@lists.denx.de Subject: [PATCH u-boot] mmc: Use EXT_CSD_EXTRACT_BOOT_PART() macro for extracting boot part Date: Sat, 11 Mar 2023 11:44:27 +0100 Message-Id: <20230311104427.18421-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 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 --- board/purism/librem5/librem5.c | 2 +- cmd/mvebu/bubt.c | 3 +-- common/spl/spl_mmc.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/board/purism/librem5/librem5.c b/board/purism/librem5/librem5.c index caa02655fc49..386ed1b4fb22 100644 --- a/board/purism/librem5/librem5.c +++ b/board/purism/librem5/librem5.c @@ -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; diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c index 49797b23144b..37ff9c455228 100644 --- a/cmd/mvebu/bubt.c +++ b/cmd/mvebu/bubt.c @@ -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; diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index bd5e6adf1ea6..a0722167044f 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -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 -- 2.20.1