summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-10-04mtd: cqspi: Fix division by zeroMarek Vasut
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 <[email protected]> Cc: Jagan Teki <[email protected]> Cc: Vignesh R <[email protected]> Cc: Pratyush Yadav <[email protected]> [trini: Drop Pratyush's RB as his requested changes weren't made as Marek disagreed]
2021-10-03Merge branch '2021-10-03-platform-updates' into nextTom Rini
- TI K3 updates, add IOT2050 platform - rtc rx8025 updates, PCI fixes
2021-10-03iot2050: Enable watchdog support, but do not auto-start itJan Kiszka
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 <[email protected]>
2021-10-03watchdog: rti_wdt: Add support for loading firmwareJan Kiszka
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 <[email protected]>
2021-10-03board: siemens: Add support for SIMATIC IOT2050 devicesJan Kiszka
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 <[email protected]>
2021-10-03arm: dts: Add IOT2050 device tree filesJan Kiszka
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 <[email protected]>
2021-10-03pci: pcie_layerscape_fixup_common: lx2_board_fix_fdt can be staticVladimir Oltean
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 <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2021-10-03pci: pcie_layerscape_fixup_common: include fdt_support.h for ft_pci_setupVladimir Oltean
The function prototype for ft_pci_setup is inside fdt_support.h, we need to include that header. Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2021-10-03pci: layerscape: ls_pcie_conf_address can be staticVladimir Oltean
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 <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2021-10-03pci: _dm_pci_phys_to_bus can be staticVladimir Oltean
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 <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2021-10-03pci: pci_read_config can be staticVladimir Oltean
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 <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2021-10-03pci: pci_write_config can be staticVladimir Oltean
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 <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2021-10-03pci: pciinfo_header can be staticVladimir Oltean
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 <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2021-10-03pci: pci_header_show can be staticVladimir Oltean
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 <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2021-10-03pci: pci_bar_show can be staticVladimir Oltean
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 <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2021-10-03pci: include pci_internal.h inside pci_auto.cVladimir Oltean
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 <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2021-10-03pci: provide prototype for pci_skip_dev outside of #if ↵Vladimir Oltean
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 <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2021-10-03rtc: rx8025: revise single register write to use offsetMathew McBride
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 <[email protected]>
2021-10-03rtc: rx8025: set date in a single i2c transactionMathew McBride
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 <[email protected]>
2021-10-03rtc: rx8025: add support for EPSON RX8035.Mathew McBride
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/[email protected]/ 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 <[email protected]>
2021-10-03rtc: rx8025: drop non-DM supportMathew McBride
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 <[email protected]>
2021-10-03ARM: dts: ast2600: Make WDT by default disabledChia-Wei Wang
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 <[email protected]> Reviewed-by: Ryan Chen <[email protected]>
2021-10-03arm: ti: k3: Resync dts files and bindings with Linux Kernel v5.14Tom Rini
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 <[email protected]>
2021-10-03dt-bindings: pinctrl: k3: Synchronize with v5.14 kernelNishanth Menon
Synchronize with the upstream version as of v5.14 kernel tag Signed-off-by: Nishanth Menon <[email protected]>
2021-10-02Merge branch '2021-10-01-assorted-removal-and-migration' into nextTom Rini
- 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.
2021-10-01serial: Remove extraneous SYS_MALLOC_F checkTom Rini
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 <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2021-10-01serial: Use the default CONFIG_SYS_BAUDRATE_TABLE in more platformsTom Rini
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 <[email protected]>
2021-10-01Convert CONFIG_BAUDRATE to KconfigTom Rini
This converts the following to Kconfig: CONFIG_BAUDRATE Signed-off-by: Tom Rini <[email protected]>
2021-10-01kgdb: Remove unused serial related optionsTom Rini
We have a few CONFIG options for KGDB that are not referenced, remove them. Signed-off-by: Tom Rini <[email protected]>
2021-10-01ppc: Remove MPC8349EMDS board and ARCH_MPC8349 supportTom Rini
This board has not been converted to CONFIG_DM by the deadline. Remove it. Cc: Priyanka Jain <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2021-10-01arm: Remove bg0900 boardTom Rini
This board has not been converted to CONFIG_DM by the deadline. Remove it. Cc: Marek Vasut <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2021-10-01arm: Remove zmx25 board and ARCH_MX25Tom Rini
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 <[email protected]> Cc: Stefano Babic <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2021-10-01arm: Remove aspenite boardTom Rini
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 <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2021-10-01arm: Remove flea3 boardTom Rini
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 <[email protected]> Signed-off-by: Tom Rini <[email protected]> Acked-by: Stefano Babic <[email protected]>
2021-10-01Merge branch 'next' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-marvell into next - kwboot higher baudrate (Pali & Marek)
2021-10-01MAINTAINERS: Add entry for kwbimage / kwboot toolsMarek Behún
Add entry for these tools with Marek, Pali and Stefan as maintainers. Signed-off-by: Marek Behún <[email protected]>
2021-10-01doc/kwboot.1: Update man pageMarek Behún
Update man page for the kwboot utility. Signed-off-by: Marek Behún <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2021-10-01tools: kwboot: Add Pali and Marek as authorsPali Rohár
Add Pali and Marek as another authors of the kwboot utility. Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Marek Behún <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2021-10-01tools: kwboot: Update file headerMarek Behún
Mention all supported platforms in file header. Signed-off-by: Marek Behún <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2021-10-01tools: kwboot: Avoid code repetition in kwboot_img_patch()Marek Behún
Change kwboot_img_patch() to avoid code repetition of setting errno to EINVAL. Signed-off-by: Marek Behún <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2021-10-01tools: kwboot: Cosmetic fixMarek Behún
Add spaces around the | operator. Signed-off-by: Marek Behún <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2021-10-01tools: kwboot: Disable non-blocking modePali Rohár
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 <[email protected]> Signed-off-by: Marek Behún <[email protected]>
2021-10-01tools: kwboot: Disable tty interbyte timeoutPali Rohár
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 <[email protected]> Signed-off-by: Marek Behún <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2021-10-01tools: kwboot: Fix initializing tty devicePali Rohár
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 <[email protected]> Signed-off-by: Marek Behún <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2021-10-01tools: kwboot: Check whether baudrate was set to requested valueMarek Behún
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 <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2021-10-01tools: kwboot: Allow any baudrate on LinuxPali Rohár
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 <[email protected]> [ termios macros rewritten to static inline functions (for type control) and moved to tools/termios_linux.h ] Signed-off-by: Marek Behún <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2021-10-01tools: kwboot: Support higher baudrates when booting via UARTPali Rohár
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 <[email protected]> [ major refactor ] Signed-off-by: Marek Behún <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2021-10-01tools: kwboot: Explicitly check against size of struct main_hdr_v1Marek Behún
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 <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2021-10-01tools: kwboot: Round up header size to 128 B when patchingPali Rohár
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 <[email protected]> [ refactored ] Signed-off-by: Marek Behún <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2021-10-01tools: kwbimage: Update comments describing kwbimage v1 structuresPali Rohár
These structures are relevant for several other platforms, mention them all. Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Marek Behún <[email protected]> Reviewed-by: Stefan Roese <[email protected]>