summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeLines
* Merge git://git.denx.de/u-boot-dmTom Rini2016-05-17-33/+1964
|\
| * dm: mmc: Use the new select_hwpart() APISimon Glass2016-05-17-4/+4
| | | | | | | | | | | | Avoid calling directly into the MMC code - use the new API call instead. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: blk: Add a easier way to create a named block deviceSimon Glass2016-05-17-8/+5
| | | | | | | | | | | | | | | | Add a function that automatically builds the device name given the parent and a supplied string. Most callers will want to do this, so putting this functionality in one place makes more sense. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: sata: Add support for driver-model block devicesSimon Glass2016-05-17-1/+30
| | | | | | | | | | | | | | | | Add driver-model block-device support to the SATA implementation. This is just a dummy implementation for now, since the SATA low-level API uses numbered devices and that doesn't fit with driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: scsi: Add support for driver-model block devicesSimon Glass2016-05-17-0/+32
| | | | | | | | | | | | Add driver-model block-device support to the SCSI implementation. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: ide: Add support for driver-model block devicesSimon Glass2016-05-17-0/+32
| | | | | | | | | | | | Add driver-model block-device support to the IDE implementation. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: scsi: Drop the get_dev() functionSimon Glass2016-05-17-8/+1
| | | | | | | | | | | | This function is implemented by the legacy block functions now. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: ide: Drop the get_dev() functionSimon Glass2016-05-17-7/+0
| | | | | | | | | | | | This function is implemented by the legacy block functions now. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: usb: Drop the get_dev() functionSimon Glass2016-05-17-18/+1
| | | | | | | | | | | | This function is implemented by the legacy block functions now. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: sata: Separate the non-command code into its own fileSimon Glass2016-05-17-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present the SATA command code includes both the command-processing code and the core SATA functions and data structures. Separate the latter into its own file, adding functions as needed to avoid the command code accessing data structures directly. With this commit: - All CONFIG option are referenced from the non-command code - The concept of a 'current SATA device' is confined to the command code This will make it easier to convert this code to driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: ide: Separate the non-command code into its own fileSimon Glass2016-05-17-0/+1207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present the IDE command code includes both the command-processing code and the core IDE functions and data structures. Separate the latter into its own file, adding functions as needed to avoid the command code accessing data structures directly. With this commit: - Most CONFIG option are referenced from the non-command code - The concept of a 'current IDE device' is confined to the command code This will make it easier to convert this code to driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: scsi: Separate the non-command code into its own fileSimon Glass2016-05-17-0/+571
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present the SCSI command code includes both the command-processing code and the core SCSI functions and data structures. Separate the latter into its own file, adding functions as needed to avoid the command code accessing data structures directly. This functions use the new legacy block functions. With this commit: - There is no CONFIG option referenced from the command code - The concept of a 'current SCSI device' is confined to the command code This will make it easier to convert this code to driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: usb: Add a legacy block interface for USB storageSimon Glass2016-05-17-0/+7
| | | | | | | | | | | | Add a legacy block interface for USB storage. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: scsi: Rename CONFIG_CMD_SCSI to CONFIG_SCSISimon Glass2016-05-17-2/+2
| | | | | | | | | | | | | | | | This option currently enables both the command and the SCSI functionality. Rename the existing option to CONFIG_SCSI since most of the code relates to the feature. Signed-off-by: Simon Glass <sjg@chromium.org>
* | SPL: Add CONFIG_SPL_ABORT_ON_RAW_IMAGEMarek Vasut2016-05-17-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | When defined, SPL will proceed to another boot method if the image it has loaded does not have a signature. This is useful if the subsequent boot methods are much more complex. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Peng Fan <van.freenix@gmail.com> Cc: Fabio Estevam <fabio.estevam@nxp.com>
* | SPL: Let spl_parse_image_header() return valueMarek Vasut2016-05-17-14/+39
|/ | | | | | | | | | | Allow the spl_parse_image_header() to return value. This is convenient for controlling the SPL boot flow if the loaded image is corrupted. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Peng Fan <van.freenix@gmail.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Tom Rini <trini@konsulko.com>
* usb: hub: Don't continue on get_port_status failureMarek Vasut2016-05-06-0/+1
| | | | | | | | | | | The code shouldn't continue probing the port if get_port_status() failed. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <clsee@altera.com> Cc: Dinh Nguyen <dinguyen@opensource.altera.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Stefan Roese <sr@denx.de> Cc: Stephen Warren <swarren@nvidia.com>
* usb: Assure Get Descriptor request is in separate microframeMarek Vasut2016-05-06-0/+8
| | | | | | | | | | | | | | The Kingston DT Ultimate USB 3.0 stick is sensitive to this first Get Descriptor request and if the request is not in a separate microframe, the stick refuses to operate. Add slight delay, which is enough for one microframe to pass on any USB spec revision. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <clsee@altera.com> Cc: Dinh Nguyen <dinguyen@opensource.altera.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Stefan Roese <sr@denx.de> Cc: Stephen Warren <swarren@nvidia.com>
* usb: Wait after sending Set Configuration requestMarek Vasut2016-05-06-0/+8
| | | | | | | | | | | | Some devices, like the SanDisk Cruzer Pop need some time to process the Set Configuration request, so wait a little until they are ready. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <clsee@altera.com> Cc: Dinh Nguyen <dinguyen@opensource.altera.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Stefan Roese <sr@denx.de> Cc: Stephen Warren <swarren@nvidia.com>
* usb: Don't init pointer to zero, but NULLMarek Vasut2016-05-06-1/+1
| | | | | | | | | | | | The pointer should always be inited to NULL, not zero (0). These are two different things and not necessarily equal. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <clsee@altera.com> Cc: Dinh Nguyen <dinguyen@opensource.altera.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Stefan Roese <sr@denx.de> Cc: Stephen Warren <swarren@nvidia.com>
* fdt: fix setting MAC addresses for multiple interfacesLev Iserovich2016-05-03-6/+14
| | | | | | | | | | For multiple ethernet interfaces the FDT offset of '/aliases' will change as we are adding MAC addresses to the FDT. Therefore only the first interface ('ethernet0') will get properly updated in the FDT, with the rest getting FDT errors when we try to set their MAC address. Signed-off-by: Lev Iserovich <iserovil@deshawresearch.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* Fix spelling of "occurred".Vagrant Cascadian2016-05-02-2/+2
| | | | | Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* common/dlmalloc.c: Delete content that was moved to malloc.hRobert P. J. Day2016-04-25-929/+0
| | | | | | | | | | | Remove several hundred lines of content surrounded by: #if 0 /* Moved to malloc.h */ ... moved stuff ... #endif /* 0 */ /* Moved to malloc.h */ Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Reviewed-by: Tom Rini <trini@konsulko.com>
* spl: spl_mmc: Disambiguate error messageFabio Estevam2016-04-25-2/+2
| | | | | | | | | The error message "spl: mmc block read error" may come from two different functions, so we should better annotate the function name where the error comes from to help debugging. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* common: env: support sata devicePeng Fan2016-04-18-0/+128
| | | | | | | | | | | | | | | | | | Introduce env support for sata device. 1. Implement write_env/read_env/env_relocate_spec/saveenv/sata_get_env_dev 2. If want to enable this feature, define CONFIG_ENV_IS_IN_SATA, and define CONFIG_SYS_SATA_ENV_DEV or implement your own sata_get_ev_dev. Signed-off-by: Peng Fan <van.freenix@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Stefan Roese <sr@denx.de> Cc: Heiko Schocher <hs@denx.de> Cc: Stuart Longland <stuartl@vrt.com.au> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* fastboot: sparse: remove unnecessary loggingSteve Rae2016-04-11-4/+2
| | | | | | | remove logging of the 'skipped' blocks Signed-off-by: Steve Rae <srae@broadcom.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
* fastboot: sparse: fix block addressing for don't care chunk typeSteve Rae2016-04-11-4/+8
| | | | | | | | | | When 7bfc3b1 (sparse: Refactor chunk parsing function) was implemented, it dropped 9981945 (aboot: fix block addressing for don't care chunk type). This re-implements the required fix for the "don't care chunk type"... Signed-off-by: Steve Rae <srae@broadcom.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
* spl: mmc: raw: Try to load u-boot if Linux image is not foundLokesh Vutla2016-04-11-1/+11
| | | | | | | | | | If CONFIG_SPL_OS_BOOT is enabled and Linux image is not flashed at RAW_MODE_KERNEL_SECTOR in MMC, spl still assumes that Linux is available and tries to boot it and hangs. In order to avoid this, adding a check to verify if parsed image header is of type IH_OS_LINUX. If it fails then fall back to load u-boot image. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
* env_eeprom invalidates gd->env_addr by setting it to an offset valueGuy Thouret2016-04-11-7/+0
| | | | | | | Patch to fix boot hang when using env on i2c eeprom caused by invalid gd->env_addr Signed-off-by: Guy Thouret <guy.thouret@wems.co.uk> Cc: Heiko Schocher <hs@denx.de>
* fastboot: sparse: fix sparse blocks calculationJeffy Chen2016-04-11-1/+2
| | | | | | | It may overflow in sparse_block_size_to_storage, use uint64_t instead in the calculation. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
* usb: kbd: Do not deregister usbkbd twice when using dmHans de Goede2016-04-10-1/+2
| | | | | | | | | | | | | | The dm usb_kbd_remove function() will deregister the usb keyboard for us on a "usb reset" / "usb stop" so there is no need to manually call usb_kbd_deregister() in the dm case. This commit removes usb_kbd_deregister() in the dm case fixing the following "usb reset" errors: usb_kbd_remove: warning, ret=-6 device_remove: Device 'usb_kbd' failed to remove, but children are gone Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* common: cli: Fix typo CONFIG_CMDINE -> CONFIG_CMDLINEStefan Roese2016-04-04-1/+1
| | | | | | | | | | Patch f8bb6964 (Drop command-processing code when CONFIG_CMDLINE is disabled) introduced a small typo. This patch fixes it and unbreaks all boards again that don't have the Hush parser enabled. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com>
* common: env_sf: Add exclamation markPeng Fan2016-04-01-1/+1
| | | | | | | | | | | | | Add exclamation mark to the errmsg, when error and set_default_env. Signed-off-by: Peng Fan <van.freenix@gmail.com> Cc: Mario Schuknecht <mario.schuknecht@dresearch-fe.de> Cc: Vignesh R <vigneshr@ti.com> Cc: Jagan Teki <jteki@openedev.com> Cc: Ravi Babu <ravibabu@ti.com> Cc: York Sun <york.sun@nxp.com> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* Common: SPL: spl_nand: Fixed debug correct NAND ECC type.Ahmed Samir Khalil2016-04-01-0/+4
| | | | | | | | | | In case of #define DEBUG 1 (fordebugging SPL). A bug in spl_nand_load_image() will be triggered, because it prints using hw ecc regardless of soft ecc configurations and initializations. Signed-off-by: Ahmed Samir <engkhalil86@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* Drop command-processing code when CONFIG_CMDLINE is disabledSimon Glass2016-04-01-1/+22
| | | | | | | | Command parsing and processing code is not needed when the command line is disabled. Remove this code in that case. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* debug_uart: Remove duplicated carriage return handlingBin Meng2016-03-27-2/+0
| | | | | | | | | Since commit b391d74 "debug_uart: output CR along with LF", the handling in puts() is duplicated, not to mention that it should output carriage return before line feed. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* Fix typo choosen in comments and printf logsAlexander Merkle2016-03-27-1/+1
| | | | | | | | Minor change: chosen is written with one "o". No code change here, only comment & printf. Signed-off-by: Alexander Merkle <alexander.merkle@lauterbach.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* lcd: Fix compile warning in 64bit modeAlexander Graf2016-03-27-2/+2
| | | | | | | | When compiling the code for 64bit, the lcd code emits warnings because it tries to cast pointers to 32bit values. Fix it by casting them to longs instead, actually properly aligning with the function prototype. Signed-off-by: Alexander Graf <agraf@suse.de>
* Merge branch 'master' of http://git.denx.de/u-boot-sunxiTom Rini2016-03-23-3/+3
|\
| * spl: Print from which mmc slot spl is trying to bootHans de Goede2016-03-23-3/+3
| | | | | | | | | | | | | | | | | | | | On some sunxi boards (and presumably also non sunxi boards) u-boot can be either loaded from a sdcard in a micro-sd slot, or from eMMC. Print which MMC spl tries to boot from, to help debugging. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* | spl_mmc: allow to load raw imageMasahiro Yamada2016-03-24-14/+4
|/ | | | | | | | | | | The function spl_parse_image_header() falls back to a raw image if the U-Boot header is missing and CONFIG_SPL_PANIC_ON_RAW_IMAGE is undefined. While, mmc_load_image_raw_sector() only accepts a U-Boot legacy image or an FIT image, preventing us from loading a raw image. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* usb: Correct return value in usb_stor_info()Simon Glass2016-03-22-1/+1
| | | | | | | | This should return 0 on success, not 1. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Marek Vasut <marex@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
* Fix spelling of "transferred".Vagrant Cascadian2016-03-22-2/+2
| | | | | | | Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Acked-by: Marek Vasut <marex@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* Allow command-line files to be droppedSimon Glass2016-03-22-2/+2
| | | | | | | | These files do not need to be compiled when CONFIG_CMDLINE is disabled. Update the Makefile to reflect this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* Panic when no command line processing can be performedSimon Glass2016-03-22-0/+1
| | | | | | | | Normally board_run_command() will handle command processed. But if for some reason it returns then we should panic to avoid further processing. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* usb: Change power-on / scanning timeout handlingStefan Roese2016-03-20-94/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the USB port scanning procedure and timeout handling in the following ways: a) The power-on delay in usb_hub_power_on() is now reduced to a value of max(100ms, "hub->desc.bPwrOn2PwrGood * 2"). The code does not wait using mdelay, instead usb_hub_power_on() will wait before querying the device in the scanning loop later. The total timeout for this hub, which is 1 second + "hub->desc.bPwrOn2PwrGood * 2" is calculated and will be used in the following per-port scanning loop as the timeout to detect active USB devices on this hub. b) Don't delay the minimum delay (for power to stabilize) in usb_hub_power_on(). Instead skip querying these devices in the scannig loop until the delay time is reached. c) The ports are now scanned in a quasi parallel way. The current code did wait for each (unconnected) port to reach its timeout and only then continue with the next port. This patch now changes this to scan all ports of all USB hubs quasi simultaneously. For this, all ports are added to a scanning list. This list is scanned until all ports are ready by either a) reaching the connection timeout (calculated earlier), or by b) detecting a USB device. This results in a faster USB scan time as the recursive scanning of USB hubs connected to the hub that's currently being scanned will start earlier. One small functional change to the original code is, that ports with overcurrent detection will now get rescanned multiple times (PORT_OVERCURRENT_MAX_SCAN_COUNT). Without this patch: starting USB... USB0: USB EHCI 1.00 scanning bus 0 for devices... 9 USB Device(s) found time: 20.163 seconds With this patch: starting USB... USB0: USB EHCI 1.00 scanning bus 0 for devices... 9 USB Device(s) found time: 1.822 seconds So ~18.3 seconds of USB scanning time reduction. Signed-off-by: Stefan Roese <sr@denx.de> Acked-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Stephen Warren <swarren@nvidia.com>
* usb: Don't reset the USB hub a 2nd timeStefan Roese2016-03-20-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Debugging has shown, that all USB hubs are being reset twice while USB scanning. This introduces additional delays and makes USB scanning even more slow. Testing has shown that this 2nd USB hub reset doesn't seem to be necessary. This patch now removes this 2nd USB hub reset. Resulting in faster USB scan time. Here the current numbers: Without this patch: => time usb start starting USB... USB0: USB EHCI 1.00 scanning bus 0 for devices... 9 USB Device(s) found time: 24.003 seconds With this patch: => time usb start starting USB... USB0: USB EHCI 1.00 scanning bus 0 for devices... 9 USB Device(s) found time: 20.392 seconds So ~3.6 seconds of USB scanning time reduction. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Simon Glass <sjg@chromium.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Stephen Warren <swarren@nvidia.com> Cc: Marek Vasut <marex@denx.de>
* usb: Remove 200 ms delay in usb_hub_port_connect_change()Stefan Roese2016-03-20-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes 2 mdelay(200) calls from usb_hub_port_connect_change(). These delays don't seem to be necessary. At least not in my tests. Here the number for a custom x86 Bay Trail board (not in mainline yet) with a quite large and complex USB hub infrastructure. Without this patch: starting USB... USB0: USB EHCI 1.00 scanning bus 0 for devices... 9 USB Device(s) found time: 28.415 seconds With this patch: starting USB... USB0: USB EHCI 1.00 scanning bus 0 for devices... 9 USB Device(s) found time: 24.003 seconds So ~4.5 seconds of USB scanning time reduction. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Simon Glass <sjg@chromium.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Stephen Warren <swarren@nvidia.com> Cc: Marek Vasut <marex@denx.de>
* usb: legacy_hub_port_reset(): Speedup hub reset handlingStefan Roese2016-03-20-2/+7
| | | | | | | | | | | | | | | | | | Start with a short USB hub reset delay of 20ms. This can be enough for some configurations. The 2nd delay at the end of the loop is completely removed. Since the delay hasn't been long enough, a longer delay time of 200ms is assigned and will be used in the next loop round. This hub reset handling is also used in the v4.4 Linux USB driver, hub_port_reset(). Signed-off-by: Stefan Roese <sr@denx.de> Cc: Simon Glass <sjg@chromium.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Stephen Warren <swarren@nvidia.com> Cc: Marek Vasut <marex@denx.de>
* Revert "fdt: fix address cell count checking in fdt_translate_address()"Przemyslaw Marczak2016-03-17-3/+4
| | | | | | | | | | | | | | | | | | | This reverts commit 71105f50fedddfa5b0535d102c3d5078671721ad. The reverted commit was applied for a temporary to unbreak few Exynos boards on the release. After the discussion about the change, this commit should be avoided. Fixed device-tree for Exynos, allows reverting it without any issues. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Stefan Roese <sr@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Cc: Stephen Warren <swarren@nvidia.com> Cc: Stephen Warren <swarren@wwwdotorg.org> Tested-by: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>