summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeLines
* common: image: Remove FIT header update from image post-processingAndrew F. Davis2016-12-04-23/+6
| | | | | | | | | | | | | | | | | | | After an image is selected out of a FIT blob for further processing we run an optional, platform specific, post-processing function on this component. This post-processing may modify the position and size of the image, so after post-processing we update the location and size for this image in the FIT header. This can cause problems as the position of subsequent components in the FIT blob are only referenced by relative position to the end of the last component. When we resize or move a component the following components position will be calculated incorrectly. To fix this, we do not update the FIT header but instead only update our local understanding of the image data. This also allows us to re-run post-processing steps if needed. Signed-off-by: Andrew F. Davis <afd@ti.com> Tested-by: Carlos Hernandez <ceh@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
* Merge branch 'master' of git://www.denx.de/git/u-boot-dmTom Rini2016-12-03-2/+5
|\
| * libfdt: replace ARCH_FIXUP_FDT with ARCH_FIXUP_FDT_MEMORYMasahiro Yamada2016-12-02-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit e2f88dfd2d96 ("libfdt: Introduce new ARCH_FIXUP_FDT option") allows us to skip memory setup of DTB, but a problem for ARM is that spin_table_update_dt() and psci_update_dt() are skipped as well if CONFIG_ARCH_FIXUP_FDT is disabled. This commit allows us to skip only fdt_fixup_memory_banks() instead of the whole of arch_fixup_fdt(). It will be useful when we want to use a memory node from a kernel DTB as is, but need some fixups for Spin-Table/PSCI. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Alexey Brodkin <abrodkin@synopsys.com> Acked-by: Simon Glass <sjg@chromium.org> Fixed build error for x86: Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Handle global_data moving in SPLSimon Glass2016-12-02-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | When CONFIG_SPL_STACK_R is enabled, and spl_init() is called before board_init_r(), spl_relocate_stack_gd() will move global_data to a new place in memory. This affects driver model since it uses a list for the uclasses. Unless this is updated the list will become invalid. When looking for a non-existent uclass, such as when adding a new one, the loop in uclass_find() may continue forever, thus causing a hang. Add a function to correct this rather obscure bug. Signed-off-by: Simon Glass <sjg@chromium.org>
* | cmd: Convert CMD_BOOTMENUTom Rini2016-12-03-0/+6
| | | | | | | | | | | | Also convert MENU while we're in here. Signed-off-by: Tom Rini <trini@konsulko.com>
* | image: Add Trusted Execution Environment image typeAndrew F. Davis2016-12-03-0/+1
| | | | | | | | | | | | | | | | Add a new image type representing Trusted Execution Environment (TEE) image types. For example, an OP-TEE OS binary image. Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | image: Add FIT image loadable section custom processingAndrew F. Davis2016-12-03-0/+33
| | | | | | | | | | | | | | | | | | | | | | To help automate the loading of custom image types we add the ability to define custom handlers for the loadable section types. When we find a compatible type while loading a "loadable" image from a FIT image we run its associated handlers to perform any additional steps needed for loading this image. Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | common: sh: add necessary define bits to board_fVladimir Zapolskiy2016-12-02-6/+9
| | | | | | | | | | | | | | | | | | | | Since a platform conversion to generic board support has not been accomplished some architecture specific bits are missing from board_f init sequence, the change adds a number of basic expected callbacks into early init sequence. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | scsi: Separate SCSI private block description initializationMichal Simek2016-12-02-6/+22
| | | | | | | | | | | | | | | | | | | | When blk_create_device() is called some parameters in blk_desc are automatically filled. Separate SCSI private initialization and SCSI full block device initialization not to rewrite already prepared data. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | scsi: Change scsi_scan() to be able to return valueMichal Simek2016-12-02-1/+2
| | | | | | | | | | | | | | | | | | | | With DM_SCSI this function will return more than one return value to cover errors. Suggested-by: Simon Glass <sjg@chromium.org> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | scsi: Make private functions staticMichal Simek2016-12-02-6/+10
| | | | | | | | | | | | | | | | | | | | Several functions should be static because they are not exported to any other file. Warnings were reported by sparse C=1. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | scsi: Remove completely unused functionsMichal Simek2016-12-02-35/+0
| | | | | | | | | | | | | | | | | | | | These functions are not called for any location. This patch removes them scsi_trim_trail(), scsi_get_disk_count() and scsi_setup_read6(). Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | scsi: Simplify scsi_read/scsi_write()Michal Simek2016-12-02-16/+11
| | | | | | | | | | | | | | | | | | | | There is no reason to directly point to static allocated array when we have proper block_dev pointer available via parameter in !CONFIG_BLK. For CONFIG_BLK this is read directly from uclass platdata. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | scsi: Move pccb buffer initalization directly to scsi_detect_devMichal Simek2016-12-02-6/+6
| | | | | | | | | | | | | | | | pccb is pointer to temporary buffer which is used only for sending command. Make it local as is done in scsi_read/scsi_write. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | scsi: Take lun from device block descriptionMichal Simek2016-12-02-6/+5
| | | | | | | | | | | | | | | | Prepare LUN(Logical unit number) directly in block description structure and reuse it. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | scsi: Extract device detection algorithmMichal Simek2016-12-02-61/+82
| | | | | | | | | | | | | | | | The patch enables running detection algorithm on block device description structure. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | scsi: Extract block device initializationMichal Simek2016-12-02-20/+25
| | | | | | | | | | | | | | Extract block device initialization to specific function. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | common: miiphyutil: Work and report phy address in hex in mdio cmdMichal Simek2016-12-02-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | It is confusing that mdio commands work and report phy id as decimal value when mii is working with hex values. For example: ZynqMP> mdio list gem: 21 - TI DP83867 <--> ethernet@ff0e0000 ZynqMP> mdio read ethernet@ff0e0000 0 Reading from bus gem PHY at address 21: 0 - 0x1140 ZynqMP> mii dump 21 0 Incorrect PHY address. Range should be 0-31 ... ZynqMP> mii dump 15 0. (1140) -- PHY control register -- (8000:0000) 0.15 = 0 reset U-Boot normally takes hex values that's why this patch is changing mdio command to handle hex instead of changing mii command to handle decimal values. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* SPL: mmc: Make spl_mmc_load_image availableMarek Vasut2016-12-01-2/+2
| | | | | | | | | | Make the spl_mmc_load_image() available globally, so it can be invoked directly by SPL on extremely space-constrained systems. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Cc: Jaehoon Chung <jh80.chung@samsung.com>
* mmc: Tinification of the mmc codeMarek Vasut2016-12-01-1/+5
| | | | | | | | | | | | Add new configuration option CONFIG_MMC_TINY which strips away all memory allocation within the MMC code and code for handling multiple cards. This allows extremely space-constrained SPL code use the MMC framework. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Jaehoon Chung <jh80.chung@samsung.com>
* Merge branch 'master' of git://git.denx.de/u-boot-mipsTom Rini2016-11-30-2/+2
|\
| * common/board_f: enable initr_trap for MIPSDaniel Schwierzeck2016-11-30-2/+2
| | | | | | | | | | | | | | | | Enable initr_trap hook also for MIPS to install and enable U-Boot's specific MIPS exception handlers. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini2016-11-30-1/+0
|\ \ | |/ |/|
| * spl: mmc: fix switch statementMax Krummenacher2016-11-29-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | If CONFIG_SPL_LIBCOMMON_SUPPORT is not defined there is a lone case statement at the end of the switch leading to a compile error. Remove the offending case statement. | common/spl/spl_mmc.c:339:7: error: label at end of compound statement Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Marek Vasut <marex@denx.de>
* | Merge git://git.denx.de/u-boot-mpc85xxTom Rini2016-11-29-0/+2
|\ \ | |/ |/|
| * tools/env: Correct include kconfigYork Sun2016-11-23-0/+2
| | | | | | | | | | | | | | While we move some config macros to Kconfig, kconfig header is needed to avoid compiling error if not already included. Signed-off-by: York Sun <york.sun@nxp.com>
* | spl: add USB Gadget config optionStefan Agner2016-11-28-12/+21
| | | | | | | | | | | | | | | | | | Introduce USB Gadget config option. This allows to combine Makefile entries for SPL_USBETH_SUPPORT and SPL_DFU_SUPPORT. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Ravi Babu <ravibabu@ti.com>
* | spl: dfu: move DFU Kconfig to SPL KconfigStefan Agner2016-11-28-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DFU Kconfig menu entries should be part of the SPL Kconfig file. Also avoid using the top level Makefile by moving the config dependent build artifacts to the driver/ and driver/usb/gadget/ Makfiles. With that, DFU can be built again in SPL if CONFIG_SPL_DFU_SUPPORT is enabled. Fixes: 6ad6102246d8 ("usb:gadget: Disallow DFU in SPL for now") Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
* | spl: add RAM boot device only if it is actually definedStefan Agner2016-11-28-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Some devices (e.g. dra7xx) support loading to RAM using DFU without having direct boot from RAM support. Make sure the linker list does not contain BOOT_DEVICE_RAM if CONFIG_SPL_RAM_DEVICE is not enabled. Fixes: 98136b2f26fa ("spl: Convert spl_ram_load_image() to use linker list") Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
* | xyz-modem: Change getc timeout loop waitingtomas.melin@vaisala.com2016-11-28-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the loop delay when using a hw watchdog. In case a watchdog is used that accesses CPU registers, the defined delay of 20us in a tight loop will cause a huge delay in the actual timeout seen. This is caused by the fact that udelay will inheritantly call WATCHDOG_RESET. Together with the omap wdt implementation, the seen timeout increases up to around 30s. This makes the loop very slow and causes long delays when using the modem. Instead, implement the 2 sec loop by using the timer interface to know when to break out of the timeout loop. Watchdog kicking is taken care of by getc(). Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
* | sata: fix sata command can not being executed bugTang Yuantian2016-11-28-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit d97dc8a0 separated the non-command code into its own file which caused variable sata_curr_device can not be set to a correct value. Before commit d97dc8a0, variable sata_curr_device can be set correctly in sata_initialize(). After commit d97dc8a0, sata_initialize() is moved out to its own file. Accordingly, variable sata_curr_device is removed from sata_initialize() too. This caused sata_curr_device never gets a chance to be set properly which prevent other commands from being executed. This patch sets variable sata_curr_device properly. Fixes: d97dc8a0 (dm: sata: Separate the non-command code into its own file) Signed-off-by: Tang Yuantian <yuantian.tang@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | generic-board: make show_board_info a weak functionMarcel Ziswiler2016-11-28-1/+1
| | | | | | | | | | | | | | | | | | Make show_board_info() a weak function which allows for custom board specific implementations thereof. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
* | Revert "generic-board: allow showing custom board info"Marcel Ziswiler2016-11-28-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Drop CONFIG_CUSTOM_BOARDINFO as it is not Kconfig compliant and anyway not really used anywhere plus the upcoming weak show_board_info() approach seems much superior. This reverts commit a9ad18c9d5fe2554753b0f9a52adfd5ebce61147. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
* | spl: remove redundant call to parse_image_header()tomas.melin@vaisala.com2016-11-28-1/+0
| | | | | | | | | | | | | | | | Image header was checked twice. Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Acked-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | spl: add check for FIT-header when loading imagetomas.melin@vaisala.com2016-11-28-1/+2
| | | | | | | | | | | | | | | | | | | | Add check for FDT_MAGIC, otherwise also legacy images will be loaded as a FIT. With this check in place, the loader works correct both with legacy and FIT images. Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Acked-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | Merge git://git.denx.de/u-boot-rockchipTom Rini2016-11-26-4/+5
|\ \
| * | stdio: Correct numbering logic in stdio_probe_device()Simon Glass2016-11-25-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current code assumes that the devices are ordered corresponding to their alias value. But (for example) video1 can come before video0 in the device tree. Correct this, by always looking for device 0 first. After that we can fall back to finding the first available device. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | stdio: Correct code style nitsSimon Glass2016-11-25-2/+2
| | | | | | | | | | | | | | | | | | Fix a few code style nits in stdio_get_by_name(). Signed-off-by: Simon Glass <sjg@chromium.org>
* | | Merge git://git.denx.de/u-boot-fsl-qoriqTom Rini2016-11-25-1/+18
|\ \ \ | |/ / |/| | | | | | | | | | | | | | Signed-off-by: Tom Rini <trini@konsulko.com> Conflicts: arch/arm/Kconfig
| * | image-fit: Fix compiling error caused by autoconf.hYork Sun2016-11-23-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit ec6617c3 includes autoconf.h in image-fit.c, causing conflict for board odroid-xu3 which overwrites CONFIG_SYS_BOARD in header file. Move the include higher and use linux/kconfig.h instead of generated/autoconf.h. Signed-off-by: York Sun <york.sun@nxp.com> CC: Alison Wang <alison.wang@nxp.com>
| * | armv8: Support loading 32-bit OS in AArch32 execution stateAlison Wang2016-11-22-1/+18
| |/ | | | | | | | | | | | | | | | | | | | | | | | | To support loading a 32-bit OS, the execution state will change from AArch64 to AArch32 when jumping to kernel. The architecture information will be got through checking FIT image, then U-Boot will load 32-bit OS or 64-bit OS automatically. Signed-off-by: Ebony Zhu <ebony.zhu@nxp.com> Signed-off-by: Alison Wang <alison.wang@nxp.com> Signed-off-by: Chenhui Zhao <chenhui.zhao@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
* | image: Combine image_sig_algo with image_sign_infoAndrew Duda2016-11-21-26/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the need to explicitly add SHA/RSA pairings. Invalid SHA/RSA pairings will still fail on verify operations when the hash length is longer than the key length. Follow the same naming scheme "checksum,crytpo" without explicitly defining the string. Indirectly adds support for "sha1,rsa4096" signing/verification. Signed-off-by: Andrew Duda <aduda@meraki.com> Signed-off-by: aduda <aduda@meraki.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | image: Add crypto_algo struct for RSA infoAndrew Duda2016-11-21-23/+23
| | | | | | | | | | | | | | | | | | | | Cut down on the repetition of algorithm information by defining separate checksum and crypto structs. image_sig_algos are now simply pairs of unique checksum and crypto algos. Signed-off-by: Andrew Duda <aduda@meraki.com> Signed-off-by: aduda <aduda@meraki.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | rsa: Verify RSA padding programaticallyAndrew Duda2016-11-21-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Padding verification was done against static SHA/RSA pair arrays which take up a lot of static memory, are mostly 0xff, and cannot be reused for additional SHA/RSA pairings. The padding can be easily computed according to PKCS#1v2.1 as: EM = 0x00 || 0x01 || PS || 0x00 || T where PS is (emLen - tLen - 3) octets of 0xff and T is DER encoding of the hash. Store DER prefix in checksum_algo and create rsa_verify_padding function to handle verification of a message for any SHA/RSA pairing. Signed-off-by: Andrew Duda <aduda@meraki.com> Signed-off-by: aduda <aduda@meraki.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | ext4: Allow reading files with non-zero offset, clamp read lenStefan Brüns2016-11-21-4/+4
|/ | | | | | | | Support was already implemented, but not hooked up. This fixes several fails in the test cases. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
* spl: Convert CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR to KconfigSemen Protsenko2016-11-18-2/+29
| | | | | | Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> [trini: Fix sniper and kc1 migration] Signed-off-by: Tom Rini <trini@konsulko.com>
* image: Protect against overflow in unknown_msg()Simon Glass2016-11-05-2/+4
| | | | | | | | | | Coverity complains that this can overflow. If we later increase the size of one of the strings in the table, it could happen. Adjust the code to protect against this. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Coverity (CID: 150964)
* cmd: dfu: Add error handling for board_usb_initMichal Simek2016-11-03-1/+5
| | | | | | board_usb_init() can failed and error should be handled properly. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini2016-10-28-0/+5
|\ | | | | | | | | | | | | | | Signed-off-by: Tom Rini <trini@konsulko.com> Conflicts: common/Kconfig configs/dms-ba16_defconfig
| * config: Move CONFIG_DEFAULT_FDT_FILE to defconfigsJagan Teki2016-10-26-0/+5
| | | | | | | | | | | | | | | | | | | | - Add DEFAULT_FDT_FILE kconfig entry - Move CONFIG_DEFAULT_FDT_FILE from include/configs to defconfigs Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Cc: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>