platform/kernel/u-boot.git
13 months agonet: fsl-mc: sync DPNI MC APIs
Ioana Ciornei [Wed, 31 May 2023 16:04:33 +0000 (19:04 +0300)]
net: fsl-mc: sync DPNI MC APIs

Sync the Data Path Network Interface APIs to their latest form, this
means the layout of each command is created based on structures which
clearly describe the endianness of each field rather than some macros.

The command version is kept in place, meaning that the minimum MC
version accepted is not changed in any way.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agonet: fsl-mc: sync DPRC MC APIs
Ioana Ciornei [Wed, 31 May 2023 16:04:32 +0000 (19:04 +0300)]
net: fsl-mc: sync DPRC MC APIs

Sync the Data Resource Container APIs to their latest form, this means
the layout of each command is created based on structures which clearly
describe the endianness of each field rather than some macros.

The command version is kept in place, meaning that the minimum MC
version accepted is not changed in any way.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agonet: fsl-mc: sync DPMAC MC APIs
Ioana Ciornei [Wed, 31 May 2023 16:04:31 +0000 (19:04 +0300)]
net: fsl-mc: sync DPMAC MC APIs

Sync the Data Path MAC APIs to their latest form, this means the
layout of each command is created based on structures which clearly
describe the endianness of each field rather than some macros.

The command version is kept in place, meaning that the minimum MC
version accepted is not changed in any way.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agonet: fsl-mc: sync DPBP MC APIs
Ioana Ciornei [Wed, 31 May 2023 16:04:30 +0000 (19:04 +0300)]
net: fsl-mc: sync DPBP MC APIs

Sync the Data Path Buffer Pool APIs to their latest form, this means the
layout of each command is created based on structures which clearly
describe the endianness of each field rather than some macros.

The command version is kept in place, meaning that the minimum MC
version accepted is not changed in any way.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agonet: fsl-mc: remove unused MC APIs
Ioana Ciornei [Wed, 31 May 2023 16:04:29 +0000 (19:04 +0300)]
net: fsl-mc: remove unused MC APIs

There are multiple MC APIs which were added years ago but they are not
used at all in the u-boot source code. Remove all these APIs.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agoboard: fsl: lx2160ardb: add dts fixup function for RevC and newer
Florin Chiculita [Wed, 31 May 2023 15:02:18 +0000 (18:02 +0300)]
board: fsl: lx2160ardb: add dts fixup function for RevC and newer

Since the new RevC LX2160A-RDB board has its 10G Aquantia PHYs at
different MDIO bus addresses, we must update both the kernel DTS and
u-boot's DTS (in case of DM_ETH) in case the board is indeed RevC or
newer. Use the newly introduced get_board_rev() function to trigger a
fixup of the kernel DTS to properly match the actual PHY addresses.
All this is encapsulated in the fdt_fixup_board_phy_revc() function
which will be used in the next patch.

Use the newly fdt_fixup_board_phy_revc() function introduced to
update both kernel's DTS and u-boot's DTS.

Signed-off-by: Florin Chiculita <florinlaurentiu.chiculita@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agoboard: fsl: lx2160ardb: add api for obtaining board revision
Florin Chiculita [Wed, 31 May 2023 15:02:17 +0000 (18:02 +0300)]
board: fsl: lx2160ardb: add api for obtaining board revision

Add new API for obtaining board revision and trigger the i2c node
fixup with this new API.

Signed-off-by: Florin Chiculita <florinlaurentiu.chiculita@nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agonet: ldpaa_eth: export DPNI and DPMAC counters through 'net stats'
Ioana Ciornei [Tue, 23 May 2023 13:47:48 +0000 (16:47 +0300)]
net: ldpaa_eth: export DPNI and DPMAC counters through 'net stats'

Export the already existing DPNI and DPMAC counters through the newly
added callbacks.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agocmd: net: add a 'net stats' command to dump network statistics
Ioana Ciornei [Tue, 23 May 2023 13:47:47 +0000 (16:47 +0300)]
cmd: net: add a 'net stats' command to dump network statistics

Add a new option to the 'net' command which can be used to dump network
statistics.

To do this, 3 new callbacks are added to the eth_ops structure:
.get_sset_count(), .get_strings(), .get_stats(). These callbacks
have the same functions as in Linux: to return the number of counters,
the strings which describe those counters and the actual values.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agonet: ldpaa_eth: extend debug capabilities with DPMAC statistics
Ioana Ciornei [Tue, 23 May 2023 13:47:46 +0000 (16:47 +0300)]
net: ldpaa_eth: extend debug capabilities with DPMAC statistics

The ldpaa_eth driver already had a DPMAC statistics dump, this patch
extends the list of stats and adds a bit more structure to the code.

For a bit more context, the DPAA2 u-boot software architecture uses a
default network interface object - a DPNI - which, at runtime, will get
connected to the currently used DPMAC object.
Each time the .stop() eth callback is called, the DPMAC is destroyed
thus any previous counters will get lost.

As a preparation for the next patches, we add a software kept set of
DPMAC counters which will get updated before each destroy operation
takes place.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agonet: ldpaa_eth: extend debug capabilities with DPNI statistics
Ioana Ciornei [Tue, 23 May 2023 13:47:45 +0000 (16:47 +0300)]
net: ldpaa_eth: extend debug capabilities with DPNI statistics

The ldpaa_eth driver already had a DPNI statistics dump, this patch
extends the list of stats and adds a bit more structure to the code.

For a bit more context, the DPAA2 u-boot software architecture uses a
default network interface object - a DPNI - which, at runtime, will get
connected to the currently used DPMAC object.
Each time the .stop() eth callback is called, the DPNI is reset to its
original state, including its counters.

As a preparation for the next patches, we add a software kept set of
DPNI counters which will get updated before each reset operation takes
place.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agonet: ldpaa_eth: transform dpni_statistics from a struct to a union
Ioana Ciornei [Tue, 23 May 2023 13:47:44 +0000 (16:47 +0300)]
net: ldpaa_eth: transform dpni_statistics from a struct to a union

In order to simplify code, dpni_statistics can be written as a union.
Using the raw accessors we can just loop through all the statistics from
a page without trying to access each an every one independently.
Make this change to a union.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agonet: ldpaa_eth: fix the memory layout of the dpmac_get_counters() API
Ioana Ciornei [Tue, 23 May 2023 13:47:43 +0000 (16:47 +0300)]
net: ldpaa_eth: fix the memory layout of the dpmac_get_counters() API

Each MC commands has a specific predefined memory layout that gets
interpreted by the firmware. The dpmac_get_counters() API memory layout
is wrong, thus the results returned by the command are incorrect.

Fix this by updating the offset of the counter field.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agonet: dsa: Fix OF fallback lookup for ports
Marcus Comstedt [Mon, 15 May 2023 15:44:23 +0000 (15:44 +0000)]
net: dsa: Fix OF fallback lookup for ports

The variable 'node' was already invalid, so using it for further
lookup will not work.

Signed-off-by: Marcus Comstedt <marcus.comstedt@requtech.se>
Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 months agoMerge tag 'tpm-for_tom-13062023' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Tue, 13 Jun 2023 17:14:49 +0000 (13:14 -0400)]
Merge tag 'tpm-for_tom-13062023' of https://source.denx.de/u-boot/custodians/u-boot-tpm into next

tpm autostart

13 months agotest/py: Account PCR updates properly during testing
Ilias Apalodimas [Wed, 7 Jun 2023 09:18:12 +0000 (12:18 +0300)]
test/py: Account PCR updates properly during testing

Currently we only read the pcr updates once on test_tpm2_pcr_read().
It turns out that the tpm init sequence of force_init() which consists
of:
- tpm2 init
- tpm2 startup TPM2_SU_CLEAR
- tpm2 self_test full
- tpm2 clear TPM2_RH_LOCKOUT

also counts as an update.  Running this in the console verifies the
update bump
=> tpm2 init
=> tpm2 startup TPM2_SU_CLEAR
=> tpm2 self_test full
=> tpm pcr_read 10 $loadaddr
PCR #10 content (28 known updates):
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=> tpm2 clear TPM2_RH_LOCKOUT
=> tpm pcr_read 10 $loadaddr
PCR #10 content (29 known updates):
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>

With the recent changes of replacing 'tpm2 init' with 'tpm2 autostart'
we end up always running the full init.  The reason is 'tpm init'
returns -EBUSY if the tpm is already open, while 'tpm autostart' handles
ths gracefully and continues with the initialization.  It's worth noting
that this won't affect the device functionality at all since
retriggering the startup sequence and selftests has no side effects.

Instead of relying on the initial value, reread the 'known updates'
just before updating the PCR to ensure we read the correct values
before testing

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 months agotest/py: replace 'tpm2 init, startup, selftest' sequences
Ilias Apalodimas [Wed, 7 Jun 2023 09:18:11 +0000 (12:18 +0300)]
test/py: replace 'tpm2 init, startup, selftest' sequences

Instead of copy pasting the commands needed to start a TPM consisting
of:
- tpm init
- tpm startup TPM2_SU_CLEAR
- tpm2 self_test full
use the newly added 'autostart' which does the same thing and simplify
our python scripts

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 months agotpm: Add 'tpm autostart' shell command
Ilias Apalodimas [Wed, 7 Jun 2023 09:18:10 +0000 (12:18 +0300)]
tpm: Add 'tpm autostart' shell command

For a TPM device to be operational we need to initialize it and
perform its startup sequence.  The 'tpm init' command currently calls
tpm_init() which ends up calling the ->open() per-device callback and
performs the initial hardware configuration as well as requesting
locality 0 for the caller.  There no code that currently calls
tpm_init() without following up with a tpm_startup() and tpm_self_test_full()
or tpm_continue_self_test().

So let's add a 'tpm autostart' command and call tpm_auto_start() which
leaves the device in an operational state.

It's worth noting that calling tpm_init() only, doesn't allow a someone
to use the TPM since the startup sequence is mandatory. We always
repeat the pattern of calling
- tpm_init()
- tpm_startup()
- tpm_self_test_full() or tpm_continue_self_test()

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 months agoMerge tag 'xilinx-for-v2023.10-rc1' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Mon, 12 Jun 2023 20:42:37 +0000 (16:42 -0400)]
Merge tag 'xilinx-for-v2023.10-rc1' of https://source.denx.de/u-boot/custodians/u-boot-microblaze into next

Xilinx changes for v2023.10-rc1

global:
- Use proper U-Boot project name

Fix sparse warnings in zynqmp-clk, zynqmp handoff, board

cmd:
- Cover incorrect 0 length entries

Versal NET:
- Add bootmode logic
- Support SPP production version
- Add loadpdi command

ZynqMP:
- Clear pmufw node command ID handling
- Change power domain behavior around zynqmp_pmufw_node()
- Fix zynqmp cmd return values and pmufw command
- Fix R5 tcm init and modes

mmc:
- Sync Versal NET emmc DT binding

pcie:
- Add support for ZynqMP PCIe root port

video:
- Add support for ZynqMP DP

tools:
- Fix debug message in relocate-rela

13 months agoMerge tag v2023.07-rc4 into next
Tom Rini [Mon, 12 Jun 2023 18:55:33 +0000 (14:55 -0400)]
Merge tag v2023.07-rc4 into next

Signed-off-by: Tom Rini <trini@konsulko.com>
13 months agoPrepare v2023.07-rc4
Tom Rini [Mon, 12 Jun 2023 17:45:09 +0000 (13:45 -0400)]
Prepare v2023.07-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
13 months agoarm64: versal: Add missing prototypes
Algapally Santosh Sagar [Fri, 9 Jun 2023 09:05:31 +0000 (03:05 -0600)]
arm64: versal: Add missing prototypes

Add missing prototypes to fix the below sparse warnings
1. warning: no previous prototype for 'set_r5_halt_mode'
[-Wmissing-prototypes]
2. warning: no previous prototype for 'set_r5_tcm_mode'
[-Wmissing-prototypes]
3. warning: no previous prototype for 'release_r5_reset'
[-Wmissing-prototypes]
4.warning: no previous prototype for 'enable_clock_r5'
[-Wmissing-prototypes]

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230609090531.31794-3-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agoarm64: versal: Add missing prototype for initialize_tcm
Algapally Santosh Sagar [Fri, 9 Jun 2023 09:05:30 +0000 (03:05 -0600)]
arm64: versal: Add missing prototype for initialize_tcm

Add the missing prototype pointed by below sparse warning
warning: no previous prototype for 'initialize_tcm'
[-Wmissing-prototypes]

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230609090531.31794-2-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agoarm64: zynqmp: Fix lockstep mode cpu release functionality
Venkatesh Yadav Abbarapu [Thu, 8 Jun 2023 03:21:52 +0000 (08:51 +0530)]
arm64: zynqmp: Fix lockstep mode cpu release functionality

For lockstep mode, cpu_release function is expecting to execute
on R5 core 0, if there is attempt to pass other than R5 core 0,
through an error saying "Lockstep mode should run on R5 core 0 only".

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20230608032152.980-3-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agoarm64: zynqmp: Fix tcminit mode param
Venkatesh Yadav Abbarapu [Thu, 8 Jun 2023 03:21:51 +0000 (08:51 +0530)]
arm64: zynqmp: Fix tcminit mode param

While invoking "zynqmp tcminit mode" command (which is invalid command)
on U-Boot, it just works. Check the mode param, if it is valid then
only initialize the TCM.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20230608032152.980-2-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agoPCI: zynqmp: Add ZynqMP NWL PCIe root port driver
Stefan Roese [Thu, 25 May 2023 09:49:18 +0000 (11:49 +0200)]
PCI: zynqmp: Add ZynqMP NWL PCIe root port driver

This patch adds the PCIe controller driver for the Xilinx / AMD ZynqMP
NWL PCIe Bridge as root port. The driver source is partly copied from
the Linux PCI driver and modified to enable usage in U-Boot (e.g.
simplified and interrupt support removed).

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Pali Rohár <pali@kernel.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Pali Rohár <pali@kernel.org>
Link: https://lore.kernel.org/r/20230525094918.111949-1-sr@denx.de
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agofirmware: zynqmp: Extend debug message to show parameters
Michal Simek [Thu, 1 Jun 2023 11:34:34 +0000 (13:34 +0200)]
firmware: zynqmp: Extend debug message to show parameters

Also print more arguments not just ID when xilinx_pm_request is called.
It helps to decode what firmware is asked to do.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/54928d061da75bd972a3b6a1219204e730b49225.1685619271.git.michal.simek@amd.com
13 months agoarm64: zynqmp: Fix return code from do_zynqmp_pmufw()
Michal Simek [Thu, 1 Jun 2023 11:25:04 +0000 (13:25 +0200)]
arm64: zynqmp: Fix return code from do_zynqmp_pmufw()

zynqmp_pmufw_node() can also return values like -ENODEV which means that
NODE has been already configured that's why don't propagate this error
code.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/e52d24d8d3efb276778d387dc716e4e065e0626f.1685618701.git.michal.simek@amd.com
13 months agoarm64: zynqmp: Fix command error values properly
Michal Simek [Thu, 1 Jun 2023 11:21:07 +0000 (13:21 +0200)]
arm64: zynqmp: Fix command error values properly

Process errors from command via cmd_process_error() as is done on Versal.
When internal function returns different number then CMD_RET_SUCCESS(0),
CMD_RET_FAILURE(1) or CMD_RET_USAGE(-1) shell react on these errors by
throwing an error like
"exit not allowed from main input shell." that's why use
cmd_process_error() to make sure that error code is all the time correct.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/d511935ba10daf95c70996fae6e6ffc374efffa0.1685618464.git.michal.simek@amd.com
13 months agovideo: zynqmp: Enable 1024x768 resolution
Michal Simek [Wed, 17 May 2023 08:42:12 +0000 (10:42 +0200)]
video: zynqmp: Enable 1024x768 resolution

Add support for 1024x768 60p resolution and set it up this resolution by
default. This resolution is still able to use only one GT line. But for
example 800x600 60p has some issues with settings. That's why extend this
table by tested resolutions.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/957e1e85a05744326ec2606dadc1af6e69976f37.1684312924.git.michal.simek@amd.com
13 months agoxilinx: zynqmp: Enable the vidconsole by default
Venkatesh Yadav Abbarapu [Wed, 17 May 2023 08:42:11 +0000 (10:42 +0200)]
xilinx: zynqmp: Enable the vidconsole by default

Add the vidconsole flags for video serial console.

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/f1b58d1d1052bf2d8cb8b25af44ecbb567ebbd4a.1684312924.git.michal.simek@amd.com
13 months agovideo: zynqmp: Driver for Xilinx ZynqMP DisplayPort Subsystem
Venkatesh Yadav Abbarapu [Wed, 17 May 2023 08:42:10 +0000 (10:42 +0200)]
video: zynqmp: Driver for Xilinx ZynqMP DisplayPort Subsystem

The Xilinx ZynqMP SoC has a hardened display pipeline named DisplayPort
Subsystem. It includes a buffer manager, blender, an audio mixer and a
DisplayPort source controller (transmitter). The DisplayPort controller can
source data from memory (non-live input) or the stream (live input). The
DisplayPort controller is responsible for managing the link and physical
layer functionality. The controller packs audio/video data into transfer
units and sends them over the main link. The link rate and lane counts can
be selected based on the application bandwidth requirements. The
DisplayPort pipeline consists of the DisplayPort direct memory access (DMA)
for fetching data from memory. The DisplayPort DMA controller (DPDMA)
supports up to six input channels as non-live input.

This driver supports the DisplayPort Subsystem and implements
1)640x480 resolution
2)RGBA8888 32bpp format
3)DPDMA channel 3 for Graphics
4)Non-live input
5)Fixed 5.4G link rate
6)Tested on ZCU102 board

There will be additional work to configure GT lines based on DT, higher
resolutions, support for more compressed video formats, spliting code to
more files, add support for EDID, audio support, using clock framework for
all clocks and in general code clean up.

Codevelop-by: Michal Simek <michal.simek@amd.com>
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/5c1567b63d0280dacc7efba2998857c399c25358.1684312924.git.michal.simek@amd.com
13 months agovideo: move zynqmp files to subdirectory
Venkatesh Yadav Abbarapu [Wed, 17 May 2023 08:42:09 +0000 (10:42 +0200)]
video: move zynqmp files to subdirectory

Place zynqmp files and headers in custom driver subdirectory.

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/9aae6d217f0673c310818e3de38bb239c79c060c.1684312924.git.michal.simek@amd.com
13 months agovideo: bmp: Support rgba8888 pixel format
Michal Simek [Wed, 17 May 2023 08:42:08 +0000 (10:42 +0200)]
video: bmp: Support rgba8888 pixel format

Adding the support for RGBA8888 format for BMP decoding.

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/322910eb24692f6140a001796501270eb1c53d9a.1684312924.git.michal.simek@amd.com
13 months agovideo: Add support for RGBA8888 format
Michal Simek [Wed, 17 May 2023 08:42:07 +0000 (10:42 +0200)]
video: Add support for RGBA8888 format

Add support for RGBA8888 32bpp format where pixels are picked in
32-bit integers, where the colors are stored in memory such that
R is at lowest address, G after that, B after that, and A last.

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/aa1de54b7d4ff46df6858f76d52634e0c5c71a4a.1684312924.git.michal.simek@amd.com
13 months agofirmware: zynqmp: Store driver data in data section
Stefan Herbrechtsmeier [Tue, 23 May 2023 12:42:14 +0000 (14:42 +0200)]
firmware: zynqmp: Store driver data in data section

Store the driver data in the data section to make the data usable before
relocation. Additionally mark the driver data static to restrict the
access.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Link: https://lore.kernel.org/r/20230523124215.30915-5-stefan.herbrechtsmeier-oss@weidmueller.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agofirmware: zynqmp: Move permission to change config object message
Stefan Herbrechtsmeier [Tue, 23 May 2023 12:42:13 +0000 (14:42 +0200)]
firmware: zynqmp: Move permission to change config object message

Move the permission to change a config object message from
zynqmp_pmufw_load_config_object function to zynqmp_pmufw_node function
to simplify the code and check the permission only if required.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Link: https://lore.kernel.org/r/20230523124215.30915-4-stefan.herbrechtsmeier-oss@weidmueller.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agopower: zynqmp: Mask node already configured error
Stefan Herbrechtsmeier [Tue, 23 May 2023 12:42:12 +0000 (14:42 +0200)]
power: zynqmp: Mask node already configured error

Do not return an error (ENODEV) from the request function if the node is
already configured.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Link: https://lore.kernel.org/r/20230523124215.30915-3-stefan.herbrechtsmeier-oss@weidmueller.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agofirmware: zynqmp: Remove redundant child device bind
Stefan Herbrechtsmeier [Tue, 23 May 2023 12:42:11 +0000 (14:42 +0200)]
firmware: zynqmp: Remove redundant child device bind

Remove the redundant child device bind from the driver bind function and
rely on the post_bind of the class which calls the same function.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Link: https://lore.kernel.org/r/20230523124215.30915-2-stefan.herbrechtsmeier-oss@weidmueller.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agofirmware: zynqmp: Remove extraordinary return value
Stefan Herbrechtsmeier [Tue, 23 May 2023 12:42:10 +0000 (14:42 +0200)]
firmware: zynqmp: Remove extraordinary return value

Return a common -EACCES error value instead of a positive private error
value XST_PM_NO_ACCESS (2002) in zynqmp_pmufw_load_config_object
function if the config object is not loadable to simplify the error
checking.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Link: https://lore.kernel.org/r/20230523124215.30915-1-stefan.herbrechtsmeier-oss@weidmueller.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agoarm64: zynqmp: Check 0 node ID
Michal Simek [Thu, 1 Jun 2023 10:32:36 +0000 (12:32 +0200)]
arm64: zynqmp: Check 0 node ID

ID is decimal not hexadecimal that's why passing hex number all the time
end's up as 0 that's why check it. Node ID 0 is not valid anyway.
Also properly say it in help.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/68c5cd5eade216f3c5aa6eb703ee9f69f14acad1.1685615549.git.michal.simek@amd.com
13 months agotools: relocate-rela: Fix typo
Marek Vasut [Tue, 30 May 2023 22:53:19 +0000 (00:53 +0200)]
tools: relocate-rela: Fix typo

Position is written with one s, fix typo.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://lore.kernel.org/r/20230530225319.949968-1-marek.vasut+renesas@mailbox.org
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agoglobal: Use proper project name U-Boot
Michal Simek [Wed, 17 May 2023 07:17:16 +0000 (09:17 +0200)]
global: Use proper project name U-Boot

Use proper project name in comments, Kconfig, readmes.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/0dbdf0432405c1c38ffca55703b6737a48219e79.1684307818.git.michal.simek@amd.com
13 months agoboard: xilinx: Add missing prototypes
Algapally Santosh Sagar [Tue, 23 May 2023 05:56:26 +0000 (23:56 -0600)]
board: xilinx: Add missing prototypes

Add missing prototypes to fix the below sparse warnings
1. warning: no previous prototype for 'soc_name_decode'
[-Wmissing-prototypes]
2. warning: no previous prototype for 'soc_detection'
[-Wmissing-prototypes]
3. warning: no previous prototype for 'board_name_decode'
[-Wmissing-prototypes]
4. warning: no previous prototype for 'board_detection'
[-Wmissing-prototypes]

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230523055626.14742-1-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agoxilinx: versal-net: Add new versalnet loadpdi command
Algapally Santosh Sagar [Mon, 22 May 2023 13:21:08 +0000 (15:21 +0200)]
xilinx: versal-net: Add new versalnet loadpdi command

Versal NET loadpdi command is used for loading secure & non-secure
pdi images.

Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/f43709af894b669833770acb39ff5856fecf6d66.1684761656.git.michal.simek@amd.com
13 months agommc: zynq: Sync with upstream DT binding
Michal Simek [Wed, 17 May 2023 08:22:48 +0000 (10:22 +0200)]
mmc: zynq: Sync with upstream DT binding

Versal NET is not in production yet that's why no need to keep backward
compatible with previously used compatible string.

Link: https://lore.kernel.org/r/20230403102551.3763054-2-sai.krishna.potthuri@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/0d355f4fbaf6a3521d41ee43f17dde2515ff7ab7.1684311766.git.michal.simek@amd.com
13 months agoarm64: versal-net: Add support for SPP production version
Michal Simek [Wed, 17 May 2023 08:21:32 +0000 (10:21 +0200)]
arm64: versal-net: Add support for SPP production version

Production version restarting platform version field from 0 that's why add
new calculation to be able to use different DT for these platforms.
Requested DT names for production silicons for IPP/SPP and EMU platform are
versal-net-ipp-rev2.0.dts and versal-net-emu-rev2.0.dts.
If platform version increase numbers revision can be even higher.
As of today platform version is 2 that's why expected is rev2.2.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/691e166b3cf2643d7edf482bda5500163eecb35a.1684311689.git.michal.simek@amd.com
13 months agocmd: sf/nand: Print and return failure when 0 length is passed
Ashok Reddy Soma [Tue, 16 May 2023 11:52:36 +0000 (05:52 -0600)]
cmd: sf/nand: Print and return failure when 0 length is passed

For sf commands, when '0' length is passed for erase, update, write or
read, there might be undesired results. Ideally '0' length means nothing to
do.

So print 'ERROR: Invalid size 0' and return cmd failure when length '0' is
passed to sf commands. Same thing applies for nand commands also.

Example:

ZynqMP> sf erase 0 0
ERROR: Invalid size 0
ZynqMP> sf write 10000 0 0
ERROR: Invalid size 0
ZynqMP> sf read 10000 0 0
ERROR: Invalid size 0
ZynqMP> sf update 1000 10000 0
ERROR: Invalid size 0
ZynqMP>

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230516115236.22458-1-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agomach-zynqmp: handoff: Add missing header
Algapally Santosh Sagar [Fri, 19 May 2023 11:38:16 +0000 (17:08 +0530)]
mach-zynqmp: handoff: Add missing header

Add missing prototype to fix the sparse warning.
warning: no previous prototype for 'bl2_plat_get_bl31_params'
[-Wmissing-prototypes]

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/20230519113816.22083-3-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agoclk: zynqmp: Add fallthrough statement in the switch case
Algapally Santosh Sagar [Fri, 19 May 2023 11:38:15 +0000 (17:08 +0530)]
clk: zynqmp: Add fallthrough statement in the switch case

Add fallthrough statement in switch case to fix the sparse warning.
In function 'zynqmp_clk_get_rate': warning: this statement may
fall through [-Wimplicit-fallthrough=]

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/20230519113816.22083-2-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agoarm64: versal-net: Detect and display bootmode
Ashok Reddy Soma [Tue, 16 May 2023 14:47:53 +0000 (08:47 -0600)]
arm64: versal-net: Detect and display bootmode

Read boodmode register using versal_net_get_bootmode() in board_late_init
and prepare corresponding distro boot command sequence based on it.

versal_net_get_bootmode() will be changed to use smc calls later, but
for now directly reads the register.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Link: https://lore.kernel.org/r/20230516144753.30869-1-ashok.reddy.soma@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agoMerge branch 'master_reserved' of https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Sun, 11 Jun 2023 20:23:32 +0000 (16:23 -0400)]
Merge branch 'master_reserved' of https://source.denx.de/u-boot/custodians/u-boot-sh

13 months agoMerge branch 'next_net/phy_connect_dev' of https://source.denx.de/u-boot/custodians...
Tom Rini [Sat, 10 Jun 2023 18:08:00 +0000 (14:08 -0400)]
Merge branch 'next_net/phy_connect_dev' of https://source.denx.de/u-boot/custodians/u-boot-sh into next

13 months agoMerge branch 'next_mtd/rpc-spi' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Sat, 10 Jun 2023 18:07:49 +0000 (14:07 -0400)]
Merge branch 'next_mtd/rpc-spi' of https://source.denx.de/u-boot/custodians/u-boot-sh into next

13 months agorenesas: rcar: Apply ATF overlay for reserved-memory
Detlev Casanova [Fri, 9 Jun 2023 15:19:08 +0000 (11:19 -0400)]
renesas: rcar: Apply ATF overlay for reserved-memory

The function fdtdec_board_setup() is called early and adds the overlay
from ATF to the u-boot device tree. That is necessary so that u-boot
doesn't use reserved memory.

Linux also needs to know about that reserved memory so the overlay from
ATF needs to be aplied on the linux device tree as well.

This commit makes sure that the ATF overlay is applied to both device trees.

Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Adam Ford <aford173@gmail.com>
13 months agoARM: renesas: Enable DM_ETH_PHY and SMSC PHY driver
Marek Vasut [Mon, 29 May 2023 18:28:54 +0000 (20:28 +0200)]
ARM: renesas: Enable DM_ETH_PHY and SMSC PHY driver

The board comes with SMSC LAN8710A PHY, enable matching driver.
Enable DM_ETH_PHY in the process to start using DM drivers more.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Michal Simek <michal.simek@amd.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
13 months agoARM: dts: renesas: Add compatible properties to LAN8710A Ethernet PHYs
Geert Uytterhoeven [Thu, 9 Sep 2021 08:49:40 +0000 (10:49 +0200)]
ARM: dts: renesas: Add compatible properties to LAN8710A Ethernet PHYs

Add compatible values to Ethernet PHY subnodes representing SMSC
LAN8710A PHYs on RZ/A1 and R-Mobile A1 boards.  This allows software to
identify the PHY model at any time, regardless of the state of the PHY
reset line.

Ported from Linux kernel commit 1c65ef1c71e473c00f2a7a1b9c140f0b4862f282 .

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/247dc2074dae149af07b6d014985ad30eb362eda.1631174218.git.geert+renesas@glider.be
---
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Michal Simek <michal.simek@amd.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
13 months agonet: sh_eth: Fix RX error handling
Valentine Barshak [Tue, 30 May 2023 22:51:31 +0000 (00:51 +0200)]
net: sh_eth: Fix RX error handling

In case RX error occurs, and the RD_RFE bit is set, the descriptor
is never returned back to the queue. Make sh_eth_recv_start return
zero length in this case so that the descriptor can be released
and pushed back to the list. Also return the more appropriate
-EAGAIN instead of -EINVAL if the descriptor is not ready yet.

Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
13 months agonet: sh_eth: Workaround cache issues
Valentine Barshak [Tue, 30 May 2023 22:51:30 +0000 (00:51 +0200)]
net: sh_eth: Workaround cache issues

U-Boot writes to RX packets when constructing replies.
This can cause stale cached data to be written to RX
buffer while we're receiving a packet. This causes RX
packet corruption because we invalidate the cache right
before processing the packet. Invalidate packet buffer
cache when preparing RX descriptor as well. This seems
to fix RX packet drops with high RX traffic.

While at it flush the descriptors right before enabling
RX/TX in sh_eth_tx_desc_init/sh_eth_rx_desc_init callbacks
when they are ready instead of flushing after allocation.

Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
13 months agonet: sh_eth: Drop reset GPIO handling in favor of common code
Marek Vasut [Tue, 30 May 2023 22:51:29 +0000 (00:51 +0200)]
net: sh_eth: Drop reset GPIO handling in favor of common code

The common code is now capable of handling reset GPIO associated
with PHY. Drop the local ad-hoc code in favor of common code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
13 months agonet: ravb: Drop reset GPIO handling in favor of common code
Marek Vasut [Tue, 30 May 2023 22:51:28 +0000 (00:51 +0200)]
net: ravb: Drop reset GPIO handling in favor of common code

The common code is now capable of handling reset GPIO associated
with PHY. Drop the local ad-hoc code in favor of common code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
13 months agonet: phy: Handle reset-delay-us/reset-post-delay-us properties
Marek Vasut [Tue, 30 May 2023 22:51:27 +0000 (00:51 +0200)]
net: phy: Handle reset-delay-us/reset-post-delay-us properties

These two properties are used by various DTs in place of
current reset-assert-us/reset-deassert-us , handle both .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
13 months agonet: phy: Bind ETH_PHY uclass driver to each new PHY
Marek Vasut [Tue, 30 May 2023 22:51:26 +0000 (00:51 +0200)]
net: phy: Bind ETH_PHY uclass driver to each new PHY

In case a new PHY is created and DM_ETH_PHY is enabled, bind a
generic PHY driver from ETH_PHY uclass to the PHY to have a
matching DM representation of that PHY.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
13 months agonet: phy: Unpublish phy_connect_dev()
Marek Vasut [Tue, 30 May 2023 22:51:25 +0000 (00:51 +0200)]
net: phy: Unpublish phy_connect_dev()

The phy_connect_dev() is legacy API, now that there are no users,
make it internal to phy.c and unpublish it from headers.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
13 months agonet: sunxi_emac: Switch to new U-Boot PHY API
Marek Vasut [Tue, 30 May 2023 22:51:24 +0000 (00:51 +0200)]
net: sunxi_emac: Switch to new U-Boot PHY API

Use new U-Boot phy_connect() API which also supports fixed PHYs.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
13 months agonet: sh_eth: Switch to new U-Boot PHY API
Marek Vasut [Tue, 30 May 2023 22:51:23 +0000 (00:51 +0200)]
net: sh_eth: Switch to new U-Boot PHY API

Use new U-Boot phy_connect() API which also supports fixed PHYs.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
13 months agonet: pch_gbe: Switch to new U-Boot PHY API
Marek Vasut [Tue, 30 May 2023 22:51:22 +0000 (00:51 +0200)]
net: pch_gbe: Switch to new U-Boot PHY API

Use new U-Boot phy_connect() API which also supports fixed PHYs.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
13 months agonet: ethoc: Switch to new U-Boot PHY API
Marek Vasut [Tue, 30 May 2023 22:51:21 +0000 (00:51 +0200)]
net: ethoc: Switch to new U-Boot PHY API

Use new U-Boot phy_connect() API which also supports fixed PHYs.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
13 months agonet: ave: Switch to new U-Boot PHY API
Marek Vasut [Tue, 30 May 2023 22:51:20 +0000 (00:51 +0200)]
net: ave: Switch to new U-Boot PHY API

Use new U-Boot phy_connect() API which also supports fixed PHYs.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
13 months agonet: altera_tsa: Switch to new U-Boot PHY API
Marek Vasut [Tue, 30 May 2023 22:51:19 +0000 (00:51 +0200)]
net: altera_tsa: Switch to new U-Boot PHY API

Use new U-Boot phy_connect() API which also supports fixed PHYs.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
13 months agonet: eth-phy: staticize eth_phy_reset()
Marek Vasut [Tue, 30 May 2023 22:51:18 +0000 (00:51 +0200)]
net: eth-phy: staticize eth_phy_reset()

The eth_phy_reset() is not used outside of this file, staticize it.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
13 months agomtd: spi: renesas: Add 4 bytes address mode support
Cong Dang [Wed, 24 Aug 2022 23:06:54 +0000 (06:06 +0700)]
mtd: spi: renesas: Add 4 bytes address mode support

This patch adds 4-byte address mode support. Because traditional access
based on FIFO/shift register, it's complex to specify information like
opcode, address length, dummy bytes etc to flash. Replace the traditional
access by spi-mem layer which is essential to make 4-byte address mode
support possible.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
13 months agomtd: spi: renesas: Add R-Car Gen4 support
Hai Pham [Thu, 5 Aug 2021 07:38:26 +0000 (14:38 +0700)]
mtd: spi: renesas: Add R-Car Gen4 support

Support RPC SPI on R-Car Gen4 R8A779F0 S4 and R8A779G0 V4H SoCs.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Squash S4 and V4H patches, fix brackets around STRTIM2]

13 months agomtd: spi: renesas: Enable SPI_FLASH_SFDP_SUPPORT
Hai Pham [Thu, 25 Aug 2022 03:32:56 +0000 (10:32 +0700)]
mtd: spi: renesas: Enable SPI_FLASH_SFDP_SUPPORT

Enable support for parsing and auto discovery of parameters for
SPI NOR flashes using Serial Flash Discoverable Parameters (SFDP)
tables as per JESD216 standard.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> # Make SFDP the default unconditionally
13 months agomtd: spi: renesas: Extract strobe delay setting code into separate function
Hai Pham [Mon, 16 Aug 2021 02:26:36 +0000 (09:26 +0700)]
mtd: spi: renesas: Extract strobe delay setting code into separate function

Move strobe delay setting code into extra function and reflect the latest
setting in datasheet (R-Car Gen3 v2.20, R-Car V3U v0.50).
i.e. STRTIM[2:0] should be set to 110 (RCar M3-W) or 111 (Other products)

This is also a preparation for new R-Car Gen4 SoC which has 4-bits STRTIM

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> # Fix for RZ/A1
13 months agoMerge branch '2023-06-09-fwu-updates' into next
Tom Rini [Sat, 10 Jun 2023 00:35:02 +0000 (20:35 -0400)]
Merge branch '2023-06-09-fwu-updates' into next

Two sets of FWU updates from Jassi Brar.  First:
The patchset reduces ~400 lines of code, while keeping the functionality same and making
meta-data operations much faster (by using cached structures).

Issue:
meta-data copies (primary and secondary) are being handled by the
backend/storage layer instead of the common core in fwu.c (as also noted by
Ilias)  that is, gpt_blk.c manages meta-data and similarly raw_mtd.c will have
to do the same when it arrives. The code could by make smaller, cleaner and
optimised.

Basic idea:
Introduce  .read_mdata() and .write_mdata() in fwu_mdata_ops  that simply
read/write meta-data copy. The core code takes care of integrity and redundancy
of the meta-data, as a result we can get rid of every other callback
.get_mdata() .update_mdata() .get_mdata_part_num()  .read_mdata_partition()
.write_mdata_partition() and the corresponding wrapper functions thereby making
the code 100s of LOC smaller.

Get rid of fwu_check_mdata_validity() and fwu_mdata_check() which expected
underlying layer to manage and verify mdata copies.
Implement  fwu_get_verified_mdata(struct fwu_mdata *mdata) public function that
reads, verifies and, if needed, fixes the meta-data copies.

Verified copy of meta-data is now cached as 'g_mdata' in fwu.c, which avoids
multiple low-level expensive read and parse calls.
gpt meta-data partition numbers are now cached in gpt_blk.c, so that we don't
have to do expensive part_get_info() and uid ops.

And second:
Introduce support for mtd backed storage for FWU feature and enable it on
Synquacer platform based DeveloperBox.

13 months agofwu: provide default fwu_plat_get_bootidx
Jassi Brar [Wed, 31 May 2023 05:30:06 +0000 (00:30 -0500)]
fwu: provide default fwu_plat_get_bootidx

Just like fwu_plat_get_update_index, provide a default/weak
implementation of fwu_plat_get_bootidx. So that most platforms
wouldn't have to re-implement the likely case.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
13 months agofwu: DeveloperBox: add support for FWU
Jassi Brar [Wed, 31 May 2023 05:29:56 +0000 (00:29 -0500)]
fwu: DeveloperBox: add support for FWU

Add code to support FWU_MULTI_BANK_UPDATE.
The platform does not have gpt-partition storage for
Banks and MetaData, rather it used SPI-NOR backed
mtd regions for the purpose.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
13 months agoconfig: developerbox: move to new flash layout and boot flow
Jassi Brar [Wed, 31 May 2023 05:29:41 +0000 (00:29 -0500)]
config: developerbox: move to new flash layout and boot flow

Towards enabling FWU and supporting new firmware layout in NOR flash,
make u-boot PIC and adjust uboot env offset in flash.

Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
13 months agodt: fwu: developerbox: enable fwu banks and mdata regions
Jassi Brar [Wed, 31 May 2023 05:29:32 +0000 (00:29 -0500)]
dt: fwu: developerbox: enable fwu banks and mdata regions

Specify Bank-0/1 and fwu metadata mtd regions.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
13 months agotools: Add mkfwumdata tool for FWU metadata image
Masami Hiramatsu [Wed, 31 May 2023 05:29:24 +0000 (00:29 -0500)]
tools: Add mkfwumdata tool for FWU metadata image

Add 'mkfwumdata' tool to generate FWU metadata image for the meta-data
partition to be used in A/B Update imeplementation.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
13 months agoFWU: Add FWU metadata access driver for MTD storage regions
Masami Hiramatsu [Wed, 31 May 2023 05:29:14 +0000 (00:29 -0500)]
FWU: Add FWU metadata access driver for MTD storage regions

In the FWU Multi Bank Update feature, the information about the
updatable images is stored as part of the metadata, on a separate
region. Add a driver for reading from and writing to the metadata
when the updatable images and the metadata are stored on a raw
MTD region.
The code is divided into core under drivers/fwu-mdata/ and some helper
functions clubbed together under lib/fwu_updates/

Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
13 months agotest: dm: fwu: fix for the updated api
Jassi Brar [Mon, 6 Mar 2023 23:18:58 +0000 (17:18 -0600)]
test: dm: fwu: fix for the updated api

fwu_get_mdata() no more requires 'dev' argument and
fwu_check_mdata_validity() has been rendered useless and dropped.
Fix the test cases to work with aforementioned changes.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Sughosh Ganu <sughosh.ganu@linaro.org>
13 months agofwu: rename fwu_get_verified_mdata to fwu_get_mdata
Jassi Brar [Mon, 6 Mar 2023 23:18:48 +0000 (17:18 -0600)]
fwu: rename fwu_get_verified_mdata to fwu_get_mdata

fwu_get_mdata() sounds more appropriate than fwu_get_verified_mdata()

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Sughosh Ganu <sughosh.ganu@linaro.org>
13 months agofwu: meta-data: switch to management by common code
Jassi Brar [Mon, 6 Mar 2023 23:18:41 +0000 (17:18 -0600)]
fwu: meta-data: switch to management by common code

The common code can now read, verify and fix meta-data copies
while exposing one consistent structure to users.
 Only the .read_mdata() and .write_mdata() callbacks of fwu_mdata_ops
are needed. Get rid of .get_mdata() .update_mdata() .get_mdata_part_num()
.read_mdata_partition() and .write_mdata_partition() and also the
corresponding wrapper functions.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Sughosh Ganu <sughosh.ganu@linaro.org>
13 months agofwu: gpt: implement read_mdata and write_mdata callbacks
Jassi Brar [Mon, 6 Mar 2023 23:18:35 +0000 (17:18 -0600)]
fwu: gpt: implement read_mdata and write_mdata callbacks

Moving towards using common code for meta-data management,
implement the read/write mdata hooks.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Sughosh Ganu <sughosh.ganu@linaro.org>
13 months agofwu: move meta-data management in core
Jassi Brar [Mon, 6 Mar 2023 23:18:28 +0000 (17:18 -0600)]
fwu: move meta-data management in core

Instead of each i/f having to implement their own meta-data verification
and storage, move the logic in common code. This simplifies the i/f code
much simpler and compact.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Sughosh Ganu <sughosh.ganu@linaro.org>
13 months agofwu: gpt: use cached meta-data partition numbers
Jassi Brar [Mon, 6 Mar 2023 23:18:21 +0000 (17:18 -0600)]
fwu: gpt: use cached meta-data partition numbers

Use cached values and avoid parsing and scanning through partitions
everytime for meta-data partitions because they can't change after bootup.

Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Tested-by: Sughosh Ganu <sughosh.ganu@linaro.org>
13 months agodt/bindings: fwu-mdata-mtd: drop changes outside FWU
Jassi Brar [Mon, 6 Mar 2023 23:18:14 +0000 (17:18 -0600)]
dt/bindings: fwu-mdata-mtd: drop changes outside FWU

Any requirement of FWU should not require changes to bindings
of other subsystems. For example, for mtd-backed storage we
can do without requiring 'fixed-partitions' children to also
carry 'uuid', a property which is non-standard and not in the
bindings.

 There exists no code yet, so we can change the fwu-mtd bindings
to contain all properties within the fwu-mdata node.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Sughosh Ganu <sughosh.ganu@linaro.org>
13 months agoMerge branch 'next_soc/v3x' of https://source.denx.de/u-boot/custodians/u-boot-sh...
Tom Rini [Fri, 9 Jun 2023 14:30:26 +0000 (10:30 -0400)]
Merge branch 'next_soc/v3x' of https://source.denx.de/u-boot/custodians/u-boot-sh into next

13 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Thu, 8 Jun 2023 22:23:06 +0000 (18:23 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

13 months agoMerge branch 'master_soc/fixes' of https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Thu, 8 Jun 2023 22:22:32 +0000 (18:22 -0400)]
Merge branch 'master_soc/fixes' of https://source.denx.de/u-boot/custodians/u-boot-sh

13 months agoARM: renesas: Add R8A77980 V3HSK board and CPLD code
Valentine Barshak [Tue, 23 Apr 2019 20:44:57 +0000 (23:44 +0300)]
ARM: renesas: Add R8A77980 V3HSK board and CPLD code

Add board code for the R8A77980 V3HSK board.
Add CPLD sysreset driver to the R-Car V3H SK board.
Extracted from a larger patch by Valentine Barshak.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Tam Nguyen <tam.nguyen.xa@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Sync configs and board code with V3H Condor, squash CPLD driver in]

13 months agoARM: dts: renesas: Add R8A77980 V3HSK DTs
Valentine Barshak [Tue, 23 Apr 2019 20:44:57 +0000 (23:44 +0300)]
ARM: dts: renesas: Add R8A77980 V3HSK DTs

Import R8A77980 V3HSK DTs from Linux 6.1.31,
commit d2869ace6eeb ("Linux 6.1.31").
Extracted from a larger patch by Valentine Barshak.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Tam Nguyen <tam.nguyen.xa@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> # Sync with 6.1.31
13 months agoARM: renesas: Add R8A77970 V3MSK board and CPLD code
Valentine Barshak [Tue, 23 Apr 2019 20:44:57 +0000 (23:44 +0300)]
ARM: renesas: Add R8A77970 V3MSK board and CPLD code

Add board code for the R8A77970 V3MSK board.
Add CPLD sysreset driver to the R-Car V3M SK board.
Extracted from a larger patch by Valentine Barshak.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Tam Nguyen <tam.nguyen.xa@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Sync configs and board code with V3M Eagle, squash CPLD driver in]

13 months agoARM: dts: renesas: Add R8A77970 V3MSK DTs
Valentine Barshak [Tue, 23 Apr 2019 20:44:57 +0000 (23:44 +0300)]
ARM: dts: renesas: Add R8A77970 V3MSK DTs

Import R8A77970 V3MSK DTs from Linux 6.1.31,
commit d2869ace6eeb ("Linux 6.1.31").
Extracted from a larger patch by Valentine Barshak.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Tam Nguyen <tam.nguyen.xa@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> # Sync with 6.1.31
13 months agoARM: rmobile: Introduce weak default board_init()
Marek Vasut [Wed, 31 May 2023 18:33:04 +0000 (20:33 +0200)]
ARM: rmobile: Introduce weak default board_init()

Introduce weak default board_init() in rcar-common/common.c , which
allows complete removal of ebisu.c and condor.c at the same time .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
13 months agoARM: rmobile: Drop eagle.h config of R8A77970 V3M Eagle board
Marek Vasut [Wed, 31 May 2023 17:53:04 +0000 (19:53 +0200)]
ARM: rmobile: Drop eagle.h config of R8A77970 V3M Eagle board

The eagle.h is now empty and only includes rcar-gen3-common.h .
Use rcar-gen3-common.h directly instead and drop eagle.h .
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
13 months agoARM: rmobile: Factor out common R-Car V3M/V3H board code
Marek Vasut [Wed, 31 May 2023 18:24:34 +0000 (20:24 +0200)]
ARM: rmobile: Factor out common R-Car V3M/V3H board code

Pull common board initialization code from V3M Eagle board
into rcar-common/v3-common.c so it can be re-used by other
V3M/V3H boards.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
13 months agoARM: rmobile: Reduce R-Car V3H Condor header usage
Marek Vasut [Wed, 31 May 2023 18:15:47 +0000 (20:15 +0200)]
ARM: rmobile: Reduce R-Car V3H Condor header usage

There is no need to pull in all those headers as the board file is
basically empty. Drop them all.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>