Commit graph

78126 commits

Author SHA1 Message Date
Marek Vasut
19fbe102b2 ARM: dts: stm32: Add DFU support for DHCOM recovery
This patch configures U-Boot SPL for DHCOM SoM to permit DFU upload of
SPL and subsequent u-boot.itb for recovery or commissioning purposes.

The DFU usage procedure is identical to STM32MP1 DHCOR SoM, see commit
3919aa1722 ("ARM: dts: stm32: Add DFU support for DHCOR recovery") ,
except for switching the SoM into DFU mode. By default, the DHCOM SoM
has no dedicated mechanism for setting BOOTn straps into UART/USB mode,
therefore to enter DFU mode, the SoC must fail to boot from boot media
which can be selected by the BOOTn strap override mechanism first and
then fall back to DFU mode.

In case of a SoM with pre-populated BOOTn strap override button, power
the system off, remove microSD card (if applicable), hold down the BOOTn
strap override button located between eMMC and SoM edge connector, power
on the SoM. The SoC will fail to boot from SD card and fall back into
DFU mode.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-03-15 09:20:32 +01:00
Marek Vasut
b49105320a stm32mp: psci: Implement PSCI system suspend and DRAM SSR
Implement PSCI system suspend and placement of DRAM into SSR while the
CPUs are in suspend. This saves non-trivial amount of power in suspend,
on 2x W632GU6NB-15 ~710mW.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
2022-03-15 09:16:55 +01:00
Marek Vasut
0d44ad8bb4 ram: stm32mp1: Unconditionally enable ASR
Enable DRAM ASR, auto self-refresh, unconditionally. This saves non-trivial
amount of power both at runtime and in suspend (on 2x W632GU6NB-15 ~150mW).

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
2022-03-15 09:16:55 +01:00
Marek Vasut
9a8996df05 ARM: dts: stm32: Move vdd_io extras into Avenger96 extras
The vdd_io regulator is present only on DHCOR SoM configured for 1V8 IO,
as populated on Avenger96, but not present on 3V3 DHCOR SoM. Move these
extras to Avenger96 u-boot DT extras.

Fixes: 3919aa1722 ("ARM: dts: stm32: Add DFU support for DHCOR recovery")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-03-15 09:15:10 +01:00
Marek Vasut
27f6c653ae ARM: dts: stm32: Add USB OTG pinctrl and regulator nodes into SPL DT on DHCOR
Fix the following warning in SPL and make sure that even DTs which
enforce Vbus detection using u-boot,force-vbus-detection;, the DFU
in SPL will work.

dwc2-udc-otg usb-otg@49000000: prop pinctrl-0 index 0 invalid phandle

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-03-15 09:13:31 +01:00
Patrick Delaunay
182738fe2f arm: dts: stm32mp15: alignment with v5.17
Device tree alignment with Linux kernel v5.17-rc1
- ARM: dts: stm32: add pull-up to USART3 and UART7 RX pins
  on STM32MP15 DKx boards
- ARM: dts: stm32: clean uart4_idle_pins_a node for stm32mp15
- ARM: dts: stm32: tune the HS USB PHYs on stm32mp15xx-dkx
- ARM: dts: stm32: tune the HS USB PHYs on stm32mp157c-ev1
- ARM: dts: stm32: fix stusb1600 pinctrl used on stm32mp157c-dk

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-03-15 09:11:47 +01:00
Gabriel Fernandez
310ef93028 video: stm32: stm32_ltdc: fix the check of return value of clk_set_rate()
The clk_set_rate() function returns rate as an 'ulong' not
an 'int' and rate > 0 by default.

This patch avoids to display the associated warning when
the set rate function returns the new frequency.

Fixes: aeaf330649 ("video: stm32: stm32_ltdc: add bridge to display controller")
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-03-15 09:11:11 +01:00
Patrick Delaunay
6ed21f3d70 board: st: common: update test on misc_read result in command stboard
Update management of misc_read/misc_write, which now returns length of
data after the commit 8729b1ae2c ("misc: Update read() and write()
methods to return bytes xfered"): raise a error when the result is not
the expected length.

Fixes: 658fde8a36 ("board: stm32mp1: stboard: lock the OTP after programming")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-03-15 09:10:52 +01:00
Patrick Delaunay
2d48d99c4a stm32mp1: bsec: add missing dev in function comment
Add the missing @dev reference in some function description.

Fixes: b66bfdf238 ("arm: stm32mp: bsec: migrate trace to log macro")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-03-15 09:10:52 +01:00
Patrick Delaunay
0c20f53b3f stm32mp: bsec: add permanent lock write support
Add support of the permanent lock support in U-Boot proper
when BSEC is not managed by secure monitor (TF-A SP_MIN or OP-TEE).

This patch avoid issue with stm32key command and fuse command
on basic boot for this missing feature of U-Boot BSEC driver.

Reported-by: Johann Neuhauser <jneuhauser@dh-electronics.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Tested-by: Johann Neuhauser <jneuhauser@dh-electronics.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-03-15 09:10:52 +01:00
Christophe Kerello
7ce4f1fad2 mtd: rawnand: stm32_fmc2: add NAND Write Protect support
This patch adds the support of the WP# signal. WP will be disabled
before the first access to the NAND flash.

Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-03-15 09:10:52 +01:00
Tom Rini
c149bf4140 Prepare v2022.04-rc4
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-03-14 16:39:08 -04:00
Tom Rini
e8ebdf6ac7 Merge branch '2022-03-14-regression-fixes'
- Regression fixes for RK3399 eMMC, j721e Sierra SerDes driver,
  vexpress64 autoboot and tbs2910 image size
2022-03-14 14:04:55 -04:00
Soeren Moch
3ec38c907c board: tbs2910: Enable Link Time Optimizations in defconfig
This saves about 12 kBytes image size and helps to stay within the
size limit.

Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Soeren Moch <smoch@web.de>
2022-03-14 12:44:51 -04:00
Andre Przywara
a95f05a6ed vexpress64: fvp: Fix automatic boot
Commit 90f262a695 ("vexpress64: Clean up BASE_FVP boot configuration")
cleaned up the usage of default address variables, but missed to update
the address for the kernel in the FVP's bootcmd definition.

Change ${kernel_addr} to read ${kernel_addr_r} to bring back the
automated boot for the fastmodel.
Also use "setenv" instead of the potentially ambiguous "set" on the way.

Fixes: 90f262a695 ("vexpress64: Clean up BASE_FVP boot configuration")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2022-03-14 12:44:51 -04:00
Aswath Govindraju
f4466ab9cc board: ti: j721e: evm.c: Fix the probing of in Sierra SerDes0
Initialization and power on operations of links have been moved under the
link device in the Sierra SerDes driver. Also, the UCLASS of
sierra_phy_provider has been changed to UCLASS_MISC.

Therefore, fix the probing of SerDes0 instance accordingly.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Reviewed-by: Georgi Vlaev <g-vlaev@ti.com>
2022-03-14 12:44:51 -04:00
Aswath Govindraju
b78f81eb5d phy: cadence: Sierra: Move the link operations from serdes phy to link device
In commit 6f46c7441a ("phy: cadence: Sierra: Add a UCLASS_PHY device for
links"), a separate udevice of type UCLASS_PHY was created for each link.
Therefore, move the corresponding link operations under the link device.

Also, change the uclass of sierra phy to UCLASS_MISC as it is no longer the
phy device.

Fixes: 6f46c7441a ("phy: cadence: Sierra: Add a UCLASS_PHY device for links")
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Reviewed-by: Georgi Vlaev <g-vlaev@ti.com>
2022-03-14 12:44:51 -04:00
Alper Nebi Yasak
ee5a284b29 rockchip: sdhci: Fix RK3399 eMMC PHY power cycling
The Rockchip RK3399 eMMC PHY has to be power-cycled while changing its
clock speed to some higher speeds. This is dependent on the desired
SDHCI clock speed, and it looks like the PHY should be powered off while
setting the SDHCI clock in these cases.

Commit ac804143cf ("mmc: rockchip_sdhci: add phy and clock config for
rk3399") attempts to do this in the set_ios_post() hook by setting the
SDHCI clock once more while the PHY is turned off/on as necessary, as
the SDHCI framework does not provide a way to override how it sets its
clock. However, the commit breaks reinitializing the eMMC on a few
boards including chromebook_kevin and reportedly ROCKPro64.

This patch reworks the power cycling to utilize the SDHCI framework
slightly better (using the set_control_reg() hook to power off the PHY
and set_ios_post() hook to power it back on) which happens to fix the
issue, at least on a chromebook_kevin.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-03-14 12:44:51 -04:00
Tom Rini
630a306c1a Merge https://source.denx.de/u-boot/custodians/u-boot-marvell
- kwboot: Misc minor improvement and fixes, e.g. mix of arguments (Pali)
- PCI: a37xx: Remap IO space to bus address 0x0 (Pali)
2022-03-14 11:24:20 -04:00
Tom Rini
b7a919b6c8 Merge https://source.denx.de/u-boot/custodians/u-boot-x86
- Trivial fixes for x86
2022-03-14 10:57:15 -04:00
Pali Rohár
037bb6e2ca arm: a37xx: Remap IO space to bus address 0x0
Remap PCI I/O space to the bus address 0x0 in the Armada 37xx device-tree
in order to support legacy I/O port based cards which have hardcoded I/O
ports in low address space.

Some legacy PCI I/O based cards do not support 32-bit I/O addressing.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2022-03-14 14:04:18 +01:00
Pali Rohár
c497ae7023 tools: kwboot: Allow to mix positional arguments with option -b
Commit 9e6d71d2b5 ("tools: kwboot: Allow to use -b without image path as
the last getopt() option") broke usage of kwboot with following arguments:

  kwboot -t -B 115200 /dev/ttyUSB0 -b u-boot-spl.kwb

Fix parsing of option -b with optional argument again.

Fixes: 9e6d71d2b5 ("tools: kwboot: Allow to use -b without image path as the last getopt() option")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reported-by: Tony Dinh <mibodhi@gmail.com>
Tested-by: Tony Dinh <mibodhi at gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2022-03-14 14:04:18 +01:00
Pali Rohár
3782f55ae8 tools: kwboot: Check if baudrate value is supported before sending image
Call kwboot_open_tty() which baudrate value which was specified at the
command line by option -B. This function returns error if baudrate is not
supported by selected tty device.

Initial baudrate for image transfer is always 115200, so call
kwboot_tty_change_baudrate() with value 115200 immediately after
kwboot_open_tty() if baudrate specified by option -B is different than
115200.

This makes kwboot fail immediately, informing that baudrate is unsupported,
instead of failing only after the first part of image is already sent.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2022-03-14 14:04:18 +01:00
Pali Rohár
a79dea2912 tools: kwboot: Allow to specify custom baudrate only in supported operations
Custom baudrate different than 115200 may be specified only when kwboot is
not going to send boot/debug message pattern or when it is going to send
boot message pattern with image file (in which case baudrate change happens
after sending kwbimage header). BootROM detects boot/debug message pattern
only at baudrate 115200.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2022-03-14 14:04:18 +01:00
Simon Glass
92a3e67ee9 x86: Correct the coreboot header file in MAINTAINERS
This board has its own config header file. Correct it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2022-03-14 15:20:40 +08:00
Simon Glass
978a8a296e x86: Add an enum name for the GNVS firmware type
This enum is currently anonymous. Add a name so it can be used in the
code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2022-03-14 15:20:40 +08:00
Tom Rini
c96137000e Pull request for efi-2022-04-rc3-2
Documentation:
 * Fix description for SiFive Unmatched
 * Add libgnutls28-dev to build dependencies
 
 UEFI
 * Avoid possibly invalid GUID pointers for protocol interfaces
 
 Other
 * Serial console support for cls command
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmIshDsACgkQxIHbvCwF
 GsR94g/+I1xaMBXGBypiKaV5S38gP7Bk4Vj7Hz97Qjd51rEx+/LL4iyrQDF3O20H
 qRywFX6aS+OVsBo1UYATSmBUdwxE1OSZzEXNWLhv3jlbOsxSIelyW/l8vOuhndVa
 TZwcQ9ii+0YArQ7uHgDdZ6KzBCtftkgQ8llditAwVHc8q+dIePWaAtv5vcGY5Xz9
 VoO+ZEzxvNi4p2WnLW0237Qtwdla4iL5qc1mbAeTDh6hjjcXdXEKmuOMXsgswhyr
 sAFv9Rft8BySCRSiiHiLH9J+XIplX+EZNKz3cvTIbWoTDCZWK7bXcvi4STJp7U2O
 lHoxfYXX0uMVtFv+Oa9eFpNFHbdP7X9yTe07YgbqYbnVN9SjQMDrKICn4PLMjxKA
 tSy/EFb9AcFl5Dr+/aRIfqJ/CPocRfrzSoCXqOPeKJZPGsPUPACjTw5P/b6N/elJ
 zhyFawDZY3PhtdaawrTIf1JJf2pTAadBrPaWBrtnCZKgJ7k4g9g+s6VzgpYZtzCJ
 ccd8m/T/KnrBrPJG4MWvYLgVKNZ0YrcLzMOHXFBJILnPbOxT1JWAzOYoj/RRemTE
 uIbUpI45q0/eubltWhe6dkawrh5fGC+GBi1MOs/qTQLYARXFxWSdE2Ev0qcx/DMn
 UnxlrXrLueGp/rVTAxXVKN5np8cUOt+9385yZrgfEq4ACNSKI4A=
 =P03c
 -----END PGP SIGNATURE-----

Merge tag 'efi-2022-04-rc3-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-04-rc3-2

Documentation:
* Fix description for SiFive Unmatched
* Add libgnutls28-dev to build dependencies

UEFI
* Avoid possibly invalid GUID pointers for protocol interfaces

Other
* Serial console support for cls command
2022-03-13 08:18:17 -04:00
Tom Rini
6d35c24892 Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-spi
- sunXi SPI fixups (Andre)
- bcm iproc qspi (Rayagonda)
2022-03-12 07:20:29 -05:00
Heinrich Schuchardt
66028930da efi_loader: copy GUID in InstallProtocolInterface()
InstallProtocolInterface() is called with a pointer to the protocol GUID.
There is not guarantee that the memory used by the caller for the protocol
GUID stays allocated. To play it safe the GUID should be copied to U-Boot's
internal structures.

Reported-by: Joerie de Gram <j.de.gram@gmail.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-03-12 12:27:07 +01:00
Heinrich Schuchardt
f95104825a doc: add libgnutls28-dev to build dependencies
mkeficapsule requires package libgnutls28-dev for building

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-03-12 12:27:07 +01:00
Heinrich Schuchardt
007fdb20bb doc: path to u-boot-spl.bin on SiFive Unmatched board
u-boot-spl.bin is built in spl/.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2022-03-12 12:27:07 +01:00
Heinrich Schuchardt
bfaa51dd4a cmd: add serial console support for the cls command
Currently the cls command does not support the serial console

The screen can be cleared in the video uclass, the colored frame buffer
console, and the serial console by sending the same escape sequence.
This reduces the cls command to a single printf() statement on most
boards.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-03-12 12:27:07 +01:00
Niklas Cassel
228173d855 mtd: spi-nor-ids: Enable quad read for Gigadevice gd25lq128
The Gigadevice gd25lq128 serial flash exists in different versions,
all which identify themselves using the same JEDEC id.

gd25lq128c:
https://www.gigadevice.com/datasheet/gd25lq128

gd25lq128d:
https://www.gigadevice.com/datasheet/gd25lq128d

However, all versions support quad read, so enable it.
Tested and verified on the Sipeed MAix BiT board.

Fixes: 30b9a28a3f ("mtd: spi-nor-ids: Add Gigadevice gd25lq128 ID")
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2022-03-12 01:10:01 +05:30
Andre Przywara
280294c5df sunxi: boards: Enable SPI flash support in U-Boot proper
Some sunxi boards ship with SPI flash, which allows booting through the
BootROM. We cover this functionality by a separate SPL "mini" driver.
Separately we have a proper DM_SPI driver for U-Boot proper, which
provides access to the SPI flash through the "sf" command. That allows
to update the firmware on the SPI flash, also to store the environment
there.

However only very few boards actually enable support for U-Boot proper,
even though that would work and the SPL part is configured.

Use the cleaned up configuration scheme to enable SPI flash on those
boards which mention a SPI flash in their .dts, or which use the SPL SPI
support.

Out of the box this would enable storing the environment on the SPI
flash, and allows people to read or write the flash from U-Boot, for
instance to update the SPI flash when booted via an SD card.

For this to actually work there must be a "spi0" alias in the DT, which
most boards are missing. But this should be addressed separately.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2022-03-10 17:34:44 +05:30
Andre Przywara
753a85fd15 env: sunxi: enable ENV_IS_IN_SPI_FLASH
Now that sunxi uses CONFIG_SPI more sanely, and can also now properly
load the environment from SPI flash, let's enable the symbol that
actually considers the SPI flash when accessing the environment.

As this symbol depends on CONFIG_SPI, which we now only enable if the
board has a SPI flash, we can make if "default y" for all Allwinner
boards.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2022-03-10 17:34:11 +05:30
Andre Przywara
e42dad4168 sunxi: use boot source for determining environment location
Currently we only support to load the environment from raw MMC or FAT
locations on Allwinner boards. With the advent of SPI flash we probably
also want to support using the environment there, so we need to become
a bit more flexible.

Change the environment priority function to take the boot source into
account. When booted from eMMC or SD card, we use FAT or MMC, if
configured, as before.
If we are booted from SPI flash, we try to use the environment from
there, if possible. The same is true for NAND flash booting, although
this is somewhat theoretical right now (as untested).

This way we can use the same image for SD and SPI flash booting, which
allows us to simply copy a booted image from SD card to the SPI flash,
for instance.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2022-03-10 17:33:50 +05:30
Andre Przywara
2bdf213f91 env: sunxi: Define location in SPI flash
To allow loading and storing the environment from SPI flash, adjust the
raw offset variables for Allwinner boards to make sense there.

U-Boot (including SPL and other blobs) is loaded from the beginning of
SPI flash, so move the environment location as far back as possible, to
not create unnecessary limits. As those offsets are shared with (now
mostly unused) raw MMC environment, we should respect the common one
megabyte limit, which also makes sense on SPI flash.

So limit the environment for those raw locations to 64KB, and place it
just below 1MB (@960KB).

Those values are currently unused, unless someone forcibly enables the
raw MMC environment. In this case it would break as of now, as the
current offset of 544KB is far too low for the current (arm64) U-Boot
proper.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2022-03-10 17:33:23 +05:30
Andre Przywara
81a46c152a sunxi: Kconfig: Fix up SPI configuration
Commit 7945caf22c ("arm: sunxi: Enable SPI/SPI-FLASH support for A64")
selected CONFIG_SPI by default on all Allwinner A64 boards, even though
only 4 out of the 14 A64 boards have a SPI flash chip. All other SoCs
had to manually select DM_SPI and friends, even though they are a
platform property (the sunxi SPI driver is DM_SPI only).

Clean this up to allow easy selection of SPI flash support in U-Boot
proper, by selecting DM_SPI and DM_SPI_FLASH *if* CONFIG_SPI is
selected, for *all* Allwinner SoCs. This simplifies the defconfig for
two Libretech boards already.

Also remove the forced CONFIG_SPI from the A64 Kconfig, instead let the
four boards which allow SPI booting select this explicitly.

Any board wishing to support SPI flash in U-Boot proper now just defines
CONFIG_SPI and CONFIG_SPI_FLASH_<vendor> in its defconfig, Kconfig takes
care of the rest.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2022-03-10 17:32:13 +05:30
Tom Rini
589c659035 Merge branch '2022-03-08-assorted-fixes'
- serial uclass fix, mailmap/gitignore updates
2022-03-08 08:42:51 -05:00
Philippe Reynes
b38fbddbaa board: .gitignore: replace dsdt.c by dsdt_generated.c
Since commit 5d94cbd1dc ("scripts: Makefile.lib: generate
dsdt_generated.c instead of dsdt.c"), the file generated
is named dsdt_generated.c instead of dsdt.c.
So all files .gitignore referencing dsdt.c should be
upated with dsdt_generated.c.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2022-03-08 08:42:43 -05:00
Mark Kettenis
c12f9d2e54 drivers: serial: Make sure we really return a serial device
The stdout-path property in the device tree does not necessarily
point at a serial device. On machines such as the Apple M1 laptops
where the serial port isn't easy to access and users expect to see
console output on the integrated display stdout-path may point at
the device tree node for the framebuffer for example.

If stdout-path does not point at a node for a serial device, the
serial_check_stdout() will not find a bound device and will drop
down into code that attempts to use lists_bind_fdt() to bind a
device anyway. However, that fallback code does not check that
the uclass of the device is UCLASS_SERIAL. So if stdout-path points
at the framebuffer instead of the serial device it will return a
UCLASS_VIDEO device. Since the code that calls this function
expects the returned device to be a UCLASS_SERIAL device, U-Boot
will crash as soon as it attempts to send output to the console.

Add a check here to verify that the uclass of the bound device
really is UCLASS_SERIAL. If it isn't, serial_check_stdout() will
return an error and serial_find_console_or_panic() will use the
serial device with sequence number 0 as the console and all is fine.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2022-03-08 08:42:43 -05:00
Michal Simek
45eb35c197 .mailmap: Fix Heinrich's xypron.glpk@gmx.de record
There is one issue with Heinrich xypron.glpk@gmx.de <xypron.glpk@gmx.de>
record which should be specifically grouped with his name.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2022-03-08 08:42:43 -05:00
Tom Rini
7fed437f40 Merge https://source.denx.de/u-boot/custodians/u-boot-watchdog
- Update MAINTAINERS file (Stefan)
- wdt-uclass.c: add a property u-boot, noautostart (Philippe)
- armada_37xx: Probe driver also when watchdog is already running (Pali)
- rti_wdt: Add 10% safety margin to clock frequency (Jan)
2022-03-08 08:42:20 -05:00
Jan Kiszka
817e153fe5 watchdog: rti_wdt: Add 10% safety margin to clock frequency
When running against RC_OSC_32k, the watchdog may suffer from running
faster than expected, expiring earlier. The Linux kernel adds a 10%
margin to the timeout calculation by slowing down the read clock rate
accordingly. Do the same here, also to have comparable preset values
for both drivers.

Along this, fix the name of the local var holding to frequency - in Hz,
not kHz.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2022-03-08 09:08:09 +01:00
Pali Rohár
65066773a3 watchdog: armada_37xx: Probe driver also when watchdog is already running
If Armada 37xx watchdog is started before U-Boot then CNTR_CTRL_ACTIVE bit
is set, U-Boot armada-37xx-wdt.c driver fails to initialize and so U-Boot
is unable to use or kick this watchdog.

Do not check for CNTR_CTRL_ACTIVE bit and always initialize watchdog. Same
behavior is implemented in Linux kernel driver.

This change allows to activate watchdog in firmware which loads U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2022-03-08 09:08:09 +01:00
Philippe Reynes
a12492ebbc drivers: watchdog: wdt-uclass.c: add a property u-boot, noautostart
Since commit 492ee6b8d0 ("watchdog: wdt-uclass.c: handle all DM
watchdogs in watchdog_reset()"), all the watchdog are started when
the config WATCHDOG_AUTOSTART.

To avoid a binary choice none/all, a property u-boot,noautostart
may be added in the watchdog node of the u-boot device tree to not
autostart this watchdog.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2022-03-08 09:08:00 +01:00
Stefan Roese
a12366a807 MAINTAINERS: Add watchdog maintainers entry
I've been handling "inofficially" the watchdog related patches for a few
years now. Let's make this official and add a tree for it and also add
myself here in the MAINTAINERS file.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Harald Seiler <hws@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
2022-03-08 07:23:10 +01:00
Tom Rini
6d3c46ed0e Merge https://source.denx.de/u-boot/custodians/u-boot-sunxi
- Fix ARMv5/F1C100 FEL booting
- Fix F1C100 reset
- Introduce proper F1C100 boot method detection
- Enable SPI booting for F1C100

Boot tested from FEL, SPI, SD card and eMMC (where applicable) on
Pine64-LTS, Pine-H64, BananaPi M1, OrangePi Zero, LicheePi Nano(F1C100).
2022-03-05 20:46:55 -05:00
Tom Rini
0444cbbe77 Merge branch '2022-03-04-assorted-minor-fixes'
- mailmap file updates, OpenSSL code cleanup, assorted TI platform
  fixes, typo fix.
2022-03-05 11:34:31 -05:00
Yann Droneaud
9b5ad4f5da lib: rsa: use actual OpenSSL 1.1.0 EVP MD API
Since OpenSSL 1.1.0, EVP_MD_CTX_create() is EVP_MD_CTX_new()
                     EVP_MD_CTX_destroy() is EVP_MD_CTX_free()
                     EVP_MD_CTX_init() is EVP_MD_CTX_reset()

As there's no need to reset a newly created EVP_MD_CTX, moreover
EVP_DigestSignInit() does the reset, thus call to EVP_MD_CTX_init()
can be dropped.
As there's no need to reset an EVP_MD_CTX before it's destroyed,
as it will be reset by EVP_MD_CTX_free(), call to EVP_MD_CTX_reset()
is not needed and can be dropped.

Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
2022-03-04 15:20:07 -05:00