platform/kernel/u-boot.git
17 months agoKconfig: j721s2: Change K3_MCU_SCRATCHPAD_BASE to non firewalled region
Manorit Chawdhry [Thu, 4 May 2023 05:37:07 +0000 (11:07 +0530)]
Kconfig: j721s2: Change K3_MCU_SCRATCHPAD_BASE to non firewalled region

On K3 HS-SE devices all the firewalls are locked by default
until sysfw comes up. Rom configures some of the firewall for its usage
along with the SRAM for R5 but the PSRAM region is still locked.

The K3 MCU Scratchpad for j721s2 was set to a PSRAM region triggering the
firewall exception before sysfw came up. The exception started happening
after adding multi dtb support that accesses the scratchpad for reading
EEPROM contents.

Old map:
┌─────────────────────────────────────┐ 0x41c00000
│                 SPL                 │
├─────────────────────────────────────┤ 0x41c61f20 (approx)
│                STACK                │
├─────────────────────────────────────┤ 0x41c65f20
│             Global data             │
│  sizeof(struct global_data) = 0xd8  │
├─────────────────────────────────────┤ gd->malloc_base = 0x41c66000
│                HEAP                 │
│  CONFIG_SYS_MALLOC_F_LEN = 0x10000  │
├─────────────────────────────────────┤ CONFIG_SPL_BSS_START_ADDR
│               SPL BSS               │ (0x41c76000)
│  CONFIG_SPL_BSS_MAX_SIZE = 0xA000   │
├─────────────────────────────────────┤ (0x41c80000)
│               DM DATA               │
├─────────────────────────────────────┤ (0x41c84130) (approx)
│                EMPTY                │
└─────────────────────────────────────┘ CONFIG_SYS_K3_BOOT_PARAM_TABLE_INDEX
        (0x41cffbfc)

New map:
┌─────────────────────────────────────┐ 0x41c00000
│                 SPL                 │
├─────────────────────────────────────┤ 0x41c61f20 (approx)
│                STACK                │
├─────────────────────────────────────┤ 0x41c65f20
│             Global data             │
│  sizeof(struct global_data) = 0xd8  │
├─────────────────────────────────────┤ gd->malloc_base = 0x41c66000
│                HEAP                 │
│  CONFIG_SYS_MALLOC_F_LEN = 0x10000  │
├─────────────────────────────────────┤ CONFIG_SPL_BSS_START_ADDR
│               SPL BSS               │ (0x41c76000)
│  CONFIG_SPL_BSS_MAX_SIZE = 0xA000   │
├─────────────────────────────────────┤ (0x41c80000)
│               DM DATA               │
├─────────────────────────────────────┤ (0x41c84130) (approx)
│                EMPTY                │
├─────────────────────────────────────┤ SYS_K3_MCU_SCRATCHPAD_BASE
│              SCRATCHPAD             │ (0x41cff9fc)
│ SYS_K3_MCU_SCRATCHPAD_SIZE = 0x200  │
└─────────────────────────────────────┘ CONFIG_SYS_K3_BOOT_PARAM_TABLE_INDEX
        (0x41cffbfc)

Reviewed-by: Kamlesh Gurudasani <kamlesh@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
17 months agoconfigs: j721s2: Merge the HS and non-HS defconfigs
Manorit Chawdhry [Thu, 4 May 2023 05:37:06 +0000 (11:07 +0530)]
configs: j721s2: Merge the HS and non-HS defconfigs

K3 devices have runtime type board detection. Make the default defconfig
include the secure configuration. Then remove the HS specific config.

Non-HS devices will continue to boot due to runtime device type detection.
If TI_SECURE_DEV_PKG is not set the build will emit warnings, for non-HS
devices these can be ignored.

Reviewed-by: Kamlesh Gurudasani <kamlesh@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
17 months agoarm: dts: iot2050: Include u-boot specific bits implicitly
Jan Kiszka [Tue, 25 Apr 2023 19:28:23 +0000 (21:28 +0200)]
arm: dts: iot2050: Include u-boot specific bits implicitly

Create *-u-boot.dtsi files for each target dtb of the IOT2050 series so
that we can drop the #include deviations from upstream dts[i] files
here.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
17 months agoenvironment: ti: Add get_fit_config command to get FIT config string
Andrew Davis [Tue, 25 Apr 2023 16:20:45 +0000 (11:20 -0500)]
environment: ti: Add get_fit_config command to get FIT config string

When OE is packaging a dtb file into the FIT image it names the node based
on the dtb filename. Node names can't have "/" so it is turned into "_".
We select our FIT config using the "fdtfile" env var so we don't duplicate
the board_name to fdt logic. Result is fdtfile needs mangled when used to
select a config node from OE made FIT image. Do this here.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
17 months agoconfigs: am62x: enable secure device configs by default
Praneeth Bajjuri [Wed, 5 Apr 2023 22:40:47 +0000 (17:40 -0500)]
configs: am62x: enable secure device configs by default

Enable the CONFIG_TI_SECURE_DEVICE by default

Non-HS devices will continue to boot due to runtime device type detection.

TI's security enforcing SoCs will authenticate each binary it loads by
comparing it's signature with keys etched into the SoC during the boot
up process. The am62x family of SoCs by default will have some level of
security enforcement checking. To keep things as simple as possible,
enable the CONFIG_TI_SECURE_DEVICE options by default so all levels of
secure SoCs will work out of the box

Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
Signed-off-by: Kamlesh Gurudasani <kamlesh@ti.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
17 months agok3: pmic: Clear ESM masks
Neha Malcom Francis [Wed, 5 Apr 2023 10:54:35 +0000 (16:24 +0530)]
k3: pmic: Clear ESM masks

ESM MCU masks must be set to 0h so that PMIC can handle errors
that require attention for example SYS_SAFETY_ERRn. The required bits
must be cleared: ESM_MCU_RST_MASK, ESM_MCU_FAIL_MASK, ESM_MCU_PIN_MASK.

If PMIC expected to handle errors, make sure EVM is configured to
connect SOC_SAFETY_ERRz (Main) to the PMIC.

Note that even though the User Guide for TPS65941 for J721E mentions
that these bits are reset to 0h; it is not reflected once board boots to
kernel, possibly due to NVM configurations. Eithercase, it is best to
account for this from R5 SPL side as well.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
17 months agoMerge branch '2023-05-03-assorted-updates-and-fixes'
Tom Rini [Thu, 4 May 2023 15:49:30 +0000 (11:49 -0400)]
Merge branch '2023-05-03-assorted-updates-and-fixes'

- Various typo fixes, pass -Werror to host tools builds, bdi cleanups,
  fix hush and local variables, a FSL PCI fix and correct some python in
  one of the tests.

17 months agoMerge tag 'efi-2023-07-rc2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Thu, 4 May 2023 13:03:02 +0000 (09:03 -0400)]
Merge tag 'efi-2023-07-rc2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2023-07-rc2

Documentation:

* treat documentation warnings as errors in CI
* adjust StarFive VisionFive 2 and SiFive Unmatched documentation
* man-page for cp
* correct description of uclass_get_device_by_of_path
* correct proftool usage

UEFI

* Fix documentation of EFI Python tests
* Rename efi_selftest Python test

17 months agoCI: treat documentation warnings as errors
Heinrich Schuchardt [Tue, 2 May 2023 03:04:11 +0000 (05:04 +0200)]
CI: treat documentation warnings as errors

We do not want to merge documentation that produces Sphinx warnings.

scripts/kernel-doc uses environment variable KDOC_WERROR to determine
if warnings should be treated as errors.

Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoefi: Rename the base efi self-test
Simon Glass [Wed, 19 Apr 2023 23:38:16 +0000 (11:38 +1200)]
efi: Rename the base efi self-test

This function uses the same base name as all the others in this file, so
it is not easy to run just that one test. Add a _base suffix so that it
can be run on its own.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
17 months agodoc: man-page for cp
Heinrich Schuchardt [Fri, 28 Apr 2023 06:52:41 +0000 (08:52 +0200)]
doc: man-page for cp

Add a man-page for the cp command.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agotest: fix pydoc issues for EFI tests
Heinrich Schuchardt [Wed, 3 May 2023 05:08:05 +0000 (07:08 +0200)]
test: fix pydoc issues for EFI tests

Fix issues reported by pydocstyle.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
17 months agodoc: correct HiFive Unmatched boot description
Heinrich Schuchardt [Mon, 1 May 2023 12:47:52 +0000 (14:47 +0200)]
doc: correct HiFive Unmatched boot description

Main U-Boot is loaded by sector number, not by partition GUID type.

Fixes: 70415e1e528d ("board: sifive: add HiFive Unmatched board support")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
17 months agodoc: fix StarFive VisionFive v2 documentation
Heinrich Schuchardt [Mon, 1 May 2023 12:20:48 +0000 (14:20 +0200)]
doc: fix StarFive VisionFive v2 documentation

The number of the partition that U-Boot SPL loads the main U-Boot from is
defined as 2 by CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=0x2. The
partition type GUID is not used currently.

Reword the description of the boot process to make it clearer.

Fixes: 5ecf9b0b8a75 ("board: starfive: add StarFive VisionFive v2 board support")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
17 months agodoc: Indicate required OpenSBI release for VisionFive 2
Heinrich Schuchardt [Thu, 27 Apr 2023 09:56:58 +0000 (11:56 +0200)]
doc: Indicate required OpenSBI release for VisionFive 2

Support for the VisionFive 2 board is not contained in the most recent
OpenSBI release (v1.2).

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
17 months agodocs: fix wrong proftool usage
Pavel Skripkin [Wed, 12 Apr 2023 19:05:31 +0000 (22:05 +0300)]
docs: fix wrong proftool usage

Guide shows incorrect usage of proftool, which is confusing. If proftool
is used w/o '-o' argument it complains like following

$ ./sandbox/tools/proftool -m sandbox/System.map -t trace dump-ftrace > trace.dat
Must provide trace data, System.map file and output file
Usage: proftool [-cmtv] <cmd> <profdata>

s/>/-o/ fixes it and proftool outputs decoded data to trace.dat

Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agodoc: mmc: drop 0x prefixes in read/write examples
Alexander Shirokov [Thu, 27 Apr 2023 10:12:07 +0000 (12:12 +0200)]
doc: mmc: drop 0x prefixes in read/write examples

The patch drops 0x prefixes because all numbers are interpreted as HEX
by default.

Also, it fixes the mismatch between input arguments and output at 'mmc
write' example. Now it's 256 (0x100) blocks.

Signed-off-by: Alexander Shirokov <shirokovalexs@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
17 months agodm: core: fix introduce uclass_get_device_by_of_path
Heinrich Schuchardt [Tue, 2 May 2023 02:59:18 +0000 (04:59 +0200)]
dm: core: fix introduce uclass_get_device_by_of_path

Correct the function documentation.

Fixes: ca031c082700 ("dm: core: introduce uclass_get_device_by_of_path()")
Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agotools: fix TestFdtUtil()
Heinrich Schuchardt [Thu, 20 Apr 2023 18:03:43 +0000 (20:03 +0200)]
tools: fix TestFdtUtil()

Variable old_outdir cannot be used before assignment.
The assignment must occur before the try block.

tools/dtoc/test_fdt.py:796:26:
E0601: Using variable 'old_outdir' before assignment
(used-before-assignment)

Add missing space in assignment.

Fixes: a004f29464d1 ("binman: Tidy up _SetupDtb() to use its own temporary file")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agopci: fsl: Do not access PCI BAR0 register of PCIe Root Port
Pali Rohár [Tue, 2 May 2023 17:53:57 +0000 (19:53 +0200)]
pci: fsl: Do not access PCI BAR0 register of PCIe Root Port

Freescale PCIe Root Port has PEXCSRBAR register at position of PCI BAR0.
PCIe Root Port does not have any PCIe memory, so returns zero when trying
to read from PCIe Root Port BAR0 and ignore any writes.

Signed-off-by: Pali Rohár <pali@kernel.org>
17 months agobuildman: Pass -Werror to the host compiler too
Simon Glass [Fri, 28 Apr 2023 19:50:48 +0000 (13:50 -0600)]
buildman: Pass -Werror to the host compiler too

The host compiler is not failing on warnings at present, when the
-E flag is used in buildman. Add the required flag to fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Tom Rini <trini@konsulko.com>
17 months agocommon/Kconfig: fix comments syntax error
Hugo Villeneuve [Tue, 25 Apr 2023 18:34:45 +0000 (14:34 -0400)]
common/Kconfig: fix comments syntax error

Fix comments error in EVENT_DEBUG description:
    this get usefui -> this to get useful

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoevent: fix comments syntax error
Hugo Villeneuve [Tue, 25 Apr 2023 13:46:45 +0000 (09:46 -0400)]
event: fix comments syntax error

Fix comments syntax error in event description:
    creasted -> created

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoboot/Kconfig: fix comments syntax error
Hugo Villeneuve [Mon, 24 Apr 2023 20:51:12 +0000 (16:51 -0400)]
boot/Kconfig: fix comments syntax error

Fix comments syntax error in SPL_LOAD_FIT_APPLY_OVERLAY description.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agocmd: bdinfo: Print ethaddr of current MAC
Marek Vasut [Sat, 22 Apr 2023 13:01:33 +0000 (15:01 +0200)]
cmd: bdinfo: Print ethaddr of current MAC

Instead of always printing ethaddr of MAC 0, print eth%daddr of the current MAC.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agocmd: bdinfo: Wrap network information printing into print_eth()
Marek Vasut [Sat, 22 Apr 2023 13:01:32 +0000 (15:01 +0200)]
cmd: bdinfo: Wrap network information printing into print_eth()

Move all the network information printing into print_eth(),
no functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agocmd: bdinfo: Map fdt_blob and new_fdt to sysmem
Marek Vasut [Sat, 22 Apr 2023 13:01:31 +0000 (15:01 +0200)]
cmd: bdinfo: Map fdt_blob and new_fdt to sysmem

Map fdt_blob and new_fdt to sysmem, otherwise $fdtcontroladdr
and bdinfo output do not match and the bdinfo output address
is not a valid address accessible via sandbox memory accessors.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agotools: fix TestFdtUtil()
Heinrich Schuchardt [Thu, 20 Apr 2023 18:03:43 +0000 (20:03 +0200)]
tools: fix TestFdtUtil()

Variable old_outdir cannot be used before assignment.
The assignment must occur before the try block.

tools/dtoc/test_fdt.py:796:26:
E0601: Using variable 'old_outdir' before assignment
(used-before-assignment)

Add missing space in assignment.

Fixes: a004f29464d1 ("binman: Tidy up _SetupDtb() to use its own temporary file")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agotest: hush_if_test: Add hush variable test
Stefan Herbrechtsmeier [Mon, 3 Apr 2023 13:50:01 +0000 (15:50 +0200)]
test: hush_if_test: Add hush variable test

Add a test for the hush shell variable assignment and clear.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agocommon: cli_hush: Restore clear local variable support
Stefan Herbrechtsmeier [Mon, 3 Apr 2023 13:50:00 +0000 (15:50 +0200)]
common: cli_hush: Restore clear local variable support

The u-boot hush shell doesn’t support the unset command to clear a
variable and therefore an empty value ("c=") should be a valid value
for the set_local_var function to clear the variable. This partial
reverts commit aa722529635c ("common: cli_hush: avoid dead code") and
only checks for a `=` in the string. Additionally explicit call the
unset_local_var function to remove the variable if the value is empty.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agobk4r1: Enable LTO
Tom Rini [Wed, 3 May 2023 22:29:58 +0000 (18:29 -0400)]
bk4r1: Enable LTO

In order to allow for general platform growth due to fixes, enable LTO
here to give us more room.

Signed-off-by: Tom Rini <trini@konsulko.com>
17 months agoMerge tag 'u-boot-imx-20230503' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Wed, 3 May 2023 17:15:12 +0000 (13:15 -0400)]
Merge tag 'u-boot-imx-20230503' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20230503
-------------------

- Fixes for : pico-imx6ul, smegw01
- new boards: DMSSE20, Reform 2
- fix: get_boot_device, PLL video rate

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

17 months agoMerge branch '2023-05-02-assorted-platform-updates-and-additions'
Tom Rini [Wed, 3 May 2023 13:23:21 +0000 (09:23 -0400)]
Merge branch '2023-05-02-assorted-platform-updates-and-additions'

- Updates for starqltechn and other qualcomm platforms, hi3798mv200,
  Broadcom Northstar, and mediatek platforms
- Drop omap5_uevm, and assorted TI platform updates
- Add MAX14526

17 months agostarqltechn: enable bootmenu
Dzmitry Sankouski [Sat, 1 Apr 2023 09:28:44 +0000 (12:28 +0300)]
starqltechn: enable bootmenu

Needed for multiboot with vendor's Android.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
17 months agostarqltechn: use button keyboard driver
Dzmitry Sankouski [Sat, 1 Apr 2023 09:28:43 +0000 (12:28 +0300)]
starqltechn: use button keyboard driver

Button keyboard driver used to navigate bootmenu entries.

Add gpio buttons, button keyboard driver.
Add gpio keys dts bindings.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agostarqltechn: use 16x32 font
Dzmitry Sankouski [Sat, 1 Apr 2023 09:28:42 +0000 (12:28 +0300)]
starqltechn: use 16x32 font

This font is more readable on high ppi display

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoarm: histb: hi3798mv200: add initial support for Hi3798MV200 HC2910-2AGHD05 board
Yang Xiwen [Sat, 1 Apr 2023 11:17:36 +0000 (19:17 +0800)]
arm: histb: hi3798mv200: add initial support for Hi3798MV200 HC2910-2AGHD05 board

A board with Hi3798MV200 SoC and various peripherals. Details are in the
board README.md.

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
17 months agodt-binding: histb-clock: add clocks definition for Hi3798MV200
Yang Xiwen [Sat, 1 Apr 2023 11:17:35 +0000 (19:17 +0800)]
dt-binding: histb-clock: add clocks definition for Hi3798MV200

These clocks are found on Hi3798MV200

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
17 months agommc: hi6220_dw_mmc: add compatible for HC2910 support
Yang Xiwen [Sat, 1 Apr 2023 11:17:34 +0000 (19:17 +0800)]
mmc: hi6220_dw_mmc: add compatible for HC2910 support

It adds compatible "hisilicon,hi3798mv200-dw-mshc" for HC2910 SoC
Hi3798MV200 to probe this mmc driver.

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
17 months agoarm: add support for Hisilicon HiSTB family SoCs
Yang Xiwen [Sat, 1 Apr 2023 11:17:33 +0000 (19:17 +0800)]
arm: add support for Hisilicon HiSTB family SoCs

First supported chip is hi3798mv200 (which is similar to Hi3798cv200
used by poplar).

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
17 months agoarm: Remove omap5_uevm board
Tom Rini [Tue, 4 Apr 2023 15:47:25 +0000 (11:47 -0400)]
arm: Remove omap5_uevm board

This platform is unsupported by TI and was never widely distributed.  As
this is untested for a long while and missing some DM conversions,
remove it and related device tree files.

Signed-off-by: Tom Rini <trini@konsulko.com>
17 months agoarm: mach-k3: Workaround errata ID i2331
Nitin Yadav [Thu, 6 Apr 2023 07:59:36 +0000 (13:29 +0530)]
arm: mach-k3: Workaround errata ID i2331

Errata doc: https://www.ti.com/lit/pdf/sprz457
Errata ID i2331 CPSW: Device lockup when reading CPSW registers

Details: A device lockup can occur during the second read of any CPSW
subsystem register after any MAIN domain power on reset (POR). A MAIN
domain POR occurs using the hardware MCU_PORz signal, or via software
using CTRLMMR_RST_CTRL.SW_MAIN_POR or CTRLMMR_MCU_RST_CTRL.SW_MAIN_POR.
After these resets, the processor and internal bus structures may get
into a state which is only recoverable with full device reset using
MCU_PORz.
Due to this errata, Ethernet boot should not be used on this device.

Workaround(s): To avoid the lockup, a warm reset should be issued after
a MAIN domain POR and before any access to the CPSW registers. The warm
reset realigns internal clocks and prevents the lockup from happening.
Workaround above errata by calling do_reset() in case of cold boot in
order to trigger warm reset. This needs enabling SYSRESET driver in R5
SPL to enable TI SCI reset driver.

Signed-off-by: Nitin Yadav <n-yadav@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
17 months agoboard: ti: j721s2: Add support to detect daughtercards
Kishon Vijay Abraham I [Mon, 10 Apr 2023 06:10:15 +0000 (11:40 +0530)]
board: ti: j721s2: Add support to detect daughtercards

Add support to detect daughtercards (GESI Ethernet card) in-order
to set the MAC address of the main CPSW2G interface.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
17 months agoconfigs: j7200_evm_a72: Enhance bootcmd to configure ethernet PHY
Kishon Vijay Abraham I [Tue, 11 Apr 2023 09:48:37 +0000 (15:18 +0530)]
configs: j7200_evm_a72: Enhance bootcmd to configure ethernet PHY

Update the default BOOTCOMMAND to provide an automatic and easier way
to configure ethernet PHY before loading the firmware.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
17 months agoconfigs: change bpi-r3 to board specific dts and change prompt
Frank Wunderlich [Tue, 11 Apr 2023 15:19:47 +0000 (17:19 +0200)]
configs: change bpi-r3 to board specific dts and change prompt

Use own devicetree for the board and change the prompt.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
17 months agoboard: mediatek: add Bananapi-R3 devicetree
Daniel Golle [Tue, 11 Apr 2023 15:19:46 +0000 (17:19 +0200)]
board: mediatek: add Bananapi-R3 devicetree

Add board specific devicetree for Bananapi R3 SBC.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
17 months agopinctrl: mediatek: set R1/R0 in case pullen/pullsel succeeded
Daniel Golle [Wed, 12 Apr 2023 20:36:43 +0000 (21:36 +0100)]
pinctrl: mediatek: set R1/R0 in case pullen/pullsel succeeded

Commit dafe0fbfb0f3 ("pinctrl: mediatek: rewrite mtk_pinconf_set and
related functions") changed the logic deciding to set R0 and R1
registers for V1 devices.

Before:
/* Also set PUPD/R0/R1 if the pin has them */
err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_PUPD, !pullup);
if (err != -EINVAL) {
mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_R0, r0);
mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_R1, r1);
}

After:
/* try pupd_r1_r0 if pullen_pullsel return error */
err = mtk_pinconf_bias_set_pullen_pullsel(dev, pin, disable, pullup,
  val);
if (err)
return mtk_pinconf_bias_set_pupd_r1_r0(dev, pin, disable,
       pullup, val);

Tracing mtk_pinconf_bias_set_pullen_pullsel shows that the function
always either returns 0 in case of success or -EINVAL in case any error
has occurred. Hence the logic responsible of the decision to program R0
and R1 has been inverted.

This leads to problems on BananaPi R2 (MT7623N) when booting from
SDMMC, it turns out accessing eMMC no longer works since
U-Boot 2022.07:

MT7623> mmc dev 0
Card did not respond to voltage select! : -110

The problem wasn't detected for a long time as both eMMC and SDMMC work
fine if they are used to boot from, and hence R0 and R1 were already
setup by the bootrom and/or preloader.

Fix the logic to restore the originally intended and correct behavior
and also change the descriptive comment accordingly.

Fixes: dafe0fbfb0f3 ("pinctrl: mediatek: rewrite mtk_pinconf_set and related functions")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Tested-By: Frank Wunderlich <frank-w@public-files.de>
17 months agoarm: mach-k3: am62a7: Enable QoS for DSS
Aradhya Bhatia [Fri, 14 Apr 2023 07:27:25 +0000 (12:57 +0530)]
arm: mach-k3: am62a7: Enable QoS for DSS

Enable Quality of Service (QoS) blocks for Display SubSystem (DSS), by
servicing the DSS - DDR traffic from the Real-Time (RT) queue. This is
done by setting the DSS DMA orderID to 8.

The C7x and VPAC have been overwhelming the DSS's access to the DDR
(when it was accessing via the Non Real-Time (NRT) Queue), primarily
because their functional frequencies, and hence DDR accesses, were
significantly higher than that of DSS. This led the display to flicker
when certain edgeAI models were being run.

With the DSS traffic serviced from the RT queue, the flickering issue
has been found to be mitigated.

The am62a qos files are auto generated from the k3 resource partitioning
tool.

Section-3.1.12, "QoS Programming Guide", in the AM62A TRM[1], provides
more information about the QoS, and section-14.1, "System Interconnect
Registers", provides the register descriptions.

[1] AM62A Tech Ref Manual: https://www.ti.com/lit/pdf/spruj16

Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
17 months agoarm: mach-k3: j7200: Fix firewall warnings at boot time
Manorit Chawdhry [Mon, 17 Apr 2023 06:34:09 +0000 (12:04 +0530)]
arm: mach-k3: j7200: Fix firewall warnings at boot time

J721E and J7200 have same file j721e_init.c which had the firewall
configs for J721E being applied on J7200 causing the warnings. Split the
firewalls for both the boards to remove those warnings.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
17 months agoboard: Fix documentation for Snapdragon based Samsung and Qualcomm boards
Bhupesh Sharma [Thu, 20 Apr 2023 11:28:48 +0000 (16:58 +0530)]
board: Fix documentation for Snapdragon based Samsung and Qualcomm boards

The current documentation for Snapdragon based Samsung
and Qualcomm boards is vague in the sense that at one place
it mentions that u-boot  can be used as a replacement for ABL
bootloader and at another it mentions that u-boot is loaded
as an Android boot image through ABL.

Fix the same.

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
17 months agoboard: Fix board file path for sdm845.c for Samsung and Qualcomm boards
Bhupesh Sharma [Thu, 20 Apr 2023 11:28:47 +0000 (16:58 +0530)]
board: Fix board file path for sdm845.c for Samsung and Qualcomm boards

Currently a few 'board/qualcomm/../Makefile' point to incorrect
path of sdm845 board file.

Fix the same.

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
17 months agoarm: mach-k3: common: don't reconfigure background firewalls
Manorit Chawdhry [Thu, 20 Apr 2023 11:46:24 +0000 (17:16 +0530)]
arm: mach-k3: common: don't reconfigure background firewalls

K3 devices have some firewalls set up by ROM that we usually remove so
that the development is easy in HS devices.

While removing the firewalls disabling a background region before
disabling the foreground regions keeps the firewall in a state where all
the transactions will be blacklisted until all the regions are disabled.
This causes a race for some other entity trying to access that memory
region before all the firewalls are disabled and causes an exception.

Since the background regions configured by ROM are in such a manner
that they allow all transactions, don't touch the background regions at
all.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Kamlesh Gurudasani <kamlesh@ti.com>
17 months agoarm: mach-k3: common: Default to non fitImage boot on HS-FS
Vignesh Raghavendra [Thu, 20 Apr 2023 16:12:21 +0000 (21:42 +0530)]
arm: mach-k3: common: Default to non fitImage boot on HS-FS

Allow non fitImage bootflow on Field Securable (HS-FS) devices in
addition to GP, force fitImage boot only on Security enforced (HS-SE)
devices where signed images are necessary to maintain chain of trust.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Kamlesh Gurudasani <kamlesh@ti.com>
17 months agoarm: dts: msm: add GENI SE QUP device tree node
Vladimir Zapolskiy [Fri, 21 Apr 2023 17:50:41 +0000 (20:50 +0300)]
arm: dts: msm: add GENI SE QUP device tree node

On modern Qualcomm platforms including SDM845 a GENI SE QUP IP
description is supposed to be found in board device tree nodes,
the version of the IP is used by the GENI UART driver to properly
set an oversampling divider value, which impacts UART baudrate.

The change touches dragonboard845c and starqltechn board device
tree source files, a device tree node label to "debug" UART is
renamed to 'uart9' according to the naming found in Linux.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
17 months agoserial: msm-geni: correct oversampling value based on QUP hardware revision
Vladimir Zapolskiy [Fri, 21 Apr 2023 17:50:40 +0000 (20:50 +0300)]
serial: msm-geni: correct oversampling value based on QUP hardware revision

Starting from QUP v2.5 the value of oversampling is changed from 32
to 16, keeping the old value on newer platforms results on wrong set
UART IP clock divider, thus the asked baudrate does not correspond to
the actually set with all the consequencies for a user.

The change links the driver to a new Qualcomm GENI SE QUP driver
to get its hardware version and update the oversampling value.

Deliberately the code under CONFIG_DEBUG_UART_MSM_GENI is not touched,
since a wanted baudrate can be controlled by setting a modified
CONFIG_DEBUG_UART_CLOCK build time variable.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
17 months agoserial: msm-geni: Use upstream Linux bindings
Konrad Dybcio [Fri, 21 Apr 2023 17:50:39 +0000 (20:50 +0300)]
serial: msm-geni: Use upstream Linux bindings

The name "se" is used in upstream Linux device trees and has been for
ages, long before this U-Boot-ism was introduced. Same goes for the
existing compatible. Get rid of that.

[vzapolskiy: removed a ready change in the driver]
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
17 months agoserial: msm-geni: fix a compile time warning from msm_serial_setbrg()
Vladimir Zapolskiy [Fri, 21 Apr 2023 17:50:38 +0000 (20:50 +0300)]
serial: msm-geni: fix a compile time warning from msm_serial_setbrg()

A compiler warns about a missing function prototype, which is valid
and fixed by converting the function into static one, also fix
interleaved local variable declarations and assignments.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Fixes: 324df15a292e ("serial: qcom: add support for GENI serial driver")
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
17 months agoserial: msm-geni: fix code indentation
Vladimir Zapolskiy [Fri, 21 Apr 2023 17:50:37 +0000 (20:50 +0300)]
serial: msm-geni: fix code indentation

This a cosmetic change, which corrects code indentation in a few places.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
17 months agoserial: msm-geni: remove invalid se-clk clock name
Vladimir Zapolskiy [Fri, 21 Apr 2023 17:50:36 +0000 (20:50 +0300)]
serial: msm-geni: remove invalid se-clk clock name

There is only one clock supplier to the serial IP, thus getting it by
name is not needed, also note that "clock-names" property is not listed
under doc/device-tree-bindings/serial/msm-geni-serial.txt, and finally
"se-clk" clock name is invalid, if added, it shall get "se" value like
it's already described in Linux device tree documentation.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
17 months agoserial: msm-geni: Always bind before relocation
Konrad Dybcio [Fri, 21 Apr 2023 17:50:35 +0000 (20:50 +0300)]
serial: msm-geni: Always bind before relocation

In preparation for supporting upstream Linux device trees on Qualcomm
platforms, make this the default behavior.

[vzapolskiy: extracted the driver change from a combination with dts changes]
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
17 months agoserial: msm-geni: remove redundant includes
Vladimir Zapolskiy [Fri, 21 Apr 2023 17:50:34 +0000 (20:50 +0300)]
serial: msm-geni: remove redundant includes

For whatever reason, likely a driver stub was copied from another
driver, the driver contains a bunch of unnecessary and confusing
includes like watchdog.h etc., the change reduces the list.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
17 months agomisc: add Qualcomm GENI SE QUP device driver
Vladimir Zapolskiy [Fri, 21 Apr 2023 17:50:33 +0000 (20:50 +0300)]
misc: add Qualcomm GENI SE QUP device driver

This change adds a Qualcomm GENI SE QUP device driver as a wrapper for
actually enabled and used serial devices found on a board.

At the moment the driver is pretty simple, its intention is to populate
childred devices and provide I/O mem read interface to them as clients,
this is needed for GENI UART driver to set up a proper clock divider
and provide the actually asked baud rate.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
17 months agoboard: Add new Broadcom Northstar board
Linus Walleij [Mon, 24 Apr 2023 07:38:30 +0000 (09:38 +0200)]
board: Add new Broadcom Northstar board

This adds a simple Northstar "BRCMNS" board to be used with
the BCM4708x and BCM5301x chips.

The main intention is to use this with the D-Link DIR-890L
and DIR-885L routers for loading the kernel into RAM from
NAND memory using the BCH-1 ECC and using the separately
submitted SEAMA load command, so we are currently not adding
support for things such as networking.

The DTS file is a multiplatform NorthStar board, designed to
be usable with several NorthStar designs by avoiding any
particulars not related to the operation of U-Boot.

If other board need other ECC for example, they need to
create a separate DTS file and augment the code, but I don't
know if any other users will turn up.

Cc: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
17 months agoarm: Add support for the Broadcom Northstar SoCs
Linus Walleij [Mon, 24 Apr 2023 07:38:29 +0000 (09:38 +0200)]
arm: Add support for the Broadcom Northstar SoCs

The original Northstar is an ARM SoC series that comprise
BCM4709x and BCM5301x and uses a dual-core Cortex A9, the
global timer and a few other things.

This series should not be confused with North Star Plus
(NSP) which is partly supported by U-Boot already.

The SoC is well supported by the Linux kernel and OpenWrt
as it is used in many routers.

Since we currently don't need any chip-specific quirks
and can get the system up from just the device tree, a
mach-* directory doesn't even need to be added, just
some small Kconfig fragments.

Cc: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
17 months agoarm: dts: Import device tree for Broadcom Northstar
Linus Walleij [Mon, 24 Apr 2023 07:38:28 +0000 (09:38 +0200)]
arm: dts: Import device tree for Broadcom Northstar

This brings in the main SoC device tree used by the
Broadcom Northstar chipset, i.e. BCM4709x and BCM5301x.
This is taken from the v6.3 Linux kernel.

Cc: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
17 months agoextcon: add MAX14526 MUIC support
Svyatoslav Ryhel [Tue, 25 Apr 2023 07:57:22 +0000 (10:57 +0300)]
extcon: add MAX14526 MUIC support

MAX14526 is a powerful extcon chip which allows detection of various
plugs like usb, mhl, uart, headset etc. This version of driver
implements support of AP-usb and CP-usb/uart paths.

Tested-by: Andreas Westman Dorcsak <hedmoo@yahoo.com> # LG P880 T30
Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # LG P895 T30
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agotest: Add tests for the extcon
Svyatoslav Ryhel [Tue, 25 Apr 2023 07:57:21 +0000 (10:57 +0300)]
test: Add tests for the extcon

Provide tests to the simple extcon device.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agodm: extcon: add an uclass for extcon
Svyatoslav Ryhel [Tue, 25 Apr 2023 07:57:20 +0000 (10:57 +0300)]
dm: extcon: add an uclass for extcon

Add a new simple uclass for extcon. Currently all setup is done
in the probe. Uclass struct and ops are empty for now.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
17 months agoMerge tag 'tpm-master-02052023' of https://source.denx.de/u-boot/custodians/u-boot-tpm
Tom Rini [Tue, 2 May 2023 16:52:40 +0000 (12:52 -0400)]
Merge tag 'tpm-master-02052023' of https://source.denx.de/u-boot/custodians/u-boot-tpm

adjust maintainers

17 months agoMerge branch '2023-05-01-assorted-powerpc-updates'
Tom Rini [Tue, 2 May 2023 16:50:42 +0000 (12:50 -0400)]
Merge branch '2023-05-01-assorted-powerpc-updates'

- A number of PCI fixes, and one Kconfig cleanup for PowerPC platforms

17 months agopci: auto: Remove PCI_CLASS_PROCESSOR_POWERPC autoconfig case
Pali Rohár [Thu, 20 Apr 2023 19:44:25 +0000 (21:44 +0200)]
pci: auto: Remove PCI_CLASS_PROCESSOR_POWERPC autoconfig case

PCI autoconfig case for PCI_CLASS_PROCESSOR_POWERPC just prints debug
message and then calls autoconfig setup code like for any other standard
endpoint device. We do not need special debug message for it, so remove
this case and handle PCI_CLASS_PROCESSOR_POWERPC via default code path.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
17 months agoMAINTAINERS: assign include/tpm*, cmd/tpm*
Heinrich Schuchardt [Sun, 2 Apr 2023 04:51:01 +0000 (06:51 +0200)]
MAINTAINERS: assign include/tpm*, cmd/tpm*

The files include/tpm* are an integral part of the TPM drivers.
The tpm* commands are used to access TPM devices.

Both should be managed by the TPM DRIVERS maintainer.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
17 months agocmd: missing break in test_write_limit()
Heinrich Schuchardt [Sun, 2 Apr 2023 04:51:54 +0000 (06:51 +0200)]
cmd: missing break in test_write_limit()

In test_write_limit() an unintended fall-through occurs.

Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
17 months agousb: ehci-mx6: move phy setup before register access
Tim Harvey [Fri, 28 Apr 2023 18:50:30 +0000 (11:50 -0700)]
usb: ehci-mx6: move phy setup before register access

For the CONFIG_PHY case, move the PHY setup before the register access.

This avoids a hang when updating the imx8mm.dtsi which moves the
USB OTG power-domains to the PHY.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Tested-by: Fabio Estevam <festevam@denx.de>
17 months agosmegw01: Convert CFG_EXTRA_ENV_SETTINGS to an env file
Fabio Estevam [Wed, 26 Apr 2023 16:05:01 +0000 (13:05 -0300)]
smegw01: Convert CFG_EXTRA_ENV_SETTINGS to an env file

Currently, it is recommended to move from CFG_EXTRA_ENV_SETTINGS to
an env file, so do the conversion.

Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
17 months agosmegw01: Fix fallback to altbootcmd
Eduard Strehlau [Wed, 26 Apr 2023 16:05:00 +0000 (13:05 -0300)]
smegw01: Fix fallback to altbootcmd

The bootcmd/altbootcmd mechanism is not invoked for bootmenus.
Manually compare bootcount and bootlimit to implement fallback on all
codepaths.

Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
17 months agosmegw01: Disable additional boot menu options
Eduard Strehlau [Wed, 26 Apr 2023 16:04:59 +0000 (13:04 -0300)]
smegw01: Disable additional boot menu options

Defaults have changed, we do not want the bootmenu to contain EFI
options.

Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
17 months agosmegw01: Read the second MAC address
Fabio Estevam [Wed, 26 Apr 2023 16:04:58 +0000 (13:04 -0300)]
smegw01: Read the second MAC address

Currently, only the first MAC address is read from the fuses.

The second MAC address is not read and Linux assigns a random one.

To prevent this behavior, read the second MAC address from the fuses
and store it into the eth1addr environment variable so that it
can be passed to Linux.

Signed-off-by: Fabio Estevam <festevam@denx.de>
17 months agosmegw01: Add lockdown U-Boot env support
Eduard Strehlau [Wed, 26 Apr 2023 16:04:57 +0000 (13:04 -0300)]
smegw01: Add lockdown U-Boot env support

Add lockdown U-Boot env support so that only certain U-Boot environment
variables are allowed to be modified.

Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
17 months agosmegw01: Switch to fitImage
Eduard Strehlau [Wed, 26 Apr 2023 16:04:56 +0000 (13:04 -0300)]
smegw01: Switch to fitImage

Instead of loading the zImage kernel and the devicetree separately, switch
to the fitImage format, which is more convenient when working with secure
boot, for example.

Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
17 months agosmegw01: Change default boot device to eMMC
Eduard Strehlau [Wed, 26 Apr 2023 16:04:55 +0000 (13:04 -0300)]
smegw01: Change default boot device to eMMC

Let eMMC be the default boot medium.

Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
17 months agosmegw01: Enable EMMC boot from multiple partitions
Eduard Strehlau [Wed, 26 Apr 2023 16:04:54 +0000 (13:04 -0300)]
smegw01: Enable EMMC boot from multiple partitions

GPT Partition labels are used for determining the right
root filesystem to boot from.

The U-Boot environment is configured to reside in the eMMC hardware
boot partition we are currently booted from.

This should enable a dual copy approach for upgrading the bootloader.
One can overwrite the inactive hardware partition with new bootloader
and environment and afterwards switch the eMMC boot partition for an
atomic bootloader switch.

Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
17 months agosmegw01: Only commit to new partition if update was successful
Eduard Strehlau [Wed, 26 Apr 2023 16:04:53 +0000 (13:04 -0300)]
smegw01: Only commit to new partition if update was successful

When performing rootfs update via swupdate, it is convenient to check the
'ustate' variable to decide whether the update succeeded or not.

Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
17 months agosmegw01: Run altbootcmd in the case of failure
Eduard Strehlau [Wed, 26 Apr 2023 16:04:52 +0000 (13:04 -0300)]
smegw01: Run altbootcmd in the case of failure

Run the altbootcmd script if any step of bootcmd fails.

This ensures that always a valid image can be run.

Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
17 months agosmegw01: Add altbootcmd
Eduard Strehlau [Wed, 26 Apr 2023 16:04:51 +0000 (13:04 -0300)]
smegw01: Add altbootcmd

Add an altbootcmd script, which is convenient way to integrate with
swupdate and perform a roll back of the previous working version in the
case of update failure.

Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
17 months agosmegw01: Select bootcount support
Eduard Strehlau [Wed, 26 Apr 2023 16:04:50 +0000 (13:04 -0300)]
smegw01: Select bootcount support

Add automatic boot counter that increases after every
reset. After a power-on reset, it will be initialized with 1,
and each reboot will increment the value by 1. By default it is
disabled if bootlimit isn't set.

Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
17 months agosmegw01: Select CONFIG_CMD_SQUASHFS
Eduard Strehlau [Wed, 26 Apr 2023 16:04:49 +0000 (13:04 -0300)]
smegw01: Select CONFIG_CMD_SQUASHFS

Select CONFIG_CMD_SQUASHFS so that the SquashFS U-Boot commands
are available.

Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
17 months agosmegw01: Enable setting additional boot params
Eduard Strehlau [Wed, 26 Apr 2023 16:04:48 +0000 (13:04 -0300)]
smegw01: Enable setting additional boot params

Introduce EXTRA_BOOTPARAMS to allow passing additional parameters
to kernel command line. This is useful for debugging purposes.

Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
17 months agoarm: imx8m: remove unused and obsolete board_fix_fdt() in SOC context
Hugo Villeneuve [Tue, 25 Apr 2023 14:19:35 +0000 (10:19 -0400)]
arm: imx8m: remove unused and obsolete board_fix_fdt() in SOC context

It doesn't seem appropriate for arch/SOC to use a board-level
functionality (CONFIG_OF_BOARD_FIXUP), because this prevents boards
that need to do FDT fixup from using that feature.

Also, this code is completely dead and useless (from comments by
Rasmus Villemoes on the mailing list):

  - No in-tree imx8m-based board seems to set CONFIG_OF_BOARD_FIXUP
  - The nodes which that function wants to disable don't even exist in
    the U-Boot copy of imx8mp.dtsi.

This code was introduced in commit 35bb60787b88. It seems to be some
random import of code from downstream NXP U-Boot, with a commit
message that makes no sense in upstream context.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
17 months agoimx: fix get_boot_device() for imx8
Tim Harvey [Mon, 24 Apr 2023 16:33:44 +0000 (09:33 -0700)]
imx: fix get_boot_device() for imx8

commit 787f04bb6a0a ("imx: add USB2_BOOT type") broke get_boot_device()
for IMX8 which affects booting from SDP due to boot_instance being
non-zero.

Fix this by only using boot_instance for imx8ulp and imx9.

Fixes: 787f04bb6a0a ("imx: add USB2_BOOT type")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
17 months agoimx6: clock: print real pixel clock rate
Dario Binacchi [Sat, 22 Apr 2023 14:11:19 +0000 (16:11 +0200)]
imx6: clock: print real pixel clock rate

Add debug messages to print the real pixel clock rate, which may not be
the requested one.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
17 months agoimx6: clock: add support to get LCD pixel clock rate
Dario Binacchi [Sat, 22 Apr 2023 14:11:18 +0000 (16:11 +0200)]
imx6: clock: add support to get LCD pixel clock rate

Add the get_lcd_clk() function to get the LCD pixel clock rate.

The patch has been tested on imx6ul platform.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
17 months agoimx6: clock: improve calculations to get the PLL video rate
Dario Binacchi [Sat, 22 Apr 2023 14:11:17 +0000 (16:11 +0200)]
imx6: clock: improve calculations to get the PLL video rate

During some tests to check the pixel clock rate in the transition from
U-Boot to the Linux kernel, I noticed that with the same configuration
of the registers the debug messages reported different rates.

The same Linux kernel calculations are now used to get the PLL video
rate.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
17 months agoimx: support i.MX8QM DMSSE20 a1 board
Oliver Graute [Fri, 21 Apr 2023 10:11:50 +0000 (12:11 +0200)]
imx: support i.MX8QM DMSSE20 a1 board

Add i.MX8QM DMSSE20 a1 board support

U-Boot 2023.04-00030-g7be2f547b2 (Apr 21 2023 - 11:11:43 +0200)

Model: Advantech iMX8QM DMSSE20
Board: DMS-SE20A1 8GB
Build: SCFW 549b1e18, SECO-FW c9de51c0, ATF 5782363
Boot:  USB
DRAM:  8 GiB
Core:  100 devices, 19 uclasses, devicetree: separate
MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... OK
In:    serial@5a060000
Out:   serial@5a060000
Err:   serial@5a060000
Net:   eth0: ethernet@5b040000
Warning: ethernet@5b050000 (eth1) using random MAC address - 32:05:0c:f9:5e:10
, eth1: ethernet@5b050000
Hit any key to stop autoboot:  0

Signed-off-by: Oliver Graute <oliver.graute@kococonnector.com>
17 months agoimx8mn: buffer overflow in low_drive_gpu_freq()
Heinrich Schuchardt [Mon, 17 Apr 2023 23:37:21 +0000 (01:37 +0200)]
imx8mn: buffer overflow in low_drive_gpu_freq()

Avoid a buffer overflow if assigned-clock-rates has less than two elements.

Fixes: 98bcdf16356c ("imx8mn: Add low drive mode support for DDR4/LPDDR4 EVK")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
17 months agopico-imx6ul: Convert to CONFIG_DM_SERIAL
Fabio Estevam [Sun, 16 Apr 2023 17:55:04 +0000 (14:55 -0300)]
pico-imx6ul: Convert to CONFIG_DM_SERIAL

The conversion to CONFIG_DM_SERIAL is mandatory, so select
this option.

Signed-off-by: Fabio Estevam <festevam@denx.de>
17 months agoboard: mntre: imx8mq: Add MNT Reform 2 board support
Patrick Wildt [Sun, 5 Feb 2023 23:48:26 +0000 (00:48 +0100)]
board: mntre: imx8mq: Add MNT Reform 2 board support

The MNT Reform 2 is a modular DIY laptop.  In its initial version it
is based on the BoundaryDevices i.MX8MQ SoM.  Some parts have been
lifted from BoundaryDevices official U-Boot downstream project.

Signed-off-by: Patrick Wildt <patrick@blueri.se>
Tested-by: Vagrant Cascadian <vagrant@debian.org>
Tested-by: Vagrant Cascadian <vagrant@debian.org>
Signed-off-by: Stefano Babic <sbabic@denx.de>
17 months agopci: mpc85xx: Do not access PCI BARs registers of BDF address 00:00.0
Pali Rohár [Thu, 20 Apr 2023 19:44:23 +0000 (21:44 +0200)]
pci: mpc85xx: Do not access PCI BARs registers of BDF address 00:00.0

At BDF address 00:00.0 is fictional device which PCI configuration header
is for configuring mpc85xx PCI controller itself. PCI config space of this
device has ATMU inbound registers on position of PCI BARs. Trying to do PCI
auto configuration of this device cause rewriting ATMU inbound registers.
To avoid it, do not allow overwriting registers at BARs positions. And
because this device does not have any PCI memory, return zeros when trying
to read PCI BARs config space registers. It signals to auto configuration
tool to not allocate any PCI memory for this device.

This information is taken from MPC8544E Reference Manual, sections
17.3.1.3, 17.3.1.1.1, 17.3.2 and 17.3.2.11. Available at NXP website:
https://www.nxp.com/docs/en/reference-manual/MPC8544ERM.pdf

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Tested-by: Heiko Schocher <hs@denx.de>
17 months agopci: mpc85xx: Do not try to access extended PCIe registers
Pali Rohár [Thu, 13 Apr 2023 20:41:46 +0000 (22:41 +0200)]
pci: mpc85xx: Do not try to access extended PCIe registers

Driver pci_mpc85xx.c is PCI controller driver for old PCI Local Bus,
which does not support access to extended PCIe registers (above 0xff),
as opposite of the PCIe driver pcie_fsl.c for the same platform.

So do not try to access extended PCIe registers as it cannot work.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Tested-by: Heiko Schocher <hs@denx.de>
17 months agopci: mpc85xx: Allow 8/16-bit access to PCI config space
Pali Rohár [Thu, 13 Apr 2023 20:41:45 +0000 (22:41 +0200)]
pci: mpc85xx: Allow 8/16-bit access to PCI config space

This Freescale mpc85xx PCI controller should support 8-bit and 16-bit read
and write access to PCI config space as described in more Freescale
reference manuals.

This change fixes issue that 8-bit and 16-bit write to PCI config space
caused to clear adjacent bits of 32-bit PCI register.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Tested-by: Heiko Schocher <hs@denx.de>