summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2015-07-20Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriqTom Rini
2015-07-20board/ls2085rdb: Export functions for standalone AQ FW load appsPrabhakar Kushwaha
Export functions required by Aquntia PHY firmware load application. functions are memset, strcpy, mdelay, mdio_get_current_dev, phy_find_by_mask, mdio_phydev_for_ethname and miiphy_set_current_dev Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com> Reviewed-by: York Sun <yorksun@freescale.com>
2015-07-20cmd_fdt: save fdtaddr in hex formatSudeep Holla
Commit 90fbee3e4051 ("cmd_fdt: Actually fix fdt command in sandbox") changed the format(from hex address to unsigned long) in which "fdtaddr" is saved . However do_fdt continues reads the "fdtaddr" assuming it to be in hex format. This may lead to fdt being either loaded or attempted to load at erroneous address generating fault if the address is out of memory. This patch changes back the format to hex while saving the "fdtaddr" as it was done before. Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Cc: Hua Yanghao <huayanghao@gmail.com> Cc: Heiko Schocher <hs@denx.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Simon Glass <sjg@chromium.org>
2015-07-20fdt: prevent clearing memory node if there are no banksAndre Przywara
Avoid clearing the reg property in the memory DT node if no memory banks have been specified for a board (CONFIG_NR_DRAM_BANKS == 0). This allows boards to let U-Boot skip the DT memory tinkering in case other firmware has already setup the node properly before. This should be safe as all callers of fdt_fixup_memory_banks that use a computed <banks> value put at least 1 in there. Add some documentation comments to the header file. Signed-off-by: Andre Przywara <osp@andrep.de> Acked-by: Simon Glass <sjg@chromium.org>
2015-07-15cmd: date: Change to use CONFIG_DM_RTC instead of CONFIG_DM_I2CBin Meng
Currently CONFIG_DM_I2C is used in cmd_date.c for driver model, but it should be actually CONFIG_DM_RTC. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-07-15dm: cpu: Fix undefined ENOSYS build errorBin Meng
Include <errno.h> otherwise ENOSYS is undefined. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-07-15spi: sf: Print the error code on failureSimon Glass
Rather than just 'ERROR', display the error code, which may be useful, at least with driver model. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Marek Vasut <marex@denx.de> Reviewed-by: Jagan Teki <jteki@openedev.com>
2015-07-15x86: fsp: Move FspInitEntry call to board_init_f()Bin Meng
The call to FspInitEntry is done in arch/x86/lib/fsp/fsp_car.S so far. It worked pretty well but looks not that good. Apart from doing too much work than just enabling CAR, it cannot read the configuration data from device tree at that time. Now we want to move it a little bit later as part of init_sequence_f[] being called by board_init_f(). This way it looks and works better in the U-Boot initialization path. Due to FSP's design, after calling FspInitEntry it will not return to its caller, instead it jumps to a continuation function which is given by bootloader with a new stack in system memory. The original stack in the CAR is gone, but its content is perserved by FSP and described by a bootloader temporary memory HOB. Technically we can recover anything we had before in the previous stack, but that is way too complicated. To make life much easier, in the FSP continuation routine we just simply call fsp_init_done() and jump back to car_init_ret() to redo the whole board_init_f() initialization, but this time with a non-zero HOB list pointer saved in U-Boot's global data so that we can bypass the FspInitEntry for the second time. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Andrew Bradford <andrew.bradford@kodakalaris.com> Tested-by: Simon Glass <sjg@chromium.org>
2015-07-11scsi: fix compiler warning with DEBUG and 48bit LBAsAndre Przywara
Commit 2b42c9317db ("ahci: support LBA48 data reads for 2+TB drives") introduced conditional code which triggers a warning when compiled with DEBUG enabled: In file included from common/cmd_scsi.c:12:0: common/cmd_scsi.c: In function 'scsi_read': include/common.h:109:4: warning: 'smallblks' may be used uninitialized in this function [-Wmaybe-uninitialized] ... Since this is for debug only, take the easy way and initialize the variable explicitly on declaration to avoid the warning. (Fix a nearby whitespace error on the way.) Tested-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Andre Przywara <osp@andrep.de>
2015-07-01common: Add CMD_SF Kconfig entryJagan Teki
Added Kconfig entry for CMD_SF. Signed-off-by: Jagan Teki <jteki@openedev.com>
2015-06-29mtd, spi: Check if flash pointer is usedHeiko Schocher
If flash pointer is used free it, before probing a new flash and storing it in flash. Signed-off-by: Heiko Schocher <hs@denx.de> Tested-by: Jagannadh Teki <jteki@openedev.com> Reviewed-by: Jagannadh Teki <jteki@openedev.com>
2015-06-29spi, sf: Use offset and size in sf cmd from mtdpartitionHeiko Schocher
With this patch, it is possible to get the offset and size information from the mtdpartiton setting in "mtdparts", similiar to the "nand" commandos. => sf sf - SPI flash sub-system Usage: sf probe [[bus:]cs] [hz] [mode] - init flash device on given SPI bus and chip select sf read addr offset|partition len - read `len' bytes starting at `offset' to memory at `addr' sf write addr offset|partition len - write `len' bytes from memory at `addr' to flash at `offset' sf erase offset|partition [+]len - erase `len' bytes from `offset' `+len' round up `len' to block size sf update addr offset|partition len - erase and write `len' bytes from memory at `addr' to flash at `offset' => for example "env" is defined in mtdparts: => sf read 13000000 env device 0 offset 0xd0000, size 0x10000 SF: 65536 bytes @ 0xd0000 Read: OK zynq-uboot> mtdparts add nor0 0x10000@0x0 env zynq-uboot> sf erase env 0x10000 SF: 65536 bytes @ 0x0 Erased: OK zynq-uboot> sf write 0x100 env device 0 offset 0x0, size 0x10000 SF: 65536 bytes @ 0x0 Written: OK zynq-uboot> sf read 0x40000 env device 0 offset 0x0, size 0x10000 SF: 65536 bytes @ 0x0 Read: OK Signed-off-by: Heiko Schocher <hs@denx.de> Tested-by: Jagannadh Teki <jteki@openedev.com> Reviewed-by: Jagannadh Teki <jteki@openedev.com>
2015-06-29mtd, nand: Move common functions from cmd_nand.c to common placeHeiko Schocher
Move common functions from cmd_nand.c (for calculating offset and size from cmdline paramter) to common place, so they could used from other commands which use mtd partitions. For onenand the arg_off_size() is left in common/cmd_onenand.c. It should use now the common arg_off() function, but as I could not test onenand I let it there ... Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Scott Wood <scottwood@freescale.com> Reviewed-by: Jagannadh Teki <jteki@openedev.com>
2015-06-29mtd, spi: Add MTD layer driverDaniel Schwierzeck
Add MTD layer driver for spi, original patch from: http://git.denx.de/?p=u-boot/u-boot-mips.git;a=commitdiff;h=bb246819cdc90493dd7089eaa51b9e639765cced Changes from Heiko Schocher against this patch: - Remove compile error if not defining CONFIG_SPI_FLASH_MTD: LD drivers/mtd/spi/built-in.o drivers/mtd/spi/sf_probe.o: In function `spi_flash_mtd_unregister': /home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: multiple definition of `spi_flash_mtd_unregister' drivers/mtd/spi/sf_params.o:/home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: first defined here drivers/mtd/spi/sf_ops.o: In function `spi_flash_mtd_unregister': /home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: multiple definition of `spi_flash_mtd_unregister' drivers/mtd/spi/sf_params.o:/home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: first defined here make[1]: *** [drivers/mtd/spi/built-in.o] Fehler 1 make: *** [drivers/mtd/spi] Fehler 2 - Add a README entry. - Add correct writebufsize, to fit with Linux v3.14 MTD, UBI/UBIFS sync. Note (From Jagan): For testing raw mtd parition erase/read/write operations using cmd_sf, sf_mtd should be required to register the spi flash device to MTD layer but the sf_mtd_info ops were not required until and unless if we use any flash filesystem layer say for example UBI. Due to this the foot-print got increased ~290bytes in non-UBI case here that should be acceptible. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Signed-off-by: Heiko Schocher <hs@denx.de> Tested-by: Jagannadh Teki <jteki@openedev.com> Reviewed-by: Jagannadh Teki <jteki@openedev.com>
2015-06-26Move defaults from config_cmd_default.h to KconfigJoe Hershberger
This sets the default commands Kconfig to match include/config_cmd_default.h commands in the common/Kconfig and removes them from include/configs. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> [trini: rastaban, am43xx_evm_usbhost_boot, am43xx_evm_ethboot updates] Signed-off-by: Tom Rini <trini@konsulko.com>
2015-06-25common: Add the CMD_ENV_EXISTS config to KconfigJoe Hershberger
This command needs to exist in the Kconfig so that it can be moved from the config_cmd_default.h. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2015-06-25common: Fix comment for saveenv in KconfigJoe Hershberger
The help for this was simply copied from another command. Update it to reflect the command. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2015-06-19Merge git://git.denx.de/u-boot-usbTom Rini
2015-06-19common: cmd_part: start and size sub-commands introductionPaul Kocialkowski
This introduces the part start and part size sub-commands. The purpose of these is to store the start block and size of a partition in a variable, given the device and partition number. This allows reading raw data that fits a single partition more easily. For instance, this could be used to figure out the start block and size of a kernel partition when a partition table is present, given the partition number. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Acked-by: Stephen Warren <swarren@nvidia.com> [trini: Change "%lx" to LBAF] Signed-off-by: Tom Rini <trini@konsulko.com>
2015-06-19common: cmd_part: Proper alignmentPaul Kocialkowski
This fixes a misaligned declaration. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2015-06-19usb: kbd: Disable idle input reports when we do not need themHans de Goede
When we're polling and thus handling key-repeat in software, make sure to disable idle reports, some keyboards may have these enabled by default messing up our software keyrepeat. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-06-18spl: spl_mmc: MMC boot mode provisions checksPaul Kocialkowski
This allows using only one of either raw or fs mode for SPL mmc boot, without the need to have provisions for the other. In particular, a device may have U-Boot installed on a file system on the mmc, without ever needing to read U-Boot from raw memory. Thus, there is no reason to provide a sector or partition for raw mode. This allows this behaviour and still provides a robust fallback mechanism in case provisions for both modes are defined. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2015-06-18spl: spl_mmc: Minor cosmeticsPaul Kocialkowski
This switches some printf calls to puts and avoids a test repetition. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2015-06-12ahci: support LBA48 data reads for 2+TB drivesMark Langsdorf
Enable full 48-bit LBA48 data reads by passing the upper word of the LBA block pointer in bytes 9 and 10 of the FIS. This allows uboot to load data from any arbitrary sector on a drive with 2 or more TB of available data connected to an AHCI controller. Signed-off-by: Mark Langsdorf <mark.langsdorf@gmail.com> Signed-off-by: Andre Przywara <osp@andrep.de> [trini: Make use of CONFIG_SYS_64BIT_LBA in a few places to drop warnings on platforms that don't enable that feature ] Signed-off-by: Tom Rini <trini@konsulko.com>
2015-06-12cmd_scsi: use lbaint_t for LBA values instead of u32Mark Langsdorf
Signed-off-by: Mark Langsdorf <mark.langsdorf@gmail.com> Signed-off-by: Andre Przywara <osp@andrep.de>
2015-06-12Merge git://git.denx.de/u-boot-dmTom Rini
2015-06-11common/cmd_bdinfo: show gd->board_typeHannes Schmelzer
sometimes it is usefull to know if board-detection has written the correct value into gd->board_type. For this we add some output to the bdinfo command. Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
2015-06-11Add a simple version of memalign()Simon Glass
This is used when the full malloc() is not available. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-06-11lcd: Support colour lookup table on 16bpp display in BMP imagesSimon Glass
For 16-bit-per-pixel displays it is useful to support 8 bit-per-pixel images to reduce image size. Add support for this when drawing BMP images. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-06-11Remove typedefs from bmp_layout.hSimon Glass
We try to avoid typedefs and these ones are easy enough to remove. Before changing this header in the next patch, remove the typedefs. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Joe Hershberger <joe.hershberger@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2015-06-08autoboot.c: Add feature to stop autobooting via SHA256 encrypted passwordStefan Roese
This patch adds the feature to only stop the autobooting, and therefor boot into the U-Boot prompt, when the input string / password matches a values that is encypted via a SHA256 hash and saved in the environment. This feature is enabled by defined these config options: CONFIG_AUTOBOOT_KEYED CONFIG_AUTOBOOT_STOP_STR_SHA256 Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-06-08autoboot.c: Move config options to KconfigStefan Roese
This patch moves the following config options to Kconfig: CONFIG_AUTOBOOT_KEYED CONFIG_AUTOBOOT_PROMPT CONFIG_AUTOBOOT_DELAY_STR CONFIG_AUTOBOOT_STOP_STR AUTOBOOT_KEYED_CTRLC Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Drop ip04 and pm9263 configs/ additions, those boards previously set CONFIG_AUTOBOOT_PROMPT but never used it, re-run savedefconfig over all boards that did change. Make digsy_mtc_* string include seconds to match others and not warn. ] Signed-off-by: Tom Rini <trini@konsulko.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-06-08autoboot.c: Remove CONFIG_AUTOBOOT_STOP_STR2 and CONFIG_AUTOBOOT_DELAY_STR2Stefan Roese
These defines for a 2nd autoboot stop and delay string are nearly unused. Only sc3 defines CONFIG_AUTOBOOT_DELAY_STR2. And a patch to remove this most likely unmaintained board is also posted to the list. By removing these defines the code will become cleaner and moving the remaining compile options to Kconfig will get easier. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Wolfgang Denk <wd@denx.de> Cc: Heiko Schocher <hs@denx.de>
2015-06-06image-fit: Fix compiler warning in fit_conf_print()Hans de Goede
This fixes the following compiler warning: In file included from tools/common/image-fit.c:1:0: ./tools/../common/image-fit.c: In function ‘fit_conf_print’: ./tools/../common/image-fit.c:1470:27: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] (const char **)&uname) > 0; Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-06-05Merge git://git.denx.de/u-boot-fdtTom Rini
2015-06-05fdt: Pass the device serial number through devicetreePaul Kocialkowski
Before device-tree, the device serial number used to be passed to the kernel using ATAGs (on ARM). This is now deprecated and all the handover to the kernel should now be done using device-tree. Thus, this passes the serial-number property to the kernel using the serial-number property of the root node, as expected by the kernel. The serial number is a string that somewhat represents the device's serial number. It might come from some form of storage (e.g. an eeprom) and be programmed at factory-time by the manufacturer or come from identification bits available in e.g. the SoC. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-by: Simon Glass <sgj@chromium.org>
2015-06-04cmd_ide: Eliminate build warnings in atapi_inquiry()Bin Meng
Eliminate the following build warning in atapi_inquiry(): "warning: assignment from incompatible pointer type [enabled by default]" Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-06-02Merge branch 'master' of git://git.denx.de/u-boot-netTom Rini
Fixup include/configs/unipher.h to not set CONFIG_LIB_RAND Signed-off-by: Tom Rini <trini@konsulko.com>
2015-06-01net: Move the CMD_NET config to defconfigsJoe Hershberger
This also selects CONFIG_NET for any CONFIG_CMD_NET board. Remove the imx default for CONFIG_NET. This moves the config that was defined by 60296a8 (commands: add more command entries in Kconfig). Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2015-06-01Move setexpr to KconfigJoe Hershberger
Another shell scripting command that has not been moved. Moved using tools/moveconfig.py using these settings: CMD_SETEXPR bool n y Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-05-29usb: kbd: Fix key repeat not always workingHans de Goede
The usb-kbd key repeat code assumes that reports get repeated every 40 ms, this is never true when using CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP, and does not always works for CONFIG_SYS_USB_EVENT_POLL and CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE since not all usb keyboards honor the usb_set_idle() command. For CONFIG_SYS_USB_EVENT_POLL we must use usb_set_idle() since we do a blocking wait for the hid report, so if we do not tell the keyboard to send a hid report every 40ms even if nothing changes then we will block u-boot for 1s (the default u-boot usb interrupt packet timeout). Note that in this case on keyboards which do not support usb_set_idle() we loose and we actually get 1s latencies on other u-boot activities. For the other poll-methods this commit stops using usb_set_idle() and instead repeats the last received hid-report every 40 ms as long as no new hid-report is received. This fixes key-repeat not working at all with CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP and fixes it not working with keyboards which do not implement usb_set_idle() when using CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-05-29usb: Remove unused variable in usb_setup_descriptor()Hans de Goede
The compiler did not catch this as it was marked __maybe_unused. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-05-28image: fix build when CONFIG_NR_DRAM_BANKS is disabled on ARMMatt Porter
common/image.c currently implicitly depends on CONFIG_NR_DRAM_BANKS when CONFIG_ARM is enabled. Make this requirement explicit. Signed-off-by: Matt Porter <mporter@konsulko.com>
2015-05-28meminfo cmd: Enable printing >=4GiB SDRAM sizesAndrew Bradford
gd->ram_size is stored as phys_size_t type which can be bigger than an unsigned long on some architectures. When using unsigned long type, SDRAM of 4GiB or larger will not print the correct size, but using phys_size_t will. Signed-off-by: Andrew Bradford <andrew.bradford@kodakalaris.com>
2015-05-28spl: spl_mmc: Error and count distinctionPaul Kocialkowski
This introduces a distinction between return codes that are read bytes counts and errors. Read bytes counts are erroneous when null (no data was read) while errors are erroneous when non-null. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Tested-by: Tim Harvey <tharvey@gateworks.com>
2015-05-28Combine bootm_find_<thing> functions togetherKarl Apsite
bootm_find_ramdisk_fdt() renamed to bootm_find_images() for readability. The function bootm_find_ramdisk_fdt() appears to be a simple wrapper for bootm_find_ramdisk(), bootm_find_fdt(), and now bootm_find_loadables(). I didn't see any other callers entering a bootm_find<thing>, so removing the wrapper, and condensing these together hopefully makes the code a little simpler. Signed-off-by: Karl Apsite <Karl.Apsite@dornerworks.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-05-28add boot_get_loadables() to load listed imagesKarl Apsite
Added a trimmed down instance of boot_get_<thing>() to satisfy the minimum requierments of the added feature. The function follows the normal patterns set by other boot_get<thing>'s, which should make it a bit easier to combine them all together into one boot_get_image() function in a later refactor. Documentation for the new function can be found in source: include/image.h Signed-off-by: Karl Apsite <Karl.Apsite@dornerworks.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-05-28mkimage will now report information about loadableKarl Apsite
Added FIT_LOADABLE_PROP, so the user can identify an optional entry named "loadables" in their .its configuration. "loadables" is a comma separated list in the .its Documentation can be found in doc/uImage.FIT/source_file_format.txt and doc/uImage.Fit/multi-with-loadables.its Signed-off-by: Karl Apsite <Karl.Apsite@dornerworks.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-05-27env_mmc: add error message to pass to set_default_envTim Harvey
Add an error message that gets passed to set_default_env() like env_nand implements. This message is displayed to the user as the reason for falling back to the default environment. Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2015-05-27menu: Return an error code if Ctrl-C is pressedTuomas Tynkkynen
Previously, if the menu activated by the 'sysboot' command gets interrupted by a Ctrl-C, the behaviour is as if the menu timeout was reached - i.e. boot the default menu entry. This patch fixes that so a Ctrl-C now terminates the command as the user would expect. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by: Simon Glass <sjg@chromium.org>