diff mbox series

[2/3] arm: mvebu: Espressobin: Use function mmc_get_op_cond() for detecting eMMC

Message ID 20210714143729.2396-2-pali@kernel.org
State Accepted
Commit 42ba56691ccae5a33da13a023a342fef4fa8f086
Delegated to: Stefan Roese
Headers show
Series [1/3] arm: mvebu: Espressobin: Fix setting $fdtfile env | expand

Commit Message

Pali Rohár July 14, 2021, 2:37 p.m. UTC
Use function mmc_get_op_cond() instead of mmc_init() for detecting presence
of eMMC. Documentation for this function says that it could be used to
detect the presence of SD/eMMC when no card detect logic is available.

This function is also used by mx6cuboxi board for detecting presence of eMMC.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 board/Marvell/mvebu_armada-37xx/board.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefan Roese July 15, 2021, 8:02 a.m. UTC | #1
On 14.07.21 16:37, Pali Rohár wrote:
> Use function mmc_get_op_cond() instead of mmc_init() for detecting presence
> of eMMC. Documentation for this function says that it could be used to
> detect the presence of SD/eMMC when no card detect logic is available.
> 
> This function is also used by mx6cuboxi board for detecting presence of eMMC.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> ---
>   board/Marvell/mvebu_armada-37xx/board.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c
> index 53408d37af9b..6086996b8062 100644
> --- a/board/Marvell/mvebu_armada-37xx/board.c
> +++ b/board/Marvell/mvebu_armada-37xx/board.c
> @@ -124,7 +124,7 @@ int board_late_init(void)
>   
>   	/* eMMC is mmc dev num 1 */
>   	mmc_dev = find_mmc_device(1);
> -	emmc = (mmc_dev && mmc_init(mmc_dev) == 0);
> +	emmc = (mmc_dev && mmc_get_op_cond(mmc_dev) == 0);
>   
>   	/* if eMMC is not present then remove it from DM */
>   	if (!emmc && mmc_dev) {
> 


Viele Grüße,
Stefan
diff mbox series

Patch

diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c
index 53408d37af9b..6086996b8062 100644
--- a/board/Marvell/mvebu_armada-37xx/board.c
+++ b/board/Marvell/mvebu_armada-37xx/board.c
@@ -124,7 +124,7 @@  int board_late_init(void)
 
 	/* eMMC is mmc dev num 1 */
 	mmc_dev = find_mmc_device(1);
-	emmc = (mmc_dev && mmc_init(mmc_dev) == 0);
+	emmc = (mmc_dev && mmc_get_op_cond(mmc_dev) == 0);
 
 	/* if eMMC is not present then remove it from DM */
 	if (!emmc && mmc_dev) {