summaryrefslogtreecommitdiff
path: root/drivers/misc
AgeCommit message (Collapse)AuthorFilesLines
2022-09-14misc: usb251xb: Support 8/16 bit device tree valuesStefan Herbrechtsmeier1-10/+10
The device tree binding [1] specify the vendor-id, product-id, device-id and language-id as 16 bit values and the linux driver reads the boost-up value as 8 bit value. [1] https://www.kernel.org/doc/Documentation/devicetree/bindings/usb/usb251xb.txt Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Marek Vasut <marex@denx.de>
2022-08-09misc: atsha204a: Don't check for error when waking up the devicePali Rohár1-5/+6
The device ignores any levels or transitions on the SCL pin when the device is idle, asleep or during waking up. Linux kernel driver for atsha204a (atmel-sha204a.ko) also ignores return value from i2c wakeup send command, see: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/crypto/atmel-i2c.c?h=v5.19#n174 And also userspace Turris libatsha204 library ignores return value from wakeup send command, see: https://gitlab.nic.cz/turris/libatsha204/-/blob/v29.2/src/libatsha204/layer_ni2c.c#L75-76 U-Boot driver should do same thing. Fixes waking up ATSHA204 on Turris 1.x boards. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Paweł Anikiel <pan@semihalf.com> Reviewed-by: Marek Behún <kabel@kernel.org>
2022-08-04Audit <flash.h> inclusionTom Rini1-1/+0
A large number of files include <flash.h> as it used to be how various SPI flash related functions were found, or for other reasons entirely. In order to migrate some further CONFIG symbols to Kconfig we need to not include flash.h in cases where we don't have a NOR flash of some sort enabled. Furthermore, in cases where we are in common code and it doesn't make sense to try and further refactor the code itself in to new files we need to guard this inclusion. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-07-26misc: fuse: update the code for accessing fuse of i.MX93Alice Guo1-12/+74
Sentinel have read access of OTP shadow register 0-511, and fsb have read access of shadow 0-51/312-511. Reviewed-by: Ye Li <ye.li@nxp.com> Signed-off-by: Alice Guo <alice.guo@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-07-26misc: fuse: support to access fuse on i.MX93Alice Guo1-1/+29
i.MX93 fuse can be accessed through FSB and s400-api. Add mapping tables for i.MX93. The offset address of FSB accessing OTP shadow registers is different between i.MX8ULP and i.MX93, so use macro to define the offset address instead of hardcode. Signed-off-by: Alice Guo <alice.guo@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-07-26misc: imx8ulp: move fuse.c from imx8ulp to sentinelAlice Guo4-5/+1
The i.MX93 platform wants to reuse drivers/misc/imx8ulp/fuse.c. Moving fuse.c from the folder imx8ulp to sentinel makes it can be used by other platforms. Signed-off-by: Alice Guo <alice.guo@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-07-26misc: S400_API: Rename imx8ulp_s400_msg to sentinel_msgYe Li2-25/+25
Use more generic name for S40x msg structure Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-07-26misc: s400_api: introduce ahab_release_m33_troutPeng Fan1-0/+25
Introduce Sentinel API ahab_release_m33_trout to make sure sentinel release M33 trout and make sure M33 could boot. Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-07-26misc: S400_API: New API for FW status and chip infoPeng Fan1-0/+61
Add new API to get sentinel FW status and SoC chip info Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-07-26misc: S400_API: Update release RDC APIYe Li1-4/+17
To support more RDC instances on i.MX93, update API to latest definition. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-07-26misc: s4mu: Support iMX93 with Sentinel MUPeng Fan1-0/+1
Support iMX93 communicate with Sentinel Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-07-26misc: imx: S400_API: Move S400 MU and API to a common placeYe Li7-7/+18
Since iMX9 uses S401 which shares the API with iMX8ULP. So move S400 MU driver and API to a common place and selected by CONFIG_IMX_SENTINEL Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-07-21treewide: Fix Marek's name and change my e-mail addressMarek Behún1-1/+1
Fix diacritics in some instances of my name and change my e-mail address to kabel@kernel.org. Add corresponding .mailmap entries. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-07-13Merge tag 'u-boot-stm32-20220712' of ↵Tom Rini1-0/+1
https://source.denx.de/u-boot/custodians/u-boot-stm - Alignment with Linux kernel device tree v5.19 for stm32mp15 and stm32mp13 - Add OP-TEE nodes for stm32mp13x, alligned with upstreamed OP-TEE - Introduce of_to_plat ops in stm32_sdmmc2 driver - Activate more features in stm32mp13 defconfig and support of STM32MP13x Rev.Y - Drop fastboot and stm32prog trigger gpios on STM32MP15x DHCOM board
2022-07-12clk: stm32: add support compatible st, stm32mp1-rcc-securePatrick Delaunay1-0/+1
Add support for new compatible st,stm32mp1-rcc-secure used when the RCC resource is managed by secured world (RCC_TZCR.TZEN=1) iand when SCMI is used. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-07-11Merge branch 'next'Tom Rini12-23/+1209
2022-07-08Merge tag 'dm-pull-28jun22' of ↵Tom Rini2-3/+5
https://source.denx.de/u-boot/custodians/u-boot-dm into next nman external-symbol improvements Driver model memory-usage reporting patman test-reporting improvements Add bloblist design goals
2022-07-07misc: nuvoton: Add host interface configuration driverJim Liu3-0/+117
add nuvoton BMC npcm750 host configuration driver Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2022-07-06Convert CONFIG_SYS_FSL_SEC_MON et al to KconfigTom Rini1-0/+14
This converts the following to Kconfig: CONFIG_SYS_FSL_SEC_MON CONFIG_SYS_FSL_SEC_MON_BE CONFIG_SYS_FSL_SEC_MON_LE Signed-off-by: Tom Rini <trini@konsulko.com>
2022-07-01misc: atsha204a: Increase wake delay by tWHIPaweł Anikiel1-2/+3
From the ATSHA204A datasheet (document DS40002025A): Wake: If SDA is held low for a period greater than tWLO, the device exits low-power mode and, after a delay of tWHI, is ready to receive I2C commands. tWHI value can be found in table 7-2. Signed-off-by: Paweł Anikiel <pan@semihalf.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-06-28misc: i2c_eeprom: remove 24aa02e48Eugen Hristev1-8/+0
This compatible does not exist in the bindings. All occurences in DT have been replaced by at24c02 which is equivalent. Fixes: 7264066707 ("misc: i2c_eeprom: Add compatible for 24AA02E48") Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Reviewed-by: Michael Walle <michael@walle.cc> Reviewed-by: Heiko Schocher <hs@denx.de>
2022-06-28sandbox: cast to pointer from integer of different sizeHeinrich Schuchardt1-1/+1
Building sandbox_defconfig on ARMv7 with HOST_32BIT=y results in: drivers/misc/qfw_sandbox.c:51:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 51 | void *address = (void *)be64_to_cpu(dma->address); Add the missing type conversion. Fixes: 69512551aa84 ("test: qemu: add qfw sandbox driver, dm tests, qemu tests") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2022-06-28dm: core: Support accessing core tagsSimon Glass1-1/+3
At present tag numbers are only allocated for non-core data, meaning that the 'core' data, like priv and plat, are accessed through dedicated functions. For debugging and consistency it is convenient to use tags for this 'core' data too. Add support for this, with new tag numbers and functions to access the pointer and size for each. Update one of the test drivers so that the uclass-private data can be tested here. There is some code duplication with functions like device_alloc_priv() but this is not addressed for now. At some point, some rationalisation may help to reduce code size, but more thought it needed on that. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-06-28dm: core: Switch the testbus driver to use a new structSimon Glass1-1/+1
At present this driver uses 'priv' struct to hold 'plat' data, which is confusing. The contents of the strct don't matter, since only dtoc is using it. Create a new struct with the correct name. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-06-23misc: nuvoton: Add NPCM7xx otp controller driverJim Liu3-0/+522
Add Nuvoton BMC npcm750 otp driver Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2022-06-20Merge branch 'master' into nextTom Rini3-0/+615
Merge in v2022.07-rc5.
2022-06-20Merge tag 'u-boot-stm32-20220620' of ↵Tom Rini1-0/+6
https://source.denx.de/u-boot/custodians/u-boot-stm into next - Add STM32MP13 SoCs support with associated board STM32M135F-DK - Correct livetree support in stm32mp1 boards - Activate livetree for stm32mp15 DHSOM boards
2022-06-20arm: layerscape: Add sfp driverSean Anderson3-0/+365
This adds a driver for the Security Fuse Processor (SFP) present on LS1012A, LS1021A, LS1043A, and LS1046A processors. It holds the Super-Root Key (SRK), One-Time-Programmable Master Key (OTPMK), and other "security" related fuses. Similar devices (sharing the same name) are present on other processors, but for the moment this just supports the LS2 variants. The mirror registers are loaded during power-on reset. All mirror registers must be programmed or read at once. Because of this, `fuse prog` will program all fuses, even though only one might be specified. To prevent accidentally burning through all your fuse programming cycles with something like `fuse prog 0 0 A B C D`, we limit ourselves to one programming cycle per reset. Fuses are numbered based on their address. The fuse at 0x1e80200 is 0, the fuse at 0x1e80204 is 1, etc. The TA_PROG_SFP supply must be enabled when programming fuses, but must be disabled when reading them. Typically this supply is enabled by inserting a jumper or by setting a register in the board's FPGA. I've also added support for using a regulator. This could be helpful for automatically issuing the FPGA write, or for toggling a GPIO controlling the supply. I suggest using the following procedure for programming: 1. Override the fuses you wish to program => fuse override 0 2 A B C D 2. Inspect the values and ensure that they are what you expect => fuse sense 0 2 4 3. Enable TA_PROG_SFP 4. Issue a program command using OSPR0 as a dummy. Since it contains the write-protect bit you will usually want to write it last anyway. => fuse prog 0 0 0 5. Disable TA_PROG_SFP 6. Read back the fuses and ensure they are correct => fuse read 0 2 4 Signed-off-by: Sean Anderson <sean.anderson@seco.com>
2022-06-17misc: stm32mp13: introduce STM32MP13 RCC driverPatrick Delaunay1-0/+6
Add the MISC RCC driver for STM32MP13, and bind it to the RCC reset driver, required for initial support. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Acked-by: Sean Anderson <seanga2@gmail.com> Change-Id: Ida11c15462caf140f87b1e3239efa2b8a689acb9
2022-06-08test: Load mac address using misc deviceSean Anderson1-0/+3
This loads a mac address using a misc device using the nvmem interface. Signed-off-by: Sean Anderson <sean.anderson@seco.com>
2022-06-08test: Load mac address with i2c eepromSean Anderson1-0/+4
This uses an i2c eeprom to load a mac address using the nvmem interface. Enable I2C_EEPROM for sandbox SPL since it is the only sandbox config which doesn't enable it eeprom. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-06-08misc: Add support for nvmem cellsSean Anderson3-0/+159
This adds support for "nvmem cells" as seen in Linux. The nvmem device class in Linux is used for various assorted ROMs and EEPROMs. In this sense, it is similar to UCLASS_MISC, but also includes UCLASS_I2C_EEPROM, UCLASS_RTC, and UCLASS_MTD. New drivers corresponding to a Linux-style nvmem device should be implemented as one of the previously-mentioned uclasses. The nvmem API acts as a compatibility layer to adapt the (slightly different) APIs of these uclasses. It also handles the lookup of nvmem cells. While nvmem devices can be accessed directly, they are most often used by reading/writing contiguous values called "cells". Cells typically hold information like calibration, versions, or configuration (such as mac addresses). nvmem devices can specify "cells" in their device tree: qfprom: eeprom@700000 { #address-cells = <1>; #size-cells = <1>; reg = <0x00700000 0x100000>; /* ... */ tsens_calibration: calib@404 { reg = <0x404 0x10>; }; }; which can then be referenced like: tsens { /* ... */ nvmem-cells = <&tsens_calibration>; nvmem-cell-names = "calibration"; }; The tsens driver could then read the calibration value like: struct nvmem_cell cal_cell; u8 cal[16]; nvmem_cell_get_by_name(dev, "calibration", &cal_cell); nvmem_cell_read(&cal_cell, cal, sizeof(cal)); Because nvmem devices are not all of the same uclass, supported uclasses must register a nvmem_interface struct. This allows CONFIG_NVMEM to be enabled without depending on specific uclasses. At the moment, nvmem_interface is very bare-bones, and assumes that no initialization is necessary. However, this could be amended in the future. Although I2C_EEPROM and MISC are quite similar (and could likely be unified), they present different read/write function signatures. To abstract over this, NVMEM uses the same read/write signature as Linux. In particular, short read/writes are not allowed, which is allowed by MISC. The functionality implemented by nvmem cells is very similar to that provided by i2c_eeprom_partition. "fixed-partition"s for eeproms does not seem to have made its way into Linux or into any device tree other than sandbox. It is possible that with the introduction of this API it would be possible to remove it. Signed-off-by: Sean Anderson <sean.anderson@seco.com>
2022-06-08misc: i2c_eeprom: Make i2c_eeprom_write use a const bufSean Anderson1-1/+2
i2c_eeprom_ops->write uses a const buf, so use one for the wrapper function as well. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-06-07misc: Port USB251xB/xBi Hi-Speed Hub Controller Driver from LinuxMarek Vasut3-0/+615
This patch adds a driver for configuration of the Microchip USB251xB/xBi USB 2.0 hub controller series with USB 2.0 upstream connectivity, SMBus configuration interface and two to four USB 2.0 downstream ports. This is ported from Linux as of Linux kernel commit 5c2b9c61ae5d8 ("usb: usb251xb: add boost-up property support") Signed-off-by: Marek Vasut <marex@denx.de> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Simon Glass <sjg@chromium.org>
2022-06-07misc: Correct Kconfig dependencies for a number of optionsTom Rini1-11/+12
We have many cases of SPL (or TPL or VPL) drivers that don't depend on SPL_MISC (and so on) but rather just MISC. Cc: Sean Anderson <sean.anderson@seco.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
2022-05-20i.MX8ULP: add display_ele_fw_version apiGaurav Jain1-0/+41
implement get f/w version api. print ele f/w version in spl. Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Pankaj Gupta <pankaj.gupta@nxp.com>
2022-05-10Merge tag 'i2c-2022-07' of https://source.denx.de/u-boot/custodians/u-boot-i2cTom Rini1-0/+1
i2c changes for 2022.07 - i2c: ihs: intel: Fix typo in comments Patch from Michal - misc: atsha204a: Add support for atsha204 chip from Pali
2022-05-10misc: Fix always compiling MISC even for SPL/TPLSean Anderson2-1/+13
We should only build support for misc if the appropriate SPL/TPL symbol is defined. To ease the transition, make SPL/TPL_MISC default to MISC. This is necessary because many drivers don't specify their dependencies properly. These defaults can be removed once all drivers depend on the appropriate config. Fixes: aaba703fd0 ("spl: misc: Allow misc drivers in SPL and TPL") Signed-off-by: Sean Anderson <sean.anderson@seco.com> [trini: Add VPL_MISC symbol, handle like SPL/TPL_MISC] Signed-off-by: Tom Rini <trini@konsulko.com>
2022-05-10misc: atsha204a: Add support for atsha204 chipPali Rohár1-0/+1
atsha204 chip is predecessor of atsha204a chip. Current U-Boot driver atsha204a-i2c.c can use both atsha204 and atsha204a chips because it does not call specific functions to just one of these chips. So just add compatible string for atsha204. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2022-05-06misc: fs_loader: Fix compile warnings when CONFIG_CMD_UBIFS is enabledPali Rohár1-0/+4
drivers/misc/fs_loader.c: In function ‘mount_ubifs’: drivers/misc/fs_loader.c:46:12: warning: implicit declaration of function ‘ubi_part’ [-Wimplicit-function-declaration] int ret = ubi_part(mtdpart, NULL); ^~~~~~~~ drivers/misc/fs_loader.c:53:9: warning: implicit declaration of function ‘cmd_ubifs_mount’ [-Wimplicit-function-declaration] return cmd_ubifs_mount(ubivol); ^~~~~~~~~~~~~~~ drivers/misc/fs_loader.c: In function ‘umount_ubifs’: drivers/misc/fs_loader.c:58:9: warning: implicit declaration of function ‘cmd_ubifs_umount’ [-Wimplicit-function-declaration] return cmd_ubifs_umount(); ^~~~~~~~~~~~~~~~ Signed-off-by: Pali Rohár <pali@kernel.org>
2022-05-02vpl: Add Kconfig options for VPLSimon Glass1-0/+28
Add VPL versions of commonly used Kconfig options. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-21misc: atsha204a: Remove duplicate CRC-16 implementationPali Rohár2-119/+4
ATSHA204A uses bit-reversed checksum of standard CRC-16 with polynomial x^16 + x^15 + x^2 + 1. This ATSHA204A specific checksum can be calculated just by using common U-Boot functions bitrev16() and crc16(). So replace custom driver CRC-16 implementation by common U-Boot functions. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-04-14Remove duplication of table_compute_checksum functionTom Rini1-3/+0
It seems like there was some merge error when first cleaning up and sharing this function. We have both an inline version of the function in include/tables_csum.h and a non-inline version in lib/tables_csum.c. Rework things so that we only have the non-inline version (due to number of calls, we should not inline this). Fixes: 1befb38b8682 ("x86: Move table csum into separate file") Fixes: 2b445e4d3194 ("x86: Move table csum into separate header") Cc: Alexander Graf <agraf@csgraf.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2022-04-14misc: atsha204a: Fix big endian supportPali Rohár1-1/+1
Callers of function atsha204a_crc16() expect to return value in host cpu endianity. So remove cpu_to_le16() conversion. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2022-04-12misc: imx8ulp: Update fuse driverPeng Fan1-1/+2
- According to S400 API, the fuse bank 25 (Testconfig2) is able to access. Add it into driver's mapping table. - According to FSB words list, the reserved 48 words are ahead of the bank 5 and bank 6. Fix the wrong position. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-04-12misc: S400_API: Update S400 API for buffer dumpYe Li1-0/+34
Add ahab_dump_buffer API to dump AHAB buffer for debug purpose Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-04-12misc: S400_API: add ahab_release_caamClement Faure1-0/+29
Add ahab_release_caam() function to the S400 API. Signed-off-by: Clement Faure <clement.faure@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-04-12misc: imx8ulp: Add OEM SRK Hash fuse supportYe Li1-0/+1
Since latest S400 firmware has supported to read OEM SRK Hash, add it to the driver's table Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-04-12drivers: misc: add Gateworks System Controller driverTim Harvey3-0/+642
Add a driver for the Gateworks System Controller used on Gateworks boards which provides a boot watchdog, power control, temperature monitor, and voltage ADCs. Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2022-04-05misc: k3_esm: Add functionality to set and route error events within K3SoCHari Nagalla1-3/+50
Add functionality to enable, set priority to the input events and to route to MCU ESM. On AM64x/AM62x devices, it is possible to route Main ESM0 error events to MCU ESM. When these error events are routed to MCU ESM high output, it can trigger the reset logic to reset the device, when CTRLMMR_MCU_RST_CTRL:MCU_ESM_ERROR_RESET_EN_Z is set to '0'. K3 based J7 devices (ex: J721e) also have ESM modules, and the changes to the driver does not impact those devices. Signed-off-by: Hari Nagalla <hnagalla@ti.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>