Commit Graph

1706 Commits

Author SHA1 Message Date
Mike Frysinger
7b826c2f35 serial: implement common uart post test
The current arch/driver specific UART posts basically boil down to setting
the UART to loop back mode, then reading and writing data.  If we ignore
the loop back part, the rest can be built upon the existing common serial
API.  So let's do just that.

First add a call back for serial drivers to implement loop back control.
Then write a post test that walks all of the serial drivers, puts them
into loop back mode, and verifies that reading/writing at all the diff
baud rates is OK.

If a serial driver doesn't support loop back mode (either it can't or
it hasn't done so yet), then skip it.  This should allow for people to
easily migrate to the new post test with existing serial drivers.

I haven't touched the few already existing uart post tests as I don't
the hardware or knowledge of converting them over.  So I've marked the
new test as weak which will allow the existing tests to override the
default until they are converted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:39:03 +02:00
Mike Frysinger
c52b4f7945 serial: drop serial_register return value
The serial_register function never fails (always return 0), so change it
to a void function to avoid wasting overhead on it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:38:01 +02:00
Mike Frysinger
6c768ca746 serial: push default_serial_console to drivers
Rather than sticking arch/board/driver specific logic in the common
serial code, push it all out to the respective drivers.  The serial
drivers declare these funcs weak so that boards can still override
things with their own definition.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Heiko Schocher <hs@denx.de>
CC: Anatolij Gustschin <agust@denx.de>
CC: Tom Rix <Tom.Rix@windriver.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
CC: Craig Nauman <cnauman@diagraph.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Mahavir Jain <mjain@marvell.com>
Tested-by: Minkyu Kang <mk7.kang@samsung.com>
2011-07-26 16:37:57 +02:00
Mike Frysinger
e84ffddbce cmd_usage: constify
The usage helper doesn't modify the command, so constify its input arg.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:34:41 +02:00
Mike Frysinger
147c7169e8 constify default env
I can't see any obvious needs for the default environment to be writable,
so make it const.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:34:22 +02:00
Mike Frysinger
c3eb3fe490 env: allow people to force envcrc building
For people who want to manually extract the embedded environment so that
it can be manually packed into the final u-boot image, add a config opt
to force building of the envcrc tool.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:33:49 +02:00
Aneesh V
05bad4aa56 scaled down version of generic libraries for SPL
Signed-off-by: Aneesh V <aneesh@ti.com>
2011-07-26 14:44:25 +02:00
Jens Scharsig
a16a84b725 Fix: watchdog timed out, if using md5 command
* Fix: if using md5 command watchdog timed out
* change function call md5(..) to the watchdog-safe variant
  md5_wd(..) to support watchdog reset

Signed-off-by: Jens Scharsig <esw@bus-elektronik.de>
2011-07-26 14:36:07 +02:00
Jens Scharsig
3e499b6ab0 Fix: watchdog timed out, if using sha1 command
* Fix: if using sha1 command watchdog timed out
* change function call sha1_csum(..) to the watchdog-safe variant
  sha1_csum_wd(..) to support watchdog reset

Signed-off-by: Jens Scharsig <esw@bus-elektronik.de>
2011-07-26 14:33:10 +02:00
Matthew McClintock
d0c4c33850 command/cmd_cache.c: Add optional flush arguments
It might be desirable to have the ability to flush icache/dcache
within u-boot, this patch gives each arch the ability to provide
a flush_dcache/flush_icache function to let u-boot flush caches
from the prompt

Signed-off-by: Matthew McClintock <msm@freescale.com>
2011-07-26 14:30:08 +02:00
Matthew McClintock
0e0996ef4f common/cmd_ximg.c: add ifdef protection for gzip uncompression
Print a message if we do not have the ability to uncompress a gzip
image. Before, u-boot would just assume the routines were available

Signed-off-by: Matthew McClintock <msm@freescale.com>
2011-07-26 14:11:21 +02:00
Matthew McClintock
df3fc52608 disk/part.c: Make features optional
If we don't want to build support for any partition types we can now
add #undef CONFIG_PARTITIONS in a board config file to keep this from
being compiled in. Otherwise boards assume this is compiled in by
default

Signed-off-by: Matthew McClintock <msm@freescale.com>
2011-07-26 14:10:14 +02:00
Laurence Withers
07c07635b4 miiphy: use strncpy() not sprintf()
In miiphy_register() the new device's name was initialised by passing a
string parameter as the format string to sprintf(). As this would cause
problems if it ever contained a '%' symbol, switch to using strncpy()
instead.

Signed-off-by: Laurence Withers <lwithers@guralp.com>
Cc: Andy Fleming <afleming@freescale.com>
2011-07-26 14:00:24 +02:00
Jens Scharsig
39c6e039a0 Fix: if using crc32 command watchdog timed out
* Fix: if using crc32 command watchdog timed out
* change function call crc32(..) to the watchdog-safe variant
  crc_32_wd(..) to support watchdog reset

Signed-off-by: Jens Scharsig <esw@bus-elektronik.de>
2011-07-26 00:40:50 +02:00
Rob Herring
942e31437d scsi/ahci: add support for non-PCI controllers
Add support for AHCI controllers that are not PCI based.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Wolfgang Denk <wd@denx.de>
2011-07-26 00:06:58 +02:00
Jason Hobbs
370d1e3e58 cosmetic, main: correct indentation/spacing issues
Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
2011-07-25 23:28:05 +02:00
Jason Hobbs
3c766dccb3 cosmetic, main: clean up declarations of abortboot
Remove an unneeded prototype declaration from the top of main.c,
and use plain inline instead of __inline__ to please checkpatch.

Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
2011-07-25 23:27:43 +02:00
Mike Frysinger
67d668bf92 autostart: unify duplicated logic into the bootm code
Rather than having a bunch of random commands handle autostart behavior,
unify the logic in a single place.  This also fixes building of these

different commands when bootm is disabled.

Acked-by: Matthew McClintock <msm@freescale.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-25 22:18:26 +02:00
Wolfgang Denk
74fac70084 Merge branch 'master' of git://git.denx.de/u-boot-mmc
* 'master' of git://git.denx.de/u-boot-mmc:
  mmc: rescan fails on empty slot
  AT91:mmc:fix multiple read/write error
  mmc: Access mode validation for eMMC cards > 2 GiB
  mmc: sh_mmcif: add support for Renesas MMCIF
  mmc: fix the condition for MMC version 4
  MMC: add marvell sdhci driver
  MMC: add sdhci generic framework
  MMC: add erase function to both mmc and sd
  MMC: unify mmc read and write operation
  mmc: Tegra2: Enable SD/MMC driver for Seaboard and Harmony
  mmc: Tegra2: SD/MMC driver for Seaboard - eMMC on SDMMC4, SDIO on SDMMC3
2011-07-19 22:27:07 +02:00
Matthew McClintock
1bb5e9071f Fix typo from 'mb_alloc' -> 'lmb_alloc'
Signed-off-by: Matthew McClintock <msm@freescale.com>
2011-07-19 10:38:33 +02:00
Wolfgang Denk
cdf1a2328a Merge branch 'master' of git://git.denx.de/u-boot-arm
* 'master' of git://git.denx.de/u-boot-arm:
  ARM: MX5: Fix broken leftover TO-2 errata workaround
  MX31: Cleanup clock function
  scb9328: Add ARM relocation support
  am3517evm: change console device from ttyS2 to ttyO2
  Remove volatile qualifier in get_ram_size() calls
  TI: TNETV107X Fix Build Error
  ARM: add missing CONFIG_SKIP_LOWLEVEL_INIT for armv7
  arm: add CONFIG_MACH_TYPE setting and documentation
  arm: add __ilog2 function
  Timer: Fix misuse of ARM *timer_masked() functions outside arch/arm
  EfikaMX: Enable EXT2 booting
  EfikaMX: Add missing CONFIG_SYS_TEXT_BASE
  EfikaMX: Use correct imximage.cfg
  MX27: Update to autogenerated asm-offsets.h
  MX5: Update to autogenerated asm-offsets.h
  imx: Add support for zmx25 board
  imx: Make imx25 compatible to mxc_gpio driver and fix in tx25
  imx: Add auto generation of asm-offsets.h for imx25
  imx: Add support for USB EHCI on imx25
  imx: Use correct imx25 reset.c
  imx: Add get_tbclk() function for imx25
  ARM: Update maintainer of board scb9328
  mx27: Make the UART port number explicit
  build: Add targets for auto gen of asm-offsets.h and use it in imx35
  mx31pdk: cosmetic: Fix line over 80 characters
2011-07-18 21:04:56 +02:00
Albert ARIBAUD
a55d23ccf6 Remove volatile qualifier in get_ram_size() calls
Checkpatch.pl complains about the volatile qualifier in calls to
get_ram_size(). Remove this qualifier in the prototype and in the
calls where it is useless, and leave it only in the function body
where it is needed.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
2011-07-17 17:11:53 +02:00
David A. Long
a28afca57d Add uboot "fdt_high" enviroment variable
Add a new "fdt_high" enviroment variable. This can be used to control (or prevent) the
relocation of the flattened device tree on boot. It can be used to prevent relocation
of the fdt into highmem.  The variable behaves similarly to the existing "initrd_high"
variable.

Signed-off-by: David A. Long <dave.long@linaro.org>
2011-07-16 11:58:30 -04:00
Michael Jones
8fd01b8f6b mmc: rescan fails on empty slot
Fail in 'mmc rescan' if mmc_init() returns error

Signed-off-by: Michael Jones <michael.jones@matrix-vision.de>
Acked-by: Andy Fleming <afleming@freescale.com>
2011-07-15 20:29:22 -05:00
Lei Wen
e6f99a5611 MMC: add erase function to both mmc and sd
Erase is a very basic function since the begin of sd specification is
announced. Although we could write a bulk of full 0xff memory to the
range to take place of erase, it is more convenient and safe to
implement the erase function itself.

Signed-off-by: Lei Wen <leiwen@marvell.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-07-15 20:29:17 -05:00
Lei Wen
6be95ccf9f MMC: unify mmc read and write operation
mmc read and write command has so many in common, unfiy those two to
force consistency across the those two.

Signed-off-by: Lei Wen <leiwen@marvell.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Andy Fleming <afleming@freescale.com>
2011-07-15 20:29:00 -05:00
Gerald Van Baren
a8d2a75d72 fdt: introduce fdt_create_phandle()
The ePAPR specification says that phandle properties should be called
"phandle", and not "linux,phandle".  To facilitate the migration from
"linux,phandle" to "phandle", introduce function fdt_create_phandle(),
which creates a phandle in a given node.  For now, we create both the
"phandle" and "linux,phandle" properties.  A later version of this
function will remove support for "linux,phandle".

Signed-off-by: Timur Tabi <timur@freescale.com>
2011-07-14 21:43:45 -04:00
Timur Tabi
bb682001f1 fdt: introduce fdt_verify_alias_address() and fdt_get_base_address()
Introduce two functions, fdt_verify_alias_address() and
fdt_get_base_address(), which can be used to verify the physical address
of a device in a device tree.

fdt_get_base_address() returns the base address of an SOC or PCI node.

fdt_verify_alias_address() prints a message if the address of a node
specified by an alias does not match the given physical address.

Signed-off-by: Timur Tabi <timur@freescale.com>
2011-07-14 21:43:36 -04:00
Aneesh V
e47f2db537 armv7: rename cache related CONFIG flags
Replace the cache related CONFIG flags with more meaningful
names. Following are the changes:

CONFIG_L2_OFF	     -> CONFIG_SYS_L2CACHE_OFF
CONFIG_SYS_NO_ICACHE -> CONFIG_SYS_ICACHE_OFF
CONFIG_SYS_NO_DCACHE -> CONFIG_SYS_DCACHE_OFF

Signed-off-by: Aneesh V <aneesh@ti.com>
V2:
 * Changed CONFIG_L2_OFF -> CONFIG_SYS_NO_L2CACHE
V4:
 * Changed all three flags to the final names suggested as above
   and accordingly changed the commit message
2011-07-04 10:55:25 +02:00
Ben Gardiner
c9494866df cmd_nand: add nand write.trimffs command
Add another nand write. variant, trimffs. This command will request of
nand_write_skip_bad() that all trailing all-0xff pages will be
dropped from eraseblocks when they are written to flash as-per the
reccommended behaviour of the UBI FAQ [1].

The function that implements this timming is the drop_ffs() function
by Artem Bityutskiy, ported from the mtd-utils tree.

[1] http://www.linux-mtd.infradead.org/doc/ubi.html#L_flasher_algo

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
CC: Artem Bityutskiy <dedekind1@gmail.com>
CC: Detlev Zundel <dzu@denx.de>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2011-07-01 15:56:51 -05:00
Ben Gardiner
a6c9aa1f92 nand_util: convert nand_write_skip_bad() to flags
In a future commit the behaviour of nand_write_skip_bad()
will be further extended.

Convert the only flag currently passed to the nand_write_
skip_bad() function to a bitfield of only one allocated
member. This should avoid an explosion of int's at the
end of the parameter list or the ambiguous calls like

nand_write_skip_bad(info, offset, len, buf, 0, 1, 1);
nand_write_skip_bad(info, offset, len, buf, 0, 1, 0);

Instead there will be:

nand_write_skip_bad(info, offset, len, buf, WITH_YAFFS_OOB |
			WITH_OTHER);

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Acked-by: Detlev Zundel <dzu@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2011-07-01 15:56:51 -05:00
Wolfgang Denk
566e5cf451 ARM: drop unsupported 'trab' board
The 'trab' board configuration is broken, and there is nobody who is
interested and willing to fix it.  Drop it.

This includes support for VFD displays which have always been used by
this board only.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-06-22 20:00:51 +02:00
Haojian Zhuang
b79003627d common/cmd_fdt.c: fix wrong data displayed in fdt print
All data in dtb is big endian. Some ARM devices are little-endian.
In print_data(), it displays data with big-endian format. For ARM device,
data should be converted to little-endian first.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: Gerald Van Baren <vanbaren@cideas.com>
2011-06-01 22:44:50 +02:00
Luuk Paulussen
d6840e3d7a sntp: avoid use of uninitialized variable
When we use the ntpserverip environment variable argv[1] may not be set.
Printing the error message using the NetNtpServerIP variable ensures the
correct output in both cases.

Signed-off-by: Luuk Paulussen <luuk.paulussen@alliedtelesis.co.nz>
Acked-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Cc: Ben Warren <biggerbadderben@gmail.com>
Acked-by: Detlev Zundel <dzu@denx.de>
2011-06-01 22:35:09 +02:00
Daniel Hobi
eb3abce898 cmd_nand: fix help of nand erase subcommand
Since commit 30486322 (nand erase: .spread, .part, .chip subcommands)
the arguments off and size are no longer optional.

Signed-off-by: Daniel Hobi <daniel.hobi@schmid-telecom.ch>
Cc: Scott Wood <scottwood@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2011-05-24 16:08:44 -05:00
Daniel Hobi
3b250ffb41 env_nand: zero-initialize variable nand_erase_options
Commit 30486322 (nand erase: .spread, .part, .chip subcommands)
added a new field to struct nand_erase_options, but forgot to
update common/env_nand.c.

Depending on the stack state and bad block distribution, saveenv()
can thus erase more than CONFIG_ENV_RANGE bytes which may corrupt
the following NAND sectors/partitions.

Signed-off-by: Daniel Hobi <daniel.hobi@schmid-telecom.ch>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2011-05-24 16:08:44 -05:00
Wolfgang Denk
cd6881b519 Minor coding style cleanup.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-05-19 22:22:44 +02:00
Luca Ceresoli
7a83af07ae TFTP: add tftpsrv command
Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: Detlev Zundel <dzu@denx.de>
2011-05-19 21:38:32 +02:00
Lei Wen
bc897b1d4d mmc: enable partition switch function for emmc
For emmc, it may have up to 7 partitions: two boot partitions, one
user partition, one RPMB partition and four general purpose partitions.
(Refer to JESD84-A44.pdf/page 154)

As bootloader may need to read out or reflashing images on those

different partitions, it is better to enable the partition switch with
console command support.

Also for partition would be restore to user partition(part 0) when CMD0
is used, so change mmc_init routine to perform normal initialization
only once for each slot, unless use the rescan command to force init
again.

Signed-off-by: Lei Wen <leiwen@marvell.com>
Acked-by: Andy Fleming <afleming@freescale.com>
2011-05-18 14:37:03 -05:00
Lei Wen
ea6ebe2177 cmd_mmc: eliminate device num in the mmc command
mmc command applied device, like ide and usb...

Signed-off-by: Lei Wen <leiwen@marvell.com>
Acked-by: Andy Fleming <afleming@freescale.com>
2011-05-18 14:36:35 -05:00
Macpaul Lin
5902e8f711 cosmetic: cmd_bdinfo.c: clean up by using checkpatch.pl
cmd_bdinfo.c: clean up with 2.6.38 checkpatch.pl

Signed-off-by: Macpaul Lin <macpaul@andestech.com>
Acked-by: Detlev Zundel <dzu@denx.de>
2011-05-12 23:31:07 +02:00
Wolfgang Denk
a02a884b95 cmd_nvedit.c: make error message more helpful
When calling getenv_f() with a too small buffer, it would print an
error message like this:

	env_buf too small [32]

This is not really helpful as it does not give any indication which of
the calls might have failed.  Change this into:

	env_buf [32 bytes] too small for value of "hwconfig"

so we know at least which variable caused the overflow; this usually
allows to quickly find the related code as well.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-05-12 19:47:14 +02:00
Holger Brunck
eae3b0644c common/hush: make get_local_var visible for other users
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
2011-05-10 23:19:07 +02:00
Heiko Schocher
62a813bcac cramfs: make cramfs usable without a NOR flash
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
2011-05-10 22:47:32 +02:00
Heiko Schocher
ee8bc961a4 cramfs: fix bug in using CONFIG_CRAMFS_CMDLINE
do not define own flash_info variable, instead use
the flash_info variable defined in your flash driver.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
2011-05-10 22:46:56 +02:00
Wolfgang Denk
96d04c3150 IDE: fix compiler warnings
The changes introduced by commit 0abddf8 ``cmd_ide: enhance new
feature "CONFIG_IDE_AHB"'' caused compiler warnings like

cmd_ide.c: In function 'ide_init':
cmd_ide.c:716: warning: assignment from incompatible pointer type

Constify the respective function arguments to fix this.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-04-30 23:29:55 +02:00
Anatolij Gustschin
a621b167ba common/cmd_mdio.c: fix compile warning
cmd_mdio.c: In function 'mdio_read_ranges':
cmd_mdio.c:97: warning: comparison is always false due to limited range of data type

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Andy Fleming <afleming@freescale.com>
2011-04-30 23:09:48 +02:00
Anatolij Gustschin
d67d5d529a miiphy: miiphyutil.c: fix compile warning
Fix warning introduced while recent PHY Lib changes:

miiphyutil.c: In function 'miiphy_read':
miiphyutil.c:304: warning: comparison is always false due to limited range of data type

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Andy Fleming <afleming@freescale.com>
2011-04-30 23:09:25 +02:00
Macpaul Lin
f3c615b8ab cmd_nvedit.c: clean up with checkpatch
Code clean up of cmd_nvedit.c by using checkpatch.pl.

Signed-off-by: Macpaul Lin <macpaul@andestech.com>
Acked-by: Detlev Zundel <dzu@denx.de>
2011-04-30 22:27:19 +02:00
Macpaul Lin
0abddf82d5 cmd_ide: enhance new feature "CONFIG_IDE_AHB"
Although most IDE controller is designed to be connected to PCI bridge,
there are still some IDE controller support AHB interface for SoC design.

The driver implementation of these IDE-AHB controllers differ from other
IDE-PCI controller, some additional registers and commands access is required
during CMD/DATA I/O. Hence a configuration "CONFIG_IDE_AHB" in cmd_ide.c is
required to be defined to support these kinds of SoC controllers. Such as
Faraday's FTIDE020 series and Global Unichip's UINF-0301.

Signed-off-by: Macpaul Lin <macpaul@andestech.com>
2011-04-30 21:04:25 +02:00