]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
14 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Mon, 16 Oct 2023 16:15:37 +0000 (12:15 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- dns325: Enable 2nd harddrive (Peter & Stefan)
- marvell: cn9310-crb: Misc fixes to SPI / pincntrl in DTS (Chris)
- kirkwood: Add support for ZyXEL NSA325 board (Tony)
- sata_mv: Add bootstd hook to enable sata_bootdev (Tony)
- x240/AC5/AC5X: Disable SMBIOS (Chris)
- Revert "arm: mvebu: x240: Use i2c-gpio instead of built in controller"
  (Chris)
- DS116/N2350: Enable bootstd (Tony)
- clearfog: Support multiple DDR sizes (Josua)

14 months agoMerge branch '2023-10-16-assorted-cmd-updates'
Tom Rini [Mon, 16 Oct 2023 14:25:11 +0000 (10:25 -0400)]
Merge branch '2023-10-16-assorted-cmd-updates'

- Update the mac command a bit, to be more widely useful and add a
  helper macro to declare CONFIG_SYS_LONGHELP text

14 months agocmd/ti: Update Kconfig logic and Makefile recursion logic
Tom Rini [Sat, 7 Oct 2023 19:36:58 +0000 (15:36 -0400)]
cmd/ti: Update Kconfig logic and Makefile recursion logic

- Add some dependencies to CMD_DDR3 as this is only valid on some
  platforms (which tend to select it as well).
- The proper gate for going in to cmd/ti is not
  CONFIG_TI_COMMON_CMD_OPTIONS as nothing under there is controlled by
  that symbol but the general TI architecture options.

Signed-off-by: Tom Rini <trini@konsulko.com>
14 months agocmd: Convert existing long help messages to the new macro
Tom Rini [Sat, 7 Oct 2023 19:13:08 +0000 (15:13 -0400)]
cmd: Convert existing long help messages to the new macro

- Generally we just drop the #ifdef CONFIG_SYS_LONGHELP and endif lines
  and use U_BOOT_LONGHELP to declare the same variable name as before
- In a few places, either rename the variable to follow convention or
  introduce the variable as it was being done inline before.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agocommand.h: Add a U_BOOT_LONGHELP macro
Tom Rini [Sat, 7 Oct 2023 19:13:07 +0000 (15:13 -0400)]
command.h: Add a U_BOOT_LONGHELP macro

In order to be able to discard unused long help texts without further
linker lists, add a macro for defining the long help messages which uses
__maybe_unused.  This allows us to discard them as unreferenced as part
of the link.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agoeeprom: starfive: add 'mac raw' command
Heinrich Schuchardt [Sat, 30 Sep 2023 12:01:47 +0000 (14:01 +0200)]
eeprom: starfive: add 'mac raw' command

Add a sub-command to print a hexdump of the EEPROM content.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
14 months agoeeprom: starfive: raw dump if unsupported data version
Heinrich Schuchardt [Sat, 30 Sep 2023 12:01:46 +0000 (14:01 +0200)]
eeprom: starfive: raw dump if unsupported data version

If the data version field of the EEPROM is not supported, provide a hexdump
of the data.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
14 months agoeeprom: starfive: re-implement mac command
Heinrich Schuchardt [Sat, 30 Sep 2023 12:01:45 +0000 (14:01 +0200)]
eeprom: starfive: re-implement mac command

The different implementations of the mac command have board or vendor
specific sub-commands.

Add the command definition specific to the VisionFive 2 board.

Don't call cmd_usage() directly but return CMD_RET_USAGE instead.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
14 months agoeeprom: SiFive Unmatched: re-implement mac command
Heinrich Schuchardt [Sat, 30 Sep 2023 12:01:44 +0000 (14:01 +0200)]
eeprom: SiFive Unmatched: re-implement mac command

The different implementations of the mac command have board or vendor
specific sub-commands.

Add the command definition specific to the SiFive HiFive Unmatched board.

Don't call cmd_usage() directly but return CMD_RET_USAGE instead.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
14 months agofreescale: fix long help handling in mac command
Heinrich Schuchardt [Sat, 30 Sep 2023 12:01:43 +0000 (14:01 +0200)]
freescale: fix long help handling in mac command

CONFIG_SYS_LONGHELP=n we want to reduce the size of the U-Boot binary.
The long text should be reduced to and empty string in this case.

There is not need to call cmd_usage() directly. It is sufficient to
return CMD_RET_USAGE.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
14 months agocmd: move mac command
Heinrich Schuchardt [Sat, 30 Sep 2023 12:01:42 +0000 (14:01 +0200)]
cmd: move mac command

Board specific implementations of the 'mac' command differ concerning the
supported sub-commands.

Move the Freescale specific mac command definition to the board code.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
14 months agoMerge tag 'u-boot-amlogic-20231015' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Mon, 16 Oct 2023 13:09:54 +0000 (09:09 -0400)]
Merge tag 'u-boot-amlogic-20231015' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- add Amlogic A1 clock driver
- add Amlogic A1 reset support
- add USB Device support for Amlogic A1
- enable RNG on Amlogic A1 & Amlogic S4
- move Amlogic Secure Monitor to standalone driver

14 months agoarm: mvebu: AC5/AC5X: Disable SMBIOS
Chris Packham [Fri, 13 Oct 2023 03:00:11 +0000 (16:00 +1300)]
arm: mvebu: AC5/AC5X: Disable SMBIOS

The RD-AC5X doesn't make use of EFI or SMBIOS. Recently we started seeing
boot failures such as

    WARNING: SMBIOS table_address overflow 27f60f020
    Failed to write SMBIOS table
    initcall failed at event 10/(unknown) (err=-22)
    ### ERROR ### Please RESET the board ###

The error is because the physical address of the RAM on the AC5X SoC is
above the 32GiB boundary. As we don't need SMBIOS or EFI this can be
safely disabled.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
14 months agoarm: mvebu: clearfog: support 512MB memory size from tlv eeprom
Josua Mayer [Sun, 8 Oct 2023 14:58:04 +0000 (16:58 +0200)]
arm: mvebu: clearfog: support 512MB memory size from tlv eeprom

Handle 2GBit memory size value "2" from tlv eeprom on ddr
initialisation, to support SoMs with 512MB ddr memory.

Signed-off-by: Josua Mayer <josua@solid-run.com>
Reviewed-by: Stefan Roese <sr@denx.de>
14 months agoarm: mvebu: clearfog: read number of ddr channels from tlv data
Josua Mayer [Sun, 8 Oct 2023 14:58:03 +0000 (16:58 +0200)]
arm: mvebu: clearfog: read number of ddr channels from tlv data

Extend the existing tlv vendor extension used for ram size by one byte to
also store the number of ddr channels.
The length of the tlv entry can indicate whether the new information is
present. If not default to single channel.

Signed-off-by: Josua Mayer <josua@solid-run.com>
Reviewed-by: Stefan Roese <sr@denx.de>
14 months agoarm: mvebu: Enable bootstd for Thecus N2350 board
Tony Dinh [Sat, 7 Oct 2023 22:08:13 +0000 (15:08 -0700)]
arm: mvebu: Enable bootstd for Thecus N2350 board

Enable bootstd for Thecus N2350 board, and remove distroboot.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
14 months agoarm: mvebu: Enable bootstd for Synology DS116 board
Tony Dinh [Sat, 7 Oct 2023 21:35:47 +0000 (14:35 -0700)]
arm: mvebu: Enable bootstd for Synology DS116 board

Enable bootstd for Synology DS116 board, and remove distroboot.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
14 months agoRevert "arm: mvebu: x240: Use i2c-gpio instead of built in controller"
Chris Packham [Tue, 3 Oct 2023 03:57:39 +0000 (16:57 +1300)]
Revert "arm: mvebu: x240: Use i2c-gpio instead of built in controller"

This reverts commit 5c1c6b7306f2b4c0fd50c7cb5d757e245b93606e. The reason
for switching to i2c-gpio was due to an issue we were seeing in the
Linux kernel where the CPU would lock up on certain adverse I2C bus
conditions. We were never able to reproduce the lockup in U-Boot but
assumed that was probably just luck.

Since then we have discovered that the lock up was due to the I2C
transaction offload engine in the I2C controller not coping with the
adverse bus conditions (basically it thinks there's another master and
waits for a STOP condition that never comes). U-Boot doesn't use the I2C
offload feature so is not susceptible to the lockup.

We can therefore safely return to using the built-in I2C controller.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
14 months agoarm: mvebu: x240: Disable SMBIOS
Chris Packham [Tue, 3 Oct 2023 03:57:38 +0000 (16:57 +1300)]
arm: mvebu: x240: Disable SMBIOS

The x240 doesn't make use of EFI or SMBIOS. Recently we started seeing
boot failures such as

    WARNING: SMBIOS table_address overflow 23f60c020
    Failed to write SMBIOS table
    initcall failed at event 10/(unknown) (err=-22)
    ### ERROR ### Please RESET the board ###

The error is because the physical address of the RAM on the AC5X SoC is
above the 32GiB boundary. As we don't need SMBIOS or EFI this can be
safely disabled.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
14 months agoarm: mvebu: sata_mv: Add bootstd hook to enable sata_bootdev
Tony Dinh [Wed, 6 Sep 2023 05:22:41 +0000 (22:22 -0700)]
arm: mvebu: sata_mv: Add bootstd hook to enable sata_bootdev

Add hook in sata_mv probe to enable bootstd bootdev.

Note: bootdev_setup_for_sibling_blk() invocation is a noop if bootsd is
not enabled for ahci sata yet.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
14 months agoarm: kirkwood: Add support for ZyXEL NSA325 board
Tony Dinh [Sat, 26 Aug 2023 03:33:29 +0000 (20:33 -0700)]
arm: kirkwood: Add support for ZyXEL NSA325 board

ZyXEL NSA325 specifications:

Marvell Kirkwood 88F6282 SoC
1.6 GHz CPU
1x GBE LAN port (Marvell MV88E1318)
512 MB RAM
128 MB Eon NAND, SLC
I2C
1x USB 3.0 (on PCIe bus)
2x USB 2.0
2x SATA (hot swap slots)
Serial console

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
14 months agoARM64: dts: marvell: cn9310-crb: Remove duplicate pinctrl
Chris Packham [Sun, 20 Aug 2023 23:31:05 +0000 (11:31 +1200)]
ARM64: dts: marvell: cn9310-crb: Remove duplicate pinctrl

The cn9130.dtsi defines a pinctrl node for SPI1 (until recently it was
mislabeled as spi0). Use this instead of having a duplicate definition
with a different label.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
14 months agoARM64: dts: marvell: cn9310: Use appropriate label for spi1 pins
Chris Packham [Sun, 20 Aug 2023 23:31:04 +0000 (11:31 +1200)]
ARM64: dts: marvell: cn9310: Use appropriate label for spi1 pins

The CN9130-DB uses the SPI1 interface but had the pinctrl node labelled
as "cp0_spi0_pins". Use the label "cp0_spi1_pins" and update the node
name to "cp0-spi-pins-1" to avoid confusion with the pinctrl options for
SPI0.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
14 months agokirkwood: dns325: Enable 2nd harddrive
Stefan Roese [Fri, 11 Aug 2023 08:02:04 +0000 (10:02 +0200)]
kirkwood: dns325: Enable 2nd harddrive

The 2nd HD is not enabled in U-Boot on the D-Link DNS325. This patch
sets the responsible GPIO to high, enabling the drive.

Suggested-by: Peter Granilla
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Tony Dinh <mibodhi@gmail.com>
14 months agoarch: meson: use secure monitor driver
Alexey Romanov [Thu, 21 Sep 2023 08:13:41 +0000 (11:13 +0300)]
arch: meson: use secure monitor driver

Now we have to use UCLASS_SM driver instead of
raw smc_call() function call.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20230921081346.22157-9-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
14 months agoarch: meson: sm: set correct order of the includes
Alexey Romanov [Thu, 21 Sep 2023 08:13:40 +0000 (11:13 +0300)]
arch: meson: sm: set correct order of the includes

The common.h header should always be first, followed
by other headers in order, then headers with directories,
then local files.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20230921081346.22157-8-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
14 months agodrivers: introduce Meson Secure Monitor driver
Alexey Romanov [Thu, 21 Sep 2023 08:13:39 +0000 (11:13 +0300)]
drivers: introduce Meson Secure Monitor driver

This patch adds an implementation of the Meson Secure Monitor
driver based on UCLASS_SM.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20230921081346.22157-7-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
14 months agosandbox: defconfig: enable CONFIG_SM option
Alexey Romanov [Thu, 21 Sep 2023 08:13:38 +0000 (11:13 +0300)]
sandbox: defconfig: enable CONFIG_SM option

We use this option to test UCLASS_SM.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20230921081346.22157-6-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
14 months agosandbox: add tests for UCLASS_SM
Alexey Romanov [Thu, 21 Sep 2023 08:13:37 +0000 (11:13 +0300)]
sandbox: add tests for UCLASS_SM

This patchs adds simple tests for Secure Monitor uclass.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20230921081346.22157-5-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
14 months agosandbox: dts: add meson secure monitor node
Alexey Romanov [Thu, 21 Sep 2023 08:13:36 +0000 (11:13 +0300)]
sandbox: dts: add meson secure monitor node

We need this to test UCLASS_SM.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20230921081346.22157-4-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
14 months agosandbox: add sandbox sm uclass driver
Alexey Romanov [Thu, 21 Sep 2023 08:13:35 +0000 (11:13 +0300)]
sandbox: add sandbox sm uclass driver

This patch adds sandbox secure monitor driver.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20230921081346.22157-3-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
14 months agodrivers: introduce Secure Monitor uclass
Alexey Romanov [Thu, 21 Sep 2023 08:13:34 +0000 (11:13 +0300)]
drivers: introduce Secure Monitor uclass

At the moment, we don't have a common API for working with
SM, only the smc_call() function. This approach is not generic
and difficult to configure and maintain.

This patch adds UCLASS_SM with the generic API:

- sm_call()
- sm_call_write()
- sm_call_read()

These functions operate with struct pt_regs, which describes
Secure Monitor arguments.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20230921081346.22157-2-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
14 months agoMerge tag 'dm-pull-13oct23' of https://source.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Sat, 14 Oct 2023 14:50:20 +0000 (10:50 -0400)]
Merge tag 'dm-pull-13oct23' of https://source.denx.de/u-boot/custodians/u-boot-dm

improvements with dev_read_addr_..._ptr()
scan all entries in multi-device boot_targets
EFI empty-capsule support

14 months agoMerge branch '2023-10-13-firmware-scmi-updates'
Tom Rini [Sat, 14 Oct 2023 14:47:52 +0000 (10:47 -0400)]
Merge branch '2023-10-13-firmware-scmi-updates'

- Fix a memset call in the optee_agent code.

Then to quote the author for the rest of the changes:
This patch series allows users to access SCMI base protocol provided by
SCMI server (platform). See SCMI specification document v3.2 beta[1]
for more details about SCMI base protocol.

What is currently not implemented is
- SCMI_BASE_NOTIFY_ERRORS command and notification callback mechanism

This feature won't be very useful in the current U-Boot environment.

[1] https://developer.arm.com/documentation/den0056/e/?lang=en

14 months agofirmware: scmi: Fix clearing variable
Francois Berder [Tue, 10 Oct 2023 17:44:32 +0000 (19:44 +0200)]
firmware: scmi: Fix clearing variable

The sess variable in open_channel was not entirely
cleared to zero at the start of this function.

This commit ensures that the entire struct is cleared.

Signed-off-by: Francois Berder <fberder@outlook.fr>
14 months agofirmware: scmi: add a check against availability of protocols
AKASHI Takahiro [Wed, 11 Oct 2023 10:07:07 +0000 (19:07 +0900)]
firmware: scmi: add a check against availability of protocols

Now that we have Base protocol support, we will be able to check if a given
protocol is really supported by the SCMI server (firmware).

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agotest: dm: add SCMI base protocol test
AKASHI Takahiro [Wed, 11 Oct 2023 10:07:06 +0000 (19:07 +0900)]
test: dm: add SCMI base protocol test

Added is a new unit test for SCMI base protocol, which will exercise all
the commands provided by the protocol, except SCMI_BASE_NOTIFY_ERRORS.
  $ ut dm scmi_base
It is assumed that test.dtb is used as sandbox's device tree.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agosandbox: remove SCMI base node definition from test.dts
AKASHI Takahiro [Wed, 11 Oct 2023 10:07:05 +0000 (19:07 +0900)]
sandbox: remove SCMI base node definition from test.dts

SCMI base protocol is mandatory and doesn't need to be listed in a device
tree.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
14 months agofirmware: scmi: install base protocol to SCMI agent
AKASHI Takahiro [Wed, 11 Oct 2023 10:07:04 +0000 (19:07 +0900)]
firmware: scmi: install base protocol to SCMI agent

SCMI base protocol is mandatory, and once SCMI node is found in a device
tree, the protocol handle (udevice) is unconditionally installed to
the agent. Then basic information will be retrieved from SCMI server via
the protocol and saved into the agent instance's local storage.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
14 months agotest: dm: simplify SCMI unit test on sandbox
AKASHI Takahiro [Wed, 11 Oct 2023 10:07:03 +0000 (19:07 +0900)]
test: dm: simplify SCMI unit test on sandbox

Adding SCMI base protocol makes it inconvenient to hold the agent instance
(udevice) locally since the agent device will be re-created per each test.
Just remove it and simplify the test flows.
The test scenario is not changed at all.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
14 months agofirmware: scmi: fake base protocol commands on sandbox
AKASHI Takahiro [Wed, 11 Oct 2023 10:07:02 +0000 (19:07 +0900)]
firmware: scmi: fake base protocol commands on sandbox

This is a simple implementation of SCMI base protocol for sandbox.
The main use is in SCMI unit test.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
14 months agofirmware: scmi: add a version check against base protocol
AKASHI Takahiro [Wed, 11 Oct 2023 10:07:01 +0000 (19:07 +0900)]
firmware: scmi: add a version check against base protocol

In SCMI base protocol version 2 (0x20000), new interfaces,
BASE_SET_DEVICE_PERMISSIONS/BASE_SET_PROTOCOL_PERMISSIONS/
BASE_RESET_AGENT_CONFIGURATION, were added. Moreover, the api of
BASE_DISCOVER_AGENT was changed to support self-agent discovery.

So the driver expects SCMI firmware support version 2 of base protocol.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
14 months agofirmware: scmi: implement SCMI base protocol
AKASHI Takahiro [Wed, 11 Oct 2023 10:07:00 +0000 (19:07 +0900)]
firmware: scmi: implement SCMI base protocol

SCMI base protocol is mandatory according to the SCMI specification.

With this patch, SCMI base protocol can be accessed via SCMI transport
layers. All the commands, except SCMI_BASE_NOTIFY_ERRORS, are supported.
This is because U-Boot doesn't support interrupts and the current transport
layers are not able to handle asynchronous messages properly.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
14 months agotest: dm: add protocol-specific channel test
AKASHI Takahiro [Wed, 11 Oct 2023 10:06:59 +0000 (19:06 +0900)]
test: dm: add protocol-specific channel test

Any SCMI protocol may have its own channel.
Test this feature on sandbox as the necessary framework was added
in a prior commit.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
14 months agofirmware: scmi: framework for installing additional protocols
AKASHI Takahiro [Wed, 11 Oct 2023 10:06:58 +0000 (19:06 +0900)]
firmware: scmi: framework for installing additional protocols

This framework allows SCMI protocols to be installed and bound to the agent
so that the agent can manage and utilize them later.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
14 months agofirmware: scmi: move scmi_bind_protocols() backward
AKASHI Takahiro [Wed, 11 Oct 2023 10:06:57 +0000 (19:06 +0900)]
firmware: scmi: move scmi_bind_protocols() backward

Move the location of scmi_bind_protocols() backward for changes
in later patches.
There is no change in functionality.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
14 months agofirmware: scmi: support dummy channels for sandbox agent
AKASHI Takahiro [Wed, 11 Oct 2023 10:06:56 +0000 (19:06 +0900)]
firmware: scmi: support dummy channels for sandbox agent

In sandbox scmi agent, channels are not used at all. But in this patch,
dummy channels are supported in order to test protocol-specific channels.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
14 months agofirmware: scmi: use a protocol's own channel if assigned
AKASHI Takahiro [Wed, 11 Oct 2023 10:06:55 +0000 (19:06 +0900)]
firmware: scmi: use a protocol's own channel if assigned

SCMI specification allows any protocol to have its own channel for
the transport. While the current SCMI driver may assign its channel
from a device tree, the core function, devm_scmi_process_msg(), doesn't
use a protocol's channel, but always use an agent's channel.

With this commit, devm_scmi_process_msg() tries to find and use
a protocol's channel. If it doesn't exist, use an agent's.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agoscmi: refactor the code to hide a channel from devices
AKASHI Takahiro [Wed, 11 Oct 2023 10:06:54 +0000 (19:06 +0900)]
scmi: refactor the code to hide a channel from devices

The commit 85dc58289238 ("firmware: scmi: prepare uclass to pass channel
reference") added an explicit parameter, channel, but it seems to make
the code complex.

Hiding this parameter will allow for adding a generic (protocol-agnostic)
helper function, i.e. for PROTOCOL_VERSION, in a later patch.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
14 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Fri, 13 Oct 2023 20:14:34 +0000 (16:14 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

- atmel gadget controller fix

14 months agobinman: capsule: Add support for generating EFI empty capsules
Sughosh Ganu [Tue, 10 Oct 2023 09:10:59 +0000 (14:40 +0530)]
binman: capsule: Add support for generating EFI empty capsules

Add support in binman for generating EFI empty capsules. These
capsules are used in the FWU A/B update feature. Also add test cases
in binman for the corresponding code coverage.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agobtool: mkeficapsule: Add support for EFI empty capsule generation
Sughosh Ganu [Tue, 10 Oct 2023 09:10:58 +0000 (14:40 +0530)]
btool: mkeficapsule: Add support for EFI empty capsule generation

Add a method to the mkeficapsule bintool to generate empty
capsules. These are capsules needed for the FWU A/B update feature.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agobinman: capsule: Use dumped capsule header contents for verification
Sughosh Ganu [Tue, 10 Oct 2023 09:10:57 +0000 (14:40 +0530)]
binman: capsule: Use dumped capsule header contents for verification

The various fields of a generated capsule are currently verified
through hard-coded offsets. Use the dump-capsule feature for dumping
the capsule header contents and use those for capsule verification.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agobinman: capsule: Remove superfluous [address, size]-cells properties
Sughosh Ganu [Tue, 10 Oct 2023 09:10:56 +0000 (14:40 +0530)]
binman: capsule: Remove superfluous [address, size]-cells properties

The #address-cells and #size-cells are not needed for running the
capsule generation binman tests. Remove the superfluous properties.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agodoc: capsule: Add documentation for the capsule dump feature
Sughosh Ganu [Tue, 10 Oct 2023 09:10:55 +0000 (14:40 +0530)]
doc: capsule: Add documentation for the capsule dump feature

Add documentation to explain the printing of the capsule headers
through the mkeficapsule tool.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agotools: mkeficapsule: Add support to print capsule headers
Sughosh Ganu [Tue, 10 Oct 2023 09:10:54 +0000 (14:40 +0530)]
tools: mkeficapsule: Add support to print capsule headers

Add support to dump the contents of capsule headers. This is useful as
a debug feature for checking the contents of the capsule headers, and
can also be used in capsule verification.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agotreewide: use dev_read_addr_*_ptr() where appropriate
Matthias Schiffer [Wed, 27 Sep 2023 13:33:34 +0000 (15:33 +0200)]
treewide: use dev_read_addr_*_ptr() where appropriate

A follow-up to commit 842fb5de424e
("drivers: use devfdt_get_addr_size_index_ptr when cast to pointer")
and commit 320a1938b6f7
("drivers: use devfdt_get_addr_index_ptr when cast to pointer").

In addition to using the *_ptr variants of these functions where the
address is cast to a pointer, this also changes devfdt_get_addr_*() to
dev_read_addr_*() in a few places. Some variable and field types are
changed from fdt_addr_t or phys_addr_t to void* where the cast was
happening later.

This patch fixes a number of compile warnings when building a 32bit
U-Boot with CONFIG_PHYS_64BIT=y. In some places, it also fixes error
handling where the return value of dev_read_addr() etc. was checked for
NULL instead of FDT_ADDR_T_NONE.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agopinctrl: single: fix compile warnings with PHYS_64BIT on 32bit
Matthias Schiffer [Wed, 27 Sep 2023 13:33:33 +0000 (15:33 +0200)]
pinctrl: single: fix compile warnings with PHYS_64BIT on 32bit

pinctrl-single uses fdt_addr_t and phys_addr_t inconsistently, but both
are wrong to be passed to readb() etc., which expect a pointer or
pointer-sized integer. Change the driver to use
dev_read_addr_size_index_ptr(), so we consistently deal with void*
(except for the sandbox case and single_get_pin_muxing()).

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Add missing mapmem.h header:
Signed-off-by: Simon Glass <sjg@chromium.org>
14 months agocore: introduce dev_read_addr_name[_size]_ptr() functions
Matthias Schiffer [Wed, 27 Sep 2023 13:33:32 +0000 (15:33 +0200)]
core: introduce dev_read_addr_name[_size]_ptr() functions

Same as dev_read_addr_name[_size](), but returns a pointer, cast
through map_sysmem().

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agocore: return FDT_ADDR_T_NONE from devfdt_get_addr_[size_]name() on errors
Matthias Schiffer [Wed, 27 Sep 2023 13:33:31 +0000 (15:33 +0200)]
core: return FDT_ADDR_T_NONE from devfdt_get_addr_[size_]name() on errors

Checking for the error cast to fdt_addr_t is rather awkward - IS_ERR()
can be used, but it's not really made to be used on fdt_addr_t, which
may not even be the same size as a native pointer.

Most places in U-Boot only check for FDT_ADDR_T_NONE; let's adjust the
error return to match the expectation.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agocore: fix doc comments of dev_read_addr*() and related functions
Matthias Schiffer [Wed, 27 Sep 2023 13:33:30 +0000 (15:33 +0200)]
core: fix doc comments of dev_read_addr*() and related functions

- The dev_read_addr_name*() family of functions has no "index" argument,
  doc comments should refer to "name"
- Specify the error return for several devfdt_get_addr*() functions

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agobinman: bintool: Change make target arg type from string to list
Lukas Funke [Wed, 4 Oct 2023 08:56:35 +0000 (10:56 +0200)]
binman: bintool: Change make target arg type from string to list

The argument type of `build_from_git` was changed from string to list
in d71e7116997f14097735f04cc7847f0a68dbc485.

This commit adapts the argument type of all bintools using this
function.

Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
14 months agosandbox: fix spl_board_init
Heinrich Schuchardt [Tue, 3 Oct 2023 00:59:46 +0000 (02:59 +0200)]
sandbox: fix spl_board_init

sandbox_spl_defconfig with CONFIG_SPL_UNIT_TEST=n fails to build.

    in function `spl_board_init':
    arch/sandbox/cpu/spl.c:134:(.text.spl_board_init+0x4a):
    undefined reference to `ut_run_list'

Add the missing configuration check.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
14 months agobootstd: Scan all bootdevs in a boot_targets entry
Simon Glass [Sat, 23 Sep 2023 20:50:15 +0000 (14:50 -0600)]
bootstd: Scan all bootdevs in a boot_targets entry

When the boot_targets environment variable is used with the distro-boot
scripts, each device is included individually. For example, if there
are three mmc devices, then we will have something like:

   boot_targets="mmc0 mmc1 mmc2"

In contrast, standard boot supports specifying just the uclass, i.e.:

   boot_targets="mmc"

The intention is that this should scan all MMC devices, but in fact it
currently only scans the first.

Update the logic to handle this case, without required BOOTSTD_FULL to
be enabled.

I believe at least three people reported this, but I found two.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Date Huang <tjjh89017@hotmail.com>
Reported-by: Vincent Stehlé <vincent.stehle@arm.com>
14 months agoMerge tag 'efi-2024-01-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Fri, 13 Oct 2023 15:08:10 +0000 (11:08 -0400)]
Merge tag 'efi-2024-01-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2024-01-rc1

Documentation:

* Bump urllib3 version
* Migrate Renesas board docs to rst
* Link an introduction video

UEFI

* Use same GUID as EDK II for auto-created boot options
* Clean up BitBlt test

14 months agoMerge tag 'xilinx-for-v2024.01-rc1-v3' of https://source.denx.de/u-boot/custodians...
Tom Rini [Fri, 13 Oct 2023 12:45:55 +0000 (08:45 -0400)]
Merge tag 'xilinx-for-v2024.01-rc1-v3' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

Xilinx changes for v2024.01-rc1 v3

clk:
- remove additional compatible strings for Versal NET

net:
- zynq_gem: Fix clock calculation for MDC for higher frequencies

pinctrl:
- core: Extend pinmux status buffere size
- zynqmp driver: Show also tristate configuration

test:
- add test case for pxe get

Xilinx:
- describe SelectMAP boot mode

Zynq:
- Fix nand description in DT

ZynqMP:
- DTS sync patches with kernel and also W=1 related fixes
- Add support for KD240, zcu670, e-a2197 with x-prc cards, SC revB/C with i2c
  description for other SC based boards
- k24 psu_init cleanup

14 months agoMerge tag 'u-boot-nand-20231013' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Fri, 13 Oct 2023 12:44:22 +0000 (08:44 -0400)]
Merge tag 'u-boot-nand-20231013' of https://source.denx.de/u-boot/custodians/u-boot-nand-flash

Pull request for u-boot-nand-20231013

The first 5 patches are from Mikhail Kshevetskiy, aligning the mtd spinand
core with kernel version 5.15.43, fixing a bug on Winbond, and adding
support for Winbond W25NO2KV.

The other 2 patches are from Patrick Delaunay and they fix a bug and mark
bad the MTD block on erase error.

14 months agousb: gadget: atmel: fix transfer of queued requests
Artur Rojek [Wed, 13 Sep 2023 15:00:58 +0000 (17:00 +0200)]
usb: gadget: atmel: fix transfer of queued requests

In the existing implementation, multiple requests queued up on an
endpoint are subject to getting evicted without transmission.

For both control and bulk endpoints, their respective logic found in
usba_control_irq()/usba_ep_irq() guarantees that TX FIFO is empty before
data is sent out, and that request_complete() gets called once the
transaction has been finished. At this point however, if any additional
requests are found on the endpoint queue, they will be processed by
submit_next_request(), which makes no checks against the above
conditions, trashing data on a busy FIFO and neglecting completion
handlers.

Fix the above issues by removing the calls to submit_next_request(),
and thus forcing the pending requests to be processed on the next pass
of the respective endpoint logic. While at it, remove a DBG message, as
that branch becomes part of regular flow.

This restores mass storage mode operation on Microchip ATSAMA5D27 SoC.

Signed-off-by: Artur Rojek <artur@conclusive.pl>
14 months agodrivers: rng: add support for Meson S4
Alexey Romanov [Thu, 12 Oct 2023 07:58:25 +0000 (10:58 +0300)]
drivers: rng: add support for Meson S4

For some Amlogic SOC's, mechanism to obtain random number
has been changed. For example, S4 now uses status bit waiting algo.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231012075828.22685-2-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
14 months agodfu: mtd: mark bad the MTD block on erase error
Patrick Delaunay [Mon, 5 Jun 2023 07:52:08 +0000 (09:52 +0200)]
dfu: mtd: mark bad the MTD block on erase error

In the MTD DFU backend, it is needed to mark the NAND block bad when the
erase failed with the -EIO error, as it is done in UBI and JFFS2 code.

This operation is not done in the MTD framework, but the bad block
tag (in BBM or in BBT) is required to avoid to write data on this block
in the next DFU_OP_WRITE loop in mtd_block_op(): the code skip the bad
blocks, tested by mtd_block_isbad().

Without this patch, when the NAND block become bad on DFU write operation
- low probability on new NAND - the DFU write operation will always failed
because the failing block is never marked bad.

This patch also adds a test to avoid to request an erase operation on a
block already marked bad; this test is not performed in MTD framework
in mtd_erase().

Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
14 months agodfu: mtd: fix the trace when limit is reached
Patrick Delaunay [Mon, 5 Jun 2023 07:52:07 +0000 (09:52 +0200)]
dfu: mtd: fix the trace when limit is reached

The offset variable = 'off' used in the error trace when limit is reach
on erase operation is incorect as 'erase_op.addr' is used in the loop.
This patch corrects the copy paste issue between the erase loop and
the write loop.

This patch also adds the 'remaining' information to allow to debug of
limit issues.

Fixes: 6015af28ee6d ("dfu: add backend for MTD device")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
14 months agomtd: spinand: winbond: add Winbond W25N02KV flash support
Mikhail Kshevetskiy [Tue, 10 Jan 2023 11:58:42 +0000 (12:58 +0100)]
mtd: spinand: winbond: add Winbond W25N02KV flash support

Add support of Winbond W25N02KV flash

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20221010105110.446674-2-mikhail.kshevetskiy@iopsys.eu
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> (U-Boot port)
Link: https://lore.kernel.org/all/20230110115843.391630-5-frieder@fris.de
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
14 months agomtd: spinand: winbond: fix flash identification
Mikhail Kshevetskiy [Tue, 10 Jan 2023 11:58:41 +0000 (12:58 +0100)]
mtd: spinand: winbond: fix flash identification

Winbond uses 3 bytes to identify flash: vendor_id, dev_id_0, dev_id_1,
but current driver uses only first 2 bytes of it for devices
identification. As result Winbond W25N02KV flash (id_bytes: EF, AA, 22)
is identified as W25N01GV (id_bytes: EF, AA, 21).

Fix this by adding missed identification bytes.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20221010105110.446674-1-mikhail.kshevetskiy@iopsys.eu
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> (U-Boot port)
Link: https://lore.kernel.org/all/20230110115843.391630-4-frieder@fris.de
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
14 months agomtd/spinand: sync supported devices with linux-5.15.43
Mikhail Kshevetskiy [Tue, 10 Jan 2023 11:58:40 +0000 (12:58 +0100)]
mtd/spinand: sync supported devices with linux-5.15.43

This adds more supported spinand devices from the Linux kernel
implementation.

This does not include the latest kernel implementation as this would
require a substantial amount of extra work due to the missing
ECC engine abstraction layer in U-Boot.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> (commit message)
Link: https://lore.kernel.org/all/20230110115843.391630-3-frieder@fris.de
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
14 months agomtd/spinand: sync core spinand code with linux-5.10.118
Mikhail Kshevetskiy [Tue, 10 Jan 2023 11:58:39 +0000 (12:58 +0100)]
mtd/spinand: sync core spinand code with linux-5.10.118

This brings us closer to the current Linux kernel implementation of
the spinand core and makes backporting features and fixes easier.

This does not include the latest kernel implementation as this would
require a substantial amount of extra work due to the missing
ECC engine abstraction layer in U-Boot.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> (add commit message)
Link: https://lore.kernel.org/all/20230110115843.391630-2-frieder@fris.de
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
14 months agomtd/spinand: rework detect procedure for different READ_ID operation
Mikhail Kshevetskiy [Tue, 10 Jan 2023 11:58:38 +0000 (12:58 +0100)]
mtd/spinand: rework detect procedure for different READ_ID operation

Currently there are 3 different variants of read_id implementation:
1. opcode only. Found in GD5FxGQ4xF.
2. opcode + 1 addr byte. Found in GD5GxGQ4xA/E
3. opcode + 1 dummy byte. Found in other currently supported chips.

Original implementation was for variant 1 and let detect function
of chips with variant 2 and 3 to ignore the first byte. This isn't
robust:

1. For chips of variant 2, if SPI master doesn't keep MOSI low
during read, chip will get a random id offset, and the entire id
buffer will shift by that offset, causing detect failure.

2. For chips of variant 1, if it happens to get a devid that equals
to manufacture id of variant 2 or 3 chips, it'll get incorrectly
detected.

This patch reworks detect procedure to address problems above. New
logic do detection for all variants separatedly, in 1-2-3 order.
Since all current detect methods do exactly the same id matching
procedure, unify them into core.c and remove detect method from
manufacture_ops.

This is a rework of Chuanhong Guo <gch981213@gmail.com> patch
submitted to linux kernel

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Link: https://lore.kernel.org/all/20230110115843.391630-1-frieder@fris.de
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
14 months agoMerge branch '2023-10-12-assorted-TI-platform-updates'
Tom Rini [Thu, 12 Oct 2023 21:02:51 +0000 (17:02 -0400)]
Merge branch '2023-10-12-assorted-TI-platform-updates'

- A few more updates for various TI platforms

14 months agoarm: mach-k3: j721s2_init: Enable memory with CONFIG_K3_J721E_DDRSS
Dominik Haller [Fri, 11 Aug 2023 10:04:44 +0000 (12:04 +0200)]
arm: mach-k3: j721s2_init: Enable memory with CONFIG_K3_J721E_DDRSS

Make that condition more generic by checking if the memory controller
driver is enabled instead of using the EVM's config.

Signed-off-by: Dominik Haller <d.haller@phytec.de>
14 months agoboard: ti: j721s2: MAINTAINERS: Update the MAINTAINERS File.
Manorit Chawdhry [Fri, 6 Oct 2023 04:46:01 +0000 (10:16 +0530)]
board: ti: j721s2: MAINTAINERS: Update the MAINTAINERS File.

Update the MAINTAINERS file and propose a new MAINTAINER for j721s2 due
to the previous MAINTAINER not being associated with TI.

Reviewed-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
14 months agodocs: board: ti: Add j721s2_evm documentation
Manorit Chawdhry [Fri, 6 Oct 2023 04:46:00 +0000 (10:16 +0530)]
docs: board: ti: Add j721s2_evm documentation

Add the documentation for J721S2-EVM and SK-AM68

TRM for J721S2/AM68: https://www.ti.com/lit/pdf/spruj28
Product Page for J721S2: https://www.ti.com/tool/J721S2XSOMXEVM
Product Page for AM68: https://www.ti.com/tool/SK-AM68

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
14 months agoarm: dts: k3-am68: Sync from Linux tag v6.6-rc1
Manorit Chawdhry [Fri, 6 Oct 2023 04:45:59 +0000 (10:15 +0530)]
arm: dts: k3-am68: Sync from Linux tag v6.6-rc1

The following commit syncs the device tree from Linux tag
v6.6-rc1 to U-boot and fixes the following to be compatible with
the future syncs -

- Include k3-am68-sk-base-board.dts file

    Remove the duplicated pinmuxes from r5 and -u-boot.dtsi files and
    include k3-am68-sk-base-board.dts for Linux fixes to propagate
    to U-boot.

- Fixing the mcu_timer0

    Remove timer0 and use the mcu_timer0 defined in mcu-wakeup.dtsi

- Fixing secure proxy nodes

    Linux DT now have these nodes defined so remove them and rename to
    use the Linux DT ones.

- Remove cpsw node

    The compatible is now fixed and the node is not required in
    -u-boot specifically

- Remove aliases and chosen node

    Use these from Linux and don't override when not required.

- Remove /delete-property/ from sdhci nodes

    We have the necessary clock and dev data so remove these.

- Remove dummy_clocks and fs_loader0

    These weren't being used anywhere so remove it.

- Remove mcu_ringacc override

All these have been put in a single commit to not break the
bisectability.

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
14 months agoarm: dts: k3-j721s2: Sync from Linux tag v6.6-rc1
Manorit Chawdhry [Fri, 6 Oct 2023 04:45:58 +0000 (10:15 +0530)]
arm: dts: k3-j721s2: Sync from Linux tag v6.6-rc1

The following commit syncs the device tree from Linux tag
v6.6-rc1 to U-boot and fixes the following to be compatible with
the future syncs -

- Include k3-j721s2-common-proc-board.dts file

    Remove the duplicated pinmuxes from r5 and -u-boot.dtsi files and
    include k3-j721s2-common-proc-board.dts for Linux fixes to propagate
    to U-boot.

- Fixing the mcu_timer0

    Remove timer0 and use the mcu_timer0 defined in mcu-wakeup.dtsi

- Fixing secure proxy nodes

    Linux DT now have these nodes defined so remove them and rename to
    use the Linux DT ones.

- Remove cpsw node

    The compatible is now fixed and the node is not required in
    -u-boot specifically

- Remove aliases and chosen node

    Use these from Linux and don't override when not required.

- Remove /delete-property/ from sdhci nodes

    We have the necessary clock and dev data so remove these.

- Remove dummy_clocks and fs_loader0

    These weren't being used anywhere so remove it.

- Remove mcu_ringacc override

All these have been put in a single commit to not break the
bisectability.

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
14 months agoarm: mach-k3: j721s2: Add mcu_timer0 id to the dev list
Manorit Chawdhry [Fri, 6 Oct 2023 04:45:57 +0000 (10:15 +0530)]
arm: mach-k3: j721s2: Add mcu_timer0 id to the dev list

mcu_timer0 is used by u-boot as the tick-timer. Add it to the soc
devices lsit so it an be enabled via the k3 power controller.

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
14 months agoRevert "arm: dts: k3-j7*: ddr: Update to 0.10 version of DDR config tool"
Manorit Chawdhry [Fri, 6 Oct 2023 04:45:56 +0000 (10:15 +0530)]
Revert "arm: dts: k3-j7*: ddr: Update to 0.10 version of DDR config tool"

The update causes instability in am68-sk boards so revert the patch in
the meantime till fix is available.

This reverts commit f1edf4bb6aa19732574ac23ca90cb9a0ba395ec1.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
14 months agoconfigs: j721s2_evm_r5_defconfig: Increase malloc pool size in DRAM
Udit Kumar [Fri, 6 Oct 2023 04:45:55 +0000 (10:15 +0530)]
configs: j721s2_evm_r5_defconfig: Increase malloc pool size in DRAM

The malloc capacity in DRAM at R5 SPL is set to 1MB which isn't
sufficient to load the new tispl.bin to
enable loading of tispl.bin the size is increased by 256KB to 1.25MB.

Cc: Nikhil M Jain <n-jain1@ti.com>
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Nikhil M Jain <n-jain1@ti.com>
14 months agoarm: dts: j7200: dts sync with Linux 6.6-rc1
Reid Tonking [Thu, 5 Oct 2023 18:12:58 +0000 (13:12 -0500)]
arm: dts: j7200: dts sync with Linux 6.6-rc1

Sync j7200 dts with Linux 6.6-rc1

- k3-j7200-r5-common-proc-board.dts now inherits from
  k3-j7200-common-proc-board.dts instead of k3-j7200-som-p0.dtsi. This
  allows us to trim down the r5 file considerably by using existing
  properties

- remove pimux nodes from r5 file

- remove duplicate nodes & node properties from r5/u-boot files

- mcu_timer0 now used instead of timer1

  mcu_timer0 device id added to dev-data.c file in order to work

- remove cpsw node

  This node is no longer required since the compatible is now fixed

- remove dummy_clock_19_2_mhz

  This node wasn't being used anyhere, so it was removed

- remove dummy_clock_200mhz

  main_sdhci0 & main_sdhci1 no longer need dummy clock for eMMC/SD

- fix secure proxy node

  mcu_secproxy changed to used secure_prxy_mcu which is already
  defined in k3-j7200-mcu-wakeup.dtsi

- removed &mcu_ringacc property override since they're present in
  v6.6-rc1

Signed-off-by: Reid Tonking <reidt@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
14 months agoarm: mach-k3: j7200: Add mcu_timer0 id to the dev list
Reid Tonking [Thu, 5 Oct 2023 18:12:57 +0000 (13:12 -0500)]
arm: mach-k3: j7200: Add mcu_timer0 id to the dev list

mcu_timer0 is now used as the tick timer in u-boot, so this adds the
timer to the soc device list so it can be enabled via the k3 power
controller.

Reviewed-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Reid Tonking <reidt@ti.com>
14 months agoboard: ti: am64x: Switch to standard boot flow
Roger Quadros [Thu, 5 Oct 2023 13:06:42 +0000 (16:06 +0300)]
board: ti: am64x: Switch to standard boot flow

Switch to using bootstd. Note with this change, we will stop using
distro_bootcmd and instead depend entirely on bootflow method of
starting the system up.

Drop header files that are no longer needed in am64x_evm.h.
k3_dfu.h is available via k3_dfu.env in am64x.env.

Drop unused macro CFG_SYS_SDRAM_BASE1.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Nishanth Menon <nm@ti.com>
14 months agoboard: ti: am62x: am62x.env: Fix boot_targets
Roger Quadros [Thu, 5 Oct 2023 13:06:41 +0000 (16:06 +0300)]
board: ti: am62x: am62x.env: Fix boot_targets

ti_mmc is not a valid boot_target for standard boot flow so
remove it. Prefer mmc1 (sd-card) over mmc0 (emmc).

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Nishanth Menon <nm@ti.com>
14 months agoclk: ti: clk-sci: Notify AVS driver based upon clock rate
Udit Kumar [Thu, 21 Sep 2023 17:03:43 +0000 (22:33 +0530)]
clk: ti: clk-sci: Notify AVS driver based upon clock rate

AVS driver needs to be notified before or after clock change,
depending upon new rate is greater or less than current clock rate.

Fixes: 1e0aa873bc7cd ("clk: clk-ti-sci: Notify AVS driver upon setting clock rate")
Cc: Keerthy <j-keerthy@ti.com>
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
14 months agoclk: ti: clk-k3: Notify AVS driver upon setting clock rate
Udit Kumar [Thu, 21 Sep 2023 17:00:38 +0000 (22:30 +0530)]
clk: ti: clk-k3: Notify AVS driver upon setting clock rate

AVS is enabled at R5 SPL stage, on few platforms like J721E
and J7200 clk-k3 is used instead if clk-sci driver.

Add support in clk-k3 driver as well to notify AVS driver
on setting clock rate so that voltage is changed accordingly.

Cc: Keerthy <j-keerthy@ti.com>
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
14 months agoMerge branch '2023-10-12-expo-add-support-for-edting-lines-of-text'
Tom Rini [Thu, 12 Oct 2023 12:15:31 +0000 (08:15 -0400)]
Merge branch '2023-10-12-expo-add-support-for-edting-lines-of-text'

To quote the author:
So far expo only supports menus. These are quite flexible for various
kinds of settings, but cannot deal with free-form input, such as a
serial number or a machine name.

This series adds support for a textline object, which is a single line
of text. It has a maximum length and its value is stored within the expo
structure.

U-Boot already has a command-line editor which provides most of the
features needed by expo. But the code runs in its own loop and only
returns when the line is finished. This is not suitable for expo, which
must handle a keypress at a time, returning to its caller after each
one.

In order to use the CLI code, some significant refactoring is included
here. This mostly involves moving the internal loop of the CLI to a
separate function and recording its state in a struct, just as was done
for single keypresses some time back. A minor addition is support for
Ctrl-W to delete a word, since strangely this is currently only present
in the simple version.

The video-console system provides most of the features needed by
testline, but a few things are missing. This series provides:

- primitive cursor support so the user can see where he is typing
- saving and restoring of the text-entry context, so that expo can allow
  the user to continue where he left off, including deleting previously
  entered characters correctly (for Truetype)
- obtaining the nominal width of a string of n characters, so that a
  suitable width can be chosen for the textline object

Note that no support is provided for clearing the cursor. This was
addressed in a previous series[1] which could perhaps be rebased. For
this implementation, the cursor is therefore not enabled for the normal
command line, only for expo.

Reading and writing textline objects is supported for FDT and
environment, but not for CMOS RAM, since it would likely use too much
RAM to store a string.

In terms of code size, the overall size increase is 180 bytes for
Thumb02 boards, 160 of whcih is the addition of Ctrl-W to delete a word.

[1] https://patchwork.ozlabs.org/project/uboot/list/?series=280178&state=*

14 months agomeson-a1: dts: add ao secure node
Alexey Romanov [Tue, 10 Oct 2023 10:06:17 +0000 (13:06 +0300)]
meson-a1: dts: add ao secure node

ao-secure node can be used to get information about the board,
so, for example, using show_board_info() we can get following
information for board with Meson A1 SoC:

SoC: Amlogic Meson A1 (A113L) Revision 2c:a (1:a)

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Link: https://lore.kernel.org/r/20231010100623.74475-3-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
14 months agomeson-a1: dts: add hw rng node
Alexey Romanov [Tue, 10 Oct 2023 10:06:16 +0000 (13:06 +0300)]
meson-a1: dts: add hw rng node

Add support for hardware random number generator
of Amlogic Meson SoCs.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Link: https://lore.kernel.org/r/20231010100623.74475-2-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
14 months agoad401: enable USB stack
Alexey Romanov [Thu, 5 Oct 2023 08:54:29 +0000 (11:54 +0300)]
ad401: enable USB stack

Currently we have all drivers for use USB stack on A1-series
SoC's. Let's enable USB options for the Amlogic AD401 reference A1
SoC board.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231005085434.74755-9-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
14 months agodwc3: add support for Amlogic A1 family
Alexey Romanov [Thu, 5 Oct 2023 08:54:28 +0000 (11:54 +0300)]
dwc3: add support for Amlogic A1 family

Now the driver supports also A1 phy layer.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231005085434.74755-8-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
14 months agoa1: clk: Add missing USB_PHY_IN and USB_PHY gates
Igor Prusov [Thu, 5 Oct 2023 08:54:27 +0000 (11:54 +0300)]
a1: clk: Add missing USB_PHY_IN and USB_PHY gates

We use this clocks in dwc3 driver.

Signed-off-by: Igor Prusov <ivprusov@salutedevices.com>
Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231005085434.74755-7-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
14 months agophy: support Amlogic A1 family
Alexey Romanov [Thu, 5 Oct 2023 08:54:26 +0000 (11:54 +0300)]
phy: support Amlogic A1 family

Setting G12A and A1 is similar, so we can use G12A phy
driver with little changes.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231005085434.74755-6-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
14 months agophy: move clk enable/disable in init/exit
Alexey Romanov [Thu, 5 Oct 2023 08:54:25 +0000 (11:54 +0300)]
phy: move clk enable/disable in init/exit

It is better to place clk_enable() in phy_meson_g12a_usb2_init()
and clk_disable() in phy_meson_g12a_usb2_exit().

For more detailed information, please see comments in the review of
a similar driver in the Linux Kernel:

https://lore.kernel.org/all/CAFBinCCEhobbyKHuKDWzTYCQWgNT1-e8=7hMhq1mvT6CuEOjGw@mail.gmail.com/

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231005085434.74755-5-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
14 months agophy: get rid of raw hex values
Alexey Romanov [Thu, 5 Oct 2023 08:54:24 +0000 (11:54 +0300)]
phy: get rid of raw hex values

It is better to use defines instead of write raw
hex values in regmap.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231005085434.74755-4-avromanov@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>