Commit Graph

3140 Commits

Author SHA1 Message Date
Bin Meng d51457583f x86: Remove unnecessary call to initr_enable_interrupts()
Actually initr_enable_interrupts() was never called in an x86 build
due to it was wrapped by CONFIG_x86 (typo of X86).

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2014-11-25 06:34:02 -07:00
Bin Meng a549f7497b x86: Remove cpu_init_r() for x86
Since cpu_init_interrupts() was moved out of cpu_init_r(), it is
useless to keep cpu_init_r() for x86, thus remove it.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2014-11-25 06:34:02 -07:00
Simon Glass 65990d5680 x86: Remove board_early_init_r()
This function is not needed. Remove it to improve the generic init sequence
slightly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2014-11-25 06:33:59 -07:00
Rabin Vincent f3a05c8f94 Revert "hush: fix segfault on syntax error"
128059b92 ("hush: fix segfault on syntax error") attempted to fix a
segfault on syntax errors, but it broke Ctrl-C handling, and the
assumption that it made, that rcode could not be -1, is incorrect.
Revert this change.

Reported-by: Stephen Warren <swarren@wwwdotorg.org>
Reported-by: Przemyslaw Marczak <p.marczak@samsung.com>
Signed-off-by: Rabin Vincent <rabin@rab.in>
2014-11-24 12:06:06 -05:00
Tom Rini dee332ffb7 Merge branch 'master' of git://www.denx.de/git/u-boot-imx 2014-11-24 12:02:12 -05:00
Tom Rini 1739564e75 Merge git://git.denx.de/u-boot-dm
Conflicts:
	drivers/serial/serial-uclass.c

Signed-off-by: Tom Rini <trini@ti.com>
2014-11-24 12:01:48 -05:00
Tom Rini 746667f1e5 Merge git://git.denx.de/u-boot-x86
Conflicts:
	arch/x86/cpu/Makefile

Signed-off-by: Tom Rini <trini@ti.com>
2014-11-24 12:00:00 -05:00
Nikita Kiryanov d957c28a7e cmd_sata: implement sata stop command
Implement sata stop command.
This introduces the __sata_stop() weak function, which mirrors
the weak __sata_initialize() function, giving users the option of
undoing the custom steps performed in overrides of sata_initialize().

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@ti.com>
2014-11-24 12:00:00 +01:00
Suriyan Ramasami d455d8789d fs: API changes enabling extra parameter to return size of type loff_t
The sandbox/ext4/fat/generic fs commands do not gracefully deal with files
greater than 2GB. Negative values are returned in such cases.

To handle this, the fs functions have been modified to take an additional
parameter of type "* loff_t" which is then populated. The return value
of the fs functions are used only for error conditions.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
[trini: Update board/gdsys/p1022/controlcenterd-id.c,
drivers/fpga/zynqpl.c for changes]
Signed-off-by: Tom Rini <trini@ti.com>
2014-11-23 06:49:04 -05:00
Suriyan Ramasami 96b1046d1c sandbox: Prepare API change for files greater than 2GB
Change the internal sandbox functions to use loff_t for file offsets.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>

Acked-by: Simon Glass <sjg@chromium.org>
2014-11-23 06:49:04 -05:00
Suriyan Ramasami 9f12cd0e06 ext4: Prepare API change for files greater than 2GB
Change the internal EXT4 functions to use loff_t for offsets.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
[trini: Update common/spl/spl_ext.c]
Signed-off-by: Tom Rini <trini@ti.com>
2014-11-23 06:49:04 -05:00
Suriyan Ramasami 1ad0b98a06 fat: Prepare API change for files greater than 2GB
Change the internal FAT functions to use loff_t for offsets.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
[trini: Fix fs/fat/fat.c for min3 updates]
Signed-off-by: Tom Rini <trini@ti.com>
2014-11-23 06:49:04 -05:00
Suriyan Ramasami 794449551d sandbox: Use md5sum and fatwrite to enable testing of fs commands
Enable md5sum to obtain the MD5 of the read and written files to check
their contents for validity.
Use map_sysmem() to map buffer in a sandbox environment.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>

Acked-by: Simon Glass <sjg@chromium.org>
2014-11-23 06:49:04 -05:00
Daniel Schwierzeck 9fdee7d730 common/board_f: fix gcc warning on MIPS64
This fixes following warning when compiled with MIPS64

common/board_f.c: In function 'display_text_info':
common/board_f.c:150:2: warning: format '%X' expects argument i
  of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat=]
  debug("U-Boot code: %08X -> %08lX  BSS: -> %08lX\n",

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-11-23 06:49:03 -05:00
Daniel Schwierzeck 666ba8444e common/board_f: add setup of initial stack frame for MIPS
The MIPS specific setup of the initial stack frame was not
ported to generic board_f.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2014-11-23 06:49:03 -05:00
Masahiro Yamada 60296a835c commands: add more command entries in Kconfig
This commit adds some of command entries (CONFIG_CMD_*) to
cover include/config_cmd_default.h and a little extra.

Because U-Boot supports lots of commands, they should be categorized
according to their usage.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-23 06:49:03 -05:00
Masahiro Yamada 6c77509000 hush: add CONFIG_HUSH_PARSER to Kconfig
The README file states that the macros beginning with "CONFIG_SYS_"
depend on the hardware etc. and should not be meddled with if you do
not what you're doing.
We have already screwed up with this policy; we have given the prefix
"CONFIG_SYS_" to many user-selectable configurations.
Here, "CONFIG_SYS_HUSH_PARSER" is one of them.  Users can enable it
if they want to use a more powerful command line parser, or disable it
if they only need a simple one.

This commit attempts to rename CONFIG_SYS_HUSH_PARSER to
CONFIG_HUSH_PARSER and move it to Kconfig.

Every board maintainer is expected to enable CONFIG_HUSH_PARSER
(= add "CONFIG_HUSH_PARSER=y" to his defconfig file) and remove
"#define CONFIG_SYS_HUSH_PARSER" from his header file.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-23 06:49:03 -05:00
Thierry Reding 4efe52bf23 pci: Honour pci_skip_dev()
When enumerating devices, honour the pci_skip_dev() function. This can
be used by PCI controller drivers to restrict which devices will be
probed.

This is required by the NVIDIA Tegra PCIe controller driver, which will
fail with a data abort exception if an access is attempted to a device
number larger than 0 outside of bus 0. pci_skip_dev() is therefore
implemented to prevent any such accesses.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-23 06:49:01 -05:00
Thierry Reding 042b83d4c5 pci: Abort early if bus does not exist
When listing the devices on a PCI bus, the current code will blindly try
to access all devices. Internally this causes pci_bus_to_hose() to be
repeatedly called and output an error message every time. Prevent this
by calling pci_bus_to_hose() once and abort early if no bus was found.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-23 06:49:01 -05:00
Christian Gmeiner 59e890ef7b fs: make it possible to read the filesystem UUID
Some filesystems have a UUID stored in its superblock. To
allow using root=UUID=... for the kernel command line we
need a way to read-out the filesystem UUID.

changes rfc -> v1:
 - make the environment variable an option parameter. If not
   given, the UUID is printed out. If given, it is stored in the env
   variable.
 - corrected typos
 - return error codes

changes v1 -> v2:
 - fix return code of do_fs_uuid(..)
 - document do_fs_uuid(..)
 - implement fs_uuid_unsuported(..) be more consistent with the
   way other optional functionality works

changes v2 -> v3:
 - change ext4fs_uuid(..) to make use of #if .. #else .. #endif
   construct to get rid of unreachable code

Hit any key to stop autoboot:  0
=> fsuuid
fsuuid - Look up a filesystem UUID

Usage:
fsuuid <interface> <dev>:<part>
    - print filesystem UUID
fsuuid <interface> <dev>:<part> <varname>
    - set environment variable to filesystem UUID

=> fsuuid mmc 0:1
d9f9fc05-45ae-4a36-a616-fccce0e4f887
=> fsuuid mmc 0:2
eb3db83c-7b28-499f-95ce-9e0bb21cda81
=> fsuuid mmc 0:1 uuid1
=> fsuuid mmc 0:2 uuid2
=> printenv uuid1
uuid1=d9f9fc05-45ae-4a36-a616-fccce0e4f887
=> printenv uuid2
uuid2=eb3db83c-7b28-499f-95ce-9e0bb21cda81
=>

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
2014-11-23 06:49:01 -05:00
Stefan Roese 18f26fdbd0 spl: Change debug to printf for "Unsupported boot-device"
We had the problem on an AM33xx platform, that SPL detected an
unsupported boot-device. But since this message is a debug message
it took a bit of time to really know, where the hangup in SPL
resulted from. So let's change this debug message to a printf
and also print the detected boot-device that is not supported.
This makes debugging of such cases much easier.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Tom Rini <trini@ti.com>
Acked-by: Heiko Schocher <hs@denx.de>
2014-11-23 06:49:00 -05:00
Masahiro Yamada b41411954d linux/kernel.h: sync min, max, min3, max3 macros with Linux
U-Boot has never cared about the type when we get max/min of two
values, but Linux Kernel does.  This commit gets min, max, min3, max3
macros synced with the kernel introducing type checks.

Many of references of those macros must be fixed to suppress warnings.
We have two options:
 - Use min, max, min3, max3 only when the arguments have the same type
   (or add casts to the arguments)
 - Use min_t/max_t instead with the appropriate type for the first
   argument

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Pavel Machek <pavel@denx.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
[trini: Fixup arch/blackfin/lib/string.c]
Signed-off-by: Tom Rini <trini@ti.com>
2014-11-23 06:48:30 -05:00
Simon Glass c1a6f371ae dm: i2c: Move error reporting into a common function
Factor out the common code to make it easier to adjust it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
Acked-by: Heiko Schocher <hs@denx.de>
2014-11-21 08:14:54 +01:00
Simon Glass 1151651831 dm: spl: Allow driver model to be used
When enabled, set up driver model for SPL. This allows SPL to use the same
drivers as the main U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Tom Rini <trini@ti.com>
2014-11-21 08:12:55 +01:00
Simon Glass fb4f5e7c91 dm: spl: Make simple malloc() available when enabled
Set up the simple malloc() implementation when requested, in preference to
the full malloc().

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-21 08:12:52 +01:00
Simon Glass c9356be307 dm: Split the simple malloc() implementation into its own file
The simple malloc() implementation is used when memory is tight. It provides
a simple buffer with an incrementing pointer.

At present the implementation is inside dlmalloc. Move it into its own file
so that it is easier to find.

Rather than using relocation as a signal that the full malloc() is
available, add a special GD_FLG_FULL_MALLOC_INIT flag. This signals that the
simple malloc() should no longer be used.

In some cases, such as SPL, even the code space used by the full malloc() is
wasteful. Add a CONFIG_SYS_MALLOC_SIMPLE option to provide only the simple
malloc. In this case the full malloc is not available at all. It saves about
1KB of code space and about 0.5KB of data on Thumb 2.

Acked-by: Tom Rini <trini@ti.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-21 08:12:28 +01:00
Simon Glass 003504b6fe x86: Remove unnecessary find_fdt(), prepare_fdt() functions
These are no-longer needed so drop them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2014-11-21 07:24:12 +01:00
Simon Glass 768e0f52f2 Move early malloc() to before arch_cpu_init()
For some CPUs, having malloc() available very early is useful. There is no
reason to delay this since early malloc is allocated before board_init_f()
is called.

Move early malloc() init nearer to the start of the init sequence.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-21 07:24:11 +01:00
Simon Glass 8b37c7694f x86: Use the standard arch_cpu_init() function
Instead of an x86-specific cpu_init_f() function, use the normal U-Boot one
for this purpose. Also remove a useless/misleading comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2014-11-21 07:24:09 +01:00
Simon Glass 07387d1769 x86: Use the standard dram_init() function
Instead of having an x86-specific DRAM init function, adjust things so we
can use the normal one.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2014-11-21 07:24:09 +01:00
Dirk Eibach f1cdde2833 common: Fix cmd_fpgad addressing
Addressing was completely broken for cmd_fpgad.

Signed-off-by: Dirk Eibach <dirk.eibach@gdsys.cc>
Signed-off-by: Stefan Roese <sr@denx.de>
2014-11-19 08:48:41 +01:00
Heiko Schocher 0c3117b1f7 spl, nand: add option to boot raw u-boot.bin image only
enable to boot only a raw u-boot.bin image from nand with the
CONFIG_SPL_NAND_RAW_ONLY define. This option saves space on
boards where spl space is low.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com>
Reviewed-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2014-11-17 08:47:17 -05:00
Tom Rini 3ad207a2bf Merge branch 'master' of git://git.denx.de/u-boot-arm 2014-11-13 09:32:45 -05:00
Nikita Kiryanov ecfdcee5d9 powerpc: remove orphaned boards mcc200 and prs200
mcc200 and prs200 are old and have no maintainer. Remove the boards.

This also removes the mcc200 specific 1bpp BMP support from
common/lcd.c

Cc: Wolfgang Denk <wd@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: York Sun <yorksun@freescale.com>
Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
2014-11-12 13:02:22 -05:00
Thierry Reding 868de51dde malloc: Output region when debugging
When DEBUG is set, output memory region used for malloc().

Signed-off-by: Thierry Reding <treding@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-11-12 07:25:42 +01:00
Tom Rini 6841deb620 Merge branch 'master' of git://git.denx.de/u-boot-usb 2014-11-11 16:59:25 -05:00
Soeren Moch 6a559bbe2f usb_storage: blacklist Enclosure Service Devices
Skip enclosure service devices when probing for usb storage devices.

This avoids long timeouts when probing for external usb harddisks
which provide "Enclosure Services".

Signed-off-by: Soeren Moch <smoch@web.de>
--

This is a new version of the patch
"usb_storage: skip all unknown devices when probing"
http://http://lists.denx.de/pipermail/u-boot/2014-November/194622.html

Cc: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@ti.com>
2014-11-08 12:03:35 +01:00
Wolfgang Denk 1aaab00d88 common/cmd_fitupd.c: restore corrupted file
This file got corrupted by the automatic editin of commit 1a45966 "Add
GPL-2.0+ SPDX-License-Identifier to source files"; restore the
opiginal content and manually insert the SPDX ID.

The bug was detected by running cppcheck, which reported:
[common/cmd_fitupd.c:8]: (error) Invalid number of character ({) when
these macros are defined: 'CONFIG_UPDATE_TFTP'.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2014-11-07 16:27:08 -05:00
Rabin Vincent 2302b3ab85 hush: make run_command() return an error on parsing failure
run_command() returns success even if the command had a syntax error;
correct this behaviour.

Signed-off-by: Rabin Vincent <rabin@rab.in>
Acked-by: Simon Glass <sjg@chromium.org)
2014-11-07 16:27:06 -05:00
Rabin Vincent 128059b926 hush: fix segfault on syntax error
Hush segfaults if it sees a syntax error while attempting to parse a
command:

 $ ./u-boot -c "'"
 ...
 syntax error
 Segmentation fault (core dumped)

This is due to a NULL pointer dereference of in_str->p in static_peek().
The problem is that the exit condition for the loop in
parse_stream_outer() checks for rcode not being -1, but rcode is only
ever 0 or 1.

Signed-off-by: Rabin Vincent <rabin@rab.in>
Acked-by: Simon Glass <sjg@chromium.org)
Tested-by: Simon Glass <sjg@chromium.org)
2014-11-07 16:27:06 -05:00
Rabin Vincent 484408fb51 hush: return consistent codes from run_command()
Attempting to run:
 - an empty string
 - a string with just spaces

returns different error codes, 1 for the empty string and 0
for the string with just spaces.  Make both of them return
0 for consistency.

Signed-off-by: Rabin Vincent <rabin@rab.in>
Acked-by: Simon Glass <sjg@chromium.org)
2014-11-07 16:27:06 -05:00
Rabin Vincent 854d2b9753 dlmalloc: ensure gd is set for early alloc
Attempting to run the sandbox leads to a segfault, because some dynamic
libraries (outside of u-boot) attempt to use malloc() to allocate memory
before u-boot's gd variable is initialized.

Check for gd not being NULL in the SYS_MALLOC_F_LEN handling, so that
malloc() doesn't crash when called at this point.

 $ gdb -q --args ./u-boot
 (gdb) r
 Program received signal SIGSEGV, Segmentation fault.
 0x0000000000412b9b in malloc (bytes=bytes@entry=37) at common/dlmalloc.c:2184
 2184		if (!(gd->flags & GD_FLG_RELOC)) {
 (gdb) p gd
 $1 = (gd_t *) 0x0
 (gdb) bt
 #0  0x0000000000412b9b in malloc (bytes=bytes@entry=37) at common/dlmalloc.c:2184
 #1  0x00007ffff75bf8e1 in set_binding_values (domainname=0x7ffff11f4f12 "libgpg-error", dirnamep=0x7fffffffe168, codesetp=0x0)
     at bindtextdom.c:228
 #2  0x00007ffff75bfb4c in set_binding_values (codesetp=0x0, dirnamep=0x7fffffffe168, domainname=<optimized out>) at bindtextdom.c:350
 #3  __bindtextdomain (domainname=<optimized out>, dirname=0x7ffff11f4f00 "/usr/share/locale") at bindtextdom.c:348
 #4  0x00007ffff11eca17 in ?? () from /lib/x86_64-linux-gnu/libgpg-error.so.0
 #5  0x00007ffff7dea9fa in call_init (l=<optimized out>, argc=argc@entry=1, argv=argv@entry=0x7fffffffe208,
     env=env@entry=0x7fffffffe218) at dl-init.c:78
 #6  0x00007ffff7deaae3 in call_init (env=0x7fffffffe218, argv=0x7fffffffe208, argc=1, l=<optimized out>) at dl-init.c:36
 #7  _dl_init (main_map=0x7ffff7ffe1a8, argc=1, argv=0x7fffffffe208, env=0x7fffffffe218) at dl-init.c:126
 #8  0x00007ffff7ddd1ca in _dl_start_user () from /lib64/ld-linux-x86-64.so.2

Signed-off-by: Rabin Vincent <rabin@rab.in>
Acked-by: Simon Glass <sjg@chromium.org>
2014-11-07 16:27:05 -05:00
Noam Camus c6150aaf2f image-fdt: boot_get_fdt() return value when no DTB exists
I believe that when no DTB is around we should return 1.
This why I fixed such scenarious to not return zero anymore.
Else kernel might get NULL pointer to DTB which doesn't exists.

Signed-off-by: Noam Camus <noamc@ezchip.com>
2014-11-07 16:27:05 -05:00
Hans de Goede 8e55311983 usb: kbd: Add (optional) support for using an interrupt queue for polling
Waiting an interrupt packet to complete in usb_kbd_poll_for_event, causes
a 40 ms latency for each call to usb_kbd_testc, which is undesirable.

Using control messages leads to lower (but still not 0) latency, but some
devices do not work well with control messages (e.g. my kvm behaves funny
with them).

This commit adds support for using the int_queue mechanism which at least
the ehci-hcd driver supports. This allows polling with 0 latency, while
using interrupt packets.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-04 06:04:01 +01:00
Hans de Goede 8f8d7d2451 usb: kbd: Cache pipe, interval and packetsize
Instead of looking them up every time we need them.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-04 06:04:00 +01:00
Hans de Goede 88274b6c43 stdio: Fix memleak on stdio_deregister
stdio_register makes a malloc-ed copy of struct stdio_dev through stdio_clone,
free the malloc-ed memory on stdio_deregister.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-04 06:04:00 +01:00
Hans de Goede dfe5b1c86f usb: kbd: Fix memleak on usb_kbd_deregister()
Free the keyboard hid-report buffer and private data on deregister.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-04 06:04:00 +01:00
Hans de Goede be17e752f3 usb: kbd: Remove unused usb_kbd_generic_poll function
This is not used anywhere, so lets remove it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-04 06:04:00 +01:00
Hans de Goede 0834bb2fb0 usb: Do not power-cycle usb devices on init
Do as the Linux kernel does and power on any ports which are not yet one,
this is enough.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-04 06:03:59 +01:00
Hans de Goede f7b9baf755 usb: Remove unnecessary portnr lookup from usb_new_device
If the device has a parent, it is instantiated from usb_hub_port_connect_change
and the portnr is right there in dev->portnr, so there is no need for this
whole dance to look it up.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-04 06:03:59 +01:00