summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2014-11-24cmd_sata: implement sata stop commandNikita Kiryanov
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-23fs: API changes enabling extra parameter to return size of type loff_tSuriyan Ramasami
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-23sandbox: Prepare API change for files greater than 2GBSuriyan Ramasami
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-23ext4: Prepare API change for files greater than 2GBSuriyan Ramasami
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-23fat: Prepare API change for files greater than 2GBSuriyan Ramasami
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-23sandbox: Use md5sum and fatwrite to enable testing of fs commandsSuriyan Ramasami
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-23common/board_f: fix gcc warning on MIPS64Daniel Schwierzeck
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-23common/board_f: add setup of initial stack frame for MIPSDaniel Schwierzeck
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-23commands: add more command entries in KconfigMasahiro Yamada
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-23hush: add CONFIG_HUSH_PARSER to KconfigMasahiro Yamada
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-23pci: Honour pci_skip_dev()Thierry Reding
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-23pci: Abort early if bus does not existThierry Reding
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-23fs: make it possible to read the filesystem UUIDChristian Gmeiner
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-23spl: Change debug to printf for "Unsupported boot-device"Stefan Roese
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-23linux/kernel.h: sync min, max, min3, max3 macros with LinuxMasahiro Yamada
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-21dm: i2c: Move error reporting into a common functionSimon Glass
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-21dm: spl: Allow driver model to be usedSimon Glass
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-21dm: spl: Make simple malloc() available when enabledSimon Glass
Set up the simple malloc() implementation when requested, in preference to the full malloc(). Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-21dm: Split the simple malloc() implementation into its own fileSimon Glass
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-21x86: Remove unnecessary find_fdt(), prepare_fdt() functionsSimon Glass
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-21Move early malloc() to before arch_cpu_init()Simon Glass
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-21x86: Use the standard arch_cpu_init() functionSimon Glass
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-21x86: Use the standard dram_init() functionSimon Glass
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-21fdt: Try to use fdt_address_cells()/fdt_size_cells()Simon Glass
Use these new functions where possible. They default to a value of 2 so we cannot use them in some places where we need a default value of 1. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
2014-11-21fdt: Change fdt_pack_reg() to static and fix typesSimon Glass
This function is only called within this file so make it static. Also fix its argument types to be consistent with its caller. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Tom Rini <trini@ti.com>
2014-11-21fdt: Add ft_system_setup() function for system device tree additionsSimon Glass
Add an additional function for adding information to the device tree before booting. This permits additions which are not board-specific. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Tom Rini <trini@ti.com>
2014-11-21fdt: Tidy up error handling in image_setup_libfdt()Simon Glass
The message about needing to reset should be printed no matter what error is printed. Also, an error should always be printed. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Tom Rini <trini@ti.com>
2014-11-21fdt: Export the fdt_find_or_add_subnode() functionSimon Glass
This function is useful for ensuring that a node exists. Export it so it can be used more widely. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Tom Rini <trini@ti.com>
2014-11-21fdt: Report failure of ft_board_setup()Simon Glass
Since this function can fail, print a message when it does. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Tom Rini <trini@ti.com>
2014-11-19common: Fix cmd_fpgad addressingDirk Eibach
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-17spl, nand: add option to boot raw u-boot.bin image onlyHeiko Schocher
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-13Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini
2014-11-12powerpc: remove orphaned boards mcc200 and prs200Nikita Kiryanov
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-12malloc: Output region when debuggingThierry Reding
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-11Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini
2014-11-08usb_storage: blacklist Enclosure Service DevicesSoeren Moch
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-07common/cmd_fitupd.c: restore corrupted fileWolfgang Denk
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-07hush: make run_command() return an error on parsing failureRabin Vincent
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-07hush: fix segfault on syntax errorRabin Vincent
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-07hush: return consistent codes from run_command()Rabin Vincent
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-07dlmalloc: ensure gd is set for early allocRabin Vincent
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-07image-fdt: boot_get_fdt() return value when no DTB existsNoam Camus
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-04usb: kbd: Add (optional) support for using an interrupt queue for pollingHans de Goede
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-04usb: kbd: Cache pipe, interval and packetsizeHans de Goede
Instead of looking them up every time we need them. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-04stdio: Fix memleak on stdio_deregisterHans de Goede
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-04usb: kbd: Fix memleak on usb_kbd_deregister()Hans de Goede
Free the keyboard hid-report buffer and private data on deregister. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-04usb: kbd: Remove unused usb_kbd_generic_poll functionHans de Goede
This is not used anywhere, so lets remove it. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-11-04usb: Do not power-cycle usb devices on initHans de Goede
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-04usb: Remove unnecessary portnr lookup from usb_new_deviceHans de Goede
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-10-29Merge git://git.denx.de/u-boot-x86Tom Rini