Commit Graph

160 Commits

Author SHA1 Message Date
Haavard Skinnemoen
0ddf06ddf6 cfi_flash: Add cmdset-specific init functions
Move things like reading JEDEC IDs and fixing up geometry reversal
into separate functions. The geometry reversal fixup is now performed
by altering the qry structure directly, which makes the sector init
code slightly cleaner.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-12-17 15:48:31 +01:00
Haavard Skinnemoen
e23741f4a6 cfi_flash: Read whole QRY structure in one go
Read out the whole CFI Standard Query structure after successful cfi
identification. This allows subsequent code to access this information
directly without having to go through flash_read_uchar() and friends.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-12-17 15:48:25 +01:00
Haavard Skinnemoen
12d30aa797 cfi_flash: Use map_physmem() and unmap_physmem()
Use map_physmem() and unmap_physmem() to convert from physical to
virtual addresses. This gives the arch a chance to provide an uncached
mapping for flash accesses.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-12-13 13:15:22 +01:00
Haavard Skinnemoen
cdbaefb5f5 cfi_flash: Introduce read and write accessors
Introduce flash_read{8,16,32,64) and flash_write{8,16,32,64} and use
them to access the flash memory. This makes it clearer when the flash
is actually being accessed; merely dereferencing a volatile pointer
looks just like any other kind of access.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-12-13 13:15:11 +01:00
Haavard Skinnemoen
be60a9021c cfi_flash: Reorder functions and eliminate extra prototypes
Reorder the functions in cfi_flash.c so that each function only uses
functions that have been defined before it. This allows the static
prototype declarations near the top to be eliminated and might allow
gcc to do a better job inlining functions.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-12-13 13:14:55 +01:00
Haavard Skinnemoen
3055793bcb cfi_flash: Make some needlessly global functions static
Make functions not declared in any header file static.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-12-13 13:12:46 +01:00
Haavard Skinnemoen
7e5b9b4715 cfi_flash: Break long lines
This patch tries to keep all lines in the cfi_flash driver below 80
columns. There are a few lines left which don't fit this requirement
because I couldn't find any trivial way to break them (i.e. it would
take some restructuring, which I intend to do in a later patch.)

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
2007-12-13 13:11:45 +01:00
Bartlomiej Sieka
42026c9cb3 CFI: synchronize command offsets with Linux CFI driver
Fixes non-working CFI Flash on the Inka4x0 board.

Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
2007-12-13 12:00:37 +01:00
Michael Schwingen
81b20ccc2d CFI: support JEDEC flash roms in CFI-flash framework
The following patch adds support for non-CFI flash ROMS, by hooking into the
CFI flash code and using most of its code, as recently discussed here in the
thread "Mixing CFI and non-CFI flashs".

Signed-off-by: Michael Schwingen <michael@schwingen.org>
Signed-off-by: Stefan Roese <sr@denx.de>
2007-12-08 08:16:50 +01:00
Jean-Christophe PLAGNIOL-VILLARD
59829cc189 drivers/mtd : move mtd drivers to drivers/mtd
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2007-11-25 23:28:52 +01:00