]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
2 years agodm: fix logic of lists_bind_fdt()
Heinrich Schuchardt [Mon, 11 Jul 2022 06:25:33 +0000 (08:25 +0200)]
dm: fix logic of lists_bind_fdt()

If parameter drv of lists_bind_fdt() is specified, we shall bind only to
this very driver and to no other.

If the driver drv has an of_match property, we shall only bind to the
driver if it matches the compatible string of the device.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoconfigs: sandbox_defconfig: CONFIG_LOG_MAX_LEVEL=9
Heinrich Schuchardt [Mon, 11 Jul 2022 06:21:32 +0000 (08:21 +0200)]
configs: sandbox_defconfig: CONFIG_LOG_MAX_LEVEL=9

Without setting CONFIG_LOG_MAX_LEVEL to a value above 6 we will not detect
NULL dereferences and other errors in log_debug() calls.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: avoid NULL dereference in lists_bind_fdt()
Heinrich Schuchardt [Mon, 11 Jul 2022 06:21:31 +0000 (08:21 +0200)]
dm: avoid NULL dereference in lists_bind_fdt()

If parameter drv of lists_bind_fdt() is specified, we want to bind to this
specific driver even if its field of_match is NULL.

If entry->of_match is NULL, we should not dereference it in a debug
statement.

Fixes: d3e773613b6d ("dm: core: Use U-Boot logging instead of pr_debug()")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agotest: fix log tests
Heinrich Schuchardt [Mon, 11 Jul 2022 06:21:30 +0000 (08:21 +0200)]
test: fix log tests

Consider CONFIG_LOG_MAX_LEVEL and gd->default_log_level in

* do_log_test_helpers()
* log_test_dropped()
* log_test_level_deny()

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: avoid NULL dereference in add_item()
Heinrich Schuchardt [Sun, 10 Jul 2022 13:40:22 +0000 (15:40 +0200)]
dm: avoid NULL dereference in add_item()

acpi_add_other_item() passes dev = NULL. Instead of dev->name write the
string "other" to the debug log:

    ACPI: Writing ACPI tables at 1fd3000
    0base: writing table '<NULL>'
    * other: Added type 3, 0000000011fd4000, size 240
    1facs: writing table 'FACS'
    * other: Added type 3, 0000000011fd4240, size 40
    5csrt: writing table 'CSRT'
    * other: Added type 3, 0000000011fd4280, size 30

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoPrepare v2022.10-rc1
Tom Rini [Tue, 26 Jul 2022 00:31:12 +0000 (20:31 -0400)]
Prepare v2022.10-rc1

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 25 Jul 2022 21:19:18 +0000 (17:19 -0400)]
configs: Resync with savedefconfig

Resync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2022-07-25-assorted-platform-updates'
Tom Rini [Mon, 25 Jul 2022 20:40:43 +0000 (16:40 -0400)]
Merge branch '2022-07-25-assorted-platform-updates'

- Assorted TI, Apple, Snapdragon and Xen updates.

2 years agodrivers: xen: unmap Enlighten page before jumping to Linux
Dmytro Firsov [Tue, 19 Jul 2022 14:55:28 +0000 (14:55 +0000)]
drivers: xen: unmap Enlighten page before jumping to Linux

This commit fixes issue with usage of Xen hypervisor shared info page.
Previously U-boot did not unmap it at the end of OS boot process. Xen
did not prevent guest from this. So, it worked, but caused wierd
issues - one memory page, that was returned by memalign in U-boot
for Enlighten mapping was not unmaped by Xen (shared_info values was
not removed from there) and returned to allocator. During the Linux
boot, it uses shared_info page as regular RAM page, which leads to
hypervisor shared info corruption.

So, to fix this issue, as discussed on the xen-devel mailing list, the
code should:
   1) Unmap the page
   2) Populate the area with memory using XENMEM_populate_physmap

This patch adds page unmapping via XENMEM_remove_from_physmap, fills
hole in address space where page was mapped via XENMEM_populate_physmap
and return this address to memory allocator for freeing.

Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
Reviewed-by: Anastasiia Lukianenko <vicooodin@gmail.com>
2 years agoarm: Remove unused references to CONFIG_SOC_DM*
Tom Rini [Mon, 18 Jul 2022 15:33:39 +0000 (11:33 -0400)]
arm: Remove unused references to CONFIG_SOC_DM*

There are no references to CONFIG_SOC_DM355 / CONFIG_SOC_DM365 /
CONFIG_SOC_DM644X / CONFIG_SOC_DM646X and the files these Makefile lines
reference have already been dropped.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agospl: Use SPL_TEXT_BASE instead of ISW_ENTRY_ADDR
Andrew Davis [Fri, 15 Jul 2022 17:31:48 +0000 (12:31 -0500)]
spl: Use SPL_TEXT_BASE instead of ISW_ENTRY_ADDR

The ISW_ENTRY_ADDR symbol was used for OMAP devices in place of
SPL_TEXT_BASE. Keystone2 HS devices were not using it right either.
Remove ISW_ENTRY_ADDR and use SPL_TEXT_BASE directly.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoarm: k3: config.mk: Read software revision information from file on HS
Andrew Davis [Fri, 15 Jul 2022 16:38:54 +0000 (11:38 -0500)]
arm: k3: config.mk: Read software revision information from file on HS

Read the swrv.txt file from the TI Security Development Tools when
TI_SECURE_DEVICE is enabled. This allows us to set our software
revision in one place and have it used by all the tools that create
TI x509 boot certificates.

Signed-off-by: Andrew Davis <afd@ti.com>
2 years agok3_gen_x509_cert: Make SWRV configurable for anti-rollback protection
Yogesh Siraswar [Fri, 15 Jul 2022 16:38:53 +0000 (11:38 -0500)]
k3_gen_x509_cert: Make SWRV configurable for anti-rollback protection

The x509 certificate SWRV is currently hard-coded to 0. This need to be
updated to 1 for j721e 1.1, j7200 and am64x. It is don't care for other
k3 devices.

Added new config K3_X509_SWRV to k3. Default is set to 1.

Signed-off-by: Yogesh Siraswar <yogeshs@ti.com>
Reviewed-by: Dave Gerlach <d-gerlach@ti.com>
2 years agoarm: mach-k3: Remove ROM firewalls on GP devices
Andrew Davis [Fri, 15 Jul 2022 16:21:27 +0000 (11:21 -0500)]
arm: mach-k3: Remove ROM firewalls on GP devices

This isn't strictly needed as these firewalls should all be disabled on
GP, but it also doesn't hurt, so do this unconditionally to remove this
use of CONFIG_TI_SECURE_DEVICE.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agodefconfigs: j721e_hs_evm: Sync HS and non-HS defconfigs
Andrew Davis [Fri, 15 Jul 2022 16:19:41 +0000 (11:19 -0500)]
defconfigs: j721e_hs_evm: Sync HS and non-HS defconfigs

Additions have been made to the non-HS defconfig without the same
being made to the HS defconfig, sync them.

Signed-off-by: Andrew Davis <afd@ti.com>
2 years agodefconfigs: am57xx_hs_evm: Sync HS and non-HS defconfigs
Andrew Davis [Fri, 15 Jul 2022 16:19:39 +0000 (11:19 -0500)]
defconfigs: am57xx_hs_evm: Sync HS and non-HS defconfigs

Sync new additions to non-HS defconfig with HS defconfig.

Signed-off-by: Andrew Davis <afd@ti.com>
2 years agodefconfigs: Add a config for AM43xx HS EVM with QSPI Boot support
Andrew Davis [Fri, 15 Jul 2022 15:58:49 +0000 (10:58 -0500)]
defconfigs: Add a config for AM43xx HS EVM with QSPI Boot support

On AM43xx HS devices, QSPI boot is XIP and we use a single stage
bootloader. Add a defconfig for this.

Signed-off-by: Andrew Davis <afd@ti.com>
2 years agoarm: mach-k3: Rename SOC_K3_AM6 to SOC_K3_AM654
Andrew Davis [Fri, 15 Jul 2022 15:25:27 +0000 (10:25 -0500)]
arm: mach-k3: Rename SOC_K3_AM6 to SOC_K3_AM654

The first AM6x device was the AM654x, but being the first we named it
just AM6, since more devices have come out with this same prefix we
should switch it to the normal convention of using the full name of the
first compatibility device the series. This makes what device we are
talking about more clear and matches all the K3 devices added since.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoarm: mach-k3: Only build init files for SPL
Andrew Davis [Fri, 15 Jul 2022 15:25:26 +0000 (10:25 -0500)]
arm: mach-k3: Only build init files for SPL

The content of these files are only used in SPL builds. The contents are
already ifdef for the same, remove that and only include the whole file
in the build when building for SPL.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoarm: dts: db410c/db820c: Fix SPMI addresses
Stephan Gerhold [Wed, 13 Jul 2022 19:17:11 +0000 (21:17 +0200)]
arm: dts: db410c/db820c: Fix SPMI addresses

The Qualcomm device trees in U-Boot are currently not consistent with
the upstream DTs used in the Linux kernel. While some bindings are
similar to the official specification in the Linux kernel, several
nodes have subtle differences, e.g. the "compatible"s or the exact
specification of memory registers.

This means that some of the Qualcomm-related U-Boot drivers are not
compatible with the Linux DT (and vice versa).

The SPMI node is one such example: the "core" region starts at
0x0200f000 in the upstream Linux MSM8916 DT, but in U-Boot it starts at
0x0200f800. The end result is normally the same, since the Linux SPMI
driver simply adds the 0x800 internally.

However, commit f5a2d6b4b03a ("spmi: msm: add arbiter version 5
support") imported this behavior into the U-Boot driver, without
adjusting the DB410c/DB820c device trees. This means that the 0x800
offset is now added twice, breaking all SPMI read/write operations:

  Failed to find PMIC pon node. Check device tree
  Failed to find pm8916_gpios@c000 node.
  USB init failed: -6
  starting USB...
  Bus ehci@78d9000: Failed to find pm8916_gpios@c000 node.
  probe failed, error -6
  No working controllers found

While the mistake is strictly speaking in the spmi-msm driver, fix the
issue by making the SPMI nodes in the DB410c/DB820c consistent with the
upstream Linux DT instead.

Ideally we should even go a step further by fixing the remaining uses
of custom bindings in the U-Boot drivers and moving to using the Linux
DTs as-is. This would likely avoid such mistakes in the future and
would also make the porting process much easier.

Cc: Dzmitry Sankouski <dsankouski@gmail.com>
Fixes: f5a2d6b4b03a ("spmi: msm: add arbiter version 5 support")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
2 years agoboard: ti: am65x: Do not disable SA2UL in DT
Andrew Davis [Wed, 13 Jul 2022 16:12:48 +0000 (11:12 -0500)]
board: ti: am65x: Do not disable SA2UL in DT

This is no longer needed as the SA2UL can now be shared with Linux.
Leave the SA2UL DT node enabled.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoarmv8: mach-k3: correct define checking for AM625/AM642 memory maps
Matt Ranostay [Wed, 13 Jul 2022 11:49:36 +0000 (04:49 -0700)]
armv8: mach-k3: correct define checking for AM625/AM642 memory maps

Using CONFIG_IS_ENABLED breaks accessing memory map structure when
doing a A53 SPL build for AM625 and AM642 platforms. This is due to
'abc if CONFIG_SPL_BUILD is defined and CONFIG_SPL_FOO is set to 'y''
in which there is no CONFIG_SPL_SOC_K3_AM625/CONFIG_SPL_SOC_K3_AM642
defined in the configuration.

For the A53 SPL builds on these platform to access the memory mapping
which it will need for enabling the mmu/cache it must use #if defined(X)
checks and not CONFIG_IS_ENABLED.

Cc: Suman Anna <s-anna@ti.com>
Cc: Neha Francis <n-francis@ti.com>
Signed-off-by: Matt Ranostay <mranostay@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoarm: dts: mt7622: remove default pinctrl of uart0
Weijie Gao [Wed, 13 Jul 2022 03:16:39 +0000 (11:16 +0800)]
arm: dts: mt7622: remove default pinctrl of uart0

Currently u-boot running on mt7622 will print an warning log at beginning:
> serial_mtk serial@11002000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19

It turns out that the pinctrl uclass can't work properly in board_f stage.

Since the uart0 is the default UART device used by bootrom, and will be
initialized in both bootrom and tf-a bl2. It's ok not to setup pinctrl for
uart0 in u-boot.

This patch removes the default pinctrl of uart0 to suppress the unwanted
warning.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 years agoarm: dts: k3-am64-ddr fix typo causing DDR4 register corruption
Anand Gadiyar [Wed, 13 Jul 2022 00:59:04 +0000 (19:59 -0500)]
arm: dts: k3-am64-ddr fix typo causing DDR4 register corruption

The entry for DDRSS_PI_321_DATA was accidentally repeated leading to the
last few PI registers being incorrectly programmed.

Fix this.

Reported-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoboard: qualcomm: Add support for QCS404 EVB
Sumit Garg [Tue, 12 Jul 2022 07:12:12 +0000 (12:42 +0530)]
board: qualcomm: Add support for QCS404 EVB

Add support for Qualcomm QCS404 SoC based evaluation board.

Features:
- Qualcomm Snapdragon QCS404 SoC
- 1GiB RAM
- 8GiB eMMC, uSD slot

U-boot is chain loaded by ABL in 64-bit mode as part of boot.img.
For detailed build and boot instructions, refer to
doc/board/qualcomm/qcs404.rst.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2 years agoclocks: qcom: Add clock driver for QCS404 SoC
Sumit Garg [Tue, 12 Jul 2022 07:12:11 +0000 (12:42 +0530)]
clocks: qcom: Add clock driver for QCS404 SoC

Currently this clock driver initializes clocks for UART and eMMC. Along
with this import "qcom,gcc-qcs404.h" header from Linux mainline to
support DT bindings.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2 years agopinctrl: qcom: Add pinctrl driver for QCS404 SoC
Sumit Garg [Tue, 12 Jul 2022 07:12:10 +0000 (12:42 +0530)]
pinctrl: qcom: Add pinctrl driver for QCS404 SoC

Currently this pinctrl driver only supports BLSP UART2 specific pin
configuration.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agommc: msm_sdhci: Add SDCC version 5.0.0 support
Sumit Garg [Tue, 12 Jul 2022 07:12:09 +0000 (12:42 +0530)]
mmc: msm_sdhci: Add SDCC version 5.0.0 support

For SDCC version 5.0.0, MCI registers are removed from SDCC interface
and some registers are moved to HC. So add support to use the new
compatible string "qcom,sdhci-msm-v5". Based on this new msm variant,
pick the relevant variant data and use it to detect MCI presence thereby
configuring register read/write to msm specific registers.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoboard: qualcomm: Add support for dragonboard845c
Sumit Garg [Tue, 12 Jul 2022 07:12:08 +0000 (12:42 +0530)]
board: qualcomm: Add support for dragonboard845c

Add support for 96Boards Dragonboard 845C aka Robotics RB3 development
platform. This board complies with 96Boards Open Platform Specifications.

Features:
- Qualcomm Snapdragon SDA845 SoC
- 4GiB RAM
- 64GiB UFS drive

U-boot is chain loaded by ABL in 64-bit mode as part of boot.img.
For detailed build and boot instructions, refer to
doc/board/qualcomm/sdm845.rst, board: dragonboard845c.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agouart: sdm845: Fix debug UART pinmux
Sumit Garg [Tue, 12 Jul 2022 07:12:07 +0000 (12:42 +0530)]
uart: sdm845: Fix debug UART pinmux

Configure debug UART pins as function: "qup9" rather than being regular
gpios. It fixes a hang seen during pinmux setting.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoclocks: sdm845: Import qcom,gcc-sdm845.h
Sumit Garg [Tue, 12 Jul 2022 07:12:06 +0000 (12:42 +0530)]
clocks: sdm845: Import qcom,gcc-sdm845.h

Rather than using magic numbers as clock ids for peripherals import
qcom,gcc-sdm845.h from Linux to be used standard macros for clock ids.
So start using corresponding clk-id macro for debug UART.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoarm64: dts: sdm845: Remove redundant u-boot DT properties
Sumit Garg [Tue, 12 Jul 2022 07:12:05 +0000 (12:42 +0530)]
arm64: dts: sdm845: Remove redundant u-boot DT properties

According to u-boot DT recomendation, u-boot specific DT properties belong
to *-uboot.dtsi. Also for starqltechn board (which is the only current
consumer of sdm845.dtsi), the properties are already included in
starqltechn-uboot.dtsi, so remove corresponding redundant properties.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoboard: starqltechn: Align DT node overrides with sdm845.dtsi
Sumit Garg [Tue, 12 Jul 2022 07:12:04 +0000 (12:42 +0530)]
board: starqltechn: Align DT node overrides with sdm845.dtsi

Currently there is a mismatch among DT node overrides in starqltechn
board DTS file and the actual DT nodes in the sdm845.dtsi. So fix that
to align with DT nodes in sdm845.dtsi.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoNokia RX-51: Remove CONFIG_PREBOOT from defconfig
Pali Rohár [Sun, 10 Jul 2022 11:42:56 +0000 (13:42 +0200)]
Nokia RX-51: Remove CONFIG_PREBOOT from defconfig

CONFIG_PREBOOT just cause putting "preboot=CONFIG_PREBOOT" into env list.
Value CONFIG_PREBOOT="run preboot" in defconfig is just nonsense and does
not do anything useful (it is infinite recursion). Config file for this
board already contains default preboot= env variable with correct value,
which has higher priority than CONFIG_PREBOOT and this is reason why
nonsense CONFIG_PREBOOT is ignored.

Remove nonsense and unused CONFIG_PREBOOT from nokia_rx51_defconfig file.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agoboard: ti: am335x: Use correct dtbs for SanCloud boards
Paul Barker [Fri, 8 Jul 2022 09:25:46 +0000 (10:25 +0100)]
board: ti: am335x: Use correct dtbs for SanCloud boards

We have different dtbs for the Lite and Extended WiFi variants of the
SanCloud BBE.

Signed-off-by: Paul Barker <paul.barker@sancloud.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoboard: ti: am335x: Enable spi0 bus on SanCloud BBE Lite
Paul Barker [Fri, 8 Jul 2022 09:25:45 +0000 (10:25 +0100)]
board: ti: am335x: Enable spi0 bus on SanCloud BBE Lite

The SanCloud BBE Lite has a Micron Authenta flash device connected to
the spi0 bus.

Signed-off-by: Paul Barker <paul.barker@sancloud.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agocmd: ti: ddr3: correct minor spelling mistake in Ti DDR3
Ramin Zaghi [Fri, 8 Jul 2022 08:02:56 +0000 (09:02 +0100)]
cmd: ti: ddr3: correct minor spelling mistake in Ti DDR3

Just a spelling mistake.

Signed-off-by: Ramin Zaghi <rzaghi@visualSilicon.com>
2 years agophy: ti: j721e-wiz: use OF data for device specific data
Matt Ranostay [Fri, 8 Jul 2022 06:41:52 +0000 (23:41 -0700)]
phy: ti: j721e-wiz: use OF data for device specific data

Move device specific data into OF data structure so it
is easier to maintain and we can get rid of if statements.

Based on: https://lore.kernel.org/linux-phy/20220526064121.27625-1-rogerq@kernel.org/T/#u

Cc: Roger Quadros <rogerq@kernel.org>
Signed-off-by: Matt Ranostay <mranostay@ti.com>
2 years agoconfigs: am62x_evm_r5: Add support for ESM
Julien Panis [Fri, 1 Jul 2022 12:30:12 +0000 (14:30 +0200)]
configs: am62x_evm_r5: Add support for ESM

Enable ESM driver for AM62x in R5 SPL/u-boot build.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
2 years agoarm64: mach-k3: am625_init: Probe ESM nodes
Julien Panis [Fri, 1 Jul 2022 12:30:11 +0000 (14:30 +0200)]
arm64: mach-k3: am625_init: Probe ESM nodes

On AM62x devices, main ESM error event outputs can be routed to
MCU ESM as inputs. So, two ESM device nodes are expected in the
device tree : one for main ESM and another one for MCU ESM.
MCU ESM error output can trigger the reset logic to reset
the device when CTRLMMR_MCU_RST_CTRL:MCU_ESM_ERROR_RESET_EN_Z is
set to '0'.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
2 years agoarm64: dts: k3-am625-r5: Add support for ESM devices
Julien Panis [Fri, 1 Jul 2022 12:30:10 +0000 (14:30 +0200)]
arm64: dts: k3-am625-r5: Add support for ESM devices

Add main ESM and MCU ESM nodes to AM625-R5 device tree.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
2 years agoarm: apple: Add initial Apple M2 support
Janne Grunau [Thu, 30 Jun 2022 22:06:17 +0000 (00:06 +0200)]
arm: apple: Add initial Apple M2 support

Apple's M2 SoC very similar to the M1 and can use the same memory map.
The keyboard/trackpad on the MacBook Pro (13-inch, M2, 2022) uses
"dockchannel" as transport instead of SPI and needs a new driver.
USB, NVMe, uart, framebuffer and watchdog are working with the existing
drivers.

Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2 years agoiommu: Add M2 support to Apple DART driver
Janne Grunau [Thu, 30 Jun 2022 22:06:16 +0000 (00:06 +0200)]
iommu: Add M2 support to Apple DART driver

"apple,t8112-dart" uses an incompatible register interface but still
offers the same functionality. This DART is found on the M2 and M1
Pro/Max/Ultra SoCs.

Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2 years agoMerge commit '90ba25b7cb78bd85c6af0b6429226c6616dedefa' of https://source.denx.de...
Tom Rini [Sun, 24 Jul 2022 11:46:55 +0000 (07:46 -0400)]
Merge commit '90ba25b7cb78bd85c6af0b6429226c6616dedefa' of https://source.denx.de/u-boot/custodians/u-boot-nand-flash

In preparation of re-sync of mtd stack, we opt to move the current stack
slowly in order to have a more easy sync and test. We would like to
prepare uboot to support no-jedec and no-onfi compliant nand so we need
to clean up a bit the code we have now and upstream some of the support.
In this series we expect no functional change

Tested on:
 - imx6ull Micron   MT29F2G08ABAGAH4
 - imx8mn  Macronix MX30LF4G18AC

2 years agoMerge tag 'efi-2022-10-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 23 Jul 2022 00:48:51 +0000 (20:48 -0400)]
Merge tag 'efi-2022-10-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-10-rc1-2

Documentation:

* doc: add package uuid-dev to build dependencies

UEFI:

* remove support for CONFIG_LCD
* fix authenticated capsules tests

Others:

* pxe: simplify label_boot()
* cli: support bracketed paste

2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-watchdog
Tom Rini [Sat, 23 Jul 2022 00:48:28 +0000 (20:48 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-watchdog

- octeontx_wdt: Add MIPS Octeon support (Stefan)
- watchdog: add amlogic watchdog support (Philippe)
- watchdog: add pulse support to gpio watchdog driver (Paul)

2 years agomtd: decommission the NAND museum
Michael Trimarchi [Wed, 20 Jul 2022 16:22:16 +0000 (18:22 +0200)]
mtd: decommission the NAND museum

Upstream linux commit f7025a43a9da26.

The MTD subsystem has its own small museum of ancient NANDs in a form of
the CONFIG_MTD_NAND_MUSEUM_IDS configuration option. The museum contains
stone age NANDs with 256 bytes pages, as well as iron age NANDs with 512
bytes per page and up to 8MiB page size.

It is with great sorrow that I inform you that the museum is being
decommissioned. The MTD subsystem is out of budget for Kconfig options and
already has too many of them, and there is a general kernel trend to
simplify the configuration menu.

We remove the stone age exhibits along with closing the museum

REMARK Don't apply this part from upstream:

Some of the iron age ones are transferred to the regular NAND depot.
Namely, only those which have unique device IDs are transferred, and the
ones which have conflicting device IDs are removed.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agomtd: nand: toshiba: Retrieve ECC requirements from extended ID
Michael Trimarchi [Wed, 20 Jul 2022 16:22:15 +0000 (18:22 +0200)]
mtd: nand: toshiba: Retrieve ECC requirements from extended ID

Upstream linux commit fb3bff5b407e58.

This patch enables support to read the ECC strength and size from the
NAND flash using Toshiba Memory SLC NAND extended-ID. This patch is
based on the information of the 6th ID byte of the Toshiba Memory SLC
NAND.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agomtd: nand: Move Macronix specific initialization in nand_macronix.c
Michael Trimarchi [Wed, 20 Jul 2022 16:22:14 +0000 (18:22 +0200)]
mtd: nand: Move Macronix specific initialization in nand_macronix.c

Upstream linux commit 3b5206f4be9b65.

Move Macronix specific initialization logic into nand_macronix.c. This
is part of the "separate vendor specific code from core" cleanup
process.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agomtd: nand: Move AMD/Spansion specific init/detection logic in nand_amd.c
Michael Trimarchi [Wed, 20 Jul 2022 16:22:13 +0000 (18:22 +0200)]
mtd: nand: Move AMD/Spansion specific init/detection logic in nand_amd.c

Upstream linux commit 229204da53b31d.

Move AMD/Spansion specific initialization/detection logic into
nand_amd.c. This is part of the "separate vendor specific code from
core" cleanup process.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agomtd: nand: Move Micron specific init logic in nand_micron.c
Michael Trimarchi [Wed, 20 Jul 2022 16:22:12 +0000 (18:22 +0200)]
mtd: nand: Move Micron specific init logic in nand_micron.c

Upstream linux commit 10d4e75c36f6c1.

Move Micron specific initialization logic into nand_micron.c. This is
part of the "separate vendor specific code from core" cleanup process.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agomtd: nand: Move Toshiba specific init/detection logic in nand_toshiba.c
Michael Trimarchi [Wed, 20 Jul 2022 16:22:11 +0000 (18:22 +0200)]
mtd: nand: Move Toshiba specific init/detection logic in nand_toshiba.c

Upstream linux commit 9b2d61f80b060c.

Move Toshiba specific initialization and detection logic into
nand_toshiba.c. This is part of the "separate vendor specific code from
core" cleanup process.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agomtd: nand: Move Hynix specific init/detection logic in nand_hynix.c
Michael Trimarchi [Wed, 20 Jul 2022 16:22:10 +0000 (18:22 +0200)]
mtd: nand: Move Hynix specific init/detection logic in nand_hynix.c

Upstream linux commit 01389b6bd2f4f7.

Move Hynix specific initialization and detection logic into
nand_hynix.c. This is part of the "separate vendor specific code from
core" cleanup process.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agomtd: nand: Move Samsung specific init/detection logic in nand_samsung.c
Michael Trimarchi [Wed, 20 Jul 2022 16:22:09 +0000 (18:22 +0200)]
mtd: nand: Move Samsung specific init/detection logic in nand_samsung.c

Upstream linux commit c51d0ac59f2420.

Move Samsung specific initialization and detection logic into
nand_samsung.c. This is part of the "separate vendor specific code from
core" cleanup process.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agomtd: nand: Export symbol nand_decode_ext_id
Michael Trimarchi [Wed, 20 Jul 2022 16:22:08 +0000 (18:22 +0200)]
mtd: nand: Export symbol nand_decode_ext_id

In preparation of moving specific nand support that are not jedec
or onfi

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agomtd: nand: Fix MediaTek MT7621 SoC build
Michael Trimarchi [Fri, 22 Jul 2022 08:28:36 +0000 (10:28 +0200)]
mtd: nand: Fix MediaTek MT7621 SoC build

nand_get_flash_type was reworked in commit 1ca6f9483e9ab5. This change
break the Mediatek MT721. Fix it adjust the function call parameters

+include/linux/mtd/rawnand.h:32:62: note: expected 'struct nand_chip *' but argument is of type 'struct mtd_info *'
+   32 | struct nand_flash_dev *nand_get_flash_type(struct nand_chip *chip,
+      |                                            ~~~~~~~~~~~~~~~~~~^~~~
+drivers/mtd/nand/raw/mt7621_nand.c:1189:48: error: passing argument 2 of 'nand_get_flash_type' from incompatible pointer type [-Werror=incompatible-pointer-types]
+      |                                                ^~~~
+      |                                                |
+      |                                                struct nand_chip *
+include/linux/mtd/rawnand.h:33:49: note: expected 'int *' but argument is of type 'struct nand_chip *'
+   33 |                                            int *maf_id, int *dev_id,

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agomtd: nand: Get rid of mtd variable in function calls
Michael Trimarchi [Wed, 20 Jul 2022 16:22:07 +0000 (18:22 +0200)]
mtd: nand: Get rid of mtd variable in function calls

chip points to mtd. Passing chip is enough to have a reference
to mtd when is necessary

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agomtd: nand: Add manufacturer specific initialization/detection steps
Michael Trimarchi [Wed, 20 Jul 2022 16:22:06 +0000 (18:22 +0200)]
mtd: nand: Add manufacturer specific initialization/detection steps

Upstream linux commit abbe26d144ec22.

A lot of NANDs are implementing generic features in a non-generic way,
or are providing advanced auto-detection logic where the NAND ID bytes
meaning changes with the NAND generation.

Providing this vendor specific initialization step will allow us to get
rid of full-id entries in the nand_ids table or all the vendor specific
cases added over the time in the generic NAND ID decoding logic.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agomtd: nand: Store nand ID in struct nand_chip
Michael Trimarchi [Wed, 20 Jul 2022 16:22:05 +0000 (18:22 +0200)]
mtd: nand: Store nand ID in struct nand_chip

Upstream linux commit 7f501f0a72036d.

Store the NAND ID in struct nand_chip to avoid passing id_data and id_len
as function parameters.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agomtd: nand: Get rid of busw parameter
Michael Trimarchi [Wed, 20 Jul 2022 16:22:04 +0000 (18:22 +0200)]
mtd: nand: Get rid of busw parameter

Upstream linux commit 29a198a1592d83.

Auto-detection functions are passed a busw parameter to retrieve the actual
NAND bus width and eventually set the correct value in chip->options.
Rework the nand_get_flash_type() function to get rid of this extra
parameter and let detection code directly set the NAND_BUSWIDTH_16 flag in
chip->options if needed.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Thu, 21 Jul 2022 13:16:59 +0000 (09:16 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- turris: Misc updates (Pali)
- mvebu: handle non-zero base address for RAM (Chris)
- mvebu: add support for Methode eDPU (Robert)
- mvebu: a3720: Set BOOT_TARGET_DEVICES list to enabled peripherals
  (Pali)
- tlv_eeprom: Add missing CRC32 dependency (Pali)
- treewide: Fix Marek's name and change my e-mail address (Marek)
- mvebu: eDPU/uDPU: Misc updates (Robert)
- mvebu: Avoid reading MVEBU_REG_PCIE_DEVID register too many times
  (Pali)

2 years agoarm: mvebu: turris_omnia: Set ETHPRIME to DT alias
Pali Rohár [Fri, 15 Jul 2022 08:16:00 +0000 (10:16 +0200)]
arm: mvebu: turris_omnia: Set ETHPRIME to DT alias

CONFIG_ETHPRIME can be set to DT node name or alias which refers to DT
node. Define ethernet aliases and set ETHPRIME to eth2 which refers to WAN
ethernet port. This removes hardcoded DT node name from U-Boot
configuration file.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: Avoid reading MVEBU_REG_PCIE_DEVID register too many times
Pali Rohár [Fri, 15 Jul 2022 08:13:12 +0000 (10:13 +0200)]
arm: mvebu: Avoid reading MVEBU_REG_PCIE_DEVID register too many times

Change detection of platform/cpu from runtime to compile time via config
define. This completely eliminates compiling code which is not going to run
on selected platform. Code which parses and prints device / revision id
still reads device id from MVEBU_REG_PCIE_DEVID register, but only once.

Signed-off-by: Pali Rohár <pali@kernel.org>
Acked-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agomvebu: uDPU: disable non-present peripherals
Robert Marko [Fri, 3 Jun 2022 10:53:05 +0000 (12:53 +0200)]
mvebu: uDPU: disable non-present peripherals

uDPU like eDPU does not expose SCSI based peripherals like SATA nor PCI
and for sure it does not have the Intel E1000 PCI card.

So, like for eDPU remove those from the defconfig.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agomvebu: eDPU: disable SCSI support
Robert Marko [Fri, 3 Jun 2022 10:53:04 +0000 (12:53 +0200)]
mvebu: eDPU: disable SCSI support

eDPU does not use SCSI nor it has SATA exposed, and commit
arm: mvebu: a3720: Set BOOT_TARGET_DEVICES list to enabled peripherals
now allows compiling U-boot wihout all of the BOOT_TARGET_DEVICES since
not all boards have all of the listed peripherals exposed.

So, disable SCSI support in defconfig for eDPU.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotreewide: Fix Marek's name and change my e-mail address
Marek Behún [Wed, 1 Jun 2022 15:17:06 +0000 (17:17 +0200)]
treewide: Fix Marek's name and change my e-mail address

Fix diacritics in some instances of my name and change my e-mail address
to kabel@kernel.org.

Add corresponding .mailmap entries.

Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoboard: turris: Fix MAINTAINERS and add Pali
Marek Behún [Wed, 1 Jun 2022 15:17:05 +0000 (17:17 +0200)]
board: turris: Fix MAINTAINERS and add Pali

Fix MAINTAINERS files for Turris devices, add missing files and add Pali
as maintainer.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agotlv_eeprom: Add missing CRC32 dependency
Pali Rohár [Mon, 30 May 2022 08:42:35 +0000 (10:42 +0200)]
tlv_eeprom: Add missing CRC32 dependency

tlv_eeprom uses crc32() function, so add dependency into Kconfig.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarch: mvebu: Disable by default unused peripherals in SPL
Pali Rohár [Tue, 24 May 2022 08:58:42 +0000 (10:58 +0200)]
arch: mvebu: Disable by default unused peripherals in SPL

SPL on mvebu loads proper U-Boot from custom Marvell kwbimage format and
therefore support for other binary formats is not required to be present in
SPL. Boot source of proper U-Boot is defined by compile time options and
therefore it is not required to enable all possible and unused peripherals
in SPL by default.

This change decrease size of SPL binaries.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: a3720: Add NVMe to BOOT_TARGET_DEVICES list
Pali Rohár [Mon, 23 May 2022 09:14:36 +0000 (11:14 +0200)]
arm: mvebu: a3720: Add NVMe to BOOT_TARGET_DEVICES list

Enable NVMe booting on boards which have enabled NVMe drivers.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: a3720: Set BOOT_TARGET_DEVICES list to enabled peripherals
Pali Rohár [Mon, 23 May 2022 09:14:35 +0000 (11:14 +0200)]
arm: mvebu: a3720: Set BOOT_TARGET_DEVICES list to enabled peripherals

This allows to compile U-Boot without some boot option for some A3720 board
which does not have that peripheral.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoMAINTAINERS: add myself as Methode maintainer
Robert Marko [Fri, 20 May 2022 11:46:33 +0000 (13:46 +0200)]
MAINTAINERS: add myself as Methode maintainer

I am currently maintaing the Methode uDPU and eDPU boards so add myself
as the maintainer for them.

Remove the old entry from board/Marvell/mvebu_armada-37xx/MAINTAINERS.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm: mvebu: add support for Methode eDPU
Robert Marko [Fri, 20 May 2022 11:46:32 +0000 (13:46 +0200)]
arm: mvebu: add support for Methode eDPU

Methode eDPU is an Armada 3720 power board based on the Methode uDPU.

They feature the same CPU, RAM, and storage as well as the form factor.

However, eDPU only has one SFP slot plus a copper G.hn port which does not
work under U-boot.

In order to reduce duplication, split the uDPU DTS into a common one.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agowatchdog: add pulse support to gpio watchdog driver
Paul Doelle [Mon, 4 Jul 2022 09:00:25 +0000 (09:00 +0000)]
watchdog: add pulse support to gpio watchdog driver

A common external watchdog circuit is kept alive by triggering a short
pulse on the reset pin. This patch adds support for this use case, while
making the algorithm configurable in the devicetree.

The "linux,wdt-gpio" driver being modified is based off the equivalent
driver in the Linux kernel, which provides support for this algorithm.
This patch brings parity to this driver, and is kept aligned with
the functionality and devicetree configuration in the kernel.

It should be noted that this adds a required property named 'hw_algo'
to the devicetree binding, following suit with the kernel. I'm happy to
make this backward-compatible if preferred.

Signed-off-by: Paul Doelle <paaull.git@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agowatchdog: add amlogic watchdog support
Philippe Boos [Mon, 13 Jun 2022 14:00:56 +0000 (16:00 +0200)]
watchdog: add amlogic watchdog support

Add support for hardware watchdog timer for Amlogic SoCs.
This driver has been heavily inspired by his Linux equivalent
(meson_gxbb_wdt.c).

Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Philippe Boos <pboos@baylibre.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agomips: octeon: octeon_ebb7304_defconfig: Enable watchdog support
Stefan Roese [Wed, 11 May 2022 07:08:48 +0000 (09:08 +0200)]
mips: octeon: octeon_ebb7304_defconfig: Enable watchdog support

This patch enables the recently added watchdog support on the MIPS
Octeon EBB7304 eval board.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2 years agowatchdog: octeontx_wdt: Add MIPS Octeon support
Stefan Roese [Wed, 11 May 2022 07:08:47 +0000 (09:08 +0200)]
watchdog: octeontx_wdt: Add MIPS Octeon support

This patch adds support for the Marvell Octeon watchdog driver, which
currently only support the ARM64 Octeon TX & TX2 platforms. Since the
IP is pretty similar, it makes sense to extend this driver to also
support the MIPS Octeon SoC.

A follow-up patch will enable this watchdog support on the EBB7304
eval board.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
2 years agoarm: mvebu: dts: sync DTS
Robert Marko [Fri, 20 May 2022 11:46:31 +0000 (13:46 +0200)]
arm: mvebu: dts: sync DTS

Update the uDPU DTS to the version that is pending upstream [1][2][3][4].

[1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20220516124828.45144-4-robert.marko@sartura.hr/
[2] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20220516124828.45144-5-robert.marko@sartura.hr/
[3] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20220516124828.45144-6-robert.marko@sartura.hr/
[4] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20220516124828.45144-7-robert.marko@sartura.hr/

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoarm64: mvebu: handle non-zero base address for RAM
Chris Packham [Fri, 20 May 2022 04:39:22 +0000 (16:39 +1200)]
arm64: mvebu: handle non-zero base address for RAM

board_get_usable_ram_top() conflated the RAM size with the top address
of RAM. On systems where RAM starts at address 0 these numbers are the
same so it went unnoticed. Update board_get_usable_ram_top() to take
CONFIG_SYS_SDRAM_BASE into account when determining the top address.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoboard: turris: Find atsha device by atsha driver
Pali Rohár [Thu, 19 May 2022 09:11:52 +0000 (11:11 +0200)]
board: turris: Find atsha device by atsha driver

It does not matter what is DT node name of atsha device. So find it via
atsha driver and not by DT node name.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoMerge tag 'for-v2022.10' of https://source.denx.de/u-boot/custodians/u-boot-ubi
Tom Rini [Wed, 20 Jul 2022 11:38:49 +0000 (07:38 -0400)]
Merge tag 'for-v2022.10' of https://source.denx.de/u-boot/custodians/u-boot-ubi

ubifs changes for 2022.10

UBIFS fixes from Pali Rohar:

- ubifs: Fix ubifs_assert_cmt_locked
- ubifs: Use U-Boot assert() from <log.h>

2 years agoubifs: Use U-Boot assert() from <log.h> in UBI/UBIFS code
Pali Rohár [Sun, 10 Jul 2022 11:38:07 +0000 (13:38 +0200)]
ubifs: Use U-Boot assert() from <log.h> in UBI/UBIFS code

U-Boot already provides assert function, so it use also in ubi and ubifs code.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agoubifs: Fix ubifs_assert_cmt_locked()
Pali Rohár [Sun, 10 Jul 2022 11:38:06 +0000 (13:38 +0200)]
ubifs: Fix ubifs_assert_cmt_locked()

U-Boot does not implement down_write_trylock() and its stub always returns
true that lock was acquired. Therefore ubifs_assert_cmt_locked() assert
currently always fails.

Fix this issue by redefining ubifs_assert_cmt_locked() to just empty stub
as there is nothing to assert.

Signed-off-by: Pali Rohár <pali@kernel.org>
2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Tue, 19 Jul 2022 19:54:57 +0000 (15:54 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

2 years agoMerge tag 'for-v2022.10' of https://source.denx.de/u-boot/custodians/u-boot-i2c
Tom Rini [Tue, 19 Jul 2022 19:54:41 +0000 (15:54 -0400)]
Merge tag 'for-v2022.10' of https://source.denx.de/u-boot/custodians/u-boot-i2c

i2c changes for 2022.10

- new driver nuvoton, NPCM7xx from Jim Liu

Fixes:

- ast_i2c: Remove SCL direct drive mode
  from Eddie James

- avoid dynamic stack use in dm_i2c_write

    bloat-o-meter drivers/i2c/i2c-uclass.o.{0,1}
    add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-144 (-144)
    Function                                     old     new   delta
    dm_i2c_write                                 552     408    -144
    Total: Before=3828, After=3684, chg -3.76%

  patch from Rasmus Villemoes

2 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Tue, 19 Jul 2022 14:52:15 +0000 (10:52 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-sunxi

To quote Andre:

One prominent feature is the restructering of the clock driver, which
allows to end up with one actual driver for all variants, although we
still only compile in support for one SoC.
Also contained are some initial SPI fixes, which should fix some
problems, and enable SPI flash support for the F1C100s SoC. Those
patches revealed more problems, I will queue fixes later on, but for
now it should at least still work.
Apart from some smaller fixes (for instance for NAND operation), there
is also preparation for the upcoming Allwinner D1 support, in form of
the USB PHY driver. There are more driver support patches to come.

The gitlab CI completed successfully, including the build test for all
160 sunxi boards. I also boot tested on a few boards, but didn't have
time for more elaborate tests this time.

2 years agoi2c: avoid dynamic stack use in dm_i2c_write
Rasmus Villemoes [Thu, 7 Jul 2022 13:12:17 +0000 (15:12 +0200)]
i2c: avoid dynamic stack use in dm_i2c_write

The size of the dynamic stack allocation here is bounded by the if()
statement. However, just allocating the maximum size up-front and
doing malloc() if necessary avoids code duplication (the
i2c_setup_offset() until the invocation of ->xfer), and generates much
better (smaller) code:

bloat-o-meter drivers/i2c/i2c-uclass.o.{0,1}
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-144 (-144)
Function                                     old     new   delta
dm_i2c_write                                 552     408    -144
Total: Before=3828, After=3684, chg -3.76%

It also makes static analysis of maximum stack usage (using the .su
files that are automatically generated during build) easier if there
are no lines saying "dynamic".

[This is not entirely equivalent to the existing code; this now uses
the stack for len <= 64 rather than len <= 63, but that seems like a
more natural limit.]

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Heiko Schocher <hs@denx.de>
2 years agoi2c: nuvoton: Add NPCM7xx i2c driver
Jim Liu [Thu, 23 Jun 2022 05:31:42 +0000 (13:31 +0800)]
i2c: nuvoton: Add NPCM7xx i2c driver

Add Nuvoton BMC NPCM750 i2c driver

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2 years agoi2c: ast_i2c: Remove SCL direct drive mode
Eddie James [Wed, 11 May 2022 20:52:03 +0000 (15:52 -0500)]
i2c: ast_i2c: Remove SCL direct drive mode

SCL direct drive mode prevents communication with devices that
do clock stretching, so disable. The Linux driver doesn't use
this mode, and the engine can handle clock stretching.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: ryan_chen <ryan_chen@aspeedtech.com>
2 years agophy: sun4i-usb: Add D1 variant
Samuel Holland [Fri, 15 Jul 2022 04:09:22 +0000 (23:09 -0500)]
phy: sun4i-usb: Add D1 variant

D1 has a register layout like A100 and H616, with the moved SIDDQ bit.
Unlike H616 it does not have any dependencies between PHY instances.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agophy: sun4i-usb: Rework HCI PHY (aka "pmu_unk1") handling
Andre Przywara [Fri, 15 Jul 2022 04:09:21 +0000 (23:09 -0500)]
phy: sun4i-usb: Rework HCI PHY (aka "pmu_unk1") handling

As Icenowy pointed out, newer manuals (starting with H6) actually
document the register block at offset 0x800 as "HCI controller and PHY
interface", also describe the bits in our "PMU_UNK1" register.
Let's put proper names to those "unknown" variables and symbols.

While we are at it, generalise the existing code by allowing a bitmap
of bits to clear and set, to cover newer SoCs: The A100 and H616 use a
different bit for the SIDDQ control.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years agophy: sun4i-usb: Drop use of arch-specific headers
Samuel Holland [Fri, 15 Jul 2022 04:09:20 +0000 (23:09 -0500)]
phy: sun4i-usb: Drop use of arch-specific headers

Since commit 089ffd0aedb7 ("phy: sun4i-usb: Use CLK and RESET support")
neither of these headers is used. Dropping them allows the driver to be
architecture-independent.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agosunxi: Move INITIAL_USB_SCAN_DELAY to driver Kconfig
Samuel Holland [Fri, 15 Jul 2022 04:09:19 +0000 (23:09 -0500)]
sunxi: Move INITIAL_USB_SCAN_DELAY to driver Kconfig

This option is used only by the phy-sun4i-usb driver, which does not
inherently depend on the ARM architecture.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 years agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-spi
Tom Rini [Mon, 18 Jul 2022 19:37:38 +0000 (15:37 -0400)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-spi

- add Macronix Octal flash (JaimeLiao)

2 years agoefi: test/py: repair authenticated capsules tests
Vincent Stehlé [Mon, 27 Jun 2022 10:23:19 +0000 (12:23 +0200)]
efi: test/py: repair authenticated capsules tests

The UEFI console initialisation has been modified by commit 68edbed454b8
("efi_loader: initialize console size late"). A corresponding workaround is
now necessary for the automated tests, as added to some of the tests
already by commit e05bd68ed5fc ("test: work around for EFI terminal size
probing").

Add the same workaround to the UEFI authenticated capsules tests to repair
them.

This can be tested with sandbox_defconfig, sandbox64_defconfig or
sandbox_flattree_defconfig, plus CONFIG_EFI_CAPSULE_AUTHENTICATE=y.

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoefi_loader: remove support for CONFIG_LCD
Heinrich Schuchardt [Thu, 14 Jul 2022 06:36:29 +0000 (08:36 +0200)]
efi_loader: remove support for CONFIG_LCD

There is no board left using CONFIG_LCD without CONFIG_DM_VIDEO.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: typo 'formatted' in codingstyle.rst
Heinrich Schuchardt [Sat, 16 Jul 2022 04:19:08 +0000 (06:19 +0200)]
doc: typo 'formatted' in codingstyle.rst

%s/formatted/format/

Fixes: 4211fb2ef6dd ("doc: Migrate CodingStyle wiki page to Sphinx")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agodoc: add package uuid-dev to build dependencies
Heinrich Schuchardt [Sat, 2 Jul 2022 18:53:21 +0000 (18:53 +0000)]
doc: add package uuid-dev to build dependencies

Building mkeficapsule requires include uuid/uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agocli: support bracketed paste
Heinrich Schuchardt [Mon, 7 Feb 2022 18:14:02 +0000 (19:14 +0100)]
cli: support bracketed paste

Some consoles use CSI 200~ and CSI 201~ to bracket inserts. This leads
U-Boot to misinterpret the inserted string. Ignore these escape sequences.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agopxe: simplify label_boot()
Heinrich Schuchardt [Mon, 15 Nov 2021 18:26:51 +0000 (19:26 +0100)]
pxe: simplify label_boot()

Coverity CID 131256 indicates a possible buffer overflow in label_boot().
This would only occur if the size of the downloaded file would exceed 4
GiB. But anyway we can simplify the code by using snprintf() and checking
the return value.

Addresses-Coverity-ID: 131256 ("Security best practices violations (STRING_OVERFLOW)")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>