Commit Graph

69553 Commits

Author SHA1 Message Date
Ilias Apalodimas e926136bb2 tpm: use more than sha256 on pcr_extend
The current tpm2_pcr_extend is hardcoded using SHA256.
Let's make the actual command to the TPM2 configurable so we can support
a wider range of algorithms and keep the current command line as-is i.e
limited to SHA256 only

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-12-03 21:22:40 +01:00
Heinrich Schuchardt fc364424ac efi_loader: replace printf by log in efi_uclass.c
Use logging functions instead of printf() and debug().

Change logging messages for uclass creation and destruction to log_debug().

Reported-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-12-03 21:22:30 +01:00
Tom Rini a2c8324711 Merge branch '2020-12-01-next-imports' into next
- More IPQ40xx improvements
- Add string support to setexpr (and tests)
- ProxyDHCP support
- Assorted cleanups
2020-12-02 11:35:02 -05:00
Holger Brunck 7292a18256 km/arm: coding style clean up
Address most of the checkpatch issues we found in km_arm and common km
code.

CC: Stefan Roese <sr@denx.de>
CC: Valentin Longchamp <valentin.longchamp@hitachi-powergrids.com>
Signed-off-by: Holger Brunck <holger.brunck@hitachi-powergrids.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2020-12-01 14:12:28 -05:00
Philippe Reynes 7d5b1bf6b8 spl: spl_fit.c: enable check of signature for config node in spl/tpl
This commit add the support of signature check for config node
in spl/tpl when the function spl_load_simple_fit is used.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-12-01 14:12:28 -05:00
Robert Marko a282ada198 IPQ40xx: clk: add USB clock handling
USB clocks were completely forgotten as driver would always return 0 even if clock ID was unknown.

This behaviour changed with "IPQ40xx: clk: dont always return 0" and this will now causes the USB-s to fail probing as clock enable will return -EINVAL.

So to fix that lets add all of the USB clocks to the driver.

Fixes: 430e1dcf ("IPQ40xx: Add USB nodes")

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Cc: Luka Perkov <luka.perkov@sartura.hr>
2020-12-01 14:12:28 -05:00
Robert Marko 20476b51aa IPQ40xx: clk: dont always return 0
Currently the driver will go through the clock ID-s and set/enable them as needed.
But if the ID is unknown it will fall through the switch case to the default case which will always return 0.

This is not correct and default cases should return a error code since clock ID is unknown.
So lets return -EINVAL instead.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Cc: Luka Perkov <luka.perkov@sartura.hr>
2020-12-01 14:12:28 -05:00
Robert Marko 164cc98a7b IPQ40xx: clk: drop breaks in switch case
There is no point in having break statements in the switch case as there is already a return before break.

So lets drop them from the driver.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Cc: Luka Perkov <luka.perkov@sartura.hr>
2020-12-01 14:12:28 -05:00
Robert Marko 90534536a3 IPQ40xx: clk: use dev_read_addr()
Lets convert the driver to use dev_read_addr() instead of the devfdt_get_addr().

While we are here, lets also alphabetise the includes.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Cc: Luka Perkov <luka.perkov@sartura.hr>
2020-12-01 14:12:28 -05:00
Patrick Delaunay 48aee0afb6 cmd: Kconfig: migrate CONFIG_SYS_PROMPT_HUSH_PS2
Move CONFIG_SYS_PROMPT_HUSH_PS2 in Kconfig, depending
on CONFIG_HUSH_PARSER, and remove the default value defined
in cli_hush.c under __U_BOOT__.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-12-01 14:12:28 -05:00
Patrick Delaunay 310f285e78 hush: Remove default CONFIG_SYS_PROMPT_HUSH_PS2 setting from board files
There is no reason to define default option for this macro which is
already done in common/cli_hush.c.

  87 #ifndef CONFIG_SYS_PROMPT_HUSH_PS2
  88 #define CONFIG_SYS_PROMPT_HUSH_PS2      "> "
  89 #endif

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
2020-12-01 14:12:28 -05:00
Heinrich Schuchardt e1864db60d net: sntp: remove CONFIG_TIMESTAMP constraint
CONFIG_TIMESTAMP is not related to the RTC drivers. It does not make any
sense to let the updating of the RTC by the sntp command depend on it.

Drop the CONFIG_TIMESTAMP checks.

Furthermore function dm_rtc_set() is enabled by CONFIG_DM_RTC. There is no
reason to require CONFIG_CMD_DATE when using a driver model RTC. The UEFI
sub-system can consume the RTC functions even if there is not date command.

Only check CONFIG_CMD_DATE when using a non-driver model RTC.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-12-01 14:12:28 -05:00
Simon Glass 2c02152a8e setexpr: Add support for strings
Add support for dealing with string operands, including reading a string
from memory into an environment variable and concatenating two strings.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Behún <marek.behun@nic.cz>
2020-12-01 10:33:38 -05:00
Simon Glass f66bee41ab setexpr: Convert to use a struct for values
At present a ulong is used to hold operand values. This means that
strings cannot be used. While most operations are not useful for strings,
concatenation is. As a starting point to supporting strings, convert the
code to use a struct instead of a ulong for operands.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-01 10:33:38 -05:00
Simon Glass 8f4aa7ddb9 setexpr: Correct buffer overflow bug and enable tests
At present when more than one substitution is made this function
overwrites its buffers. Fix this bug and update the tests now that they
can pass.

Also update the debug code to show all substrings, since at present it
omits the final one.

Fixes: 855f18ea0e ("setexpr: add regex substring matching and substitution")
Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-01 10:33:38 -05:00
Simon Glass 9528229f22 setexpr: Correct dropping of final unmatched string
At present the 'nlen' variable increases with each loop. If the previous
loop had back references, then subsequent loops without back references
use the wrong value of nlen. The value is larger, meaning that the string
terminator from nbuf is copied along to the main buffer, thus terminating
the string prematurely.

This leads to the final result being truncated, e.g. missing the last
(unmatched) part of the string. So "match match tail" become
"replaced replaced" instead of "replaced replaced tail".

Fix this by resetting nlen to the correct value each time around the lop.

Fixes: 855f18ea0e ("setexpr: add regex substring matching and substitution")
Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-01 10:33:38 -05:00
Simon Glass d422c77ae8 setexpr: Add some tests for buffer overflow and backref
Add tests to check for buffer overflow using simple replacement as well
as back references. At present these don't fully pass.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-01 10:33:38 -05:00
Simon Glass 56331b2680 setexpr: Split the core logic into its own function
At present this function always allocates a large amount of stack, and
selects its own size for buffers. This makes it hard to test the code
for buffer overflow.

Separate out the inner logic of the substitution so that tests can call
this directly. This will allow checking that the algorithm does not
overflow the buffer.

Fix up one of the error lines at the same time, since it should be
printing nbuf_size, not data_size.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-01 10:33:38 -05:00
Simon Glass e713124e35 test: Add some setexpr regex tests
Add tests for the setexpr regex commands.

Note that these tests currently crash on sandbox due to an existing bug in
the setexpr implementation, so two of the tests are commented out.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-01 10:33:38 -05:00
Simon Glass 25a43ac84a setexpr: Add explicit support for 32- and 64-bit ints
At present this function assumes that a size of 4 refers to a ulong. This
is true on 32-bit machines but not commonly on 64-bit machines.

This means that the 'l' specify does not work correctly with setexpr.

Add an explicit case for 32-bit values so that 64-bit machines can still
use the 'l' specifier. On 32-bit machines, 64-bit is still not supported.

This corrects the operation of the default size (which is 4 for setexpr),
so update the tests accordingly.

The original code for reading from memory was included in 47ab5ad145
("cmd_setexpr: allow memory addresses in expressions") but I am not adding
a Fixes: tag since that code was not written with 64-bit machines in mind.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-01 10:33:38 -05:00
Simon Glass 7526deec7e command: Add constants for cmd_get_data_size string / error
At present these values are open-coded in a few places. Add constants so
the meaning is clear.

Also add a comment to cmd_get_data_size()

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-01 10:33:38 -05:00
Simon Glass 90a9901764 test: Add some tests for setexpr
This command currently has no tests. Add some for basic assignment and the
integer operations.

Note that the default size for setexpr is ulong, which varies depending on
the build machine. So for sandbox on a 64-bit host, this means that the
default size is 64 bits.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-01 10:33:38 -05:00
Pali Rohár 4532bf411e Makefile: Correctly propagate failure when removing target
On more places is used pattern 'command > $@ || rm -f $@'. But it does not
propagate failure from 'command' as 'rm -f' returns success.

Fix it by calling 'false' to correctly propagate failure after 'rm -f'.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-12-01 10:33:38 -05:00
Patrick Delaunay 8558217153 gpio: Convert to use APIs which support live DT
Use ofnode_ or dev_ APIs instead of fdt_ and fdtdec_ APIs so that the
driver can support live DT.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
2020-12-01 10:33:37 -05:00
Lyle Franklin c8e251f82a Adds basic support for ProxyDHCP
- ProxyDHCP allows a second DHCP server to exist alongside your main
  DHCP server and supply additional BOOTP related options
- When u-boot sends out a DHCP request, the real DHCP server will
  respond with a normal response containing the new client IP address
  while simultaneously the ProxyDHCP server will respond with a blank
  client IP address and a `bootfile` option
- This patch adds CONFIG_SERVERIP_FROM_PROXYDHCP (default false) to
  enable this behavior and CONFIG_SERVERIP_FROM_PROXYDHCP_DELAY_MS
  (default 100) which tells u-boot to wait additional time after
  receiving the main DHCP response to give the ProxyDHCP response time
  to arrive
- The PXE spec for ProxyDHCP is more complicated than the solution
  added here as diagramed on page 16:
  http://www.pix.net/software/pxeboot/archive/pxespec.pdf:

```
DHCP Discover will be retried four times. The four timeouts are 4, 8, 16
and 32 seconds respectively. If a DHCPOFFER is received without an Option
timeouts in an attempt to receive a PXE response.
```

- Adding a simple delay worked for my purposes but let me know if a
  more robust solution is required

Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>
2020-12-01 10:33:37 -05:00
Anton Leontiev db3667413d cmd: pxe: Use internal FDT if retrieving from FDTDIR fails
As FDTDIR label doesn't specify exact file to be loaded, it should
not fail if no file exists in the directory. In this case try to boot
with internal FDT if it exists.

Signed-off-by: Anton Leontiev <aleontiev@elvees.com>
2020-12-01 10:33:37 -05:00
Tom Rini 0719bf4293 Prepare v2021.01-rc3
Signed-off-by: Tom Rini <trini@konsulko.com>
2020-11-30 13:09:42 -05:00
Tom Rini 53def460d2 configs: Resync with savedefconfig
Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2020-11-30 12:50:32 -05:00
Tom Rini a7ab4b71d5 Merge tag 'mmc-2020-11-29' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc
- mmc minor update for better debug and error check
- fsl_esdhc sysctl set and make sure delay check for HS400
2020-11-29 11:12:59 -05:00
Tom Rini fc4c2f7f85 Pull request for UEFI sub-system for efi-2021-01-rc3 (3)
The following errors are corrected:
 
 * Linux crash when accessing UEFI variables at runtime.
 * UEFI variable using standalone MM on 32 bit systems
   not working due to missing packing of communication
   structure
 * NULL dereference when FAT16 root directory is full
 * FAT files with a short file name starting with 0xE5 (0x05 in directory
   entry) where treated as deleted.
 
 The UEFI SetTime() service is enabled on ARM QEMU.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAl/DPScACgkQxIHbvCwF
 GsQDhA/8CZAwTdKeXGkjaaQqDnU2rYS0D6HlQPeRFAjOC7bG2wD1WBEMz27j4on0
 3IgX/E9M3HVk2AtFHT/yOs3fhEXXZLONjciL5bppxZzfyYvhe/b3/GPy1BxjCSJ9
 8N0KohKU8xyGFCQjyyeBv3qnQV8m1WK7rIctFZ/0VZITvNCAdjRm0lcMBANQdG+B
 xlEmOUcPopNs01xmWBKwtZ5FXBb8dKo6+JZkRjBMN3PoBGzM53xiAn6Lv+coKr+c
 Z3DGgCpkOevSi6hYZZ2M5Dfe/Ar7fn4dInuxLjHaT05r7SRkmeqrFOSkvX7rKwa3
 IGpR+D6edb3qZ1XSiiqNLni/vxSVQFxWJwGFa50zk9pnCnD+lzUECLITOh5FD/Qb
 W9HK0lhgWzYX9+l+mrZ6XldhQhvSABa0B3Zxb9Y8+c2bfut04XuaKCtlJM3y83hu
 1AaNE5ClIU87sobn/jpdTiJSLz8F2rOSf7jVgdUmXP1Nc+q8vr+YzjDcM8BmGWrL
 k2Ku8npMkpn2JG1W7lwzlA5en6/+L5hAaujBo/jj1KlwUlNnfyVNVu/AZlK38Ug6
 7QIi7FJ7T4onRAkNqfzqfYlB2yvth1p/v3LomyGlkJgFCB+WW5aHVCK38/BlQ5jR
 Uf2uv7xX510vfct/wBYUAz3fp7S2l7K9Lf/dSNpgegiSSUe+5jc=
 =CgpH
 -----END PGP SIGNATURE-----

Merge tag 'efi-2021-01-rc3-3' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2021-01-rc3 (3)

The following errors are corrected:

* Linux crash when accessing UEFI variables at runtime.
* UEFI variable using standalone MM on 32 bit systems
  not working due to missing packing of communication
  structure
* NULL dereference when FAT16 root directory is full
* FAT files with a short file name starting with 0xE5 (0x05 in directory
  entry) where treated as deleted.

The UEFI SetTime() service is enabled on ARM QEMU.
2020-11-29 11:12:49 -05:00
Ilias Apalodimas 6974a4a373 charset: make u16_strnlen accessible at runtime
commit 1fabfeef506c ("efi_loader: parameter check in GetNextVariableName()")
introduces a check using u16_strnlen(). This code is used on EFI
runtime variables as well, so unless we mark it as runtime, the kernel
will crash trying to access it.

Fixes: 1fabfeef506c ("efi_loader: parameter check in GetNextVariableName()")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-11-29 05:18:37 +01:00
Etienne Carriere 03699bc756 lib/efi_loader: fix ABI in efi_mm_communicate_header
Pack struct efi_mm_communicate_header as done in EDK2 as seen in
release 201808 [1]. If not packed sizeof() for the structure adds
4 additional bytes on 32bit targets which breaks the ABI.

Link: [1] https://github.com/tianocore/edk2/blob/edk2-stable201808/MdePkg/Include/Protocol/MmCommunication.h#L21
Fixes: 23a397d2e2 ("efi_loader: Add headers for EDK2 StandAloneMM communication")
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2020-11-29 05:18:37 +01:00
Heinrich Schuchardt 31cadc3635 efi_loader: enable EFI_SET_TIME on sandbox and QEMU ARM
Enable EFI_SET_TIME on the sandbox and QEMU ARM to ensure that we compile
and test the relevant code.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-11-29 05:18:37 +01:00
Heinrich Schuchardt 1ec29aa306 fs: fat: use ATTR_ARCH instead of anonymous 0x20
Using constants instead of anonymous numbers increases code readability.

Fixes: 704df6aa0a ("fs: fat: refactor write interface for a file offset")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-11-29 05:18:16 +01:00
Heinrich Schuchardt a2c5a92d48 fs: fat: directory entries starting with 0x05
0x05 is used as replacement letter for 0xe5 at the first position of short
file names. We must not skip over directory entries starting with 0x05.

Cf. Microsoft FAT Specification, August 30 2005

Fixes: 39606d462c ("fs: fat: handle deleted directory entries correctly")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2020-11-29 05:18:16 +01:00
Heinrich Schuchardt 661d223868 fs: fat: avoid NULL dereference when root dir is full
When trying to create a file in the full root directory of a FAT32
filesystem a NULL dereference can be observed.

When the root directory of a FAT16 filesystem is full fill_dir_slot() must
return -1 to signal that a new directory entry could not be allocated.

Fixes: cd2d727fff ("fs: fat: allocate a new cluster for root directory of fat32")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-11-29 05:18:16 +01:00
Tom Rini f6cf78dc6a Merge https://gitlab.denx.de/u-boot/custodians/u-boot-i2c 2020-11-28 10:55:46 -05:00
Pragnesh Patel f517e5fe98 riscv: sifive/fu540: kconfig: Enable support for Opencores I2C controller
Enable support for SiFive FU540 Opencores I2C master controller.

Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
Reviewed-by: Rick Chen <rick@andestech.com>
2020-11-28 08:30:41 +01:00
Pragnesh Patel b2d4cbe6d4 i2c: ocores: add i2c driver for OpenCores I2C controller
Add support for the OpenCores I2C controller IP core
(See http://www.opencores.org/projects.cgi/web/i2c/overview).

This driver implementation is inspired from the Linux OpenCores
I2C driver available.

Thanks to Peter Korsgaard <peter@korsgaard.com> for writing Linux
OpenCores I2C driver.

Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
Reviewed-by: Rick Chen <rick@andestech.com>
2020-11-28 08:30:41 +01:00
Simon Glass 942012246a i2c: designware_i2c: Don't warn if no reset controller
At present if CONFIG_RESET is not enabled, this code shows a warning:

  designware_i2c_ofdata_to_platdata() i2c_designware_pci i2c2@16,0:
	Can't get reset: -524

Avoid this by checking if reset is supported, first.

Fixes: 622597dee4 ("i2c: designware: add reset ctrl to driver")
Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-28 08:30:41 +01:00
Baruch Siach 5a13c0d134 i2c: mvtwsi: disable i2c slave also on Armada 8k
The hidden I2C slave is also present on the Armada 8k AP806. Testing
shows that this I2C slave causes the same issues as Armada 38x.
Disabling that I2C slave fixes all these issues.

I2C blocks on the Armada 8k CP110 are not affected.

Extend the I2C slave disable to Armada 8k as well.

Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2020-11-28 08:17:16 +01:00
Jaehoon Chung b3dc016caa mmc: check a return value about regulator's always-on
Regulator can be set to "always-on".
It's not error about enable/disable. It needs to check about
its condition.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2020-11-28 10:44:39 +08:00
Jaehoon Chung 58896458b7 mmc: display an error number to debug
It's useful to know an error number when it's debugging.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2020-11-28 10:43:42 +08:00
Yangbo Lu 8ee802f899 mmc: fsl_esdhc: make sure delay chain locked for HS400
For eMMC HS400 mode, the DLL reset is a required step for mmc rescan.
This step has not been documented in reference manual, but the RM will
be fixed sooner or later.

In previous commit to support eMMC HS400,
  db8f936 mmc: fsl_esdhc: support eMMC HS400 mode

the steps to configure DLL could be found in commit message,
  13. Set DLLCFG0[DLL_ENABLE] and DLLCFG0[DLL_FREQ_SEL].
  14. Wait for delay chain to lock.

these would be fixed as,
  13.   Set DLLCFG0[DLL_ENABLE] and DLLCFG0[DLL_FREQ_SEL].
  13.1  Write DLLCFG0[DLL_RESET] to 1 and wait for 1us,
        then write DLLCFG0[DLL_RESET]
  14.   Wait for delay chain to lock.

This patch is to add the step of DLL reset, and make sure delay chain
locked for HS400.

Fixes: db8f93672b ("mmc: fsl_esdhc: support eMMC HS400 mode")
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2020-11-28 10:39:44 +08:00
Yangbo Lu 263ddfc345 mmc: fsl_esdhc: set sysctl register for clock initialization
The initial clock setting should be through sysctl register only,
while the mmc_set_clock() will call mmc_set_ios() introduce other
configurations like bus width, mode, and so on.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2020-11-28 10:39:44 +08:00
Sean Anderson da12917060 mmc: Add some helper functions for retrying on error
All of the existing quirks add retries to various calls of mmc_send_cmd.
mmc_send_cmd_quirks is a helper function to do this retrying behavior. It
checks if quirks mode is enabled, and if a specific quirk is activated it
retries on error.

This also adds mmc_send_cmd_retry, which retries on error every time
(instead of if a quirk is activated).

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2020-11-28 10:39:44 +08:00
Tom Rini 7889951d0f - STM32 MCU's DT update
- Add DHCOM based STM32MP15x PicoITX board
 - Correct ALIGN macro usage for on syram for SPL dcache support
 - Fixes on DHCOM: uSD card-detect GPIO and Drop QSPI CS2
 - Fix compilation issue for spl_mmc_boot_partition
 - Fix MTD partitions for serial boot
 - Add support of MCU HOLD BOOT with reset for stm32 remoteproc
   (prepare alligneent with  kernel DT)
 - Correct bias information and support in STM32 soc and STMFX
 - Support optional vbus in usbphyc
 - Update FIT examples to avoid kernel zImage relocation before decompression
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEE56Yx6b9SnloYCWtD4rK92eCqk3UFAl++X0MACgkQ4rK92eCq
 k3UQTQf/VndEkKb/jWxvXPI69g0aGW1CgzkJrOyv5LzR7E7n16Y6sDjnHFqNwqrM
 5WWgft0KYY9zb3+Hk92ymD/Z7zKkIWDbp9FlFky3q7rcKe6mpNghtHS6VoiXwcRG
 gZro+bM/5QKZUpZOcDB6oRtlKx+IgvKYAtOeURK1zUOkoiwuzoRPYhyEdi/DFFG8
 y8ByGBj0SAkv//PKrF+XfS0F5eGJuBrncEfI3+iMtJI/P1fiP/UdySVUK58JkKMJ
 hEUwuR7RADL1F0cP7ZQSBOXksLyKf/DpdYt8J52hf1ml3H5BmhWb91sFK58RRw/v
 PBGbdoschACauAzbSdEh2sqp8dQG9A==
 =ox0A
 -----END PGP SIGNATURE-----

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

- STM32 MCU's DT update
- Add DHCOM based STM32MP15x PicoITX board
- Correct ALIGN macro usage for on syram for SPL dcache support
- Fixes on DHCOM: uSD card-detect GPIO and Drop QSPI CS2
- Fix compilation issue for spl_mmc_boot_partition
- Fix MTD partitions for serial boot
- Add support of MCU HOLD BOOT with reset for stm32 remoteproc
  (prepare alligneent with  kernel DT)
- Correct bias information and support in STM32 soc and STMFX
- Support optional vbus in usbphyc
- Update FIT examples to avoid kernel zImage relocation before decompression
2020-11-25 11:00:52 -05:00
Patrick Delaunay 60a2dd6aa2 board: st: stm32mp1: update load address for FIT examples
Update kernel load address for FIT examples to avoid relocation:
- Kernel example uses Image.gz with U-Boot gzip decompression
  at final kernel location 0x0xC0008000.
- Copro example loads zImage at a correct location (0xC4000000),
  to avoid zImage relocation before decompression by kernel code.

An other solution to avoid zImage relocation is to align
the kernel load and entry address with the real location in FIT
(the relocation of zImage is skipped in U-Boot bootm command for
identical address) but it is less flexible because this offset
depends on FIT content:

For example:

## Loading kernel from FIT Image at c2000000 ...
   Using 'ev1' configuration
   Trying 'kernel' kernel subimage
     Description:  Linux kernel
     Created:      2020-10-22   9:08:32 UTC
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0xc20000cc

The kernel offset in FIT is 0xCC in FIT and zImage is decompressed at
0xC0008000 by kernel code:

kernel {
	description = "Linux kernel";
	data = /incbin/("zImage");
	type = "kernel";
	arch = "arm";
	os = "linux";
	compression = "none";
	load = <0xC20000cc>;
	entry = <0xC20000cc>;
	hash-1 {
		algo = "sha1";
	};
};

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-11-25 14:27:19 +01:00
Patrick Delaunay c480138958 phy: stm32: usbphyc: manage optional vbus regulator on phy_power_on/off
This patch adds support for optional vbus regulator.
It is managed on phy_power_on/off calls and may be needed for host mode.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-11-25 12:02:58 +01:00
Patrick Delaunay e27e96aa80 pinctrl: stmfx: update pin name
Update pin name to avoid duplicated name with SOC GPIO
gpio0...gpio15 / agpio0....agpio7: add a stmfx prefix.

This pin name can be used in pinmux command.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-11-25 12:01:53 +01:00