Commit Graph

2367 Commits

Author SHA1 Message Date
Daniel Schwierzeck
59af76d9cc bootm: fix conditional compilation for bootm ramdisk subcommand
All code related to the bootm ramdisk subcommand is conditionally
enabled by CONFIG_SYS_BOOT_RAMDISK_HIGH except for the help message.
Replace the CONFIG_ARCH defines by CONFIG_SYS_BOOT_RAMDISK_HIGH
to fix this.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2013-03-04 14:19:56 -05:00
Joe Hershberger
18a3cce9fa env: Avoid clobbering an edited variable on ctrl-c
If readline says there was an error, don't write to the variable!

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2013-03-04 14:19:56 -05:00
Simon Glass
d304931f23 sandbox: Add 'sb' command to access filesystem features
The new 'sb' command is intended to deal with sandbox-specific features
that have no parallel in other archs. This commit adds two sub-commands
to list a directory and read a file from the host filesystem.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
2013-03-04 14:19:56 -05:00
Tom Rini
1c9f47ab2a Merge branch 'mem' of git://git.denx.de/u-boot-x86 2013-03-04 11:14:27 -05:00
Tom Rini
c259188b20 Merge branch 'master' of git://git.denx.de/u-boot-blackfin 2013-03-04 09:44:42 -05:00
Sonic Zhang
a2979dcdbe blackfin: bf60x: Port blackfin core architecture code to boot on bf60x.
Set up clocks, DDR controller, Nor flash controller, reboot,
serial port. Add new SPI boot modes.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Sonic Zhang <sonic.adi@gmail.com>
2013-03-04 13:42:06 +08:00
Stefano Babic
28786eb960 SPL: Change description for spl command
Add a more descriptive text to the help of the spl
command.

Signed-off-by: Stefano Babic <sbabic@denx.de>
Reviewed-by: Tom Rini <trini@ti.com>
2013-03-01 12:01:32 -05:00
Simon Glass
218da0f35f hash: Use lower case for hash algorithm names
Rather than use strcasecmp() in the hash algorithm search, require the
caller to do this first. Most of U-Boot can use lower case anyway, and
the hash command can convert to lower case before calling hash_command().
This saves needing strcasecmp() for boards that use hashing but not
the hash command.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-28 19:49:13 -08:00
Simon Glass
bd091b67d0 sandbox: Allow hash functions to work correctly
Use map_sysmem() so that hashing is possible on sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-28 19:49:13 -08:00
Simon Glass
5512d5b034 sandbox: Update mtest to fix crashes
Use map_sysmem() in the memory tester so that it works as expected on
sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-28 19:49:11 -08:00
Simon Glass
8e169cc943 Move CONFIG_SYS_MEMTEST_SCRATCH #ifdef to top of file
This config effectively has a default value of 0, so add this setting
at the top of the code to remove an #ifdef in the C function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-28 19:09:24 -08:00
Simon Glass
d20a40de9d Roll crc32 into hash infrastructure
Add the CRC32 algorithm to the list of available hashes, and make
the crc32 command use hash_command(). Add a new crc32_wd_buf() to
make this possible, which puts its result in a buffer rather than
returning it as a 32-bit value.

Note: For some boards the hash command is not enabled, neither
are sha1, sha256 or the verify option. In this case the full
hash implementation adds about 500 bytes of overhead. So as a
special case, we use #ifdef to select very simple bahaviour in
that case. The justification for this is that it is currently
a very common case (virtually all boards enable crc32 but only
some enable more advanced features).

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-28 19:09:23 -08:00
Simon Glass
d5b76673a5 hash: Add a flag to support saving hashes in the environment
Some hashing commands permit saving the hash in an environment variable,
and verifying a hash from there. But the crc32 command does not support
this. In order to permit crc32 to use the generic hashing infrastructure,
add a flag to select which behaviour to use.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-28 19:09:23 -08:00
Simon Glass
0ccff500cf image: Use crc header file instead of C prototypes
We have an existing header which the crc32 definitions, so use it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-28 19:09:23 -08:00
Simon Glass
41ef372c1a common: Use new numeric setenv functions
Use setenv_ulong(), setenv_hex() and setenv_addr() in common/

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-28 19:09:23 -08:00
Simon Glass
bfc5996643 Update set_working_fdt_addr() to use setenv_addr()
We might as well use this common function instead of repeating the same
code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-28 19:09:23 -08:00
Simon Glass
8c86bbe00f Reduce casting in mtest
Use a ulong for the command arguments, and only cast to an address when
needed. This fixes warnings in sandbox where pointers are typically 64 bits
long.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-28 19:09:22 -08:00
Simon Glass
c44d4386e6 Bring mtest putc() into common code
If we get a Ctrl-C abort, we always print a newline. Move this repeated
code out of the functions and into a single place in the caller.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-28 19:09:22 -08:00
Simon Glass
7ecbd4d708 Fix mtest indenting
Some of the inner loops are not indented correctly. Fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-28 19:09:22 -08:00
Simon Glass
51209b1f42 Use common mtest iteration counting
The iteration code is the same for each version of the memory test, so
pull it out into the common function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-28 19:09:22 -08:00
Simon Glass
c9638f50fb Split out the memory tests into separate functions
Half of the code is currently hidden behind an #ifdef. Move the two
memory tests into their own functions and use the compiler to eliminate
the unused code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-28 19:09:22 -08:00
Simon Glass
0628ab8ec5 sandbox: Change memory commands to use map_physmem
Sandbox wants to support commands which use memory. The map_sysmen()
call provides this feature, so use this in the memory commands.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-28 19:09:22 -08:00
Simon Glass
6b3ff98da4 Tidy up error checking and fix bug in hash command
There are two problems:

1. The argument count needs to be checked before argv is used
2. When verify is not enabled, we need to define a constant zero value

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-28 19:09:21 -08:00
Phil Sutter
a1eac57a20 common/env_nand.c: calculate crc only when readenv was OK
Calculating the checksum of incompletely read data is useless.

Signed-off-by: Phil Sutter <phil.sutter@viprinet.com>
[scottwood@freescale.com: minor formatting fix]
Signed-off-by: Scott Wood <scottwood@freescale.com>
2013-02-22 19:59:53 -06:00
Phil Sutter
b76a147b72 env_nand.c: clarify log messages when env reading fails
The single message is misleading, since there is no equivalent success
note when reading the other copy succeeds. Instead, warn if one of the
redundant copies could not be loaded and emphasise on the error when
reading both fails.

Signed-off-by: Phil Sutter <phil.sutter@viprinet.com>
2013-02-22 19:34:53 -06:00
Harvey Chapman
ced199dc85 nand: fix nand read.option parsing
"nand read.part addr off size" would be treated as "nand read.raw addr off 1"
It now fails as intended stating "Unknown nand command suffix '.part'"

Signed-off-by: Harvey Chapman <hchapman@3gfp.com>
2013-02-22 18:49:04 -06:00
Vipin Kumar
8fdf1e0f6d imls: Add support to list images in NAND device
This patch adds support to list images in NAND flash through imls

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
2013-02-22 16:53:04 -06:00
Piotr Wilczek
3e34cf7bff gpt: fix partion size limit
Currently, in gpt command, partion size is converted from string
to unsigned long type using 'ustrtol' function. That type limits
the partition size to 4GB.

This patch changes the conversion function to 'ustrtoll' to return
unsigned long long type.

Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2013-02-20 08:52:41 -05:00
Holger Hans Peter Freyther
4f47aceb11 led: The gpio_led.c code expects that LED state is from the enum
u-boot is not consistent if state should be 0|1 or of the enum, the
GPIO driver expects this to be one of the enum values. Update the
caller.

Signed-off-by: Holger Hans Peter Freyther <holger@freyther.de>
2013-02-20 08:52:41 -05:00
Reinhard Arlt
1b3e0b191a cmd_elf: Fix broken bootvx command
Fix broken bootvx command.

Signed-off-by: Reinhard Arlt <reinhard.arlt@esd.eu>
2013-02-20 08:52:29 -05:00
Robert P. J. Day
70d7cb9252 cmd_load.c: Add #endif comments to reduce confusion
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
2013-02-19 17:01:26 -05:00
Robert P. J. Day
85de63e2e6 cmd_mem.c: Fix some typoes, no functional changes
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
2013-02-19 17:01:26 -05:00
Gabor Juhos
7b395232da malloc: make malloc_bin_reloc static
On architectures where manual relocation
is needed, the 'malloc_bin_reloc' function
must be called after 'mem_malloc_init'.

Make the 'malloc_bin_reloc' function static
and call it directly from 'mem_malloc_init'
instead of calling that from board_init_{r,f}
functions of the affected architectures.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Andreas Bießmann <andreas.devel@gmail.com>
Cc: Jason Jin <Jason.jin@freescale.com>
Cc: Macpaul Lin <macpaul@andestech.com>
Cc: Daniel Hellstrom <daniel@gaisler.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
2013-02-19 17:01:26 -05:00
Kim Phillips
8aa5ec6e16 common/fdt_support.c: sparse fixes
trivial:

fdt_support.c:89:64: warning: Using plain integer as NULL pointer
fdt_support.c:325:65: warning: Using plain integer as NULL pointer
fdt_support.c:352:65: warning: Using plain integer as NULL pointer

For the following bad constant expression, We hardcode the max. number of
memory banks to four for the foreseeable future, and add an error with
instructions on what to do once it's exceeded:

fdt_support.c:397:22: error: bad constant expression

For the rest below, sparse found a couple of wrong endian conversions
in of_bus_default_translate() and fdt_get_base_address(), but
otherwise the rest is mostly annotation fixes:

fdt_support.c:64:24: warning: cast to restricted __be32
fdt_support.c:192:21: warning: incorrect type in assignment (different base types)
fdt_support.c:192:21:    expected unsigned int [unsigned] [usertype] tmp
fdt_support.c:192:21:    got restricted __be32 [usertype] <noident>
fdt_support.c:201:21: warning: incorrect type in assignment (different base types)
fdt_support.c:201:21:    expected unsigned int [unsigned] [addressable] [usertype] tmp
fdt_support.c:201:21:    got restricted __be32 [usertype] <noident>
fdt_support.c:304:13: warning: incorrect type in assignment (different base types)
fdt_support.c:304:13:    expected unsigned int [unsigned] [usertype] val
fdt_support.c:304:13:    got restricted __be32 [usertype] <noident>
fdt_support.c:333:13: warning: incorrect type in assignment (different base types)
fdt_support.c:333:13:    expected unsigned int [unsigned] [usertype] val
fdt_support.c:333:13:    got restricted __be32 [usertype] <noident>
fdt_support.c:359:13: warning: incorrect type in assignment (different base types)
fdt_support.c:359:13:    expected unsigned int [unsigned] [usertype] val
fdt_support.c:359:13:    got restricted __be32 [usertype] <noident>
fdt_support.c:373:21: warning: cast to restricted __be32
fdt_support.c:963:48: warning: incorrect type in argument 1 (different base types)
fdt_support.c:963:48:    expected restricted __be32 const [usertype] *p
fdt_support.c:963:48:    got unsigned int [usertype] *<noident>
fdt_support.c:971:48: warning: incorrect type in argument 1 (different base types)
fdt_support.c:971:48:    expected restricted __be32 const [usertype] *p
fdt_support.c:971:48:    got unsigned int [usertype] *<noident>
fdt_support.c:984:29: warning: incorrect type in argument 1 (different base types)
fdt_support.c:984:29:    expected restricted __be32 const [usertype] *cell
fdt_support.c:984:29:    got unsigned int [usertype] *addr
fdt_support.c:996:32: warning: incorrect type in argument 1 (different base types)
fdt_support.c:996:32:    expected restricted __be32 const [usertype] *cell
fdt_support.c:996:32:    got unsigned int [usertype] *addr
fdt_support.c:1041:41: warning: incorrect type in argument 1 (different base types)
fdt_support.c:1041:41:    expected restricted __be32 const [usertype] *cell
fdt_support.c:1041:41:    got unsigned int [usertype] *addr
fdt_support.c:1053:41: warning: incorrect type in argument 2 (different base types)
fdt_support.c:1053:41:    expected restricted __be32 const [usertype] *range
fdt_support.c:1053:41:    got unsigned int const [usertype] *[assigned] ranges
fdt_support.c:1064:53: warning: incorrect type in argument 2 (different base types)
fdt_support.c:1064:53:    expected restricted __be32 const [usertype] *addr
fdt_support.c:1064:53:    got unsigned int [usertype] *addr
fdt_support.c:1110:50: warning: incorrect type in argument 2 (different base types)
fdt_support.c:1110:50:    expected restricted __be32 const [usertype] *addr
fdt_support.c:1110:50:    got unsigned int *<noident>
fdt_support.c:1121:49: warning: incorrect type in argument 1 (different base types)
fdt_support.c:1121:49:    expected restricted __be32 const [usertype] *cell
fdt_support.c:1121:49:    got unsigned int *<noident>
fdt_support.c:1147:60: warning: incorrect type in argument 2 (different base types)
fdt_support.c:1147:60:    expected restricted __be32 const [usertype] *addr
fdt_support.c:1147:60:    got unsigned int *<noident>
fdt_support.c:1081:5: warning: symbol '__of_translate_address' was not declared. Should it be static?
fdt_support.c:1154:5: error: symbol 'fdt_translate_address' redeclared with different type (originally declared at include/fdt_support.h:95) - incompatible argument 3 (different base types)
fdt_support.c: In function 'fdt_node_offset_by_compat_reg':
fdt_support.c:1173:17: warning: initialization discards 'const' qualifier from pointer target type [enabled by default]

See also linux kernel commit 0131d897 "of/address: use proper
endianess in get_flags".

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Cc: Jerry Van Baren <gvb.uboot@gmail.com>
2013-02-07 20:38:55 -05:00
Kim Phillips
12e06fe03f treewide: include libfdt_env.h before fdt.h
and, if including libfdt.h which includes libfdt_env.h in
the correct order, don't include fdt.h before libfdt.h.

this is needed to get the fdt type definitions set from
the project environment before fdt.h uses them.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Cc: Jerry Van Baren <gvb.uboot@gmail.com>
2013-02-07 20:38:55 -05:00
Tom Rini
2d795c9621 Merge branch 'master' of git://www.denx.de/git/u-boot-microblaze 2013-02-04 09:14:22 -05:00
Michal Simek
e70fb539a6 serial: arm_dcc: Remove CONFIG_ARM_DCC_MULTI option
CONFIG_ARM_DCC_MULTI should be also removed in the patch
"serial: Remove CONFIG_SERIAL_MULTI from serial drivers"
(sha1: a382725060)
Because the driver defines serial_* functions
which cause conflict with serial.c (multiple definition of serial_*)

Removing CONFIG_SERIAL_MULTI function also require to define
default_serial_console for cases where another serial driver
is not available in the system.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Marek Vasut <marex@denx.de>
2013-02-04 09:14:21 -05:00
Richard Genoud
34765e8853 cmd_time: merge run_command_and_time_it with cmd_process
As far as every arch has a get_timer function,
run_command_and_time_it code can now disappear.

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Acked-By: Che-Liang Chiou <clchiou@chromium.org>
[trini: s/ulong/unsigned long/ in command.h portion]
Signed-off-by: Tom Rini <trini@ti.com>
2013-02-04 09:14:02 -05:00
Jim Lin
b2f3e0ea3e console: USB: KBD: Fix incorrect autoboot timeout
Autoboot timeout defined by CONFIG_BOOTDELAY will not be accurate if
CONFIG_USB_KEYBOARD and CONFIG_SYS_USB_EVENT_POLL are defined in
configuration file and when tstc() function for checking key pressed
takes longer time than 10 ms (e.g., 50 ms) to finish.

Signed-off-by: Jim Lin <jilin@nvidia.com>
2013-02-04 09:07:21 -05:00
Fabio Estevam
b56540801f common: env_mmc: Use __weak annotation to simplify code
Using the __weak annotation can make the code cleaner.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Marek Vasut <marex@denx.de>
2013-02-04 09:07:21 -05:00
Gabor Juhos
0f3073433c common/cmd_bootm.c: prevent running of subcommands before 'bootm start'
The execution order of the bootm subcommands is fixed.
Although here is a sanity check in the state machine
which should prevent running the subcommands in wrong
order but it does not catch all possible errors.

It is possible to run any subcommand without running
'bootm start' first which leads to unexpected behaviour.
For example, running 'bootm loados' without 'bootm start'
causes a hang:

    U-Boot> bootm loados
       XIP Invalid Image ... OK
    OK

Add a sanity check to 'do_bootm_subcommand' in order
to ensure that no subcommands can be executed before
'bootm start'.

After the patch running of any subcommand without running
'bootm start' will cause an error like this:

    U-Boot> bootm loados
    Trying to execute a command out of order
    bootm - boot application image from memory

    Usage:
    bootm [addr [arg ...]]
        - boot application image stored in memory
    ...

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2013-02-04 09:07:21 -05:00
Simon Glass
c8fcd0f279 Only use fb_base if we have a display
The ideal of having a frame buffer when there isn't a display is not
that useful. Change the bdinfo command to expect this only when we
have an lcd or video display.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-04 09:05:45 -05:00
Michal Simek
82b6a4764c common: cmd_bdinfo: Fix compilation warning for microblaze
Fix one printf compilation warning in microblaze bdinfo part.

Warning log:
cmd_bdinfo.c: In function 'do_bdinfo':
cmd_bdinfo.c:219:2: warning: format '%u' expects argument of type
'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat]

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2013-02-04 12:09:50 +01:00
Michal Simek
9fc6a06ad3 common: cmd_bdinfo: Fix bdinfo to show all MACs for Microblaze and ARM
- Show all ethernet MACs in the system.
- Show current ethernet device

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2013-02-04 12:07:09 +01:00
Simon Glass
1206c18403 ppc: Move brg_clk to arch_global_data
Move this field into arch_global_data and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-01 15:42:45 -05:00
Simon Glass
34fd5d253d arm: Move tlb_addr and tlb_size to arch_global_data
Move these fields into arch_global_data and tidy up.

Signed-off-by: Simon Glass <sjg@chromium.org>
[trini: Address tlb_size in this patch as well]
Signed-off-by: Tom Rini <trini@ti.com>
2013-02-01 15:21:58 -05:00
Tom Rini
981481958f Merge branch 'master' of git://git.denx.de/u-boot-video 2013-01-14 15:41:38 -07:00
Nikita Kiryanov
dad631ccf7 lcd: restore ability to display 8 bpp BMPs on 16 bpp LCDs
Commit fb6a9aab7a (LCD: display 32bpp decompressed bitmap image)
broke the check that allowed U-Boot to display 8 bpp BMPs on a 16
bpp LCD screen, effectively turning this feature off.

Restore this feature by changing the check back to the same meaning
it originally had.
To avoid future confusion, the check has also been rephrased to make
its meaning clear.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2013-01-14 20:16:45 +01:00
Albert ARIBAUD
1199c377cf Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master' 2013-01-14 15:21:00 +01:00
Tom Rini
7a8e739cd5 Merge branch 'master' of git://git.denx.de/u-boot-arm 2013-01-11 14:38:24 -07:00