9
0
Fork 0
Commit Graph

5258 Commits

Author SHA1 Message Date
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 04191aa0fc cfi_flash: do not reset flash when probe fails
The CFI flash driver starts at flash_init() which calls down into
flash_get_size().  This starts by calling flash_detect_cfi().  If said
function fails, flash_get_size() finishes by attempting to reset the
flash.  Unfortunately, it does this with an info->portwidth set to 0x10
which filters down into flash_make_cmd() and that happily smashes the
stack by sticking info->portwidth bytes into a cfiword_t variable that
lives on the stack.  On a 64bit system you probably won't notice, but
killing the last 8 bytes on a 32bit system usually leads to a corrupt
return address.  Which is what happens on a Blackfin system.

based on U-Boot

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-12-03 01:53:13 +08:00
Jean-Christophe PLAGNIOL-VILLARD fec9928dc7 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.

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 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 ce35b3c09a cfi_flash: synchronize command offsets with Linux CFI driver
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-12-03 01:53:12 +08:00
Jean-Christophe PLAGNIOL-VILLARD 64e70cd050 cfi_flash: use amd and standard reset flash command at probing
as we do not known which flash we have yet

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-12-03 01:53:12 +08:00
Jean-Christophe PLAGNIOL-VILLARD ae416f6270 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>
2010-12-03 01:53:12 +08:00
Jean-Christophe PLAGNIOL-VILLARD 7c487f3730 cfi_flash: add Atmel real protect flash support
based on U-Boot

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
Marek Belisko 4a7f56056d scripts: Adapt checkpatch.pl for barebox.
Add directories from root of barebox to top_of_kernel_tree()
function for usage of script without additional parameters.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-29 21:56:05 +01:00
Marek Belisko 8beaec022e scripts: Add checkpatch.pl script.
Overtake script checkpatch.pl from kernel source.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-29 21:56:05 +01:00
Jean-Christophe PLAGNIOL-VILLARD 7e0982bdc2 defaultenv/udpate: in xmodem mode load the data before erasing
and abort the update if loadb failed or cancelled

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-29 21:55:25 +01:00
Jean-Christophe PLAGNIOL-VILLARD a75df244b2 defaultenv/udpate: fix typo in default barebox image name
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-29 21:55:25 +01:00
Jean-Christophe PLAGNIOL-VILLARD a6e514b388 miidev: allow multiple dev
now we need to set the dev id to -1

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-29 21:55:25 +01:00
Jean-Christophe PLAGNIOL-VILLARD f69626c632 clocksource: switch mask to CLOCKSOURCE_MASK
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-29 21:55:25 +01:00
Jean-Christophe PLAGNIOL-VILLARD c448d8c659 clocksource: import CLOCKSOURCE_MASK from the kernel
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-29 21:55:25 +01:00
Marek Belisko 804e0b0084 drivers: mci: Fix compilation warning.
Fix compilation warning:
drivers/mci/mci-core.c:1002:
warning: comparison of distinct pointer types lacks a cast

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-26 08:24:35 +01:00
Sascha Hauer 53dbaf3fc7 Merge branch 'master' into next 2010-11-19 09:35:15 +01:00
Marek Belisko 52f5f20baa smc91111: Various sparse fixes.
Patch fix all similar warnings found by sparse:
drivers/net/smc91111.c:488:9:
warning: incorrect type in argument 1 (different base types)
	expected void const volatile [noderef] <asn:2>*<noident>
	got unsigned long [unsigned] offset

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-19 09:35:09 +01:00
Marek Belisko 5c495ce5e5 nand_s3c2410: Fix sparse warnings.
Patch fix following sparse warnings:
drivers/mtd/nand/nand_s3c2410.c:125:9:
warning: incorrect type in argument 1 (different base types)
	expected void const volatile [noderef] <asn:2>*<noident>
	got unsigned long

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-19 09:35:09 +01:00
Marek Belisko dbd3613394 mtd: Fix sparse warning.
Patch fix following sparse warning:
drivers/mtd/nand/nand_base.c:123:16:
warning: incorrect type in argument 1 (different address spaces)
	expected void const volatile [noderef] <asn:2>*<noident>
	got void *IO_ADDR_R

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-19 09:35:04 +01:00
Marek Belisko 83a9266a08 common: Add define for IOMEM helper macro.
IOMEM helper macro is used for address casting which then
is used in read(bwl)/write(bwl) functions.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-19 09:34:00 +01:00
Marek Belisko a894660cf1 fs: Fix bug found by sparse.
Patch fix following sparse warning:
fs/fs.c:757:28: warning: dubious: !x & y

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-19 09:31:57 +01:00
Sascha Hauer 820873b5d6 i.MX device macros: Fix esdhci
The patch introducing device macros for i.MX accidently registered a
imx-mmc device for i.MX25/35/51. It should be a imx-esdhc device. This
patch fixes tis

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-18 09:14:08 +01:00
Sascha Hauer f90e136aa2 Merge branch 'master' into next 2010-11-17 10:23:56 +01:00
Sascha Hauer 7e7ca7cb3a Merge branch 'x86' of git://git.jcrosoft.org/barebox 2010-11-17 10:23:48 +01:00
Marek Belisko c22da7e05d serial_s3c24x0: Add missing brackets.
Fucntion s3c24x0_serial_flush() could behave wrong
because of missing brackets. Correct condition logic.
Problem found by sparse.

Signed-off-by: Marek Belisko <marek.belisko@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-17 09:46:29 +01:00
Sascha Hauer 4d63d07ffa Merge branch 'for-mainline-doc' of git://git.pengutronix.de/git/rsc/barebox into next 2010-11-17 09:45:23 +01:00
Sascha Hauer 8ef2947fff Remove m68k support
The m68k support is compile broken for a long time now and nobody
cared so far. We cannot keep the architecture uptodate with current
development wihtout being able to compile it. It's still in the
archives and can be re-added anytime once somebody cares for.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-17 09:18:25 +01:00
Jean-Christophe PLAGNIOL-VILLARD 8842674637 x86: fix out of tree build support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-11-17 12:14:57 +08:00
Jean-Christophe PLAGNIOL-VILLARD f7a37ae14b x86: add 64bit host build support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-11-17 12:14:56 +08:00
Jean-Christophe PLAGNIOL-VILLARD fa1fdeb350 linux16: fix cmd_tbl_t as struct command
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-11-17 12:14:55 +08:00
Sascha Hauer 33e3dc3cdb pcm037: Enable nand driver in defaultconfig
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-15 12:26:34 +01:00
Sascha Hauer 2e75410c06 pcm037: set nand_device in default environment
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-15 12:26:17 +01:00
Robert Schwebel 4ce5028ecd doc: put barebox version into documentation
Currently the documentation does always claim to be version 1. We add
the revision plus the git version to the manual.

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
2010-11-15 09:57:26 +01:00
Robert Schwebel 507480dd0a doc: add missing commands
This patch adds command entries for all commands available in barebox.
However, as there is no documentation for all of these commands, 'make
docs' will now spit out warnings.

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
2010-11-15 09:57:26 +01:00
Robert Schwebel 944ab68ab7 doc: sort list alphabetically
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
2010-11-15 09:57:26 +01:00
Marek Belisko b960023b46 pcm037: Fix compilation warning.
This patch fix following compilation warning:
../devices-imx31.h: In function 'imx31_add_fb':
../devices-imx31.h:34: warning: passing argument 2 of 'imx_add_ipufb'
from incompatible pointer type

Signed-off-by: Marek Belisko <marek.belisko@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-15 09:20:47 +01:00
Marek Belisko 6d2fd508d1 mini2440: Fix compilation error.
Patch fix following compilation error:
../mini2440.c:33:28: error: asm/mach-types.h: No such file or directory
../mini2440.c: In function 'mini2440_devices_init':
../mini2440.c:113: error: 'MACH_TYPE_MINI2440' undeclared (first use in this function)
../mini2440.c:113: error: (Each undeclared identifier is reported only once
../mini2440.c:113: error: for each function it appears in.)

Signed-off-by: Marek Belisko <marek.belisko@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-15 09:20:34 +01:00
Sascha Hauer a3da178176 Merge branch 'master' into next 2010-11-12 08:08:13 +01:00
Sascha Hauer f99b1d38ee ARM i.MX51: Add nand device
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:02 +01:00
Sascha Hauer ce15c024c1 imx nand: Add v3 (i.MX51) support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:02 +01:00
Sascha Hauer 691bff0062 imx nand: introduce overwritable check_int function
needed for v3 support later.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:02 +01:00
Sascha Hauer 5fcca46544 imx nand: move initialization to preset function
This has two purposes. First we need to factor out initialization
to be able to do something different on v3 type controllers,
second with this patch we are independent of preinitialized register
values.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:02 +01:00
Sascha Hauer da1ad19c4c mxc_nand: fix correct_data function
The v2 controller has a totally different mechanism to check
whether the data we read had ecc errors or not. Implement this.
The mechanism in the v2 controller happens to be identical to
the v3 controller.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:02 +01:00
Sascha Hauer 87ccd2d109 imx nand: add V1_V2 namespace to registers
This prepares the driver for v3 support. The v3 controller
has a completely different register layout, so add a V1_V2_
namespace to the register defines to avoid confusion with
the v3 regs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:02 +01:00
Sascha Hauer 22180f96b1 imx nand: do not read-modify-write SPAS register
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:01 +01:00
Sascha Hauer a0fc5252a7 imx_nand: make some internally used functions overwriteable
This patch prepares the driver to add v3 controller support
later. The v3 controller is basically the same controller as v1
and v2, but with a completely different register layout.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:01 +01:00
Sascha Hauer 2cb2a68b92 imx nand: remove unnecessary register write
NFC_SP_EN is cleared in probe and never set again, so we do not
need to clear it in other functions again.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-12 08:08:01 +01:00