9
0
Fork 0
Commit Graph

16 Commits

Author SHA1 Message Date
Sascha Hauer 7eebd3b4c6 cfi flash: Fix alignment problem
The intel cfi buffer write has a problem with writing when
the alignment of the buffer in memory is smaller than the
flash bus width.

This patch fixes a alignment problem which may show during this
scenario:
- 32 or 64 attached NOR flash
- flashing an image directly from network to the nor flash

The involved network driver is "smc9111.c".

The data that comes from the network stack and should be written into
the flash isn't 32 bit aligned (at least with this network driver).
This is probably due to the 48 bit wide ethernet addresses.

However the "cfi_flash.c" driver doesn't handle this situation, and
accesses the not-aligned address with a 32 bit pointer.

This patch fixes the problem by reducing the access width if an
aligment problem between source and destination is found.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-05 10:58:02 +02:00
Sascha Hauer 14bc0e9f83 cfi flash: Fix loop count calculation
'reduce the number of loops by the width of the port' means
a simple len / width. Do not try to be clever by shifting
and doing it wrong.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-04-05 10:58:02 +02:00
Teresa Gámez 943b27107c cfi_flash: support of u32 cmd
Some NOR flash chips have commands with length greater than the maximum
value size of uchar.

Based on an U-Boot Patch by Vasiliy Leoenenko <vasiliy.leonenko@mail.ru>

Only tested with little endian on an intel cfi_flash.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-26 09:33:37 +02:00
Jean-Christophe PLAGNIOL-VILLARD 9985498695 cfi_flash: introduce flash cmdset fixup
Move fixing up like 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.

based on U-Boot

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-12-03 01:53:14 +08:00
Jean-Christophe PLAGNIOL-VILLARD 0df2a8d263 cfi_flash: move reset command assigment to specific chipset init function
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-12-03 01:53:14 +08:00
Jean-Christophe PLAGNIOL-VILLARD 6bc05afea5 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.

based on U-Boot

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-12-03 01:53:13 +08:00
Jean-Christophe PLAGNIOL-VILLARD 8b41ca208e cfi_flash: update manufacturer id flash support
several first banks can contain 0x7f instead of actual ID

support as done in linux

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-12-03 01:53:12 +08:00
Jean-Christophe PLAGNIOL-VILLARD 322b9af875 cfi_flash: move intel real protect flash support to cfi_flash_intel.c
let an empty function for amd as we will add later atmel real protect flash

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-12-03 01:53:12 +08:00
Sascha Hauer 497445d51e cfi_flash: Do not typedef struct flash_info
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-07-05 13:00:02 +02:00
Sascha Hauer e6b8bdc0c5 cfi_flash: move include/cfi_flash.c next to driver
This file has no useful things for others than the driver,
so move it next to the driver and remove the corresponding
include from other files.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-08 14:37:50 +01:00
Sascha Hauer 582da05383 cfi_flash: remove old driver and switch to new one
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-08 14:37:49 +01:00
Sascha Hauer 089066237d cfi_flash_new: generate flash erase dots in common function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-08 14:37:49 +01:00
Sascha Hauer 146ba46d41 cfi_flash_new: Safe indention level by bailing out earlier in error case
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-08 14:37:49 +01:00
Sascha Hauer 4e459d98ef cfi_flash_new: Fix Intel chips
There was some mixup when to to a full status check and
when to do a status check only. Fix this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-02-08 14:37:49 +01:00
Jean-Christophe PLAGNIOL-VILLARD c495fe0fcd cfi new: fix new disabling buffer support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-10-20 15:02:31 +02:00
Sascha Hauer 313a618ce0 Move cfi flash drivers to drivers/nor as suggested by Nishanth Menon
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-25 09:31:04 +02:00