platform/kernel/u-boot.git
16 months agoimx: parse-container: fix build warning
Peng Fan [Thu, 15 Jun 2023 10:09:06 +0000 (18:09 +0800)]
imx: parse-container: fix build warning

Fix build warning:
warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3
has type ‘u64’ {aka ‘long long unsigned int’} [-Wformat=]
         printf("can't find memreg for image %d load address 0x%x, error %d\n",
warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but
argument 3 has type ‘sc_faddr_t’ {aka ‘long long unsigned int’} [-Wformat=]
          debug("memreg %u 0x%lx -- 0x%lx\n", mr, start, end);

Signed-off-by: Peng Fan <peng.fan@nxp.com>
16 months agoimx: use generic name ele(EdgeLockSecure Enclave)
Peng Fan [Thu, 15 Jun 2023 10:09:05 +0000 (18:09 +0800)]
imx: use generic name ele(EdgeLockSecure Enclave)

Per NXP requirement, we rename all the NXP EdgeLock Secure Enclave
code including comment, folder and API name to ELE to align.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
16 months agoimx: scu_api: update to version 1.16 and add more APIs
Peng Fan [Thu, 15 Jun 2023 10:09:04 +0000 (18:09 +0800)]
imx: scu_api: update to version 1.16 and add more APIs

Upgrade SCFW API to 1.16
Add more APIs:
 sc_misc_get_button_status
 sc_pm_reboot
 sc_seco_v2x_build_info

Signed-off-by: Peng Fan <peng.fan@nxp.com>
16 months agoimx: congatec/cgtqmx8: correct SCU API usage
Peng Fan [Thu, 15 Jun 2023 10:09:03 +0000 (18:09 +0800)]
imx: congatec/cgtqmx8: correct SCU API usage

The return value is int type, not sc_err_t(u8), correct the usage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Tested-by: Oliver Graute <oliver.graute@kococonnector.com>
Reviewed-by: Oliver Graute <oliver.graute@kococonnector.com>
16 months agoimx: advantech: correct SCU API usage
Peng Fan [Thu, 15 Jun 2023 10:09:02 +0000 (18:09 +0800)]
imx: advantech: correct SCU API usage

The return value is int type, not sc_err_t(u8), correct the usage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Tested-by: Oliver Graute <oliver.graute@kococonnector.com>
Reviewed-by: Oliver Graute <oliver.graute@kococonnector.com>
16 months agoimx: siemens/capricorn: correct SCU API usage
Peng Fan [Thu, 15 Jun 2023 10:09:01 +0000 (18:09 +0800)]
imx: siemens/capricorn: correct SCU API usage

The return value is int type, not sc_err_t(u8), correct the usage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
16 months agoimx: toradex/colibri-imx8x: correct SCU API usage
Peng Fan [Thu, 15 Jun 2023 10:09:00 +0000 (18:09 +0800)]
imx: toradex/colibri-imx8x: correct SCU API usage

The return value is int type, not sc_err_t(u8), correct the usage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
16 months agoimx: toradex/apalis-imx8: correct SCU API usage
Peng Fan [Thu, 15 Jun 2023 10:08:59 +0000 (18:08 +0800)]
imx: toradex/apalis-imx8: correct SCU API usage

The return value is int type, not sc_err_t(u8), correct the usage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
16 months agoimx: mach: correct SCU API usage
Peng Fan [Thu, 15 Jun 2023 10:08:58 +0000 (18:08 +0800)]
imx: mach: correct SCU API usage

The return value is int type, not sc_err_t(u8), correct the usage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
16 months agoconfigs: phycore-imx8mm_defconfig: Enable LTO
Teresa Remmet [Wed, 14 Jun 2023 12:36:48 +0000 (14:36 +0200)]
configs: phycore-imx8mm_defconfig: Enable LTO

Enable LTO for binary size reduction.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
16 months agoconfigs: phycore-imx8mp_defconfig: Enable LTO
Teresa Remmet [Wed, 14 Jun 2023 12:36:47 +0000 (14:36 +0200)]
configs: phycore-imx8mp_defconfig: Enable LTO

Enable LTO for binary size reduction.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
16 months agocolibri_imx6: fix RALAT and WALAT values
Stefan Eichenberger [Wed, 14 Jun 2023 09:01:37 +0000 (11:01 +0200)]
colibri_imx6: fix RALAT and WALAT values

Running a memtest in U-Boot and Linux shows that some Colibri iMX6
produce bitflips at temperatures above 60°C. This happens because the
RALAT and WALAT values on the Colibri iMX6 are too low. The problems
were introduced by commit 09dbac8174c4 ("mx6: ddr: Restore ralat/walat
in write level calibration") before the calibration process overwrote
the values and set them to the maximum value. With this commit, we make
sure that the RALAT and WALAT values are set to the maximum values
again. This has been proven to work for years.

Fixes: 09dbac8174c4 ("mx6: ddr: Restore ralat/walat in write level calibration")
Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
16 months agodoc: board: phytec: add phycore_imx8mp
Yannic Moog [Wed, 14 Jun 2023 07:12:20 +0000 (09:12 +0200)]
doc: board: phytec: add phycore_imx8mp

Add documentation on how to build a bootable U-Boot image for the PHYTEC
phyCORE-i.MX 8M Plus.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
16 months agodoc: board: phytec: add phycore_imx8mm
Yannic Moog [Wed, 14 Jun 2023 07:12:19 +0000 (09:12 +0200)]
doc: board: phytec: add phycore_imx8mm

Add documentation on how to build a bootable U-Boot image for the PHYTEC
phyCORE-i.MX 8M Mini.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
16 months agoboard: gateworks: venice: add imx8mp-gw7905-2x support
Tim Harvey [Fri, 9 Jun 2023 16:54:51 +0000 (09:54 -0700)]
board: gateworks: venice: add imx8mp-gw7905-2x support

The Gateworks imx8mp-venice-gw7905-2x consists of a SOM + baseboard.

The GW702x SOM contains the following:
 - i.MX8M Plus SoC
 - LPDDR4 memory
 - eMMC Boot device
 - Gateworks System Controller (GSC) with integrated EEPROM, button
   controller, and ADC's
 - PMIC
 - SOM connector providing:
  - eQoS GbE MII
  - 1x SPI
  - 2x I2C
  - 4x UART
  - 2x USB 3.0
  - 1x PCI
  - 1x SDIO (4-bit 3.3V)
  - 1x SDIO (4-bit 3.3V/1.8V)
  - GPIO

The GW7905 Baseboard contains the following:
 - GPS
 - microSD
 - off-board I/O connector with I2C, SPI, GPIO
 - EERPOM
 - PCIe clock generator
 - 1x full-length miniPCIe socket with PCI/USB3 (via mux) and USB2.0
 - 1x half-length miniPCIe socket with USB2.0 and USB3.0
 - USB 3.0 HUB
 - USB Type-C with USB PD Sink capability and peripheral support
 - USB Type-C with USB 3.0 host support

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
16 months agoboard: gateworks: venice: display dram speed
Tim Harvey [Fri, 9 Jun 2023 16:54:01 +0000 (09:54 -0700)]
board: gateworks: venice: display dram speed

Display dram speed during configuration.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
16 months agoboard: gateworks: venice: assume emmc device for USB boot
Tim Harvey [Fri, 9 Jun 2023 16:51:46 +0000 (09:51 -0700)]
board: gateworks: venice: assume emmc device for USB boot

When booting from USB (SDP) setup firmware-update environment
for emmc device.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
16 months agoimx8m: beacon: Update MAINTAINER file to include beacon rst files
Adam Ford [Sun, 28 May 2023 19:18:04 +0000 (14:18 -0500)]
imx8m: beacon: Update MAINTAINER file to include beacon rst files

With variou README files migrated to rst, add them to the
MAINTAINER file for Beacon.

Signed-off-by: Adam Ford <aford173@gmail.com>
16 months agoimx8m: imx8mn-beacon: Migrate README to rst
Adam Ford [Sun, 28 May 2023 19:18:03 +0000 (14:18 -0500)]
imx8m: imx8mn-beacon: Migrate README to rst

Since U-Boot builds HTML documentation, migrate the contents
of the README file to an rst file which can generate the
proper outputs.

Signed-off-by: Adam Ford <aford173@gmail.com>
16 months agoimx: imx8mn-beacon: Move environment definition to env file
Adam Ford [Sun, 28 May 2023 19:18:02 +0000 (14:18 -0500)]
imx: imx8mn-beacon: Move environment definition to env file

Instead of cluttering up a header file with a bunch of defines,
move the default environmental variables to a file called
imx8mn_beacon.env and reference it from the defconfigs.

Signed-off-by: Adam Ford <aford173@gmail.com>
16 months agoimx8m: imx8mm-beacon: Migrate README to rst
Adam Ford [Sun, 28 May 2023 19:18:01 +0000 (14:18 -0500)]
imx8m: imx8mm-beacon: Migrate README to rst

Since U-Boot builds HTML documentation, migrate the contents
of the README file to an rst file which can generate the
proper outputs.

Signed-off-by: Adam Ford <aford173@gmail.com>
16 months agoimx: imx8mm-beacon: Move environment definition to env file
Adam Ford [Sun, 28 May 2023 19:18:00 +0000 (14:18 -0500)]
imx: imx8mm-beacon: Move environment definition to env file

Instead of cluttering up a header file with a bunch of defines,
move the default environmental variables to a file called
imx8mm_beacon.env and reference it from the defconfig.

Signed-off-by: Adam Ford <aford173@gmail.com>
16 months agoimx8mn-var-som: read eth MAC address from EEPROM
Hugo Villeneuve [Thu, 25 May 2023 21:02:28 +0000 (17:02 -0400)]
imx8mn-var-som: read eth MAC address from EEPROM

Read ethernet MAC address from EEPROM located on the SOM.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
16 months agoarm: dts: imx8mn-var-som: fix PHY detection bug by adding deassert delay
Hugo Villeneuve [Thu, 25 May 2023 21:02:27 +0000 (17:02 -0400)]
arm: dts: imx8mn-var-som: fix PHY detection bug by adding deassert delay

While testing the ethernet interface on a Variscite symphony carrier
board using an imx8mn SOM with an onboard ADIN1300 PHY (EC hardware
configuration), the ethernet PHY is not detected.

The ADIN1300 datasheet indicate that the "Management interface
active (t4)" state is reached at most 5ms after the reset signal is
deasserted.

The device tree in Variscite custom git repository uses the following
property:

    phy-reset-post-delay = <20>;

Add a new MDIO property 'reset-deassert-us' of 20ms to have the same
delay inside the ethphy node. Adding this property fixes the problem
with the PHY detection.

Note that this SOM can also have an Atheros AR8033 PHY. In this case,
a 1ms deassert delay is sufficient. Add a comment to that effect.

Fixes: c4c1ed68c1e8 ("imx8mn_var_som: Add support for Variscite
VAR-SOM-MX8M-NANO board")

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
16 months agoimx8mn-var-som: fix non-applied PHY reset-gpios properties
Hugo Villeneuve [Thu, 25 May 2023 21:02:26 +0000 (17:02 -0400)]
imx8mn-var-som: fix non-applied PHY reset-gpios properties

Select DM_ETH_PHY so that the reset-gpios property of the ethphy node
can be used.

Also select DM_PCA953X, which is needed for resetting the
ethernet PHY on the carrier board via the PCA9534 I/O expander.

Commit 4e5114daf9eb ("imx8mn: synchronise device tree with linux") did
synchronise device tree with linux, which in effect removed obsolete
PHY reset properties and replaced them with new mdio DM
properties. But the commit didn't activate DM_ETH_PHY or DM_PCA953X.

Fixes: 4e5114daf9eb ("imx8mn: synchronise device tree with linux")

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
16 months agoimx8mn-var-som: read and print SoM infos from eeprom on startup
Hugo Villeneuve [Thu, 25 May 2023 21:02:25 +0000 (17:02 -0400)]
imx8mn-var-som: read and print SoM infos from eeprom on startup

Enable support to read and display configuration/manufacturing infos
from 4Kbit EEPROM located on SOM board.

Note: CONFIG_DISPLAY_BOARDINFO is automatically selected for ARM arch.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
16 months agoimx8m: soc.c: demote some printfs to debug
Rasmus Villemoes [Mon, 22 May 2023 09:27:28 +0000 (11:27 +0200)]
imx8m: soc.c: demote some printfs to debug

Getting

  Found /vpu_g1@38300000 node
  Modify /vpu_g1@38300000:status disabled
  Found /vpu_g2@38310000 node
  Modify /vpu_g2@38310000:status disabled

etc. on the console on every boot is needlessly verbose. Demote the
"Found ..." lines to debug(), which is consistent with other instances
in soc.c.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
16 months agoconfig: xea: Enable DM_SERIAL for the XEA - single binary (SB) u-boot
Lukasz Majewski [Fri, 19 May 2023 10:43:58 +0000 (12:43 +0200)]
config: xea: Enable DM_SERIAL for the XEA - single binary (SB) u-boot

The single binary version of u-boot for XEA board is used to debrick and
factory programming.

The produced u-boot.sb is a single file, which allows having fully
operational u-boot prompt loaded with imx287 ROM.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agoconfig: xea: Enable DM_SERIAL for the XEA (imx287 based) board
Lukasz Majewski [Fri, 19 May 2023 10:43:57 +0000 (12:43 +0200)]
config: xea: Enable DM_SERIAL for the XEA (imx287 based) board

The XEA board now supports the DM_SERIAL feature in u-boot.

The SPL is using the SPL_OF_PLATDATA - i.e. NOT SPL_DM_SERIAL to
reduce the overall size of the SPL binary.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agoarm: Kconfig: Switch XEA (imx287 based) board to use CONFIG_PL01X_SERIAL
Lukasz Majewski [Fri, 19 May 2023 10:43:56 +0000 (12:43 +0200)]
arm: Kconfig: Switch XEA (imx287 based) board to use CONFIG_PL01X_SERIAL

The CONFIG_PL011 used by all other ARCH_MX28 based boards is not
supporting DM_SERIAL. Instead, other define - namely CONFIG_PL01X_SERIAL
shall be used by boards supporting DM_SERIAL.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agoarm: xea: Call spl_early_init() before DM serial console is enabled in SPL
Lukasz Majewski [Fri, 19 May 2023 10:43:55 +0000 (12:43 +0200)]
arm: xea: Call spl_early_init() before DM serial console is enabled in SPL

The in-spl enabled DM serial console requires the board setup to be
able to parse SPL_OF_PLATDATA based serial driver (pl01x) for the
imx28 based XEA board.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agoarm: mxs: Prevent serial console init when in very early SPL boot code
Lukasz Majewski [Fri, 19 May 2023 10:43:54 +0000 (12:43 +0200)]
arm: mxs: Prevent serial console init when in very early SPL boot code

When DM_SERIAL is enabled on mxs (i.e. imx28) platform, the console
early initialization must be postponed until the driver model is
correctly setup.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agoserial: pl01x: Modify pending callback to test if transmit FIFO is empty
Lukasz Majewski [Fri, 19 May 2023 10:43:53 +0000 (12:43 +0200)]
serial: pl01x: Modify pending callback to test if transmit FIFO is empty

Before this change the FR_TXFF (Transmit FIFO full) bit (5 in
HW_UARTDBG_FR) has been used to assess if there is still data pending
to be sent via UART.

This approach is problematic, as it may happen that serial is in the
middle of transmission (so the TX FIFO is NOT full anymore) and this
test returns true infinitely. As a result, for example in _serial_flush()
DM serial function we are locked in endless while().

The fix here is to test explicitly if the TX FIFO is empty.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agoserial: pl01x: Prepare the driver to support SPL_OF_PLATDATA
Lukasz Majewski [Fri, 19 May 2023 10:43:52 +0000 (12:43 +0200)]
serial: pl01x: Prepare the driver to support SPL_OF_PLATDATA

This commit prepares the pl01x serial driver to be used with
SPL_OF_PLATDATA enabled.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agoserial: pl01x: Change OF_CONTROL to OF_REAL
Lukasz Majewski [Fri, 19 May 2023 10:43:51 +0000 (12:43 +0200)]
serial: pl01x: Change OF_CONTROL to OF_REAL

Before this change, building this driver for SPL with enabled SPL_DM_SERIAL
was problematic, as '-Wunused-const-variable=' warning was visible.

Now, the code is only considered when u-boot proper is build.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agodts: xea: Disable 'clks' node for xea (imx287)
Lukasz Majewski [Fri, 19 May 2023 10:43:50 +0000 (12:43 +0200)]
dts: xea: Disable 'clks' node for xea (imx287)

As imx28 family of SoCs is NOT supporting the Common Clock Framework (CCF)
the 'clks' property shall NOT be enabled by default.

Without this change u-boot proper before relocation tries to bind driver
(which doesn't exists) for this device. As a result, pre-relocation DTB
parsing is finished with error and the board hangs in a very early stage
of u-boot proper boot process.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agodts: xea: Remove clocks property from debug UART on XEA
Lukasz Majewski [Fri, 19 May 2023 10:43:49 +0000 (12:43 +0200)]
dts: xea: Remove clocks property from debug UART on XEA

The imx287 SoC doesn't support common clock framework (CCF), so the
'clocks' property is removed to avoid early (i.e. in SPL) errors when
SPL_OF_PLATDATA is used.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agodts: xea: Add u-boot specific 'type' property to duart
Lukasz Majewski [Fri, 19 May 2023 10:43:48 +0000 (12:43 +0200)]
dts: xea: Add u-boot specific 'type' property to duart

The DM_SERIAL implicitly requires CONFIG_PL01X_SERIAL, which
allows support for both serial IP block versions (i.e. PL011 and
PL010).

The decision about used IP block is based on the compatible string,
when DM is used.

In the XEA, the OF_PLATDATA is used to allow usage of serial driver in
the SPL (as the size of SPL is crucial). In this case one cannot extract
the type of IP block from .data field (corresponding to compatible) and
it must be explicitly read at probe from dtoc generated, u-boot specific
property.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agodts: xea: Enable debug UART support in XEA's SPL (DM_SERIAL)
Lukasz Majewski [Fri, 19 May 2023 10:43:47 +0000 (12:43 +0200)]
dts: xea: Enable debug UART support in XEA's SPL (DM_SERIAL)

After enabling DM_SERIAL for XEA board, the same serial shall be used
in the SPL (with SPL_OF_PLATDATA support).

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agospl: xea: Provide stub DM driver for imx28 clocks
Lukasz Majewski [Fri, 19 May 2023 10:43:46 +0000 (12:43 +0200)]
spl: xea: Provide stub DM driver for imx28 clocks

This code fixes following WARNING:
  DTOC    spl/dts/dt-plat.c
fsl_imx28_clkctrl: WARNING: the driver fsl_imx28_clkctrl was not found in the driver list

As imx28 doesn't yet support common clock framework, this prevents from
DTOC warnings during SPL build.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agodefconfig: xea: Change default spi-nor memory bus to 2
Lukasz Majewski [Fri, 19 May 2023 10:43:45 +0000 (12:43 +0200)]
defconfig: xea: Change default spi-nor memory bus to 2

After the re-sync with Linux kernel (v6.0) of the XEA DTS
(SHA1: 7d08ddd09b75e7a3c103cc0d0d3ed700287f268e) the alias
for SPI bus, to which SPI-NOR  memory is connected, has changed from
'spi3' to 'spi2'.

To be in sync with current u-boot's xea dts, the default bus number
(which allows running 'sf probe' without any extra parameters given)
has been adjusted.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agodts: xea: Provide missing FEC required properties (mac0 and reg_fec_3v3)
Lukasz Majewski [Fri, 19 May 2023 10:43:44 +0000 (12:43 +0200)]
dts: xea: Provide missing FEC required properties (mac0 and reg_fec_3v3)

After the commit (SHA1: 7d08ddd09b75e7a3c103cc0d0d3ed700287f268e) some
u-boot specific XEA FEC related properties have been replaced by ones
from the Linux kernel.

To be more specific - XEA board (and imx287 in general) has built L2
switch connected to FEC, which needs some special treatment.

In u-boot it is handled with 'mac0' node, whereas Linux uses dedicated
switch DTS node.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agodts: xea: Delete not used in u-boot DTS nodes
Lukasz Majewski [Fri, 19 May 2023 10:43:43 +0000 (12:43 +0200)]
dts: xea: Delete not used in u-boot DTS nodes

After the re-sync with Linux Kernel's DTS
(SHA1: 7d08ddd09b75e7a3c103cc0d0d3ed700287f268e), the XEA's
descripion has nodes and properties, which are NOT utilized
in the u-boot.

To avoid confusion - those are deleted.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agotoradex: tdx-cfg-block: add 0070 verdin i.mx 8m plus quad sku
Emanuele Ghidoli [Mon, 15 May 2023 13:06:41 +0000 (15:06 +0200)]
toradex: tdx-cfg-block: add 0070 verdin i.mx 8m plus quad sku

Add new i.MX 8M Plus Quad SKU to ConfigBlock handling.

0070: Verdin iMX8M Plus Quad 8GB WB IT

This SKU is identical to 0066 but supporting Industrial Temperature range.

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
16 months agoarm: config: Adjust imx287 based XEA board PMU configuration
Lukasz Majewski [Tue, 9 May 2023 14:32:43 +0000 (16:32 +0200)]
arm: config: Adjust imx287 based XEA board PMU configuration

This patch adjusts XEA's PMU setup as this board is supposed to be
mainly powered from DCDC_BATT source.

Moreover, in this HW design the VDD_4P2 is not used as well.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agoarm: mxs: Add function to dump PMU registers
Lukasz Majewski [Tue, 9 May 2023 14:32:42 +0000 (16:32 +0200)]
arm: mxs: Add function to dump PMU registers

This commit provides function, which when debugging
output is enabled dumps the IMX28 PMU registers.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agoarm: mxs: Provide Kconfig option to not enable 4P2 regulator in IMX28 PMU
Lukasz Majewski [Tue, 9 May 2023 14:32:41 +0000 (16:32 +0200)]
arm: mxs: Provide Kconfig option to not enable 4P2 regulator in IMX28 PMU

The IMX28 PMU (Power Management Unit) has a dedicated Linear Regulator
to produce (by default) 4.2V output - available outside the chip as
VDD_4P2.

When system is supposed to not use VDD5V as a main power source - instead
the DCDC_BATT is used; it is safe to disable this regulator.

As the in-PMU DCDC switching regulator (from which DCDC_VDDA, DCDC_VDDIO
and DCDC_VDDD are generated) can be driven from DCDC_BATT or output
of this 4P2 regulator - by disabling the latter the use of the DCDC_BATT
is forced.

To be more specific - according to NXP's AN4199 the DCDC_BATT source is
preferred (over VDD5V), as more efficient and stable source for
industrial applications.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agoarm: mxs: Provide Kconfig option to disable battery charging at IMX28 PMU
Lukasz Majewski [Tue, 9 May 2023 14:32:40 +0000 (16:32 +0200)]
arm: mxs: Provide Kconfig option to disable battery charging at IMX28 PMU

This new Kconfig option allows disabling the in-PMU battery charging
block. This may be required when DCDC_BAT source is powered not from
battery, but from already regulated, good quality source.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agoarm: mxs: Provide Kconfig option to to not use VDD5V as IMX28 PMU source
Lukasz Majewski [Tue, 9 May 2023 14:32:39 +0000 (16:32 +0200)]
arm: mxs: Provide Kconfig option to to not use VDD5V as IMX28 PMU source

This option sets the current limit for 5V source to zero, so all
the PMU outputs are primarily powered from battery source (DCDC_BAT).

This option may be set on systems, where the 5V is NOT supposed to be
in any scenario powering the system - for example on systems where
DCDC_BAT is connected to fixed and regulated 4.2V source (so the
"battery" is not present).

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agopower: imx8m-power-domain: Add delay to align with kernel driver
Fabio Estevam [Sat, 6 May 2023 16:14:02 +0000 (13:14 -0300)]
power: imx8m-power-domain: Add delay to align with kernel driver

In the imx8m power domain kernel driver, there is an extra udelay(5)
prior to requesting the domain to power up:

https://github.com/torvalds/linux/blob/v6.3/drivers/soc/imx/gpcv2.c#L347-L375

Haven't observed any issues due to the lack of this delay in U-Boot yet,
but better to align it with the kernel driver implementation.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
16 months agoboard: gateworks: venice: update board doc to show other emmc parts
Tim Harvey [Wed, 3 May 2023 00:05:57 +0000 (17:05 -0700)]
board: gateworks: venice: update board doc to show other emmc parts

Update the venice board documentation to show how to install to the
various eMMC hardware partitions available as the same binary firmware
can be placed in either user/boot0/boot1 without build-time config
changes. Note that the boot offsets differ depending on the SoC and the
eMMC hardware partition.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
16 months agoboard: gateworks: venice: move env location
Tim Harvey [Wed, 3 May 2023 00:05:56 +0000 (17:05 -0700)]
board: gateworks: venice: move env location

To allow U-Boot to fit within emmc boot partitions move the env from
just under 16MiB to just under 4MiB as some emmc devices used on venice
boards have 4MiB boot partitions. This still leaves plenty of room for
U-Boot.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
16 months agoboard: gateworks: venice: dynamically update the update_firmware script
Tim Harvey [Wed, 3 May 2023 00:05:55 +0000 (17:05 -0700)]
board: gateworks: venice: dynamically update the update_firmware script

The update_firmware script is intended to update the boot firmware but
the details including the offset and hardware partition are dependent
on the boot device.

Specifically:
- IMX8MM/IMX8MP (BOOTROM v2) the offset is 32KiB for SD and eMMC user
  hardware partition and 0KiB for eMMC boot partitions.
- IMX8MM the offset is 33KiB for SD and eMMC regardless of hardware
  partition.

Dynamically set soc, dev, bootpart, and bootblk env vars at runtime
and use these in the update_firmware script. Remove the splblk env var
from config files as its no longer needed.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
16 months agoboard: gateworks: venice: dynamically determine U-Boot env partition
Tim Harvey [Wed, 3 May 2023 00:05:54 +0000 (17:05 -0700)]
board: gateworks: venice: dynamically determine U-Boot env partition

Determine the U-Boot env hardware partition depending on the boot
device.

This allows the same boot firmware image to be placed on user, boot0,
or boot1 without changing CONFIG_SYS_MMC_ENV_PART.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
16 months agoboard: gateworks: venice: dynamically determine U-Boot raw sector
Tim Harvey [Wed, 3 May 2023 00:05:53 +0000 (17:05 -0700)]
board: gateworks: venice: dynamically determine U-Boot raw sector

CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR needs to adjust for
IMX8MN and IMX8MP when booting from an eMMC boot partition due
to IMX BOOTROM v2 using an SPL offset of 0 for boot partitions
and 32K for the user partition.

In order to allow the same firmware to run on both user and boot
hardware partitions adjust raw_sect dynamically at runtime.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
16 months agoboard: gateworks: venice: add eraseenv command
Tim Harvey [Tue, 2 May 2023 17:45:54 +0000 (10:45 -0700)]
board: gateworks: venice: add eraseenv command

Add eraseenv command and remove the unnecessary env command.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
16 months agoboard: gateworks: venice: add GPIO name lookup
Tim Harvey [Tue, 2 May 2023 17:44:44 +0000 (10:44 -0700)]
board: gateworks: venice: add GPIO name lookup

Add GPIO name lookup so that you can act on GPIO's by name vs controller
id:

Before:
u-boot=> gpio input pci_wdis#
GPIO: 'pci_wdis#' not found
Command 'gpio' failed: Error -22

After:
u-boot=> gpio input pci_wdis#
gpio: pin pci_wdis# (gpio 103) value is 1

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
16 months agoconfigs: verdin-imx8mp: enable ARCH_MISC_INIT
Sergio Prado [Tue, 2 May 2023 08:57:50 +0000 (10:57 +0200)]
configs: verdin-imx8mp: enable ARCH_MISC_INIT

This is required to boot a FIT image, otherwise the caam_jr driver is
not initialized and the hash verification fails with the following
error:

Verifying Hash Integrity ... sha256dev_get_priv: null device
CAAM was not setup properly or it is faulty

Signed-off-by: Sergio Prado <sergio.prado@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
16 months agoARM: imx9: support env in fat and ext4
Oleksandr Suvorov [Tue, 11 Apr 2023 17:27:41 +0000 (20:27 +0300)]
ARM: imx9: support env in fat and ext4

Change boot device logic to also allow environment stored in fat and
in ext4 when booting from SD or eMMC.

As the boot device check for SD and for eMMC was depending on
ENV_IS_IN_MMC being defined, change the ifdef blocks at
env_get_location to use IS_ENABLED instead for all modes, returning
NOWHERE when no valid mode is found.

This solution is based on (with added SPL support):
Link: https://lore.kernel.org/all/20211020191626.3648540-1-ricardo@foundries.io/
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
16 months agoarm: mx6: module_fuse: fix build failure due to wrong argument name
Giulio Benetti [Thu, 6 Apr 2023 16:17:13 +0000 (18:17 +0200)]
arm: mx6: module_fuse: fix build failure due to wrong argument name

nodeoff variable should be variable off returned by fdt_path_offset() so
let's rename it to off.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
16 months agocolibri-imx8x: print firmware versions
Andrejs Cainikovs [Mon, 3 Apr 2023 11:14:25 +0000 (13:14 +0200)]
colibri-imx8x: print firmware versions

Print firmware versions during U-Boot start:

 BuildInfo:
  - SCFW f5623878, SECO-FW c9de51c0, IMX-MKIMAGE 0, ATF c6a19b1
  - U-Boot 2022.04-00335-g65192567f81-dirty

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
16 months agoconfigs: imx: imx8mm_beacon: Add config option for QSPI booting
Adam Ford [Thu, 2 Feb 2023 01:58:41 +0000 (19:58 -0600)]
configs: imx: imx8mm_beacon: Add config option for QSPI booting

The imx8mm_beacon SOM has a QSPI part attached to the FSPI controller.
Update the header and spl files to support booting from NOR flash and
add imx8mm_beacon_fspi_defconfig to support this configuration.

Signed-off-by: Adam Ford <aford173@gmail.com>
16 months agoimx: imx8mm-beacon: Enable FlexSPI in U-Boot
Adam Ford [Thu, 2 Feb 2023 01:58:40 +0000 (19:58 -0600)]
imx: imx8mm-beacon: Enable FlexSPI in U-Boot

In order to use the FlexSPI interface in U-Boot, configure
the alias to make spi0 point to flexspi.

With that enabled, sf probe detects the QSPI part as:
SF: Detected n25q256ax1 with page size 256 Bytes, erase size 4 KiB, total 32 MiB

Signed-off-by: Adam Ford <aford173@gmail.com>
16 months agoMerge branch 'next'
Tom Rini [Mon, 10 Jul 2023 18:29:14 +0000 (14:29 -0400)]
Merge branch 'next'

16 months agoPrepare v2023.07 v2023.07
Tom Rini [Mon, 10 Jul 2023 18:13:47 +0000 (14:13 -0400)]
Prepare v2023.07

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoMerge tag 'fsl-qoriq-2023-7-6' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Mon, 10 Jul 2023 01:54:40 +0000 (21:54 -0400)]
Merge tag 'fsl-qoriq-2023-7-6' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq into next

Enable DM Serial for ls1043ardb and ls1046ardb/afrwy
Fixed secure boot on LS-CH2 platforms

16 months agoMerge branch '2023-07-07-assorted-build-improvements' into next
Tom Rini [Sat, 8 Jul 2023 15:28:39 +0000 (11:28 -0400)]
Merge branch '2023-07-07-assorted-build-improvements' into next

- Correct a few dependencies in Kconfig and better handle some generated
  files so that they are properly cleaned later.

16 months agosysreset: Change Kconfig GPIO dependency
Michal Simek [Tue, 4 Jul 2023 12:05:13 +0000 (14:05 +0200)]
sysreset: Change Kconfig GPIO dependency

DM_GPIO depends on GPIO to be enabled but select will cause that DM_GPIO is
selected without GPIO which ends up in compilation error:
undefined reference to `dm_gpio_set_value'
undefined reference to `dm_gpio_get_value'
undefined reference to `dm_gpio_free'
undefined reference to `gpio_request_by_name'

Signed-off-by: Michal Simek <michal.simek@amd.com>
[trini: Fix configs which had relied on these select's]
Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agotpl: Kconfig: TPL_BANNER_PRINT depends on DEBUG_UART && TPL_SERIAL
Ying Sun [Sun, 25 Jun 2023 09:18:21 +0000 (17:18 +0800)]
tpl: Kconfig: TPL_BANNER_PRINT depends on DEBUG_UART && TPL_SERIAL

As implemented in the arch/arm/mach-rockchip/tpl.c file,
the CONFIG_TPL_BANNER_PRINT option will not work
if either of these options is not enabled.

Add dependency constraints to the CONFIG_TPL_BANNER_PRINT option
definition to prevent configuration problems
where option is enabled but do not take effect.

Suggested-by: Yanjie Ren <renyanjie01@gmail.com>
Signed-off-by: Ying Sun <sunying@nj.iscas.ac.cn>
16 months agocommon: Kconfig: SYS_CONSOLE_ENV_OVERWRITE depends on SYS_CONSOLE_IS_IN_ENV
Ying Sun [Sun, 25 Jun 2023 08:52:07 +0000 (16:52 +0800)]
common: Kconfig: SYS_CONSOLE_ENV_OVERWRITE depends on SYS_CONSOLE_IS_IN_ENV

CONFIG_SYS_CONSOLE_ENV_OVERWRITE is implemented in common/console.c
when "#if CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV)" is met.

It is recommended to add dependency constraints to its definition.

Suggested-by: Yanjie Ren <renyanjie01@gmail.com>
Signed-off-by: Ying Sun <sunying@nj.iscas.ac.cn>
16 months agocmd: CONFIG_CMD_SAVES depends on CONFIG_CMD_LOADS
Ying Sun [Sun, 25 Jun 2023 08:24:47 +0000 (16:24 +0800)]
cmd: CONFIG_CMD_SAVES depends on CONFIG_CMD_LOADS

CONFIG_CMD_SAVES is used to enable support for the "saveenv" command
and is only implemented in cmd/load.c
when "#if defined(CONFIG_CMD_LOADS)" is met.

It is recommended to add dependency constraints to its definition.
Prevents "saveenv" command from not being supported
when "CONFIG_CMD_SAVES=y CONFIG_CMD_LOADS=n".

Suggested-by: Yanjie Ren <renyanjie01@gmail.com>
Signed-off-by: Ying Sun <sunying@nj.iscas.ac.cn>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agotest: Find leftovers after clean/mrproper
Tobias Deiminger [Mon, 19 Jun 2023 22:41:07 +0000 (00:41 +0200)]
test: Find leftovers after clean/mrproper

Docs describe 'make clean' to delete most generated files, 'make
mrproper' to delete current configuration and all generated files. This
test tries to assert it.

Idea is to search remaining files by patterns in copies of the initial
out-of-source build, which has two advantages:
- looking in an out-of-source build dir allows to tell generated source
  code from committed source code
- copying is fast (compared to rebuilding each time) which allows to do
  a "world clean"

Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
16 months agoKbuild: Fix cleanup of *.dtbo for sandbox
Tobias Deiminger [Mon, 19 Jun 2023 22:41:06 +0000 (00:41 +0200)]
Kbuild: Fix cleanup of *.dtbo for sandbox

sandbox can generate DT overlays, but they were not cleaned.

Extend the explicit clean-files list accordingly.

Fixes: 95300f203f32 ("pytest: add sandbox test for "extension" command")
Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
16 months agoKbuild: Fix cleanup of *.dtb for some archs
Tobias Deiminger [Mon, 19 Jun 2023 22:41:05 +0000 (00:41 +0200)]
Kbuild: Fix cleanup of *.dtb for some archs

'make clean' did not descend into arch/$ARCH/dts for arc, m68k, nios2,
sh, xtensa.

Fix it by adding the missing archs to the explicit clean-dirs list.

Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
16 months agoKbuild: Fix cleanup of VPL
Tobias Deiminger [Mon, 19 Jun 2023 22:41:04 +0000 (00:41 +0200)]
Kbuild: Fix cleanup of VPL

VPL artifacts like example vpl/u-boot-vpl are currently not removed by
'make clean'.

We can clean them just as it's already done for SPL and TPL.

Fixes: f86ca5ad8f78 ("Introduce Verifying Program Loader (VPL)")
Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
16 months agoAdjust gitignore for tools/generated/
Tobias Deiminger [Mon, 19 Jun 2023 22:41:03 +0000 (00:41 +0200)]
Adjust gitignore for tools/generated/

Tell git that auto-generated C sources are now exclusively expected
under tools/generated/.

Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
16 months agoKbuild: Fix cleanup of generated sources in tools
Tobias Deiminger [Mon, 19 Jun 2023 22:41:02 +0000 (00:41 +0200)]
Kbuild: Fix cleanup of generated sources in tools

On 'make clean', generated C files in tools/env/ and tools/boot/ are
currently not removed, but they should.

Auto-generation for shared sources was first introduced with
ad80c4a3220b ("kbuild, tools: generate wrapper C sources automatically
by Makefile"). Cleanup later regressed (see Fixes:), because shared
files were moved out of lib/ and common/, but 'clean-dirs := lib common'
was not adjusted accordingly. Further, the generated
tools/env/embedded.c became a sibling to project files, which prevents
directory-wise cleanup at all.

To solve it, we establishe tools/generated/ as the sole place for
generated sources. Wrappers are now generated as
tools/generated/<orig_dirname>/<orig_filename>, and 'make clean' can
remove tools/generated/ as a whole (Linux Makefile.asm-generic headers
are cleaned similarly). This way we don't have to maintain separate
clean-files or clean-dirs entries for each single added or moved wrapper
file.

Fixes: 0649cd0d4908 ("Move environment files from common/ to env/")
Fixes: 19a91f2464a8 ("Create a new boot/ directory")
Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
[trini: Correct mkfwupdate case]
Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoMAINTAINERS: correct at91 tree link
Eugen Hristev [Fri, 7 Jul 2023 13:45:32 +0000 (16:45 +0300)]
MAINTAINERS: correct at91 tree link

This was not done when the tree name was changed, fix it now.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
16 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-usb into...
Tom Rini [Thu, 6 Jul 2023 17:23:36 +0000 (13:23 -0400)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-usb into next

16 months agoMerge branch 'riscv-for-next' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Thu, 6 Jul 2023 17:21:37 +0000 (13:21 -0400)]
Merge branch 'riscv-for-next' of https://source.denx.de/u-boot/custodians/u-boot-riscv into next

- RISC-V CI OpenSBI version update
- Andes ae350 board modification
- Sync PolarFire SoC dts with Linux
- Support building ubifs

16 months agoboard: ae350: Add missing env variables for booti
Yu Chien Peter Lin [Tue, 4 Jul 2023 11:13:21 +0000 (19:13 +0800)]
board: ae350: Add missing env variables for booti

The 'booti' command is unable to boot Image.gz due to the absence
of required environment variables 'kernel_comp_addr_r' and
'kernel_comp_size'.

This commit adds these variables and reorganizes the memory layout
to prevent any overlap between binaries and files.

Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
16 months agoriscv: andes_plicsw: Fix IPI during OpenSBI invocation
Yu Chien Peter Lin [Tue, 4 Jul 2023 11:13:20 +0000 (19:13 +0800)]
riscv: andes_plicsw: Fix IPI during OpenSBI invocation

On some AE350 boards, we need to explicitly initialize the priority
registers to a non-zero value so the boot hart can instruct secondary
harts to jump to OpenSBI.

This patch also updates the information about PLICSW.

Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
16 months agoRISC-V: CONFIG_SPL_OPENSBI_SCRATCH_OPTIONS description
Heinrich Schuchardt [Tue, 4 Jul 2023 00:14:21 +0000 (02:14 +0200)]
RISC-V: CONFIG_SPL_OPENSBI_SCRATCH_OPTIONS description

Describe which numeric values can be used for as scratch options for
OpenSBI.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
16 months agoclk: starfive: pll: Fix to use postdiv1_mask
Hoegeun Kwon [Wed, 28 Jun 2023 10:19:49 +0000 (19:19 +0900)]
clk: starfive: pll: Fix to use postdiv1_mask

There is a problem that the rates of PLL0 and PLL1 are set incorrectly
because the postdiv1_mask value is incorrectly entered when setting
the pll clk reg. Modify postdiv1's mask value to be put correctly.

Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
16 months agoci: riscv: Update OpenSBI to v1.2
Bin Meng [Tue, 20 Jun 2023 05:55:00 +0000 (13:55 +0800)]
ci: riscv: Update OpenSBI to v1.2

Use the latest OpenSBI v1.2 release binaries for the RISC-V CI.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
16 months agoboard: microchip: set mac address for ethernet1 on icicle
Conor Dooley [Thu, 15 Jun 2023 10:12:44 +0000 (11:12 +0100)]
board: microchip: set mac address for ethernet1 on icicle

The dts sync from Linux leaves mac0/ethernet1 enabled on icicle, but
U-Boot does not currently set a mac address for it. Expand on the code
which currently sets the mac for mac1/ethernet0 to optionally set the
mac address for the second ethernet.

Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
Tested-by: Padmarao Begari <padmarao.begari@microchip.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
16 months agoriscv: dts: sync mpfs-icicle devicetree with linux
Conor Dooley [Thu, 15 Jun 2023 10:12:43 +0000 (11:12 +0100)]
riscv: dts: sync mpfs-icicle devicetree with linux

The "notable" disappearances are:
- the pac193x stanza - there's nothing in mainline linux w.r.t. bindings
  for this & what is going to appear in mainline linux is going to be
  incompatible with what is currently in U-Boot.
- operating points - these operating points should not be set at the
  soc.dtsi level as they may not be possible depending on the design
  programmed to the FPGA
- clock output names - there are defines for the clock indices, these
  should not be needed
- the dt maintainers in linux NAKed using defines for IRQ numbers
- the qspi nand, which is not part of the icicle's default configuration
  is removed.

Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
Tested-by: Padmarao Begari <padmarao.begari@microchip.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Rick Chen <rick@andestech.com>
16 months agoriscv: dts: drop microchip from dts filenames
Conor Dooley [Thu, 15 Jun 2023 10:12:42 +0000 (11:12 +0100)]
riscv: dts: drop microchip from dts filenames

The original names picked for the DT doesn't match Linux's naming scheme
and it was renamed there a while ago. Rename it in U-Boot to allow
easily syncing dts between the two projects.

Reviewed-by: Rick Chen <rick@andestech.com>
Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
16 months agoclk: sifive: only build sifive-prci.o for CONFIG_CLK_SIFIVE_PRCI
Ben Dooks [Tue, 9 May 2023 13:50:05 +0000 (14:50 +0100)]
clk: sifive: only build sifive-prci.o for CONFIG_CLK_SIFIVE_PRCI

If we're building non FU540/FU740 SoC drivers, then the sifive-prci.o
is not needed. Only build this when CONFIG_CLK_SIFIVE_PRCI is selected.

Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
16 months agoriscv: define test_and_{set,clear}_bit in asm/bitops.h
Ben Dooks [Fri, 5 May 2023 08:02:07 +0000 (09:02 +0100)]
riscv: define test_and_{set,clear}_bit in asm/bitops.h

These seem to be missing, and trying to build ubifs without them
is causing errors due to these being missing.

Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
16 months agoriscv: implement local_irq_{save,restore} macros
Ben Dooks [Fri, 5 May 2023 08:02:06 +0000 (09:02 +0100)]
riscv: implement local_irq_{save,restore} macros

Add implementations of the local_irq_{save,restore} macros so that
<asm/atomic.h> can be used with riscv.

Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
16 months agoriscv: add generic link for <asm/atomic.h>
Ben Dooks [Fri, 5 May 2023 08:02:05 +0000 (09:02 +0100)]
riscv: add generic link for <asm/atomic.h>

Add a link from <asm/atomic.h> to the generic one to allow
things like ubifs to be built. This can be extended with
riscv AMO ops at a later date.

Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
16 months agocmd/sbi: display new extensions
Heinrich Schuchardt [Wed, 12 Apr 2023 08:38:16 +0000 (10:38 +0200)]
cmd/sbi: display new extensions

OpenSBI already implements some extensions that are not ratified yet:

* Debug Console Extension (DBCN)
* System Suspend Extension (SUSP)
* Collaborative Processor Performance Control Extension (CPPC)

Allow the sbi command to display these.

Provide the FID definitions of the Debug Console Extension. We can use that
extension for an early debug console driver.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
16 months agoLFU-544: Kconfig.nxp: Fixed secure boot on LS-CH2 platforms
Kshitiz Varshney [Thu, 22 Jun 2023 09:24:45 +0000 (11:24 +0200)]
LFU-544: Kconfig.nxp: Fixed secure boot on LS-CH2 platforms

pimg64 image pointer is dependent on ESBC_ADDR_64BIT config, which is
getting disabled, due to dependency on ESBC_HDR_LS.
ESBC_HDR_LS is required for LS-CH3 platforms.
So, removing the dependency on ESBC_HDR_LS.

Signed-off-by: Kshitiz Varshney <kshitiz.varshney@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
16 months agoconfigs: ls1046afrwy: enable DM_SERIAL
Camelia Groza [Fri, 16 Jun 2023 13:18:38 +0000 (16:18 +0300)]
configs: ls1046afrwy: enable DM_SERIAL

As the serial devices are configured in the device tree, enable
DM_SERIAL in the ls1046afrwy defconfigs.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
16 months agoconfigs: ls1046ardb: enable DM_SERIAL
Camelia Groza [Fri, 16 Jun 2023 13:18:37 +0000 (16:18 +0300)]
configs: ls1046ardb: enable DM_SERIAL

As the serial devices are configured in the device tree, enable
DM_SERIAL in the ls1046ardb defconfigs.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
16 months agoarch: arm: dts: ls1046a: tag serial nodes with bootph-all
Camelia Groza [Fri, 16 Jun 2023 13:18:36 +0000 (16:18 +0300)]
arch: arm: dts: ls1046a: tag serial nodes with bootph-all

Make sure the serial driver is initialized before relocation by tagging
the serial nodes with "bootph-all".

In order to keep the serial nodes in sync with their representation in
the Linux dts, add these u-boot specific properties to *-u-boot.dtsi
files.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
16 months agoarch: arm: dts: ls1046a: sync serial nodes with Linux
Camelia Groza [Fri, 16 Jun 2023 13:18:35 +0000 (16:18 +0300)]
arch: arm: dts: ls1046a: sync serial nodes with Linux

Pick up the serial node descriptions from Linux v6.3 for the ls1046ardb
and ls1046afrwy boards and their dependencies. Including the
fsl,qoriq-clockgen.h and arm-gic.h headers forces us to change the include
directives to explicitly go through the C preprocessor for all boards in
the ls1046a SoC family.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
16 months agoconfigs: ls1043ardb: enable DM_SERIAL
Camelia Groza [Fri, 16 Jun 2023 13:18:34 +0000 (16:18 +0300)]
configs: ls1043ardb: enable DM_SERIAL

As the serial devices are configured in the device tree, enable
DM_SERIAL in the ls1043ardb defconfigs.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
16 months agoarch: arm: dts: ls1043a: tag serial nodes with bootph-all
Camelia Groza [Fri, 16 Jun 2023 13:18:33 +0000 (16:18 +0300)]
arch: arm: dts: ls1043a: tag serial nodes with bootph-all

Make sure the serial driver is initialized before relocation by tagging
the serial nodes with "bootph-all".

In order to keep the serial nodes in sync with their representation in
the Linux dts, add these u-boot specific properties to *-u-boot.dtsi
files.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>