diff mbox series

[U-Boot,v1,3/4] mmc: omap_hsmmc: compile out ADMA support for am33xx and omap34xx

Message ID 1519295148-6817-4-git-send-email-jjhiblot@ti.com
State Superseded
Delegated to: Jaehoon Chung
Headers show
Series mmc: omap_hsmmc: Reduce the footprint of the driver and fix am335x clock | expand

Commit Message

Jean-Jacques Hiblot Feb. 22, 2018, 10:25 a.m. UTC
This reduces the size of the binary by about 600 bytes.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
---

 drivers/mmc/omap_hsmmc.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

Comments

Tom Rini Feb. 22, 2018, 3:47 p.m. UTC | #1
On Thu, Feb 22, 2018 at 11:25:47AM +0100, Jean-Jacques Hiblot wrote:
> This reduces the size of the binary by about 600 bytes.
> 
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
> ---
> 
>  drivers/mmc/omap_hsmmc.c | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
> index 8b57edc..31c1f66 100644
> --- a/drivers/mmc/omap_hsmmc.c
> +++ b/drivers/mmc/omap_hsmmc.c
> @@ -48,6 +48,10 @@
>  #include <dm.h>
>  #include <power/regulator.h>
>  
> +#if !defined(CONFIG_AM33XX) && !defined(CONFIG_OMAP34XX)
> +#define ADMA_SUPPORT
> +#endif
> +
>  DECLARE_GLOBAL_DATA_PTR;
>  
>  /* simplify defines to OMAP_HSMMC_USE_GPIO */
> @@ -93,7 +97,7 @@ struct omap_hsmmc_data {
>  	enum bus_mode mode;
>  #endif
>  	u8 controller_flags;
> -#ifndef CONFIG_OMAP34XX
> +#ifdef ADMA_SUPPORT

How about we add CONFIG_MMC_OMAP_HS_ADMA, and select it on !AM33XX &&
!OMAP34XX, and then test that here?  Thanks!
Jaehoon Chung Feb. 23, 2018, 7:06 a.m. UTC | #2
On 02/23/2018 12:47 AM, Tom Rini wrote:
> On Thu, Feb 22, 2018 at 11:25:47AM +0100, Jean-Jacques Hiblot wrote:
>> This reduces the size of the binary by about 600 bytes.
>>
>> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
>> ---
>>
>>  drivers/mmc/omap_hsmmc.c | 16 ++++++++++------
>>  1 file changed, 10 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
>> index 8b57edc..31c1f66 100644
>> --- a/drivers/mmc/omap_hsmmc.c
>> +++ b/drivers/mmc/omap_hsmmc.c
>> @@ -48,6 +48,10 @@
>>  #include <dm.h>
>>  #include <power/regulator.h>
>>  
>> +#if !defined(CONFIG_AM33XX) && !defined(CONFIG_OMAP34XX)
>> +#define ADMA_SUPPORT
>> +#endif
>> +
>>  DECLARE_GLOBAL_DATA_PTR;
>>  
>>  /* simplify defines to OMAP_HSMMC_USE_GPIO */
>> @@ -93,7 +97,7 @@ struct omap_hsmmc_data {
>>  	enum bus_mode mode;
>>  #endif
>>  	u8 controller_flags;
>> -#ifndef CONFIG_OMAP34XX
>> +#ifdef ADMA_SUPPORT
> 
> How about we add CONFIG_MMC_OMAP_HS_ADMA, and select it on !AM33XX &&
> !OMAP34XX, and then test that here?  Thanks!

I agreed Tom's suggestion. 
If you can send v2 with it, I will pick these series with Tom's Reviewed's tag and Adam's Tested tag.

Best Regards,
Jaehoon Chung

>
diff mbox series

Patch

diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index 8b57edc..31c1f66 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -48,6 +48,10 @@ 
 #include <dm.h>
 #include <power/regulator.h>
 
+#if !defined(CONFIG_AM33XX) && !defined(CONFIG_OMAP34XX)
+#define ADMA_SUPPORT
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
 /* simplify defines to OMAP_HSMMC_USE_GPIO */
@@ -93,7 +97,7 @@  struct omap_hsmmc_data {
 	enum bus_mode mode;
 #endif
 	u8 controller_flags;
-#ifndef CONFIG_OMAP34XX
+#ifdef ADMA_SUPPORT
 	struct omap_hsmmc_adma_desc *adma_desc_table;
 	uint desc_slot;
 #endif
@@ -117,7 +121,7 @@  struct omap_mmc_of_data {
 	u8 controller_flags;
 };
 
-#ifndef CONFIG_OMAP34XX
+#ifdef ADMA_SUPPORT
 struct omap_hsmmc_adma_desc {
 	u8 attr;
 	u8 reserved;
@@ -741,7 +745,7 @@  static int omap_hsmmc_init_setup(struct mmc *mmc)
 			return -ETIMEDOUT;
 		}
 	}
-#ifndef CONFIG_OMAP34XX
+#ifdef ADMA_SUPPORT
 	reg_val = readl(&mmc_base->hl_hwinfo);
 	if (reg_val & MADMA_EN)
 		priv->controller_flags |= OMAP_HSMMC_USE_ADMA;
@@ -834,7 +838,7 @@  static void mmc_reset_controller_fsm(struct hsmmc *mmc_base, u32 bit)
 	}
 }
 
-#ifndef CONFIG_OMAP34XX
+#ifdef ADMA_SUPPORT
 static void omap_hsmmc_adma_desc(struct mmc *mmc, char *buf, u16 len, bool end)
 {
 	struct omap_hsmmc_data *priv = omap_hsmmc_get_data(mmc);
@@ -1037,7 +1041,7 @@  static int omap_hsmmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
 		else
 			flags |= (DP_DATA | DDIR_WRITE);
 
-#ifndef CONFIG_OMAP34XX
+#ifdef ADMA_SUPPORT
 		if ((priv->controller_flags & OMAP_HSMMC_USE_ADMA) &&
 		    !mmc_is_tuning_cmd(cmd->cmdidx)) {
 			omap_hsmmc_prepare_data(mmc, data);
@@ -1082,7 +1086,7 @@  static int omap_hsmmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
 		}
 	}
 
-#ifndef CONFIG_OMAP34XX
+#ifdef ADMA_SUPPORT
 	if ((priv->controller_flags & OMAP_HSMMC_USE_ADMA) && data &&
 	    !mmc_is_tuning_cmd(cmd->cmdidx)) {
 		u32 sz_mb, timeout;