diff mbox

[U-Boot] arm: socfpga: fix up a questionable macro for SDMMC

Message ID 1449012047-7763-1-git-send-email-dinguyen@opensource.altera.com
State Superseded
Delegated to: Marek Vasut
Headers show

Commit Message

Dinh Nguyen Dec. 1, 2015, 11:20 p.m. UTC
From: Dinh Nguyen <dinguyen@opensource.altera.com>

Not sure what made this macro questionable, but edit the macro to be similar
to what is used in Linux.

Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
---
 arch/arm/mach-socfpga/include/mach/system_manager.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Marek Vasut Dec. 1, 2015, 11:30 p.m. UTC | #1
On Wednesday, December 02, 2015 at 12:20:47 AM, dinguyen@opensource.altera.com 
wrote:
> From: Dinh Nguyen <dinguyen@opensource.altera.com>
> 
> Not sure what made this macro questionable, but edit the macro to be
> similar to what is used in Linux.

It should most likely be dissolved and moved into socfpga_dw_mmc.c , since
it's used only once in there. What do you think ?

> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
> ---
>  arch/arm/mach-socfpga/include/mach/system_manager.h | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-socfpga/include/mach/system_manager.h
> b/arch/arm/mach-socfpga/include/mach/system_manager.h index
> 618c92f..c0566b0 100644
> --- a/arch/arm/mach-socfpga/include/mach/system_manager.h
> +++ b/arch/arm/mach-socfpga/include/mach/system_manager.h
> @@ -201,9 +201,8 @@ struct socfpga_system_manager {
>  #define SYSMGR_FPGAINTF_NAND	(1 << 4)
>  #define SYSMGR_FPGAINTF_SDMMC	(1 << 5)
> 
> -/* FIXME: This is questionable macro. */
>  #define SYSMGR_SDMMC_CTRL_SET(smplsel, drvsel)	\
> -	((((drvsel) << 0) & 0x7) | (((smplsel) << 3) & 0x38))
> +	((((smplsel) & 0x7) << 3) | (((drvsel) & 0x7) << 0))
> 
>  /* EMAC Group Bit definitions */
>  #define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII	0x0

Best regards,
Marek Vasut
diff mbox

Patch

diff --git a/arch/arm/mach-socfpga/include/mach/system_manager.h b/arch/arm/mach-socfpga/include/mach/system_manager.h
index 618c92f..c0566b0 100644
--- a/arch/arm/mach-socfpga/include/mach/system_manager.h
+++ b/arch/arm/mach-socfpga/include/mach/system_manager.h
@@ -201,9 +201,8 @@  struct socfpga_system_manager {
 #define SYSMGR_FPGAINTF_NAND	(1 << 4)
 #define SYSMGR_FPGAINTF_SDMMC	(1 << 5)
 
-/* FIXME: This is questionable macro. */
 #define SYSMGR_SDMMC_CTRL_SET(smplsel, drvsel)	\
-	((((drvsel) << 0) & 0x7) | (((smplsel) << 3) & 0x38))
+	((((smplsel) & 0x7) << 3) | (((drvsel) & 0x7) << 0))
 
 /* EMAC Group Bit definitions */
 #define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII	0x0