Commit graph

91498 commits

Author SHA1 Message Date
Heinrich Schuchardt
551bc96be5 cmd: smbios: show correct table size for SMBIOS2.1 entry point
The SMBIOS table size for SMBIOS2.1 entry points is in field 'Structure
Table Length' (offset 0x16) and not in field 'Maximum Structure Size'
(offset 0x08).

Rename the receiving variable max_struct_size to table_maximum_size
to avoid future confusion.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-02-02 19:57:45 +01:00
Heinrich Schuchardt
5778c88eb0 smbios: correctly fill chassis handle
The chassis handle field in the type 2 structure must point to the handle
of the type 3 structure.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-02-02 19:57:16 +01:00
Heinrich Schuchardt
545e0e42b9 smbios: provide type 4 RISC-V SMBIOS Processor ID
For RISC-V CPUs the SMBIOS Processor ID field contains
the Machine Vendor ID from CSR mvendorid.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-02-02 19:57:16 +01:00
Heinrich Schuchardt
6ebf9136ec smbios: if a string value is unknown, use string number 0
The SMBIOS specification describes: "If a string field references no string,
a null (0) is placed in that string field."

Accordingly we should avoid writing a string "Unknown" to the SMBIOS table.

dmidecode displays 'Not Specified' if the string number is 0.

Commit 00a871d34e ("smbios: empty strings in smbios_add_string()")
correctly identified that strings may not have length 0 as two
consecutive NULs indentify the end of the string list. But the suggested
solution did not match the intent of the SMBIOS specification.

Fixes: 00a871d34e ("smbios: empty strings in smbios_add_string()")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-02-02 19:56:54 +01:00
Matthias Brugger
e31efe50b5 smbios: Fix table when no string is present
When no string is present in a table, next_ptr points to the same
location as eos. When calculating the string table length, we would only
reserve one \0. By spec a SMBIOS table has to end with two \0\0 when no
strings a present.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-02-02 19:56:54 +01:00
Heinrich Schuchardt
c11f176ab1 cmd: smbios: replace missing string by 'Not Specified'
A missing string value is indicated by a string index of 0. In this case
print 'Not Specified' like the Linux dmidecode command does.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-02-02 19:56:54 +01:00
Heinrich Schuchardt
e799f8a48d cmd: smbios: add missing colon after UUID
For consistent formatting add a colon ':' after the UUID label.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-02-02 19:56:34 +01:00
Heinrich Schuchardt
7ca4b0ea6a cmd: smbios: always use '0x%04x' for printing handles
Handles are u16 numbers. Consistently use '0x%04x' to print them.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-02-02 19:55:29 +01:00
Heinrich Schuchardt
b327e64d5f smbios: get_str_from_dt() - add sysinfo_id description
Add description for parameter sysinfo_id of function get_str_from_dt().

Fixes: 07c9e683a4 ("smbios: Allow a few values to come from sysinfo")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-02-02 19:55:29 +01:00
Heinrich Schuchardt
85e490b22e lib: smbios_entr() use logical or for booleans
As a matter of programming style use logical or to combine two boolean
results.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-02-02 19:55:29 +01:00
Tom Rini
050a9b981d - stop printing board model twice after sysinfo update
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPVPGJshWBf4d9CyLd9zb2sjISdEFAmW7qZEACgkQd9zb2sjI
 SdErzQ//bw6KUZ+blULL98qXoaxPnnAE4NLxU7PUYgzV0lYXiSJZdPBTlE69V2Cy
 xSaYzinLpDg1TDpbUvIHi7Q0Qs8KA3ppW00AXVXAuT9hwHWrYXA/gLs2ghflM/eJ
 gPjjKgO2HpMkHGqf2NKelfk0gCy7EHTFUUO3jvmJZZvoUYY0uiQIxZddluwWiqrz
 fR0TmueCR4Wyaxy7Wni19RETmhg0osB8HSwWhTEa3Cpqn8mb/ci26S106Q55mOpA
 BefRtkP+/dqhBZgUbS2sf1YC8pRD84uvKJyNVXeEce7bYp/lUPacObtTMhZhn27q
 2y3LGgYHGwQ+SCxMWYJi1CfjLN0Gu6mlTda0WIJZA5UxRK2ttZjfEVy4aea8kMyg
 KOR7nO7qJyEBe9UDPQPQgDBdFR6EoxUJCfM3ac0o+pjy7dhmYdjIafAK4pTtQcEE
 MzPeG3iqsZNl+B1k0yqrMm54UWE0r/TL2C3J0gfy+civLtIaHnG/M7tozpOBJY8V
 Xp38WgC7weQmE161p+3jfnq3R2sR89Er02aDYODsrRSJmSCZ5g8v7l7Wb+4A2kDq
 kxivQ4ZJ7jbTjQbyZsYwWmB6QMTVHm6CCImYKaj7erB7yv22jyNk6vFBKknL+YPy
 UhYe1jjS97HM1jx0wQ1UYIQctCZUHHKC6gEaQZKFtwkx0xy9FWA=
 =slED
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-amlogic-fixes-20240201' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- stop printing board model twice after sysinfo update
2024-02-01 09:59:53 -05:00
Tom Rini
f0df21b40c Merge https://source.denx.de/u-boot/custodians/u-boot-watchdog
- add andes atcwdt200 support (Randolph)
2024-02-01 09:59:09 -05:00
Randolph
094eda0660 configs: andes: add watchdog support fot andes ae350
It adds the ATCWDT200 support for Andes AE350 platform.
It also enables wdt command support.

Signed-off-by: CL Wang <cl634@andestech.com>
Signed-off-by: Randolph <randolph@andestech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-02-01 09:08:44 +01:00
Randolph
4350e99937 drivers: watchdog: add andes atcwdt200 support
This patch adds an implementation of the Andes watchdog ATCWDT200 driver.

Signed-off-by: CL Wang <cl634@andestech.com>
Signed-off-by: Randolph <randolph@andestech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-02-01 09:08:44 +01:00
Tom Rini
b6d8969bcb First set of u-boot-at91 features for the 2024.04 cycle
-----BEGIN PGP SIGNATURE-----
 
 iQFQBAABCgA6FiEEqxhEmNJ6d7ZdeFLIHrMeAg6sL8gFAmW4mGIcHGV1Z2VuLmhy
 aXN0ZXZAY29sbGFib3JhLmNvbQAKCRAesx4CDqwvyBq9B/sHzeh4lWQpyU5CcO8J
 WnlRn2blqL/2LzkawD6OvA7WhEYisLh2389q6pPSFqWZS8v1aNgTO4krnPDOG3a5
 s7yigcBtg5KsmnM4K89+KZ/BZW4TzrSHIY4P+t1W92QtnFHEzNW/LolG6jBZnz+e
 bMzi0uCGR1cgTW4IfLmuq6NajIaAXywdohMxfi/9kiNhQVT03Jux/CGoIvpJ61Bu
 OKWX2KNn0o3XXK7UKdZUSzP6CyiRSplQl3eX/0shh9qPR16eSeUqh952zGxlcOZO
 PKXvDMl8QxkCzRjXdg3EH2jADoaTB0maq6JutVyY+SoLiYJ9A8BUCLOIMevCVXjK
 3BCH
 =V29u
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-at91-2024.04-a' of https://source.denx.de/u-boot/custodians/u-boot-at91

First set of u-boot-at91 features for the 2024.04 cycle:

This set includes some DT alignments and solves a compile issue for
custom nand defconfigs.
2024-01-31 10:44:33 -05:00
Tom Rini
625e68ef65 Merge https://source.denx.de/u-boot/custodians/u-boot-riscv
* Add RISC-V falcon mode documentation
* Add Clang build support
* Add cmd to detect Debug Trigger Extension support

* Add PWM setting for Unmatched board
* Add Milk-V Duo board support
* Add new device node and enable new config option for VisionFive2 board
* Add second virtio device for RISC-V QEMU
2024-01-31 08:49:35 -05:00
Nam Cao
6882255ac3 riscv: dts: starfive: add regulator device
Add the axp15060 regulator device. OpenSBI uses this device to perform
board reset and shutdown.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31 16:52:53 +08:00
Nam Cao
92802e12ef riscv: dts: jh7110: add power management unit controller node
JH7110 has a power management unit controller node. Add this node.

This device is used by OpenSBI during board reset/shutdown.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31 16:52:53 +08:00
Lukasz Tekieli
70f150759b board: visionfive2: configure PHY pad drive strength
Configure the pad drive strength register for both PHYs.
The values correspond to what can be found in the Linux DTS
for VisionFive2 v1.3b.

Pad drive strength configuration is required for the phy0 to work correctly
with 100Mbit links.

Signed-off-by: Lukasz Tekieli <tekieli.lukasz@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31 16:52:49 +08:00
Lukasz Tekieli
c025c8afd4 net: phy: motorcomm: configure pad drive strength register
This ports the pad drive strength register configuration which can be
already found in the Linux driver for this PHY.

Signed-off-by: Lukasz Tekieli <tekieli.lukasz@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31 16:52:49 +08:00
Kongyang Liu
36278b7051 doc: sophgo: milkv_duo: document Milk-V Duo board
Add document for Milk-V Duo board which based on Sophgo's CV1800B SoC.

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31 16:52:45 +08:00
Kongyang Liu
0dc6ee6d2b riscv: sophgo: milkv_duo: initial support added
Add support for Sophgo's Milk-V Duo board, only minimal device tree and
serial console are enabled, and it can boot via vendor first stage
bootloader.

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31 16:52:45 +08:00
Kongyang Liu
f03d2ab206 riscv: dts: sophgo: add basic device tree for Milk-V Duo board
Import device tree from Linux kernel to add basic support for CPU, PLIC,
UART and Timer. The name cv1800b in the filename represent the chip used
on Milk-V Duo board.

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31 16:52:45 +08:00
Aurelien Jarno
386db9a26b configs: visionfive2: Disable ENV_IS_NOWHERE
The VisionFive 2 board supports saving the u-boot environment settings
are saved to on-board SPI flash. However the defconfig enables both
ENV_IS_NOWHERE and ENV_IS_IN_SPI_FLASH, preventing the "saveenv" command
to work. Fix that by disabling ENV_IS_NOWHERE.

Fixes: 7d79bed00c ("configs: starfive: Enable environment in SPI flash support")

Reported-by: E Shattow <lucent@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31 16:52:38 +08:00
kleines Filmröllchen
ee9f9d6a41 riscv: Support building with Clang
The -ffixed-gp option of GCC has an exact equivalent of -ffixed-x3 in
Clang.

Signed-off-by: kleines Filmröllchen <filmroellchen@serenityos.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2024-01-31 16:52:36 +08:00
Heinrich Schuchardt
6b0520c939 cmd: sbi: add support for Debug Trigger Extension
Detect and show if the SBI implements the Debug Trigger Extension.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31 16:52:30 +08:00
Vincent Chen
282159ff24 board: sifive: spl: Initialized the PWM setting in the SPL stage
LEDs and multiple fans can be controlled by SPL. This patch ensures
that all fans have been enabled in the SPL stage. In addition, the
LED's color will be set to yellow.

Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Co-developed-by: Nylon Chen <nylon.chen@sifive.com>
Signed-off-by: Nylon Chen <nylon.chen@sifive.com>
Co-developed-by: Zong Li <zong.li@sifve.com>
Signed-off-by: Zong Li <zong.li@sifve.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31 16:52:24 +08:00
Aurelien Jarno
cbc45cb596 riscv: qemu: enable booting on a second virtio device
QEMU RISC-V supports multiple virtio devices, but only tries to boot to
the first one. Enable support for a second virtio device, that is useful
for instance to boot on a disk image + an installer. Ideally that should
be made dynamic, but that's a first step.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31 16:52:15 +08:00
Aurelien Jarno
465e7e6d50 board: starfive: handle compatible property in dynamic DT configuration
The difference between the StarFive VisionFive 2 1.2A and 1.3B boards is
handled dynamically by looking at the PCB version in the EEPROM in order
to have a single u-boot version for both versions of the board. While
the "model" property is correctly handled, the "compatible" one is
always the the one of version 1.3b.

This patch add support for dynamically configuring that property.

Fixes: 9b7060bd15 ("riscv: dts: jh7110: Combine the board device tree files of 1.2A and 1.3B")

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31 16:52:07 +08:00
Randolph
a400ffad02 configs: andes: add the fdt blob copy address for SPL
Add the address to which the FDT blob is to be moved.

Signed-off-by: Randolph <randolph@andestech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31 16:51:03 +08:00
Randolph
10c4ab898c spl: riscv: falcon: move fdt blob to specified address
In Falcon Boot mode, the fdt blob should be move to the RAM from
kernel BSS section. To avoid being cleared by BSS initialisation.
SPL_PAYLOAD_ARGS_ADDR is the address where SPL copies.

Signed-off-by: Randolph <randolph@andestech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31 16:51:03 +08:00
Randolph
011d07b4d8 doc: falcon: riscv: Falcon Mode boot on RISC-V
Add documentation to introduce the Falcon Mode on RISC-V.
In this mode, the boot sequence is SPL -> OpenSBI -> Linux kernel.

Signed-off-by: Randolph <randolph@andestech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-01-31 16:51:03 +08:00
Ivan T. Ivanov
12d479d018 configs: rpi_arm64: build position independent code
Latest RPi5 EEPROM firmware versions after "DATE: 2023/10/30", has changed
kernel load address from 0x80000 to 0x200000 which break boot process.
Switch to position independent code to be able to boot the same binary
on top of different EEPROM firmware versions.

Tested on:
Raspberry Pi 5 Model B Rev 1.0
Raspberry Pi 4 Model B Rev 1.1
Raspberry Pi 3 Model B Plus Rev 1.3
Raspberry Pi Zero 2 W Rev 1.0
Raspberry Pi 2 Model B Rev 1.2
Raspberry Pi Compute Module 4 Rev 1.0
Raspberry Pi Compute Module 3 Rev 1.0

Tested-by: Jens Maus <mail@jens-maus.de>
Tested-by: Darko Alavanja <darko.alavanja@konsulko.com>
Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2024-01-30 17:40:13 +01:00
Ivan T. Ivanov
239fd8651d configs: rpi_arm64: enable SDHCI BCMSTB driver
RPi5 have "brcm,bcm2712-sdhci" controller which is
handled by "sdhci-bcmstb" driver, so enable it.

Tested-by: Jens Maus <mail@jens-maus.de>
Tested-by: Darko Alavanja <darko.alavanja@konsulko.com>
Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2024-01-30 17:40:07 +01:00
Ivan T. Ivanov
10127cdbab mmc: bcmstb: Add support for bcm2712 SD controller
Make sure that core SDHCI accessors are used and add
device specific card detection initialization, which
is borrowed from vendor Linux driver code.

Tested-by: Jens Maus <mail@jens-maus.de>
Tested-by: Darko Alavanja <darko.alavanja@konsulko.com>
Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2024-01-30 17:40:01 +01:00
Ivan T. Ivanov
cce167eb8d bcm2835: Dynamically calculate bytes per pixel parameter
brcm,bcm2708-fb device provided by firmware on RPi5 uses
16 bits per pixel, so lets calculate framebuffer bytes
per pixel dynamically based on queried information.

Tested to work for RPi2b v1.2, RPi3b v1.3, RPi4b v1.1,
RPi2 Zero W, RPi5b v1.0.

Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Tested-by: Jens Maus <mail@jens-maus.de>
Tested-by: Darko Alavanja <darko.alavanja@konsulko.com>
Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2024-01-30 17:39:51 +01:00
Ivan T. Ivanov
08a5b4bd6c rpi5: Use devicetree to retrieve board revision
Firmware on RPi5 return error on board revision query
through firmware interface, but on the other hand it fills
"linux,revision" in "system" node, so use it to detect board
revision.

	system {
		linux,revision = <0xc04170>;
		linux,serial = <0x6cf44e80 0x3c533ede>;
	};

Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Tested-by: Jens Maus <mail@jens-maus.de>
Tested-by: Darko Alavanja <darko.alavanja@konsulko.com>
Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2024-01-30 17:39:46 +01:00
Dmitry Malkin
60878e753c rpi5: Use devicetree as alternative way to read IO base addresses
MBOX and Watchdog on RPi5/bcm2712 have a different base IO offsets.
Find them via devicetree blob passed by bootloader.

Signed-off-by: Dmitry Malkin <dmitry@bedrocksystems.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Tested-by: Jens Maus <mail@jens-maus.de>
Tested-by: Darko Alavanja <darko.alavanja@konsulko.com>
Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2024-01-30 17:39:39 +01:00
Dmitry Malkin
a5a27eafc4 rpi5: add initial memory map for bcm2712
This includes:
* 1GB of RAM (from 4GB or 8GB total)
* AXI ranges (main peripherals)

When HDMI cable is plugged in at boot time firmware will
insert "simple-framebuffer" device into devicetree and will
shrink first memory region to 0x3f800000UL. Board setup then
will properly reserve framebuffer region.

When no HDMI cable is plugged in the size of the region will
be 0x3fc00000UL.

Signed-off-by: Dmitry Malkin <dmitry@bedrocksystems.com>
Tested-by: Jens Maus <mail@jens-maus.de>
Tested-by: Darko Alavanja <darko.alavanja@konsulko.com>
Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2024-01-30 17:39:31 +01:00
Tom Rini
28760ce864 Clock changes for v2024.04
This pull has the usual fixes and new (clock-adjacent) drivers. It also has some
 cleanups for the clock API; in particular removing the unused rfree callback.
 
 CI: https://source.denx.de/u-boot/custodians/u-boot-clk/-/pipelines/19486
 -----BEGIN PGP SIGNATURE-----
 
 iQGTBAABCgB9FiEEkGEdW86NSNID6GAoPuiP7LShEG4FAmW4fUJfFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDkw
 NjExRDVCQ0U4RDQ4RDIwM0U4NjAyODNFRTg4RkVDQjRBMTEwNkUACgkQPuiP7LSh
 EG5piQf/donCQvmyDyrWfSDtm8WIxzBas+1TqvRH4Q+YoPCwntCytfccyCegm5LI
 YjSw6Rn1qJ0/Y1F2pvK94TF8ViznZO4biAPAqqG6M8o44EvgWArlcSijG27QA9BN
 I0GFbPZ5wZfvV5wNLPqjGEUh8Nqa2XnFLenD2IlZTzIENh2fzBFFSZiPsIDa/v+t
 uWrqhkn4sDzL5R0n0mrWfFU7At/cOAGUPlfMgsMDrn5w0b8o+S1i1hlVIZXvw2Er
 fS439of0IclVMMrV835oK9XWITp/GdnafxmD07KX6+S8IGi+ic7Jpm/0jXrnriyz
 X0unxn6EJH9Z0q5drqtX4MY8+h8R/g==
 =qz3U
 -----END PGP SIGNATURE-----

Merge tag 'clk-2024.04-rc2' of https://source.denx.de/u-boot/custodians/u-boot-clk

Clock changes for v2024.04

This pull has the usual fixes and new (clock-adjacent) drivers. It also has some
cleanups for the clock API; in particular removing the unused rfree callback.

CI: https://source.denx.de/u-boot/custodians/u-boot-clk/-/pipelines/19486
2024-01-30 07:54:28 -05:00
Neil Armstrong
076529725f ARM: meson: stop printing board model after sysinfo update
After the sysinfo update, Model is printed twice, remove
the now duplicate Model print from mach-meson/board-info.

Link: https://lore.kernel.org/r/20240124-u-boot-model-print-fix-v1-1-484960069623@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2024-01-30 09:35:51 +01:00
Svyatoslav Ryhel
a8dc4965f0 clk: clk-gpio: add actual gated clock
Existing gpio-gate-clock driver acts like a simple GPIO switch without any
effect on gated clock. Add actual clock actions into enable/disable ops and
implement get_rate op by passing gated clock if it is enabled.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20240110160956.4476-2-clamor95@gmail.com
[ sorted includes ]
Signed-off-by: Sean Anderson <seanga2@gmail.com>
2024-01-29 22:35:34 -05:00
Sean Anderson
0bfbb83055 clk: Document clk_ops return codes and behavior
Currently, clock consumers cannot take any programmatic action based on the
return code of a clock function. This is because there is no
standardization, and generally no way of separating e.g. "there was a major
problem setting the rate for this clock" which usually should not be
recovered from, from "this clock doesn't support setting its rate" or "this
clock doesn't support *this* rate" which could be absolutely fine depending
on the driver.

This commit aims to standardize the acceptable codes which may be returned
from clock operations. In general,

- ENOSYS should be returned when an operation is not supported for a
  particular clock.
- ENOENT may be returned if the clock ID is invalid. However, it is
  encouraged to move any checks to request() to reduce code duplication.
- EINVAL should be returned for logical errors only (such as requesting an
  invalid rate).

Each function has had specific guidance added for when to return each error
code. This is just guidance for now; most of the clock subsystem does not
yet conform to this standard. However, it is expected that new clock
drivers return these error codes.

Additionally, this commit adds expected behavior for each of the clock
operations. I believe these should be mostly straightforward and correspond
to existing behavior. I remember not understanding what the expected
invariants were for several clock functions, so hopefully this should help
out new driver authors. In the future, some of these invariants could be
checked via an optional config option.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231216193843.2463779-4-seanga2@gmail.com
2024-01-29 22:35:02 -05:00
Sean Anderson
c9309f40a6 treewide: Remove clk_free
This function is a no-op. Remove it.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231216193843.2463779-3-seanga2@gmail.com
2024-01-29 22:35:02 -05:00
Sean Anderson
82719d3f40 clk: Remove rfree
Nothing uses this function. Remove it. Since clk_free no longer does
anything, just stub it out.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231216193843.2463779-2-seanga2@gmail.com
2024-01-29 22:35:02 -05:00
Julien Masson
b500447ad6 clk: fix clk_get_rate() always return ulong
When we call clk_get_rate(), we expect to get clock rate value as
ulong.
In that case we should not use log_ret() macro since it use internally
an int.
Otherwise we may return an invalid/truncated clock rate value.

Signed-off-by: Julien Masson <jmasson@baylibre.com>
Fixes: 5c5992cb90 ("clk: Add debugging for return values")
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/87o7erv9p4.fsf@baylibre.com
2024-01-29 22:34:52 -05:00
Neil Armstrong
2da1331d20 clk: meson: add Hardware Clock measure driver
Amlogic SoCs embeds an hardware clock measure block, port it
from Linux and implement it as a UCLK_CLK with only the dump
op and fail-only xlate.

Based on the Linux driver introduced in [1].

[1] commit 2b45ebef39a2 ("soc: amlogic: Add Meson Clock Measure driver").

Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231218-uboot-meson-clk-msr-v3-1-acf4d90ccfee@linaro.org
2024-01-29 22:34:39 -05:00
Tom Rini
6faba41927 Prepare v2024.04-rc1
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-01-29 20:53:19 -05:00
Tom Rini
d5c0c990c3 Pull request efi-2024-04-rc1-4
Documentation:
 
 * uefi: remove ".py" suffix for pytest.py command
 * correct date in migration plan for CONFIG_DM
 
 UEFI:
 
 * fix conflicting SPDX license in RISC-V EFI linker scripts
 * page align EFI binary section in RISC-V EFI binaries
 * separate .data and .text sections of RISC-V EFI binaries
 * use common function to get EFI configuration table
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEK7wKXt3/btL6/yA+hO4vgnE3U0sFAmW4FP0ACgkQhO4vgnE3
 U0ubIQ//b8nZf1lBTesAWjeLeiTrnRkr/yfSlikppDQBaq4kogcU8j5OM4xetVMa
 qtmTZLLVRbJuTVAZSWYm8oPN4+EfSRYzdcQuFTIHS9ZHeVovJ0zwtEp6TG0csPcF
 p1KgWFZuACM4OhYjQvNqUms9oCQbRGsn/GJd1pLacy4oX9cKojM8n9SBJc4x5FSH
 LiN8Fu/Jw10yGwyEL6lkuQUCHysItFRkcc5wVrcQm8oOt+RoT41SgmYmzWZJEoaP
 zGYErYGKNVXmFPFEn3gSzoSisPhuPLf/oYU03kYYmzlhnzUVeHf/V7XC034CCNoI
 V3YB9uHihgGzju9JfLsC5qdZ7QvtE+Pz6/OgJnY4DZMvGZHiziDJZucf/gb8Ms5o
 YXE4oKvEx68qO5rVc4aMtOdeaC4vV9D+ngt6zO70tXnXj108gQ7t74ln9NSwEOpM
 v3M4p9Q4j+md/uRarYjCnF9nXqtlL6G63E1lnIRLnqM8GEVS38RYvfB72hyrr+bb
 fnPGK85ga/z64EET8E2SdwrRkq/M8dr2jqsdUhCWzPBscEaR/8xipvelNpPzHwaC
 M7M8wZIA195FqEpxEXlvmWD2yjav3xIXfUfhttwwe+s/abNzkfi5bOvY67ZbhqE4
 ckRccC44Idh2HdCd+gXr/wFVqqU8wtlf0YpokwgoZHzgauJF7P8=
 =ZGn5
 -----END PGP SIGNATURE-----

Merge tag 'efi-2024-04-rc1-4' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2024-04-rc1-4

Documentation:

* uefi: remove ".py" suffix for pytest.py command
* correct date in migration plan for CONFIG_DM

UEFI:

* fix conflicting SPDX license in RISC-V EFI linker scripts
* page align EFI binary section in RISC-V EFI binaries
* separate .data and .text sections of RISC-V EFI binaries
* use common function to get EFI configuration table
2024-01-29 16:19:10 -05:00
Quentin Schulz
341e8a6c7c tools: buildman: fix non-existing SafeConfigParser in Python 3.12+
SafeConfigParser was renamed back in Python 3.2 (yes, no typo) to
ConfigParser[1], but it was still working as an alias until it got
removed in 3.12[2].

[1] https://docs.python.org/3.8/whatsnew/3.2.html#configparser
[2] https://github.com/python/cpython/pull/92503

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2024-01-29 14:54:15 -05:00