Commit Graph

1656 Commits

Author SHA1 Message Date
Wolfgang Denk a146bcc208 Merge branch 'master' of git://git.denx.de/u-boot-mmc 2011-04-29 22:45:50 +02:00
Thomas Chou 28df15e023 mmc_spi: add mmc_init call
As Andy Fleming suggested, we can call mmc_init() in mmc_spi command.
So that we don't need to run mmcinfo command next.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
2011-04-29 03:20:01 -05:00
Stefan Bigler c649dda537 i2c: add i2c deblock sequence before and after every mux config
To make sure that the mux can be configured a deblocking sequence
is done before the mux configuration. After the mux switch the new leaf
of, the i2c tree must be again deblocked.

Signed-off-by: Stefan Bigler <stefan.bigler@keymile.com>
Acked-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Prafulla Wadaskar <prafulla@marvell.com>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
2011-04-28 10:56:54 +02:00
Kim Phillips a000b7950d common: add a grepenv command
u-boot environments, esp. when boards are shared across multiple
users, can get pretty large and time consuming to visually parse.
The grepenv command this patch adds can be used in lieu of printenv
to facilitate searching.  grepenv works like printenv but limits
its output only to environment strings (variable name and value
pairs) that match the user specified substring.

the following examples are on a board with a 5313 byte environment
that spans multiple screen pages:

Example 1:  summarize ethernet configuration:

=> grepenv eth TSEC
etact=FM1@DTSEC2
eth=FM1@DTSEC4
ethact=FM1@DTSEC2
eth1addr=00:E0:0C:00:8b:01
eth2addr=00:E0:0C:00:8b:02
eth3addr=00:E0:0C:00:8b:03
eth4addr=00:E0:0C:00:8b:04
eth5addr=00:E0:0C:00:8b:05
eth6addr=00:E0:0C:00:8b:06
eth7addr=00:E0:0C:00:8b:07
eth8addr=00:E0:0C:00:8b:08
eth9addr=00:E0:0C:00:8b:09
ethaddr=00:E0:0C:00:8b:00
netdev=eth0
uprcw=setenv ethact $eth;setenv filename p4080ds/R_PPSXX_0xe/rcw_0xe_2sgmii_rev2_high.bin;setenv start 0xe8000000;protect off all;run upimage;protect on all
upuboot=setenv ethact $eth;setenv filename u-boot.bin;setenv start eff80000;protect off all;run upimage;protect on all
upucode=setenv ethact $eth;setenv filename fsl_fman_ucode_P4080_101_6.bin;setenv start 0xef000000;protect off all;run upimage;protect on all
usdboot=setenv ethact $eth;tftp 1000000 $dir/$bootfile;tftp 2000000 $dir/initramfs.cpio.gz.uboot;tftp c00000 $dir/p4080ds-usdpaa.dtb;setenv bootargs root=/dev/ram rw console=ttyS0,115200 $othbootargs;bootm 1000000 2000000 c00000;
=>

Example 2: detect unused env vars:

=> grepenv etact
etact=FM1@DTSEC2
=>

Example 3: reveal hardcoded variables; e.g., for fdtaddr:

=> grepenv fdtaddr
fdtaddr=c00000
nfsboot=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off console=$consoledev,$baudrate $othbootargs;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr - $fdtaddr
ramboot=setenv bootargs root=/dev/ram rw console=$consoledev,$baudrate $othbootargs;tftp $ramdiskaddr $ramdiskfile;tftp $loadaddr $bootfile;tftp $fdtaddr $fdtfile;bootm $loadaddr $ramdiskaddr $fdtaddr
=> grep $fdtaddr
fdtaddr=c00000
my_boot=bootm 0x40000000 0x41000000 0x00c00000
my_dtb=tftp 0x00c00000 $prefix/p4080ds.dtb
nohvboot=tftp 1000000 $dir/$bootfile;tftp 2000000 $dir/$ramdiskfile;tftp c00000 $dir/$fdtfile;setenv bootargs root=/dev/ram rw ramdisk_size=0x10000000 console=ttyS0,115200;bootm 1000000 2000000 c00000;
=>

This patch also enables the grepenv command by default on
corenet_ds based boards (and repositions the DHCP command
entry to keep the list sorted).

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Cc: Kumar Gala <kumar.gala@freescale.com>
Cc: Andy Fleming <afleming@freescale.com>
2011-04-28 01:00:07 +02:00
thomas.langer@lantiq.com 2dc55d9ede fix redundant environment for serial flash
This patch fixes problems in the handling of redundant environment in env_sf.c

The major problem are double calls of free() on the allocated buffers,
which damages the internal data of malloc and crashes on next call.

In addition, the selection of the active environment had errors and compiler
warnings, which are corrected by this patch.

Signed-off-by: Thomas Langer <thomas.langer@lantiq.com>
2011-04-28 00:46:01 +02:00
Wolfgang Denk f38536f913 Merge branch 'master' of git://git.denx.de/u-boot-arm 2011-04-27 21:48:09 +02:00
Jason Kridner b633f66f02 Add 'led' command
This patch allows any board implementing the coloured LED API
to control the LEDs from the console.

led [green | yellow | red | all ]  [ on | off ]

or

led [ 1 | 2 | 3 | all ]  [ on | off ]

Adds configuration item CONFIG_CMD_LED enabling the command.

Partially based on patch from Ulf Samuelsson:
http://www.mail-archive.com/u-boot@lists.denx.de/msg09593.html.

Updated based on feedback:
http://www.mail-archive.com/u-boot@lists.denx.de/msg41847.html
https://groups.google.com/d/topic/beagleboard/8Wf1HiK_QBo/discussion
* Fixed a handful of style issues.
* Significantly reduced the number of #ifdefs and redundant code
* Converted redundant code into loops test against a structure
* Made use of cmd_usage()
* Introduced a str_onoff() function, but haven't yet put it in common
* Eliminated trailing newline

Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2011-04-27 19:38:05 +02:00
Grant Likely 55b0a39314 Respect memreserve regions specified in the device tree
If a regions is reserved in the fdt, then it should not be used.  Add
the memreserve regions to the lmb so that u-boot doesn't use them to
store the initrd.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
2011-04-25 21:11:21 -04:00
Grant Likely ce6b27a874 Fix off-by-one error in passing initrd end address via device tree
The initrd_end variable contains the address immediately *after* the
initrd blob, not the last address containing data.  This patch fixes
an inadvertent off-by-one when setting up the initrd reserved map.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
2011-04-25 21:11:21 -04:00
Grant Likely ed59e58786 Remove device tree booting dependency on CONFIG_SYS_BOOTMAPSZ
The previous patch makes u-boot use the full accessible size of ram as
the default boot mapped size if CONFIG_SYS_BOOTMAPSZ is not defined,
which means boot_relocate_fdt() can be changed to depend solely on
CONFIG_OF_LIBFDT.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
2011-04-25 21:11:20 -04:00
Grant Likely c3624e6ed0 Default to bootm_size() when CONFIG_SYS_BOOTMAPSZ is not defined
This patch adds a function getenv_bootm_mapsize() for obtaining the
size of the early mapped region accessible by the kernel during early
boot.  It defaults to CONFIG_SYS_BOOTMAPSZ, or if not defined,
defaults to getenv_bootm_size(), which in turn defaults to the size of
RAM.

getenv_bootm_mapsize() can also be overridden with a "bootm_mapsize"
environmental variable.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
2011-04-25 21:11:20 -04:00
Grant Likely 590d3cacb9 Stop passing around bootmem_base value.
For the calls to boot_relocate_fdt(), boot_get_cmdline(), and
boot_get_kbd(), the value of bootmem_base is always obtained by
calling getenv_bootm_low().  Since the value always comes from the
same source, the calling signature for those functions can be
simplified by making them call getenv_bootm_low() directly.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
2011-04-25 21:11:19 -04:00
Loïc Minier 31e413985c Fix typo in #error: IS_IN_NOWHERE vs. IS_NOWHERE
Signed-off-by: Loc Minier <loic.minier@linaro.org>
2011-04-26 00:04:02 +02:00
Wolfgang Denk aef293bc85 Merge branch 'phylib' of git://git.denx.de/u-boot-mmc 2011-04-20 23:01:52 +02:00
Wolfgang Denk 9dd5dad887 Merge branch 'misc' of git://git.denx.de/u-boot-blackfin 2011-04-20 22:57:35 +02:00
Wolfgang Denk d7eb184af8 Merge branch 'master' of git://git.denx.de/u-boot-fdt 2011-04-20 22:53:34 +02:00
Wolfgang Denk 4f27f0ab98 Merge branch 'master' of git://git.denx.de/u-boot-mmc 2011-04-20 22:18:13 +02:00
Andy Fleming 995daa0b81 Add mdio command for new PHY infrastructure
The new mdio command doesn't have all of the features of the mii
command, but it provides the necessary read/write primitives, and allows
users to interact with 10G PHYs, and other PHYs which use Clause 45 of
802.3.  This means that the mdio command requires a "Device Address"
argument, though for clause 22 PHYs, the argument can be "-".

Signed-off-by: Andy Fleming <afleming@freescale.com>
Acked-by: Detlev Zundel <dzu@denx.de>
2011-04-20 15:09:35 -05:00
Andy Fleming 5f184715ec Create PHY Lib for U-Boot
Extends the mii_dev structure to participate in a full-blown MDIO and
PHY driver scheme.  The mii_dev structure and miiphy calls are modified
in such a way to allow the original mii command and miiphy
infrastructure to work as before, but also to support a new set of APIs
which allow (among other things) sharing of PHY driver code and 10G support

The mii command will continue to support normal PHY management functions
(Clause 22 of 802.3), but will not be changed to support 10G
(Clause 45).

The basic design is similar to PHY Lib from Linux, but simplified for
U-Boot's network and driver infrastructure.

We now have MDIO drivers and PHY drivers

An MDIO driver provides:
read
write
reset

A PHY driver provides:
(optionally): probe
config - initial setup, starting of auto-negotiation
startup - waiting for AN, and reading link state
shutdown - any cleanup needed

The ethernet drivers interact with the PHY Lib using these functions:
phy_connect()
phy_config()
phy_startup()
phy_shutdown()

Each PHY driver can be configured separately, or all at once using
config_phylib_all_drivers.h (added in the patch which adds the drivers)

We also provide generic drivers for Clause 22 (10/100/1000), and
Clause 45 (10G) PHYs.

We also implement phy_reset(), and call it in phy_connect(). Because
phy_reset() is essentially the same as miiphy_reset, but:
a) must support 10G PHYs, and
b) should use the phylib primitives,

we implement miiphy_reset, using phy_reset(), but only when
CONFIG_PHYLIB is set. Otherwise, we just use the old version. In this
way, we save on compile size, even if we don't manage to save code size.

Pulled ethtool.h and mdio.h from:
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
782d640afd15af7a1faf01cfe566ca4ac511319d
With many, many deletions so as to enable compilation under u-boot

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Detlev Zundel <dzu@denx.de>
2011-04-20 15:09:19 -05:00
Andy Fleming 16a5323833 miiphy: Fix some formatting issues
Mostly putting a space between function name and "(", and
doing return (foo)

Signed-off-by: Andy Fleming <afleming@freescale.com>
Acked-by: Detlev Zundel <dzu@denx.de>
2011-04-20 13:44:46 -05:00
Kyle Moffett d13ffa66af fdt_support: Fix buffer overflow in fdt_fixup_memory_banks
When fdt_fixup_memory_banks is called with 2-cell address and size
fields in the device-tree (IE: 64-bit address and size), then it will
overflow its on-stack "tmp" buffer.

This fixes the buffer size and adds a comment explaining how many bytes
need to be allocated per record.

Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Cc: Jerry Van Baren <vanbaren@cideas.com>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
2011-04-17 21:08:41 -04:00
Wolfgang Denk f16b608ae7 Merge branch 'sf' of git://git.denx.de/u-boot-blackfin 2011-04-13 22:04:11 +02:00
Mike Frysinger 6801201ee7 gpio: check request result
Make sure the pin request passed before attempting to use it later on.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-13 15:57:00 -04:00
Mike Frysinger a972b8d701 gpio: generalize for all generic gpio providers
The Blackfin gpio command isn't terribly Blackfin-specific.  So generalize
the few pieces into two new optional helpers:
	name_to_gpio() - turn a string name into a GPIO #
	gpio_status() - display current pin bindings (think /proc/gpio)

Once these pieces are pulled out, we can relocate the cmd_gpio.c into the
common directory.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-13 15:56:51 -04:00
Mike Frysinger c3d2a17c1e md5sum/sha1sum/unzip: split out of mondo mem file
There's no real need to keep these functions in the cmd_mem file since
they do not use any of the common global mem variables.  So split them
out into their own dedicated cmd files.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-13 15:56:47 -04:00
Mike Frysinger 710b99385c crc32: make command optional
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-13 15:56:43 -04:00
Mike Frysinger a641b9794b make `go` optional
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-13 15:56:39 -04:00
Mike Frysinger 0c79cda01b env: make import/export optional
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-13 15:56:34 -04:00
Minkyu Kang 940e078297 mmc: show mmc capacity using print_size
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
2011-04-13 06:35:22 -05:00
Thomas Chou d52ebf1022 mmc: add generic mmc spi driver
This patch supports mmc/sd card with spi interface. It is based on
the generic mmc framework. It works with SDHC and supports multi
blocks read/write.

The crc checksum on data packet is enabled with the def,

There is a subcomamnd "mmc_spi" to setup spi bus and cs at run time.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Andy Fleming <afleming@freescale.com>
2011-04-13 06:35:22 -05:00
Graeme Russ fea2572001 x86: Rename i386 to x86
Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
2011-04-13 19:43:28 +10:00
Andreas Bießmann 418e046d89 common/cmd_bdinfo.c: fix do_bdinfo() for AVR32
This patch fixes following warning message:

---8<---
cmd_bdinfo.c:458: warning: initialization from incompatible pointer type
--->8---

There was a prototype change in 54841ab50c for
argv[] pointer type to const. This change was not made for AVR32 cause this
code came in later by a merge.

Signed-off-by: Andreas Biemann <biessmann@corscience.de>
2011-04-12 22:58:32 +02:00
Andreas Bießmann 8c3aff525c cmd_nvedit: use explicit typecast for printf
This patch fixes warnings in MAKEALL for avr32:

---8<---
cmd_nvedit.c: In function 'do_env_export':
cmd_nvedit.c:663: warning: format '%zX' expects type 'size_t', but argument 3 has type 'ssize_t'
--->8---

Signed-off-by: Andreas Biemann <biessmann@corscience.de>
2011-04-12 22:58:32 +02:00
Loïc Minier 6052cbab40 Fix misc spelling errors found by lintian
Signed-off-by: Loc Minier <loic.minier@linaro.org>
2011-04-12 22:58:31 +02:00
Mike Frysinger 8a07de03f0 cmd_sf: use cmd_usage() in more places
Requires a little reworking of the code flow with sub-functions, but
not a big deal.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-12 02:30:25 -04:00
Mike Frysinger 840ff99889 cmd_sf: drop device status message when probing
The common spi flash layer displays useful info when probing, so no
need for us to duplicate that.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-12 02:30:25 -04:00
Richard Retanubun 334eb4b02f cmd_sf: add handler for +len arg for erase command
This patch adds [+]len handler for the erase command that will
automatically round up the requested erase length to the flash's
sector_size.

Signed-off-by: Richard Retanubun <RichardRetanubun@RuggedCom.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-12 02:30:25 -04:00
Lei Wen 02cf345973 bootm: replace blob_start with image_start
For uImage always has a 64 bytes header, we couldn't expect to do
the xip from the header but should xip from the image start.

The latter logic in that section is also move the image from image_start
to the load address, so sync this logic to the xip operation.

Signed-off-by: Lei Wen <leiwen@marvell.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-04-11 21:10:44 +02:00
Mike Frysinger 1ba7fd2567 Blackfin: ldrinfo: new command
Simple command to decode/check an LDR image before we try to boot it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-08 00:44:27 -04:00
Mike Frysinger 31488a6f6e Blackfin: bootldr: use common defines
Now that the common bootrom.h sets up defines for us, switch to them
rather than our own local set.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-08 00:44:27 -04:00
Wolfgang Denk 4db2fa7f94 Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
Conflicts:
	drivers/usb/host/ehci-pci.c

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-04-05 12:24:20 +02:00
Mingkai Hu 97039ab98c env_mmc: Allow board code to override the environment address
On some boards the environment may not be located at a fixed address in
the MMC/SDHC card.  This allows those boards to implement their own
means to report what address the environment is located at.

Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com>
Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
Signed-off-by: Zhao Chenhui <b35336@freescale.com>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2011-04-04 22:26:16 -05:00
Kyle Moffett c7fd27ccfb mpc8xxx: DDR2/DDR3: Clean up DIMM-type switch statements
The numeric constants in the switch statements are replaced by #defines
added to the common ddr_spd.h header.  This dramatically improves the
readability of the switch statments.

In addition, a few of the longer lines were cleaned up, and the DDR2
type for an SO-RDIMM module was added to the DDR2 switch statement.

Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Cc: Andy Fleming <afleming@gmail.com>
Cc: Kim Phillips <kim.phillips@freescale.com>
Acked-by: York Sun <yorksun@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2011-04-04 09:24:43 -05:00
Erik Hansen 56887e27ae Remove unnecessary reset in usb_stor_get_info
The reset request in usb_stor_get_info is causing issues with some usb
sticks. Some of these sticks vendor_id/product_id have been hardcoded to
not reset but better is to remove the reset altogether. It is not needed.

Signed-off-by: Erik Hansen <erik@makarta.com>
2011-04-02 09:38:24 +02:00
Stefan Roese 7f5d8a4d8e UBI: Fix error code handling in ubi commands
Some ubi commands returned negative error codes, resulting in
the following error message on the prompt:

"exit not allowed from main input shell."

Negative error codes are not allowed.

This patch now changes the UBI code to return positive error codes.
Additionally "better" error codes are used, for example "ENOMEM" when
no memory is available for the UBI volume creation any more.

Also the output of some commands is enhanced:

Before:

=> ubi read 100000 testvol 100000
Volume testvol found at volume id 0
read 1048576 bytes from volume 0 to 100000(buf address)
=> ubi write 100000 testvol 1000
Volume testvol found at volume id 0

After:

=> ubi read 100000 testvol 100000
Read 1048576 bytes from volume testvol to 00100000
=> ubi write 100000 testvol 1000
4096 bytes written to volume testvol

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
2011-03-21 10:02:16 +01:00
Tom Warren 2ee3678159 serial: Add Tegra2 serial port support
Signed-off-by: Tom Warren <twarren@nvidia.com>
2011-02-21 08:30:55 +01:00
Remy Bohmer 3a26c43e42 Fix build warnings in cmd_flash.c
These variables are only used in case CONFIG_SYS_NO_FLASH is NOT set:
struct mtd_device *dev;
struct part_info *part;
u8 dev_type, dev_num, pnum;

Signed-off-by: Remy Bohmer <linux@bohmer.net>
2011-02-19 20:32:38 +01:00
Simon Glass 89d48367ed Add USB host ethernet adapter support
This adds support for using USB Ethernet dongles in host mode. This is just
the framework - drivers will come later. A new config option called
CONFIG_USB_HOST_ETHER can be defined in board config files to switch this
on.

The was originally written by NVIDIA and was cleaned up for release by the
Chromium authors.

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-02-19 20:32:36 +01:00
Wolfgang Denk 67fb0622a9 unzip: return uncompressed size in `filesize', and print it.
The unzip command did not provide a way for the caller to get any
information about the uncompressed size.  To make it better usable in
scripts, we now store the uncompressed size in the `filesize'
variable, like we do when for example loading a file over the network
or when reading it from a file system.  Following that analogy, it is
only consequent to also print the size.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-02-15 21:46:39 +01:00
Wolfgang Denk cc22b795fb itest: fix result of string compares
The implementation of the string compare function of the "itest"
command was weird, as only the length of the shortest argument was
included in the compare, with the result that something like
"itest.s abd == abddef" would return TRUE.  Fix this.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>
2011-02-15 21:45:55 +01:00