aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc
AgeCommit message (Collapse)Author
2024-05-06global: Audit usage of <eeprom.h>Tom Rini
The file include/eeprom.h is used only in some legacy non-DM I2C EEPROM access cases. Remove most inclusions of this file as they are not needed. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-04-26rockchip: io-domain: Add support for RK3328Jonas Karlman
Port the RK3328 part of the Rockchip IO-domain driver from linux. This differs from linux version in that pmu io iodomain bit is enabled in the write ops instead of in an init ops as in linux, this way we can avoid keeping a full state of all supply that have been configured. Enable by default on all RK3328 boards, skip rk3328-evb because this target is typically also used on miscellaneous boards and boxes not fully supported by U-Boot. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2024-04-15drivers: misc: Fixes: Rename CONFIG_SPL_SOCFPGA_SEC_REG to ↵Wan Yee Lau
CONFIG_SPL_SOCFPGA_DT_REG Commit 3f190c55a4211215914126b74357344342329943 ("drivers: misc: Add socfpga_dtreg driver for Intel SoCFPGA") This commit rename CONFIG_SPL_SOCFPGA_SEC_REG to CONFIG_SPL_SOCFPGA_DT_REG in Makefile. Signed-off-by: Wan Yee Lau <wan.yee.lau@intel.com>
2024-04-04misc: turris_omnia_mcu: Add support for rng provided by MCUMarek Behún
Add support for true random number generator provided by the MCU on Turris Omnia. The MCU firmware supports TRNG if the FEAT_TRNG bit is set in features. In that case we bind the rng driver. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2024-04-04gpio: turris_omnia_mcu: Add support for system power off via sysresetMarek Behún
Add support for system power off via UCLASS_SYSRESET. Newer versions of Turris Omnia MCU firmware can power off the board (MCU will disable almost all voltage regulators and go into low power mode). Move the MCU driver into drivers/misc and register it under UCLASS_MISC. The sysreset and gpio device are bound as child devices of the MCU device. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2024-03-24imx: ele_ahab: Add ahab_commit command supportMathieu Othacehe
This message is used to commit into the fuses any new SRK revocation and FW version information that have been found into the NXP (ELE FW) and OEM containers. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2024-03-19Merge tag 'u-boot-socfpga-next-20240319' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-socfpga into next - A new driver in the misc to register setting from device tree. This also provides user a clean interface and all register settings are centralized in one place, device tree. - Enable Agilex5 platform for Intel product. Changes, modification and new files are created for board, dts, configs and makefile to create the base for Agilex5. Build-tested on SoC64 boards, boot tested on some of them.
2024-03-18drivers: misc: Add socfpga_dtreg driver for Intel SoCFPGAWan Yee Lau
Add socfpga_dtreg driver enablement for Intel SoCFPGA. Signed-off-by: Wan Yee Lau <wan.yee.lau@intel.com> Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
2024-03-14rockchip: io-domain: Add support for RK3399Jonas Karlman
Port the RK3399 part of the Rockchip IO-domain driver from linux. This differs from linux version in that pmu io iodomain bit is enabled in the write ops instead of in an init ops as in linux, this way we can avoid keeping a full state of all supply that have been configured. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2024-03-05misc: atsha204a: fix wakeup functionMichał Barnaś
The ATSHA204A chip requires SDA line to go low for at least 60us to wake up the chip. Previous implementation did not meet this requirement due to the NAK received on bus and not sending the zeroes. The function to ignore the NAK and send bytes regardless is not supported in the u-boot making it impossible to wake up the chip this way. Instead, the bus speed, if needed, is set to lowest value and the message is sent to the address 0x0. This way, the address of zero makes the SDA line go low for about 80us, meeting the required time to wake up the chip. The zero length packet is not sent by the i2c, so the one byte is sent to the transfer function, but only the address is sent anyway. After sending the zero address, the bus speed is restored to the previous value if it was slowed down to wake up the chip. Signed-off-by: Michał Barnaś <barnas@google.com>
2024-03-05misc: atsha204a: fix sleep functionMichał Barnaś
Fix the sleep function to issue the sleep command instead of idle one. Signed-off-by: Michał Barnaś <barnas@google.com>
2024-03-05misc: atsha204a: remove broken for loopMichał Barnaś
Some previous commit changed the continue statement to return, making the for loop used to retry waking up the chip to always return after one iteration. This commit removes the loop, cleaning the code a little. Signed-off-by: Michał Barnaś <barnas@google.com>
2024-02-08imx: scu_api: add implementation of sc_pm_reset_reasonIgor Opaniuk
Add implementation of sc_pm_reset_reason() call for obtaining reset reason. Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
2024-02-02smbios: correctly name Structure Table Maximum Size fieldHeinrich Schuchardt
In the SMBIOS 3 entry point the Structure Table Maximum Size field was incorrectly named max_struct_size. A Maximum Structure Size field only exists in the SMBIOS 2.1 entry point and has a different meaning. Call the Structure Table Length field table_maximum_size. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-01-29treewide: Remove clk_freeSean Anderson
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-26smbios: use struct_table_length to get SMBIOS 2.1 total table lengthMasahisa Kojima
The current code convert the SMBIOS 2.1 entry point structure to SMBIOS 3.0 entry point structure. The max_struct_size member in SMBIOS 2.1 entry point structure indicates "Size of the largest SMBIOS structure, in bytes". We need to use struct_table_length instead. Fixes: 1c5aab803c0b ("smbios: copy QEMU tables") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2024-01-16smbios: copy QEMU tablesHeinrich Schuchardt
QEMU provides SMBIOS tables with detailed information. We should not try to replicate them in U-Boot. If we want to inform about U-Boot, we can add a Firmware Inventory Information (type 45) table in future. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2024-01-16serial: msm-geni: don't rely on parent misc deviceCaleb Connolly
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>
2024-01-07acpi: enable writing ACPI tables on QEMUHeinrich Schuchardt
Invoke write_acpi_tables() via EVT_LAST_STAGE_INIT on QEMU except on X86. X86 calls write_acpi_tables() in write_tables(). Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2024-01-07acpi: carve out qfw_acpi.cHeinrich Schuchardt
Move the code related to copying tables from QEMU to a separate code module. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-01-07acpi: Kconfig symbol CONFIG_QFW_ACPIHeinrich Schuchardt
We have two implementations of write_acpi_tables(). One for writing ACPI tables based on ACPI_WRITER() entries another based on copying tables from QEMU. Create a symbol CONFIG_QFW_ACPI that signifies copying ACPI tables from QEMU and use it consistently. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-12-18Merge tag 'v2024.01-rc5' into nextTom Rini
Prepare v2024.01-rc5
2023-12-13acpi: move acpi_get_rsdp_addr() to acpi/acpi_table.hHeinrich Schuchardt
Function acpi_get_rsdp_addr() is needed on all architectures which write ACPI tables. Move the definition from the x86 include to an architecture independent one. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-12-13Merge patch series "bootm: Refactoring to reduce reliance on CMDLINE (part A)"Tom Rini
To quote the author: It would be useful to be able to boot an OS when CONFIG_CMDLINE is disabled. This could allow reduced code size. Standard boot provides a way to handle programmatic boot, without scripts, so such a feature is possible. The main impediment is the inability to use the booting features of U-Boot without a command line. So the solution is to avoid passing command arguments and the like to code in boot/ A similar process has taken place with filesystems, for example, where we have (somewhat) separate Kconfig options for the filesystem commands and the filesystems themselves. This series starts the process of refactoring the bootm logic so that it can be called from standard boot without using the command line. Mostly it removes the use of argc, argv and cmdtbl from the internal logic. Some limited tidy-up is included, but this is kept to smaller patches, rather than trying to remove all #ifdefs etc. Some function comments are added, however. A simple programmatic boot is provided as a starting point. This work will likely take many series, so this is just the start. Size growth with this series for firefly-rk3288 (Thumb2) is: arm: (for 1/1 boards) all +23.0 rodata -49.0 text +72.0 This should be removed by: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/11 but it is not included in this series as it is already large enough. No functional change is intended in this series. Changes in v3: - Add a panic if programmatic boot fails - Drop RFC tag Changes in v2: - Add new patch to adjust position of unmap_sysmem() in boot_get_kernel() - Add new patch to obtain command arguments - Fix 'boot_find_os' typo - Pass in the command name - Use the command table to provide the command name, instead of "bootm"
2023-12-13command: Introduce functions to obtain command argumentsSimon Glass
Add some functions which provide an argument to a command, or NULL if the argument does not exist. Use the same numbering as argv[] since it seems less confusing than the previous idea. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Tom Rini <trini@konsulko.com>
2023-12-13drivers: misc: Kconfig: Fix SPL_FS_LOADER promptAlexander Gendin
Both FS_LOADER and SPL_FS_LOADER have the same menu prompt. To avoid confusion, make prompt for SPL_FS_LOADER different. Signed-off-by: Alexander Gendin <agendin@matrox.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-10Merge branch '2023-11-10-assorted-fixes'Tom Rini
- Fix some issues Coverity has reported, update MAINTAINERS file, another bootstd fix, typo fix in error message, gitignore fix and update TI's URL in many places.
2023-11-10tree-wide: Replace http:// link with https:// link for ti.comNishanth Menon
Replace instances of http://www.ti.com with https://www.ti.com Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-10rockchip: otp: Add support for RV1126Tim Lunn
Extend the otp driver to read rv1126 otp. This driver code was adapted from the Rockchip BSP stack. Signed-off-by: Tim Lunn <tim@feathertop.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-11-02cros_ec: spi: disable annoying key echo on consoleMilan P. Stanić
on Peach-pi console every key press is echoed with message 'cros_ec_command: Returned status 1' this is not proper fix, just hack to disable this message Signed-off-by: Milan P. Stanić <mps@arvanta.net> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-10-30misc: i2c_eeprom: consider pagesize when writing to eepromMichel Alex
Calculate the maximum length of the buffer when writing across the page boundary. If the buffer length (len) exceeds the page boundary (pagesize), split it. Use this length instead of comparing the length with the pagesize, because if the write start address (offset) is not at the beginning of a page and the page_offset + len is greater than the page boundary (pagesize), the write operation would overflow the current page and the behaviour can be undefined (e.g. at24). Signed-off-by: Alex Michel <alex.michel@wiedemann-group.com>
2023-10-30Kconfig: Remove all default n/no optionsMichal Simek
Similar change was done by commit b4c2c151b14b ("Kconfig: Remove all default n/no options") and again sync is required. default n/no doesn't need to be specified. It is default option anyway. Signed-off-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Svyatoslav Ryhel <clamor95@gmail.com> # tegra Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Angelo Dureghello <angelo@kernel-space.org>
2023-10-27driver: misc: k3_avs: Add support for thermal shutdownUdit Kumar
To avoid thermal burn out, program thermal shutdown value in VTM (Voltage and Thermal Manager) IP. Part of Linux kernel driver (drivers/thermal/k3_j72xx_bandgap.c) is ported from kernel 6.6-rc1, which sets thermal shutdown values. Signed-off-by: Udit Kumar <u-kumar1@ti.com> Signed-off-by: Neha Francis <n-francis@ti.com>
2023-10-27misc: vexpress_config: Use member .priv_auto to set the private dataWei Chen
In current vexpress_config_probe code, it sets the uclass private data directly. This will cause one compilation error: drivers/misc/vexpress_config.c:114:27: error: lvalue required as left operand of assignment 114 | dev_get_uclass_priv(dev) = priv; | ^ In this patch we set the uclass private data through struct member .priv_auto, and this compilation error disappears. Signed-off-by: Wei Chen <wei.chen@arm.com> Signed-off-by: Qi Feng <qi.feng@arm.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2023-10-18eeprom: at24: add ST M24C32-D Additional Write lockable page supportMarek Vasut
The ST M24C32-D behaves as a regular M24C32, except for the -D variant which uses up another I2C address for Additional Write lockable page. This page is 32 Bytes long and can contain additional data. Add entry for it, so users can describe that page in DT. Note that users still have to describe the main M24C32 area separately as that is on separate I2C address from this page. From Linux kernel commit: 4791146e9055 ("eeprom: at24: add ST M24C32-D Additional Write lockable page support") Signed-off-by: Marek Vasut <marex@denx.de>
2023-10-11misc: fs_loader: Fix alignment of fs_loader driverSean Anderson
DM_DRIVER_GET will redeclare the fs_loader driver without the correct alignment. This causes GCC to use the default section alignment of 32 bytes. This in turn creates a gap in the linker list due to the padding required to achieve the correct alignment, corrupting all further entries. Use DM_DRIVER_REF instead, which doesn't redeclare anything. Fixes: 0998a20cfc6 ("misc: fs_loader: Add function to get the chosen loader") Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-10-08Merge tag 'u-boot-rockchip-20231007' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-rockchip - Add Board: rk3568 Bananapi R2Pro; - Update pcie bifurcation support; - dwc_eth_qos controller support for rk3568 and rk3588; - Compressed binary support for U-Boot on rockchip platform; - dts and config updates for different board and soc; [ trini: Fix conflict on include/spl.h ] Signed-off-by: Tom Rini <trini@konsulko.com>
2023-10-07rockchip: Port IO-domain driver for RK3568 from linuxJonas Karlman
Port the Rockchip IO-domain driver for RK3568 from linux. The driver auto probe after bind to configure IO-domain based on the regulator voltage. Compared to the linux driver this driver is not notified about regulator voltage changes and only configure IO-domain based on the initial voltage autoset by the regulator. It is not recommended to enable MMC_IO_VOLTAGE or the mmc signal voltage and IO-domain may end up out of sync. Based on the linux commit 28b05a64e47c ("soc: rockchip: io-domain: add rk3568 support"). Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-10-06sandbox: Init the EC properly even if no state file is availableSimon Glass
This currently relies on sandbox attempting to read a state file. At present it always does, even when there is no state file, in which case it fails, but still inits the EC. That is a bug, so update this driver to set the current image always, even if no state is read. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-09-24common: Drop linux/printk.h from common headerSimon Glass
This old patch was marked as deferred. Bring it back to life, to continue towards the removal of common.h Move this out of the common header and include it only where needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-09-22x86: Update cbmem driverSimon Glass
This driver is not actually built since a Kconfig was never created for it. Add a Kconfig (which is already implied by COREBOOT) and update the implementation to avoid using unnecessary memory. Drop the #ifdef at the top since we can rely on Kconfig to get that right. To enable it (in addition to serial and video), use: setenv stdout serial,vidconsole,cbmem Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [Modified the comment about overflow a little bit] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2023-09-19drivers: misc: k3_avs: Add Linux compatibles to maintain syncReid Tonking
The ti,j7200-vtm and ti,j721e-vtm compatibles are used for voltage and thermal monitoring (VTM) by (drivers/thermal/k3_j72xx_bandgap.c) in Linux, but the same hardware is used for adaptive voltage scaling (AVS) in u-boot, This brings both drivers in line with the same compatibles. Since the j7200 uses the config as the j721e, the data is inherited from j721e vs creating a duplicate Signed-off-by: Neha Francis <n-francis@ti.com> Signed-off-by: Reid Tonking <reidt@ti.com> Reviewed-by: Nishanth Menon <nm@ti.com>
2023-08-09Kconfigs: Correct default of "0" on hex type entriesTom Rini
It is not a parse error to have a default value of "0" for a "hex" type entry, instead of "0x0". However, "0" and "0x0" are not treated the same even by the tools themselves. Correct this by changing the default value from "0" to "0x0" for all hex type questions that had the incorrect default. Fix one instance (in two configs) of a default of "0" being used on a hex question to be "0x0". Remove the cases where a defconfig had set a value of "0x0" to be used as the default had been "0". Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-08cros_ec: Fix an error code is cros_ec_get_sku_id()Dan Carpenter
The ec_command_inptr() function returns negative error codes or the number of bytes that it was able to read. The cros_ec_get_sku_id() function should return negative error codes. Right now it returns positive error codes or negative byte counts. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-17x86: Record the start and end of the tablesSimon Glass
The ACPI tables are special in that they are passed to EFI as a separate piece, independent of other tables. Also they can be spread over two areas of memory, e.g. with QEMU we end up with tables kept in high memory as well. Add new global_data fields to hold this information and update the bdinfo command to show the table areas. Move the rom_table_end variable into the loop that uses it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17qfw: Set the address of the ACPI tablesSimon Glass
Once the ACPI tables have been set up, record their address so that it is possible to list them with 'acpi list'. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-14misc: npcm_host_intf: change initialization sequenceJim Liu
configuration should be done before release host wait Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2023-07-14misc: nuvoton: fix type errorJim Liu
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2023-07-13imx: imx8ulp: start the ELE RNG at bootPeng Fan
On the imx8ulp A1 SoC, the ELE RNG needs to be manually started. Signed-off-by: Clement Faure <clement.faure@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2023-07-13imx: misc: ele_mu: Update ELE MU driverYe Li
Extend the RX timeout value to 10s, because when authentication is failed the ELE needs long time (>2s for 28M image) to return the result. Print rx wait info per 1s. Also correct TX and RX status registers in debug. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>