Commit Graph

63765 Commits

Author SHA1 Message Date
Heinrich Schuchardt
7aeceffb25 efi_loader: description efi_convert_pointer()
Correct the description of function efi_convert_pointer().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-03-22 11:06:23 +01:00
Heinrich Schuchardt
9f888969fd efi_loader: simplify logical expression in efi_disk_add_dev()
To check if a variable is non-zero there is no need for '!= 0'.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-03-22 11:06:23 +01:00
Heinrich Schuchardt
e1089765b5 efi_selftest: check length reported by GetNextVariableName()
GetNextVariableName should report the length of the variable including the
final 0x0000 in bytes.

Check this in the unit test.

Increase the buffer size for variable names. 40 bytes is too short.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-03-22 11:06:23 +01:00
Heinrich Schuchardt
4d7f5af841 efi_loader: correct reported length in GetNextVariable()
The runtime service GetNextVariable() returns the length of the next
variable including the closing 0x0000. This length should be in bytes.

Comparing the output of EDK2 and U-Boot shows that this is currently not
correctly implemented:

EDK2:
OsIndicationsSupported: 46
PlatformLang: 26
PlatformLangCodes: 36

U-Boot:
OsIndicationsSupported: 23
PlatformLang: 13
PlatformLangCodes: 18

Provide correct length in GetNextVariable().

Fixes: d99a87f84b ("efi_loader: implement GetNextVariableName()")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-03-22 11:06:23 +01:00
Heinrich Schuchardt
47a9596354 efi_loader: fix function descriptions in efi_disk.c
Use Sphinx style for function descriptions.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-03-22 11:06:23 +01:00
Heinrich Schuchardt
f0b0f7fe0e efi_loader: description of efi_variable.c
Correct the file description.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-03-22 11:06:23 +01:00
Andre Przywara
cd27b933f5 sunxi: Remove no longer needed default options from defconfigs
Now that those common Allwinner config symbols are defined automatically
for all boards in their Kconfig files, we can remove the now redundant
definitions from the boards' _defconfig files.

Some boards had a differing definiton for some of those symbols, it
looks like mostly to "merge races" when the symbol was introduced (new
board *_defconfig file missed the "add symbol to all files" patch).

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Tested-by: Jagan Teki <jagan@amarulasolutions.com> # Amarula A64-Relic
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-03-18 18:25:11 +05:30
Andre Przywara
48313fe510 sunxi: Move common defconfig options to Kconfig
Some config symbols are found in *almost* every _defconfig file for
Allwinner boards, because those options are actually a platform choice,
and not a per-board decision.
Some of these options are older, some have recently been added.

Move those options to be set for all Allwinner boards in their
respective Kconfig files.

The rationales are as follows:
- NR_DRAM_BANKS: All Allwinner SoC map DRAM at one contiguous region of
  address space only, starting at 1 GB. So it's always one bank.
- SPL_{DOS,EFI}_PARTITION: The Allwinner SPL does only support raw MMC
  accesses, we don't care about filesystems or partitions in there, so
  there is no need to define those symbols at all.
- USE_PREBOOT: We start USB early when a keyboard is configured, using the
  preboot env variable, so we need to set this variable.
- SYS_RELOC_GD_ENV_ADDR: We don't specify any ENV_ADDR, so need this
  symbol to be set (according to 8d8ee47e03).
- SYS_USB_EVENT_POLL_VIA_INT_QUEUE: According to commit eab9433aa5,
  specifying this reduces the latency of the USB keyboard handling, so
  this was formerly enabled in config headers for all Allwinner boards.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Tested-by: Jagan Teki <jagan@amarulasolutions.com> # Amarula A64-Relic
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-03-18 18:25:00 +05:30
Andre Przywara
e66a34eaba sunxi: Pine H64: Enable SPI booting in defconfig
The Pine H64 board comes with some onboard SPI flash chip, which is
perfect for loading SPL, ATF and U-Boot proper from there.

Enable the functionality in the defconfig, so that we use sunxi-fel to
transfer a bootable image to the NOR flash.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-03-18 18:12:20 +05:30
Andre Przywara
fd40ad0d57 sunxi: SPL SPI: Add SPI boot support for the Allwinner H6 SoC
The Allwinner H6 SoC uses a quite different memory map, also changes the
clocks quite a bit. This requires some changes to the SPL SPI routine,
which hardcodes these values so far.

Using the just introduced helper functions to determine base address
and SPI controller generation, we can cover some of these differences
easily.
The clock setup is different, so requires some explicit code changes
there (reset and clock gate in one register at a different address).
Also we need to change the pinmux function to use a different set of
pins that the H6 uses for SPI0.

Eventually we can enable the H6 to use SPI booting in Kconfig.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-03-18 18:12:04 +05:30
Andre Przywara
da19a0dbc8 sunxi: SPL SPI: Add SPI boot support for the Allwinner R40 SoC
Now that we can easily select an SoC specific SPI0 base address, adding
support for the Allwinner R40 is fairly trivial:
We set the base address, add this SoC to the ones that use PC23 and
enable it in Kconfig.

This allows booting from SPI flash on R40 boards.

Tested on a Bananapi M2 Berry with SPI flash connected to the header pins.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-03-18 18:11:53 +05:30
Andre Przywara
56f51f3875 sunxi: SPL SPI: Introduce is_sun6i_gen_spi()
So far we were using the CONFIG_SUNXI_GEN_SUN6I symbol to select between
the two SPI controller generations used on Allwinner SoCs. This is a
convenience symbol to roughly differentiate between "older" and "newer"
generation of SoCs.

The H6 SoCs is the newest SoC so far, but is sufficiently different to
not define this symbol. However it is using a SPI controller compatible
to the "new gen" SoCs.

To prepare for H6 support, we replace the check for this single symbol
with an explicit function, which can later be extended.
For now we just return CONFIG_SUNXI_GEN_SUN6I in there, so this does not
create a functional change.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-03-18 18:11:41 +05:30
Andre Przywara
2775e08a2b sunxi: SPL SPI: Split off SPI0 base address
So far on all supported Allwinner SoCs we find the old generation SPI
controller always at address 0x1c05000, and the new generation one at
0x1c68000. However the Allwinner R40 SoC has a new generation SPI at
the old address, and the H6 uses a completely different address.

So split off the base address from the respective SPI registers, by
changing the #defines to just contain offsets.
The base address is provided by a function, so it can easily be extended
later when support for those SoCs materialises.

This does not change the code size (since the toolchain is clever enough
to optimise this properly), also does not bring any functional change at
this point.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-03-18 18:11:30 +05:30
Tom Rini
14eb12a3c8 Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi
- Revert "sunxi: psci: avoid error address-of-packed-member"
2020-03-18 07:48:53 -04:00
Tom Rini
40e82bb97c Pull request for UEFI sub-system for efi-2020-04-rc4 (4)
This series fixes several bugs:
 
 * consider the /reserved-memory node in the device tree
 * consider memory reservations created in ft_board_setup()
 * correct output of 'efidebug memmap' on the sandbox
 * correct the definition of efi_capsule_header()
 
 Furthermore some definitions needed for future patches are added to
 header files.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAl5x6bIACgkQxIHbvCwF
 GsSTYQ//fyixmgA7x6uD3222BAq000Y5bQ2jkt5Pd4dlg4Nv3FdNvElfSTOt9whT
 CCAGKMKafB7jkqXRohlPAmO4JG9bZmpJD26Wd1J+XWwax5q5ngFYFbWYZyymb4OQ
 xD8pxHkwwrF6D0VrVCbk3CMn+7sGIaGxm+0zZXDPQ1ZS2zbEkJlWGn6dGXy00yJY
 DWc+9P4e+bPGCKLU2xzADpY9seCg52OQ+C66aCj/f2qeMhOykgWG1B/GhvryljMl
 rbueOClQEbPdB6mAm7xyvOEDQ1K5Iy1JNf/4v5kL07jDiO/7rWP6ptXflaPIJP9y
 qhQ7Ozige/VpTUHauv9BE2oREPaSArJNhetyV4tWcNtS2+9vk+JLHoGWNK/8LtrE
 fTwL8tUyvTDA2YPQKy0TTJ0swLV3Y+Iwv7n51SxbAR7uMeRT9acs9ljciQtF5CQh
 S3i5ZN5+45utS6Gv8kVAwYsbFAs1CIuRAVleCu9OcnfWj61X5gvtkgNlbG5P1gGS
 WHsteTxB4gCQIyS+n0H9MhJFLzYFvj0WQWmJGULmEqgnWO06+gUsTLli9yt/ytoS
 a03VLMx/EZn2W48366OgH/dqrzVFT17IyrAehz08Uu7mk127OGggSJm5j2JRHqUf
 aBDn8K8+rf0zdaFtLDh8DagPX2fV97cPvmMQ/x2r+Ahqoc2rWhI=
 =zB6g
 -----END PGP SIGNATURE-----

Merge tag 'efi-2020-04-rc4-4' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2020-04-rc4 (4)

This series fixes several bugs:

* consider the /reserved-memory node in the device tree
* consider memory reservations created in ft_board_setup()
* correct output of 'efidebug memmap' on the sandbox
* correct the definition of efi_capsule_header()

Furthermore some definitions needed for future patches are added to
header files.
2020-03-18 07:48:39 -04:00
Tom Rini
78176d408b Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
- Fix sbi_remote_sfence_vma{,_asid}.
- Avoid calling sbi_clear_ipi().
- Add new SBI v0.2 extensions support.
2020-03-18 07:48:11 -04:00
Tomasz Duszynski
3586cb8227 Revert "sunxi: psci: avoid error address-of-packed-member"
Using memcpy() for some MMIO access is generally frowned upon and might
break things on some platforms. Allwinner H3, which fails to boot, being
an example here.

Moreover, fields being accessed are naturally aligned and warnings
produced by GCC have been quiesced for some time already by:

53dc8ae ("gcc-9: silence 'address-of-packed-member' warning")

That said, it should be okay to revert this commit.

This reverts commit 9bd34a69a4.

Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
2020-03-18 15:37:08 +05:30
AKASHI Takahiro
74b4487535 efi_loader: correct a definition of struct efi_capsule_header
See UEFI specification, section 8.5.3.
In addition, the structure, efi_capsule_header, should be "packed"
as it is a serialized binary format in a capsule file.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2020-03-17 08:29:52 +01:00
AKASHI Takahiro
b51ec63978 efi_loader: export a couple of protocol related functions
This is a preparatory patch.
Those functions will be used in an implementation of UEFI firmware
management protocol as part of my capsule update patch.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2020-03-17 08:29:52 +01:00
AKASHI Takahiro
b74d568d83 efi_loader: define System Resource Table macros
Some of those values will be used in an implementation of UEFI firmware
management protocol as part of my capsule update patch.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2020-03-17 08:29:52 +01:00
AKASHI Takahiro
7cceef7bde efi_loader: define OsIndicationsSupported flags
These flags are expected to be set in OsIndicationsSupported variable
if corresponding features are supported. See UEFI specification,
section 8.5.4.

In particular, capsule-related flags will be used in my capsule
update patch.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

Fix misspelled EFI_OS_INDICATIONS_BOOT_TO_FW_UI.
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-03-17 08:29:52 +01:00
Atish Patra
7be64b885a cmd: bootefi: Parse reserved-memory node from DT
Currently, bootefi only parses memory reservation block to setup
EFI reserved memory mappings. However, it doesn't parse the
reserved-memory[1] device tree node that also can contain the
reserved memory regions.

Add capability to parse reserved-memory node and update the EFI memory
mappings accordingly.

1. <U-Boot source>/doc/device-tree-bindings/reserved-memory/reserved-memory.txt]

Signed-off-by: Atish Patra <atish.patra@wdc.com>

Fix an endless loop.

The /reserved-memory node may have children without reg property. Remove
a superfluous debug statement.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-03-17 08:29:52 +01:00
Heinrich Schuchardt
a415d61eac cmd: map addresses to sysmem in efidebug memmap
Addresses in the sandbox's device tree are in the sandbox's virtual address
space. If we want to compare memory reservations in the device-tree with
the output of 'efidebug memmap', we need to convert back to this address
space.

Adjust the output of the 'efidebug memmap' command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-03-17 08:29:52 +01:00
Heinrich Schuchardt
fef907b2e4 efi_loader: create reservations after ft_board_setup
Some memory reservations are made in ft_board_setup(). Ensure that we
create reserved memory map entries after ft_board_setup().

The downside of this patch is that if bootefi is called multiple times with
an devicetree argument superfluous reservations for the old copies of the
device tree will exist. But that is still better than missing a reservation.

Deleting the superfluous reservations is not possible because reservations
in the memory map are rounded to page size and may be coallesced.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-03-17 08:29:52 +01:00
Bin Meng
5bde2152d4 riscv: Implement new SBI v0.2 extensions
Few v0.1 SBI calls are being replaced by new SBI calls that follows
v0.2 calling convention.

Implement the replacement extensions and few additional new SBI
function calls that makes way for a better SBI interface in future.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Pragnesh Patel <pragnesh.patel@sifive.com>
2020-03-17 11:29:54 +08:00
Bin Meng
1b3c8d6402 riscv: Introduce a new config for SBI v0.1
We now have SBI v0.2 which is more scalable and extendable to handle
future needs for RISC-V supervisor interfaces.

Introduce a new config and move all SBI v0.1 code under that config.
This allows to implement the new replacement SBI extensions cleanly
and remove v0.1 extensions easily in future. Currently, the config
is enabled by default. Once all M-mode software, with v0.1, is no
longer in use, this config option and all relevant code can be easily
removed.

This commit is inspired from Linux kernel patch:
https://patchwork.kernel.org/patch/11407361/

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Pragnesh Patel <pragnesh.patel@sifive.com>
2020-03-17 11:29:54 +08:00
Bin Meng
1e32715602 riscv: Add SBI v0.2 extension definitions
Few v0.1 SBI calls are being replaced by new SBI calls that follows
v0.2 calling convention.

This patch just defines these new extensions.

This commit is inspired from Linux kernel patch:
https://patchwork.kernel.org/patch/11407359/

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Pragnesh Patel <pragnesh.patel@sifive.com>
2020-03-17 11:29:54 +08:00
Bin Meng
f58fc34a2b riscv: Add basic support for SBI v0.2
The SBI v0.2 introduces a base extension which is backward compatible
with v0.1. Implement all helper functions and minimum required SBI
calls from v0.2 for now. All other base extension function will be
added later as per need.

As v0.2 calling convention is backward compatible with v0.1, remove
the v0.1 helper functions and just use v0.2 calling convention.

Add a new Kconfig options CONFIG_SBI for the new SBI v0.2 codes, and
let CONFIG_SBI_IPI depend on it.

This commit is inspired from Linux kernel patch:
https://patchwork.kernel.org/patch/11407363/

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Pragnesh Patel <pragnesh.patel@sifive.com>
2020-03-17 11:29:54 +08:00
Bin Meng
215c3a7701 riscv: Mark existing SBI as v0.1 SBI
As per the new SBI specification, current SBI implementation version
is defined as 0.1 and will be removed/replaced in future. Each of the
function call in 0.1 is defined as a separate extension which makes
easier to replace them one at a time.

Rename existing implementation to reflect that. This patch is just
a preparatory patch for SBI v0.2 and doesn't introduce any functional
changes.

This commit is inspired from Linux kernel patch:
https://patchwork.kernel.org/patch/11407355/

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Pragnesh Patel <pragnesh.patel@sifive.com>
2020-03-17 11:29:54 +08:00
Bin Meng
f295e00c61 riscv: Avoid calling sbi_clear_ipi()
There is no need for S-mode U-Boot to call sbi_clear_ipi() as it
can be cleared directly from S-mode. This saves some cycles.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas@auer.io>
2020-03-17 11:29:40 +08:00
Bin Meng
fe13692e23 riscv: Fix sbi_remote_sfence_vma{,_asid}
Currently sbi_remote_sfence_vma{,_asid} does not pass their arguments
to SBI at all, which is semantically incorrect.

This keeps in sync with Linux kernel commit:
  a21344dfc6ad: fix sbi_remote_sfence_vma{,_asid}

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas@auer.io>
2020-03-17 11:29:40 +08:00
Tom Rini
a4df9d8ab8 Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
- Fix timer wrap (Chris)
- Use dev_read only if OF_PLATDATA is not enabled (Walter)
2020-03-16 12:33:24 -04:00
Chris Packham
6d8eae9ab7 watchdog: Handle timer wrap around
On some platforms/architectures the value from get_timer() can wrap.
This is particularly problematic when long-running code needs to measure
a time difference as is the case with watchdog_reset() which tries to
avoid tickling the watchdog too frequently.

Use time_after() from time.h instead of a plain > comparison to avoid
any issues with the time wrapping on a system that has been sitting in
u-boot for a long time.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2020-03-16 11:25:12 +01:00
Walter Lozano
ed666fb129 watchdog: Use dev_read only if OF_PLATDATA is not enabled
Currently watchdog tries to use dev_read_u32_default to get timeout
configuration in case OF_CONTROL is enabled. However, if SPL is
built with OF_PLATDATA this has no sense as there is no device tree.

This patch fixes this issue by only use dev_read_u32_default if OF_CONTROL
is enabled but OF_PLATDATA is not.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-03-16 11:25:12 +01:00
Tom Rini
50be9f0e1c Merge branch '2020-03-13-master-imports'
- Address the regression with the 'gpio' command
- Fix mcfuart regression
- Other minor fixes
2020-03-13 13:21:17 -04:00
Patrice Chotard
d21ffa2a2e MAINTAINERS: update entry for ARM STI
Add STi drivers/include files and git tree.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2020-03-13 09:30:30 -04:00
Heinrich Schuchardt
183780491f fit: check return value of fit_image_get_data_size()
GCC-10 reports:

In file included from tools/common/image-fit.c:1:
include/image.h: In function ‘fit_image_get_data_and_size’:
./tools/../common/image-fit.c:1015:9: warning: ‘len’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
 1015 |   *size = len;
      |   ~~~~~~^~~~~
./tools/../common/image-fit.c:996:6: note: ‘len’ was declared here
  996 |  int len;
      |      ^~~

Add the missing check of the return value of fit_image_get_data_size().

Fixes: c3c8638804 ("add FIT data-position & data-offset property support")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2020-03-13 09:30:30 -04:00
Michal Simek
92a19be258 watchdog: Align Kconfig properties
Just cleanup help indentation to be the same for all options.
It means <tab><space><space> indentation.

OMAP3 should be indented by tabs which is also fixed.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2020-03-13 09:30:30 -04:00
Alex Kiernan
4af2a33ee5 cmd: gpio: Make gpio input return pin value again
4dbc107f46 ("cmd: gpio: Correct do_gpio() return value") correctly
changed the behaviour of the gpio command to return CMD_RET_SUCCESS or
CMD_RET_FAILURE, but any existing script which expects the return value
to be the pin value is broken by this change.

Reinstate the legacy behaviour for `gpio input` only.

Fixes: 4dbc107f46 ("cmd: gpio: Correct do_gpio() return value")
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Alex Kiernan <alex.kiernan@hivehome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-03-13 09:30:30 -04:00
AKASHI Takahiro
dde1b75e95 Makefile: doesn't need check stack size when dtb is not built
The commit 5fed97af20 ("Makefile: ensure DTB doesn't overflow into
initial stack") adds an extra check for stack size in BSS if
CONFIG_SYS_INIT_SP_BSS_OFFSET is enabled.
This check, however, doesn't make sense under the configuration where
control dtb won't be built in and it should be void in such cases.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Fixes: 5fed97af20 ("Makefile: ensure DTB doesn't overflow into initial stack")
Reviewed-by: Stephen Warren <swarren@nvidia.com>
2020-03-13 09:30:30 -04:00
Angelo Durgehello
1886024a0e serial: mcfuart: renaming to a more appropriate name
All drivers seems to align now to serial_xxx maning, so, aligning
also this driver, to allow to be found easily.

Signed-off-by: Angelo Durgehello <angelo.dureghello@timesys.com>
2020-03-13 09:29:50 -04:00
Angelo Durgehello
ce5e3ea799 serial: mcfuart: fix uart port index
Actually, using dev->seq value before probe to deduce the current
serial port index leads to reading an invalid seq value (-1).
So, getting dev->seq at probe time.

Signed-off-by: Angelo Durgehello <angelo.dureghello@timesys.com>
2020-03-13 09:28:17 -04:00
Tom Rini
db3b1818b7 Pull request for UEFI sub-system for efi-2020-04-rc4 (3)
This pull request provides the hardware RNG driver for Amlogic systems needed
 for the EFI_RNG_PROTOCOL.
 
 Furthermore bug fixes are provided:
 
 * correct an error message in the efidebug command
 * correct an error in the 'efidebug rm' command
 * remove an unnecessary assignment in efi_queue_event()
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAl5pGo4ACgkQxIHbvCwF
 GsRBnw//Q7HAFk4VILwMOG28/naa6rqDyIetPDEuL/RBi1FO2v0BQo+QnNU0KSLC
 NpUze/2g6Bp+hTwoPg8CLbcCLJR0K5a4+ySmQvxDv9K6jCCMcjEreBTP6iiqiR3+
 KeTber7nNveX7xCS/ErFjayjFysODnopjKO0E+7jtGVeoHUPLY+W0Mz72k9UPFYF
 Yk3vCmfI+soQhW+rrimCYngTmmDcayQjtdXqK2hxUqvGQ04zpYpf1UbuO3u2znJy
 i6f4pftLkki0kZCymImBpYJXdqpVNGzUOHRAUp244OIHgY3+Pz9uSZp8iysqhJe9
 VmmIVvtv91JfakgABTEKv5sziE+Jr3TtVtjMUL6+DyNZK5TM9BwlwkTxapQw7S+y
 ++uz6zQX7dcdUlOWg1sy/8dzlcvzMq7PL7hQKyXfz1Nm72tsyJcwpk02M4ki09Od
 jzJ23gIhWCM3nc22oJNLripVTx+Vj6uRzPTdqGDhkNiGz24svsVcWa+GXGfmWO2K
 SF2SJ8eYtkFe/qXEzqx0VGzjNRA7yjOtpSVzai9L4459MojAEcI5GaePpJ1W7xLr
 YQf0i4M+cU1fomOfPAnM9YykB3+QS3N6BvwMWpwM9YuyhbLfBds1HSJE4rvsh6EG
 kL/sSF8lyugzVlUoSymtnJhUMpSk65tGNDsyw65zFvFA7cHcT08=
 =fiKc
 -----END PGP SIGNATURE-----

Merge tag 'efi-2020-04-rc4-3' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2020-04-rc4 (3)

This pull request provides the hardware RNG driver for Amlogic systems needed
for the EFI_RNG_PROTOCOL.

Furthermore bug fixes are provided:

* correct an error message in the efidebug command
* correct an error in the 'efidebug rm' command
* remove an unnecessary assignment in efi_queue_event()
2020-03-12 12:51:44 -04:00
Tom Rini
6e3cd0a384 - stm32mp: fix dependency for CONFIG_STM32_ETZPC
-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEE56Yx6b9SnloYCWtD4rK92eCqk3UFAl5nyysACgkQ4rK92eCq
 k3Uz6Qf+KWNcWU4/2GA5qhhonfBgLqCs1McSv4WjfFKVclWpnqpx4N/tjKwTi3PR
 h3TnwAyMihTOwr4pbbwSenZcLmcUX1aqc4509+clLIltyU+phSKCYZqPra/fiTh/
 6eiyXXwgUEzAUnqKO1wer/apgCgY2SmZxMvG+Huq6EGPl6UCANLeyYr2+um/skG4
 ufFI6DReR1UrmxSykJlgkurHKa5PnipODeOixbiKpAGo28vve+i4t1T4GL+bQLW9
 ZvTP5gN0dV9Hq1MBauJ7pIY5LPBfgRH+swvD/li9hePhjb47d1y5ZGfKhXGD72xo
 p+QgxYxukItWSiEOCRDRXVhlusJfUg==
 =Z9NT
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-stm32-20200310' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm

- stm32mp: fix dependency for CONFIG_STM32_ETZPC
2020-03-12 12:50:09 -04:00
Heinrich Schuchardt
bc40eb278b drivers/rng: add Amlogic hardware RNG driver
Add support for the hardware random number generator of Amlogic SOCs.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2020-03-11 08:29:58 +01:00
Heinrich Schuchardt
c312c4b4dc drivers/rng: simplify Kconfig
For all sandbox systems with DM_RNG we enable RNG_SANDBOX. So we can simply
set the default to yes.

All rng drivers depend on DM_RNG. Use a single 'if' instead of individual
dependencies. Now 'make menuconfig' shows the individual drivers neatly
indented under the DM_RNG entry.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2020-03-11 08:29:58 +01:00
Heinrich Schuchardt
2b8568f461 efi_loader: unnecessary assignment in efi_queue_event
The assigned value NULL is never used.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-03-11 08:23:05 +01:00
Heinrich Schuchardt
30efb5dd43 cmd: efidebug: correct error message
Add the missing line feed at the error message if the variable referred to
by 'efidebug boot rm' does not exist.

Shorten the format string by using the variable name instead of the number
of the boot variable.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-03-11 08:23:05 +01:00
AKASHI Takahiro
e8bced62b6 cmd: efidebug: fix a failure of "boot rm" sub-command
There is a wrong usage of utf8_utf16_strncpy() in "boot rm" command, and
then it will end up with a failure of this command due to a wrong
value of an interim variable ("var_name16").

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-03-11 08:23:05 +01:00
AKASHI Takahiro
b484296f6f efi_loader: get_memory_map: return parameters whenever possible
Currently, if GetMemoryMap API returns EFI_BUFFER_TOO_SMALL, it doesn't
set valid values to other parameters, descriptor_size and
descriptor_version, except memory_map_size.
Some efi applications, however, may use those value; in particular,
xen uses descriptor_size to calculate a size of buffer to be allocated.

While UEFI specification is ambiguous in this point, it would be better
to address this issue proactively to maximize the compatibility with
existing efi applications.

With this patch, for example, xen.efi (and hence linux kernel) can be
started via bootefi without modification.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-03-11 08:23:05 +01:00