summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* efi_loader: correctly determine if an MMC device is an SD-cardHeinrich Schuchardt2017-12-161-3/+21
| | | | | | | | The SD cards and eMMC devices have different device nodes. The current coding interpretes all MMC devices as eMMC. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: error handling in efi_load_image()Heinrich Schuchardt2017-12-161-16/+15
| | | | | | | | | | | | If a failure occurs when trying to load an image, it is insufficient to free() the EFI object. We must remove it from the object list, too. Otherwise a use after free will occur the next time we iterate over the object list. Furthermore errors in setting up the image should be handled. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: new function efi_delete_handle()Heinrich Schuchardt2017-12-162-86/+102
| | | | | | | | | | | Provide a function to remove a handle from the object list after removing all protocols. To avoid forward declarations other functions have to move up in the coding. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: return status from efi_setup_loaded_image()Heinrich Schuchardt2017-12-162-7/+12
| | | | | | | | | | efi_setup_loaded_image() should return an error code indicating if an error has occurred. An error occurs if a protocol cannot be installed. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: Ensure efi_dp_find_obj() finds exact matchesAlexander Graf2017-12-161-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling efi_dp_find_obj(), we usually want to find the *exact* match of an object for a given device path. However, I ran into a nasty corner case where I had the following objects with paths available: Handle 0x9feffa70 /HardwareVendor(e61d73b9-a384-4acc-aeab-82e828f3628b)[0: ]/USB(6,0)/EndEntire Handle 0x9feffb58 /HardwareVendor(e61d73b9-a384-4acc-aeab-82e828f3628b)[0: ]/USB(6,0)/HD(1,800,32000,2de808cb00000000,1,1)/EndEntire and was searching for /HardwareVendor(e61d73b9-a384-4acc-aeab-82e828f3628b)[0: ]/USB(6,0)/HD(1,800,32000,2de808cb00000000,1,1)/EndEntire But because our device path search looked for any substring match, it would return /HardwareVendor(e61d73b9-a384-4acc-aeab-82e828f3628b)[0: ]/USB(6,0)/EndEntire because that path is a full substring of the path we were searching for. So this patch adapts the device path search logic to always look for exact matches first. The way we distinguish between those cases is by looking at whether our caller actually deals with remainders. As a side effect, the code as is from all I can tell now never does a substring match anymore, because it always gets called with rem=NULL, so we always only do exact matches now. Reported-by: Jonathan Gray <jsg@jsg.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: helloworld.c: Reduce file sizeAlexander Graf2017-12-161-7/+4
| | | | | | | | | | The efi linker script includes sections needed for the dynamic linker. However, in our EFI application environment we don't have a dynamic linker. So let's remove them. That way we save on 4k padding and reduce the file size of the hello world efi binary from ~4k to ~1k. Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: helloworld.c: Explicitly use .rodata for loaded_image_guidAlexander Graf2017-12-161-1/+2
| | | | | | | | | | | | | | | | | | | | | Commit bbf75dd9345d0b ("efi_loader: output load options in helloworld") introduced a const variable in efi_main() called loaded_image_guid which got populated from a constant struct. While you would usually expect a compiler to realize that this variable should really just be a global pointer to .rodata, gcc disagrees and instead puts it on the stack. Unfortunately in some implementations of gcc it does so my calling memcpy() which we do not implement in our hello world environment. So let's explicitly move it to a global variable which in turn puts it in .rodata reliably and gets rid of the memcpy(). Fixes: bbf75dd9345d0b ("efi_loader: output load options in helloworld") Reported-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Tested-by: Florian Fainelli <f.fainelli@gmail.com>
* Merge git://git.denx.de/u-boot-dmTom Rini2017-12-1461-62/+1638
|\
| * power: pmic/regulator: Add basic support for TPS65910Felix Brack2017-12-127-0/+705
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Texas Instrument's TPS65910 PMIC contains 3 buck DC-DC converts, one boost DC-DC converter and 8 LDOs. This patch implements driver model support for the TPS65910 PMIC and its regulators making the get/set API for regulator value/enable available. This patch depends on the patch "am33xx: Add a function to query MPU voltage in uV" to build correctly. For boards relying on the DT include file tps65910.dtsi the v3 patch "power: extend prefix match to regulator-name property" and an appropriate regulator naming is also required. Signed-off-by: Felix Brack <fb@ltec.ch> Reviewed-by: Simon Glass <sjg@chromium.org>
| * dm: blk: Use uclass_find_first/next_device() in blk_first/next_device()Stefan Roese2017-12-121-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the calls to uclass_first/next_device() in blk_first/ next_device() to use uclass_find_first/next_device() instead. These functions don't prepare the devices, which is correct in this case. With this patch applied, the "usb storage" command now works again as expected: => usb storage Device 0: Vendor: SanDisk Rev: 1.00 Prod: Ultra Type: Removable Hard Disk Capacity: 58656.0 MB = 57.2 GB (120127488 x 512) Without this patch, it used to generate this buggy output: => usb storage Card did not respond to voltage select! mmc_init: -95, time 26 No storage devices, perhaps not 'usb start'ed..? Signed-off-by: Stefan Roese <sr@denx.de> Suggested-by: Simon Glass <sjg@chromium.org> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * power: extend prefix match to regulator-name propertyFelix Brack2017-12-125-5/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch extends pmic_bind_children prefix matching. In addition to the node name the property regulator-name is used while trying to match prefixes. This allows assigning different drivers to regulator nodes named regulator@1 and regulator@10 for example. I have discarded the idea of using other properties then regulator-name as I do not see any benefit in using property compatible or even regulator-compatible. Of course I am open to change this if there are good reasons to do so. Signed-off-by: Felix Brack <fb@ltec.ch> Reviewed-by: Simon Glass <sjg@chromium.org>
| * dm: reset: have the reset-command perform a COLD resetPhilipp Tomsich2017-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The DM version of do_reset has been issuing a warm-reset, which (on some platforms keeps GPIOs and other parts of the platform active). This may cause unintended behaviour, as calling do_reset usually indicates a desire to reset the board/platform and not just the CPU. This changes do_reset to always request a COLD reset. Note that programmatic uses can still invoke a WARM reset through reset_cpu() or using sysreset_walk(). Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * binman: tegra: Convert to use binmanSimon Glass2017-12-129-8/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update tegra to use binman for image creation. This still includes the current Makefile logic, but a later patch will remove this. Three output files are created, all of which combine SPL and U-Boot: u-boot-tegra.bin - standard image u-boot-dtb-tegra.bin - same as u-boot-tegra.bin u-boot-nodtb-target.bin - includes U-Boot without the appended device tree The latter is useful for build systems where the device is appended later, perhaps after being modified. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Add documentation for the symbol featureSimon Glass2017-12-121-1/+31
| | | | | | | | | | | | | | Add this feature to the README. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Lukasz Majewski <lukma@denx.de>
| * binman: Add binman support to spl_ram.cSimon Glass2017-12-121-4/+15
| | | | | | | | | | | | | | | | SPL supports reading U-Boot from a RAM location. At present this is hard-coded to the U-Boot text base address. Use binman to allow this to come from the image file, if binman is used. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Add binman symbol support to SPLSimon Glass2017-12-123-2/+38
| | | | | | | | | | | | | | | | Allow SPL to access binman symbols and use this to get the address of U-Boot. This falls back to CONFIG_SYS_TEXT_BASE if the binman symbol is not available. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: arm: Include the binman symbol tableSimon Glass2017-12-122-2/+11
| | | | | | | | | | | | | | | | | | This area of the image contains symbols whose values are filled in by binman. If this feature is not used, the table is empty. Add this to the ARM SPL link script. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Support accessing binman tables at run timeSimon Glass2017-12-1211-10/+403
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Binman construct images consisting of multiple binary files. These files sometimes need to know (at run timme) where their peers are located. For example, SPL may want to know where U-Boot is located in the image, so that it can jump to U-Boot correctly on boot. In general the positions where the binaries end up after binman has finished packing them cannot be known at compile time. One reason for this is that binman does not know the size of the binaries until everything is compiled, linked and converted to binaries with objcopy. To make this work, we add a feature to binman which checks each binary for symbol names starting with '_binman'. These are then decoded to figure out which entry and property they refer to. Then binman writes the value of this symbol into the appropriate binary. With this, the symbol will have the correct value at run time. Macros are used to make this easier to use. As an example, this declares a symbol that will access the 'u-boot-spl' entry to find the 'pos' value (i.e. the position of SPL in the image): binman_sym_declare(unsigned long, u_boot_spl, pos); This converts to a symbol called '_binman_u_boot_spl_prop_pos' in any binary that includes it. Binman then updates the value in that binary, ensuring that it can be accessed at runtime with: ulong u_boot_pos = binman_sym(ulong, u_boot_spl, pos); This assigns the variable u_boot_pos to the position of SPL in the image. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Support enabling debug in testsSimon Glass2017-12-124-6/+23
| | | | | | | | | | | | | | | | The elf module can provide some debugging information to assist with figuring out what is going wrong. This is also useful in tests. Update the -D option so that it is passed through to tests as well. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Adjust size of test SPL binarySimon Glass2017-12-125-14/+14
| | | | | | | | | | | | | | | | | | | | This is only 3 bytes long which is not enough to hold two symbol values, needed to test the binman symbols feature. Increase it to 15 bytes. Using very small regions is useful since we can easily compare them in tests and errors are fairly easy to diagnose. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Add tests binaries with binman symbolsSimon Glass2017-12-129-1/+103
| | | | | | | | | | | | | | | | | | | | | | For testing we need to build some ELF files containing binman symbols. Add these to the Makefile and check in the binaries: u_boot_binman_syms - normal, valid ELF file u_boot_binman_syms_bad - missing the __image_copy_start symbol u_boot_binman_syms_size - has a binman symbol with an invalid size Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Drop a stale comment about the 'board' featureSimon Glass2017-12-121-1/+0
| | | | | | | | | | | | This feature is now supported. Drop the incorrect comment. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Add support for including spl/u-boot-spl-nodtb.binSimon Glass2017-12-123-0/+33
| | | | | | | | | | | | | | This file contains SPL image without a device tree. Add support for including this in images. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Add support for including spl/u-boot-spl.dtbSimon Glass2017-12-123-0/+37
| | | | | | | | | | | | | | This file contains the SPL device tree. Add support for including this by itself in images. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Add a function to read ELF symbolsSimon Glass2017-12-128-11/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | In some cases we need to read symbols from U-Boot. At present we have a a few cases which does this via 'nm' and 'grep'. It is better to use objdump since that tells us the size of the symbols and also whether it is weak or not. Add a new module which reads ELF information from files. Update existing uses of 'nm' to use this module. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Merge branch 'master' of git://git.denx.de/u-boot-socfpgaTom Rini2017-12-131-2/+0
|\ \
| * | ARM: socfpga: remove unneeded CONFIG_SYS_NAND_USE_FLASH_BBTMasahiro Yamada2017-12-091-1/+0
| | | | | | | | | | | | | | | | | | Neither denali.c nor denali_spl.c references this option. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
| * | ARM: socfpga: remove unused CONFIG_NAND_DENALI_ECC_SIZEMasahiro Yamada2017-12-091-1/+0
| | | | | | | | | | | | | | | | | | This option is no longer used. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* | | Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini2017-12-131-8/+5
|\ \ \
| * | | usb: r8a66597: convert wait loop to readw_poll_timeoutChris Brandt2017-12-091-8/+5
| |/ / | | | | | | | | | | | | | | | It is better to use an existing wait loop implementation. Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
* | | Merge branch 'rmobile-mx' of git://git.denx.de/u-boot-shTom Rini2017-12-1337-9/+6494
|\ \ \
| * | | ARM: rmobile: Add R8A77995 D3 Draak boardMarek Vasut2017-12-099-1/+403
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add bits to support yet another board, the R8A77995 D3 Draak. The DT file is from Linux 4.15-rc1 , commit b35334447513c14a4dd55a67c269a743d4a4824b . Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
| * | | ARM: rmobile: Add R8A77970 V3M Eagle boardMarek Vasut2017-12-099-1/+320
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add bits to support yet another board, the R8A77970 V3M Eagle. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
| * | | net: ravb: Add R8A77995 D3 compatibleMarek Vasut2017-12-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new compatible to the Ethernet AVB driver for R8A77995 D3 SoC. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
| * | | net: ravb: Add R8A77970 V3M compatibleMarek Vasut2017-12-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new compatible to the Ethernet AVB driver for R8A77970 V3M SoC. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
| * | | mmc: uniphier-sd: Add R8A77995 D3 compatibleMarek Vasut2017-12-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new compatible to the Uniphier SD driver for R8A77995 D3 SoC. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
| * | | mmc: uniphier-sd: Add R8A77970 V3M compatibleMarek Vasut2017-12-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new compatible to the Uniphier SD driver for R8A77970 V3M SoC. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
| * | | gpio: rmobile: Add generic Gen3 compatibleMarek Vasut2017-12-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add generic compatible to the GPIO driver for Gen3 SoCs. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
| * | | gpio: rmobile: Add R8A77995 D3 compatibleMarek Vasut2017-12-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new compatible to the GPIO driver for R8A77995 D3 SoC. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
| * | | gpio: rmobile: Add R8A77970 V3M compatibleMarek Vasut2017-12-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new compatible to the GPIO driver for R8A77970 V3M SoC. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
| * | | pinctrl: rmobile: Add R8A77995 D3 PFC tablesMarek Vasut2017-12-095-0/+1837
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add PFC tables for R8A77995 D3 SoC. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
| * | | pinctrl: rmobile: Add R8A77970 V3M PFC tablesMarek Vasut2017-12-095-0/+2620
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add PFC tables for R8A77970 V3M SoC. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
| * | | clk: rmobile: Add R8A77995 D3 clock tablesMarek Vasut2017-12-091-3/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add clock tables for R8A77995 D3 SoC. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
| * | | clk: rmobile: Add R8A77970 V3M clock tablesMarek Vasut2017-12-092-4/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add clock tables for R8A77970 V3M SoC. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
| * | | ARM: rmobile: Add R8A77995 SoCMarek Vasut2017-12-097-0/+518
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add bits to support yet another SoC, the R8A77995 D3 . Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
| * | | ARM: rmobile: Add R8A77970 SoCMarek Vasut2017-12-098-0/+504
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add bits to support yet another SoC, the R8A77970 V3M . Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
| * | | clk: rmobile: Fix typo in R8A7796 RPC clock table entryMarek Vasut2017-12-091-1/+1
| |/ / | | | | | | | | | | | | | | | | | | Fix a copy-paste typo in the clock table entry, s/7795/7796/. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* | | Merge git://git.denx.de/u-boot-samsungTom Rini2017-12-1310-557/+583
|\ \ \
| * | | ARM: Samsung: Add Exynos5422-based Odroid HC1 supportMarek Szyprowski2017-12-054-10/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Odroid HC1 board is based on Odroid XU4 board, but it has no HDMI, no eMMC, no build-in USB3.0 hub, no extension port pins, and no GPIO button. USB3.0 ports are used for build-in JMicron USB to SATA bridge and Gigabit R8152 ethernet chips. HC1 uses only passive cooling. This patch also updates Odroid's ADCmax array and reduces ADC tolerance to 1% to ensure that XU4 and HC1 revisions are properly detected. I've tested this with XU3, XU3-lite, XU4 and HC1 boards. In case of my test boards I got following values from ADC register: 372, 370, 1281 and 1313. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Lukasz Majewski <lukma@denx.de> Tested-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * | | arm: dts: exynos4: fix the device-tree compile warningJaehoon Chung2017-12-056-547/+558
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After updating dtc-1.4.5 version, there are too many warning. This patch is to fix about exynos4 series. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>