Commit Graph

123 Commits

Author SHA1 Message Date
Thomas Chou ed6ce67a2c lib: add crc7 from Linux
Crc7 is used to compute mmc spi command packet checksum.

Copy from linux-2.6 lib/crc7.c include/linux/crc7.h
commit ad241528c4919505afccb022acbab3eeb0db4d80

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
2011-01-18 23:38:08 +01:00
Lei Wen 245eb90091 mtd: nand: Allow caller to pass alternative ID table to nand_scan_ident()
This patch sync with David's patch on Linux for handling nand_scan_ident.

	commit 5e81e88a4c140586d9212999cea683bcd66a15c6
	Author: David Woodhouse <David.Woodhouse@intel.com>
	Date:   Fri Feb 26 18:32:56 2010 +0000

	mtd: nand: Allow caller to pass alternative ID table to nand_scan_ident()

	Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Signed-off-by: Lei Wen <leiwen@marvell.com>
2011-01-12 17:13:10 -06:00
Wolfgang Denk cdc51c294a Merge branch 'next' of ../next 2010-12-22 21:16:17 +01:00
Florian Fainelli 1ce7084a15 NAND: add NAND_CMD_PARAM (0xec) definition
This command is used to read the device ONFI parameters page.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
2010-12-17 14:32:12 -06:00
Mike Frysinger 0bdecd82dd nand: constify id/manu tables
These id tables need not be writable.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-12-17 14:32:11 -06:00
Wolfgang Denk d177e444a6 Coding style (white space) cleanup.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-12-17 10:14:09 +01:00
Wolfgang Denk 006915fbb0 Merge branch 'master' of ../master into next 2010-12-16 23:00:53 +01:00
Macpaul Lin 7ea23555f5 include/linux/mii.h: update for supporting GE
This file has been synced (copy) from Linux source code.
This commit was based on kernel 2.6.32.
It updates gigabit related phy registers and basic definitions.

Signed-off-by: Macpaul Lin <macpaul@andestech.com>
2010-12-09 11:01:16 +01:00
Mike Frysinger 543f0a3819 ctype: constify lookup table
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-11-28 21:58:29 +01:00
Wolfgang Denk 071bc92330 Coding Style cleanup
Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-10-27 22:48:30 +02:00
Wolfgang Denk 16a354f920 include/asm-offsets.h: automatically generate assembler constants
A recurrent issue is that certain C level constructs like sizeof() or
offsetof() cannot be used in assembler files, which is inconvenient
when such constructs are used in the definition of macro names etc.

To avoid duplication of such definitions (and thus another cause of
problems), we adapt the Linux way to automatically generate the
respective definitions from the respective C header files.

In Linux, this is implemented in include/linux/kbuild.h, Kbuild, and
arch/*/kernel/asm-offsets.c; we adapt the code from the Linux v2.6.36
kernel tree.

We also copy the concept of the include/generated/ directory which can
be used to hold other automatically generated files as well.

We start with an architecture-independent lib/asm-offsets.c which
generates include/generated/generic-asm-offsets.h (included by
include/asm-offsets.h, which is what will be referred to in the actual
source code).  Later this may be extended by architecture-specific
arch/*/lib/asm-offsets.c files that will generate a
include/generated/asm-offsets.h.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
2010-10-26 21:04:34 +02:00
Stefano Babic bf90ecd3c3 Add linux framebuffer header include/linux/fb.h
[port of linux 2.6.34 commit 6a9ee8af344e3bd7dbd61e67037096cdf7f83289]

Signed-off-by: Stefano Babic <sbabic@denx.de>
2010-10-22 00:05:05 +02:00
Enric Balletbo i Serra 456be17dbe mtd: OneNAND: add support for OneNAND manufactured by Numonyx
This patch adds the Numonyx manufacturer code (0x20) to
onenand manufacturers.

Signed-off-by: Enric Balletbo i Serra <eballetbo@gmail.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Steve Sakoman <steve.sakoman@linaro.org>
Tested-by: Steve Sakoman <steve.sakoman@linaro.org>
2010-10-11 15:15:45 -05:00
Ben Gardiner 4ba692fb1e mtd: add an mtd method for get_len_incl_bad()
The logic to 'spread' mtd partitions needs to calculate the length in
the mtd device, including bad blocks.

This patch introduces a new function, mtd_get_len_incl_bad that can
return both the length including bad blocks and whether that length
was truncated on the device. This new function will be used by the
mtdparts spread command later in this series. The definition of the
function is #ifdef'd out in configurations that do not use the new
'mtdparts spread' command.

Signed-off-by: Ben Gardiner<bengardiner@nanometrics.ca>
CC: Scott Wood <scottwood@freescale.com>
2010-10-11 15:11:00 -05:00
Scott Wood 5b8e6bb517 nand: remove dead code and suspend/resume
Get rid of the several "#if 0" sections that were keeping around Linux
code that isn't relevant to U-Boot.  Besides cluttering the code, these
sections make tracking upstream changes harder, rather than easier.
It's easy to discard obviously irrelevant diff hunks that patch rejects,
but it's not as easy to notice hunks that apply cleanly to the #if 0
section, but *are* relevant to U-Boot and require modification elsewhere.

Also remove suspend/resume, as this is not applicable to U-Boot.  Removal
saves 232 bytes on powerpc.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Tested-by: Ben Gardiner <bengardiner@nanometrics.ca>
2010-10-11 15:10:35 -05:00
Vitaly Kuzmichev 6142e0ae0f USB-CDC: Fix coding style issues
Fixes most of checkpatch warnings and errors in USB gadget stack.

The most frequently encountered problems are:
1) "(foo*)", "foo * bar", "foo* bar"
2) C99 // comments
3) No spaces before/after/around '?', ':', '=', '==', ',', '&', '('
4) Spaces before '['
5) Spaces between function names and '('
6) Block braces in wrong places
7) Spaces before tabs
8) Macros with complex values not enclosed in parenthesis
9) Multiline comments start just after /*

Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com>
2010-09-20 21:57:17 +02:00
Remy Bohmer 23cd138503 Integrate USB gadget layer and USB CDC driver layer
Derived from Linux kernel 2.6.27

Signed-off-by: Thomas Smits <ts.smits@gmail.com>
Signed-off-by: Remy Bohmer <linux@bohmer.net>
2010-09-20 21:57:16 +02:00
Graeme Russ 95ffaba390 x86: Fix support for booting bzImage
Add support for newer (up to 2.6.33) kernels

Add zboot command which takes the address of a bzImage as its first
argument and (optionally) the size of the bzImage as the second argument
(the second argument is needed for older kernels which do not include
the bzImage size in the header)

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
2010-05-06 00:17:01 +02:00
Thomas Chou c72bfafbc9 nios2: add struct stat support in linux/stat.h
This is needed for jffs2 support.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Scott McNutt <smcnutt@psyent.com>
2010-04-02 12:28:40 -04:00
Matthias Kaehlcke b63815e313 move definition of macros likely and unlikely to compiler.h
the macros likely and unlikely were defined in include/linux/mtd/compat.h,
but used in code not related to MTD. moved the macro definitions to compiler.h

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
2010-01-18 00:28:27 +01:00
Peter Korsgaard 20dde48bca add lzop decompression support
Add lzop decompression support to the existing lzo bitstream handling
(think gzip versus zlib), and support it for uImage decompression if
CONFIG_LZO is enabled.

Lzop doesn't compress as good as gzip (~10% worse), but decompression
is very fast (~0.7s faster here on a slow ppc). The lzop decompression
code is based on Albin Tonnerre's recent ARM Linux lzo support patch.

Cc: albin.tonnerre@free-electrons.com
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2009-12-05 01:30:23 +01:00
Sandeep Paulraj bb3e9828e7 NAND:Extending the nand_ecclayout structure
NANDs with page size of lesser than and equal to 2K are
reaching EOL. They are bing replaced with NANDs of
page size 4K and above.
To support this we have to extend the eccpos field

Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2009-11-18 14:26:39 -06:00
Wolfgang Denk 06f43286c6 Merge branch 'master' into next 2009-11-15 23:13:40 +01:00
Amul Kumar Saha cacbe91958 Flex-OneNAND driver support
This patch adds support for Flex-OneNAND devices.

Signed-off-by: Rohit Hagargundgi <h.rohit@samsung.com>
Signed-off-by: Amul Kumar Saha <amul.saha@samsung.com>
2009-11-13 16:56:18 -06:00
Sandeep Paulraj aaa8eec532 NAND: Update to support 64 bit device size
This patch adds support for NANDs greater than 2 GB.
Patch is based on the MTD NAND driver in the kernel.

Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-11-13 16:56:14 -06:00
Remy Bohmer 25793f76bf ARM: Use Linux version for unaligned access code
The asm-arm/unaligned.h includes linux/unaligned/access_ok.h
This file is unsafe to be used on ARM, since it does an unaligned memory
accesses which fails on ARM.

Lookin at Linux the basic difference seems to be the header
"include/asm-arm/unaligned.h". The Linux version of "unaligned.h"
does *not* include "access_ok.h" at all. It includes "le_byteshift.h"
and "be_byteshift.h" instead.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
Signed-off-by: Stefan Roese <sr@denx.de>
--
 include/asm-arm/unaligned.h            |    3 -
 include/linux/unaligned/be_byteshift.h |   70 +++++++++++++++++++++++++++++++++
 include/linux/unaligned/le_byteshift.h |   70 +++++++++++++++++++++++++++++++++
 3 files changed, 142 insertions(+), 1 deletion(-)
 create mode 100644 include/linux/unaligned/be_byteshift.h
 create mode 100644 include/linux/unaligned/le_byteshift.h
2009-11-07 15:56:30 -06:00
Minkyu Kang f380737478 s5pc1xx: SMDKC100: fix compile warnings
fix the following compile warnings
warning: dereferencing type-punned pointer will break strict-aliasing rules

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2009-10-24 09:55:25 -05:00
Minkyu Kang 4678d674f0 s5pc1xx: support onenand driver
This patch includes the onenand driver for s5pc100

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2009-10-13 21:13:55 -05:00
Simon Kagstrom 0413cfecea Correct ffs/fls regression for PowerPC etc
Commits

  02f99901ed
  52d61227b6

introduced a regression where platform-specific ffs/fls implementations
were defined away. This patch corrects that by using PLATFORM_xxx
instead of the name itself.

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Stefan Roese <sr@denx.de>
2009-09-17 22:45:31 +02:00
Simon Kagstrom 52d61227b6 Define ffs/fls for all architectures
UBIFS requires fls(), which is not defined for arm (and some other
architectures) and this patch adds it. The implementation is taken from
Linux and is generic. ffs() is also defined for those that miss it.

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
2009-09-15 22:34:32 +02:00
Simon Kagstrom 02f99901ed Move __set/clear_bit from ubifs.h to bitops.h
__set_bit and __clear_bit are defined in ubifs.h as well as in
asm/include/bitops.h for some architectures. This patch moves
the generic implementation to include/linux/bitops.h and uses
that unless it's defined by the architecture.

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
2009-09-15 22:31:24 +02:00
Sandeep Paulraj f83b7f9e8a MTD:NAND: ADD new ECC mode NAND_ECC_HW_OOB_FIRST
This patch adds the new mode NAND_ECC_HW_OOB_FIRST in the nand code to
support 4-bit ECC on TI DaVinci devices with large page (up to 2K) NAND
chips.  This ECC mode is similar to NAND_ECC_HW, with the exception of
read_page API that first reads the OOB area, reads the data in chunks,
feeds the ECC from OOB area to the ECC hw engine and perform any
correction on the data as per the ECC status reported by the engine.

This patch has been accepted by Andrew Morton and can be found at

http://userweb.kernel.org/~akpm/mmotm/broken-out/mtd-nand-add-new-ecc-mode-ecc_hw_oob_first.patch

Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
Signed-off-by: Sneha Narnakaje <nsnehaprabha@ti.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-08-26 15:37:03 -05:00
Sandeep Paulraj a2c65b47ef NAND: ADD page Parameter to all read_page/read_page_raw API's
This patch adds a new "page" parameter to all NAND read_page/read_page_raw
APIs.  The read_page API for the new mode ECC_HW_OOB_FIRST requires the
page information to send the READOOB command and read the OOB area before
the data area.

This patch has been accepted by Andrew Morton and can be found at
http://userweb.kernel.org/~akpm/mmotm/broken-out/mtd-nand-add-page-parameter-to-all-read_page-read_page_raw-apis.patch

WE would like this to become part of the u-boot GIT as well

Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
Signed-off-by: Sneha Narnakaje <nsnehaprabha@ti.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-08-26 15:37:02 -05:00
Kyungmin Park ecad289fc6 OneNAND: Remove unused read_spareram
Remove unused read_spareram and add unlock_all as kernel does

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-08-26 15:37:02 -05:00
Albin Tonnerre e84aba135e Replace BCD2BIN and BIN2BCD macros with inline functions
In the process, also remove backward-compatiblity macros BIN_TO_BCD and
BCD_TO_BIN and update the sole board using them to use the new bin2bcd
and bcd2bin instead

Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>
2009-08-25 12:57:55 +02:00
Scott Wood be33b046b5 Remove legacy NAND and disk on chip code.
Legacy NAND had been scheduled for removal.  Any boards that use this
were already not building in the previous release due to an #error.

The disk on chip code in common/cmd_doc.c relies on legacy NAND,
and it has also been removed.  There is newer disk on chip code
in drivers/mtd/nand; someone with access to hardware and sufficient
time and motivation can try to get that working, but for now disk
on chip is not supported.

Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-07-16 19:07:47 -05:00
Stefan Roese fbdaafaee7 nand: Change NAND_MAX_OOBSIZE to 218 as needed for some 4k page devices
This is needed for the MPC512x NAND driver (fsl_nfc_nand.c) which already
defines such a 4k plus 218 bytes ECC layout.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Scott Wood <scottwood@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-07-16 17:52:03 -05:00
Wolfgang Denk 8e5e9b940c Coding style cleanup; update CHANGELOG
Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-07-07 22:35:02 +02:00
Stefan Roese 8d2effea23 mtd: Update MTD infrastructure to support 64bit device size
This patch brings the U-Boot MTD infrastructure in sync with the current
Linux MTD version (2.6.30-rc3). Biggest change is the 64bit device size
support and a resync of the mtdpart.c file which has seen multiple fixes
meanwhile.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Kyungmin Park <kmpark@infradead.org>
2009-06-12 20:45:47 +02:00
Stefan Roese 0a57265533 mtd: Add MTD concat support to concatenate multiple MTD NOR devices
This patch adds concatenation support to the U-Boot MTD infrastructure.
By enabling CONFIG_MTD_CONCAT this MTD CFI wrapper will concatenate
all found NOR devices into one single MTD device. This can be used by
e.g by UBI to access a partition that spans over multiple NOR chips.

Signed-off-by: Stefan Roese <sr@denx.de>
2009-06-12 20:45:47 +02:00
Wolfgang Grandegger 33846df28f Add wait flags to support board/chip specific delays
The NAND flash on the TQM8548_BE modules requires a short delay after
running the UPM pattern like the MPC8360ERDK board does. The TQM8548_BE
requires a further short delay after writing out a buffer. Normally the
R/B pin should be checked, but it's not connected on the TQM8548_BE.
The corresponding Linux FSL UPM driver uses similar delay points at the
same locations. To manage these extra delays in a more general way, I
introduced the "wait_flags" field allowing the board-specific driver to
specify various types of extra delay.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-03-23 15:53:40 -05:00
Wolfgang Grandegger 06e9f7df05 Add support for TQM-specific chip select logic to FSL-UPM
For the NAND chips on the TQM8548 modules, a special chip-select logic is
used. It uses dedicated address lines to be set via UPM machine address
register (mar). This patch adds such support to the FSL-UPM driver.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-03-23 15:53:39 -05:00
Wolfgang Grandegger e93c1c169d Add multi chip support to the FSL-UPM driver
This patch adds support for multi-chip NAND devices to the FSL-UPM
driver. The "dev_ready" callback of the "struct fsl_upm_nand" is now
called with the argument "chip_nr" to allow testing the proper chip
select line. The NAND support of the MPC8360ERDK is updated as well.
No other boards are currently using the FSL UPM driver.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-03-23 15:53:38 -05:00
Stefan Roese 9eefe2a2b3 UBIFS: Implement read-only UBIFS support in U-Boot
The U-Boot UBIFS implementation is largely a direct copy from the current
Linux version (2.6.29-rc6). As already done in the UBI version we have an
"abstraction layer" to redefine or remove some OS calls (e.g. mutex_lock()
...). This makes it possible to use the original Linux code with very
little changes. And by this we can better update to later Linux versions.

I removed some of the Linux features that are not used in the U-Boot
version (e.g. garbage-collection, write support).

Signed-off-by: Stefan Roese <sr@denx.de>
CC: Artem Bityutskiy <dedekind@infradead.org>
CC: Adrian Hunter <ext-Adrian.Hunter@nokia.com>
2009-03-20 22:39:15 +01:00
Stefan Roese b1b4e89a0f Add LZO decompressor support
This patch adds LZO decompression support to U-Boot. It is needed for
the upcoming UBIFS support, since UBIFS uses LZO as default compressor/
decompressor. Since we only support read-only in UBIFS, only the
decompressor is needed.

All this is copied with minor changes from the current Linux kernel
version (2.6.28-rc8).

This patch only implements this LZO decompressor support for PPC.
Other platforms using UBIFS will have to add the required
"include/asm/unaligned.h" as well. It should be fairly easy to copy this
from the Linux source tree as I have done it for PPC in this patch.

Signed-off-by: Stefan Roese <sr@denx.de>
2009-03-20 22:39:15 +01:00
Wolfgang Grandegger 6c869637fe NAND: rename NAND_MAX_CHIPS to CONFIG_SYS_NAND_MAX_CHIPS
This patch renames NAND_MAX_CHIPS to CONFIG_SYS_NAND_MAX_CHIPS and
changes the default from 8 to 1 for the legacy and the new MTD
NAND layer. This allows to remove all NAND_MAX_CHIPS definitions
in the board config files because none of the boards use multi
chip support (NAND_MAX_CHIPS > 1) so far. The bamboo and the DU440
define

 #define NAND_MAX_CHIPS          CONFIG_SYS_MAX_NAND_DEVICE

but that's bogus and did not work anyhow.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-01-23 10:32:51 -06:00
Stefan Roese 1ae3986204 OneNAND: Additional sync with 2.6.27
- Add subpage write support
- Add onenand_oob_64/32 ecclayout

This has been missing and without it UBI has some incompatibilies issues
with the current (>= 2.6.27) Linux kernel version. vid_hdr_offset is
placed differently (2048 instead of 512) without this fix.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-01-23 10:32:48 -06:00
Kyungmin Park ef0921d6b0 Sync with 2.6.27
Sync with OneNAND kernel codes

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2009-01-23 10:32:44 -06:00
Wolfgang Denk 455ae7e87f Coding style cleanup, update CHANGELOG.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-12-16 01:02:17 +01:00
Kyungmin Park 58be3a1056 UBI: Add basic UBI support to U-Boot (Part 8/8)
This patch adds basic UBI (Unsorted Block Image) support to U-Boot.
It's based on the Linux UBI version and basically has a "OS"
translation wrapper that defines most Linux specific calls
(spin_lock() etc.) into no-ops. Some source code parts have been
uncommented by "#ifdef UBI_LINUX". This makes it easier to compare
this version with the Linux version and simplifies future UBI
ports/bug-fixes from the Linux version.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2008-11-19 20:34:39 +01:00