Mikhail Zolotaryov [Wed, 8 Sep 2010 14:06:03 +0000 (17:06 +0300)]
VFAT: fix processing of scattered long file name entries
The U-Boot code has the following bugs related to the processing of Long File
Name (LFN) entries scattered across several clusters/sectors :
1) get_vfatname() function is designed to gather scattered LFN entries by
cluster chain processing - that doesn't work for FAT12/16 root directory.
In other words, the function expects the following input data:
1.1) FAT32 directory (which is cluster chain based);
OR
1.2) FAT12/16 non-root directory (which is also cluster chain based);
OR
1.3) FAT12/16 root directory (allocated as contiguous sectors area), but
all necessary information MUST be within the input buffer of filesystem cluster
size (thus cluster-chain jump is never initiated).
In order to accomplish the last condition, root directory parsing code in
do_fat_read() uses the following trick: read-out cluster-size block, process
only first sector (512 bytes), then shift 512 forward, read-out cluster-size
block and so on. This works great unless cluster size is equal to 512 bytes
(in a case you have a small partition), or long file name entries are scattered
across three sectors, see 4) for details.
2) Despite of the fact that get_vfatname() supports FAT32 root directory
browsing, do_fat_read() function doesn't send current cluster number correctly,
so root directory look-up doesn't work correctly.
3) get_vfatname() doesn't gather scattered entries correctly also is the case
when all LFN entries are located at the end of the source cluster, but real
directory entry (which must be returned) is at the only beginning of the
next one. No error detected, the resulting directory entry returned contains
a semi-random information (wrong size, wrong start cluster number and so on)
i.e. the entry is not accessible.
4) LFN (VFAT) allows up to 20 entries (slots) each containing 26 bytes (13
UTF-16 code units) to represent a single long file name i.e. up to 520 bytes.
U-Boot allocates 256 bytes buffer instead, i.e. 10 or more LFN slots record
may cause buffer overflow / memory corruption.
Also, it's worth to mention that 20+1 slots occupy 672 bytes space which may
take more than one cluster of 512 bytes (medium-size FAT32 or small FAT16
partition) - get_vfatname() function doesn't support such case as well.
The patch attached fixes these problems in the following way:
- keep using 256 bytes buffer for a long file name, but safely prevent a
possible buffer overflow (skip LFN processing, if it contains 10 or more
slots).
- explicitly specify FAT12/16 root directory parsing buffer size, instead
of relying on cluster size. The value used is a double sector size (to store
current sector and the next one). This fixes the first problem and increases
performance on big FAT12/16 partitions;
- send current cluster number (FAT32) to get_vfatname() during root
directory processing;
- use LFN counter to seek the real directory entry in get_vfatname() - fixes the
third problem;
- skip deleted entries in the root directory (to prevent bogus buffer
overflow detection and LFN counter steps).
Note: it's not advised to split up the patch, because a separate part may
operate incorrectly.
Signed-off-by: Mikhail Zolotaryov <lebon@lebon.org.ua>
Daniel Hobi [Mon, 11 Oct 2010 16:03:35 +0000 (18:03 +0200)]
tools/imls: fix comment in Makefile
Commit
d984fed0 (makefiles: fixes for building build tools)
changed the variable name FIT_CFLAGS to HOSTCFLAGS_NOPED
but forgot to update to corresponding comment.
Signed-off-by: Daniel Hobi <daniel.hobi@schmid-telecom.ch>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Wolfgang Denk <wd@denx.de>
Lei Wen [Sun, 10 Oct 2010 04:36:40 +0000 (12:36 +0800)]
env: don't set to default env twice when use CONFIG_ENV_IS_NOWHERE
When use the CONFIG_ENV_IS_NOWHERE, I met such issue:
DRAM: 256 MiB
Using default environment
*** Warning - bad CRC, using default environment
Signed-off-by: Lei Wen <leiwen@marvell.com>
Stefan Roese [Wed, 8 Sep 2010 13:35:31 +0000 (15:35 +0200)]
zlib: Add further watchdog reset calls
Patch
253cb831 [zlib: add watchdog reset call] added already a few
watchdog reset calls to the new zlib U-Boot port. But on some boards
this is not enough. Additional calls are needed on boards with
short watchdog timeouts.
This was detected and tested on the lwmon5 board with a very short
watchdog timeout. Without this patch, the board resets during Linux
kernel decompression. With it, the decompression succeeds.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>
Stefan Roese [Wed, 8 Sep 2010 13:34:58 +0000 (15:34 +0200)]
zlib/gunzip: Use WATCHDOG_RESET macro
As usually done in U-Boot, the watchdog_reset code is called via a
macro (WATCHDOG_RESET). In zlib.c this was done differently, by using
a function pointer which is initialized with WATCHDOG_RESET upon watchdog
usage or with NULL otherwise. This patch now uses the plain
WATCHDOG_RESET macros to call the function resulting in slightly smaller
U-Boot images and simpler code.
U-Boot code size reduction:
PowerPC board with watchdog support (lwmon5):
-> 80 bytes smaller image size
PowerPC board without watchdog support (sequoia):
-> 112 bytes smaller image size
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>
Anatolij Gustschin [Tue, 17 Aug 2010 15:46:02 +0000 (17:46 +0200)]
pdm360ng: add EDID property to FDT display node
PDM360NG board uses this functionality to pass display
timing info to the Linux Framebuffer driver.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>
Anatolij Gustschin [Wed, 18 Aug 2010 09:25:20 +0000 (11:25 +0200)]
fdt_support: support adding EDID property to FDT display nodes
Boards can pass display timing info for drivers using EDID
block. Provide common function to add board specific EDID
data to the device tree. Subsequent patch makes use of this
functionality.
Detailed timing descriptor data from EDID is used for
programming the display controller. This is currently
implemented on the Linux side by the fsl-diu-fb frame
buffer driver and it is documented there in
Documentation/powerpc/dts-bindings/fsl/diu.txt.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>
Cc: Gerald Van Baren <vanbaren@cideas.com>
Alexander Stein [Wed, 11 Aug 2010 14:48:04 +0000 (16:48 +0200)]
CONFIG_CMD_JFFS2 is not necessary to use mtdparts on erase & protect on/off
The include <jffs2/jffs2.h> is still necessary though.
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Acked-by: Stefan Roese <sr@denx.de>
Wolfgang Denk [Tue, 12 Oct 2010 18:49:27 +0000 (20:49 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-cfi-flash
Wolfgang Denk [Tue, 12 Oct 2010 18:48:01 +0000 (20:48 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-microblaze
Wolfgang Denk [Tue, 12 Oct 2010 18:44:46 +0000 (20:44 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-net
John Schmoller [Wed, 29 Sep 2010 18:49:05 +0000 (13:49 -0500)]
cfi_flash: Fix "Unknown FLASH" error message
When a CFI flash chip could not be detected an error message similar to
the following would be printed on bootup:
FLASH: ## Unknown FLASH on Bank 1 - Size = 0x01000000 = 0 MB
The printf incorrectly converted the flash size into megabytes. This
patch fixes the printing of the flash size in megabytes:
FLASH: ## Unknown FLASH on Bank 1 - Size = 0x01000000 = 16 MB
Signed-off-by: John Schmoller <jschmoller@xes-inc.com>
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Michal Simek [Thu, 12 Aug 2010 09:47:11 +0000 (11:47 +0200)]
microblaze: Support little-endian microblaze target
Microblaze little-endian toolchain should export
__MICROBLAZEEL__.
Signed-off-by: Michal Simek <monstr@monstr.eu>
Michal Simek [Mon, 2 Aug 2010 12:42:09 +0000 (14:42 +0200)]
microblaze: Add support for NET_MULTI api
Microblaze hasn't supported NET_MULTI support.
Signed-off-by: Michal Simek <monstr@monstr.eu>
Michal Simek [Mon, 2 Aug 2010 12:20:28 +0000 (14:20 +0200)]
microblaze: Fix microblaze-generic config file
1. Fix preprocessor statements
2. Clean coding style
Signed-off-by: Michal Simek <monstr@monstr.eu>
Stephan Linz [Mon, 21 Jun 2010 20:58:10 +0000 (22:58 +0200)]
microblaze: generic: rename MTD partition set to 'flash-0'
Signed-off-by: Stephan Linz <linz@li-pro.net>
Signed-off-by: Michal Simek <monstr@monstr.eu>
Stephan Linz [Mon, 21 Jun 2010 20:58:09 +0000 (22:58 +0200)]
microblaze: generic: adding DHCP support
Signed-off-by: Stephan Linz <linz@li-pro.net>
Signed-off-by: Michal Simek <monstr@monstr.eu>
Thomas Chou [Wed, 6 Oct 2010 01:16:10 +0000 (09:16 +0800)]
smc91111: add write_hwaddr
Add smc_write_hwaddr() to set mac address.
Clear dev before use.
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Ben Gardiner [Thu, 23 Sep 2010 13:58:43 +0000 (09:58 -0400)]
davinci_emac: davinci_eth_set_mac_addr to ->write_hwaddr
This patch proposes to migrate the davinci_emac driver to using the
eth_device->write_hwaddr function pointer as suggested by Ben Warren.
All the davinci boards had the behaviour, prior to this patch, of
sync'ing the environment variable enetaddr with the MAC address read
from non-volatile storage on boot -- when the two locations disagreed,
the environment variable value took precendence. This patch keeps the
same behaviour but lets eth_initialize take care of it.
This patch refactors davinci_emac setup in the boards so that the MAC
address is read from non-volatile storage into the environment variable
and then the environment variable value is use in eth_intialize. The
only exception is the direct call to davinci_eth_set_mac_addr made by
the da830evm board init which was changed into an assignment of the
enetaddr field.
Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Tested-by: Nick Thompson <nick.thompson@ge.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Michal Simek [Mon, 11 Oct 2010 01:41:47 +0000 (11:41 +1000)]
net: Move Emaclite to NET_MULTI
Emaclite was using old net api that's why
this patch move emaclite to NET_MULTI api.
Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Peter Tyser [Thu, 30 Sep 2010 16:25:48 +0000 (11:25 -0500)]
rarp: Condtionally compile rarp support
Most people don't use the 'rarpboot' command, so only enable it when
CONFIG_CMD_RARP is defined.
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Michal Simek [Mon, 11 Oct 2010 01:41:46 +0000 (11:41 +1000)]
net: Fix emaclite driver to support little-endian microblaze
Support New emaclite AXI IP.
Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Ilya Yanok [Thu, 19 Aug 2010 09:09:06 +0000 (11:09 +0200)]
mpc5xxx_fec: add call to reset_phy() after PHY initialization
Some boards need their board-specific PHY quirks to be called
to PHY to work normally. As mpc5xxx_fec driver uses on demand
PHY initialization and can even reinit PHY during normal operation
we can't count on reset_phy() call from arch/<arch>/lib/board.c
(it is most likely called _before_ we init the PHY from the
driver) so we need to add call to reset_phy() directly in the
driver.
Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Andreas Bießmann [Thu, 7 Oct 2010 07:44:47 +0000 (09:44 +0200)]
drivers/net/at91_emac.c: change return values
Some return values pretended correct pass. This patch changes them according
to README.drivers.net. This patch changes e.g. command 'dhcp' to stop after
errorneous autonegotiation.
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Andreas Bießmann [Thu, 7 Oct 2010 07:44:46 +0000 (09:44 +0200)]
drivers/net/at91_emac.c: increase timeout for autonegotiation
This patch increases timeout for autonegotiation from 1 second to 3 seconds.
Some boards (e.g. at91rm9200ek) did not negotiate within 1 second.
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Reinhard Meyer [Sun, 12 Sep 2010 14:23:49 +0000 (16:23 +0200)]
NET: add ENC28J60 driver using SPI framework
V3: further refinements:
- use priv member instead of container method
- allow setting of MAC address by write_hwaddr method
- avoid shutting down link between commands
Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Joakim Tjernlund [Tue, 10 Aug 2010 14:36:49 +0000 (16:36 +0200)]
UEC PHY: Speed up initial PHY neg.
Instead of always performing an autoneg, check if the PHY
already has a link and if it matches one of the requested
modes. Initially only 100MbFD is optimized this way.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Ben Warren [Mon, 2 Aug 2010 06:00:31 +0000 (23:00 -0700)]
Net: Remove redundant CONFIG_NET_MULTI directives
All are within an #ifdef CONFIG_NET_MULTI block already
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Joakim Tjernlund [Wed, 11 Aug 2010 09:44:22 +0000 (11:44 +0200)]
UEC PHY: Remove strange 0.5 sec delay
This udelay looks bogus and doesn't help my board.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Acked-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Joakim Tjernlund [Wed, 11 Aug 2010 09:44:21 +0000 (11:44 +0200)]
UEC: Don't udelay needlessly
uec_init() adds an udelay(100000) even though
the PHY status read went well, don't do that.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Acked-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Reinhard Meyer (-VC) [Fri, 6 Aug 2010 16:42:07 +0000 (18:42 +0200)]
NET: move legacy enc28j60.c to sidetrack as enc28j60_lpc2292.c
This patch is required before the upcoming new enc28j60 driver
using SPI framework patch can be applied:
- Move legacy enc28j60.c to enc28j60_lpc2292.c.
- Change Makefile and the two affected boards' definition files.
Tested with ./MAKEALL ARM7 that both boards still compile.
Signed-off-by: Reinhard Meyer<info@emk-elektronik.de>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Joakim Tjernlund [Thu, 19 Aug 2010 07:37:32 +0000 (09:37 +0200)]
net: Fix faulty definition of uec_initialize()
The correct definition is in drivers/qe/uec.h so just
remove this one.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Enric Balletbo i Serra [Mon, 11 Oct 2010 19:48:03 +0000 (21:48 +0200)]
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>
Scott Wood [Fri, 17 Sep 2010 19:38:37 +0000 (14:38 -0500)]
README: Add new NAND env features
CONFIG_ENV_SIZE does not need block alignment.
Document CONFIG_ENV_RANGE and CONFIG_ENV_OFFSET_OOB.
Signed-off-by: Scott Wood <scottwood@freescale.com>
Scott Wood [Thu, 9 Sep 2010 20:40:03 +0000 (15:40 -0500)]
Followup fixes on the mtdparts spread patchset
Consolidate some code in mtd_get_len_incl_bad(), and fix a condition
where a valid partition could be reported as truncated if it has a
good block at the end of the device (unlikely, since the BBT is usually
there).
Fix mid-block declarations in net_part_size().
Signed-off-by: Scott Wood <scottwood@freescale.com>
Reviewed-by: Ben Gardiner <bengardiner@nanometrics.ca>
Ben Gardiner [Tue, 31 Aug 2010 21:48:04 +0000 (17:48 -0400)]
mtdparts: new add.spread: add part skipping bad blocks
This patch adds a new 'mtdparts add' variant: add.spread. This command variant
adds a new partition to the mtdparts variable but also increases the partitions
size by skipping bad blocks and aggregating any additional bad blocks found at
the end of the partition.
Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
CC: Wolfgang Denk <wd@denx.de>
CC: Scott Wood <scottwood@freescale.com>
Ben Gardiner [Tue, 31 Aug 2010 21:48:03 +0000 (17:48 -0400)]
mtdparts: add new sub-command "spread"
This patch introduces the 'spread' sub-command of the mtdparts command.
This command will modify the existing mtdparts variable by increasing
the size of the partitions such that 1) each partition's net size is at
least as large as the size specified in the mtdparts variable and 2)
each partition starts on a good block.
The new subcommand is implemented by iterating over the mtd device
partitions and collecting a bad blocks count in each -- including any
trailing bad blocks -- and then modifying that partitions's part_info
structure and checking if the modification affects the next partition.
This patch is based on a port of the 'dynnamic partitions' feature by
Harald Welte <laforge@gnumonks.org>; ported from commit
e05835df019027391f58f9d8ce5e1257d6924798 of
git://git.openmoko.org/u-boot.git. Whereas Harald's feature used a
compile-time array to specify partitions, the feature introduced by
this patch uses the mtdparts environment variable.
Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Signed-off-by: Harald Welte <laforge@gnumonks.org>
CC: Wolfgang Denk <wd@denx.de>
CC: Scott Wood <scottwood@freescale.com>
Ben Gardiner [Tue, 31 Aug 2010 21:48:02 +0000 (17:48 -0400)]
mtdparts: show net size in mtdparts list
This patch adds an additional column to the output of list_partitions. The
additional column will contain the net size and a '(!)' beside it if the net
size is not equal to the partition size.
Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
CC: Wolfgang Denk <wd@denx.de>
CC: Scott Wood <scottwood@freescale.com>
Ben Gardiner [Tue, 31 Aug 2010 21:48:01 +0000 (17:48 -0400)]
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>
Ben Gardiner [Tue, 31 Aug 2010 21:48:00 +0000 (17:48 -0400)]
mtdparts: regroup calls to get_mtd_device_nm
The get_mtd_device_nm function is called in a couple places and the
string that is passed to it is not really used after the calls.
This patch regroups the calls to this function into a new function,
get_mtd_info.
Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Acked-by: Stefan Roese <sr@denx.de>
CC: Wolfgang Denk <wd@denx.de>
Scott Wood [Wed, 25 Aug 2010 22:42:49 +0000 (17:42 -0500)]
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>
Scott Wood [Wed, 25 Aug 2010 20:24:01 +0000 (15:24 -0500)]
nand commands: make only "dump" repeatable.
The dump command is made to increment its address on repeat,
as md does. Other commands do not make sense to issue repeatedly,
and can be irritating when it happens accidentally, so don't.
Signed-off-by: Scott Wood <scottwood@freescale.com>
Tested-by: Ben Gardiner <bengardiner@nanometrics.ca>
Scott Wood [Wed, 25 Aug 2010 19:43:29 +0000 (14:43 -0500)]
nand erase: .spread, .part, .chip subcommands
A while back, in http://lists.denx.de/pipermail/u-boot/2009-June/054428.html,
Michele De Candia posted a patch to not count bad blocks toward the
requested size to be erased. This is desireable when you're passing in
something like $filesize, but not when you're trying to erase a partition.
Thus, a .spread subcommand (named for consistency with
http://lists.denx.de/pipermail/u-boot/2010-August/075163.html) is introduced
to make explicit the user's desire to erase for a given amount of data,
rather than to erase a specific region of the chip.
While passing $filesize to "nand erase" is useful, accidentally passing
something like $fliesize currently produces quite unpleasant results, as the
variable evaluates to nothing and U-Boot assumes that you want to erase
the entire rest of the chip/partition. To improve the safety of the
erase command, require the user to make explicit their intentions by
using a .part or .chip subcommand. This is an incompatible user interface
change, but keeping compatibility would eliminate the safety gain, and IMHO
it's worth it.
While touching nand_erase_opts(), make it accept 64-bit offsets and sizes,
fix the percentage display when erase length is rounded up, eliminate
an inconsistent warning about rounding up the erase length which only
happened when the length was less than one block (rounding up for $filesize
is normal operation), and add a diagnostic if there's an attempt to erase
beginning at a non-block boundary.
Signed-off-by: Scott Wood <scottwood@freescale.com>
Tested-by: Ben Gardiner <bengardiner@nanometrics.ca>
Scott Wood [Mon, 2 Aug 2010 18:04:24 +0000 (13:04 -0500)]
cmd_nand: some infrastructure fixes and refactoring
- If the current device is overridden by a named partition,
- update the caller's pointer/index, rather than copy over the
nand_info struct, and
- be sure to call board_nand_select_device even when the device
is overridden by a named partition.
- Support 64-bit offsets/sizes in a few more places.
- Refactor arg_off_size for added readability and flexibility,
and some added checks such as partition size.
- Remove redundant check for bad subcommands -- if there's no match
it'll print usage when it gets to the end anyway.
Signed-off-by: Scott Wood <scottwood@freescale.com>
Tested-by: Ben Gardiner <bengardiner@nanometrics.ca>
Scott Wood [Fri, 30 Jul 2010 21:11:41 +0000 (16:11 -0500)]
nand util: read/write: accept unaligned length
The underlying code in nand_base.c already supports non-page-aligned reads
and writes, but the block-skipping wrapper code did not.
With block skipping, an unaligned start address is not useful since you
really want to be starting at the beginning of a partition -- or at least
that's where you want to start checking for blocks to skip, but we don't
(yet) support that. So we still require the start address to be aligned.
An unaligned length, though, is useful for passing $filesize to the
read/write command, and handling it does not complicate block skipping.
Signed-off-by: Scott Wood <scottwood@freescale.com>
Tested-by: Ben Gardiner <bengardiner@nanometrics.ca>
Wolfgang Denk [Mon, 11 Oct 2010 08:00:34 +0000 (10:00 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-x86
Wolfgang Denk [Mon, 11 Oct 2010 07:56:34 +0000 (09:56 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
Wolfgang Denk [Mon, 11 Oct 2010 07:52:16 +0000 (09:52 +0200)]
Merge branch 'sf' of git://git.denx.de/u-boot-blackfin
Timur Tabi [Thu, 30 Sep 2010 20:36:50 +0000 (15:36 -0500)]
fsl: add support for NXID v1 EEPROM format
Freescale application note AN3638 describes an update to the NXID format,
which stores MAC addresses and related data on an on-board EEPROM. The new
version adds support for up to 23 MAC addresses, instead of just 8. Since
the initial implementation of NXID had a "0" in the 'version' field, this
new version is called "v1".
Boards that are shipped with EEPROMs in the NXID v1 format should define
CONFIG_SYS_I2C_EEPROM_NXID_1 instead of CONFIG_SYS_I2C_EEPROM_NXID.
Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Kim Phillips [Fri, 3 Sep 2010 15:57:31 +0000 (10:57 -0500)]
powerpc/85xx: fix rev.2 job queue LIODN error storm
pumping line-rate traffic though a p4080 rev.2, which
is configured to encrypt packets prior to forwarding through
an IPsec tunnel, gets this error:
of_platform
ffe302000.jq: DECO: desc idx 22: LIODN error. DECO was trying
to share from itself or from another DECO but the two Non-SEQ LIODN
values didn't match or the "shared from" DECO's Descriptor required that
the SEQ LIODNs be the same and they aren't.
Since high traffic rates cause DECOs to begin to start sharing
shared descriptors amongst themselves, and DECOs inherit job queue
LIODNs when accessing shared descriptors, and a recently discovered
rev.2 h/w erratum requires all sharing job queues in a partition
have same liodn assignment, reassign the first job queue's liodn
assignment to the rest.
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Kumar Gala [Thu, 23 Sep 2010 19:50:37 +0000 (14:50 -0500)]
powerpc/p4080: Add new CPC register - HDBCR0
Manual was updated to add a new register for disabling CDQ speculation.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Kumar Gala [Fri, 9 Jul 2010 14:12:18 +0000 (09:12 -0500)]
powerpc/85xx: Add support for 4th PCI controller on corenet_ds
We configure the controller but dont have virtual address space thus any
devices on the 4th controller are not accessible in u-boot.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Emil Medve [Wed, 1 Sep 2010 03:57:43 +0000 (22:57 -0500)]
powerpc/corenet_ds: Various updates to initial env cfg
* Make the U-Boot update command sequence conditional. Helps prevent
accidental erasing if an upload or previous step fails
* Make it easier to update other FLASH banks
* Enable DDR controller cache line interleaving and bank cs0/cs1 by default
Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Timur Tabi [Mon, 2 Aug 2010 18:03:23 +0000 (13:03 -0500)]
fsl: verify writes to the MAC address EEPROM
Update the code which writes to the on-board EEPROM so that it can detect if
the write failed because the EEPROM is write-protected. Most of the 8xxx-class
Freescale reference boards use an AT24C02 EEPROM to store MAC addresses and
similar information. With this patch, if the EEPROM is protected, the
"mac save" command will display an error message indicating that the write
has not succeeded.
Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Timur Tabi [Wed, 21 Jul 2010 21:56:19 +0000 (16:56 -0500)]
p1022ds: add audclk hwconfig setting to enable codec reference clock
The Freescale P1022DS can use either a 12.288MHz or a 11.2896MHz reference
clock for the audio codec, but by default both are disabled. Add a 'audclk'
hwconfig option that allows the user to choose which clock he wants.
The 12.288MHz clock allows the codec to use sampling rates of 16, 24, 32, 48,
64, and 96KHz. The 11.2896 clock allows 14700, 22050, 29400, 44100, 58800, and
88200Hz.
Also configure a pin muxing to select some SSI signals, which will disable
I2C1.
Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Haiying Wang [Wed, 29 Sep 2010 17:31:36 +0000 (13:31 -0400)]
mpc8569mds: fix some ddr settings
Enable half drive strength, set RTT to 60Ohm and set write leveling override.
Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Haiying Wang [Wed, 29 Sep 2010 17:31:35 +0000 (13:31 -0400)]
mpc8569mds: fix consuming long time while relocating code.
The original code maps boot flash as non-cacheable region. When calling
relocate_code in flash to copy u-boot from flash to ddr, every loop copy command
is read from flash. The flash read speed will be the bottleneck, which consuming
long time to do this operation. To resovle this, map the boot flash as
write-through cache via tlb. And set tlb to remap the flash after code
executing in ddr, to confirm flash erase operation properly done.
Signed-off-by: Kai.Jiang <Kai.Jiang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Haiying Wang [Wed, 29 Sep 2010 17:44:14 +0000 (13:44 -0400)]
mpc8569mds: fix CONFIG_ENV_SIZE
CONFIG_ENV_SIZE of MPC8569MDS was wrongly set to CONFIG_ENV_SECT_SIZE which
is 128KB, so it took longer time to do crc32 calculation for ENV than it should
do. It causes the bootup for MPC8569MDS significantly slow. This patch fixs it
to 0x2000(8KB), also fix the comment for CONFIG_ENV_SECT_SIZE to correct size.
Signed-off-by: Kai.Jiang <Kai.Jiang@freescale.com
Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Graeme Russ [Thu, 7 Oct 2010 09:03:33 +0000 (20:03 +1100)]
x86: Implement fully relocatable image
u-boot.bin can be loaded at any 4-byte aligned memory location and directly
'jumped' to using the 'go' command using the load address as the start
address. Doing so performs a 'warm boot' which skips memory initialisation
and other low-level initialisations, relocates U-Boot to upper memory and
starts U-Boot in RAM as per normal 'cold boot'
Graeme Russ [Thu, 7 Oct 2010 09:03:33 +0000 (20:03 +1100)]
x86: Use loops instead of memcpy/memset in board_init_f
Provides a small speed increase and prepares for fully relocatable image.
Downside is the TEXT_BASE, bss, load address etc must ALL be aligned on a
a 4-byte boundary which is not such a terrible restriction as everything
is already 4-byte aligned anyway
Graeme Russ [Thu, 7 Oct 2010 09:03:32 +0000 (20:03 +1100)]
x86: Rearrange linker script
Tidy up the linker script and discard some sections to save space
Graeme Russ [Thu, 7 Oct 2010 09:03:31 +0000 (20:03 +1100)]
x86: Rename linker script symbols
Create more generic names for the symbols exported from the linker script
Graeme Russ [Thu, 7 Oct 2010 09:03:30 +0000 (20:03 +1100)]
x86: Set cold/warm boot flag
Graeme Russ [Thu, 7 Oct 2010 09:03:29 +0000 (20:03 +1100)]
x86: Place global data below stack before entering C
By reserving space for the Global Data immediately below the stack during
assembly level initialisation, the C declaration of the static global data
can be removed, along with the 'RAM Bootstrap' function. This results in
cleaner code, and the ability to pass boot-up flags from assembler into C
Graeme Russ [Thu, 7 Oct 2010 09:03:28 +0000 (20:03 +1100)]
x86: Dont clobber %eax after getting memory size
By using another register, reduce code size by one instruction
Graeme Russ [Thu, 7 Oct 2010 09:03:28 +0000 (20:03 +1100)]
x86: Don't clobber %ebx
%ebx will hold low-level boot flags and must be preserved
Graeme Russ [Thu, 7 Oct 2010 09:03:27 +0000 (20:03 +1100)]
x86: Remove usage of %ebp as a return pointer
Using %ebp as a return pointer prevents creating 'load anywhere' images
Graeme Russ [Thu, 7 Oct 2010 09:03:26 +0000 (20:03 +1100)]
x86: Move ECC initialisation outside RAM initialisation
To allow for 'load anywhere' images, the %ebp return pointer 'hack' must
be removed, so we cannot have two 'calls' to get_mem_size
Graeme Russ [Thu, 7 Oct 2010 09:03:24 +0000 (20:03 +1100)]
x86: Remove progress indication in low-level init
Progress indication is not relocation friendly so remove it in
preperation for full relocatability support
Graeme Russ [Thu, 7 Oct 2010 09:03:23 +0000 (20:03 +1100)]
x86: Fix %ss and %esp in register structure for interrupts
Graeme Russ [Thu, 7 Oct 2010 09:03:23 +0000 (20:03 +1100)]
x86: Change compiler options
Change to:
- reparam=3
- no-from-pointer
- no-stack-protector
- preferred-stack-boundary=2
- no-top-level-reorder
These options make the code a little smaller and faster
Graeme Russ [Thu, 7 Oct 2010 09:03:21 +0000 (20:03 +1100)]
x86: Coding Style Cleanup
Perform some basic code cleanups of the x86 files
Graeme Russ [Thu, 7 Oct 2010 09:03:21 +0000 (20:03 +1100)]
x86: Move loading of GTD to C code
Linux has C macros and code to load the GTD after switching to Protected
Mode. Using these greatly simplifies the assembler code
Graeme Russ [Thu, 7 Oct 2010 09:03:20 +0000 (20:03 +1100)]
x86: use gc sections to reduce image size
Follow the discussion of Charles Manning and Mike Frysinger.
Using gc_sections helps reduce image size.
Graeme Russ [Thu, 7 Oct 2010 09:03:19 +0000 (20:03 +1100)]
x86: zboot update
The header of recent Linux Kernels includes the size of the image, and
therefore is not needed to be passed to zboot. Still process the third
parameter (size of image) in the event that an older kernel is being loaded
Graeme Russ [Thu, 7 Oct 2010 09:03:18 +0000 (20:03 +1100)]
x86: Use TEXT_BASE in linker scripts
Use TEXT_BASE rather than a hard-coded base address on x86 linker scripts.
This will allow any board to define its base link address without having
to modify the linker script
Graeme Russ [Thu, 7 Oct 2010 09:03:18 +0000 (20:03 +1100)]
x86: Make CONFIG_RELOC_FIXUP_WORKS generic for all x86 boards
Relocation is not board-specific for the x86 architectrure, so
CONFIG_RELOC_FIXUP_WORKS can be defined globally in the config.h
Graeme Russ [Thu, 7 Oct 2010 09:03:17 +0000 (20:03 +1100)]
x86: Remove bi_env from do_bdinfo
Commit
55e97429d1e6cf0976711e4e0f29ea924b7e5917 removed the definition
from /arch/i386/include/asm/u-boot.h but not its usage in do_bdinfo()
Reinhard Meyer [Thu, 26 Aug 2010 08:57:27 +0000 (10:57 +0200)]
sspi: add options to specify bus and mode
and clean up error messages and help,
removed pointless debug() call.
Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
David Jander [Mon, 23 Aug 2010 13:12:16 +0000 (15:12 +0200)]
sf: spansion: add support for S25FL032P parts
This patch introduces an extra mask-field in spansion_spi_flash_params
to support flash chips with 1-byte extended ID (like the S25FL032P).
Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Marc-André Hébert [Tue, 10 Aug 2010 13:02:09 +0000 (09:02 -0400)]
sf: spansion: fixing erasing when sector size >64KiB
The spansion_erase currently only works when the sector size is 64KB.
cmd[1] should contain the higher 8 bit of the 24 bit address of the
sector to be erased. Currently it is holding the sector index to be
erased which happens to be the same thing when the sector size is
64KB.
Signed-off-by: Marc-Andre Hebert <marc-andre.hebert@humanware.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Andreas Bießmann [Sat, 25 Sep 2010 15:45:59 +0000 (17:45 +0200)]
include/compiler.h: remove uint typedef for __MACH__
uint is typedefed twice if __MACH__ is defined. This generates an error
when calling MAKEALL for netstar bord on OS X.
This patch removes the typedef for __MACH__ case in favor of general
definiton some lines below.
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Peter Tyser [Wed, 29 Sep 2010 18:30:56 +0000 (13:30 -0500)]
Replace MAX_CMDBUF_SIZE references with CONFIG_SYS_CBSIZE
The MAX_CMDBUF_SIZE define is unneeded as it should always
equal CONFIG_SYS_CBSIZE.
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Jeff Dischler [Wed, 29 Sep 2010 18:46:19 +0000 (13:46 -0500)]
ds1621: Fix negative temperature readings
Fix bug where signed data was processed as unsigned. The bug previously
resulted in negative temperature readings wrapping around, eg -10 became
245.
Signed-off-by: Jeff Dischler <jdischler@xes-inc.com>
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Peter Tyser [Wed, 29 Sep 2010 18:46:18 +0000 (13:46 -0500)]
ds1621: Clean up coding style
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Peter Tyser [Wed, 29 Sep 2010 18:46:17 +0000 (13:46 -0500)]
ds1621: Poll for register write completion
Poll the ds1621 NV Memory Busy bit instead of waiting a static amount of
time for register writes.
Also add config retister bit defines.
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Andreas Bießmann [Fri, 1 Oct 2010 20:51:02 +0000 (22:51 +0200)]
lib/hashtable.c: add CONFIG_ENV_MIN_ENTRIES
This patch adds a new config parameter for adjusting the calculation of
hash table size when importing a buffer.
When importing a extremely small buffer (e.g. the default_environment)
the old calculation generated a hash table which could hold at most the
buffer content but no more entires.
The new calculation add a fixed number of entries to the result to fit
better for small import buffers. This amount may be configured by the
user in board file to adjust the behaviour.
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Mike Frysinger [Sat, 2 Oct 2010 19:44:53 +0000 (15:44 -0400)]
cmd_elf: add an option for loading ELFs according to PHDRs
The current ELF loading function does a lot of work above and beyond a
simple "loading". It ignores the real load addresses and loads things
into their virtual (runtime) address. This is undesirable when we just
want it to load an ELF and let the ELF do the actual C runtime init.
So add a command line option to let people choose to load via either the
program or section headers. I'd prefer to have program header loading
be the default, but this would break historical behavior, so I'll leave
section header loading as the norm.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Andre Schwarz [Tue, 5 Oct 2010 09:59:31 +0000 (11:59 +0200)]
PowerPC: change board specific early pci_init() into generic.
Signed-off-by: Andre Schwarz <andre.schwarz@matrix-vision.de>
Stefan Roese [Wed, 6 Oct 2010 16:50:59 +0000 (18:50 +0200)]
serial.c: Fix build breakage introduced with commit
e3c78c9b
This patch fixes the compilation problem introduced with commit
e3c78c9b [ppc4xx: Remove now unused CONFIG_UART1_CONSOLE]:
-> ./MAKEALL TB5200
Configuring for TB5200 board...
serial.c: In function '__default_serial_console':
serial.c:94: warning: no return statement in function returning non-void
I accidentally removed an "#else" line. This patch adds it back.
Signed-off-by: Stefan Roese <sr@denx.de>
Heiko Schocher [Tue, 5 Oct 2010 12:17:00 +0000 (14:17 +0200)]
env: fix cmd_env_sub fct pointers if CONFIG_RELOC_FIXUP_WORKS is not defined
commit
ea882baf9c17cd142c99e3ff640d3ab01daa5cec introduces
a command_sub_table for the "env" command. On arm, avr32, m68k,
mips and sparc architectures, relocation needs manual fixups,
so add these fixups for this sub command table too.
Tested on arm/qong board.
mips board (Ben NanoNote) from Xiangfu Liu
arm/AT91 board from Reinhard Meyer
Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
cc: Xiangfu Liu <xiangfu@openmobilefree.net>
cc: Reinhard Meyer <u-boot@emk-elektronik.de>
cc: sshtylyov@mvista.com
Peter Tyser [Wed, 6 Oct 2010 04:48:47 +0000 (23:48 -0500)]
board/mpl: Remove mpl-specific memory test command
The mpl-specfic memory test is only documented for one board, doesn't
compile cleanly, uses improper coding style, and overlaps functionality
with U-Boot's common 'mtest' command, so lets get rid of it.
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
CC: d.peter@mpl.ch
CC: d.mueller@elsoft.ch
CC: wd@denx.de
Steve Sakoman [Tue, 5 Oct 2010 22:31:38 +0000 (15:31 -0700)]
env_mmc: Fix broken build due to set_default_env() change
Previously the function was set_default_env(void), it is now
set_default_env(const char *s). This patch adds the required
parameter. This fixes a broken build on OMAP4430 SDP.
Signed-off-by: Steve Sakoman <steve.sakoman@linaro.org>
Wolfgang Denk [Tue, 5 Oct 2010 20:54:54 +0000 (22:54 +0200)]
CCM: remove code for yet another corpse
The CCM board has long reached EOL, and support for it is no longer
relevant in current versions of U-Boot. Remove it.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Wolfgang Denk [Tue, 5 Oct 2010 20:54:53 +0000 (22:54 +0200)]
PCU_E: remove code for yet another corpse
The PCU_E board has long reached EOL, and support for it is no longer
relevant in current versions of U-Boot. Remove it.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Wolfgang Denk [Tue, 5 Oct 2010 19:27:17 +0000 (21:27 +0200)]
pm9g45: fix compile warning
Fix warning:
pm9g45.c: In function 'pm9g45_macb_hw_init':
pm9g45.c:99: warning: unused variable 'pio'
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Ilko Iliev <iliev@ronetix.at>
Wolfgang Denk [Tue, 5 Oct 2010 19:24:17 +0000 (21:24 +0200)]
pm9263: fix compile warning
Fix warning:
pm9263.c: In function 'pm9263_macb_hw_init':
pm9263.c:99: warning: unused variable 'pio'
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Ilko Iliev <iliev@ronetix.at>
Wolfgang Denk [Tue, 5 Oct 2010 12:08:55 +0000 (14:08 +0200)]
rules.mk: make sure we always create a .depend file
There are some cases where "make depend" would always run when
entering a directory. This happened when both the $(SRCS) and
$(HOSTSRCS) lists were empty (which is for example typical for the
examples/api/ directory). Avoid this by making sure that a ".depend"
file gets always created, even if empty.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>
Graeme Smecher [Thu, 29 Jul 2010 13:00:02 +0000 (09:00 -0400)]
sf: winbond: add support W25Q64 parts
Adds support for Winbond's W25Q64 SPI flash. These devices are used on
(among others) Xilinx' SP601 and SP605 Spartan-6 evaluation boards.
Tested with "sf" commands.
Signed-off-by: Graeme Smecher <graeme.smecher@mail.mcgill.ca>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Wolfgang Denk [Tue, 5 Oct 2010 12:42:32 +0000 (14:42 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-blackfin