Commit Graph

1476 Commits

Author SHA1 Message Date
Terry Lv a80603598c Save environment data to mmc.
This patch is to save environment data to mmc card.
It uses interfaces defined in generic mmc.

Signed-off-by: Terry Lv <r65388@freescale.com>
Acked-by: Stefano Babic <sbabic@denx.de>
2010-09-19 17:47:29 +02:00
Lei Wen 8f3b96427a mmc: print out partition table
Signed-off-by: Lei Wen <leiwen@marvell.com>
2010-09-18 23:47:28 +02:00
Graeme Russ a806ee6fae x86: Add do_bdinfo()
x86 failed to compile with a message "a case for this architecture does
not exist!" - Add do_bdinfo() for this arch
2010-09-13 07:20:02 +10:00
Wolfgang Denk 2d941de9d5 Prepare v2010.09-rc1
Coding style cleanup.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-09-10 00:16:19 +02:00
Wolfgang Denk 09b4a9cf40 Merge branch 'master' of git://git.denx.de/u-boot-samsung 2010-09-08 00:03:22 +02:00
Wolfgang Denk f91506e283 Merge branch 'master' of /home/wd/git/u-boot/master 2010-09-07 22:19:49 +02:00
Wolfgang Denk 1b43b5d7a6 Merge branch 'master' of git://git.denx.de/u-boot-sh 2010-09-07 21:49:47 +02:00
Wolfgang Denk 67bd94148e Merge branch 'master' of git://git.denx.de/u-boot-i2c 2010-09-07 21:28:20 +02:00
Nobuhiro Iwamatsu ebd0d062ac sh: Add support do_bdinfo function
SH did not support do_bdinfo fuction.
This code based avr32 stuff.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
2010-08-30 17:02:49 +09:00
Minkyu Kang 889a275d42 ARMV7: S5P: rename from CONFIG_S5PC1XX to CONFIG_S5P
Use the same configuration around S5P SoCs.
(s5pc100, s5pc110, s5pc210 and so on)

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2010-08-26 17:33:23 +09:00
Reinhard Meyer 7a92e53cd0 CMD_I2C: make alen=0 work
Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
2010-08-26 08:33:24 +02:00
Scott Wood 6395f318e9 fdt: call fdt_parent_offset fewer times while translating addresses
fdt_parent_offset() is an expensive operation, so we'd like to reduce
unnecessary calls to it.

Further, the practice of iterating up to the root if address/size cells
aren't found was apparently done for Linux for compatibility with certain
buggy Open Firmware implementations, and U-Boot inherited the code.  The
compliant behavior is to treat a missing #address-cells as 2, and a missing
#size-cells as 1 -- never looking anywhere but the immediate parent of the
node of interest.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-08-19 21:21:41 -05:00
Wolfgang Denk 5549d22b65 Merge branch 'master' of /home/wd/git/u-boot/master 2010-08-18 21:19:00 +02:00
Mike Frysinger 962ad59e25 env_nand: return error when no device is found
Currently, if there is an error probing the NAND chip and the env is based
in NAND, the readenv() function will use a NULL function pointer and thus
jump to address 0.

Here I just check for a non-zero value of blocksize as that shouldn't be
zero when a valid device is found, but perhaps there is a better way for
someone familiar with the NAND internals to suggest.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Tested-by: Ben Gardiner <bengardiner@nanometrics.ca>
2010-08-13 13:32:42 -05:00
Wolfgang Denk ae37a0704a Merge branch 'master' of git://git.denx.de/u-boot-ti 2010-08-12 23:08:05 +02:00
Sergei Poselenov 842404ea07 Fixed clobbered output of the "help usb" command
The "usb help" doesn't format the output correctly:

=> help usb
usb - USB sub-system

Usage:
usb reset - reset (rescan) USB controller
usb stop [f]  - stop USB [f]=force stop
usb tree  - show USB device tree
usb info [dev] - show available USB devices
usb storage  - show details of USB storage devices
usb dev [dev] - show or set current USB storage device
usb part [dev] - print partition table of one or all USB storage devices
usb read addr blk# cnt - read `cnt' blocks starting at block `blk#'
    to memory address `addr'usb write addr blk# cnt - write `cnt'
blocks starting at block `blk#' from memory address `addr'
=>

With fix below applied, the output is correct:

=> help usb
usb - USB sub-system

Usage:
usb reset - reset (rescan) USB controller
usb stop [f]  - stop USB [f]=force stop
usb tree  - show USB device tree
usb info [dev] - show available USB devices
usb storage  - show details of USB storage devices
usb dev [dev] - show or set current USB storage device
usb part [dev] - print partition table of one or all USB storage devices
usb read addr blk# cnt - read `cnt' blocks starting at block `blk#'
    to memory address `addr'
usb write addr blk# cnt - write `cnt' blocks starting at block `blk#'
    from memory address `addr'
=>

Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
2010-08-12 16:40:00 +02:00
Matthias Weisser 6052ac8386 ARM: Add support for MB86R0x SoCs
Signed-off-by: Matthias Weisser <weisserm@arcor.de>
2010-08-10 23:13:28 +02:00
Wolfgang Denk b9d51fbb18 Merge branch 'master' of git://git.denx.de/u-boot-arm 2010-08-10 23:03:15 +02:00
Wolfgang Denk b77f380115 Merge branch 'master' of git://git.denx.de/u-boot-imx 2010-08-10 22:49:09 +02:00
Wolfgang Denk fe8d63c8c7 Merge branch 'master' of git://git.denx.de/u-boot-marvell 2010-08-10 22:37:27 +02:00
Reinhard Meyer a9804be868 fix cmd_mmc.c, line 136 missing "
Remove warning for missing " at the end of line 136

Signed-off-by: Reinhard Meyer <u-boot@emk-elektronik.de>
2010-08-10 09:43:26 +02:00
Mike Frysinger ede16ea32d miiphy: leverage current_mii cache more
For code that uses miiphy_{read,write}, every call invokes a full look up
of the mii list.  There is already a "current_mii" cache that is used by
some code, but have the miiphy_{read,write} function use it as well.  This
does increase the code size slightly, but I think it's worth it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2010-08-09 11:52:30 -07:00
Mike Frysinger 0daac97801 miiphy: unify device list lookup
Rather than have every func re-implement the list walking code, do it one
local function.  This shrinks the resulting object code a little while
making the source much more manageable.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2010-08-09 11:52:29 -07:00
Mike Frysinger 5700bb6352 miiphy: constify device name
The driver name does not need to be writable, so constify it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2010-08-09 11:52:29 -07:00
Feng Wang 3840ebfaf8 fdt: Fix bug in size calculation in fdt_resize() with initrd use
Original bug description from Feng (fdt_resize() bug caused "WARNING:
could not set linux, initrd-start FDT_ERR_NOSPACE."):

What I got is an error: "WARNING: could not set linux,initrd-start
FDT_ERR_NOSPACE." after loading Device Tree blob. This in turn caused
linux to miss init part.

After some digging, I found out the reason for this error, it is caused
by fdt_resize().

FDT blob got resized after filling in all board specific information of
PowerPC. (in boot_body_linux()). It reduced blob size with only extra
space for two fdt_reserve_entry, one for fdt itself, and one for initrd.
Then it's aligned to a 0x1000 page boundary. However, later in
fdt_initrd(), it could add two more properties, initrd-start AND
initrd-end, each one needs at least two fdt_reserve_entry sizes done by
_fdt_add_property() (name and value). Thus, the two fdt_reserve_entry
extra space is not sufficient.

So for some specific fdt size which is just under the page boundary
after resizing, this will cause an error of FDT_ERR_NOSPACE in
fdt_initrd() when setting those two properties, and failed to pass
initrd information to linux.

My fix is in fdt_resize(), leave at least 4 fdt_reserve_entry for
initrd. So instead of 2*sizeof(struct fdt_reserve_entry) for
actual_totalsize, use 5*sizeof(struc fdt_reserve_entry).

Stefan: I got this same error on katmai, when trying to boot with
initrd (run flash_self). This patch fixes this issue.

Signed-off-by: Feng Wang <fwang02@harris.com>
Tested-by: Stefan Roese <sr@denx.de>
Cc: Jerry Van Baren <gvb.uboot@gmail.com>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
2010-08-09 01:10:30 +02:00
Frans Meulenbroeks 388a29d024 various cmd_* files: fixed layout a little bit
Most of the files have U_BOOT_CMD on a separate line,
but a few didn't and had the first line on the same line
as U_BOOT_CMD.

This changes these files by adding a line break and a tab

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
2010-08-09 01:07:37 +02:00
Frans Meulenbroeks cc9f607beb various cmd_* files: remove the command name from the help message
removed the command name from the help message as it is already printed.
for cmd_mmc also rewrote the message a little bit

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
2010-08-09 01:06:34 +02:00
Mike Frysinger a4e8d9f5f9 flash_protect: check for NULL flash info
If a flash is unable to be detected, and then someone calls flash_protect
on it (like the common code does in flash_init), the flash_protect logic
will dereference a NULL pointer.

Since flash_protect already does sanity checking on the info structs, add
a NULL pointer check in there.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-08-09 01:03:54 +02:00
Wolfgang Denk 9ed4a9582f getenv_f(): fix handling of too short buffers
Fix error handling in getenv_f() when the user provided buffer is too
short to hold the variable name; make sure to truncate and
NUL-terminate without overwriting the buffer limits.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-08-09 00:53:57 +02:00
Mike Frysinger 739b8080af dataflash mmc mux: use common cmd_usage function
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-08-09 00:32:26 +02:00
Mike Frysinger a7481b353b mflash: use common cmd_usage function
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-08-09 00:32:06 +02:00
Mike Frysinger 8faba4894c cmd editing: optimize/shrink output blanking
No need to output spaces 1 char at a time in a loop when the printf code
can do the same thing with the right format string.  This shrinks things
and gives a nice speed up when killing off lines more than a byte or two
as printf will send out the buffer in one big chunk.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-08-09 00:26:04 +02:00
Stephan Linz 958e120643 fdt relocate: have more attention to use a bootmap or not
Platforms with flat device tree support can use a bootmap to relocate
the fdt_blob. This is not a must. That's why the relocation function
boot_relocate_fdt() should be use only if CONFIG_OF_LIBFDT was defined
together with CONFIG_SYS_BOOTMAPSZ (see common/cmd_bootm.c).

On MicroBlaze platforms there is no need to use a bootmap to relocate
a fdt blob. So we need a more precise focus on the compilation and usage
of boot_relocate_fdt().

In general it is valid to exclude the function boot_relocate_fdt() if
the bootmap size CONFIG_SYS_BOOTMAPSZ is not defined.

Signed-off-by: Stephan Linz <linz@li-pro.net>
2010-08-08 22:16:05 +02:00
Prafulla Wadaskar 5f30500316 cmd_ide: add support for Kirkwood
Added MVSATAC definitions to Kirkwood.
Added support for Kirkwood in cmd_ide.

Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
2010-08-08 05:17:55 +05:30
Albert Aribaud 113bfe48bc cmd_ide: add support for orion5x
Add MVSATAHC definitions to orion5x.
Add support for orion5x in cmd_ide.

Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
2010-08-08 05:17:06 +05:30
Albert Aribaud f2a37fcd9b ide: add configuration
CONFIG_IDE_SWAP_IO

This configuration option replaces a complex conditional
in cmd_ide.c with an explicit define to be added to SoC or
board configs.

Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
2010-08-08 05:17:05 +05:30
Matthias Weisser 60fdc5f2f0 LZMA and LZO causes compile error
If both LZMA and LZO compressions are used there is a compile error
in cmd_bootm.c

Signed-off-by: Matthias Weisser <weisserm@arcor.de>
2010-08-07 23:49:59 +02:00
Matthew McClintock c519facc64 Fix condition where bootm_size not set and wrong memory size reported
If the user sets bootm_low and does not set bootm_size, u-boot will
report the memory node in the flat device tree incorrectly. Instead
of reporting the remaining size of memory, it will report the total
available memory which is incorrect.

Specifically this fixes the situation when booting a relocatable
kernel and the memory is reported as an offset and size in the
device tree, and the size needs to be adjusted accordingly.

Signed-off-by: Matthew McClintock <msm@freescale.com>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
2010-08-07 21:55:03 +02:00
Wolfgang Denk cdb749778a Rename getenv_r() into getenv_f()
While running from flash, i. e. before relocation, we have only a
limited C runtime environment without writable data segment. In this
phase, some configurations (for example with environment in EEPROM)
must not use the normal getenv(), but a special function.  This
function had been called getenv_r(), with the idea that the "_r"
suffix would mean the same as in the _r_eentrant versions of some of
the C library functions (for example getdate vs. getdate_r, getgrent
vs. getgrent_r, etc.).

Unfortunately this was a misleading name, as in U-Boot the "_r"
generally means "running from RAM", i. e. _after_ relocation.

To avoid confusion, rename into getenv_f() [as "running from flash"]

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>
2010-08-04 00:45:36 +02:00
Mike Frysinger 78e1e84677 bootm: fix pointer warning with lzma
Avoid warning:
cmd_bootm.c: In function 'bootm_load_os':
cmd_bootm.c:394: warning: passing argument 2 of
	'lzmaBuffToBuffDecompress' from incompatible pointer type

For 32 bit systems, this change shouldn't make a difference to code size
since sizeof(size_t) and sizeof(unsigned int) are equal.  But it does fix
the warning.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-08-04 00:43:53 +02:00
Kumar Gala b4b847e951 fdt: Add function to alloc phandle values
If we are creating reference (handles) to nodes in a device tree we need
to first create a new phandle in node and this needs a new phandle
value.  So we search through the whole dtb to find the max phandle value
and return the next greater value for a new phandle allocation.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
2010-07-26 13:07:56 -05:00
Wolfgang Denk 7385c28e9b fs/fat: Big code cleanup.
- reformat
- throw out macros like FAT_DPRINT and FAT_DPRINT
- remove dead code

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-07-24 20:54:46 +02:00
Wolfgang Denk 226fa9bb9e usb_storage.c: change progress output in debug() message
The dots printed by common/usb_storage.c as progress meter corrupt the
output for example of "fatls usb" commands like this:

=> fatls usb 0
.			<<==== here
       29   file.001
       29   file.002
       29   file.003
       29   file.004
       29   file.005
       29   file.006
       29   file.007
       29   file.008
       29   file.009
       29   file.010
       29   file.011
       29   file.012
       29   file.013
       29   file.014
       29   file.015
       29   file.016
.			<<==== here
       29   file.017
       29   file.018
       29   file.019
...

Turn the progress output into a debug message.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Remy Bohmer <linux@bohmer.net>
2010-07-24 20:53:50 +02:00
Wolfgang Denk a17c548b53 usb_storage.c: initialize device type
The device type was left uninitialized which caused later tests
against DEV_TYPE_UNKNOWN to fail. In the result, "usb part" would
attempt to print information about non-existent devices like this:

	=> usb part
	print_part of 0

	Partition Map for USB device 0  --   Partition Type: DOS

	Partition     Start Sector     Num Sectors     Type
	    1                    0         2031616      f8

	print_part of 1
	## Unknown partition table

	print_part of 2
	## Unknown partition table

	print_part of 3
	## Unknown partition table

	print_part of 4
	## Unknown partition table
	=>

By initializing the type as DEV_TYPE_UNKNOWN we avoid all the
"Unknown partition table" messages.

[Note: the "print_part of ?" messages is left over debug code that
will be removed in another patch.]

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Remy Bohmer <linux@bohmer.net>
2010-07-24 20:45:39 +02:00
Wolfgang Denk 47e26b1bf9 cmd_usage(): simplify return code handling
Lots of code use this construct:

	cmd_usage(cmdtp);
	return 1;

Change cmd_usage() let it return 1 - then we can replace all these
ocurrances by

	return cmd_usage(cmdtp);

This fixes a few places with incorrect return code handling, too.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-07-24 20:43:57 +02:00
Kumar Gala 75e73afd57 fdt: Add fdt_node_offset_by_compat_reg helper
Given a compatible string and physical address try and find a node that
matches.  This is useful when we want to find a specific device node to
update (for example if we have multiple PCI nodes we can use the
physical address to distinguish them when trying to update the device
tree).

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
2010-07-20 04:40:06 -05:00
Kumar Gala a0342c0804 fdt: Add fdt_translate_address to convert reg node to cpu phys addr
This code is extracted out of the Linux Kernel code from
arch/powerpc/kernel/prom_parse.c.

We maintain some of the same structure to support multiple bus types even
though we only have one in the current code.  In the future we might want
to translate across a PCI bus and thus it will be easier to add that
functionality back in.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
2010-07-20 04:40:00 -05:00
Wolfgang Denk 0fe247b973 Drop support for GTH board
The board maintainer states:

    The GTH board is obsolete and has not been manufactured for
    several years.
    To my knowledge, no recent U-Boot build has been tested on that
    card.

So drop support for this board.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Thomas Lange <thomas@corelatus.se>
Acked-by: Thomas Lange<thomas@corelatus.se>
2010-07-17 20:47:08 +02:00
Wolfgang Denk b6c208ab1e Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx 2010-07-16 23:15:01 +02:00
Becky Bruce 199e262eb3 mpc85xx: Add reginfo command
The new command dumps the TLBCAM, the LAWs, and the BR/OR regs.
Add CONFIG_CMD_REGINFO to the config for all MPC85xx parts.

Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-07-16 10:55:09 -05:00