Tom Rini [Mon, 4 Oct 2021 15:27:55 +0000 (11:27 -0400)]
Merge branch 'next'
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Mon, 4 Oct 2021 15:09:26 +0000 (11:09 -0400)]
Prepare v2021.10
Signed-off-by: Tom Rini <trini@konsulko.com>
Marek Vasut [Tue, 14 Sep 2021 03:21:48 +0000 (05:21 +0200)]
mtd: cqspi: Fix division by zero
Both dummy.nbytes and dummy.buswidth may be zero. By not checking
the later, it is possible to trigger division by zero and a crash.
This does happen with tiny SPI NOR framework in SPL. Fix this by
adding the check and returning zero dummy bytes in such a case.
Fixes: 38b0852b0ea ("spi: cadence-qspi: Add support for octal DTR flashes")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Vignesh R <vigneshr@ti.com>
Cc: Pratyush Yadav <p.yadav@ti.com>
[trini: Drop Pratyush's RB as his requested changes weren't made as
Marek disagreed]
Tom Rini [Sun, 3 Oct 2021 23:31:04 +0000 (19:31 -0400)]
Merge branch '2021-10-03-platform-updates' into next
- TI K3 updates, add IOT2050 platform
- rtc rx8025 updates, PCI fixes
Jan Kiszka [Sat, 18 Sep 2021 06:17:56 +0000 (08:17 +0200)]
iot2050: Enable watchdog support, but do not auto-start it
This allows to use the watchdog in custom scripts but does not enforce
that the OS has to support it as well.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Jan Kiszka [Sat, 18 Sep 2021 06:17:55 +0000 (08:17 +0200)]
watchdog: rti_wdt: Add support for loading firmware
To avoid the need of extra boot scripting on AM65x for loading a
watchdog firmware, add the required rproc init and loading logic for the
first R5F core to the watchdog start handler. In case the R5F cluster is
in lock-step mode, also initialize the second core. The firmware itself
is embedded into U-Boot binary to ease access to it and ensure it is
properly hashed in case of secure boot.
One possible firmware source is https://github.com/siemens/k3-rti-wdt.
The board is responsible for providing the firmware as additional
loadable via the U-Boot fit image. The driver will pick up its location
from /fit-images/k3-rti-wdt-firmware then.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Jan Kiszka [Sat, 18 Sep 2021 06:17:53 +0000 (08:17 +0200)]
board: siemens: Add support for SIMATIC IOT2050 devices
This adds support for the IOT2050 Basic and Advanced devices. The Basic
used the dual-core AM6528 GP processor, the Advanced one the AM6548 HS
quad-core version.
Both variants are booted via a Siemens-provided FSBL that runs on the R5
cores. Consequently, U-Boot support is targeting the A53 cores. U-Boot
SPL, ATF and TEE have to reside in SPI flash.
Full integration into a bootable image can be found on
https://github.com/siemens/meta-iot2050
Based on original board support by Le Jin, Gao Nian and Chao Zeng.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Jan Kiszka [Sat, 18 Sep 2021 06:17:52 +0000 (08:17 +0200)]
arm: dts: Add IOT2050 device tree files
Prepares for the addition of the IOT2050 board which is based on the TI
AM65x. The board comes in four variants, Basic and Advanced, each as
product generation 1 (SR1.0) and 2 (SR2.x), so there are separate dts
files needed. Furthermore, the SPL has its own device tree.
Based on original board support by Le Jin, Gao Nian and Chao Zeng.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Vladimir Oltean [Fri, 17 Sep 2021 12:11:30 +0000 (15:11 +0300)]
pci: pcie_layerscape_fixup_common: lx2_board_fix_fdt can be static
To avoid W=1 build warnings, declare this function as static, since it
is not used outside of this translation module.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Vladimir Oltean [Fri, 17 Sep 2021 12:11:29 +0000 (15:11 +0300)]
pci: pcie_layerscape_fixup_common: include fdt_support.h for ft_pci_setup
The function prototype for ft_pci_setup is inside fdt_support.h, we need
to include that header.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Vladimir Oltean [Fri, 17 Sep 2021 12:11:28 +0000 (15:11 +0300)]
pci: layerscape: ls_pcie_conf_address can be static
To avoid W=1 build warnings, declare this function as static, since it
is not used outside of this translation module.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Vladimir Oltean [Fri, 17 Sep 2021 12:11:27 +0000 (15:11 +0300)]
pci: _dm_pci_phys_to_bus can be static
To avoid W=1 build warnings, declare this function as static, since it
is not used outside of this translation module.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Vladimir Oltean [Fri, 17 Sep 2021 12:11:26 +0000 (15:11 +0300)]
pci: pci_read_config can be static
To avoid W=1 build warnings, declare this function as static, since it
is not used outside of this translation module.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Vladimir Oltean [Fri, 17 Sep 2021 12:11:25 +0000 (15:11 +0300)]
pci: pci_write_config can be static
To avoid W=1 build warnings, declare this function as static, since it
is not used outside of this translation module.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Vladimir Oltean [Fri, 17 Sep 2021 12:11:24 +0000 (15:11 +0300)]
pci: pciinfo_header can be static
To avoid W=1 build warnings, declare this function as static, since it
is not used outside of this translation module.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Vladimir Oltean [Fri, 17 Sep 2021 12:11:23 +0000 (15:11 +0300)]
pci: pci_header_show can be static
To avoid W=1 build warnings, declare this function as static, since it
is not used outside of this translation module.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Vladimir Oltean [Fri, 17 Sep 2021 12:11:22 +0000 (15:11 +0300)]
pci: pci_bar_show can be static
To avoid W=1 build warnings, declare this function as static, since it
is not used outside of this translation module.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Vladimir Oltean [Fri, 17 Sep 2021 12:11:21 +0000 (15:11 +0300)]
pci: include pci_internal.h inside pci_auto.c
To avoid a build warning with W=1, provide a function prototype for
dm_pciauto_prescan_setup_bridge, which is a non-static function whose
definition is inside pci_auto.c.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Vladimir Oltean [Fri, 17 Sep 2021 12:11:20 +0000 (15:11 +0300)]
pci: provide prototype for pci_skip_dev outside of #if defined(CONFIG_DM_PCI_COMPAT)
The weak definition of pci_skip_dev from drivers/pci/pci_common.c is not
under CONFIG_DM_PCI_COMPAT, and that definition needs a previous
function prototype declaration to avoid W=1 build warnings.
That prototype is not available due to it being under CONFIG_DM_PCI_COMPAT,
so move it outside of that preprocessor block.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Mathew McBride [Fri, 17 Sep 2021 06:46:04 +0000 (06:46 +0000)]
rtc: rx8025: revise single register write to use offset
Writing of individual registers was not functioning
correctly as a 0 'offset' byte under DM-managed
I2C was being appended in front of register we
wanted to access.
Signed-off-by: Mathew McBride <matt@traverse.com.au>
Mathew McBride [Fri, 17 Sep 2021 06:46:03 +0000 (06:46 +0000)]
rtc: rx8025: set date in a single i2c transaction
The RX8025/RX8035 does not like having it's time registers
set byte-by-byte in separate I2C transactions.
From the note at the top of the file, it appears
target-dependent workarounds have been used in the
past for this.
Resolve this by setting the time registers in a single
I2C transaction.
As part of this, also ensure the '24/12' flag in the RTC
is reset before writing the date (instead of after), otherwise
the RX8035 will clear the seconds and minutes registers.
Tested on Traverse Ten64 (NXP LS1088A) with RX8035.
Signed-off-by: Mathew McBride <matt@traverse.com.au>
Mathew McBride [Fri, 17 Sep 2021 06:46:02 +0000 (06:46 +0000)]
rtc: rx8025: add support for EPSON RX8035.
The RX8035 is a newer model from EPSON which is
very similar in operation to the RX8025.
The changes mirror similar ones that will be
in Linux 5.15:
https://lore.kernel.org/all/
20210709044518.28769-2-matt@traverse.com.au/
The UBOOT_DRIVER ID has also been corrected, previously
it declared itself as rx8010sj_rtc which is a different driver.
Signed-off-by: Mathew McBride <matt@traverse.com.au>
Mathew McBride [Fri, 17 Sep 2021 06:46:01 +0000 (06:46 +0000)]
rtc: rx8025: drop non-DM support
A search of the tree showed there is only one user
of this driver (soon to be two) - board/socrates
The second user will be the Traverse Ten64 board.
Both these boards have DM_RTC.
Signed-off-by: Mathew McBride <matt@traverse.com.au>
Chia-Wei Wang [Thu, 16 Sep 2021 06:10:09 +0000 (14:10 +0800)]
ARM: dts: ast2600: Make WDT by default disabled
The WDT devices described in the general .dtsi file
should be marked as "disabled" by default.
A WDT should be then enabled in the board specific
.dts file on demands.
Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Reviewed-by: Ryan Chen <ryan_chen@aspeedtech.com>
Tom Rini [Fri, 10 Sep 2021 21:37:43 +0000 (17:37 -0400)]
arm: ti: k3: Resync dts files and bindings with Linux Kernel v5.14
This resyncs the dts files for all of the currently in-tree K3
platforms, along with relevant bindings, with the v5.14 Linux Kernel
release. Of note are that the main-navss/mcu-navss nodes were renamed
to main_navss / mcu_navss and so the u-boot.dtsi files needed to be
updated to match.
Tested on j721e_evm and am65x_evm.
Signed-off-by: Tom Rini <trini@konsulko.com>
Nishanth Menon [Tue, 31 Aug 2021 18:12:24 +0000 (13:12 -0500)]
dt-bindings: pinctrl: k3: Synchronize with v5.14 kernel
Synchronize with the upstream version as of v5.14 kernel tag
Signed-off-by: Nishanth Menon <nm@ti.com>
Tom Rini [Sat, 2 Oct 2021 19:47:28 +0000 (15:47 -0400)]
Merge branch '2021-10-01-assorted-removal-and-migration' into next
- Remove the last non-CONFIG_DM boards, and their related unused code.
- Finish a few partial migrations to Kconfig, and remove some redundant
serial related code.
Tom Rini [Mon, 13 Sep 2021 21:24:54 +0000 (17:24 -0400)]
serial: Remove extraneous SYS_MALLOC_F check
We enforce that DM_SERIAL will have SYS_MALLOC_F enabled and so
SYS_MALLOC_F_LEN will have a value. Remove the build-time check.
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Mon, 13 Sep 2021 21:24:53 +0000 (17:24 -0400)]
serial: Use the default CONFIG_SYS_BAUDRATE_TABLE in more platforms
A number of platforms are still defining CONFIG_SYS_BAUDRATE_TABLE to
the fallback default of "{ 9600, 19200, 38400, 57600, 115200 }", but
with varying whitespace, or were introduced after the default fallback
was added. Use the default table here.
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Mon, 13 Sep 2021 21:24:52 +0000 (17:24 -0400)]
Convert CONFIG_BAUDRATE to Kconfig
This converts the following to Kconfig:
CONFIG_BAUDRATE
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Mon, 13 Sep 2021 21:24:51 +0000 (17:24 -0400)]
kgdb: Remove unused serial related options
We have a few CONFIG options for KGDB that are not referenced, remove
them.
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Thu, 9 Sep 2021 11:54:53 +0000 (07:54 -0400)]
ppc: Remove MPC8349EMDS board and ARCH_MPC8349 support
This board has not been converted to CONFIG_DM by the deadline.
Remove it.
Cc: Priyanka Jain <priyanka.jain@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Thu, 9 Sep 2021 11:54:51 +0000 (07:54 -0400)]
arm: Remove bg0900 board
This board has not been converted to CONFIG_DM by the deadline.
Remove it.
Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Thu, 9 Sep 2021 11:54:50 +0000 (07:54 -0400)]
arm: Remove zmx25 board and ARCH_MX25
This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last ARCH_MX25 platform, remove those
references as well.
Cc: Matthias Weisser <weisserm@arcor.de>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Thu, 9 Sep 2021 11:54:49 +0000 (07:54 -0400)]
arm: Remove aspenite board
This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last armada100 platform, remove that support
as well.
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Tue, 14 Sep 2021 13:09:31 +0000 (09:09 -0400)]
arm: Remove flea3 board
This board has not been converted to CONFIG_DM by the deadline.
Remove it. As this is the last mx35 platform, remove that support as
well.
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Stefano Babic <sbabic@denx.de>
Tom Rini [Fri, 1 Oct 2021 13:15:48 +0000 (09:15 -0400)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-marvell into next
- kwboot higher baudrate (Pali & Marek)
Marek Behún [Wed, 25 Aug 2021 12:49:39 +0000 (14:49 +0200)]
MAINTAINERS: Add entry for kwbimage / kwboot tools
Add entry for these tools with Marek, Pali and Stefan as maintainers.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Marek Behún [Fri, 24 Sep 2021 21:07:15 +0000 (23:07 +0200)]
doc/kwboot.1: Update man page
Update man page for the kwboot utility.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Fri, 24 Sep 2021 21:07:14 +0000 (23:07 +0200)]
tools: kwboot: Add Pali and Marek as authors
Add Pali and Marek as another authors of the kwboot utility.
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Marek Behún [Fri, 24 Sep 2021 21:07:13 +0000 (23:07 +0200)]
tools: kwboot: Update file header
Mention all supported platforms in file header.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Marek Behún [Fri, 24 Sep 2021 21:07:12 +0000 (23:07 +0200)]
tools: kwboot: Avoid code repetition in kwboot_img_patch()
Change kwboot_img_patch() to avoid code repetition of setting errno to
EINVAL.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Marek Behún [Fri, 24 Sep 2021 21:07:11 +0000 (23:07 +0200)]
tools: kwboot: Cosmetic fix
Add spaces around the | operator.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Fri, 24 Sep 2021 21:07:10 +0000 (23:07 +0200)]
tools: kwboot: Disable non-blocking mode
The kwboot utility does not handle EAGAIN / EBUSY errors, it expects
blocking mode on tty - it uses select() to check if data is available.
Disable non-blocking mode by clearing O_NDELAY flag which was set by
open().
We can't just take O_NDELAY from open(), because it is required there
until the CLOCAL flag is set on the tty.
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Pali Rohár [Fri, 24 Sep 2021 21:07:09 +0000 (23:07 +0200)]
tools: kwboot: Disable tty interbyte timeout
Function kwboot_tty_recv() has its own handling of read timeout, we
don't need to do set it in tty settings.
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Fri, 24 Sep 2021 21:07:08 +0000 (23:07 +0200)]
tools: kwboot: Fix initializing tty device
Retrieve current terminal settings via tcgetattr(), set to raw mode with
cfmakeraw(), enable receiver via CREAD and ignore modem control lines
via CLOCAL.
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Marek Behún [Fri, 24 Sep 2021 21:07:07 +0000 (23:07 +0200)]
tools: kwboot: Check whether baudrate was set to requested value
The tcsetattr() function can return 0 even if baudrate was not changed.
Check whether baudrate was changed to requested value, and in case of
arbitrary baudrate, check whether the set value is within 3% tolerance.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Fri, 24 Sep 2021 21:07:06 +0000 (23:07 +0200)]
tools: kwboot: Allow any baudrate on Linux
The A38x platform supports more baudrates than just those defined by the
Bn constants, and some of them are higher than the highest Bn baudrate
(the highest is 4 MBd while A38x support 5.15 MBd).
On Linux, add support for arbitrary baudrates. (Since there is no
standard POSIX API to specify arbitrary baudrate for a tty device, this
change is Linux-specific.)
We need to use raw TCGETS2/TCSETS2 or TCGETS/TCSETS ioctls with the
BOTHER flag in struct termios2/termios, defined in Linux headers
<asm/ioctls.h> (included by <sys/ioctl.h>) and <asm/termbits.h>. Since
these headers conflict with glibc's header file <termios.h>, it is not
possible to use libc's termios functions and we need to reimplement them
via ioctl() calls.
Note that the Bnnn constants from <termios.h> need not be compatible
with Bnnn constants from <asm/termbits.h>.
Signed-off-by: Pali Rohár <pali@kernel.org>
[ termios macros rewritten to static inline functions (for type control)
and moved to tools/termios_linux.h ]
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Fri, 24 Sep 2021 21:07:05 +0000 (23:07 +0200)]
tools: kwboot: Support higher baudrates when booting via UART
Add support for uploading the boot image (the data part only) at higher
baudrate than the standard one.
The kwboot utility already has -B option, but choosing other baudrate
than the standard one (115200 Bd) can only work for debug mode, not for
booting the device. The BootROM for kwboot supported platforms (Orion,
Kirkwood, Dove, Discovery, AXP, A37x, A38x, A39x) cannot change the
baudrate when uploading boot image via the Xmodem protocol, nor can it
be configured via strapping pins.
So instead we add this support by injecting baudrate changing code into
the kwbimage v1 header as a new optional binary extension. This code is
executed by BootROM after it receives the whole header. The code sends
the magic string "$baudratechange\0" just before changing the baudrate
to let kwboot know that it should also change it. This is because the
injected code is run as the last binary extension, and we do not want
to loose possible output from other possible binary extensions that
came before it (in most cases this is U-Boot SPL).
We also inject the code before the payload (the data part of the image),
to change the baudrate back to the standard value, in case the payload
does not reset UART.
This change improves boot time via UART significantly (depending on the
chosen baudrate), which is very useful when debugging.
Signed-off-by: Pali Rohár <pali@kernel.org>
[ major refactor ]
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Marek Behún [Fri, 24 Sep 2021 21:07:04 +0000 (23:07 +0200)]
tools: kwboot: Explicitly check against size of struct main_hdr_v1
Explicitly check the image size against size of struct main_hdr_v1.
This way the check is more readable, since the `hdrsz` variable
may semantically contain another value.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Fri, 24 Sep 2021 21:07:03 +0000 (23:07 +0200)]
tools: kwboot: Round up header size to 128 B when patching
The beginning of image data must be sent in a separate xmodem block;
the block must not contain end of header with the beginning of data.
Therefore we need to ensure that the image header size is a multiple of
xmodem block size (which is 128 B).
Read the file into a malloc()ed buffer of enough size instead of
mmap()ing it. (If we are going to move the data, most of the pages will
be dirty anyway.) Then move the payload if header size needs to be
increased.
Signed-off-by: Pali Rohár <pali@kernel.org>
[ refactored ]
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Fri, 24 Sep 2021 21:07:02 +0000 (23:07 +0200)]
tools: kwbimage: Update comments describing kwbimage v1 structures
These structures are relevant for several other platforms, mention them
all.
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Marek Behún [Fri, 24 Sep 2021 21:07:01 +0000 (23:07 +0200)]
tools: kwbimage: Refactor kwbimage header size determination
Add functions kwbheader_size() and kwbheader_size_for_csum().
Refactor code determining header size to use these functions.
Refactor header checksum determining function.
Remove stuff that is not needed anymore.
This simplifies the code a little and fixes one instance of validating
header size meant for checksum instead of whole header size.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Marek Behún [Fri, 24 Sep 2021 21:07:00 +0000 (23:07 +0200)]
tools: kwbimage: Refactor image_version()
Rename this function to kwbimage_version() and don't cast argument if
not needed.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Fri, 24 Sep 2021 21:06:59 +0000 (23:06 +0200)]
tools: kwboot: Patch destination address to DDR area for SPI image
SPI/NOR kwbimage may have destination address set to 0xFFFFFFFF, which
means that the image is not downloaded to DDR but rather it is executed
directly from SPI/NOR. In this case execution address is set to SPI/NOR
area.
When patching image to UART type, change destination and execution
addresses from SPI/NOR XIP area to DDR area 0x00800000 (which is default
for A38x).
Signed-off-by: Pali Rohár <pali@kernel.org>
[ refactored ]
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Fri, 24 Sep 2021 21:06:58 +0000 (23:06 +0200)]
tools: kwboot: Patch source address in image header
Some image types have source address in non-bytes unit; for example for
SATA images, it is in 512 B units.
We need to multiply by unit size when patching image type to UART.
Signed-off-by: Pali Rohár <pali@kernel.org>
[ refactored ]
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Fri, 24 Sep 2021 21:06:57 +0000 (23:06 +0200)]
tools: kwboot: Don't patch image header if signed
It is not possible to modify image with secure header due to
cryptographic signature.
Signed-off-by: Pali Rohár <pali@kernel.org>
[ refactored ]
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Marek Behún [Tue, 17 Aug 2021 22:59:15 +0000 (00:59 +0200)]
tools: kwbimage: Simplify iteration over version 1 optional headers
Create macro
for_each_opt_hdr_v1
and functions
opt_hdr_v1_size(),
opt_hdr_v1_valid_size(),
opt_hdr_v1_ext(),
opt_hdr_v1_first() and
opt_hdr_v1_next()
to simplify iteration over version 1 optional headers.
This prevents ugly code repetition and makes it nicer to read.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Pali Rohár [Fri, 24 Sep 2021 21:06:55 +0000 (23:06 +0200)]
tools: kwboot: Always call kwboot_img_patch_hdr()
The kwboot_img_patch_hdr() function already decides if header patching
is needed. Always call this function and deprecate the unneeded command
line option `-p`.
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>
Pali Rohár [Fri, 24 Sep 2021 21:06:54 +0000 (23:06 +0200)]
tools: kwboot: Properly finish xmodem transfer
After kwboot sends EOT, BootROM sends back ACK. Add code for handling
this and retry sending EOT on error.
Signed-off-by: Pali Rohár <pali@kernel.org>
[ refactored ]
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Marek Behún [Fri, 24 Sep 2021 21:06:53 +0000 (23:06 +0200)]
tools: kwboot: Prevent waiting indefinitely if no xmodem reply is received
Currently if BootROM fails to respond with ACK/NAK to a xmodem block, we
will be waiting indefinitely for such response.
Make sure that we only wait at most 1 second (blk_rsp_timeo) for ACK/NAK
for each block in case non-xmodem text output is not being expected.
Interpret this timeout expiration as NAK, to try to send the block
again.
On the other hand, if timeout expires without ACK while some non-xmodem
output was already received (DDR training output, for example), we know
that the block was received, since the code is being executed, so in
this case exit with ETIMEDOUT.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Marek Behún [Fri, 24 Sep 2021 21:06:52 +0000 (23:06 +0200)]
tools: kwboot: Allow greater timeout when executing header code
When executing header code (which contains U-Boot SPL in most cases),
wait 10s after every non-xmodem character received (i.e. printed by
U-Boot SPL) before timing out.
Sometimes DDR training, which runs in SPL, may be slow.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Marek Behún [Fri, 24 Sep 2021 21:06:51 +0000 (23:06 +0200)]
tools: kwboot: Print new line after SPL output
There is no separation between output from the code from binary header
(U-Boot SPL in most cases) and subsequent kwboot output.
Print '\n' to make distinguishing these two easier.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Fri, 24 Sep 2021 21:06:50 +0000 (23:06 +0200)]
tools: kwboot: Allow non-xmodem text output from BootROM only in a specific case
When sending image header / image data, BootROM does not send any
non-xmodem text output. We should therefore interpret unknown bytes in
the xmodem protocol as errors and resend current packet. This should
improve the transfer in case there are errors on the UART line.
Text output from BootROM may only happen after whole image header is
sent and before ACK for the last packet of image header is received.
In this case BootROM may execute code from the image, which may interact
with UART (U-Boot SPL, for example, prints stuff on UART).
Print received non-xmodem output from BootROM only in this case.
Signed-off-by: Pali Rohár <pali@kernel.org>
[ refactored & simplified ]
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Marek Behún [Fri, 24 Sep 2021 21:06:49 +0000 (23:06 +0200)]
tools: kwboot: Use a function to check whether received byte is a Xmodem reply
This is a non-functional change that should make the code more readable.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Fri, 24 Sep 2021 21:06:48 +0000 (23:06 +0200)]
tools: kwboot: Split sending image into header and data stages
This change is required to implement other features in kwboot.
Split sending header and data parts of the image into two stages.
Signed-off-by: Pali Rohár <pali@kernel.org>
[ refactored ]
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Fri, 24 Sep 2021 21:06:47 +0000 (23:06 +0200)]
tools: kwboot: Print newline on error when progress was not completed
When progress was not completed, current terminal position is in progress
bar. So print newline before printing error message to make error message
more readable.
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>
Pali Rohár [Fri, 24 Sep 2021 21:06:46 +0000 (23:06 +0200)]
tools: kwboot: Fix printing progress
Ensure that `pos` is still in range up to the `width` so printing 100%
works also for bigger images. After printing 100% progress reset it to
zero, so that next progressbar can be started.
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>
Marek Behún [Fri, 24 Sep 2021 21:06:45 +0000 (23:06 +0200)]
tools: kwboot: Fix comparison of integers with different size
The compiler complains that we are comparing int with size_t when
compiled with -W.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Fri, 24 Sep 2021 21:06:44 +0000 (23:06 +0200)]
tools: kwboot: Fix return type of kwboot_xm_makeblock() function
Function kwboot_xm_makeblock() always returns length of xmodem block. It
is always non-negative and calculated from variable with size_t type. Set
return type of this function to size_t and remove dead code which checks
for negative value.
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>
Pali Rohár [Fri, 24 Sep 2021 21:06:43 +0000 (23:06 +0200)]
tools: kwboot: Fix kwboot_xm_sendblock() function when kwboot_tty_recv() fails
When kwboot_tty_recv() fails or times out, it does not set the `c`
variable to NAK. The variable is then compared, while it holds either
an undefined value or a value from previous iteration. Set `c` to NAK so
that the other side will try to resend current block, and remove the
now unnecessary break.
In other failure cases return immediately.
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>
Pali Rohár [Fri, 24 Sep 2021 21:06:42 +0000 (23:06 +0200)]
tools: kwboot: Print version information header
Print kwboot's (U-Boot's) version when printing usage.
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>
Marek Behún [Fri, 24 Sep 2021 21:06:41 +0000 (23:06 +0200)]
tools: kwboot: Refactor and fix writing buffer
There are 3 instances in kwboot.c where we need to write() a given
buffer whole (iteratively writing until all data are written), and 2 of
those instances are wrong, for they do not increment the buffer pointer.
Refactor the code into a new function kwboot_write() where it is fixed.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Marek Behún [Fri, 24 Sep 2021 21:06:40 +0000 (23:06 +0200)]
tools: kwboot: Make the quit sequence buffer const
This buffer is never written to. Make it const.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Marek Behún [Fri, 24 Sep 2021 21:06:39 +0000 (23:06 +0200)]
tools: kwboot: Fix buffer overflow in kwboot_terminal()
The `in` variable is set to -1 in kwboot_terminal() if stdin is not a
tty. In this case we should not look whether -1 is set in fd_set, for it
can lead to a buffer overflow, which can be reproduced with
echo "xyz" | ./tools/kwboot -t /dev/ttyUSB0
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Marek Behún [Fri, 24 Sep 2021 21:06:38 +0000 (23:06 +0200)]
tools: kwbimage: Fix printf format warning
On 32-bit ARM the compiler complains:
tools/kwbimage.c:547: warning: format ‘%lu’ expects argument of type
‘long unsigned int’, but argument 4 has
type ‘unsigned int’
Fix this by using %zu instead of %lu format specifier.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Tom Rini [Thu, 30 Sep 2021 16:33:46 +0000 (12:33 -0400)]
Azure/GitLab CI: Update docker image
Rebuild our current docker image so that ca-certificates will be updated
and Let's Encrypt issued certificates will work again.
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Thu, 30 Sep 2021 15:36:10 +0000 (11:36 -0400)]
Azure/GitLab CI: Update docker image
Rebuild our current docker image so that ca-certificates will be updated
and Let's Encrypt issued certificates will work again.
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Thu, 30 Sep 2021 15:29:41 +0000 (11:29 -0400)]
Merge tag 'xilinx-for-v2022.01-rc1' of https://source.denx.de/u-boot/custodians/u-boot-microblaze into next
Xilinx changes for v2022.01-rc1
zynq:
- Enable capsule update for qspi and mmc
- Update zed DT qspi compatible string
zynqmp:
- Add missing modeboot for EMMC
- Add missing nand DT properties
- List all eeproms for SC on vck190
- Add vck190 SC psu_init
clk:
- Handle only GATE type clock for Versal
watchdog:
- Update versal driver to handle system reset
Tom Rini [Thu, 30 Sep 2021 14:26:43 +0000 (10:26 -0400)]
Merge branch '2021-09-30-whitespace-cleanups' into next
- A large number of whitespace cleanups from Wolfgang
Wolfgang Denk [Mon, 27 Sep 2021 15:42:39 +0000 (17:42 +0200)]
WS cleanup: remove SPACE(s) followed by TAB
Signed-off-by: Wolfgang Denk <wd@denx.de>
Wolfgang Denk [Mon, 27 Sep 2021 15:42:38 +0000 (17:42 +0200)]
WS cleanup: remove trailing white space
Signed-off-by: Wolfgang Denk <wd@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Wolfgang Denk [Mon, 27 Sep 2021 15:42:37 +0000 (17:42 +0200)]
WS cleanup: remove excessive empty lines
Signed-off-by: Wolfgang Denk <wd@denx.de>
Wolfgang Denk [Mon, 27 Sep 2021 15:42:36 +0000 (17:42 +0200)]
WS cleanup: remove trailing empty lines
Signed-off-by: Wolfgang Denk <wd@denx.de>
Ashok Reddy Soma [Tue, 28 Sep 2021 06:01:59 +0000 (11:31 +0530)]
watchdog: versal: Add support for expire now
Wdt expire command makes the wdt to count least possible ticks(1)
and expires immediately. Add expire_now option to the xlnx_wwdt_ops
and implement it by calling xlnx_wwdt_start() with minimum possible
count(1).
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/1632808919-8600-3-git-send-email-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Ashok Reddy Soma [Tue, 28 Sep 2021 06:01:58 +0000 (11:31 +0530)]
watchdog: versal: Add support for basic window watchdog
Existing driver uses generic watchdog mode which generates a signal to
PLM firmware, but the signal cannot be used to reset the system.
Change driver to use window watchdog basic mode. This window watchdog mode
generates a signal to PLM firmware which decides what action to take upon
expiry of watchdog.
Timeout value for xlnx_wwdt_start will come in milli seconds from wdt
framework. Make changes to load count value accordingly.
Add checks before loading the timer for min and max possible values.
Fix authour email id of Ashok Reddy Soma to long email id.
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/1632808919-8600-2-git-send-email-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
T Karthik Reddy [Tue, 28 Sep 2021 06:00:27 +0000 (11:30 +0530)]
clk: versal: Enable only GATE type clocks
Clocks should be enabled or disabled only if they are of GATE type
clocks. If they are not of GATE type clocks, don't touch them.
Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Link: https://lore.kernel.org/r/1632808827-6109-1-git-send-email-ashok.reddy.soma@xilinx.com
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Michal Simek [Fri, 24 Sep 2021 13:06:18 +0000 (15:06 +0200)]
arm64: zynqmp: Add psu_init_gpl for vck190/vmk180 SC
Add psu_init_gpl file for getting SPL to work directly from the tree.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/6675723ad52d29982e62c6ca4832ed18688076cb.1632488774.git.michal.simek@xilinx.com
Michal Simek [Fri, 24 Sep 2021 13:04:57 +0000 (15:04 +0200)]
arm64: zynqmp: Define all eeproms for SC on vck190
There are multiple eeproms on vck190 that's why list all of them.
FMC eeproms are present only when fmcs are plugged.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/96902661e3ab9e20b59d626e6129ccf6f3317c4d.1632488695.git.michal.simek@xilinx.com
Michal Simek [Wed, 15 Sep 2021 14:22:31 +0000 (16:22 +0200)]
arm: zynq: Use s25fl256s1 compatible string on zedboard
Use compatible string which is listed in the Linux kernel.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/49bc6b056b0f6f69d4d90351dc875a66b7e37619.1631715748.git.michal.simek@xilinx.com
Amit Kumar Mahapatra [Wed, 15 Sep 2021 13:46:36 +0000 (15:46 +0200)]
arm64: zynqmp: Add device tree properties for nand flash
Add ecc strength & ecc step size properties for nand flash devices,
when operating in software-ecc mode.
Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/866f4b888129ff0213df9cdb51b5529b199fb7b7.1631713594.git.michal.simek@xilinx.com
Ashok Reddy Soma [Wed, 15 Sep 2021 06:52:17 +0000 (08:52 +0200)]
xilinx: zynqmp: Set modeboot env variable in eMMC bootmode
Set environment variable modeboot to "emmcboot" in case of eMMC boot
mode.
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/c61231e4b8c6118862dfc82e923211637bf29991.1631688736.git.michal.simek@xilinx.com
Michal Simek [Fri, 27 Aug 2021 10:53:32 +0000 (12:53 +0200)]
ARM: zynq: Enable capsule update for qspi and mmc
Generate dfu_alt_info setup at runtime for capsule update.
Enabling this feature will help with upgrading boards without remembering
what is where.
The similar change was done for ZynqMP by commit
b86f43de0be0 ("xilinx:
zynqmp: Add support for runtime dfu_alt_info setup").
Code needs to be enabled by CONFIG_SET_DFU_ALT_INFO.
And also enable capsule on disk for RAW firmware images with efidebug
command.
Two indexes are supported for SPL flow. Images can be generated like:
./tools/mkeficapsule --raw spl/boot.bin --index 1 capsule1.bin
./tools/mkeficapsule --raw u-boot.img --index 2 capsule2.bin
Then place them to SD card and load them:
load mmc 0
10000000 capsule1.bin && efidebug capsule update -v
10000000
load mmc 0
10000000 capsule2.bin && efidebug capsule update -v
10000000
FSBL flow will also work where only index 1 capsule is used. There
should be enough space for using boot.bin with bitstream too.
Zynq also support multiple boot locations in SPI or MMC but it is not wired
by this patch.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/bea5fc75a87a5971f118b46bab4aa7ca39a629c6.1630061610.git.michal.simek@xilinx.com
Tom Rini [Wed, 29 Sep 2021 19:13:35 +0000 (15:13 -0400)]
Merge tag 'rpi-next-2021.10.2' of https://source.denx.de/u-boot/custodians/u-boot-raspberrypi
- fix usb stopt; usb start; bug
- update Nicolas email address
Tom Rini [Wed, 29 Sep 2021 19:13:11 +0000 (15:13 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell
- Armada8k: Fix CP0 eMMC/SDIO support (Robert)
Marek Szyprowski [Fri, 17 Sep 2021 08:19:43 +0000 (10:19 +0200)]
arm: rpi: perform XHCI firmware upload only once
XHCI firmware upload must be performed only once after initializing the
PCI bridge. This fixes USB stack initialization after calling "usb stop;
usb start" on Raspberry Pi 4B.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Nicolas Saenz Julienne [Thu, 16 Sep 2021 09:55:48 +0000 (11:55 +0200)]
mailmap: Update mail address for Nicolas Saenz julienne
The @suse.de address doesn't exist anymore. Update it to something not
dependent on my workplace.
Signed-off-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Tom Rini [Wed, 29 Sep 2021 11:58:20 +0000 (07:58 -0400)]
Merge branch 'network_master' of https://source.denx.de/u-boot/custodians/u-boot-net into next
- Fix some non-NULL terminated strings in the networking subsystem
- net: tsec: Mark tsec_get_interface as __maybe_unused
Robert Marko [Mon, 27 Sep 2021 21:03:26 +0000 (23:03 +0200)]
arm: dts: armada8040: Fix CP0 eMMC/SDIO support
During the migration to a single DTSI for the CP110-s specific pinctrl
compatibles were moved to the SoC DTSI as CP0 and CP1 have some specifics.
Namely, CP0 eMMC/SDIO support depends on the mvebu-pinctrl driver setting
the BIT(0) in eMMC PHY IO Control 0 Register to 0 in order for the connect
the eMMC/SDIO PHY to the controller and not use it as a MPP pin multiplexor.
So, the mvebu-pinctrl driver check specifically for the
"marvell,armada-8k-cpm-pinctrl" compatible to clear the that bit.
Issue is that compatibles in the 8040 DTSI were set to "marvell,8k-cpm-pinctrl"
for CP0 and "marvell,8k-cps-pinctrl" for the CP1.
This is obviously incorrect as the pinctrl driver does not know about these.
So fix the regression by applying correct compatibles to the DTSI.
Regression found and tested on the Puzzle M801 board.
Fixes: a0ba97e5 ("arm: armada: dts: Use a single dtsi for cp110 die description")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Stefan Roese <sr@denx.de>
Tom Rini [Tue, 28 Sep 2021 23:18:56 +0000 (19:18 -0400)]
Merge branch '2021-09-25-TI-platform-updates' into next
- Start moving some TI board docs to rST
- Assorted TI-specific Kconfig migrations and namespace cleanups. This
also allows for some code cleanups.