mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] NOR flash: reduce size of cfiword_t if not using 64-bit bus.
@ 2012-05-05 21:35 Krzysztof Halasa
  2012-05-11 18:40 ` Sascha Hauer
  2012-05-13  9:03 ` Sascha Hauer
  0 siblings, 2 replies; 4+ messages in thread
From: Krzysztof Halasa @ 2012-05-05 21:35 UTC (permalink / raw)
  To: barebox

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>

diff --git a/drivers/nor/cfi_flash.h b/drivers/nor/cfi_flash.h
index df482b6..fec0894 100644
--- a/drivers/nor/cfi_flash.h
+++ b/drivers/nor/cfi_flash.h
@@ -30,7 +30,17 @@
 #include <linux/mtd/mtd.h>
 
 typedef unsigned long flash_sect_t;
+
+#if   defined(CONFIG_DRIVER_CFI_BANK_WIDTH_8)
 typedef u64 cfiword_t;
+#elif defined(CONFIG_DRIVER_CFI_BANK_WIDTH_4)
+typedef u32 cfiword_t;
+#elif defined(CONFIG_DRIVER_CFI_BANK_WIDTH_2)
+typedef u16 cfiword_t;
+#else
+typedef u8 cfiword_t;
+#endif
+
 struct cfi_cmd_set;
 
 /*-----------------------------------------------------------------------

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] NOR flash: reduce size of cfiword_t if not using 64-bit bus.
  2012-05-05 21:35 [PATCH] NOR flash: reduce size of cfiword_t if not using 64-bit bus Krzysztof Halasa
@ 2012-05-11 18:40 ` Sascha Hauer
  2012-05-12 19:09   ` Krzysztof Halasa
  2012-05-13  9:03 ` Sascha Hauer
  1 sibling, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2012-05-11 18:40 UTC (permalink / raw)
  To: Krzysztof Halasa; +Cc: barebox

Hi Krzysztof,

On Sat, May 05, 2012 at 11:35:10PM +0200, Krzysztof Halasa wrote:
> Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
> 
> diff --git a/drivers/nor/cfi_flash.h b/drivers/nor/cfi_flash.h
> index df482b6..fec0894 100644
> --- a/drivers/nor/cfi_flash.h
> +++ b/drivers/nor/cfi_flash.h
> @@ -30,7 +30,17 @@
>  #include <linux/mtd/mtd.h>
>  
>  typedef unsigned long flash_sect_t;
> +
> +#if   defined(CONFIG_DRIVER_CFI_BANK_WIDTH_8)
>  typedef u64 cfiword_t;
> +#elif defined(CONFIG_DRIVER_CFI_BANK_WIDTH_4)
> +typedef u32 cfiword_t;
> +#elif defined(CONFIG_DRIVER_CFI_BANK_WIDTH_2)
> +typedef u16 cfiword_t;
> +#else
> +typedef u8 cfiword_t;
> +#endif

Is this worth it? Do we safe binary size or what else is the reasoning
for this patch?

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] NOR flash: reduce size of cfiword_t if not using 64-bit bus.
  2012-05-11 18:40 ` Sascha Hauer
@ 2012-05-12 19:09   ` Krzysztof Halasa
  0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Halasa @ 2012-05-12 19:09 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Hi,

Sascha Hauer <s.hauer@pengutronix.de> writes:

>> +++ b/drivers/nor/cfi_flash.h
>> @@ -30,7 +30,17 @@
>>  #include <linux/mtd/mtd.h>
>>  
>>  typedef unsigned long flash_sect_t;
>> +
>> +#if   defined(CONFIG_DRIVER_CFI_BANK_WIDTH_8)
>>  typedef u64 cfiword_t;
>> +#elif defined(CONFIG_DRIVER_CFI_BANK_WIDTH_4)
>> +typedef u32 cfiword_t;
>> +#elif defined(CONFIG_DRIVER_CFI_BANK_WIDTH_2)
>> +typedef u16 cfiword_t;
>> +#else
>> +typedef u8 cfiword_t;
>> +#endif
>
> Is this worth it? Do we safe binary size or what else is the reasoning
> for this patch?

Well, I haven't done any measurments :-(
But I guess long long operations on a 32-bit CPU aren't very effective.

Just checked, with WIDTH_2 on my IXP425 the barebox.bin shrunk from
239456 to 239264 bytes. That's 192 bytes saved with this patch.
-- 
Krzysztof Halasa

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] NOR flash: reduce size of cfiword_t if not using 64-bit bus.
  2012-05-05 21:35 [PATCH] NOR flash: reduce size of cfiword_t if not using 64-bit bus Krzysztof Halasa
  2012-05-11 18:40 ` Sascha Hauer
@ 2012-05-13  9:03 ` Sascha Hauer
  1 sibling, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2012-05-13  9:03 UTC (permalink / raw)
  To: Krzysztof Halasa; +Cc: barebox

On Sat, May 05, 2012 at 11:35:10PM +0200, Krzysztof Halasa wrote:
> Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>

Applied, thanks

Sascha

> 
> diff --git a/drivers/nor/cfi_flash.h b/drivers/nor/cfi_flash.h
> index df482b6..fec0894 100644
> --- a/drivers/nor/cfi_flash.h
> +++ b/drivers/nor/cfi_flash.h
> @@ -30,7 +30,17 @@
>  #include <linux/mtd/mtd.h>
>  
>  typedef unsigned long flash_sect_t;
> +
> +#if   defined(CONFIG_DRIVER_CFI_BANK_WIDTH_8)
>  typedef u64 cfiword_t;
> +#elif defined(CONFIG_DRIVER_CFI_BANK_WIDTH_4)
> +typedef u32 cfiword_t;
> +#elif defined(CONFIG_DRIVER_CFI_BANK_WIDTH_2)
> +typedef u16 cfiword_t;
> +#else
> +typedef u8 cfiword_t;
> +#endif
> +
>  struct cfi_cmd_set;
>  
>  /*-----------------------------------------------------------------------
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-13  9:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-05 21:35 [PATCH] NOR flash: reduce size of cfiword_t if not using 64-bit bus Krzysztof Halasa
2012-05-11 18:40 ` Sascha Hauer
2012-05-12 19:09   ` Krzysztof Halasa
2012-05-13  9:03 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox