]> git.baikalelectronics.ru Git - uboot.git/log
uboot.git
2 years agolib: crypto: add mscode_parser
AKASHI Takahiro [Tue, 5 Jul 2022 05:48:11 +0000 (14:48 +0900)]
lib: crypto: add mscode_parser

In MS authenticode, pkcs7 should have data in its contentInfo field.
This data is tagged with SpcIndirectData type and, for a signed PE image,
provides a image's message digest as SpcPeImageData.

This parser is used in image authentication to parse the field and
retrieve a message digest.

Imported from linux v5.19-rc, crypto/asymmetric_keys/mscode*.
Checkpatch.pl generates tones of warnings, but those are not fixed
for the sake of maintainability (importing from another source).

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2 years agoPrepare v2022.07-rc6
Tom Rini [Mon, 4 Jul 2022 12:18:33 +0000 (08:18 -0400)]
Prepare v2022.07-rc6

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 4 Jul 2022 12:15:34 +0000 (08:15 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agousb: host: ehci-generic: Fix error check
Andre Przywara [Sat, 2 Jul 2022 00:45:10 +0000 (01:45 +0100)]
usb: host: ehci-generic: Fix error check

Commit b38a0ac9f2ee ("usb: host: ehci-generic: Make resets and clocks
optional") improved the error check to cover the reset property being
optional. However this was using the wrong error variable for the
check, so would now never fail.

Use the correct error variable for checking the result of
reset_get_bulk(), to actually report genuine errors.

Fixes: b38a0ac9f2ee ("usb: host: ehci-generic: Make resets and clocks optional")
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agoMerge tag 'efi-2022-07-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 2 Jul 2022 13:55:26 +0000 (09:55 -0400)]
Merge tag 'efi-2022-07-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-07-rc6

UEFI:

* Fix EFI_IO_BLOCK_PROTOCOL: read correct blocks on partitions

Other:

* Honor CONFIG_SYS_64BIT_LBA in the disk uclass

2 years agoMerge branch '2022-07-01-additional-critical-fixes-and-updates'
Tom Rini [Sat, 2 Jul 2022 13:54:46 +0000 (09:54 -0400)]
Merge branch '2022-07-01-additional-critical-fixes-and-updates'

- Update some MAINTAINERS entries, fix a regression on FIT images

2 years agoEFI: Fix ReadBlocks API reading incorrect sector for UCLASS_PARTITION devices
Paul Barbieri [Thu, 30 Jun 2022 11:02:04 +0000 (07:02 -0400)]
EFI: Fix ReadBlocks API reading incorrect sector for UCLASS_PARTITION devices

The requsted partition disk sector incorrectly has the parition start
sector added in twice for UCLASS_PARTITION devices. The efi_disk_rw_blocks()
routine adds the diskobj->offset to the requested lba. When the device
is a UCLASS_PARTITION, the dev_read() or dev_write() routine is called
which adds part-gpt_part_info.start. This causes I/O to the wrong sector.

Takahiro Akashi suggested removing the offset field from the efi_disk_obj
structure since disk-uclass.c handles the partition start biasing. Device
types other than UCLASS_PARTITION set the diskobj->offset field to zero
which makes the field unnecessary. This change removes the offset field
from the structure and removes all references from the code which is
isolated to the lib/efi_loader/efi_disk.c module.

This change also adds a test for the EFI ReadBlocks() API in the EFI
selftest code. There is already a test for reading a FAT file. The new
test uses ReadBlocks() to read the same "disk" block and compare it to
the data read from the file system API.

Signed-Off-by: Paul Barbieri <plb365@gmail.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodisk: honor CONFIG_SYS_64BIT_LBA
Heinrich Schuchardt [Sat, 2 Jul 2022 12:07:48 +0000 (14:07 +0200)]
disk: honor CONFIG_SYS_64BIT_LBA

Without the patch for qemu-x86_defconfig:

* sizeof(lbaint_t) = 4 in dev_read()
* sizeof(lbaint_t) = 8 in blkcache_read()

CONFIG_SYS_64BIT_LBA is defined in common.h via
include/configs/x86-common.h:22.

We have to include common.h before including blk.h.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoimage: fit: Use stack allocation macro
Joel Stanley [Mon, 20 Jun 2022 07:01:17 +0000 (16:31 +0930)]
image: fit: Use stack allocation macro

The documentation above the DEFINE_ALIGN_BUFFER says it's for use
outside functions, but we're inside one.

Instead use ALLOC_CACHE_ALIGN_BUFFER, the stack based macro, which also
includes the cache alignment.

Fixes: 4ec8564f5550 ("image: fit: Align hash output buffers")
Signed-off-by: Joel Stanley <joel@jms.id.au>
Tested-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
2 years agoMAINTAINERS: Add Dario and Michael as NAND maintainers
Michael Trimarchi [Wed, 29 Jun 2022 15:57:51 +0000 (17:57 +0200)]
MAINTAINERS: Add Dario and Michael as NAND maintainers

Both of us are working on NAND subsystem on several architectures and
we have boards and projects to improve the subsystem in uboot. The idea
is to guarantee quick feedback on patches sent on mailing list and most
of the time the possibilities to test them.

Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Acked-by: Tom Rini <trini@konsulko.com>
2 years agoboard/BuR/*: replace maintainer of BuR boards
Hannes Schmelzer [Wed, 29 Jun 2022 10:11:40 +0000 (12:11 +0200)]
board/BuR/*: replace maintainer of BuR boards

Since I'm leaving the company with end of June, the maintainership will
be transferred to Wolfgang Wallner.

Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
2 years agochameleonv3: Add MAINTAINERS file
Tom Rini [Fri, 1 Jul 2022 19:55:54 +0000 (15:55 -0400)]
chameleonv3: Add MAINTAINERS file

This file was missing, add.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge commit 'a77019ba2c9b5b7d3f830d29d45348a15ce1d0ce' of https://github.com/tienfon...
Tom Rini [Fri, 1 Jul 2022 13:14:32 +0000 (09:14 -0400)]
Merge commit 'a77019ba2c9b5b7d3f830d29d45348a15ce1d0ce' of https://github.com/tienfong/uboot_mainline

2 years agoMerge tag 'u-boot-amlogic-20220701' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Fri, 1 Jul 2022 13:13:58 +0000 (09:13 -0400)]
Merge tag 'u-boot-amlogic-20220701' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- search dtb for meson-axg-usb-ctrl on board axg

2 years agodrivers: clk: Update license for Intel N5X device
Teik Heng Chong [Wed, 29 Jun 2022 05:51:50 +0000 (13:51 +0800)]
drivers: clk: Update license for Intel N5X device

All the source code of clk-mem-n5x.c and clk-n5x.c are from Intel,
update the license to use both GPL2.0 and BSD-3 Clause because this
copy of code may used for open source and internal project.

Signed-off-by: Teik Heng Chong <teik.heng.chong@intel.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
2 years agosocfpga: arria10: Allow dcache_enable before relocation
Paweł Anikiel [Fri, 17 Jun 2022 10:47:26 +0000 (12:47 +0200)]
socfpga: arria10: Allow dcache_enable before relocation

Before relocating to SDRAM, the ECC is initialized by clearing the
whole SDRAM. In order to speed this up, dcache_enable is used (see
sdram_init_ecc_bits).

Since commit 2e4fa5bed8a5 ("arm: cp15: update DACR value to activate
access control"), this no longer works, because running code in OCRAM
with the XN bit set causes a page fault. Override dram_bank_mmu_setup
to disable XN in the OCRAM and setup DRAM dcache before relocation.

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agosocfpga: arria10: Wait for fifo empty after writing bitstream
Paweł Anikiel [Fri, 17 Jun 2022 10:47:25 +0000 (12:47 +0200)]
socfpga: arria10: Wait for fifo empty after writing bitstream

For some reason, on the Mercury+ AA1 module, calling
fpgamgr_wait_early_user_mode immediately after writing the peripheral
bitstream leaves the fpga in a broken state (ddr calibration hangs).
Adding a delay before the first sync word is written seems to fix this.
Inspecting the fpgamgr registers before and after the delay,
imgcfg_FifoEmpty is the only bit that changes. Waiting for this bit
(instead of a hardcoded delay) also fixes the issue.

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agosocfpga: arria10: Improve bitstream loading speed
Paweł Anikiel [Fri, 17 Jun 2022 10:47:24 +0000 (12:47 +0200)]
socfpga: arria10: Improve bitstream loading speed

Apply some optimizations to speed up bitstream loading
(both for full and split periph/core bitstreams):

 * Change the size of the first fs read, so that all the subsequent
   reads are aligned to a specific value (called MAX_FIRST_LOAD_SIZE).
   This value was chosen so that in subsequent reads the fat fs driver
   doesn't have to allocate a temporary buffer in get_contents
   (assuming 8KiB clusters).

 * Change the buffer size to a larger value when reading to ddr
   (but not too large, because large transfers cause a stack overflow
   in the dwmmc driver).

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agosocfpga: arria10: Replace delays with busy waiting in cm_full_cfg
Paweł Anikiel [Fri, 17 Jun 2022 10:47:23 +0000 (12:47 +0200)]
socfpga: arria10: Replace delays with busy waiting in cm_full_cfg

Using udelay while the clocks aren't fully configured causes the timer
system to save the wrong clock rate. Use sdelay and wait_on_value
instead (the values used in these functions were found experimentally).

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
2 years agosysreset: socfpga: Use parent device for reading base address
Paweł Anikiel [Fri, 17 Jun 2022 10:47:22 +0000 (12:47 +0200)]
sysreset: socfpga: Use parent device for reading base address

This driver is a child of the rstmgr driver, both of which share the
same devicetree node. As a result, passing the child's udevice pointer
to dev_read_addr_ptr results in a failure of reading the #address-cells
property. Use the parent udevice pointer instead.

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agomisc: atsha204a: Increase wake delay by tWHI
Paweł Anikiel [Fri, 17 Jun 2022 10:47:21 +0000 (12:47 +0200)]
misc: atsha204a: Increase wake delay by tWHI

From the ATSHA204A datasheet (document DS40002025A):

Wake: If SDA is held low for a period greater than tWLO, the device
exits low-power mode and, after a delay of tWHI, is ready to receive
I2C commands.

tWHI value can be found in table 7-2.

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoconfig: Add Chameleonv3 config
Paweł Anikiel [Fri, 17 Jun 2022 10:47:20 +0000 (12:47 +0200)]
config: Add Chameleonv3 config

Add defconfig and Kconfig files for Google Chameleon V3 board

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoboard: Add Chameleonv3 board dir
Paweł Anikiel [Fri, 17 Jun 2022 10:47:19 +0000 (12:47 +0200)]
board: Add Chameleonv3 board dir

Add board directory for Google Chameleon V3 board

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoarm: dts: Add Chameleonv3 devicetrees
Paweł Anikiel [Fri, 17 Jun 2022 10:47:18 +0000 (12:47 +0200)]
arm: dts: Add Chameleonv3 devicetrees

Add devicetrees for Google Chameleon V3 board

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoarm: dts: Add Chameleonv3 handoff headers
Paweł Anikiel [Fri, 17 Jun 2022 10:47:17 +0000 (12:47 +0200)]
arm: dts: Add Chameleonv3 handoff headers

Add handoff headers for the Google Chameleonv3 variants: 480-2 and
270-3. Both files were generated using qts-filter-a10.sh.

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoarm: dts: Add Mercury+ AA1 devicetrees
Paweł Anikiel [Fri, 17 Jun 2022 10:47:16 +0000 (12:47 +0200)]
arm: dts: Add Mercury+ AA1 devicetrees

Devicetree headers for Mercury+ AA1 module

Signed-off-by: Paweł Anikiel <pan@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoMerge tag 'u-boot-rockchip-20220630' of https://source.denx.de/u-boot/custodians...
Tom Rini [Fri, 1 Jul 2022 02:36:41 +0000 (22:36 -0400)]
Merge tag 'u-boot-rockchip-20220630' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

- Fix for rk3328 nonopi-r2s boot env;
- Fix for rk8xx pmic boot on power plug-in;
- Fix for tee.bin support in fit image;
- rk3288 board dts update or fix;
- Some rk3399 board fix;

2 years agomtd: mxs_nand_spl: fix nand_command protocol violation
Andrea Scian [Tue, 21 Jun 2022 20:05:10 +0000 (22:05 +0200)]
mtd: mxs_nand_spl: fix nand_command protocol violation

mxs_nand_command() implementation assume that it's working with a
LP NAND, which is a common case nowadays and thus uses two bytes
for column address.

However this is wrong for NAND_CMD_READID and NAND_CMD_PARAM, which
expects only one byte of column address, even for LP NANDs.
This leads to ONFI detection problem with some NAND manufacturer (like
Winbond) but not with others (like Samsung and Spansion)

We fix this with a simple workaround to avoid the 2nd byte column address
for those two commands.

Also align the code with nand_base to support 16 bit devices.

Tested on an iMX6SX device with:
* Winbond W29N04GVSIAA
* Spansion S34ML04G100TF100
* Samsung K9F4G08U00

Tested on imx8mn device with:
* Windbond W29N04GV

Signed-off-by: Andrea Scian <andrea.scian@dave.eu>
CC: Stefano Babic <sbabic@denx.de>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agorockchip: pinebook-pro: sync PBP dtb to 5.18
Peter Robinson [Sun, 12 Jun 2022 14:25:29 +0000 (15:25 +0100)]
rockchip: pinebook-pro: sync PBP dtb to 5.18

Sync the pinebook pro to upstream 5.18, in particular this brings
brings in a fix so the DP is disabled so Linux will actually boot.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: rockpro64: enable leds
Peter Robinson [Sun, 12 Jun 2022 13:52:25 +0000 (14:52 +0100)]
rockchip: rockpro64: enable leds

The Rockpro64 has some GPIO leds so let's enable them so the
user gets some output in early boot.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: pinebook-pro: minor SPI flash fixes
Peter Robinson [Sun, 12 Jun 2022 13:47:14 +0000 (14:47 +0100)]
rockchip: pinebook-pro: minor SPI flash fixes

Set a default offset for environment so it doesn't write it to
unexpected locations, drop unneeded mtd config option.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: Add option to prevent booting on power plug-in
Chris Morgan [Fri, 27 May 2022 18:18:20 +0000 (13:18 -0500)]
rockchip: Add option to prevent booting on power plug-in

For Rockchip boards with the all rk8xx series PMICs (excluding the
rk808), it is sometimes desirable to not boot whenever the device is
plugged in. An example would be for the Odroid Go Advance.

This provides a configurable option to check the PMIC says it was
powered because of a plug-in event. If the value is 1 and this option
is selected, the device shuts down shortly after printing a message
to console stating the reason why it's shutting down. Powering up the
board with the power button is not affected.

This patch parallels the work done in the following patch series:
https://lore.kernel.org/u-boot/20220121133732.2397273-1-andre.przywara@arm.com/

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agopower: pmic: rk8xx: Support sysreset shutdown method
Chris Morgan [Fri, 27 May 2022 18:18:19 +0000 (13:18 -0500)]
power: pmic: rk8xx: Support sysreset shutdown method

Add support for sysreset shutdown for this PMIC. The values were pulled
from the various datasheets, but for now it has only been tested on
the rk817 (for an Odroid Go Advance).

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agomach-rockchip: make_fit_atf.py: support OP-TEE tee.bin v1 format
Jerome Forissier [Wed, 11 May 2022 15:35:14 +0000 (17:35 +0200)]
mach-rockchip: make_fit_atf.py: support OP-TEE tee.bin v1 format

This commit adds support for the OP-TEE 'tee.bin' v1 format for Rockchip
platforms.

Since OP-TEE 3.8.0, tee.bin contains meta-data in a proprietary format
in addition to the ELF data. They are essential information for proper
initialization of the TEE core, such as the size of the memory region
covered by the TEE or a compact representation of runtime relocation
data when ASLR is enabled.

With OP-TEE 3.8.0 onwards, 'tee.elf' MUST NOT be used and 'tee.bin'
MUST be used instead. Ignoring this recommendation can lead to crashes
as described in [3].

Link: [1] https://github.com/OP-TEE/optee_os/commit/5dd1570ac5b0f6563b1a9c074533a19107b8222d
Link: [2] https://github.com/OP-TEE/optee_os/blob/3.17.0/scripts/gen_tee_bin.py#L275-L302
Link: [3] https://github.com/OP-TEE/optee_os/issues/4542
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Peter Griffin <peter.griffin@linaro.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2 years agorockchip: rk3328: nanopi-r2s: Use the sdcard for the env
Emmanuel Vadot [Tue, 3 May 2022 18:41:04 +0000 (20:41 +0200)]
rockchip: rk3328: nanopi-r2s: Use the sdcard for the env

The NanoPi-R2S doesn't have eMMC so use the sdcard as the device
to save the environment variables

Signed-off-by: Emmanuel Vadot <manu@FreeBSD.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoarm: dts: rockchip: rk3288: move dma-controller nodes
Johan Jonker [Mon, 2 May 2022 11:22:55 +0000 (13:22 +0200)]
arm: dts: rockchip: rk3288: move dma-controller nodes

In order to better compare the Linux rk3288.dtsi version
with the u-boot version move the dma-controller nodes
to the DT root.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoarm: dts: rockchip: rk3288: sort mipi hdmi lvds and dp nodes
Johan Jonker [Mon, 2 May 2022 10:19:34 +0000 (12:19 +0200)]
arm: dts: rockchip: rk3288: sort mipi hdmi lvds and dp nodes

In order to better compare the Linux rk3288.dtsi version
with the u-boot version sort the mipi,hdmi,lvds and dp nodes.

Changed:
  Rename mipi_dsi label.
  Rename dp nodename.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoarm: dts: rockchip: rk3288: bulk convert gpios to their constant counterparts
Johan Jonker [Mon, 2 May 2022 08:58:27 +0000 (10:58 +0200)]
arm: dts: rockchip: rk3288: bulk convert gpios to their constant counterparts

Bulk convert rk3288 DT gpios to their constant counterparts.

Partial Linux sync for the rk3288.dtsi file.

ARM: dts: rockchip: bulk convert gpios to their constant counterparts
https://lore.kernel.org/all/20190402121852.14442-1-heiko@sntech.de/

sed -i -f script.sed rk3288.dtsi

================================

/rockchip,pins *=/bcheck
b # to end of script
:append-next-line
N
:check
/^[^;]*$/bappend-next-line
s/<RK_GPIO\([0-9]\) /<\1 /g
s/<\([^ ][^ ]*  *\)0 /<\1RK_PA0 /g
s/<\([^ ][^ ]*  *\)1 /<\1RK_PA1 /g
s/<\([^ ][^ ]*  *\)2 /<\1RK_PA2 /g
s/<\([^ ][^ ]*  *\)3 /<\1RK_PA3 /g
s/<\([^ ][^ ]*  *\)4 /<\1RK_PA4 /g
s/<\([^ ][^ ]*  *\)5 /<\1RK_PA5 /g
s/<\([^ ][^ ]*  *\)6 /<\1RK_PA6 /g
s/<\([^ ][^ ]*  *\)7 /<\1RK_PA7 /g
s/<\([^ ][^ ]*  *\)8 /<\1RK_PB0 /g
s/<\([^ ][^ ]*  *\)9 /<\1RK_PB1 /g
s/<\([^ ][^ ]*  *\)10 /<\1RK_PB2 /g
s/<\([^ ][^ ]*  *\)11 /<\1RK_PB3 /g
s/<\([^ ][^ ]*  *\)12 /<\1RK_PB4 /g
s/<\([^ ][^ ]*  *\)13 /<\1RK_PB5 /g
s/<\([^ ][^ ]*  *\)14 /<\1RK_PB6 /g
s/<\([^ ][^ ]*  *\)15 /<\1RK_PB7 /g
s/<\([^ ][^ ]*  *\)16 /<\1RK_PC0 /g
s/<\([^ ][^ ]*  *\)17 /<\1RK_PC1 /g
s/<\([^ ][^ ]*  *\)18 /<\1RK_PC2 /g
s/<\([^ ][^ ]*  *\)19 /<\1RK_PC3 /g
s/<\([^ ][^ ]*  *\)20 /<\1RK_PC4 /g
s/<\([^ ][^ ]*  *\)21 /<\1RK_PC5 /g
s/<\([^ ][^ ]*  *\)22 /<\1RK_PC6 /g
s/<\([^ ][^ ]*  *\)23 /<\1RK_PC7 /g
s/<\([^ ][^ ]*  *\)24 /<\1RK_PD0 /g
s/<\([^ ][^ ]*  *\)25 /<\1RK_PD1 /g
s/<\([^ ][^ ]*  *\)26 /<\1RK_PD2 /g
s/<\([^ ][^ ]*  *\)27 /<\1RK_PD3 /g
s/<\([^ ][^ ]*  *\)28 /<\1RK_PD4 /g
s/<\([^ ][^ ]*  *\)29 /<\1RK_PD5 /g
s/<\([^ ][^ ]*  *\)30 /<\1RK_PD6 /g
s/<\([^ ][^ ]*  *\)31 /<\1RK_PD7 /g
s/<\([^ ][^ ]*  *[^ ][^ ]*  *\)0 /<\1RK_FUNC_GPIO /g
s/<\([^ ][^ ]*  *[^ ][^ ]*  *\)RK_FUNC_\([1-9]\) /<\1\2 /g

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoarm: dts: rockchip: remove usb-phy fallback string for rk3188
Johan Jonker [Fri, 29 Apr 2022 21:40:08 +0000 (23:40 +0200)]
arm: dts: rockchip: remove usb-phy fallback string for rk3188

With the conversion of rockchip-usb-phy.yaml a long time used fallback
string for rk3066a/rk3188 was added. The linux driver doesn't do much with
the GRF phy address range, however the u-boot driver rockchip_usb2_phy.c
does. The bits in GRF_UOC0_CON2 for rk3066a/rk3188 and rk3288 for example
don't match. Remove the usb-phy fallback string for rk3188
to prevent possible strange side effects.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: board: change condition board_usb_init() in function
Johan Jonker [Fri, 29 Apr 2022 21:40:07 +0000 (23:40 +0200)]
rockchip: board: change condition board_usb_init() in function

Change define condition in board_usb_init() function
to allow rk3066/rk3188 to use the USB PHY driver.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: usb: phy: add rk3066/rk3188 support
Johan Jonker [Fri, 29 Apr 2022 21:40:06 +0000 (23:40 +0200)]
rockchip: usb: phy: add rk3066/rk3188 support

Add rk3066a/rk3188 support to rockchip_usb2_phy.c
They don't have completely identical usb phy registers,
so separate comapatible strings and data.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: usb: gadget: add rk3066 product id
Paweł Jarosz [Fri, 29 Apr 2022 21:40:05 +0000 (23:40 +0200)]
rockchip: usb: gadget: add rk3066 product id

Product id of rk3066 usb otg is 0x300a.

Signed-off-by: Paweł Jarosz <paweljarosz3691@gmail.com>
Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agorockchip: include: configs: remove unused configs for tag and size
Johan Jonker [Wed, 20 Apr 2022 12:54:10 +0000 (14:54 +0200)]
rockchip: include: configs: remove unused configs for tag and size

The configs ROCKCHIP_CHIP_TAG and ROCKCHIP_MAX_INIT_SIZE were
originally added with rksd.c, rkspi.c and rkcommon.c in mind,
but are no longer in use and replaced by struct spl_info,
so remove unused configs for tag and size.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agophycore-rk3288: Avoid enabling partition support in SPL
Simon Glass [Fri, 11 Mar 2022 19:10:04 +0000 (12:10 -0700)]
phycore-rk3288: Avoid enabling partition support in SPL

This is not needed or used, and adds code size. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2 years agoMerge branch '2022-06-28-assorted-fixes'
Tom Rini [Tue, 28 Jun 2022 21:02:25 +0000 (17:02 -0400)]
Merge branch '2022-06-28-assorted-fixes'

- Fix a squashfs security issue, an i2c access security issue and fix
  NAND booting on imx8mn_bsh_smm_s2

2 years agoconfigs: imx8mn_bsh_smm_s2: add mtdparts to bootargs
Dario Binacchi [Sun, 26 Jun 2022 10:05:18 +0000 (12:05 +0200)]
configs: imx8mn_bsh_smm_s2: add mtdparts to bootargs

Passing the mtdparts environment variable to the Linux kernel is
required to properly mount the UBI rootfs.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agoconfigs: imx8mn_bsh_smm_s2: remove console from bootargs
Dario Binacchi [Sun, 26 Jun 2022 10:05:17 +0000 (12:05 +0200)]
configs: imx8mn_bsh_smm_s2: remove console from bootargs

The Linux kernel device tree already specifies the device to be used for
boot console output with a stdout-path property under /chosen.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agoconfigs: imx8mn_bsh_smm_s2: add UBI commands
Dario Binacchi [Sun, 26 Jun 2022 10:05:16 +0000 (12:05 +0200)]
configs: imx8mn_bsh_smm_s2: add UBI commands

imx8mn_bsh_smm_s2 uses ubifs rootfs, UBI commands are required to flash
it.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agoconfigs: imx8mn_bsh_smm_s2: add NAND driver
Dario Binacchi [Sun, 26 Jun 2022 10:05:15 +0000 (12:05 +0200)]
configs: imx8mn_bsh_smm_s2: add NAND driver

It allows to boot from NAND.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agofs/squashfs: Use kcalloc when relevant
Miquel Raynal [Mon, 27 Jun 2022 10:20:03 +0000 (12:20 +0200)]
fs/squashfs: Use kcalloc when relevant

A crafted squashfs image could embed a huge number of empty metadata
blocks in order to make the amount of malloc()'d memory overflow and be
much smaller than expected. Because of this flaw, any random code
positioned at the right location in the squashfs image could be memcpy'd
from the squashfs structures into U-Boot code location while trying to
access the rearmost blocks, before being executed.

In order to prevent this vulnerability from being exploited in eg. a
secure boot environment, let's add a check over the amount of data
that is going to be allocated. Such a check could look like:

if (!elem_size || n > SIZE_MAX / elem_size)
return NULL;

The right way to do it would be to enhance the calloc() implementation
but this is quite an impacting change for such a small fix. Another
solution would be to add the check before the malloc call in the
squashfs implementation, but this does not look right. So for now, let's
use the kcalloc() compatibility function from Linux, which has this
check.

Fixes: a1cf70ece42 ("fs/squashfs: new filesystem")
Reported-by: Tatsuhiko Yasumatsu <Tatsuhiko.Yasumatsu@sony.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Tested-by: Tatsuhiko Yasumatsu <Tatsuhiko.Yasumatsu@sony.com>
2 years agoi2c: fix stack buffer overflow vulnerability in i2c md command
Nicolas Iooss [Fri, 10 Jun 2022 14:50:25 +0000 (14:50 +0000)]
i2c: fix stack buffer overflow vulnerability in i2c md command

When running "i2c md 0 0 80000100", the function do_i2c_md parses the
length into an unsigned int variable named length. The value is then
moved to a signed variable:

    int nbytes = length;
    #define DISP_LINE_LEN 16
    int linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes;
    ret = dm_i2c_read(dev, addr, linebuf, linebytes);

On systems where integers are 32 bits wide, 0x80000100 is a negative
value to "nbytes > DISP_LINE_LEN" is false and linebytes gets assigned
0x80000100 instead of 16.

The consequence is that the function which reads from the i2c device
(dm_i2c_read or i2c_read) is called with a 16-byte stack buffer to fill
but with a size parameter which is too large. In some cases, this could
trigger a crash. But with some i2c drivers, such as drivers/i2c/nx_i2c.c
(used with "nexell,s5pxx18-i2c" bus), the size is actually truncated to
a 16-bit integer. This is because function i2c_transfer expects an
unsigned short length. In such a case, an attacker who can control the
response of an i2c device can overwrite the return address of a function
and execute arbitrary code through Return-Oriented Programming.

Fix this issue by using unsigned integers types in do_i2c_md. While at
it, make also alen unsigned, as signed sizes can cause vulnerabilities
when people forgot to check that they can be negative.

Signed-off-by: Nicolas Iooss <nicolas.iooss+uboot@ledger.fr>
Reviewed-by: Heiko Schocher <hs@denx.de>
2 years agoMerge tag 'u-boot-imx-20220628' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Tue, 28 Jun 2022 15:10:23 +0000 (11:10 -0400)]
Merge tag 'u-boot-imx-20220628' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

Fixes for 2022.07

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/12541

2 years agokontron-sl-mx8mm: Add CAAM support
Fabio Estevam [Thu, 9 Jun 2022 20:13:31 +0000 (17:13 -0300)]
kontron-sl-mx8mm: Add CAAM support

Add CAAM support, which is required when enabling HAB secure boot.

Select CONFIG_SPL_DRIVERS_MISC so that CONFIG_IMX_HAB could
build successfully, if selected.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Acked-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de>
2 years agoboard: apalis_imx6: DDR init using mx6_dram_cfg()
Francesco Dolcini [Fri, 24 Jun 2022 10:33:36 +0000 (12:33 +0200)]
board: apalis_imx6: DDR init using mx6_dram_cfg()

Do DDR initialization using the procedural mx6_dram_cfg() instead of
programming the MMDC using a raw list of register/value pairs, this
solves some rare boot failures on specific "bad" modules.

Calibration values, DDR geometry are unchanged, memory timings are
updated according to the relevant memory datasheet, no changes on
the power consumption.

For IT temperature range SKUs CL is decreased from 8 to 7 and tFAW
value is increased, for commercial temperature range SKUs some
changes on ODT parameters.

This change was validated over a range of different apalis-imx6 SoM, on
the whole working temperature range with weeks of continuous testing.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agoimx: kontron-sl-mx8mm: Enable PCA9450 regulator driver and fix SD card access
Frieder Schrempf [Mon, 27 Jun 2022 11:00:59 +0000 (13:00 +0200)]
imx: kontron-sl-mx8mm: Enable PCA9450 regulator driver and fix SD card access

Currently accessing the SD card on USDHC2 fails with:

=> mmc dev 1
Card did not respond to voltage select! : -110

This is due to the fact that UHS modes are enabled in the defconfig
and the devicetree, but the referenced LDO5 regulator (reg_nvcc_sd)
is not available to switch the data lines from 3.3V to 1.8V mode.

By enabling the regulator driver the vqmmc-supply is now available
and the SD card works also in high speed modes:

=> mmc dev 1
switch to partitions #0, OK
mmc1 is current device

Please note that the board has a GPIO connected to the SD_VSEL signal
of the PMIC. As the driver uses the LDO5CTRL_H register to set the
voltage, we need to make sure that this GPIO (GPIO01_IO4) is set to
a high level.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Tested-by: Fabio Estevam <festevam@denx.de>
2 years agopmic: pca9450: Add optional SD_VSEL GPIO for LDO5
Frieder Schrempf [Mon, 27 Jun 2022 11:00:58 +0000 (13:00 +0200)]
pmic: pca9450: Add optional SD_VSEL GPIO for LDO5

LDO5 has two separate control registers. LDO5CTRL_L is used if the
input signal SD_VSEL is low and LDO5CTRL_H if it is high.
The current driver implementation only uses LDO5CTRL_H. To make this
work on boards that have SD_VSEL connected to a GPIO, we add support
for specifying an optional GPIO and setting it to high at probe time.

In the future we might also want to add support for boards that have
SD_VSEL set to a fixed low level. In this case we need to change the
driver to be able to use the LDO5CTRL_L register.

This is a port of the same change in the Linux kernel:
8c67a11bae88 ("regulator: pca9450: Add SD_VSEL GPIO for LDO5")

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Tested-by: Fabio Estevam <festevam@denx.de>
2 years agomx6: ddr: Fix disabling on-die termination
Francesco Dolcini [Fri, 24 Jun 2022 10:33:35 +0000 (12:33 +0200)]
mx6: ddr: Fix disabling on-die termination

In case rtt_nom is set to 0 keep ODT disabled (MMDC MPODTCTRL = 0).
No changes required for DDR MR1 Rtt_Nom impedance register, 0 value is
already handled correctly.

No board is currently affected by this change (rtt_nom != 0 on all i.MX6
ddr3 boards), this will be used by a follow-up change.

Fixes: fe0f7f7842e1 ("mx6: add mmdc configuration for MX6Q/MX6DL")
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2 years agotoradex: apalis/colibri_imx6: Fix CLKO1/CLKO2 output
Francesco Dolcini [Fri, 24 Jun 2022 09:52:19 +0000 (11:52 +0200)]
toradex: apalis/colibri_imx6: Fix CLKO1/CLKO2 output

Set CLK01 and CLK02 to 24MHz and enable it in CCM_CCOSR register.

This clock is used by both the audio codec (CLKO1) and by the CSI camera
(CLKO2) and is expected to be 24MHz.

Despite the wrong 16.5MHz there was no real issue because of the wrong
frequency since Linux reconfigures the clocks afterward, however this
was triggering an issue with noise coming from the SGTL5000 audio codec.

The problem is that the SGTL5000 does not have a reset pin and after it
is configured if the input MCLK clock is disabled it produces a constant
noise on its output, this was happening on software reboot.

Forcing the clock to be enabled in U-Boot prevent the problem by making
sure that the clock is always available, without this change as soon as
Linux was changing the clock tree (setting clk_out_sel=1 without setting
clko2_en=1) the noise would start till the actual clock was enabled
(clko2_en=1) during the SGTL5000 driver probe.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoARM: imx: Switch Data Modul i.MX8M Mini eDM SBC to USB251x Hub driver
Marek Vasut [Wed, 15 Jun 2022 11:07:39 +0000 (13:07 +0200)]
ARM: imx: Switch Data Modul i.MX8M Mini eDM SBC to USB251x Hub driver

Replace the ad-hoc I2C register programming scripted in board
environment with U-Boot DM driver.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoimx8m: fixup thermal trips
Andrejs Cainikovs [Fri, 27 May 2022 13:20:42 +0000 (15:20 +0200)]
imx8m: fixup thermal trips

Fixup thermal trips in Linux device tree according to SoC thermal
grade.

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Tested-by: Adam Ford <aford173@gmail.com>
2 years agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Mon, 27 Jun 2022 01:06:08 +0000 (21:06 -0400)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi

The main attraction are two regressions, plus a fix
for a long standing bug:
- Fix USB support on boards with a switched VBUS regulator.
- Fix failing boot due to env loading on boards without MMC (CHIP).
- Fix PSCI CPU_OFF operation on R40 boards.
The rest are smaller fixes, and the forgotten DT sync for sun4i boards.

2 years agosunxi: psci: Fix sunxi_power_switch on sun8i-r40 platform
qianfan Zhao [Sat, 14 May 2022 03:19:23 +0000 (11:19 +0800)]
sunxi: psci: Fix sunxi_power_switch on sun8i-r40 platform

linux system will die if we offline one of the cpu on R40 based board:
eg: echo 0 > /sys/devices/system/cpu/cpu3/online

The reason is that the R40 version of sunxi_cpu_set_power always passes
0 for the CPU number, so we turn off CPU0, regardless of what CPU the
CPU_OFF request came for.

Fix this by passing the proper CPU number, as there are proper power
clamp registers for every of the four cores.

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agosunxi: fix initial environment loading without MMC
Samuel Holland [Wed, 20 Apr 2022 22:15:39 +0000 (23:15 +0100)]
sunxi: fix initial environment loading without MMC

Commit b065c620c59a ("sunxi: use boot source for determining environment
location") changed our implementation of env_get_location() and enabled
it for every board, even those without MMC support (like the C.H.I.P.
boards). However the default fallback location of ENVL_FAT requires MMC
support compiled in, so the board hangs when trying to initially load
the environment.

Change the algorithm to only return configured environment locations,
and improve the fallback algorithm on the way.

The env_init() routine calling this function here does not behave well
if the return value is ENVL_UNKNOWN on the very first call: it will make
U-Boot proper silently hang very early.
Work around this issue by making sure we return some configured (dummy)
environment location when prio is 0. This for instance happens when
booting via FEL.

This fixes U-Boot loading on the C.H.I.P. boards.

Fixes: b065c620c59a ("sunxi: use boot source for determining environment location")
Reported-by: Chris Morgan <macroalpha82@gmail.com>
Signed-off-by: Samuel Holland <samuel@sholland.org>
[Andre: fix FEL boot case by not returning ENVL_UNKNOWN when prio==0]
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agoclk: sunxi: Add additional RTC compatible strings
Samuel Holland [Sun, 1 May 2022 03:38:36 +0000 (22:38 -0500)]
clk: sunxi: Add additional RTC compatible strings

Compatible strings for some new RTC hardware variants were added to
the binding. Add them to the driver in preparation for supporting
those new SoCs.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agogpio: sunxi: Fix build with CONFIG_SPL_SERIAL=n
Samuel Holland [Wed, 11 May 2022 00:03:34 +0000 (19:03 -0500)]
gpio: sunxi: Fix build with CONFIG_SPL_SERIAL=n

This driver uses simple_strtol(), so it needs SPL_STRTO. Before commit
62bcde047894f ("disk: Add an option for partitions in SPL"), SPL_STRTO
was always selected indirectly. Now it is not, so select it here.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agoARM: dts: sun4i: Sync from Linux v5.18-rc1
Samuel Holland [Thu, 26 May 2022 03:26:02 +0000 (22:26 -0500)]
ARM: dts: sun4i: Sync from Linux v5.18-rc1

Copy the devicetree source for the A10 SoC and all existing boards
verbatim from the Linux v5.18-rc1 tag.

The previous version of this change was only partially applied.

Fixes: 03d3a136a774 ("ARM: dts: sun4i: Sync from Linux v5.18-rc1")
Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agosunxi: usb: convert PHY GPIO functions to DM
Andre Przywara [Tue, 7 Jun 2022 22:36:18 +0000 (23:36 +0100)]
sunxi: usb: convert PHY GPIO functions to DM

The Allwinner USB PHY driver is still using the legacy GPIO interface,
which is now implemented by the DM_GPIO compat functions.
Those seem to have some design flaws, as setting the direction, then
later setting the value will not work, if the DM_GPIO driver is
implementing set_flags.

Fix this by using the dm_ version of the direct GPIO interface, which
uses struct gpio_desc structs to handle requested GPIOs, and actually
keeps the flags we set earlier.

This fixes USB operation on boards which need to toggle the VBUS supply
via a GPIO, like the Teres-I laptop or the BananaPi M2 Berry board.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reported-by: Milan P. Stanić <mps@arvanta.net>
Reviewed-by: Samuel Holland <samuel@sholland.org>
2 years agoMerge tag 'video-20220625' of https://source.denx.de/u-boot/custodians/u-boot-video
Tom Rini [Sat, 25 Jun 2022 12:38:00 +0000 (08:38 -0400)]
Merge tag 'video-20220625' of https://source.denx.de/u-boot/custodians/u-boot-video

 - fix building sandbox with NO_SDL=1
 - fix stb TrueType to check return value of STBTT_malloc()
 - remove not required DM_REGULATOR test in stm32 dsi driver

2 years agovideo: stm32: remove test on CONFIG_DM_REGULATOR
Patrick Delaunay [Mon, 20 Jun 2022 09:55:07 +0000 (11:55 +0200)]
video: stm32: remove test on CONFIG_DM_REGULATOR

The tests on CONFIG_DM_REGULATOR, added to avoid compilation issues, can
now be removed, they are no more needed since the commit 8b4a43deb9b0
("power: regulator: add dummy helper").

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agodriver: video: Check allocated pointers
Bin Meng [Wed, 18 May 2022 05:36:18 +0000 (13:36 +0800)]
driver: video: Check allocated pointers

The codes that call STBTT_malloc() / stbtt__new_active() do not check
the return value at present which may cause segfault.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2 years agosandbox: sdl: Add stub sandbox_sdl_remove_display()
Andrew Scull [Wed, 23 Mar 2022 20:20:37 +0000 (20:20 +0000)]
sandbox: sdl: Add stub sandbox_sdl_remove_display()

Building the sandbox with NO_SDL=1 resulted in an undefined reference to
'sandbox_sdl_remove_display'. Resolve this by adding a stub
implementation to match the stubs of the other similar functions.

Signed-off-by: Andrew Scull <ascull@google.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoMerge branch '2022-06-23-important-fixes'
Tom Rini [Thu, 23 Jun 2022 15:27:04 +0000 (11:27 -0400)]
Merge branch '2022-06-23-important-fixes'

- Apple NVMe updates to support macOS 13 changes, kontron-sl-mx8mm dts
  changes to fix some problems.

2 years agoimx: kontron-sl-mx8mm: Remove deprecated phy-mode property
Frieder Schrempf [Tue, 14 Jun 2022 13:03:19 +0000 (15:03 +0200)]
imx: kontron-sl-mx8mm: Remove deprecated phy-mode property

This was previously needed, but U-Boot is now capable of parsing
the new "phy-connection-type" property that is already used in
the main devicetree.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoimx: kontron-sl-mx8mm: Sync dts files and fix ethernet
Frieder Schrempf [Tue, 14 Jun 2022 13:03:18 +0000 (15:03 +0200)]
imx: kontron-sl-mx8mm: Sync dts files and fix ethernet

This syncs the devicetree files with the latest Linux kernel (5.19-rc2).
This also fixes the currently broken ethernet support:

Before:

  Net:   Could not get PHY for FEC0: addr 0

After:

  Net:   eth0: ethernet@30be0000

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoarm: apple: Increase RTKit timeouts
Janne Grunau [Tue, 14 Jun 2022 07:09:09 +0000 (09:09 +0200)]
arm: apple: Increase RTKit timeouts

Timeouts are not expected to happen and are handled as fatal errors.
Increase all timeouts to 1 second as defensive measure to avoid relying
on the timing behaviour of certain firmware versions or configurations.

Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Tested-by: Mark Kettenis <kettenis@openbsd.org>
2 years agoMAINTAINERS: Add nvme_apple to Apple SoC section
Janne Grunau [Tue, 14 Jun 2022 07:09:08 +0000 (09:09 +0200)]
MAINTAINERS: Add nvme_apple to Apple SoC section

Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2 years agoarm: apple: nvme: Add SART support and RTKit buffer management
Janne Grunau [Tue, 14 Jun 2022 07:09:07 +0000 (09:09 +0200)]
arm: apple: nvme: Add SART support and RTKit buffer management

The NVMe firmware in the macOS 13 beta blocks or crashes with u-boot's
current minimal RTKit implementation. It does not provide buffers for
the firmware's buffer requests. The ANS2 firmware included in macOS 11
and 12 tolerates this. The firmware included in the first macOS 13 beta
requires buffers for the crashlog and ioreport endpoints to function.

In the case of the NVMe the buffers are physical memory. Access to
physical memory is guarded by what Apple calls SART.
Import m1n1's SART driver (exclusively used for the NVMe controller).
Implement buffer management helpers for RTKit. These are generic since
other devices (none in u-boot so far) require different handling.

Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Tested-by: Mark Kettenis <kettenis@openbsd.org>
2 years agoPrepare v2022.07-rc5
Tom Rini [Mon, 20 Jun 2022 18:30:36 +0000 (14:30 -0400)]
Prepare v2022.07-rc5

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge tag 'efi-2022-07-rc5-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 19 Jun 2022 15:30:29 +0000 (11:30 -0400)]
Merge tag 'efi-2022-07-rc5-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2020-07-rc5-2

Documentation:

* man-pages for booti and printenv

UEFI

* correct return value for printenv -e command
* initialize console size late

2 years agoefi_loader: initialize console size late
Heinrich Schuchardt [Tue, 14 Jun 2022 06:02:03 +0000 (08:02 +0200)]
efi_loader: initialize console size late

If CONFIG_VIDEO_DM=n we query the display size from the serial console.
Especially when using a remote console the response can be so late that
it interferes with autoboot.

Only query the console size when running an EFI binary.

Add debug output showing the determined console size.

Reported-by: Fabio Estevam <festevam@gmail.com>
Fixes: 585e1519a1e8 ("efi_loader: split efi_init_obj_list() into two stages")
Fixes: 3da94f1971c7 ("efi_loader: disk: a helper function to create efi_disk objects from udevice")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tested-by: Fabio Estevam <festevam@denx.de>
Tested-by: Heiko Thiery <heiko.thiery@gmail.com>
2 years agotest: work around for EFI terminal size probing
Heinrich Schuchardt [Sun, 19 Jun 2022 12:02:18 +0000 (14:02 +0200)]
test: work around for EFI terminal size probing

When the UEFI sub-system is initialized it sends an escape sequence to the
serial console to determine the terminal size. This stops the
run_command_list() function of the console emulation from recognizing the
U-Boot command line prompt.

Add a 'print -e' command as first command in the command list to work
around this issue.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agocmd: correct return value for printenv -e
Heinrich Schuchardt [Sun, 19 Jun 2022 11:36:48 +0000 (13:36 +0200)]
cmd: correct return value for printenv -e

If printenv -e is executed and the specified variable is not found, the
return value $? of the command should be 1 (false).

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: man-page for the printenv command
Heinrich Schuchardt [Sun, 19 Jun 2022 11:59:22 +0000 (13:59 +0200)]
doc: man-page for the printenv command

Privide a man-page for the printenv command.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: man-page for bootz command
Heinrich Schuchardt [Sat, 11 Jun 2022 06:23:31 +0000 (08:23 +0200)]
doc: man-page for bootz command

Provide a man-page for the bootz command.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoMerge tag 'u-boot-stm32-20220617' of https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Fri, 17 Jun 2022 13:41:11 +0000 (09:41 -0400)]
Merge tag 'u-boot-stm32-20220617' of https://source.denx.de/u-boot/custodians/u-boot-stm

- Fix the stm32prog command for stm32mp platform
- Add stm32mp15x DHCOR based DRC Compact board

2 years agoMerge commit '21c1e708105f54ff3f7202ecae045b38fcb330b6' of https://github.com/tienfon...
Tom Rini [Fri, 17 Jun 2022 13:35:28 +0000 (09:35 -0400)]
Merge commit '21c1e708105f54ff3f7202ecae045b38fcb330b6' of https://github.com/tienfong/uboot_mainline

2 years agoMerge branch '2022-06-16-assorted-bugfixes'
Tom Rini [Fri, 17 Jun 2022 13:13:50 +0000 (09:13 -0400)]
Merge branch '2022-06-16-assorted-bugfixes'

- A wide array of regression fixes and minor updates

2 years agoddr: altera: soc64: Integer fix overflow that caused DDR size mismatched
Dinesh Maniyam [Wed, 1 Jun 2022 10:49:02 +0000 (18:49 +0800)]
ddr: altera: soc64: Integer fix overflow that caused DDR size mismatched

Convert the constant integer to 'phys_size_t' to avoid overflow
when calculating the SDRAM size.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
2 years agodrivers: cache: ncore: Disable snoop filter
Dinesh Maniyam [Wed, 1 Jun 2022 07:57:25 +0000 (15:57 +0800)]
drivers: cache: ncore: Disable snoop filter

There is hardware bug in NCORE CCU IP and it is causing an issue in the
coherent directory tracking of outstanding cache lines.
The workaround is disabling snoop filter.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
2 years agoarm: dts: socfpga: stratix10: Add freeze controller node
Dinesh Maniyam [Tue, 31 May 2022 08:15:17 +0000 (16:15 +0800)]
arm: dts: socfpga: stratix10: Add freeze controller node

The freeze controller is required for FPGA partial reconfig.
This node is disable on default.
Enable this node via u-boot fdt command when needed.

Signed-off-by: Yau Wai Gan <yau.wai.gan@intel.com>
Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
2 years agoarm: dts: socfpga: agilex: Add freeze controller node
Dinesh Maniyam [Tue, 31 May 2022 08:05:56 +0000 (16:05 +0800)]
arm: dts: socfpga: agilex: Add freeze controller node

The freeze controller is required for FPGA partial reconfig.
This node is disable on default.
Enable this node via u-boot fdt command when needed.

Signed-off-by: Yau Wai Gan <yau.wai.gan@intel.com>
Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
2 years agoarch: arm: socfpga: timer_s10: Override udelay for secure section
Dinesh Maniyam [Wed, 1 Jun 2022 07:54:59 +0000 (15:54 +0800)]
arch: arm: socfpga: timer_s10: Override udelay for secure section

Override __udelay() as 'always inlined' function so that PSCI code
run in '__secure' section can call this delay function as well.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
2 years agoARM: dts: stm32: Add DHCOR based DRC Compact board
Marek Vasut [Mon, 13 Jun 2022 09:55:21 +0000 (11:55 +0200)]
ARM: dts: stm32: Add DHCOR based DRC Compact board

Add DT for DH DRC Compact unit, which is a universal controller device.
The system has two ethernet ports, one CAN, RS485 and RS232, USB, uSD
card slot, eMMC and SDIO Wi-Fi.

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>
2 years agoARM: dts: stm32: Add alternate pinmux for SPI2 pins
Marek Vasut [Mon, 13 Jun 2022 09:55:20 +0000 (11:55 +0200)]
ARM: dts: stm32: Add alternate pinmux for SPI2 pins

Add another mux option for SPI2 pins, this is used on DRC Compact board.

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>
2 years agoARM: dts: stm32: Add alternate pinmux for CAN1 pins
Marek Vasut [Mon, 13 Jun 2022 09:55:19 +0000 (11:55 +0200)]
ARM: dts: stm32: Add alternate pinmux for CAN1 pins

Add another mux option for CAN1 pins, this is used on DRC Compact board.

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>
2 years agoARM: dts: stm32: Add alternate pinmux for UART5 pins
Marek Vasut [Mon, 13 Jun 2022 09:55:18 +0000 (11:55 +0200)]
ARM: dts: stm32: Add alternate pinmux for UART5 pins

Add another mux option for UART5 pins, this is used on DRC Compact board.

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>
2 years agoARM: dts: stm32: Add alternate pinmux for UART4 pins
Marek Vasut [Mon, 13 Jun 2022 09:55:17 +0000 (11:55 +0200)]
ARM: dts: stm32: Add alternate pinmux for UART4 pins

Add another mux option for UART4 pins, this is used on DRC Compact board.

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>
2 years agoARM: dts: stm32: Add alternate pinmux for UART3 pins
Marek Vasut [Mon, 13 Jun 2022 09:55:16 +0000 (11:55 +0200)]
ARM: dts: stm32: Add alternate pinmux for UART3 pins

Add another mux option for UART3 pins, this is used on DRC Compact board.

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>
2 years agostm32mp: stm32prog: fix the last character of dfu_alt_add third parameter
Patrick Delaunay [Thu, 16 Jun 2022 16:37:59 +0000 (18:37 +0200)]
stm32mp: stm32prog: fix the last character of dfu_alt_add third parameter

The third parameter of dfu_alt_add(), the string description of alternate,
is build in stm32prog_alt_add() with a unnecessary character ';' at the
end of the string.

This separator was required in the first implementation of
dfu_alt_add() but is no more needed in the current implementation;
this separator is managed only in dfu_config_interfaces() which call
dfu_alt_add() for this parameter without this separator.

And since the commit b6e3be8f1c86 ("DFU: Check the number of arguments
and argument string strictly"), this added character cause an error when
the stm32prog command is executed because the third parameter of
dfu_alt_add() must be a string with a numerical value; 's' must be NULL
in the result of call in dfu_fill_entity_mmc():
  third_arg = simple_strtoul(argv[2], &s, 0);

Fixes: b6e3be8f1c86 ("DFU: Check the number of arguments and argument string strictly")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agonet: Fix discuss discard typo
Marek Vasut [Sun, 1 May 2022 16:43:55 +0000 (18:43 +0200)]
net: Fix discuss discard typo

Replace discuss with discard, that is what happens with packet with
incorrect checksum. Fix the typo.

Fixes: e2b4a83352d ("Convert CONFIG_UDP_CHECKSUM to Kconfig")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Simon Glass <sjg@chromium.org>