summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-08-21uclass: Add dev_get_uclass_index() to get the uclass/index of a deviceJean-Jacques Hiblot
This function is the reciprocal of uclass_find_device(). It will be used to print the index information in dm tree dump. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-08-21net: eth-uclass: Fix for DM USB ethernet supportJean-Jacques Hiblot
When a USB ethernet device is halted, the device driver is removed. When this happens the uclass private memory is freed and uclass_priv is set to NULL. This causes a data abort when uclass_priv->state is then set to ETH_STATE_PASSIVE. Fix it by checking if uclass_priv is NULL before setting uclass_priv->state Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2018-08-21usb: gadget: Add bcdDevice for the DWC3 USB Gadget ControllerJean-Jacques Hiblot
Add an entry in usb_gadget_controller_number() for the DWC3 gadget controller. Without it, it is not possible to bind the USB Ethernet driver. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-08-21usb: musb-new: omap2430: Enable DM_USB and OF supportAdam Ford
With upcoming changes that require CONFIG_BLK, this broke USB Mass Storage on the OMAP3 boards because if CONFIG_BLK is enabled, it assumes that DM_USB is enabled, but it wasn't yet available on omap3 and omap4 boards. This patch converts the OMAP2430 MUSB glue to support DM_USB and extracts the necessary information based on the device tree. It's based on the ti-musb driver, but there are enough significant differences in both the architecture and device tree entires between am33xx and OMAP3/OMAP4, that I think it makes sense to continue to keep the separate. Per doc/driver-model/usb-info.txt, the USB gadget stuff hasn't migrated to DM_USB yet, so this only supports USB Host for now. Users wanting USB Gadgets will need to disable DM_USB and leave it the old way for now. Signed-off-by: Adam Ford <aford173@gmail.com>
2018-08-21usb: musb-new: omap2430: Remove dead codeAdam Ford
A bunch of code was encapsulated in #ifdef's whether or not it is building or for U-Boot. Since this code is always building for U-Boot, this patch removes the dead code. Signed-off-by: Adam Ford <aford173@gmail.com>
2018-08-21cmd: fastboot: Validate user inputSam Protsenko
In case when user provides '-' as USB controller index, like this: => fastboot - data abort occurs in strcmp() function in do_fastboot(), here: if (!strcmp(argv[1], "udp")) (tested on BeagleBone Black). That's because argv[1] is NULL when user types in the '-', and null pointer dereference occurs in strcmp() (which is ok according to C standard specification). So we must validate user input to prevent such behavior. While at it, check also the result of strtoul() function and handle error cases properly. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2018-08-21cmd: efi: Clarify calculation precedence for '&' and '?'Eugeniu Rosca
Fix cppcheck complaint: [cmd/efi.c:173]: (style) Clarify calculation precedence for '&' and '?'. Fixes: f1a0bafb5802 ("efi: Add a command to display the memory map") Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-08-21efi: Add EFI_MEMORY_{NV, MORE_RELIABLE, RO} attributesEugeniu Rosca
With this update, the memory attributes are in sync with Linux kernel v4.18-rc4. They also match page 190 of UEFI 2.7 spec [1]. [1] http://www.uefi.org/sites/default/files/resources/UEFI_Spec_2_7.pdf Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-08-21efi: Fix truncation of constant valueEugeniu Rosca
Starting with commit 867a6ac86dd8 ("efi: Add start-up library code"), sparse constantly complains about truncated constant value in efi.h: include/efi.h:176:35: warning: cast truncates bits from constant value (8000000000000000 becomes 0) This can get quite noisy, preventing real issues to be noticed: $ make defconfig *** Default configuration is based on 'sandbox_defconfig' $ make C=2 -j12 2>&1 | grep truncates | wc -l 441 After the patch is applied: $ make C=2 -j12 2>&1 | grep truncates | wc -l 0 $ sparse --version v0.5.2 Following the suggestion of Heinrich Schuchardt, instead of only fixing the root-cause, I replaced the whole enum of _SHIFT values by ULL defines. This matches both the UEFI 2.7 spec and the Linux kernel implementation. Some ELF size comparison before and after the patch (gcc 7.3.0): efi-x86_payload64_defconfig: text data bss dec hex filename 407174 29432 278676 715282 aea12 u-boot.old 407152 29464 278676 715292 aea1c u-boot.new -22 +32 0 +10 efi-x86_payload32_defconfig: text data bss dec hex filename 447075 30308 280076 757459 b8ed3 u-boot.old 447053 30340 280076 757469 b8edd u-boot.new -22 +32 0 +10 Fixes: 867a6ac86dd8 ("efi: Add start-up library code") Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-08-21efi_loader: EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset()Heinrich Schuchardt
Implement the reset service of the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL. This should resolve the error reported by the SCT in Protocol/SimpleTextOut/BlackBoxTest/SimpleTextOutBBTestFunction_uefi.c:639 Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-08-20Merge branch 'master' of git://git.denx.de/u-boot-sunxiTom Rini
2018-08-20Merge git://git.denx.de/u-boot-x86Tom Rini
2018-08-20display5: Introduce fitImg_fw_sz variableLukasz Majewski
This cosmetic change allow easy adjustment of the to-load kernel size if needed. Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Lukasz Majewski <lukma@denx.de>
2018-08-20efi_selftest: correct block device unit testHeinrich Schuchardt
The UEFI specification mandates that the create flag is only used in conjunction with both the read and the write flag. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-08-20efi_loader: document runtime functionsHeinrich Schuchardt
Add comments for runtime service functions. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-08-20efi_loader: update runtime services table crc32Heinrich Schuchardt
The crc32 of the runtime services table must be updated after detaching. efi_update_table_header_crc32() must be __efi_runtime. So move it to efi_runtime.c Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-08-20lib: crc32: mark function crc32() as __efi_runtimeHeinrich Schuchardt
The function crc32() is needed by the EFI subsystem at runtime. So it has to be linked into the runtime section together with all dependencies. Eliminate empty defines local and ZEXPORT. Mark variables as static which are not exported. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-08-20efi_loader: avoid NULL dereference in efi_get_memory_map()Heinrich Schuchardt
We should only dereference parameter memory_map_size after checking that it is valid. Fixes: 8e835554b36b ("efi_loader: check parameters of GetMemoryMap") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-08-20board: sunxi: Remove unused local variablesJagan Teki
variables buf from board_mmc_init, and ret from misc_init_r were unused on the functions, so remove it. Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2018-08-20efi_loader: fix a parameter check at CreateEvent()AKASHI Takahiro
The commit 21b3edfc9644 ("efi_loader: check parameters of CreateEvent") enforces a strict parameter check at CreateEvent(). On the other hand, UEFI specification version 2.7, section 7.1, says: The EVT_NOTIFY_WAIT and EVT_NOTIFY_SIGNAL flags are exclusive. If neither flag is specified, the caller does not require any notification concerning the event and the NotifyTpl, NotifyFunction, and NotifyContext parameters are ignored. So the check should be mitigated so as to comply with the specification. Without this patch, EDK2's Shell.efi won't be started. Fixes: 21b3edfc9644 ("efi_loader: check parameters of CreateEvent") Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-08-20riscv: Include bss subsections in linker scriptAlexander Graf
When we build with -fdata-sections we may end up with bss subsections. Our linker script explicitly lists only a single consecutive bss section though. Adapt the statement to also include subsections. Signed-off-by: Alexander Graf <agraf@suse.de>
2018-08-20x86: Enable -fdata-sections alwaysAlexander Graf
We left -fdata-sections disabled for x86_64 before because we encountered random bugs that were at that time inexplicable. Turns out this really was just side effects of missing .bss* statements in the linker scripts. With those fixed, we can enable data sections for all targets. Signed-off-by: Alexander Graf <agraf@suse.de>
2018-08-20x86: Include bss subsections in linker scriptAlexander Graf
When we build with -fdata-sections we may end up with bss subsections. Our linker script explicitly lists only a single consecutive bss section though. Adapt the statement to also include subsections. This fixes booting efi-x86_app_defconfig. Signed-off-by: Alexander Graf <agraf@suse.de>
2018-08-20sunxi: fix sid base address macro name for H6Icenowy Zheng
In the current H6 CPU memory space code, the SUNXI in the macro name of the SID address base is wrongly spelled as SNUXI, which leads to SID readout not working. Fix this macro name. Fixes: 55f6b1c351c9 ("sunxi: add basic memory map definitions of H6 SoC") Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2018-08-20configs: sun7i: Fix to use emmc dts for OLinuXino_MICRO-eMMCJagan Teki
A20 OLinuXino Micro eMMC board has emmc with mmc2 slot so use proper dts, sun7i-a20-olinuxino-micro-emmc.dts Cc: Stefan Mavrodiev <stefan@olimex.com> Cc: Hans de Goede <hdegoede@redhat.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2018-08-20doc: FIT image: fix typoPierre-Jean Texier
Fix typo in beaglebone verified boot documentation. Signed-off-by: Pierre-Jean Texier <texier.pj2@gmail.com>
2018-08-20cmd: Add dtimg commandSam Protsenko
dtimg command allows user to work with Android DTB/DTBO image format. Such as, getting the address of desired DTB/DTBO file, printing the dump of the image in U-Boot shell, etc. This command is needed to provide Android boot with new Android DT image format further. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-08-20common: Add support for Android DT imageSam Protsenko
Android documentation recommends new image format for storing DTB/DTBO files: [1]. To support that format, this patch adds helper functions for Android DTB/DTBO format. In image-android-dt.* files you can find helper functions to work with Android DT image format, such us routines for: - printing the dump of image structure - getting the address and size of desired dtb/dtbo file This patch uses dt_table.h file, that was added in commit 643cefa4d848 ("Import Android's dt_table.h for DT image format") by Alex Deymo. [1] https://source.android.com/devices/architecture/dto/partitions Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-08-20fs/fat: debug-print file read position during file_fat_read_at()Andreas Dannenberg
In order to make the debug print in file_fat_read_at() a tad more useful, show the offset the file is being read at alongside the filename. Suggested-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Andreas Dannenberg <dannenberg@ti.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2018-08-20spl: fix debug print in spl_common_init()Simon Goldschmidt
spl_common_init() debug-prints "spl_early_init()\n" but it is called both from spl_early_init() and spl_init(). Fix this by moving the debug() statement to the calling functions which now print their name. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-08-20ARM: da8xxevm: README: Add NOR booting instructionsAdam Ford
The da850evm with its UI expander board can boot XIP boot from NOR flash. This adds the instructions to the readme. file. Signed-off-by: Adam Ford <aford173@gmail.com>
2018-08-20ARM: da850evm: Enable SPL_SYS_MALLOC_SIMPLEAdam Ford
The SPL space is limited. In order to try to enable DM in SPL, we need more space. When combined wtih TINY_PRINTF, this reduces the size of SPL by 6.5k Original: text data bss dec hex filename 20760 1216 80 22056 5628 spl/u-boot-spl Tiny Printf text data bss dec hex filename 17947 1216 80 19243 4b2b spl/u-boot-spl Malloc Simple + Tiny Printf text data bss dec hex filename 15187 176 28 15391 3c1f spl/u-boot-spl Signed-off-by: Adam Ford <aford173@gmail.com>
2018-08-20ARM: da850evm: Enable USE_TINY_PRINTFAdam Ford
The SPL space is limited. In order to try to enable DM in SPL, we need more space. This reduces the size of SPL by ~2.7K before: text data bss dec hex filename 20760 1216 80 22056 5628 spl/u-boot-spl after: text data bss dec hex filename 17947 1216 80 19243 4b2b spl/u-boot-spl Signed-off-by: Adam Ford <aford173@gmail.com>
2018-08-20configs: da850evm: Remove DM_I2C_COMPATAdam Ford
Since using DM_I2C_COMPAT throws a warning during compilation, and it isn't really needed any longer, so this patch removes this feature and shrinks the code a bit. from: text data bss dec hex filename 343326 13388 123448 480162 753a2 u-boot to: text data bss dec hex filename 342924 13380 123440 479744 75200 u-boot Signed-off-by: Adam Ford <aford173@gmail.com>
2018-08-20efi_loader: relocate pointer to tablesHeinrich Schuchardt
When applying a virtual memory map we have to update the pointer to the list of configuration tables. Fixes: 4182a129ef73 ("efi_loader: allocate configuration table array") Reported-by: Mark Kettenis <mark.kettenis@xs4all.nl> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Tested-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-08-20Revert "efi_loader: efi_allocate_pages is too restrictive"Stephen Warren
This reverts commit aa909462d01866354f4cd4534db5f571c2cf1fbb. This change caused "dhcp filename" to crash the system on p2371-2180 (Jetson TX1), for example when running test/py. Reverting this change isn't optimal, but at least restores TX1 to a working state. In the future, we should: a) Fix whatever problem causes the crash with this patch applied. This needs further discussion, so isn't something we can immediately do. b) Undo the revert; re-apply the original patch to efi_allocate_pages. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-08-20sandbox: Move BSS after EFI sectionsAlexander Graf
Something went wrong when writing the sandbox linker scripts and so we ended up with a .bss section marker right before the efi runtime sections. That obviously is a terrible idea, as it may result in overwriting efi runtime code and data. So let's move the .bss identifier behind the efi sections. Signed-off-by: Alexander Graf <agraf@suse.de>
2018-08-20x86: efi: payload: Add default TSC frequency in the device treeBin Meng
It was observed sometimes U-Boot as the EFI payload fails to boot on QEMU. This is because TSC calibration fails with no valid frequency. This adds default TSC frequency in the device tree. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-20x86: coreboot: Add default TSC frequency in the device treeBin Meng
It was observed sometimes U-Boot as the coreboot payload fails to boot on QEMU. This is because TSC calibration fails with no valid frequency. This adds default TSC frequency in the device tree. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2018-08-20x86: tsc: Try hardware calibration firstBin Meng
At present if TSC frequency is provided in the device tree, it takes precedence over hardware calibration result. This swaps the order to try hardware calibration first and uses device tree as last resort. This can be helpful when a generic dts (eg: coreboot/efi payload) is supposed to work on as many hardware as possible, including emulators like QEMU where TSC hardware calibration sometimes fails. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2018-08-20x86: dts: Remove coreboot_fb.dtsiBin Meng
There is no need to keep a separate coreboot_fb.dtsi since now we have a generic coreboot payload dts. While we are here, this also remove the out-of-date description in the documentation regarding to coreboot framebuffer driver with U-Boot loaded as a payload from coreboot. As the testing result with QEMU 2.5.0 shows, the driver just works like a charm. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-20x86: Remove support for Advantech SOM-6896Bin Meng
Now that we have generic coreboot payload support, remove the dedicated support for Advantech SOM-6896. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2018-08-20x86: coreboot: Add generic coreboot payload supportBin Meng
Currently building U-Boot as the coreboot payload requires user to change the build configuration for a specific board during menuconfig process. This uses the board's native device tree to configure the hardware. For example, the device tree provides PCI address range for the PCI host controller and U-Boot will re-program all PCI devices' BAR to be within this range. In order to make sure we don't mess up the hardware, we should guarantee the range matches what coreboot programs the chipset. But we really should make the coreboot payload support easier. Just like EFI payload, we can create a generic coreboot payload for all x86 boards as well. The payload is configured to include as many generic drivers as possible. All stuff that touches low level initialization are not allowed as such is the coreboot's responsibility. Platform specific drivers (like gpio, spi, etc) are not included. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2018-08-20Makefile: Don't generate position independent codeAndy Shevchenko
Since gcc-8 the --enable-default-pie starts producing code which assembler can't translate in case of U-Boot. The build fails with {standard input}: Assembler messages: {standard input}:21100: Error: junk at end of line, first unrecognized character is `@' {standard input}:21120: Error: junk at end of line, first unrecognized character is `@' and so on. This is usually the case for x86 platform because in many cases it uses host compiler from the Linux distributions, where PIE is enabled by default. Previously (gcc-7 and earlier) that was a potential issue due to absence of constructions like .long end.5561@gotoff-start.5558@gotoff which are a cause of above error messages in gcc-8. Fix all these by disabling PIE on Makefile level. Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Suggested-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2018-08-19drivers: regulator: fixed: add u-boot, off-on-delay-usPeng Fan
Add u-boot,off-on-delay-us for fixed regulator. Depends on board design, the gpio regulator sometimes connects with a big capacitance. When need to off, then on the regulator, if there is no enough delay, the voltage does not drop to 0, so introduce this property to handle such case. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-08-19env: Merge Rockchip, Sunxi, Zynq and ZynqMPMichal Simek
There is no reason to have the same Kconfig options for different SoCs separately. The patch is merging them together. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> [trini: Fix ENV_SIZE around ENV_IS_NOWHERE] Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2018-08-17Convert CONFIG_SYS_I2C_DAVINCI to KconfigAdam Ford
This converts the following to Kconfig: CONFIG_SYS_I2C_DAVINCI Signed-off-by: Adam Ford <aford173@gmail.com>
2018-08-17Removed unused references to CONFIG_SERIALxAdam Ford
After creating CONS_INDEX and migrating a bunch of boards to it, there are a bunch of defined references to CONFIG_SERIALx which are not referenced in any C code or #ifdef, so they can now be removed Signed-off-by: Adam Ford <aford173@gmail.com>
2018-08-17Convert CONFIG_TWL4030_LED et al to KconfigAdam Ford
This converts the following to Kconfig: CONFIG_TWL4030_LED CONFIG_TWL4030_INPUT This also removes dead references to: CONFIG_TWL4030_KEYPAD Signed-off-by: Adam Ford <aford173@gmail.com>
2018-08-17Convert CONFIG_VIDEO_OMAP3 to KconfigAdam Ford
This converts the following to Kconfig: CONFIG_VIDEO_OMAP3 Signed-off-by: Adam Ford <aford173@gmail.com>