]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
11 months agopmic: qcom: dont use dev_read_addr to get USID
Caleb Connolly [Tue, 5 Dec 2023 13:46:54 +0000 (13:46 +0000)]
pmic: qcom: dont use dev_read_addr to get USID

Linux DTs stuff a value indicating if the USID is a USID or a GSID in the
reg property, the Linux SPMI driver then reads the two address cells
separately. U-boot's dev_read_addr() doesn't know how to handle this, so
use ofnode_read_u32_index() to get just the USID.

The Qcom pmic driver doesn't have support for GSID handling, so just
ignore the second value for now.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agospmi: msm: fix register range names
Caleb Connolly [Tue, 5 Dec 2023 13:46:53 +0000 (13:46 +0000)]
spmi: msm: fix register range names

The core and chnl register ranges were swapped on SDM845. Fix it, and
fetch the register ranges by name instead of by index.

Drop the cosmetic "version" variable and clean up the debug logging.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agogpio: qcom_pmic: drop gpio-count property
Caleb Connolly [Tue, 5 Dec 2023 13:46:52 +0000 (13:46 +0000)]
gpio: qcom_pmic: drop gpio-count property

This property is not part of the dt bindings and all boards use the new
gpio-ranges property instead. Drop support for this.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agodts: qcom: adjust pmic gpio to use upstream bindings
Caleb Connolly [Tue, 5 Dec 2023 13:46:51 +0000 (13:46 +0000)]
dts: qcom: adjust pmic gpio to use upstream bindings

Use the upstream gpio-ranges property instead of gpio-count, and drop
the bank-name property for Qualcomm boards.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agogpio: qcom_pmic: support upstream DT
Caleb Connolly [Tue, 5 Dec 2023 13:46:50 +0000 (13:46 +0000)]
gpio: qcom_pmic: support upstream DT

Upstream uses the gpio-ranges property to define the number of GPIOs,
support for parsing this when gpio-count is unspecified

Additionally, drop the bank-name property as it isn't used in upstream,
and we can just hardcode the bank name instead.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agogpio: qcom_pmic: drop pon GPIO driver
Caleb Connolly [Tue, 5 Dec 2023 13:46:49 +0000 (13:46 +0000)]
gpio: qcom_pmic: drop pon GPIO driver

Remove the (now unused) GPIO driver for the power and resin buttons on
the PMIC.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agomach-snapdragon: switch to PMIC button driver
Caleb Connolly [Tue, 5 Dec 2023 13:46:48 +0000 (13:46 +0000)]
mach-snapdragon: switch to PMIC button driver

The PMIC button driver is a much better representation of the hardware
here, adjust the boards to use upstream DT and the PMIC button driver
instead of exposing the buttons as GPIOs and relying on the GPIO-button
driver.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agobutton: qcom-pmic: introduce Qualcomm PMIC button driver
Caleb Connolly [Tue, 5 Dec 2023 13:46:47 +0000 (13:46 +0000)]
button: qcom-pmic: introduce Qualcomm PMIC button driver

Qualcomm PMICs include a "pon" function which handles two buttons, the
power button and "resin" button (usually volume down). Introduce a new
driver following upstream Linux DT to enable these and map them to Enter
and Down respectively to enable use in boot menus.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agogpio: qcom_pmic: fix silent dev_read_addr downcast
Caleb Connolly [Tue, 5 Dec 2023 13:46:46 +0000 (13:46 +0000)]
gpio: qcom_pmic: fix silent dev_read_addr downcast

priv->pid is uint32_t, but dev_read_addr() returns a uint64_t on arm64,
with the upper bits being used for error codes. Do error checking before
downcasting to u32 to prevent errors being silently ignored.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agoserial: msm-geni: handle devm_clk_get() errors
Caleb Connolly [Tue, 14 Nov 2023 12:51:12 +0000 (12:51 +0000)]
serial: msm-geni: handle devm_clk_get() errors

devm_clk_get() returns an ERR_PTR on failure, not null. Fix the check to
avoid the board crashing when the clock isn't available.

Additionally, add the missing error handling for this function.

Fixes: 324df15a292e ("serial: qcom: add support for GENI serial driver")
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agoserial: msm-geni: don't rely on parent misc device
Caleb Connolly [Tue, 14 Nov 2023 12:51:11 +0000 (12:51 +0000)]
serial: msm-geni: don't rely on parent misc device

commit 1b15483deb3f ("misc: add Qualcomm GENI SE QUP device driver")
introduced support for platform-specific oversampling values, necessary
to configure the UART clocks on all platforms at runtime. However it
relies in probing a parent device. Despite the DM_FLAG_PRE_RELOC flag,
this is not done consistently during boot.

Instead, take another approach by relying on ofnode_ helpers to read the
serial engine base address and do the read directly. This fixes early
UART on boards with a non-default oversampling rate.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agomsm_gpio: use unsigned int
Caleb Connolly [Tue, 14 Nov 2023 12:55:43 +0000 (12:55 +0000)]
msm_gpio: use unsigned int

Replaces the uses of "unsigned" with "unsigned int".

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agopinctrl: qcom: make compatible with linux DTs
Caleb Connolly [Tue, 14 Nov 2023 12:55:42 +0000 (12:55 +0000)]
pinctrl: qcom: make compatible with linux DTs

The pinctrl and GPIO drivers are currently heavily incompatible with
upstream. Most Qualcomm pinctrl blocks feature "tiles" of pins, each at
it's own address. Introduce support for these by allowing the soc driver
to specify per-pin register offsets similarly to the Linux driver.

Adjust the GPIO driver to handle these too, and finally enable support
for all pins with the same numbering as used in Linux.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agopinctrl: qcom: move ipq4019 driver from mach-ipq40xx
Caleb Connolly [Tue, 14 Nov 2023 12:55:41 +0000 (12:55 +0000)]
pinctrl: qcom: move ipq4019 driver from mach-ipq40xx

Drop the duplicated pinctrl-snapdragon driver from mach-ipq40xx and add
it to drivers/pinctrl/qcom.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agopinctrl: qcom: move out of mach-snapdragon
Caleb Connolly [Tue, 14 Nov 2023 12:55:40 +0000 (12:55 +0000)]
pinctrl: qcom: move out of mach-snapdragon

Move the Qualcomm pinctrl drivers out of mach-snapdragon and over to the
rest of the pinctrl drivers, adjust the drivers so that support for each
platform can be enabled/disabled individually and introduce platform
specific configuration options.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agoclk/qcom: fix rcg divider value
Caleb Connolly [Tue, 7 Nov 2023 12:41:05 +0000 (12:41 +0000)]
clk/qcom: fix rcg divider value

The RCG divider field takes a value of (2*h - 1) where h is the divisor.
This allows fractional dividers to be supported by calculating them at
compile time using a macro.

However, the clk_rcg_set_rate_mnd() function was also performing the
calculation. Clean this all up and consistently use the F() macro to
calculate these at compile time and properly support fractional divisors.

Additionally, improve clk_bcr_update() to timeout with a warning rather
than hanging the board, and make the freq_tbl struct and helpers common
so that they can be reused by future platforms.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agoclk/qcom: add mnd_width to clk_rcg_set_rate_mnd()
Caleb Connolly [Tue, 7 Nov 2023 12:41:04 +0000 (12:41 +0000)]
clk/qcom: add mnd_width to clk_rcg_set_rate_mnd()

This property is needed on some platforms to ensure that only the
relevant bits are set in the M/N/D registers.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agoclk/qcom: use function pointers for enable and set_rate
Caleb Connolly [Tue, 7 Nov 2023 12:41:03 +0000 (12:41 +0000)]
clk/qcom: use function pointers for enable and set_rate

Currently, it isn't possible to build clock drivers for more than one
platform due to how the msm_enable() and msm_set_rate() callbacks are
implemented.

Extend qcom_clk_data to include function pointers for these and convert
all platforms to use them.

Previously, clock drivers relied on include/configs/<board.h> to include the
board specific sysmap header, however as most of the header contents are clock
driver related, import the contents directly into each clock driver and
remove the header. The only exception here is the dragonboard820c board file
which includes some pinctrl macros, those are also inlined.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
[caleb: remove additional sysmap-sdm845.h mention]

11 months agoclk/qcom: sdm845: add register map for simple gate clocks
Caleb Connolly [Tue, 7 Nov 2023 12:41:02 +0000 (12:41 +0000)]
clk/qcom: sdm845: add register map for simple gate clocks

Many gate clocks can be enabled with a single register write, add support
for defining these simple gate clocks and add the ones found on SDM845.

While we're here, inline clk_init_uart() into msm_set_rate().

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agoclk/qcom: handle resets and clocks in one device
Konrad Dybcio [Tue, 7 Nov 2023 12:41:01 +0000 (12:41 +0000)]
clk/qcom: handle resets and clocks in one device

Qualcomm's clock controller blocks actually do much more than it
says on the tin.. They provide clocks, resets and power domains.
Currently, U-Boot requires one to spawn 2 separate devices for
controlling clocks and resets, both spanning the same register space.
Refactor the code to make it work with just a single DT node, making
it compatible with upstream Linux bindings and dropping the dedicated
reset driver in favour of including it in the clock driver.

Heavily inspired by Renesas code for a similar hw block.

[caleb: moved drivers to clk/qcom, added reset driver and adjusted bind
logic. Imported qcom,gcc-ipq4019.h from Linux]

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agoclk/qcom: move ipq4019 driver from mach-ipq40xx
Caleb Connolly [Tue, 7 Nov 2023 12:41:00 +0000 (12:41 +0000)]
clk/qcom: move ipq4019 driver from mach-ipq40xx

This driver is just a stub, but it's necessary to support the upcoming
reset driver changes.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agoclk/qcom: move from mach-snapdragon
Caleb Connolly [Tue, 7 Nov 2023 12:40:59 +0000 (12:40 +0000)]
clk/qcom: move from mach-snapdragon

Clock drivers don't belong here, move them to the right place and
declutter mach-snapdragon a bit.

To de-couple these drivers from specific "target" platforms, add
additional config options to enable each clock driver gated behind a
common CLK_QCOM option and enable them by default for the respective
targets. This will make future work easier as we move towards a generic
Qualcomm target.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agoMerge branch 'master-sync-dts-663' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Sun, 14 Jan 2024 23:07:49 +0000 (18:07 -0500)]
Merge branch 'master-sync-dts-663' of https://source.denx.de/u-boot/custodians/u-boot-sh

11 months agoARM: dts: renesas: Synchronize R-Car R8A779F0 S4 DTs with Linux 6.6.3
Marek Vasut [Sun, 3 Dec 2023 13:15:24 +0000 (14:15 +0100)]
ARM: dts: renesas: Synchronize R-Car R8A779F0 S4 DTs with Linux 6.6.3

Synchronize R-Car R8A779F0 S4 DTs with Linux 6.6.3,
commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
11 months agoARM: dts: renesas: Synchronize R-Car R8A77990 E3 DTs with Linux 6.6.3
Marek Vasut [Sun, 3 Dec 2023 13:15:23 +0000 (14:15 +0100)]
ARM: dts: renesas: Synchronize R-Car R8A77990 E3 DTs with Linux 6.6.3

Synchronize R-Car R8A77990 E3 DTs with Linux 6.6.3,
commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
11 months agoARM: dts: renesas: Synchronize R-Car R8A77970 V3M DTs with Linux 6.6.3
Marek Vasut [Sun, 3 Dec 2023 13:15:22 +0000 (14:15 +0100)]
ARM: dts: renesas: Synchronize R-Car R8A77970 V3M DTs with Linux 6.6.3

Synchronize R-Car R8A77970 V3M DTs with Linux 6.6.3,
commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
11 months agoARM: dts: renesas: Synchronize R-Car R8A7792 V2H DTs with Linux 6.6.3
Marek Vasut [Sun, 3 Dec 2023 13:15:21 +0000 (14:15 +0100)]
ARM: dts: renesas: Synchronize R-Car R8A7792 V2H DTs with Linux 6.6.3

Synchronize R-Car R8A7792 V2H DTs with Linux 6.6.3,
commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
11 months agoclk: renesas: Synchronize RZ R8A774E1 RZ/G2H clock tables with Linux 6.6.3
Marek Vasut [Sun, 3 Dec 2023 13:15:20 +0000 (14:15 +0100)]
clk: renesas: Synchronize RZ R8A774E1 RZ/G2H clock tables with Linux 6.6.3

Synchronize RZ R8A774E1 RZ/G2H clock tables with Linux 6.6.3,
commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
11 months agoclk: renesas: Synchronize RZ R8A774C0 RZ/G2E clock tables with Linux 6.6.3
Marek Vasut [Sun, 3 Dec 2023 13:15:19 +0000 (14:15 +0100)]
clk: renesas: Synchronize RZ R8A774C0 RZ/G2E clock tables with Linux 6.6.3

Synchronize RZ R8A774C0 RZ/G2E clock tables with Linux 6.6.3,
commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
11 months agoclk: renesas: Synchronize RZ R8A774B1 RZ/G2N clock tables with Linux 6.6.3
Marek Vasut [Sun, 3 Dec 2023 13:15:18 +0000 (14:15 +0100)]
clk: renesas: Synchronize RZ R8A774B1 RZ/G2N clock tables with Linux 6.6.3

Synchronize RZ R8A774B1 RZ/G2N clock tables with Linux 6.6.3,
commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
11 months agoclk: renesas: Synchronize RZ R8A774A1 RZ/G2M clock tables with Linux 6.6.3
Marek Vasut [Sun, 3 Dec 2023 13:15:17 +0000 (14:15 +0100)]
clk: renesas: Synchronize RZ R8A774A1 RZ/G2M clock tables with Linux 6.6.3

Synchronize RZ R8A774A1 RZ/G2M clock tables with Linux 6.6.3,
commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
11 months agoclk: renesas: Synchronize R-Car R8A77995 D3 clock tables with Linux 6.6.3
Marek Vasut [Sun, 3 Dec 2023 13:15:16 +0000 (14:15 +0100)]
clk: renesas: Synchronize R-Car R8A77995 D3 clock tables with Linux 6.6.3

Synchronize R-Car R8A77995 D3 clock tables with Linux 6.6.3,
commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
11 months agoclk: renesas: Synchronize R-Car R8A77990 E3 clock tables with Linux 6.6.3
Marek Vasut [Sun, 3 Dec 2023 13:15:15 +0000 (14:15 +0100)]
clk: renesas: Synchronize R-Car R8A77990 E3 clock tables with Linux 6.6.3

Synchronize R-Car R8A77990 E3 clock tables with Linux 6.6.3,
commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
11 months agoclk: renesas: Synchronize R-Car R8A77965 M3-N clock tables with Linux 6.6.3
Marek Vasut [Sun, 3 Dec 2023 13:15:14 +0000 (14:15 +0100)]
clk: renesas: Synchronize R-Car R8A77965 M3-N clock tables with Linux 6.6.3

Synchronize R-Car R8A77965 M3-N clock tables with Linux 6.6.3,
commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
11 months agoclk: renesas: Synchronize R-Car R8A77960 M3-W and R8A77961 M3-W+ clock tables with...
Marek Vasut [Sun, 3 Dec 2023 13:15:13 +0000 (14:15 +0100)]
clk: renesas: Synchronize R-Car R8A77960 M3-W and R8A77961 M3-W+ clock tables with Linux 6.6.3

Synchronize R-Car R8A77960 M3-W and R8A77961 M3-W+ clock tables with Linux 6.6.3,
commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 .

Add ZG clock macro into rcar-gen3-cpg.h to cover the new clock type .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
11 months agoMerge tag 'efi-2024-04-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 14 Jan 2024 14:34:14 +0000 (09:34 -0500)]
Merge tag 'efi-2024-04-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2024-04-rc1

Documentation:

* update coreboot graphics documentation
* fix '---' rendering

UEFI:

* add missing pointer check after memory allocation in efidebug
* replace duplicate functions efi_dp_append and efi_dp_concat
* support fmp versioning for multi bank update
* avoid using dm_scan_other() in EFI app

11 months agocmd: efidebug: check pointer after memory allocation
Heinrich Schuchardt [Thu, 11 Jan 2024 08:25:35 +0000 (09:25 +0100)]
cmd: efidebug: check pointer after memory allocation

After calling efi_alloc() we must check that the return value is not NULL.

Fixes: f01c961ee34c ("cmd: efidebug: add uri device path")
Addresses-Coverity-ID: 477185 Dereference null return value
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agoefi_loader: support fmp versioning for multi bank update
Masahisa Kojima [Thu, 11 Jan 2024 05:35:40 +0000 (14:35 +0900)]
efi_loader: support fmp versioning for multi bank update

This commit stores the firmware version into the array
of fmp_state structure to support the fmp versioning
for multi bank update. The index of the array is identified
by the bank index.

This modification keeps the backward compatibility with
the existing versioning feature.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agofwu: fix fwu_get_image_index interface
Masahisa Kojima [Thu, 11 Jan 2024 05:35:39 +0000 (14:35 +0900)]
fwu: fix fwu_get_image_index interface

The capsule update uses the DFU framework for updating
storage. fwu_get_image_index() currently returns the
image_index calculated by (dfu_alt_num + 1), but this is
different from the image_index in UEFI terminology.

Since capsule update implementation calls dfu_write_by_alt
function, it is better that FWU returns the dfu_alt_num.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agoefi_loader: Clean up efi_dp_append and efi_dp_concat
Ilias Apalodimas [Mon, 8 Jan 2024 08:55:33 +0000 (10:55 +0200)]
efi_loader: Clean up efi_dp_append and efi_dp_concat

Looking back at the initrd storing functionality, we introduced three
functions, efi_dp_append_or_concatenate(), efi_dp_append/concat(). In
hindsight we could have simplified that by a lot. First of all none of
the functions append anything. They all allocate a new device path and
concatenate the contents of two device paths in one. A boolean parameter
controls the final device path -- if that's true an end node is injected
between the two device paths.

So let's rewrite this and make it a bit easier to read. Get rid of
efi_dp_append(), efi_dp_concat() and rename
efi_dp_append_or_concatenate() to efi_dp_concat(). This is far more
intuitive and the only adjustment that is needed is an extra boolean
argument on all callsites.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agodoc: fix three-dash references in reStructuredText
Grzegorz Szymaszek [Sat, 6 Jan 2024 10:36:54 +0000 (11:36 +0100)]
doc: fix three-dash references in reStructuredText

The "Sending patches" and "Patman patch manager" documents refer to the
three-dash, "---", that separates patch parts. The symbol is written in
the documentation in the same form as it is in actual patches: as three
U+002D HYPHEN-MINUS characters. When building the documentation, Sphinx
converts this symbol to a U+2014 EM DASH, that is invalid in this case.

Make the three-dash symbol a reStructuredText inline literal to prevent
its conversion; that is, enclose it in a pair of double backquotes (`).

Signed-off-by: Grzegorz Szymaszek <gszymaszek@short.pl>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
11 months agodoc: coreboot: Update stale graphics enabling instructions
Bin Meng [Thu, 4 Jan 2024 23:25:42 +0000 (07:25 +0800)]
doc: coreboot: Update stale graphics enabling instructions

With latest coreboot (e.g.: v4.22.01), the instructions to enable
graphics support has changed. Refresh the doc.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
11 months agoefi_loader: remove unused members from struct efi_disk_obj
Masahisa Kojima [Mon, 25 Dec 2023 04:43:54 +0000 (13:43 +0900)]
efi_loader: remove unused members from struct efi_disk_obj

part and dev_index in struct efi_disk_obj are not used,
let's remove it.

This commit also removes the invalid structure comment
for @dev, it does not exist.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
11 months agoefi: Avoid using dm_scan_other()
Simon Glass [Tue, 19 Dec 2023 14:27:19 +0000 (07:27 -0700)]
efi: Avoid using dm_scan_other()

This function is defined by bootstd so using it precludes using that
feature. Use the board_early_init_r() feature instead.

Nove the affected code into a new file, so that it is clear that
this relates to board init.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
11 months agoefi_loader: fix iteration of FMP protocols
Masahisa Kojima [Mon, 18 Dec 2023 09:57:41 +0000 (18:57 +0900)]
efi_loader: fix iteration of FMP protocols

If one of the FMP protocols fails when calling GetImageInfo(),
populating the ESRT ends up with failure and other FMP protocols
are not added to the ESRT. We should still add all other FMP
protocols to the ESRT.

With this commit, iteration of all FMP protocols continues
even though one of the FMP protocols fails.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agoMerge branch '2024-01-12-assorted-fixes'
Tom Rini [Fri, 12 Jan 2024 13:34:50 +0000 (08:34 -0500)]
Merge branch '2024-01-12-assorted-fixes'

- Allow defconfigs to #include files (so we can construct a defconfig
  from fragments), update phy-mtk-tphy binding, assorted test fixes,
  allow building host tools without cryptographic libraries again,
  android_ab bugfix, and make some SPL debugging cases easier.

11 months agoMakefile: Run defconfig files through the C preprocessor
Andrew Davis [Wed, 1 Nov 2023 17:05:18 +0000 (12:05 -0500)]
Makefile: Run defconfig files through the C preprocessor

This allows us to use some of the normal preprocessor directives inside
defconfig files. Such as #define and #include.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoandroid_ab: don't ignore ab_control_store return code
Alexey Romanov [Mon, 25 Dec 2023 10:22:45 +0000 (13:22 +0300)]
android_ab: don't ignore ab_control_store return code

ab_control_store() can return an error if writing to disk fails.
In this case, we have to pass the error code to the caller.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
11 months agotools: fix build without LIBCRYPTO support
Paul-Erwan Rio [Thu, 21 Dec 2023 07:26:11 +0000 (08:26 +0100)]
tools: fix build without LIBCRYPTO support

Commit cb9faa6f98ae ("tools: Use a single target-independent config to
enable OpenSSL") introduced a target-independent configuration to build
crypto features in host tools.

But since commit 2c21256b27d7 ("hash: Use Kconfig to enable hashing in
host tools and SPL") the build without OpenSSL is broken, due to FIT
signature/encryption features. Add missing conditional compilation
tokens to fix this.

Signed-off-by: Paul-Erwan Rio <paulerwan.rio@gmail.com>
Tested-by: Alexander Dahl <ada@thorsis.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agotools: kwbimage: Allow disabling build on non-mvebu platforms
Alexander Dahl [Thu, 21 Dec 2023 07:26:10 +0000 (08:26 +0100)]
tools: kwbimage: Allow disabling build on non-mvebu platforms

Some users want to build with CONFIG_TOOLS_LIBCRYPTO disabled, which in
general is possible for at least some boards.  32-bit mvebu however
requires kwbimage for building SPL, and kwbimage has a hard dependency
to host OpenSSL.

The new symbol CONFIG_TOOLS_KWBIMAGE allows disabling kwbimage build on
non-mvebu platforms, and thus building without host libcrypto from
OpenSSL.

Based on previous work and discussions, see links below.

Link: https://lore.kernel.org/u-boot/20211021093304.25399-1-pali@kernel.org/
Link: https://lore.kernel.org/u-boot/20220111153120.1276641-1-marex@denx.de/
Link: https://lore.kernel.org/u-boot/20230121154743.667253-2-paulerwan.rio@gmail.com/
Cc: Marek Vasut <marex@denx.de>
Cc: Paul-Erwan Rio <paulerwan.rio@gmail.com>
Signed-off-by: Alexander Dahl <ada@thorsis.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agotest: fs: fs-test: Move the tests to use sha256sum
Peter Robinson [Tue, 19 Dec 2023 22:01:50 +0000 (22:01 +0000)]
test: fs: fs-test: Move the tests to use sha256sum

Move the use of md5s for recording filesystem file integrity
checks to sha256 hashes as they're preferred due to being
less likely to produce clashing hashes. In the process
generalise some of the wording to use the more generic
hash term.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
11 months agoti: am335x: Remove unused linker script
Tom Rini [Tue, 19 Dec 2023 14:03:30 +0000 (09:03 -0500)]
ti: am335x: Remove unused linker script

The board specific linker script has not been used in a long time here,
remove it.

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agoarm: spl: Use separate fault handlers instead of a single common one
Csókás Bence [Tue, 19 Dec 2023 13:33:18 +0000 (14:33 +0100)]
arm: spl: Use separate fault handlers instead of a single common one

It may be necessary to set breakpoints etc. on a specific fault handler in SPL.
Add a Kconfig option to separate the different handlers into their own individual infinite loops.

Signed-off-by: Csókás Bence <csokas.bence@prolan.hu>
11 months agotest: CONFIG_UT_BOOTSTD must depend on CONFIG_BOOTSTD
Heinrich Schuchardt [Sat, 16 Dec 2023 15:46:31 +0000 (16:46 +0100)]
test: CONFIG_UT_BOOTSTD must depend on CONFIG_BOOTSTD

Building sandbox_defconfig with

    CONFIG_BOOTSTD=n
    CONFIG_UT_BOOTSTD=y

leads to an error

    /usr/bin/ld: test/cmd_ut.o:(.data.rel.cmd_ut_sub+0xc0):
    undefined reference to `do_ut_bootstd'

Add the missing dependency.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agoboot: CONFIG_CEDIT must depend on CONFIG_EXPO
Heinrich Schuchardt [Sat, 16 Dec 2023 15:38:36 +0000 (16:38 +0100)]
boot: CONFIG_CEDIT must depend on CONFIG_EXPO

Building sandbox_defconfig with

    CONFIG_CMD_CEDIT=y
    CONFIG_EXPO=n

fails with

    cmd/cedit.c:258:(.text.do_cedit_run+0x4c):
    undefined reference to `expo_apply_theme

Fix the dependencies.

Fixes: a0874dc4ac71 ("expo: Add a configuration editor")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agotest: build test/boot for CONFIG_UT_BOOTSTD=n
Heinrich Schuchardt [Sat, 16 Dec 2023 15:19:54 +0000 (16:19 +0100)]
test: build test/boot for CONFIG_UT_BOOTSTD=n

Building sandbox_defconfig with

    CONFIG_UT_BOOTSTD=n
    CONFIG_MEASURMENT=y

results in an error:

    /usr/bin/ld: test/cmd_ut.o:(.data.rel.cmd_ut_sub+0x408):
    undefined reference to `do_ut_measurement'

Fixes: 5999ea20fa42 ("test: Add sandbox TPM boot measurement")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agoboot: Support decompressing non-kernel OS images
Simon Glass [Fri, 15 Dec 2023 23:54:16 +0000 (16:54 -0700)]
boot: Support decompressing non-kernel OS images

Sometimes the kernel is built as an EFI application rather than a
binary. We still want to support compression for this case.

For arm64 the entry point is set later in the bootm_load_os() function,
since these images are typically relocated due to the 2MB-alignment
requirement of arm64 images. But since the EFI image is not in the same
format, we need to update the entry point earlier.

Set the entry point always, for kernel_noload to resolve this problem.
It should be harmless to do this always.

Signed-off-by: Simon Glass <sjg@chromium.org>
11 months agophy: phy-mtk-tphy: add properties for phy tuning
Chunfeng Yun [Wed, 13 Dec 2023 06:41:34 +0000 (14:41 +0800)]
phy: phy-mtk-tphy: add properties for phy tuning

Add properties to improve eye diagram which sometimes need adjust
some parameters of u2phy;
Add a property to tune disconnect threshold;

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
11 months agodt-bindings: phy-mtk-tphy: add properties for phy tuning
Chunfeng Yun [Wed, 13 Dec 2023 06:41:33 +0000 (14:41 +0800)]
dt-bindings: phy-mtk-tphy: add properties for phy tuning

Add properties to improve eye diagram which sometimes need adjust
some parameters of u2phy;
Add a property to tune disconnect threshold;

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
11 months agoMerge patch series "net fixes prior lwip"
Tom Rini [Thu, 11 Jan 2024 16:25:07 +0000 (11:25 -0500)]
Merge patch series "net fixes prior lwip"

Maxim Uvarov <maxim.uvarov@linaro.org> says:

Add small net fixes prior lwip patches.

11 months agoMakefile: add dtbs to clean
Maxim Uvarov [Tue, 26 Dec 2023 15:46:19 +0000 (21:46 +0600)]
Makefile: add dtbs to clean

CI test checks that generated dtb has to be cleaned up.
Use the same clean procedure as Linux top level Makefile has.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
11 months agoomap3: use device specific naming for mem_init
Maxim Uvarov [Tue, 26 Dec 2023 15:46:18 +0000 (21:46 +0600)]
omap3: use device specific naming for mem_init

Use device specific naming for functions so as to not overlap
with common function names.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
11 months agobcm_ns3: use device specific naming for variables
Maxim Uvarov [Tue, 26 Dec 2023 15:46:17 +0000 (21:46 +0600)]
bcm_ns3: use device specific naming for variables

Use device specific naming for variables so as to not overlap
with common function names.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
11 months agomach-socfpga: do not overlap defines with lwip
Maxim Uvarov [Tue, 26 Dec 2023 15:46:16 +0000 (21:46 +0600)]
mach-socfpga: do not overlap defines with lwip

Fix compilation issue with overlapping lwip and march defines.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agodriver/net/rtl8139: remove debug print
Maxim Uvarov [Tue, 26 Dec 2023 15:46:15 +0000 (21:46 +0600)]
driver/net/rtl8139: remove debug print

debug print delays reset of the driver. Finally I see
bunch of "rx error FFFF" errors in the screen. CI can
not handle many prints. While network works fine there

Reproduced with:
make CROSS_COMPILE=sh2-linux- r2dplus_defconfig all
qemu-system-sh4 -M r2d -nographic -serial null \
-serial mon:stdio -net user,tftp=`pwd` \
-net nic,model=rtl8139 -kernel ./u-boot.bin

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agosandbox: eth-raw-os: successful return code is 0
Maxim Uvarov [Tue, 26 Dec 2023 15:46:14 +0000 (21:46 +0600)]
sandbox: eth-raw-os: successful return code is 0

all network drivers return 0 on the successful
transmission.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agonet/smc911x: fix return from smc911x_send
Maxim Uvarov [Tue, 26 Dec 2023 15:46:13 +0000 (21:46 +0600)]
net/smc911x: fix return from smc911x_send

return value of smc911x_send is ignored, but on sucesseful
send we need return 0 and or error -ETIMEOUT, not opposite.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agotest_net: print out net list
Maxim Uvarov [Tue, 26 Dec 2023 15:46:12 +0000 (21:46 +0600)]
test_net: print out net list

Printing net list is useful in CI log files.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agoMerge tag 'u-boot-dfu-20240111' of https://source.denx.de/u-boot/custodians/u-boot-dfu
Tom Rini [Thu, 11 Jan 2024 15:03:51 +0000 (10:03 -0500)]
Merge tag 'u-boot-dfu-20240111' of https://source.denx.de/u-boot/custodians/u-boot-dfu

u-boot-dfu-20240111

- Implement fastboot multi-response. This allows multi-line response and
  most importantly, finally adds support for fastboot getvar all command.

- New 'fastboot oem console' command. Useful for debugging to send data
  the u-boot shell via fastboot

- Console recording fixes

11 months agoconfigs: Resync with savedefconfig
Tom Rini [Wed, 10 Jan 2024 15:45:49 +0000 (10:45 -0500)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Wed, 10 Jan 2024 14:53:29 +0000 (09:53 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- AC5: Use finer grained memory map (Chris)
- Espressobin: Misc improvements (Robert)
- eDPU: Support new board revision (Robert)

11 months agoarm: mvebu: eDPU: support new board revision
Robert Marko [Wed, 29 Nov 2023 10:11:08 +0000 (11:11 +0100)]
arm: mvebu: eDPU: support new board revision

There is a new eDPU revision that uses Marvell 88E6361 switch onboard.
We can rely on detecting the switch to enable and fixup the Linux DTS
so a single DTS can be used.

There is currently no support for the 88E6361 switch and thus no working
networking in U-Boot, so we disable both ports.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Stefan Roese <sr@denx.de>
11 months agoarm: mvebu: Espressobin: move network setup into a separate function
Robert Marko [Wed, 29 Nov 2023 10:11:07 +0000 (11:11 +0100)]
arm: mvebu: Espressobin: move network setup into a separate function

Currently, Esspresobin switch is being setup directly in last_stage_init()
which makes it hard to add support for any other board to be setup.

So, lets just move the switch setup code to a separate function and call it
if compatible matches, there should be no functional change.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Stefan Roese <sr@denx.de>
11 months agoarm: mvebu: Espressobin: move FDT fixup into a separate function
Robert Marko [Wed, 29 Nov 2023 10:11:06 +0000 (11:11 +0100)]
arm: mvebu: Espressobin: move FDT fixup into a separate function

Currently, Esspresobin FDT is being fixed up directly in ft_board_setup()
which makes it hard to add support for any other board to be fixed up.

So, lets just move the FDT fixup code to a separate function and call it
if compatible matches, there should be no functional change.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Stefan Roese <sr@denx.de>
11 months agoarm: mvebu: AC5: Use finer grained memory map
Chris Packham [Fri, 27 Oct 2023 00:44:11 +0000 (13:44 +1300)]
arm: mvebu: AC5: Use finer grained memory map

The ATF implementation for AC5/AC5X ends up with bl31 living in some
internal SRAM. This is in the middle of the large MMIO region that we
were using. Adjust this to be finer grained blocks based on the address
map from the AC5X Family Control and Management Subsystem Functional
Datasheet.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
11 months agoMerge tag 'smbios-2024-04-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Tue, 9 Jan 2024 17:50:04 +0000 (12:50 -0500)]
Merge tag 'smbios-2024-04-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request smbios-2024-04-rc1

* make table_compute_checksum() arguments const
* remove duplicate function verify_checksum()
* enable setting processor family > 0xff
* set correct SMBIOS processor family value for RISC-V
* avoid importing ofnode.h in smbios.h
* provide a UEFI tool to dump SMBIOS table

11 months agoMerge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-samsung
Tom Rini [Tue, 9 Jan 2024 14:00:59 +0000 (09:00 -0500)]
Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-samsung

11 months agopinctrl: exynos: Convert to use livetree API for fdt access
Sam Protsenko [Thu, 30 Nov 2023 20:13:52 +0000 (14:13 -0600)]
pinctrl: exynos: Convert to use livetree API for fdt access

Use counterpart dev_read_* functions instead of fdt* ones. It fixes
checkpatch warnings like this:

    WARNING: Use the livetree API (dev_read_...)
    #54: FILE: drivers/pinctrl/exynos/pinctrl-exynos.c:137:
        pinvals[idx] = fdtdec_get_int(fdt, node,

and also makes it possible to avoid using the global data pointer in the
driver.

No functional change.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 months agopinctrl: exynos: Reduce variables scope
Sam Protsenko [Thu, 30 Nov 2023 20:13:51 +0000 (14:13 -0600)]
pinctrl: exynos: Reduce variables scope

Pull some variables declared in exynos_pinctrl_set_state() into its
loop, to reduce their scope. Style commit, no functional change.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 months agopinctrl: exynos: Refactor handling the pin related dt properties
Sam Protsenko [Thu, 30 Nov 2023 20:13:50 +0000 (14:13 -0600)]
pinctrl: exynos: Refactor handling the pin related dt properties

All pin related dt properties (pin-function, pin-pud and pin-drv) are
handled in a very similar way. Get rid of that code duplication by
extracting the corresponding data knowledge into an actual data
structure (array), and then just iterating over it.

No functional change, it's a refactoring commit.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 months agopinctrl: exynos: Support different register types in pin banks
Sam Protsenko [Thu, 30 Nov 2023 20:13:49 +0000 (14:13 -0600)]
pinctrl: exynos: Support different register types in pin banks

Get rid of hard-coded register offsets and widths. Instead provide a way
for pinctrl drivers to specify different pin bank register offsets and
widths. This in turn makes it possible to add support for new SoCs that
have registers with offset/width values different than generic ones
already available in pinctrl-exynos driver.

Offset constants (now unused in pinctrl-exynos.c) are moved to
pinctrl-exynos7420 driver, which is the single user of those constants.

The design of this patch follows Linux kernel pinctrl-exynos driver
design, in terms of added data structures and types. This patch doesn't
add support for any new SoCs and shouldn't introduce any functional
changes.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 months agopinctrl: exynos: Rework pin_to_bank_base() to obtain data by name
Sam Protsenko [Thu, 30 Nov 2023 20:13:48 +0000 (14:13 -0600)]
pinctrl: exynos: Rework pin_to_bank_base() to obtain data by name

Rework pin_to_bank_base() function to obtain bank data structure by bank
name instead of getting bank base address by pin name, and rename it to
get_bank() to reflect this change. This in turn leads to the extraction
of parse_pin(), so the caller has to use it before calling get_bank().

No functional change. This is a refactoring commit which prepares
pinctrl driver code for handling different sizes of register fields,
which will be added next.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 months agopinctrl: exynos: Extract pin parsing code into a separate function
Sam Protsenko [Thu, 30 Nov 2023 20:13:47 +0000 (14:13 -0600)]
pinctrl: exynos: Extract pin parsing code into a separate function

Next commits are going to re-design the pin_to_bank_base() function and
its usage in a way that the pin parsing code will be called separately.
Extract it into a separate function first, as a refactoring commit.

No functional change.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 months agopinctrl: exynos: Improve coding style
Sam Protsenko [Thu, 30 Nov 2023 20:13:46 +0000 (14:13 -0600)]
pinctrl: exynos: Improve coding style

Style commit, no functional change.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
11 months agotest: hush: dollar: fix bugous behavior
Ion Agorria [Fri, 5 Jan 2024 07:22:12 +0000 (09:22 +0200)]
test: hush: dollar: fix bugous behavior

The dollar test was merged with bugous console behavior, and
instead of fixing it, this behavior was just workarounded.

It seems like without the fix the ut_assert_skipline(); didn't clear
console and running ut_assert_skipline(); many times would give always
OK. With

lib: membuff: fix readline not returning line in case of overflow

the line is cleared correctly and next assert fails because now there
is nothing to clean which is correct if we look the this a bit above
the failing assert:

    if (gd->flags & GD_FLG_HUSH_MODERN_PARSER) {
         /*
          * For some strange reasons, the console is not empty after
          * running above command.
          * So, we reset it to not have side effects for other tests.
          */
         console_record_reset_enable();
    } else if (gd->flags & GD_FLG_HUSH_OLD_PARSER) {
         ut_assert_console_end();
    }

Which further confirms that tests workaround the old problem and now
that problem is fixed we can remove the whole if blocks and simply
place ut_assert_console_end() right after ut_assert_skipline() without
any conditional and will pass green.

So this part of code goes from:
    ut_assert_skipline();
    ut_assert_skipline();

    if (gd->flags & GD_FLG_HUSH_MODERN_PARSER) {
        /* See above comments. */
        console_record_reset_enable();
    } else if (gd->flags & GD_FLG_HUSH_OLD_PARSER) {
        ut_assert_console_end();
    }

to become:
    ut_assert_skipline();
    ut_assert_console_end();

Same thing should be done with the if block mentioned above that calls
console_record_reset_enable().

Signed-off-by: Ion Agorria <ion@agorria.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20240105072212.6615-8-clamor95@gmail.com
[mkorpershoek: reworded commit title]
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
11 months agoMerge tag 'rng-2024-04-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Tue, 9 Jan 2024 14:00:39 +0000 (09:00 -0500)]
Merge tag 'rng-2024-04-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request rng-2024-04-rc1

QEMU does not provide information in the device-tree if the ARMv8.5 RNDR
or the RISC-V Zkr RNG have been enabled on the command line.

In different parts of our code we assume that the first RNG device is the
one to be used. Therefore it is preferable to detect the availability of
said devices already in the bind method.

There has been a related discussion if the U_BOOT_DRVINFO() macro should be
used for architectural devices
(https://lore.kernel.org/u-boot/20231031125552.26698-1-heinrich.schuchardt@canonical.com/).
This aspect is not touched by this series.

11 months agofastboot: add oem console command support
Ion Agorria [Fri, 5 Jan 2024 07:22:11 +0000 (09:22 +0200)]
fastboot: add oem console command support

"oem console" serves to read console record buffer.

Signed-off-by: Ion Agorria <ion@agorria.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20240105072212.6615-7-clamor95@gmail.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
11 months agolib: membuff: fix readline not returning line in case of overflow
Ion Agorria [Fri, 5 Jan 2024 07:22:10 +0000 (09:22 +0200)]
lib: membuff: fix readline not returning line in case of overflow

If line overflows readline it will not be returned, fix this behavior,
make it optional and documented properly.

Signed-off-by: Ion Agorria <ion@agorria.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/r/20240105072212.6615-6-clamor95@gmail.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
11 months agocommon: console: record console from the beginning
Ion Agorria [Fri, 5 Jan 2024 07:22:09 +0000 (09:22 +0200)]
common: console: record console from the beginning

Set flag to enable console record on console_record_init
and not only on console_record_reset_enable. This fixes
missing start of U-Boot log for fastboot oem console
command.

Signed-off-by: Ion Agorria <ion@agorria.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20240105072212.6615-5-clamor95@gmail.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
11 months agocommon: console: introduce console_record_isempty helper
Ion Agorria [Fri, 5 Jan 2024 07:22:08 +0000 (09:22 +0200)]
common: console: introduce console_record_isempty helper

Add console_record_isempty to check if console record buffer
contains any data.

Signed-off-by: Ion Agorria <ion@agorria.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20240105072212.6615-4-clamor95@gmail.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
11 months agofastboot: implement "getvar all"
Ion Agorria [Fri, 5 Jan 2024 07:22:07 +0000 (09:22 +0200)]
fastboot: implement "getvar all"

This commit implements "fastboot getvar all" listing
by iterating the existing dispatchers that don't require
parameters (as we pass NULL), uses fastboot multiresponse.

Signed-off-by: Ion Agorria <ion@agorria.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20240105072212.6615-3-clamor95@gmail.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
11 months agofastboot: multiresponse support
Ion Agorria [Fri, 5 Jan 2024 07:22:06 +0000 (09:22 +0200)]
fastboot: multiresponse support

Currently u-boot fastboot can only send one message back to host,
so if there is a need to print more than one line messages must be
kept sending until all the required data is obtained. This behavior
can be adjusted using multiresponce ability (getting multiple lines
of response) proposed in this patch.

Signed-off-by: Ion Agorria <ion@agorria.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20240105072212.6615-2-clamor95@gmail.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
11 months agoefi_loader: provide tool to dump SMBIOS table
Heinrich Schuchardt [Wed, 3 Jan 2024 08:07:21 +0000 (09:07 +0100)]
efi_loader: provide tool to dump SMBIOS table

An EFI binary smbiosdump.efi is provided that can be used to check the
SMBIOS table for consistency and to dump it as a file.

The tool provides the following commands:

check
    Check the SMBIOS table for consistency.

exit
    Leave the tool.

help
    Show available commands.

save
    Save the SMBIOS table to a file on the EFI system partition. The file
    can be further analyzed with the dmidecode command line tool::

        dmidecode --from-dump <filename>

Specifying 'nocolor' as load option data suppresses colored output and
clearing of the screen.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agosmbios: smbios.h should not import ofnode.h
Heinrich Schuchardt [Wed, 3 Jan 2024 08:07:20 +0000 (09:07 +0100)]
smbios: smbios.h should not import ofnode.h

The smbios.h include does not use any definitions from ofnode.h.
So don't include it.

As DECLARE_GLOBAL_DATA_PTR is no longer defined via dm/of.h we need to
add it to efi_smbios.c.

Add now missing includes to smbios-parser.c.

Remove a superfluous check comparing the sizes of the SMBIOS 2.1 and SMBIOS
3.0 anchors.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agocpu: riscv: set correct SMBIOS processor family value
Heinrich Schuchardt [Thu, 28 Dec 2023 07:30:24 +0000 (08:30 +0100)]
cpu: riscv: set correct SMBIOS processor family value

The SMBIOS specification requires to set the processor family in the type 4
(Processor Information) table to specific values depending only on the
bitness of the system (0x200 for RV32 and 0x201 for RV64).

With this patch dmidecode shows

    Handle 0x0004, DMI type 4, 48 bytes
    Processor Information
Socket Designation: Not Specified
Type: Central Processor
Family: RV64

for qemu-riscv64_smode_defconfig.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agosmbios: enable setting processor family > 0xff
Heinrich Schuchardt [Thu, 28 Dec 2023 07:30:23 +0000 (08:30 +0100)]
smbios: enable setting processor family > 0xff

Many value of processor type exceed 0xff and have to be stored as u16
value. In the type 4 table set processor_family = 0xfe signaling that
field processor_family2 is used and write the actual value into the
processor_family2 field.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agolib: smbios: verify_checksum() is duplicate
Heinrich Schuchardt [Tue, 26 Dec 2023 10:22:28 +0000 (11:22 +0100)]
lib: smbios: verify_checksum() is duplicate

The function verify_checksum() duplicates what table_compute_checksum()
does. Replace it. table_compute_checksum() is always compiled.

Fixes: 415eab0655a8 ("smbios: add parsing API")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agolib: make table_compute_checksum() arguments const
Heinrich Schuchardt [Tue, 9 Jan 2024 08:36:44 +0000 (09:36 +0100)]
lib: make table_compute_checksum() arguments const

table_compute_checksum() does neither changes the content of the
checksummed buffer nor the buffer length. Adding const to the
definition makes the function wider usable.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agorng: detect RISC-V Zkr RNG device in bind method
Heinrich Schuchardt [Sat, 4 Nov 2023 06:51:07 +0000 (08:51 +0200)]
rng: detect RISC-V Zkr RNG device in bind method

The existence of devices should be checked in the bind method and not in
the probe method. Adjust the RISC-V Zkr RNG driver accordingly.

Use ENOENT (and not ENODEV) to signal that the device is not available.

Fixes: ceec977ba1a9 ("rng: Provide a RNG based on the RISC-V Zkr ISA extension")
Reported-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agorng: fix ARMv8.5 RNDR driver
Heinrich Schuchardt [Sat, 4 Nov 2023 07:00:07 +0000 (09:00 +0200)]
rng: fix ARMv8.5 RNDR driver

In different parts of our code we assume that the first RNG device is the
one to be used. Therefore it is preferable to detect the availability of
the RNDR register already in the bind method.

For signaling the non-existence of a device the driver model requires using
ENOENT (and not ENODEV).

Fixes: 31565bb0aa2d ("driver: rng: Add DM_RNG interface for ARMv8.5 RNDR registers")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Andre Przywara <andre.przywara@arm.com>