summaryrefslogtreecommitdiffstats
path: root/drivers/nor
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2010-11-27 00:11:59 +0800
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2010-12-03 01:53:12 +0800
commitae416f62701feb0cc93257b80c1a9a2b3c3bd54b (patch)
tree5c921fe6077cc8b9cbabb7f1c7fb71d0f61d219f /drivers/nor
parent7c487f37307795ed4ed6ad79a76f61f2b9ccfeb6 (diff)
downloadbarebox-ae416f62701feb0cc93257b80c1a9a2b3c3bd54b.tar.gz
barebox-ae416f62701feb0cc93257b80c1a9a2b3c3bd54b.tar.xz
cfi_flash: move flash_read_uchar from inline to noinline
it will reduce the binary size of 28 bytes and fix some issue observerd during the porting of the at91rm9200ek when reading the device_id and manufacturor_id Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'drivers/nor')
-rw-r--r--drivers/nor/cfi_flash.c15
-rw-r--r--drivers/nor/cfi_flash.h15
2 files changed, 16 insertions, 14 deletions
diff --git a/drivers/nor/cfi_flash.c b/drivers/nor/cfi_flash.c
index 08e45ef2bb..0efe0d4b58 100644
--- a/drivers/nor/cfi_flash.c
+++ b/drivers/nor/cfi_flash.c
@@ -186,6 +186,21 @@ static void flash_printqry (struct flash_info *info, flash_sect_t sect)
#endif
/*
+ * read a character at a port width address
+ */
+uchar flash_read_uchar (struct flash_info *info, uint offset)
+{
+ uchar *cp;
+
+ cp = flash_make_addr (info, 0, offset);
+#if defined(__LITTLE_ENDIAN)
+ return (cp[0]);
+#else
+ return (cp[info->portwidth - 1]);
+#endif
+}
+
+/*
* read a short word by swapping for ppc format.
*/
static ushort flash_read_ushort (struct flash_info *info, flash_sect_t sect, uint offset)
diff --git a/drivers/nor/cfi_flash.h b/drivers/nor/cfi_flash.h
index 047a0359b4..9a299db1ee 100644
--- a/drivers/nor/cfi_flash.h
+++ b/drivers/nor/cfi_flash.h
@@ -211,20 +211,7 @@ static inline uchar *flash_make_addr (struct flash_info *info, flash_sect_t sect
return ((uchar *) (info->start[sect] + (offset * info->portwidth)));
}
-/*
- * read a character at a port width address
- */
-static inline uchar flash_read_uchar (struct flash_info *info, uint offset)
-{
- uchar *cp;
-
- cp = flash_make_addr (info, 0, offset);
-#if defined(__LITTLE_ENDIAN)
- return (cp[0]);
-#else
- return (cp[info->portwidth - 1]);
-#endif
-}
+uchar flash_read_uchar (struct flash_info *info, uint offset);
#ifdef CONFIG_DRIVER_CFI_BANK_WIDTH_1
#define bankwidth_is_1(info) (info->portwidth == 1)