]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
12 months agobootflow: bootmeth_efi: don't free buffer
Shantur Rathore [Sun, 19 Nov 2023 16:55:01 +0000 (16:55 +0000)]
bootflow: bootmeth_efi: don't free buffer

bootmeth_efi doesn't allocate any buffer to load efi in any case.
enable static buffer flag for all cases.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Shantur Rathore <i@shantur.com>
12 months agobootflow: bootmeth_efi: Handle fdt not available.
Shantur Rathore [Sun, 19 Nov 2023 16:55:00 +0000 (16:55 +0000)]
bootflow: bootmeth_efi: Handle fdt not available.

While booting with efi, if fdt isn't available externally,
just use the built-in one.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Shantur Rathore <i@shantur.com>
12 months agobootflow: bootmeth_efi: set bflow->fname from bootfile name
Shantur Rathore [Sun, 19 Nov 2023 16:54:59 +0000 (16:54 +0000)]
bootflow: bootmeth_efi: set bflow->fname from bootfile name

We need to set boot->fname before calling efi_set_bootdev
otherwise this crashes as bflow->fname is null.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Shantur Rathore <i@shantur.com>
12 months agobootflow: bootmeth_efi: Set bootp_arch as hex
Shantur Rathore [Sun, 19 Nov 2023 16:54:58 +0000 (16:54 +0000)]
bootflow: bootmeth_efi: Set bootp_arch as hex

bootmeth_efi sets up bootp_arch which is read later in bootp.c
Currently bootp_arch is being set as integer string and being
read in bootp.c as hex, this sends incorrect arch value to dhcp server
which in return sends wrong file for network boot.

For ARM64 UEFI Arch value is 0xb (11), here we set environment as 11
and later is read as 0x11 and 17 is sent to dhcp server.

Setting it as hex string fixes the problem.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Shantur Rathore <i@shantur.com>
13 months agobootstd: Avoid freeing a non-allocated buffer
Simon Glass [Thu, 16 Nov 2023 01:35:23 +0000 (18:35 -0700)]
bootstd: Avoid freeing a non-allocated buffer

EFI applications can be very large and thus used to cause boot failures
when malloc() space was exhausted.

A recent changed fixed this by using the kernel_addr_r environment var
as the address of the buffer. However, it still frees the buffer when
the bootflow is discarded.

Fix this by introducing a flag to indicate whether the buffer was
allocated, or not.

Note that kernel_addr_r is not the last word here. It might be better
to use lmb to place images. But there is a lot of refactoring to do
before we can remove the environment variables. The distro scripts rely
on them so it is safe for bootstd to do so too.

Fixes: 6a8c2f9781c bootstd: Avoid allocating memory for the EFI file
Signed-off-by: Simon Glass <sjg@chromium.org>
Reported by: Simon Glass <sjg@chromium.org>
Reported by: Shantur Rathore <i@shantur.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Tested-by: Shantur Rathore <i@shantur.com>
13 months agoMerge tag 'dm-pull-15nov23' of https://source.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Wed, 15 Nov 2023 19:15:21 +0000 (14:15 -0500)]
Merge tag 'dm-pull-15nov23' of https://source.denx.de/u-boot/custodians/u-boot-dm

patman correct import of u_boot_pylib
correct long-standing EFI framebuffer bug
minor test refactor

13 months agobootstage: Correct exhasuted typo
Simon Glass [Tue, 7 Nov 2023 09:17:40 +0000 (10:17 +0100)]
bootstage: Correct exhasuted typo

Correct this typo in the warning message shown when no more bootstage
records can be added.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
13 months agosandbox: Close file after mmaping it
Sean Anderson [Sat, 4 Nov 2023 19:57:33 +0000 (15:57 -0400)]
sandbox: Close file after mmaping it

After opening pathname, we must close ifd once we are done with it.

Fixes: b9274095c2c ("sandbox: Add a way to map a file into memory")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
13 months agodm: Do not enable debug messages by default
Heinrich Schuchardt [Sat, 4 Nov 2023 18:40:43 +0000 (20:40 +0200)]
dm: Do not enable debug messages by default

CONFIG_DM_WARN has a text indicating that these messages should only
provided when debugging. This implies that the setting must be default no.

We should still create debug messages.

Reported-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
13 months agopatman: Correct Python 3.6 behaviour
Simon Glass [Sat, 4 Nov 2023 16:25:24 +0000 (10:25 -0600)]
patman: Correct Python 3.6 behaviour

The importlib_resources import is not actually used. Fix this so that
patman can run on Python 3.6 to some extent, once
'pip3 install importlib-resources' has been run.

Signed-off-by: Simon Glass <sjg@chromium.org>
13 months agopatman: Avoid using func_test at top level
Simon Glass [Sat, 4 Nov 2023 16:25:23 +0000 (10:25 -0600)]
patman: Avoid using func_test at top level

Import this only when it is needed, since it is not present when
installed via 'pip install'.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: https://source.denx.de/u-boot/u-boot/-/issues/26
13 months agopatman: Correct easy pylint warnings in __main__
Simon Glass [Sat, 4 Nov 2023 16:25:22 +0000 (10:25 -0600)]
patman: Correct easy pylint warnings in __main__

Tidy up the code a little to reduce the number of pylint warnings.

Signed-off-by: Simon Glass <sjg@chromium.org>
13 months agopatman: Move the main program into a function
Simon Glass [Sat, 4 Nov 2023 16:25:21 +0000 (10:25 -0600)]
patman: Move the main program into a function

Add a new run_patman() function to hold the main logic.

Signed-off-by: Simon Glass <sjg@chromium.org>
13 months agopatman: Split out arg parsing into its own file
Simon Glass [Sat, 4 Nov 2023 16:25:20 +0000 (10:25 -0600)]
patman: Split out arg parsing into its own file

Move this code into a separate cmdline module, as is done with the
other tools.

Use the same HAS_TESTS check as buildman

Signed-off-by: Simon Glass <sjg@chromium.org>
13 months agoexpo: Correct background colour
Simon Glass [Mon, 2 Oct 2023 01:14:41 +0000 (19:14 -0600)]
expo: Correct background colour

Use the correct background colour when using white-on-black.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
13 months agobootstd: Add a return code to bootflow menu
Simon Glass [Mon, 2 Oct 2023 01:14:38 +0000 (19:14 -0600)]
bootstd: Add a return code to bootflow menu

Return an error when the user does not select an OS, so we know whether
to boot or not.

Move calling of bootflow_menu_run() into a separate function so we can
call it from other places.

Expand the test to cover these cases.

Add some documentation also, while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
13 months agobootstd: Refactor mmc prep to allow a different scan
Simon Glass [Mon, 2 Oct 2023 01:14:37 +0000 (19:14 -0600)]
bootstd: Refactor mmc prep to allow a different scan

Adjust scan_mmc4_bootdev() and related function so that the caller can
do its own 'bootflow scan' command. This allows it to change the flags
if needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
13 months agoefi: Correct handling of frame buffer
Simon Glass [Mon, 2 Oct 2023 01:14:36 +0000 (19:14 -0600)]
efi: Correct handling of frame buffer

The efi_gop driver uses private fields from the video uclass to obtain a
pointer to the frame buffer. Use the platform data instead.

Check the VIDEO_COPY setting to determine which frame buffer to use. Once
the next stage is running (and making use of U-Boot's EFI boot services)
U-Boot does not handle copying from priv->fb to the hardware framebuffer,
so we must allow EFI to write directly to the hardware framebuffer.

We could provide a function to read this, but it seems better to just
document how it works. The original change ignored an explicit comment
in the video.h file ("Things that are private to the uclass: don't use
these in the driver") which is why this was missed when the VIDEO_COPY
feature was added.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 8f661a5b662 ("efi_loader: gop: Expose fb when 32bpp")
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
13 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Sun, 12 Nov 2023 21:36:22 +0000 (16:36 -0500)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi

To quote Andre:

The first few patches are some easy refactorings and fixes, most of them
actually don't change the generated binaries at all. Then there is a
defconfig for a new board, for which we just gained the .dts file from
the last kernel DT sync.
On top there is support for a new PMIC (AXP313), and LPDDR4 support for
the Allwinner H616 SoC, both of which are needed to support new devices
that appeared lately, especially cheap TV boxes.

While those are technically new features, they don't affect existing
boards, for instance the LPDDR4 support code is guarded by a new DRAM
type Kconfig variable. So the risk for regressions is very slim.

Gitlab CI passed, and I booted that briefly on some boards, including an
H616 and an H618 one (with LPDDR4).

13 months agosunxi: H616: add LPDDR4 DRAM support
Mikhail Kalashnikov [Sat, 11 Nov 2023 09:10:00 +0000 (12:10 +0300)]
sunxi: H616: add LPDDR4 DRAM support

The H616 SoC family has support for several types of DRAM: DDR3,
LPDDR3, DDR4 and LPDDR4.
At the moment, the driver only supports DDR3 and LPDDR3 memory.
Let's extend the driver to support the LPDDR4 memory. This type
of memory widely used in device with T507(-H) SoC and new orangepi
zero3 with H618.
The compatibility with T507 is not yet complete, because there
is difference in the phy_init array.
The LPDDR4-2133 timings correspond to DRAM Rayson RS1G32LO4D2BDS-53BT
found on the NOR SPI from the Orangepi Zero 3 4GB.

Signed-off-by: Mikhail Kalashnikov <iuncuim@gmail.com>
Tested-by: Piotr Oniszczuk <piotr.oniszczuk@gmail.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Acked-by: Andre Przywara <andre.przywara@arm.com>
13 months agosunxi: H616: DRAM: refactor mctl_phy_configure_odt()
Andre Przywara [Thu, 7 Sep 2023 19:38:46 +0000 (20:38 +0100)]
sunxi: H616: DRAM: refactor mctl_phy_configure_odt()

The original H616 DDR3 ODT configuration code wrote board specific values
into a sequence of paired registers.
For LPDDR3 support we needed to special-case one group of registers,
because for that DRAM type we need to write 0 into the lower register of
each pair. That already made the code less readable.

LPDDR4 support will make things even messier, so let's refactor that
code now: We allow to write different values into the lower and upper
half of each pair. The masking is moved into a macro, and use in each
write statement.

The effect is not as obvious yet, as we don't need the full flexibility at
the moment, but the motivation will become clearer with LPDDR4 support.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Mikhail Kalashnikov <iuncuim@gmail.com>
13 months agopower: regulator: add AXP313 support
Andre Przywara [Tue, 17 Oct 2023 13:12:44 +0000 (14:12 +0100)]
power: regulator: add AXP313 support

The X-Powers AXP313a is a small PMIC with just three buck converters and
three LDOs, one of which is actually fixed (so not modelled here).

Add the compatible string and the respective regulator ranges to allow
drivers to adjust voltages.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
13 months agopower: pmic: sunxi: add AXP313 SPL driver
Andre Przywara [Sun, 30 Jul 2023 00:11:01 +0000 (01:11 +0100)]
power: pmic: sunxi: add AXP313 SPL driver

On boards using the AXP313 PMIC, the DRAM rail is often not setup
correctly at reset time, so we have to program the PMIC very early in
the SPL, before running the DRAM initialisation.

Add a simple AXP313 PMIC driver that knows about DCDC2(CPU) and
DCDC3(DRAM), so that we can bump up the voltage before the DRAM init.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
13 months agoarm: dts: icnova-a20-adb4006: Add board support
Ludwig Kormann [Wed, 1 Nov 2023 07:28:32 +0000 (08:28 +0100)]
arm: dts: icnova-a20-adb4006: Add board support

Add board support for ICnova A20 SomPi compute module on
ICnova ADB4006 development board.

Specification:
SoM
- Processor: Allwinner A20 Cortex-A7 Dual Core at 1GHz
- 512MB DDR3 RAM
- Fast Ethernet (Phy: Realtek RTL8201CP)
ADB4006
- I2C
- 2x USB 2.0
- 1x Fast Ethernet port
- 1x SATA
- 2x buttons (PWRON, Boot)
- 2x LEDS
- serial console
- HDMI
- µSD-Card slot
- Audio Line-In / Line-Out
- GPIO pinheaders

https://wiki.in-circuit.de/index.php5?title=ICnova_ADB4006
https://wiki.in-circuit.de/index.php5?title=ICnova_A20_SODIMM

devicetree upstreamed with linux 6.5

Signed-off-by: Ludwig Kormann <ludwig.kormann@ict42.de>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
13 months agopinctrl: sunxi: Avoid using .bss for SPL
Samuel Holland [Tue, 31 Oct 2023 04:57:40 +0000 (23:57 -0500)]
pinctrl: sunxi: Avoid using .bss for SPL

sunxi platforms put .bss in DRAM, so .bss is not available in SPL before
DRAM controller initialization. Therefore, this buffer must be placed in
the .data section.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
13 months agosunxi: mmc: Sort compatible strings numerically
Samuel Holland [Tue, 31 Oct 2023 05:22:34 +0000 (00:22 -0500)]
sunxi: mmc: Sort compatible strings numerically

commit 95168d77d391 ("sunxi: add Allwinner R528/T113 SoC support") added
the new entry out of order.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
13 months agoclk: sunxi: Use the right symbol in the Makefile
Samuel Holland [Tue, 31 Oct 2023 04:49:22 +0000 (23:49 -0500)]
clk: sunxi: Use the right symbol in the Makefile

CONFIG_ARCH_SUNXI will not be enabled for RISC-V SoCs using this driver.
Use the symbol for the driver itself instead.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
13 months agosunxi: mmc: Move header to the driver directory
Samuel Holland [Tue, 31 Oct 2023 05:22:35 +0000 (00:22 -0500)]
sunxi: mmc: Move header to the driver directory

The MMC controller driver is (and ought to be) the only user of these
register definitions. Put them in a header next to the driver to remove
the dependency on a specific ARM platform's headers.

Due to the sunxi_mmc_init() prototype, the file was not renamed. None of
the register definitions were changed.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
13 months agonet: sun8i_emac: Drop DM_GPIO checks
Samuel Holland [Tue, 31 Oct 2023 05:25:46 +0000 (00:25 -0500)]
net: sun8i_emac: Drop DM_GPIO checks

DM_GPIO is always enable in U-Boot proper for ARCH_SUNXI, and this
driver is never enabled in SPL, so the condition is always true.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
13 months agoarm: sunxi: Correct warning in board_fit_config_name_match
Tom Rini [Mon, 17 Jul 2023 19:29:20 +0000 (15:29 -0400)]
arm: sunxi: Correct warning in board_fit_config_name_match

When building this with clang, we get a warning about having excess
parenthesis here, or that we're incorrectly using "==" when we want "=".
Correct these by using the common size macro.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[Andre: Use SZ_512M as per Simon's suggestion]
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
13 months agosunxi: board: simplify early PMIC setup conditions
Andre Przywara [Sun, 27 Jun 2021 00:13:09 +0000 (01:13 +0100)]
sunxi: board: simplify early PMIC setup conditions

So far we have a convoluted #ifdef mesh that guards the early AXP PMIC
setup in board.c. That combination of &&, || and negations is very hard
to read, maintain and especially to extend.

Fortunately we have those same conditions already modelled in the
Kconfig file, so they are actually redundant. On top of that the real
reason we have those preprocessor guards in the first place is about the
symbols that are *conditionally* defined: without #ifdefs the build
would break because of them being undefined for many boards.

To simplify this, just change the guards to actually look at the symbols
needed, so CONFIG_AXP_xxx_VOLT instead of CONFIG_AXPyyy_POWER.
This drastically improves the readability of this code, and makes adding
PMIC support a pure Kconfig matter.

Doing this revealed one bug in Kconfig: there is no axp_set_dcdc4() for
the AXP818, even though CONFIG_AXP_DCDC4_VOLT includes that PMIC.
Since the AXP818 wasn't included when calling axp_set_dcdc4() in board.c,
this wasn't an issue, but becomes one now, so also remove the AXP818 from
the DCDC4 Kconfig symbol.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
13 months agoMerge tag 'doc-2024-01-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 11 Nov 2023 14:22:54 +0000 (09:22 -0500)]
Merge tag 'doc-2024-01-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi

Documentation:

* hikey960: update link URLs
* j7200_evm: Fix OPTEE platform name
* ti: fix style of examples
* fix typos

13 months agodoc: typo 'form' in qfw.rst
Heinrich Schuchardt [Thu, 9 Nov 2023 16:32:06 +0000 (08:32 -0800)]
doc: typo 'form' in qfw.rst

%s/form/from/

Fixes: d46bee8c2d24 ("doc: qfw man-page")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
13 months agodoc: board: ti: k3 docs: Use ::prompt
Nishanth Menon [Fri, 3 Nov 2023 04:40:26 +0000 (23:40 -0500)]
doc: board: ti: k3 docs: Use ::prompt

Use prompt instead of code-block to have copy-paste friendly command
documentation.

Signed-off-by: Nishanth Menon <nm@ti.com>
13 months agodoc: board: ti: Use prompt prompt_style to simplify documentation
Nishanth Menon [Fri, 3 Nov 2023 04:40:25 +0000 (23:40 -0500)]
doc: board: ti: Use prompt prompt_style to simplify documentation

The sphinx-prompt documentation[0] provides examples on how we can use
prompt as a parameter to simplify the description. Use the same.

While at it, ensure to make all relevant prompts clarified such as gdb
prompts.

[0] http://sbrunner.github.io/sphinx-prompt/

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
13 months agodoc: build: fix wrongly written targests instead of targets
Milan P. Stanić [Sat, 4 Nov 2023 14:38:15 +0000 (15:38 +0100)]
doc: build: fix wrongly written targests instead of targets

Signed-off-by: Milan P. Stanić <mps@arvanta.net>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
13 months agodoc: shorten overlong title underlines
Heinrich Schuchardt [Sat, 28 Oct 2023 09:59:32 +0000 (11:59 +0200)]
doc: shorten overlong title underlines

Title underlines should match the length of the title. Unfortunately
docutils only catches underlines that are too short.

Add some missing empty lines after titles.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
13 months agodoc: ti: j7200_evm: Fix OPTEE platform name
Nishanth Menon [Wed, 1 Nov 2023 14:50:25 +0000 (09:50 -0500)]
doc: ti: j7200_evm: Fix OPTEE platform name

k3-j7200 does not exist in upstream OPTEE. Use j721e as the platform
name. Using k3-j7200 as OPTEE name results in broken boot due to wrong
configuration being picked.

Fixes: c727b81d6530 ("doc: board: ti: k3: Reuse build instructions")
Signed-off-by: Nishanth Menon <nm@ti.com>
13 months agohikey960: Fix 404 links
Dylan Corrales [Sat, 28 Oct 2023 09:46:39 +0000 (05:46 -0400)]
hikey960: Fix 404 links

The build instructions for the hikey960 had some broken links. Update
the links to use new vendor URLs. Also change build instructions to
reference a different file name.

Signed-off-by: Dylan Corrales <deathcamel58@gmail.com>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
13 months agoMerge patch series "arm: dts: k3-am6: Fix Ethernet/DMA"
Tom Rini [Fri, 10 Nov 2023 20:25:47 +0000 (15:25 -0500)]
Merge patch series "arm: dts: k3-am6: Fix Ethernet/DMA"

To quote the author:

Since commit [1], Ethernet is broken on TI AM62 and AM64 platforms.

The commit [1] is not the culprit. It just unearths the problem by fixing
the error check in k3-udma.c. This issue was silently being ignored earlier
due to wrong error check. [NULL instead of FDT_ADDR_T_NONE].

Fix the issue by adding the necessary register spaces for the u-boot K3-UDMA
driver for AM62 and AM64 platforms.

These properties will eventually make it into the SoC DTSi files [2] after
which these can be dropped from k3-*-u-boot.dtsi files.

[1] - 5fecea171de3dd ("treewide: use dev_read_addr_*_ptr() where appropriate")
[2] - https://lore.kernel.org/linux-arm-kernel/20230810174356.3322583-1-vigneshr@ti.com/

13 months agoarm: dts: k3-am642: Update main_bcdma and main_pktdma nodes
Siddharth Vadapalli [Sat, 28 Oct 2023 17:36:03 +0000 (20:36 +0300)]
arm: dts: k3-am642: Update main_bcdma and main_pktdma nodes

Update main_bcdma and main_pktdma nodes for native configuration in the
absence of DM services.

Drop duplicate main_pktdma node in k3-am642-sk-u-boot.dtsi.

Reported-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Nishanth Menon <nm@ti.com>
13 months agoarm: dts: k3-am625-verdin-wifi-dev-u-boot.dtsi: Fix DMA/Ethernet
Roger Quadros [Sat, 28 Oct 2023 17:36:02 +0000 (20:36 +0300)]
arm: dts: k3-am625-verdin-wifi-dev-u-boot.dtsi: Fix DMA/Ethernet

Update main_bcdma and main_pktdma nodes for native configuration in the
absence of DM services. u-boot k3-udma driver expects these additional
register fields else probe will fail.

Reported-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
13 months agoarm: dts: k3-am625-sk-u-boot.dtsi: Update main_bcdma and main_pktdma nodes
Siddharth Vadapalli [Sat, 28 Oct 2023 17:36:01 +0000 (20:36 +0300)]
arm: dts: k3-am625-sk-u-boot.dtsi: Update main_bcdma and main_pktdma nodes

Update main_bcdma and main_pktdma nodes for native configuration in the
absence of DM services.

Reported-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Nishanth Menon <nm@ti.com>
13 months agoMerge tag 'u-boot-stm32-20231110' of https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Fri, 10 Nov 2023 14:43:01 +0000 (09:43 -0500)]
Merge tag 'u-boot-stm32-20231110' of https://source.denx.de/u-boot/custodians/u-boot-stm

_ Fix compilation issue when SYS_DCACHE_OFF and/or SYS_DCACHE_SYS are enabled
_ Fix issue following DT sync with kernel 6.3 for stm32mp15xx-ev1 and DHSOM SoM
_ Enable TCP, IPv6, wget on DH STM32MP15 DHSOM
_ Limit u-boot.itb size to 0x160000 bytes on DH STM32MP15 DHSOM
_ Read auth stats and boot_partition from tamp

13 months agoMerge branch '2023-11-10-assorted-fixes'
Tom Rini [Fri, 10 Nov 2023 13:44:18 +0000 (08:44 -0500)]
Merge branch '2023-11-10-assorted-fixes'

- Fix some issues Coverity has reported, update MAINTAINERS file,
  another bootstd fix, typo fix in error message, gitignore fix and
  update TI's URL in many places.

13 months agoboot: Fix syntax in fdt_overlay_apply_verbose() error message
Hugo Villeneuve [Thu, 26 Oct 2023 19:54:49 +0000 (15:54 -0400)]
boot: Fix syntax in fdt_overlay_apply_verbose() error message

Remove superfluous "did".

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
13 months agotools: gitignore: Fix tools/generated path
Sam Protsenko [Thu, 26 Oct 2023 21:00:15 +0000 (16:00 -0500)]
tools: gitignore: Fix tools/generated path

'git status' shows 'tools/generated/' after running the build, which is
wrong. The corresponding .gitignore rule was already added in commit
c623642d29be ("Adjust gitignore for tools/generated/"), but because of
superfluous 'tools/' part it wasn't in effect. Remove incorrect 'tools/'
part to fix it.

While at it, remove tools/ path incorrectly added to the top-level
.gitignore in commit 801c482207c7 (".gitignore: ignore misc include,
simple-bin, and tools/generated build artifacts"), as it's required in
the comment on the top of .gitignore:

    # NOTE! Don't add files that are generated in specific
    # subdirectories here. Add them in the ".gitignore" file
    # in that subdirectory instead.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Fixes: c623642d29be ("Adjust gitignore for tools/generated/")
Fixes: 801c482207c7 (".gitignore: ignore misc include, simple-bin, and tools/generated build artifacts")
13 months agobootstd: Skip over bad device during bootflows scanning
Tony Dinh [Thu, 2 Nov 2023 18:51:15 +0000 (11:51 -0700)]
bootstd: Skip over bad device during bootflows scanning

During bootstd scanning for bootdevs, if bootdev_hunt_drv() encounters
a device not found error (e.g. ENOENT), let it return a successful status
so that bootstd will continue scanning the next devices, not stopping
prematurely.

Background:

During scanning for bootflows, it's possible for bootstd to encounter a
faulty device controller. Also when the same u-boot is used for another
variant of the same board, some device controller such as SATA might
not exist.

I've found this issue while converting the Marvell Sheevaplug board to
use bootstd. This board has 2 variants, the original Sheevaplug has MMC and
USB only, but the later variant comes with USB, MMC, and eSATA ports. We
have been using the same u-boot (starting with CONFIG_IDE and later with DM
CONFIG_SATA) for both variants. This worked well with the old
envs-scripting booting scheme.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
13 months agotree-wide: Replace http:// link with https:// link for ti.com
Nishanth Menon [Wed, 1 Nov 2023 20:56:03 +0000 (15:56 -0500)]
tree-wide: Replace http:// link with https:// link for ti.com

Replace instances of http://www.ti.com with https://www.ti.com

Signed-off-by: Nishanth Menon <nm@ti.com>
13 months agotest: cmd: mbr: Remove unreachable code
Alexander Gendin [Wed, 8 Nov 2023 03:05:19 +0000 (03:05 +0000)]
test: cmd: mbr: Remove unreachable code

Fix an issue reported by Coverity scan, and fix code indentation.

Addresses-Coverity-ID: 467404 ("Control flow issues (DEADCODE)")
Signed-off-by: Alexander Gendin <agendin@matrox.com>
13 months agofirmware: scmi: correct a validity check against power domain id
AKASHI Takahiro [Tue, 7 Nov 2023 00:05:47 +0000 (09:05 +0900)]
firmware: scmi: correct a validity check against power domain id

A power domain id on sandbox should be in the range from zero to
ARRAY_SIZE(scmi_pwdom) - 1. Correct the validity check logic.

Addresses-Coverity-ID: 467401 ("Out-of-bounds write")
Addresses-Coverity-ID: 467405 ("Out-of-bounds read")
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
13 months agoscsi: Have scsi_init_dev_desc_priv() use memset
Tom Rini [Wed, 8 Nov 2023 19:28:11 +0000 (14:28 -0500)]
scsi: Have scsi_init_dev_desc_priv() use memset

When we do not have CONFIG_BOUNCE_BUFFER enabled, inside of
scsi_init_dev_desc_priv we never set the 'bb' field to false, we only
initialize it to true when CONFIG_BOUNCE_BUFFER is set. Given that we
have a number of other fields here we had been explicitly setting to
zero, change to first calling memset to clear the struct and then
initialize only the fields that need non-zero default values.

Addresses-Coverity-ID: 467407 ("Uninitialized variables (UNINIT)")
Fixes: 81bd22e935dc ("rockchip: block: blk-uclass: add bounce buffer flag to blk_desc")
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
13 months agoMerge tag 'u-boot-rockchip-20231110' of https://source.denx.de/u-boot/custodians...
Tom Rini [Fri, 10 Nov 2023 12:54:52 +0000 (07:54 -0500)]
Merge tag 'u-boot-rockchip-20231110' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

- Add Board: rk3588 Pine64 QuartzPro64;
- Fix rk3066 enter download mode;
- Fix for ringneck-px30 board;

13 months agorockchip: include: asm: fix entering download mode rk3066
Johan Jonker [Fri, 27 Oct 2023 18:35:37 +0000 (20:35 +0200)]
rockchip: include: asm: fix entering download mode rk3066

Keep track of the re-entries with help of the lr register.
This binary can be re-used and called from various BROM functions.
Only when it's called from the part that handles SPI, NAND or EMMC
hardware it needs to early return to BROM ones.
In download mode when it handles data on USB OTG and UART0
this section must be skipped.

Unlike newer Rockchip SoC models the rk3066 BROM code does not have built-in
support to enter download mode on return to BROM. This binary must check
the boot mode register for the BOOT_BROM_DOWNLOAD flag and reset if it's set.
It then returns to BROM to the end of the function that reads boot blocks.
From there the BROM code goes into a download mode and waits for data
on USB OTG and UART0.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
13 months agorockchip: ringneck-px30: enable SPL_BOARD_INIT
Quentin Schulz [Fri, 3 Nov 2023 09:28:13 +0000 (10:28 +0100)]
rockchip: ringneck-px30: enable SPL_BOARD_INIT

Now that Ringneck requires some board-specific code (namely resetting
the MCU companion controller) to be run during SPL stage, let's enable
SPL_BOARD_INIT.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
13 months agorockchip: ringneck-px30: always reset STM32 companion controller on boot
Quentin Schulz [Fri, 3 Nov 2023 09:28:12 +0000 (10:28 +0100)]
rockchip: ringneck-px30: always reset STM32 companion controller on boot

It's happened that glitches on the STM32_RST and STM32_BOOT lines have
put the STM32 companion microcontroller into DFU mode making it not boot
its FW, rendering it useless for the user.

Considering that the STM32 companion microcontroller is always reset on
a reboot or power cycle, resetting it once again in U-Boot SPL isn't
going to hurt it any more.

For ATtiny companion microcontroller, the situation is a bit different
because a reboot or power cycle doesn't reset it. Additionally, since it
can only be reset with a UPDI reset on the STM32_RST line, and that is
virtually impossible to mistakenly trigger, the ATtiny is unlikely to be
in unwanted reset or enter reset because U-Boot toggles STM32_RST line.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
13 months agorockchip: rv1126: Read cpuid from otp and set ethaddr
Tim Lunn [Tue, 31 Oct 2023 02:07:15 +0000 (13:07 +1100)]
rockchip: rv1126: Read cpuid from otp and set ethaddr

Provide configuration to read cpuid and generate a persistent
MAC address in ethaddr

Signed-off-by: Tim Lunn <tim@feathertop.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
13 months agorockchip: otp: Add support for RV1126
Tim Lunn [Tue, 31 Oct 2023 02:07:14 +0000 (13:07 +1100)]
rockchip: otp: Add support for RV1126

Extend the otp driver to read rv1126 otp. This driver code was
adapted from the Rockchip BSP stack.

Signed-off-by: Tim Lunn <tim@feathertop.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
13 months agorockchip: dts: fix bootph tags for rv1126
Tim Lunn [Mon, 30 Oct 2023 13:12:41 +0000 (00:12 +1100)]
rockchip: dts: fix bootph tags for rv1126

RV1126 fails to boot on 2024.01-rc1.

Commit 9e644284ab81 ("dm: core: Report bootph-pre-ram/sram node as
pre-reloc after relocation") changed the behaviour of bootph-pre-ram, to
limit nodes to spl phase. This caused rv1126 boards to fail to boot with
the current dts.

This patch updates the pmu/grf nodes to bootph-all tags as they are
needed in all phases. This fixes the boot issue on rv1126 boards.

Signed-off-by: Tim Lunn <tim@feathertop.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
13 months agoMAINTAINERS: Fix Sam Protsenko mail
Sam Protsenko [Tue, 7 Nov 2023 20:45:04 +0000 (14:45 -0600)]
MAINTAINERS: Fix Sam Protsenko mail

Sam works for Linaro again. Use his work e-mail address for ANDROID AB
subsystem.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
13 months agostm32mp1: read auth stats and boot_partition from tamp
Igor Opaniuk [Mon, 6 Nov 2023 10:41:52 +0000 (11:41 +0100)]
stm32mp1: read auth stats and boot_partition from tamp

Obtain from TAMP backup register information about image authorization
status and partition id used for booting. Store this info in
environmental variables ("boot_auth" and "boot_part" correspondingly).

Image authorization supported values:
0x0 - No authentication done
0x1 - Authentication done and failed
0x2 - Authentication done and succeeded

These values are stored to TAMP backup register by Trusted Firmware-A [1].

Testing:
STM32MP> print boot_part
boot_part=1
STM32MP> print boot_auth
boot_auth=2

[1] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?h=refs/heads/integration&id=ab2b325c1ab895e626d4e11a9f26b9e7c968f8d8

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Co-developed-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
13 months agoarm: stm32: Limit u-boot.itb size to 0x160000 bytes on DH STM32MP15 DHSOM
Marek Vasut [Sat, 4 Nov 2023 16:31:57 +0000 (17:31 +0100)]
arm: stm32: Limit u-boot.itb size to 0x160000 bytes on DH STM32MP15 DHSOM

The maximum size of u-boot.itb in SPI NOR on DH STM32MP15 DHSOM is
0x160000 . Define this size in U-Boot config to prevent misconfigured
builds from emitting larger u-boot.itb than the one which fits the
SPI NOR area reserved for the blob.

The SPI NOR layout is as follows:
0x00_0000..0x03_ffff ... SPL 1
0x04_0000..0x07_ffff ... SPL 2
0x08_0000..0x1d_ffff ... U-Boot
0x1e_0000..0x1e_ffff ... Environment 1
0x1f_0000..0x1f_ffff ... Environment 2

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
13 months agoarm: stm32: Enable TCP, IPv6, wget on DH STM32MP15 DHSOM
Marek Vasut [Sat, 4 Nov 2023 16:31:56 +0000 (17:31 +0100)]
arm: stm32: Enable TCP, IPv6, wget on DH STM32MP15 DHSOM

Enable support for TCP protocol, wget, and IPv6 on this platform.
The former two allow users download payload into the U-Boot from
a web server, which may be more convenient or easier to set up
than TFTP server. The later is enabled to future proof the IP
stack on this platform.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
13 months agoARM: dts: stm32mp: Repair damage from alignment with v6.3
Marek Vasut [Mon, 9 Oct 2023 23:15:51 +0000 (01:15 +0200)]
ARM: dts: stm32mp: Repair damage from alignment with v6.3

The patch fixed by this commit renders ST STM32MP15xx EV1 board and
all DHSOM SoM based boards unbootable from SPI NOR. Fix the damage
by updating -u-boot.dtsi to match the stm32mp15-pinctrl.dtsi update.

Fixes: 08002ffd083d ("ARM: dts: stm32mp: alignment with v6.3")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
13 months agoarm: stm32mp: Really fix compilation issue when SYS_DCACHE_OFF and/or SYS_DCACHE_SYS...
Bhupesh Sharma [Tue, 22 Aug 2023 07:51:11 +0000 (13:21 +0530)]
arm: stm32mp: Really fix compilation issue when SYS_DCACHE_OFF and/or SYS_DCACHE_SYS are enabled

While 23e20b2fa6 ("arm: stm32mp: Fix compilation issue when
SYS_DCACHE_OFF and/or SYS_DCACHE_SYS are enabled") tried fixing
this issue, fix it really by adding #if checks for SYS_ICACHE_OFF
and SYS_DCACHE_OFF.

Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
13 months agorockchip: ringneck-px30: enable i2c command
Quentin Schulz [Wed, 25 Oct 2023 11:17:12 +0000 (13:17 +0200)]
rockchip: ringneck-px30: enable i2c command

This is a useful tool to check the presence of a device on a specific
i2c bus, so let's enable it.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
13 months agoboard: rockchip: add Pine64 QuartzPro64 RK3588 board
Tom Fitzhenry [Mon, 23 Oct 2023 14:22:22 +0000 (01:22 +1100)]
board: rockchip: add Pine64 QuartzPro64 RK3588 board

QuartzPro64 is a Rockchip RK3588 based SBC by Pine64.

UART and boot over SD/eMMC/RJ45 are tested to work.

Linux commits from next-20231013:
8152d3d070a9 ("arm64: dts: rockchip: Add QuartzPro64 SBC device tree")

Signed-off-by: Tom Fitzhenry <tom@tom-fitzhenry.me.uk>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Cc: Eugen Hristev <eugen.hristev@collabora.com>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Ondrej Jirman <megi@xff.cz>
13 months agoMerge tag 'xilinx-for-v2024.01-rc3' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Tue, 7 Nov 2023 15:36:23 +0000 (10:36 -0500)]
Merge tag 'xilinx-for-v2024.01-rc3' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

Xilinx changes for v2024.01-rc3

xilinx:
- Disable lock in mini spi configurations

zynq:
- DTS syncups
- Kconfig updates

zynqmp:
- DTS syncups
- Kconfig fixups

versal:
- Make 30MHz as default freq for spi

versal net:
- Enable ADMA for mmc

serial:
- Read baudrate from DT

spi:
- Put spi lock under one Kconfig
- Support 64bit addresses in cadance_ospi
- zynqmp_gqspi - change logging support

firmware:
- Handle errors in zynqmp_pm_feature()

include:
- Sync vsc8531 dt binding with kernel

13 months agoMAINTAINERS: fastboot: add Mattijs
Mattijs Korpershoek [Thu, 5 Oct 2023 13:04:26 +0000 (15:04 +0200)]
MAINTAINERS: fastboot: add Mattijs

Fastboot has been marked as orphaned since 2021.
Since I'm interested in maintaining this, assign myself.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Lukasz Majewski <lukma@denx.de>
13 months agoMAINTAINERS: usb gadget: add Mattijs
Mattijs Korpershoek [Thu, 5 Oct 2023 13:04:25 +0000 (15:04 +0200)]
MAINTAINERS: usb gadget: add Mattijs

It seems that Lukasz and Marek could get some help in maintaining the
usb gadget drivers.

Assign myself as maintainer.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Lukasz Majewski <lukma@denx.de>
13 months agodt-bindings: Remove VSC8531 specific RGMII delay definitions
Michal Simek [Wed, 1 Nov 2023 15:05:16 +0000 (16:05 +0100)]
dt-bindings: Remove VSC8531 specific RGMII delay definitions

Based on Linux upstream discussion value enumeration shouldn't be used.
Instead of it delay in pS should be used that's why remove it from the
header.

Link: https://lore.kernel.org/all/YNsm%2F0dmpBgO8mqr@lunn.ch/
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/bbd343474856a67252f3b31d22b3b5a80ad04043.1698851109.git.michal.simek@amd.com
13 months agoarm64: zynqmp: Add description for nvmem efuse layout
Michal Simek [Wed, 1 Nov 2023 12:06:15 +0000 (13:06 +0100)]
arm64: zynqmp: Add description for nvmem efuse layout

Based on discussion with DT folks at link below there is not going to be
any name restrictions for child names. That's why add description for
current nvmem layout.

Link: https://lore.kernel.org/lkml/20231013101450.573-3-praveen.teja.kundanala@amd.com/
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/af81299cafc2bd13ed30dcd69bdf6efb5fbb7f68.1698840373.git.michal.simek@amd.com
13 months agoARM: zynq: Add partition description
Michal Simek [Wed, 1 Nov 2023 11:22:14 +0000 (12:22 +0100)]
ARM: zynq: Add partition description

Xilinx is using standard mtd partition layout for quite a long time. It is
used for testing purpose on evaluation boards.
Also #address/size-cells shouldn't be present without nodes which should
use them that's why move them from zynq-7000.dtsi to nand/nor nodes
directly.

The patch was tested on zc706 and zedboard(with also increasing max
frequency and rx bus width).

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/4c3348981bba32d3892194420d78fe8621c47534.1698837725.git.michal.simek@amd.com
13 months agoxilinx: Enable SPI_FLASH_MTD by default
Michal Simek [Wed, 1 Nov 2023 11:22:13 +0000 (12:22 +0100)]
xilinx: Enable SPI_FLASH_MTD by default

Provide access to qspi flash layout via mtd command.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/b3c4a3eddb71aab9535b034380d0dbae770828d4.1698837725.git.michal.simek@amd.com
13 months agoarm64: zynqmp: Comment all smmu entries
Michal Simek [Wed, 1 Nov 2023 08:01:03 +0000 (09:01 +0100)]
arm64: zynqmp: Comment all smmu entries

SMMU is disabled by default and not all masters can be enabled at the same
time because of limited number of entries. That's why comment all iommu
properties but keep them for reference in DT. In XEN case they should be
added back and Xen should have SMMU enabled by default.
Also add IDs for DP and DPDMA.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/e868c27c52ded5d8ef25f75ba394b1ab3b31b80a.1698825657.git.michal.simek@amd.com
13 months agoarm64: versal-net: Add DTSes for mini qspi/ospi configuration
Michal Simek [Thu, 26 Oct 2023 14:04:52 +0000 (16:04 +0200)]
arm64: versal-net: Add DTSes for mini qspi/ospi configuration

Mini U-Boot is running out of OCM and it's only purpose is to program non
volatile memories. There are different configurations which ospi/qspi can
be that's why describe them via DT.
DT binding is already approved that's why there is no reason not to add it.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/a99a8d72201a782fc811715942dea97fb5ab583b.1698329087.git.michal.simek@amd.com
13 months agoarm64: versal: Add DTSes for mini qspi/ospi configuration
Michal Simek [Thu, 26 Oct 2023 14:04:51 +0000 (16:04 +0200)]
arm64: versal: Add DTSes for mini qspi/ospi configuration

Mini U-Boot is running out of OCM and it's only purpose is to program non
volatile memories. There are different configurations which ospi/qspi can
be that's why describe them via DT.
DT binding is already approved that's why there is no reason not to add it.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/9518ab1c4299a45e800b8611172edd78c9243132.1698329087.git.michal.simek@amd.com
13 months agoARM: zynq: Add DTSes for mini qspi configurations
Michal Simek [Thu, 26 Oct 2023 14:04:50 +0000 (16:04 +0200)]
ARM: zynq: Add DTSes for mini qspi configurations

Mini U-Boot is running out of OCM and it's only purpose is to program non
volatile memories. There are different configurations which qspi can be
that's why describe them via DT.
DT binding is already approved that's why there is no reason not to add it.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/e7d31a9d9c4a76e171eefc619f31fabd0831a614.1698329087.git.michal.simek@amd.com
13 months agoARM: zynq: Add DTSes for mini qspi configurations
Michal Simek [Thu, 26 Oct 2023 14:04:49 +0000 (16:04 +0200)]
ARM: zynq: Add DTSes for mini qspi configurations

Mini U-Boot is running out of OCM and it's only purpose is to program non
volatile memories. There are different configurations which qspi can be
that's why describe them via DT.
DT binding is already approved that's why there is no reason not to add it.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/28b3cdd7e91b2b4c3c36d0bf65aa5bac042f248c.1698329087.git.michal.simek@amd.com
13 months agoxilinx: versal: Setup 30MHz as default spi frequency
Michal Simek [Tue, 31 Oct 2023 10:50:54 +0000 (11:50 +0100)]
xilinx: versal: Setup 30MHz as default spi frequency

Align default SPI configuration with ZynqMP/Versal NET.
There is no reason to run on lower frequencies.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/c1d6ebd659f3002649b1200c926f8b9ed3132085.1698749448.git.michal.simek@amd.com
13 months agoarm64: versal-net: enable CONFIG_MMC_SDHCI_ADMA
Venkatesh Yadav Abbarapu [Fri, 27 Oct 2023 03:04:46 +0000 (08:34 +0530)]
arm64: versal-net: enable CONFIG_MMC_SDHCI_ADMA

The Standard Host Controller Interface (SDHCI) specification version
3.00 adds support for Advanced DMA (ADMA) for both 64 and 32 bit
widths of DMA. This significantly improves read and write throughput.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20231027030446.4009-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agoarm64: zynqmp: Fix Kconfig entry indentation
Michal Simek [Thu, 26 Oct 2023 06:34:31 +0000 (08:34 +0200)]
arm64: zynqmp: Fix Kconfig entry indentation

Use tabs instead of space for entry indentation which is standard coding
style.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ff28e719de82258c066f1fedae87f88597f367b5.1698302068.git.michal.simek@amd.com
13 months agoarm: xilinx: Add missing dual parallel flash description
Michal Simek [Mon, 23 Oct 2023 07:21:53 +0000 (09:21 +0200)]
arm: xilinx: Add missing dual parallel flash description

Describe flash memories based on the latest DT binding.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/cddf2909d0445eba08b998d42ffc31c1fa3132b9.1698045694.git.michal.simek@amd.com
13 months agoarm64: zynqmp: Disable Tri-state for MIO38 Pin
Tejas Bhumkar [Fri, 20 Oct 2023 05:06:22 +0000 (10:36 +0530)]
arm64: zynqmp: Disable Tri-state for MIO38 Pin

gpio38 is used in SOM's kv260 to reset the Ethernet PHY.
At present, HW reset is not working properly as Tri-state 
is enabled for MIO38, causing inappropriate PHY register reads.

Disabled Tri-state for MIO38 to make HW reset work.

Tri-state disable :
ZynqMP> md 0xFF180208 2
ff18020800bfe7a3 00000540

Tri-state enable :
ZynqMP> md 0xFF180208 2
ff18020800bfe7e3 00000540

Signed-off-by: Tejas Bhumkar <tejas.arvind.bhumkar@amd.com>
Link: https://lore.kernel.org/r/20231020050622.972750-1-tejas.arvind.bhumkar@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agozynqmp: migrate gqspi debug to logging
Ibai Erkiaga [Fri, 13 Oct 2023 12:37:27 +0000 (13:37 +0100)]
zynqmp: migrate gqspi debug to logging

The following patch migrates the usage of debug and printf functions
to the relevant logging function as per U-Boot DM guidelines.

Additionally some of the debugging statements have been rearanged for
a more meaningfull debug experience.

aarch64-linux-gnu-size reports 229 bytes less when debug is enabled at
file level, while is just 5bytes more when disabled.

Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>
Link: https://lore.kernel.org/r/20231013123739.2757979-1-ibai.erkiaga-elorza@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agoarm64: dts: zynqmp: make hw-ecc as the default ecc mode
Amit Kumar Mahapatra [Thu, 12 Oct 2023 13:58:21 +0000 (15:58 +0200)]
arm64: dts: zynqmp: make hw-ecc as the default ecc mode

Except for Linux no other component (i.e., u-boot, fsbl or BootRom) of the
software stack supports software ecc engine. So, make hw-ecc as the default
ecc mode.

Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/f47b95616eb40d3a9908ca60df94ec6e873b071c.1697119098.git.michal.simek@amd.com
13 months agoARM: zynq: Disable the config CONFIG_SPI_FLASH_USE_4K_SECTORS
Venkatesh Yadav Abbarapu [Thu, 12 Oct 2023 13:39:56 +0000 (15:39 +0200)]
ARM: zynq: Disable the config CONFIG_SPI_FLASH_USE_4K_SECTORS

Lock size for the flashes will be in terms of sector size, so
disable the CONFIG_SPI_FLASH_USE_4K_SECTORS and read it from the
flash itself.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/8e5c2bf3b7e5f366c4e261e8055ea254bda53aa9.1697117993.git.michal.simek@amd.com
13 months agoarm64: zynqmp: Disable the lock option for mini qspi
Venkatesh Yadav Abbarapu [Thu, 12 Oct 2023 13:37:52 +0000 (15:37 +0200)]
arm64: zynqmp: Disable the lock option for mini qspi

As mini configs are required only for flashing the images, so
disabling the lock config which will save nearly 6KB of memory.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/374d6b3a46d19b7ee171dfe8071676098db93e25.1697117869.git.michal.simek@amd.com
13 months agoarm64: zynqmp: remove snps, xhci-stream-quirk property for usb
Piyush Mehta [Thu, 12 Oct 2023 12:58:51 +0000 (14:58 +0200)]
arm64: zynqmp: remove snps, xhci-stream-quirk property for usb

To sync up with the upstream bulk-stream feature, removed
'snps,xhci-stream-quirk' DT property for usb.

Signed-off-by: Piyush Mehta <piyush.mehta@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/1f4ecfe3ea6a4d0d8d8de324f5dffd3efc86656a.1697115523.git.michal.simek@amd.com
13 months agoarm64: zynqmp: Remove address/size-cells from ams node
Michal Simek [Thu, 12 Oct 2023 12:58:50 +0000 (14:58 +0200)]
arm64: zynqmp: Remove address/size-cells from ams node

Remove unused address/size-cells which is also done upstream that's why
this is pretty much sync patch with upstream.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/0ca8d8fe245ad7cb665f5333202d83f70acfc11f.1697115523.git.michal.simek@amd.com
13 months agoRevert "arm64: zynqmp: Add power domain description for PL"
Michal Simek [Thu, 12 Oct 2023 12:58:49 +0000 (14:58 +0200)]
Revert "arm64: zynqmp: Add power domain description for PL"

This reverts commit d59fac2f3f247470708a1aed1af96802a05e0e61.

This power domain shouldn't be enabled by default. Power domain behavior
should be handled on case by case basis. Adding this property to
zynqmp.dtsi is breaking some suspend/resume cases that's why remove it
from this file.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/7ed2a46383c6918fbbaca2d618459b1ee58f865c.1697115523.git.michal.simek@amd.com
13 months agoarm64: zynqmp: Remove xlnx,zynqmp-aes node
Michal Simek [Thu, 12 Oct 2023 12:58:48 +0000 (14:58 +0200)]
arm64: zynqmp: Remove xlnx,zynqmp-aes node

AES can be discovered via firmware interface that's why remove node for it.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/eaf575a6ca92f8c10cefb447c08c1292025deb74.1697115523.git.michal.simek@amd.com
13 months agoarm64: zynqmp: Use mdio node by vp-x-a2785-00-revA and vpk120-revA
Michal Simek [Thu, 12 Oct 2023 12:58:47 +0000 (14:58 +0200)]
arm64: zynqmp: Use mdio node by vp-x-a2785-00-revA and vpk120-revA

All boards have been converted to use mdio node that's why move ethernet
phys under mdio node too.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/6c60f5d29b9d9992bd0130fd263c8ed13cb8166c.1697115523.git.michal.simek@amd.com
13 months agoarm64: zynqmp: Remove fclk driver
Michal Simek [Thu, 12 Oct 2023 08:22:16 +0000 (10:22 +0200)]
arm64: zynqmp: Remove fclk driver

fclk will never go upstream that's why removing this node from DT.
All PL (programmable logic) based IPs should handle clocks self without
using this workaround.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/fbb8665b8a58dbe96349abfe5492a509939e165b.1697098930.git.michal.simek@amd.com
13 months agospi: cadence_ospi_versal: Add support for 64-bit address
Venkatesh Yadav Abbarapu [Wed, 11 Oct 2023 03:15:15 +0000 (08:45 +0530)]
spi: cadence_ospi_versal: Add support for 64-bit address

When 64-bit address is passed only lower 32-bit address
is getting updated. Program the upper 32-bit address in the
DMA destination memory address MSBs register.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20231011031515.4151-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agodrivers: firmware: Handle error case in the zynqmp_pm_feature
Venkatesh Yadav Abbarapu [Wed, 11 Oct 2023 02:56:47 +0000 (08:26 +0530)]
drivers: firmware: Handle error case in the zynqmp_pm_feature

Unhandled error coming from xilinx_pm_request() but return
value is not read back that's why getting sparse warning
as below:
warning: variable 'ret' set but not used [-Wunused-but-set-variable].
In case of error return the "ret" value.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20231011025647.17200-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agoarm64: versal_net: Disable the lock option for mini ospi and qspi
Venkatesh Yadav Abbarapu [Tue, 3 Oct 2023 03:17:15 +0000 (08:47 +0530)]
arm64: versal_net: Disable the lock option for mini ospi and qspi

As mini configs are required only for flashing the images, so
disabling the lock config which will save nearly 6KB of memory.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20231003031715.5343-4-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agoarm64: versal: Disable the lock option for mini ospi and qspi
Venkatesh Yadav Abbarapu [Tue, 3 Oct 2023 03:17:14 +0000 (08:47 +0530)]
arm64: versal: Disable the lock option for mini ospi and qspi

As mini configs are required only for flashing the images, so
disabling the lock config which will save nearly 6KB of memory.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20231003031715.5343-3-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agomtd: spi-nor: Add spi flash lock config option
Venkatesh Yadav Abbarapu [Tue, 3 Oct 2023 03:17:13 +0000 (08:47 +0530)]
mtd: spi-nor: Add spi flash lock config option

Provide an explicit configuration option to disable default "lock"
of any flash chip which supports locking. By disabling the lock
config will save some amount of memory and also don't expose the
lock functionality to the users i.e., via sf protect command.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20231003031715.5343-2-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agoserial: zynqmp: Fetch baudrate from dtb and update
Algapally Santosh Sagar [Thu, 21 Sep 2023 11:20:43 +0000 (16:50 +0530)]
serial: zynqmp: Fetch baudrate from dtb and update

The baudrate configured in .config is taken by default by serial. If
change of baudrate is required then the .config needs to changed and
u-boot recompilation is required or the u-boot environment needs to be
updated.

To avoid this, support is added to fetch the baudrate directly from the
device tree file and update.
The serial, prints the log with the configured baudrate in the dtb.
The commit c4df0f6f315c ("arm: mvebu: Espressobin: Set default value for
$fdtfile env variable") is taken as reference for changing the default
environment variable.

The default environment stores the default baudrate value, When default
baudrate and dtb baudrate are not same glitches are seen on the serial.
So, the environment also needs to be updated with the dtb baudrate to
avoid the glitches on the serial.

Also add test to cover this new function.

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20230921112043.3144726-3-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>