summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' of git://git.denx.de/u-boot-dmTom Rini2014-09-133-12/+29
|\
| * dm: Make driver model available before board_init()Simon Glass2014-09-102-15/+27
| | | | | | | | | | | | | | | | | | | | | | For some boards board_init() will change GPIOs, so we need to have driver model available before then. Adjust the board init to arrange this, but enable it for driver model only, just to be safe. This does create additional #ifdef logic, but it is safer than trying to make a pervasive change which may cause some boards to break. Signed-off-by: Simon Glass <sjg@chromium.org>
| * Set up stdio earlier when using driver modelSimon Glass2014-09-101-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Since driver model registers itself with the stdio subsystem, and we want to avoid delayed registration and other complexity associated with the current serial console, move the stdio subsystem init earlier when driver model is used for serial. This simplifies the implementation. Should there be any problems with this approach they can be dealt with as boards are converted over to use driver model for serial. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: Move pre-reloc init earlier to cope with board_early_init_f()Simon Glass2014-09-101-2/+2
| | | | | | | | | | | | | | | | | | In order to support GPIO access in board_early_init_f() we must set up driver model before this function is called. In any case, earlier is better since driver model is (or will become) a key function for most init. Signed-off-by: Simon Glass <sjg@chromium.org>
* | board_r: ARM[64] do not set gd againJeroen Hofstee2014-09-091-1/+1
|/ | | | | | | | | For ARM / ARM64 the relocation routines already updated gd to the new value. Don't set it again. This allows compilation with clang as it cannot update gd directly. cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* Merge git://git.denx.de/u-boot-usbTom Rini2014-09-021-4/+19
|\
| * dfu: Provide means to find difference between dfu-util -e and -RLukasz Majewski2014-09-021-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit provides distinction between DFU device detach and reset. The -R behavior is preserved with proper handling of the dfu-util's -e switch, which detach the DFU device. By running dfu-util -e; one can force device to finish the execution of dfu command on target and execute some other scripted commands. Moreover, some naming has been changed - the dfu_reset() method now is known as dfu_detach(). New name better reflects the purpose of the code. It was also necessary to increase the number of usb_gadget_handle_interrupts() calls since we also must wait for detection of the USB reset event. Example usage: 1. -e (detach) switch dfu-util -a0 -D file1.bin;dfu-util -a3 -D uImage;dfu-util -e access to u-boot prompt. 2. -R (reset) switch dfu-util -a0 -D file1.bin;dfu-util -R -a3 -D uImage target board reset Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Reviewed-by: Stephen Warren <swarren@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com>
* | dm: gpio: Allow gpio command to adjust GPIOs that are busySimon Glass2014-08-311-3/+6
| | | | | | | | | | | | | | | | | | | | The gpio command mostly relies on gpio_request() and gpio_free() being nops, in that you can request a GPIO twice. With driver model this is now implemented correctly, so it fails. Change the command to deal with a failure to claim the GPIO. Signed-off-by: Simon Glass <sjg@chromium.org>
* | dm: gpio: Enhance gpio command to show only active GPIOsSimon Glass2014-08-311-32/+69
|/ | | | | | | | | | | | The GPIO list is very long in many cases and most of them are not used. By default, show only the GPIOs that are in use, and provide a flag to show all of them. This makes the 'gpio status' command much more pleasant. In order to do this, driver model now exposes a method for obtaining the 'function' of a GPIO, which describes whether it is an input or output, for example. Implementation of this method is optional. Signed-off-by: Simon Glass <sjg@chromium.org>
* cmd_bootm.c: Add 'booti' for ARM64 Linux kernel ImagesTom Rini2014-08-301-0/+140
| | | | | | | | | | | | | The default format for arm64 Linux kernels is the "Image" format, described in Documentation/arm64/booting.txt. This, along with an optional gzip compression on top is all that is generated by default. The Image format has a magic number within the header for verification, a text_offset where the Image must be run from, an image_size that includes the BSS and reserved fields. This does not support automatic detection of a gzip compressed image. Signed-off-by: Tom Rini <trini@ti.com>
* Merge branch 'master' of git://git.denx.de/u-boot-tiTom Rini2014-08-291-7/+5
|\
| * common/Makefile: Consolidate SPL ENV options, correct inclusionTom Rini2014-08-251-7/+5
| | | | | | | | | | | | | | CONFIG_SPL_NET_SUPPORT is not the only time we want SPL to ahve environment, CONFIG_SPL_ENV_SUPPORT is when we want it. Signed-off-by: Tom Rini <trini@ti.com>
* | Merge git://git.denx.de/u-boot-usbTom Rini2014-08-292-5/+25
|\ \
| * | usb: hub: don't check CONNECTION in hub_port_reset()Stephen Warren2014-08-291-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One specific USB 3.0 device behaves strangely when reset by usb_new_device()'s call to hub_port_reset(). For some reason, the device appears to briefly drop off the bus when this second bus reset is executed, yet if we retry this loop, it'll eventually come back after another two resets. If USB bus reset is executed over and over within usb_new_device()'s call to hub_port_reset(), I see the following sequence of results, which repeats as long as you want: 1) STAT_C_CONNECTION = 1 STAT_CONNECTION = 0 USB_PORT_STAT_ENABLE 0 2) STAT_C_CONNECTION = 1 STAT_CONNECTION = 1 USB_PORT_STAT_ENABLE 0 3) STAT_C_CONNECTION = 1 STAT_CONNECTION = 1 USB_PORT_STAT_ENABLE 1 The device in question is a SanDisk Ultra USB 3.0 16GB memory stick with USB VID/PID 0x0781/0x5581. In order to allow this device to work with U-Boot, ignore the {C_,}CONNECTION bits in the status/change registers, and only use the ENABLE bit to determine if the reset was successful. To be honest, extensive investigation has failed to determine why this problem occurs. I'd love to know! I don't know if it's caused by: * A HW bug in the device * A HW bug in the Tegra USB controller * A SW bug in the U-Boot Tegra USB driver * A SW bug in the U-Boot USB core This issue only occurs when the device's USB3 pins are attached to the host; if only the USB2 pins are connected the issue does not occur. The USB3 controller on Tegra is in reset, so is not actively communicating with the device at all - a USB3 analyzer confirms this. Slightly unplugging the device (so the USB3 pins don't contact) or using a USB2 cable or hub as an intermediary avoids the problem. For some reason, the Linux kernel (either on the same Tegra board, or on an x86 host) has no issue with the device, and I observe no disconnections during reset. This change won't affect any USB device that already works, since such devices could not currently be triggering the error return this patch removes, or they wouldn't be working currently. However, this patch is quite reliable in practice, hence I hope it's acceptable to solve the problem. The only potential fallout I can see from this patch is: * A broken device that triggers C_CONNECTION/!CONNECTION now causes the loop in hub_port_reset() to run multiple times. If it never succeeds, this will cause "usb start" to take roughly 1s extra to execute. * If the user unplugs a device while hub_port_reset() is executing, and very quickly swaps in a new device, hub_port_reset() might succeed on the new device. This would mean that any information cached about the original device (from the descriptor read in usb_new_device(), which simply caches the max packet size) might be invalid, which would cause problems talking to the new device. However, without this change, the new device wouldn't work anyway, so this is probably not much of a loss. Signed-off-by: Stephen Warren <swarren@nvidia.com>
| * | usb: Handle -ENODEV from usb_lowlevel_init()Marek Vasut2014-08-291-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we support both Host and Device mode operation, an OTG controller can return -ENODEV on a port which it found to be in Device mode during Host mode scan for devices. In case -ENODEV is returned, print that the port is not available and continue instead of screaming a bloody error message. Signed-off-by: Marek Vasut <marex@denx.de>
* | | Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini2014-08-291-4/+4
|\ \ \
| * | | mx6: add support of multi-processor commandGabriel Huau2014-08-201-4/+4
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | This allows u-boot to load different OS or Bare Metal application on different cores of the i.MX6 SoC. For example: running Android on cpu0 and a RT OS like QNX/FreeRTOS on cpu1. Signed-off-by: Gabriel Huau <contact@huau-gabriel.fr> Acked-by: Stefano Babic <sbabic@denx.de>
* | | Fix test failure caused by bad handling of ramdiskSimon Glass2014-08-282-2/+3
| |/ |/| | | | | | | | | | | | | | | | | | | Commit e3a5bbce broke the FIT image tests by not loading a ramdisk even if a load address is provided in the FIT. The rationale was that a load address of 0 should be considered to mean 'do not load'. Add a new load operation which supports this feature, so that the ramdisk will be loaded if a non-zero load address is provided. Signed-off-by: Simon Glass <sjg@chromium.org>
* | mtd, ubi, ubifs: resync with Linux-3.14Heiko Schocher2014-08-252-28/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resync ubi subsystem with linux: commit 455c6fdbd219161bd09b1165f11699d6d73de11c Author: Linus Torvalds <torvalds@linux-foundation.org> Date: Sun Mar 30 20:40:15 2014 -0700 Linux 3.14 A nice side effect of this, is we introduce UBI Fastmap support to U-Boot. Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Tom Rini <trini@ti.com> Cc: Marek Vasut <marex@denx.de> Cc: Sergey Lapin <slapin@ossfans.org> Cc: Scott Wood <scottwood@freescale.com> Cc: Joerg Krause <jkrause@posteo.de>
* | Merge branch 'agust@denx.de' of git://git.denx.de/u-boot-stagingTom Rini2014-08-251-0/+1
|\ \
| * | mtdparts: fix usecount bugHeiko Schocher2014-08-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | add missing put_mtd_device, so mtd->usecount gets correct decremented in get_mtd_info(). Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Scott Wood <scottwood@freescale.com> Cc: Tom Rini <trini@ti.com>
* | | nios2: add generic board supportThomas Chou2014-08-242-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements the generic board init as described in doc/README.generic-board. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Signed-off-by: Scott McNutt <smcnutt@psyent.com> Reviewed-by: Stefan Roese <sr@denx.de>
* | | bootm: make sure pass NULL when argc < 1Bryan Wu2014-08-211-2/+3
| | | | | | | | | | | | | | | | | | arg[0] might not be NULL even if argc < 1, so fix this as before. Signed-off-by: Bryan Wu <pengw@nvidia.com>
* | | image: fix bootm failure for FIT imageBryan Wu2014-08-212-18/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b3dd64f5d537 "bootm: use genimg_get_kernel_addr()" introduced a bug for booting FIT image. It's because calling fit_parse_config() twice will give us wrong value in img_addr. Add a new function genimg_get_kernel_addr_fit() whichl will always return fit_uname_config and fit_uname_kernel for CONFIG_FIT. genimg_get_kernel_addr() will ignore those to parameters. Reported-by: York Sun <yorksun@freescale.com> Signed-off-by: Bryan Wu <pengw@nvidia.com>
* | | pxe: Allow use of environment variables in append stringHans de Goede2014-08-211-16/+13
| | | | | | | | | | | | | | | | | | | | | Use cli_simple_process_macros, so that environment variables (e.g. ${console}) can be used in append strings. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* | | cli: Export cli_simple_process_macros for use outside of cli_simpleHans de Goede2014-08-211-2/+2
|/ / | | | | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* | Merge branch 'master' of git://git.denx.de/u-boot-blackfinTom Rini2014-08-121-11/+34
|\ \
| * | support blackfin board initialization in generic board_fSonic Zhang2014-08-071-11/+34
| |/ | | | | | | | | | | | | | | | | - init hardware watchdog if applicable - use CONFIG_SYS_MONITOR_LEN as the gd monitor len for Blackfin - reserve u-boot memory at the top field of the RAM for Blackfin - avoid refer to CONFIG_SYS_MONITOR_LEN, which is not defined by Blackfin Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
* | lcd: support displaying 24bpp BMPs on >= 24bpp LCDsHannes Petermaier2014-08-111-3/+20
| | | | | | | | | | | | | | | | | | | | most todays LCDs support 32bpp e.g. the framebuffer memory is 32bpp organized. To support 24bpp BMPs we need to take only 3 byte from the bpp and set one byte from the FB to 0. Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
* | lcd: remove unused lcd_puts_xyJeroen Hofstee2014-08-111-10/+0
| | | | | | | | | | | | | | | | prevents a clang warning that the function is never used. cc: agust@denx.de Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* | lcd: cleanup unused functionsHannes Petermaier2014-08-101-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes following two functions: - lcd_getbgcolor(...) not used somewhere outside lcd.c, internally we use now the global variable lcd_color_bg (was return value of function before) - lcd_getfgcolor(...) not used in any place of u-boot Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at> [agust: rebased] Signed-off-by: Anatolij Gustschin <agust@denx.de>
* | Add support for 32-bit organized framebuffersHannes Petermaier2014-08-101-3/+32
| | | | | | | | | | | | | | - Adds support for 32-bit organized framebuffers to the LCD-framework. Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at> Cc: agust@denx.de
* | env_fat.c: Make sure our buffer is cache alignedTom Rini2014-08-091-2/+2
| | | | | | | | | | | | | | We must ensure the buffer we read the env into is aligned or we may get warnings later on. Signed-off-by: Tom Rini <trini@ti.com>
* | bootm: use genimg_get_kernel_addr()Bryan Wu2014-08-091-20/+5
| | | | | | | | | | | | | | | | | | | | | | Use the new API which is originally taken out from boot_get_kernel of bootm.c Signed-off-by: Bryan Wu <pengw@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Stephen Warren <swarren@nvidia.com> [trini: Fix warnings with CONFIG_FIT] Signed-off-by: Tom Rini <trini@ti.com>
* | pxe: detect image format before calling bootm/bootzBryan Wu2014-08-091-4/+11
| | | | | | | | | | | | | | | | | | | | Trying bootm for zImage will print out several error message which is not necessary for this case. So detect image format firstly, only try bootm for legacy and FIT format image then try bootz for others. This patch needs new function genimg_get_kernel_addr(). Signed-off-by: Bryan Wu <pengw@nvidia.com>
* | image: introduce genimg_get_kernel_addr()Bryan Wu2014-08-091-0/+43
| | | | | | | | | | | | | | | | | | | | Kernel address is normally stored as a string argument of bootm or bootz. This function is taken out from boot_get_kernel() of bootm.c, which can be reused by others. Signed-off-by: Bryan Wu <pengw@nvidia.com> [trini: Fix warnings with CONFIG_FIT] Signed-off-by: Tom Rini <trini@ti.com>
* | fdt: Rename fdt_resize() to fdt_shrink_to_minimum()Simon Glass2014-08-093-3/+3
| | | | | | | | | | | | | | Since libfdt now has an fdt_resize() function, we need to rename the U-Boot one. Signed-off-by: Simon Glass <sjg@chromium.org>
* | ext4load: fix help textPavel Machek2014-08-091-1/+1
| | | | | | | | | | | | Fix ext4load help text. Signed-off-by: Pavel Machek <pavel@denx.de>
* | board_r: Add missing return to initr_docIan Campbell2014-08-091-0/+1
| | | | | | | | | | | | | | | | I happened to spot this while working in the area. Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Acked-by: Simon Glass <sjg@chromium.org> Cc: Simon Glass <sjg@chromium.org>
* | pxe: clear Bootfile before returningStephen Warren2014-08-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When "pxe boot" downloads the initrd/kernel/DTB, netboot_common() saves the downloaded filename to global variable BootFile. If the boot operation is aborted, this global state is not cleared. If "dhcp" is executed later without any arguments, BootFile is not cleared, and when the DHCP response is received, BootpCopyNetParams() writes the value into environment variable bootfile. This causes the following scenario: * Boot script executes dhcp; pxe get; pxe boot * User CTRL-C's the PXE menu, which causes the first menu item to be booted, which causes some file to be downloaded. (This boot-on-CTRL-C behaviour is arguably a bug too, but it's a separate bug and the bug this patch fixes would still exist if the user simply waited to press CTRL-C until "pxe boot" started downloading files) * User CTRL-C's the file downloads, but the filename is still written to the bootfile environment variable. * User re-runs the boot command, which in my case executes "dhcp; pxe get; pxe boot" again, and "dhcp" picks up the saved bootfile environment variable and proceeds to download a file that it shouldn't. To solve this, modify the implementation of "pxe get" to clear BootFile if the whole boot operation fails, which avoids this whole mess. An alternative would be to modify netboot_common() such that the no- arguments case explicitly clears the global variable BootFile. However, that would prevent the following command sequences from working: $ dhcp filename # downloads "filename" $ dhcp # downloads $bootfile, i.e. "filename" or: $ setenv bootfile filename $ dhcp # downloads $bootfile, i.e. "filename" ... and I assume someone relies on U-Boot working that way. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* | thor: defer parsing of device string to IO backendLukasz Majewski2014-08-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit d4f5ef59cc7 "dfu: defer parsing of device string to IO backend" changed the function signature of dfu_init_env_entities(). Adjust cmd_thordown.c to match that change. Also, apply the same change as commit d6d37d737b58e "dfu: free entities when parsing fails" to cmd_thordown.c. Fixes: d4f5ef59cc7 ("dfu: defer parsing of device string to IO backend") Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
* | dfu: defer parsing of device string to IO backendStephen Warren2014-08-091-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Devices are not all identified by a single integer. To support this, defer the parsing of the device string to the IO backed, so that it can apply the appropriate rules. SPI devices are specified as controller:chip_select. SPI/SF support will be added soon. MMC devices can also be specified as controller[.hwpart][:partition] in many commands, although we don't support that syntax in DFU. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* | fs: implement size/fatsize/ext4sizeStephen Warren2014-08-093-0/+40
|/ | | | | | | | | | These commands may be used to determine the size of a file without actually reading the whole file content into memory. This may be used to determine if the file will fit into the memory buffer that will contain it. In particular, the DFU code will use it for this purpose in the next commit. Signed-off-by: Stephen Warren <swarren@nvidia.com>
* env_mmc: support env partition setup in runtimeDmitry Lifshitz2014-08-011-12/+23
| | | | | | | | | | | | Add callback with __weak annotation to allow setup of environment partition number in runtime from a board file. Propagate mmc_switch_part() return value into init_mmc_for_env() instead of -1 in case of failure. Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
* ARM: convert arch_fixup_memory_node to a generic FDT fixup functionMa Haijun2014-07-281-2/+5
| | | | | | | | | | | | Some architecture needs extra device tree setup. Instead of adding yet another hook, convert arch_fixup_memory_node to be a generic FDT fixup function. [maz: collapsed 3 patches into one, rewrote commit message] Signed-off-by: Ma Haijun <mahaijuns@gmail.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'Albert ARIBAUD2014-07-281-1/+1
|\
| * keystone2: use CONFIG_SOC_KEYSTONE in common placesKhoronzhuk, Ivan2014-07-251-1/+1
| | | | | | | | | | | | | | | | Use CONFIG_SOC_KEYSTONE in common places instead of defining a lot of "if def .. || if def " for different Keystone2 SoC types. Acked-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
* | Add a flag indicating when the serial console is readySimon Glass2014-07-231-2/+2
| | | | | | | | | | | | | | | | | | | | For sandbox we have a fallback console which is used very early in U-Boot, before serial drivers are available. Rather than try to guess when to switch to the real console, add a flag so we can be sure. This makes sure that sandbox can always output a panic() message, for example, and avoids silent failure (which is very annoying in sandbox). Signed-off-by: Simon Glass <sjg@chromium.org>
* | console: Remove vprintf() optimisation for sandboxSimon Glass2014-07-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | If the console is not present, we try to reduce overhead by stopping any output in vprintf(), before it gets to putc(). This is of dubious merit in general, but in the case of sandbox it is incorrect since we have a fallback console which reports errors very early in U-Boot. If this is defeated U-Boot can hang or exit with no indication of what is wrong. Remove the optimisation for sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
* | stdio: Provide functions to add/remove devices using stdio_devSimon Glass2014-07-231-8/+24
| | | | | | | | | | | | | | | | | | The current functions for adding and removing devices require a device name. This is not convenient for driver model, which wants to store a pointer to the relevant device. Add new functions which provide this feature and adjust the old ones to call these. Signed-off-by: Simon Glass <sjg@chromium.org>
OpenPOWER on IntegriCloud