Commit Graph

55334 Commits

Author SHA1 Message Date
Adam Ford
ed59a76db0 ARM: DTS: omap3-u-boot.dtsi
Create generic omap3-u-boot.dtsi file that omap3 based boards
can include to generate device tree in SPL for booting MLO.

Credit should go to Tom Rini.

Signed-off-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
2019-02-19 16:58:23 -05:00
Adam Ford
57ade0792c ARM: da8xxevm: Add NAND instructions for da850-evm to README
The README.da850 file continues information on how to burn NAND
for the LCDK, but not the DA850-EVM.  This patch adds both the
commands and dip switch instructions for burning and booting
NAND.

Signed-off-by: Adam Ford <aford173@gmail.com>
2019-02-19 08:55:43 -05:00
Adam Ford
1c6b6f383a ARM: am3517_evm: Enable Falcon Mode
The other OMAP3 based Logic PD boards have Falcon Mode enabled,
so this patch makes it possible on the AM3517-evm as well.

Signed-off-by: Adam Ford <aford173@gmail.com>
2019-02-19 08:55:43 -05:00
Adam Ford
591353d011 ARM: da850evm: Increase Malloc Size
The SPI NOR frameware was recently updated, but they require a little
more memory that we had previosly allocated, so it stopped booting.
This patch doubles the size of CONFIG_SPL_SYS_MALLOC_F_LEN to 0x800.

Fixes: c4e8862308 ("mtd: spi: Switch to new SPI NOR framework")

Signed-off-by: Adam Ford <aford173@gmail.com>
2019-02-19 08:55:43 -05:00
Manivannan Sadhasivam
362d00dfff hikey: Allow environment to store in eMMC and increase bootdelay
Current Hikey configuration allows us to store u-boot environment on uSD
card. But this will be useless if uSD card is not inserted, hence use
the onboard eMMC memory for storing environment at Boot1 partition.
While we are at it, let's increase the boot delay to 10s also.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2019-02-19 08:55:43 -05:00
Igor Opaniuk
7374b15522 test: let use gdbserver for all sandbox targets
Enable usage of gdbserver for all sandbox targets (sandbox,
sandbox_flattree etc.).

Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2019-02-19 08:55:43 -05:00
Philippe Reynes
4ebcb16b51 bcm963158: use TARGET_BCM963158 instead of ARCH_BCM63158
We use TARGET_BCM63158 in the Kconfig instead of ARCH_BCM63158,
so we could add other board that use a bcm63158.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2019-02-19 08:55:43 -05:00
Michal Simek
1e7883f632 dtbo: Fix dtbo generation rules
Take the first prerequisite (dts overlay file) instead of standard
input.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2019-02-19 08:55:43 -05:00
Tien Fong Chee
e48485f5e4 fs: fat: Reduce default max clustersize 64KiB from malloc pool
Release cluster block immediately when no longer use would help to reduce
64KiB memory allocated to the memory pool.

Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
2019-02-19 08:55:43 -05:00
Tien Fong Chee
8537874a65 fs: fat: dynamically allocate memory for temporary buffer
Drop the statically allocated get_contents_vfatname_block and
dynamically allocate a buffer only if required. This saves
64KiB of memory.

Signed-off-by: Stefan Agner <stefan.ag...@toradex.com>
Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
2019-02-19 08:55:43 -05:00
Simon Goldschmidt
dae5c2dcdc spl: implement CRC check on U-Boot uImage
SPL currently does not check uImage CRCs when loading U-Boot.

This patch adds checking the uImage CRC when SPL loads U-Boot. It does
this by reusing the existing config option SPL_CRC32_SUPPORT to allow
leaving out the CRC check on boards where the additional code size or
boot time is a problem (adding the CRC check currently adds ~1.4 kByte
to flash).

The SPL_CRC32_SUPPORT config option now gets enabled by default if SPL
support for legacy images is enabled to check the CRC on all boards
that don't actively take countermeasures.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2019-02-19 08:55:43 -05:00
Bin Liu
8502fe84a4 configs: am57xx_evm: define CONFIG_SPL_LOAD_FIT_ADDRESS for SPL-DFU
Define CONFIG_SPL_LOAD_FIT_ADDRESS to enable SPL-DFU for am57x platform.

Signed-off-by: Bin Liu <b-liu@ti.com>
2019-02-19 08:55:43 -05:00
Roman Kapl
44ac80e7e9 cmd: date: Do not overwrite arguments
Arguments are const and belong to the caller. Calling date in a hush
loop will yield different results from the second invocation.

Signed-off-by: Roman Kapl <rka@sysgo.com>
2019-02-19 08:55:43 -05:00
Kurban Mallachiev
957f51e863 elf: fix cache flushing in 'bootelf -p' command
Currently there are two problems in 'bootelf -p' (load elf by segments)
command:
- bss section is not flushed, so booted elf can have non zero values
  in bss;
- at least on ARM there are 'CACHE: Misaligned operation at
  range...' warnings

Use p_memsz instead of p_filesz during cache flushing for elf segment.
p_filesz doesn't include zero initialized memory (e.g. bss section),
which also should be flushed.

Align these cache flushes to line boundaries.

Signed-off-by: Kurban Mallachiev <mallachiev@ispras.ru>
2019-02-19 08:55:43 -05:00
Hannes Schmelzer
eaba7df704 board/BuR/brxre1: convert do DM
This commit converts the brxre1 board to DM,
for this we have todo following things:

- add a devicetree-file for this board
- drop all obsolete settings from board header-file
- use dm_i2c_xxx calls for read/write to the resetcontroller
- request gpios before operate them

Serues-cc: trini@konsulko.com
Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
2019-02-19 08:55:43 -05:00
Heinrich Schuchardt
90037d4c73 dm: scsi: report correct device number
Before the patch scsi would report the same device number for all SCSI
devices, e.g.

  Device 0: (1:0) Vendor: ATA Prod.: Crucial_CT128M55 Rev: MU01
            Type: Hard Disk
            Capacity: 122104.3 MB = 119.2 GB (250069680 x 512)
  Device 0: (1:0) Vendor: ATA Prod.:  Rev:
            Type: Hard Disk
            Capacity: not available

With the patch the same device number is reported as is used in
scsi_read():

  Device 0: (1:0) Vendor: ATA Prod.: Crucial_CT128M55 Rev: MU01
            Type: Hard Disk
            Capacity: 122104.3 MB = 119.2 GB (250069680 x 512)
  Device 1: (1:0) Vendor: ATA Prod.:  Rev:
            Type: Hard Disk
            Capacity: not available

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-19 08:55:43 -05:00
Heinrich Schuchardt
c7cd4afb92 tpm: simplify: tpm_set_global_lock()
When in pack_byte_string() memcpy() is called for size 0 the source buffer
address has no relevance. So we can use NULL here.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2019-02-19 08:55:43 -05:00
Tom Rini
b78a9e2212 Merge branch 'master' of git://git.denx.de/u-boot-socfpga
- Misc Gen5 fixes
- stratix10 bugfix
- dwmmc bugfix
2019-02-18 22:12:59 -05:00
Tom Rini
f14de0014c Prepare v2019.04-rc2
Signed-off-by: Tom Rini <trini@konsulko.com>
2019-02-18 21:36:39 -05:00
Jean-Jacques Hiblot
3c5aa6cacc configs: Enable CONFIG_BLK in am57xx_evm and am57xx_hs_evm
Enable CONFIG_DM_SCSI and CONFIG_BLK.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
2019-02-18 15:53:09 -05:00
Jean-Jacques Hiblot
fb2cedb262 configs: k2g_evm: Enable CONFIG_BLK
CONFIG_BLK can be safely enabled as DM_MMC and DM_USB are already enabled.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Vignesh R <vigneshr@ti.com>
2019-02-18 15:53:09 -05:00
Alexander Graf
7590f907da efi_loader: Swap roles with Heinrich
Heinrich is going to take over maintainership of the efi_loader tree
going forward.

To ensure that I will still receive review mails at least, add me as
reviewer with a stable email address.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
2019-02-18 15:53:09 -05:00
Alexander Graf
3157bbfa18 rpi: Make Matthias maintainer
Matthias Brugger agreed to take over maintainership from me for the
Raspberry Pi tree. Add him to the MAINTAINERS file instead.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
2019-02-18 15:53:09 -05:00
Hannes Schmelzer
d3a78cb7ea board/BuR/brppt1: fix ethernet support on brppt1 boards
The commit 1bac199e8c ("configs: Resync with savedefconfig")
did remove ethernet driver from following boards defconfig:

- brppt1_mmc
- brppt1_nand
- brppt1_spi

With this commit we add ethernet and responsible phy support again.

Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
2019-02-18 15:53:09 -05:00
Tom Rini
beff8e34b2 Pull request for EFI sub-system in U-Boot v2019.04-rc2
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAlxq+mUACgkQxIHbvCwF
 GsRxKQ/+NXcGaWEzxgIWj1HMVQsbf4lM+gXva2K60Ar/e10up2I8ARrnAnje//fi
 YSg98vdNS1HPoJ1H1oaC54NJgsiYyH1kdb0uxwGXrEAagB/6EWIWVuPaKTSAjXPa
 8pb+I4xdZCPxIYtzczaSCeqjFoSwMovLxbQnkLWIjqrYoI4Skx1970/UoGt4EBlJ
 LI9RecTODPPmQQvC44y9Ao3fh6/qldJsJfNLMlQbr9+1OYfr1xBTLn2ry/LITzTm
 w+1OArjoRHyehEup/mx9eAXbX2b2ljp9x1J/Hazwn5CjHFP86Q9JYdisU42rJZHb
 1m6uZZNxME2GdAQTI3YcmME0w1fIUMaTL3oNoOfKDLkYaj5QQOcLLAYY5+j8x1F+
 hPhSutyIZ7DBT/oIODte+BboARkTRvGYgv842Sq3HtTMfL7uXdowABQ/XkdzuAYb
 d/NxMQxSti+Xk5mzmIcRJULBAZPs/SFNQjsTNmh64+rTDIYNzNRgj8XiQp4UkNVK
 7+9CQ8R6qS6MF/KBF6FqGrVQ7cprrdFpvgejEL5qwhcQeTtJWsUi+oe1zRj4l7ip
 JRs22/HjTiytxe5wqPyoxQav+tKjj87jRfFqRuxqG1kfzRzcEhjbZhHrduC1jae4
 Gtg+tEjhi0fu1l3p3Jrtx79mhy9kU6YKZ8ZGfu1qWbT6RTromdI=
 =BbQI
 -----END PGP SIGNATURE-----

Merge tag 'efi-2019-04-rc2' of https://github.com/xypron2/u-boot

The patches fix multiple errors. Mentionable are:
- EFI unit tests (bootefi selftest) can run on i386.
- `make tests` executes the Unicode unit tests.

The LoadImage patch is preparing for further rework to be delivered
in v2019.07.
2019-02-18 15:48:01 -05:00
Ang, Chee Hong
5097ba6177 ARM: socfpga: stratix10: Return valid error code from FPGA driver
This patch prevent the Stratix 10 FPGA driver incorrectly return the
transaction ID as the mailbox error code. It should always return the
actual mailbox error code from SDM firmware.

Signed-off-by: Ang, Chee Hong <chee.hong.ang@intel.com>
2019-02-18 13:00:54 +01:00
Ley Foon Tan
7997599e2d mmc: dwmmc: Poll for iDMAC TX/RX interrupt
Poll for iDMAC TX/RX interrupt before disable DMA.
This to prevent disable DMA before data is transfer
completed.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2019-02-18 13:00:54 +01:00
Simon Goldschmidt
473f55676a arm: socfpga: gen5: remove hacked ETH RST handling
The 'dwmac_socfpga' ETH driver can now get the MACs out of reset
via the socfpga reset driver and can set PHY mode via syscon.

This means we can now remove the ad-hoc code to do this from
arch/arm/mach-socfpga.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2019-02-18 13:00:53 +01:00
Simon Goldschmidt
6fb1eb1b76 arm: socfpga: gen5 enable designware_socfpga
Enable the socfpga specific designware ethernet driver by default for
socfpga by implying it when enabling CONFIG_ETH_DESIGNWARE for a
MACH_SOCFPGA config.

This is required to remove the hacky reset and phy mode handling in
arch/arm/mach-socfpga.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2019-02-18 13:00:53 +01:00
Simon Goldschmidt
4f1267cea1 net: designware: socfpga: adapt to Gen5
This driver was written for Arria10, but it applies to Gen5, too.

The main difference is that Gen5 has 2 MACs (Arria10 has 3) and the
syscon bits are encoded in the same register, thus an offset is needed.

This offset is already read from the devicetree, but for Arria10 it is
always 0, which is probably why it has been ignored. By using this
offset when writing the phy mode into the syscon regiter, we can use
this driver to set the phy mode for both of the MACs on Gen5.

Since the PHY mode bits in sysmgr are the same even for Stratix10,
let's drop the detection of the sub-mach by checking compatible
version and just use the same code for all FPGAs.

To work correctly, this driver depends on SYSCON and REGMAP, so select
those via Kconfig when it is enabeld.

Tested on socfpga_socrates (where the 2nd MAC is connected, so a shift
offset is required).

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2019-02-18 13:00:53 +01:00
Tom Rini
500ad54e35 - sunxi display DDC probe fallback
- support 24bpp BMP files on 16bpp displays
 -----BEGIN PGP SIGNATURE-----
 
 iGwEABECACwWIQSC4hxrSoIUVfFO0kRM6ATMmsalXAUCXGiRSQ4cYWd1c3RAZGVu
 eC5kZQAKCRBM6ATMmsalXBhGAJ0Z1jc7lDzxlldLsnz32J22uCPsigCdHaefxWKX
 r4K/oQsvMOHPJCDVm7Y=
 =4PiI
 -----END PGP SIGNATURE-----

Merge tag 'video-for-2019.04-rc2' of git://git.denx.de/u-boot-video

- sunxi display DDC probe fallback
- support 24bpp BMP files on 16bpp displays
2019-02-16 18:10:53 -05:00
Tom Rini
7a2ab3778c Merge branch 'master' of git://git.denx.de/u-boot-sh
- Various MMC fixes
2019-02-16 17:05:51 -05:00
Marek Vasut
261445dfaf mmc: tmio: sdhi: Configure DT2FF register for HS400 mode
The DT2FF register must be configured differently for HS400 mode
and for HS200/SDR104 mode. Configure the DT2FF register according
to the recommended datasheet settings for each mode.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-02-16 18:12:17 +01:00
Marek Vasut
4c80f111c0 mmc: tmio: Configure HOST_MODE WMODE according to bus width
Set the HOST_MODE register WMODE bit according to the SDHI bus width,
that is 0 for 64bit bus and 1 for 16/32bit bus.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-02-16 18:12:17 +01:00
Marek Vasut
fceea99268 mmc: Downgrade SD/MMC from UHS/HS200/HS400 modes before boot
Older kernel versions or systems which do not connect eMMC reset line
properly may not be able to handle situations where either the eMMC
is left in HS200/HS400 mode or SD card in UHS modes by the bootloader
and may misbehave. Downgrade the eMMC to HS/HS52 mode and/or SD card
to non-UHS mode before booting the kernel to allow such older kernels
to work with modern U-Boot.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
2019-02-16 18:12:17 +01:00
Heinrich Schuchardt
997fc12ec9 efi_loader: do not miss last relocation block
If the last block in the relocation table contains only a single
relocation, the current coding ignores it.

Fix the determination of the end of the relocation table.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-16 15:51:14 +01:00
Heinrich Schuchardt
1db561e11f efi_loader: documentation of image loader
- Add missing function descriptions.
- Update existing function descriptions to match Sphinx style.
- Add lib/efi_loader/efi_image_loader.c to the input files for Sphinx
  generated documentation.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-16 15:48:58 +01:00
Heinrich Schuchardt
1504bb0d96 efi_loader: clean up bootefi_test_prepare()
Free resources upon failure.

Correct the function description.

As there is no need for any special address in the dummy memory device
path passed via the EFI_LOADED_IMAGE_PROTOCOL simply use 0 as address.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-16 15:42:20 +01:00
Heinrich Schuchardt
914df75b0c efi_loader: fix EFI entry counting
`bootefi selftest` fails on qemu-x86_defconfig if efi_selftest() is not
invoked using EFI_CALL().

Likewise we call the entry point of EFI payloads with
EFI_CALL(efi_start_image()).

entry_count indicates if we are in U-Boot (1) or in EFI payload code (0).
As we start in U-Boot code the initial value has to be 1.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-16 15:42:20 +01:00
Heinrich Schuchardt
f69d63fae2 efi_loader: use efi_start_image() for bootefi
Remove the duplicate code in efi_do_enter() and use efi_start_image() to
start the image invoked by the bootefi command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-16 15:42:20 +01:00
Heinrich Schuchardt
8f7e2b2980 efi_loader: set entry point in efi_load_pe()
Up to now efi_load_pe() returns the entry point or NULL in case of an
error. This does not allow to return correct error codes from LoadImage().

Let efi_load_pe() return a status code and fill in the entry point in the
corresponding field of the image object.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-16 15:42:20 +01:00
Heinrich Schuchardt
0e18f584de efi_loader: LoadImage: always allocate new pages
If we want to properly unload images in Exit() the memory should always be
allocated in the same way. As we allocate memory when reading from file we
should do the same when the original image is in memory.

A further patch will be needed to free the memory when Exit() is called.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-16 15:42:20 +01:00
Heinrich Schuchardt
16112f9f48 efi_loader: error handling in efi_setup_loaded_image()
In case of an error we should set the returned pointers to NULL. This
ensures that an illegal free does not occur even if the caller calls
free() for the handles.

If protocols cannot be installed, release all resources.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-16 15:42:20 +01:00
Heinrich Schuchardt
bc19681acf test: adjust names of Unicode test functions
In test/py/conftest.py the assumption is made that for if a test is called
with `ut unicode` the test function name starts with 'unicode_test_'. As
the Unicode tests did not follow this naming scheme they were not executed
by `make tests`.

Rename the Unicode test functions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-16 15:42:20 +01:00
Heinrich Schuchardt
60c4454ddb lib/vsprintf: print '?' for illegal Unicode sequence
Commit 0e66c10a7d ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-16 15:42:20 +01:00
Heinrich Schuchardt
d787caddf1 efi_selftest: LoadImage from file device path
Provide a unit test that calls LoadImage() with a file device path and
executes the application via StartImage().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-16 15:42:19 +01:00
Heinrich Schuchardt
95288b1e94 efi_loader: comments for efi_file_from_path()
Add more comments for efi_file_from_path().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-16 15:42:19 +01:00
Heinrich Schuchardt
caf6d2fd1a efi_loader: efi_dp_split_file_path() error handling
If the path passed to efi_dp_split_file_path() does not contain a
reference to a file it returns EFI_OUT_OF_RESOURCES. This does not properly
indicate the kind of the problem that occurred. Return
EFI_INVALID_PARAMETER instead.

Update function description.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-16 15:42:19 +01:00
Heinrich Schuchardt
ee3c8ba855 efi_selftest: fix memory allocation in HII tests
In efi_selftest we are in EFI land. We cannot call U-Boot library
functions malloc() and free() but should use the boot time services
instead.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Alexander Graf <agraf@suse.de>
2019-02-16 15:42:19 +01:00
Heinrich Schuchardt
afa17aa23f efi_selftest: do not use efi_free_pool()
In efi_selftest we are in EFI land. We should not use U-Boot library
functions but boot time services for memory management.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Alexander Graf <agraf@suse.de>
2019-02-16 15:42:19 +01:00