summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2008-02-25 18:41:25 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2008-02-25 18:41:25 +0100
commit7f88a7844cb8e04ae409ca3ae176a5a1c50629d0 (patch)
treefb59965dd0b7d22bf2b177d9b608cdf8b5796ced /include
parentef4ddb0ec0bb78a5010d4a5b39df442d4507cf8a (diff)
downloadbarebox-7f88a7844cb8e04ae409ca3ae176a5a1c50629d0.tar.gz
barebox-7f88a7844cb8e04ae409ca3ae176a5a1c50629d0.tar.xz
[CFI FLASH] Make the 'new' driver compile again and reorder functions to
get rid of static function declarations.
Diffstat (limited to 'include')
-rw-r--r--include/cfi_flash_new.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/cfi_flash_new.h b/include/cfi_flash_new.h
index 6794ec172d..2ccae1dca0 100644
--- a/include/cfi_flash_new.h
+++ b/include/cfi_flash_new.h
@@ -185,7 +185,7 @@ int flash_status_check (flash_info_t * info, flash_sect_t sector,
int flash_isequal (flash_info_t * info, flash_sect_t sect, uint offset, uchar cmd);
void flash_make_cmd (flash_info_t * info, uchar cmd, void *cmdbuf);
-/*-----------------------------------------------------------------------
+/*
* create an address based on the offset and the port width
*/
static inline uchar *flash_make_addr (flash_info_t * info, flash_sect_t sect, uint offset)
@@ -193,6 +193,21 @@ static inline uchar *flash_make_addr (flash_info_t * info, flash_sect_t sect, ui
return ((uchar *) (info->start[sect] + (offset * info->portwidth)));
}
+/*
+ * read a character at a port width address
+ */
+static inline uchar flash_read_uchar (flash_info_t * 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
+}
+
typedef union {
unsigned char c;
unsigned short w;