summaryrefslogtreecommitdiff
path: root/drivers/i2c
AgeCommit message (Collapse)Author
2025-09-30Merge tag 'u-boot-socfpga-next-20250930' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-socfpga into next SoCFPGA updates for v2025.10: CI: https://source.denx.de/u-boot/custodians/u-boot-socfpga/-/pipelines/27762 This pull request brings a set of updates across SoCFPGA platforms covering Agilex5, Agilex7, N5X, and Stratix10. The changes include: * Agilex5 enhancements: - USB3.1 enablement and DWC3 host driver support - System Manager register configuration for USB3 - Watchdog timeout increase and SDMMC clock API integration - dcache handling improvements in SMC mailbox path - Enable SPL_SYS_DCACHE_OFF in defconfig * Clock driver improvements: - Introduce dt-bindings header for Agilex clocks - Add enable/disable API and EMAC clock selection fixes - Replace manual shifts with FIELD_GET usage * DDR updates: - IOSSM mailbox compatibility check - Correct DDR calibration status handling * Device tree changes: - Agilex5: disable cache allocation for reads - Stratix10: add NAND IP node - Enable driver model watchdog - Enable USB3.1 node for Agilex5 * Config cleanups: - Simplify Agilex7 VAB defconfig - Remove obsolete SYS_BOOTM_LEN from N5X VAB config - Enable CRC32 support for SoCFPGA - Increase USB hub debounce timeout Overall this set improves reliability of DDR and cache flows, adds missing USB and MMC features for Agilex5, and refines clock and configuration handling across platforms. This patch set has been tested on Agilex 5 devkit, and Agilex devkit.
2025-09-29i2c: designware_i2c: Don't warn if reset DT property is not presentMaksim Kiselev
If reset property is missing in DT, then we get this warning: designware_i2c@0: Can't get reset: -2 Avoid this by checking if reset DT property is present, first. Fixes: 622597dee4f ("i2c: designware: add reset ctrl to driver") Signed-off-by: Maksim Kiselev <[email protected]> Reviewed-by: Heiko Schocher <[email protected]> Reviewed-by: Peng Fan <[email protected]>
2025-09-10i2c: davinci: prefer kernel types (u8/u32)Bhimeswararao Matsa
Replace uint8_t/uint32_t with u8/u32 to match U-Boot style (checkpatch PREFER_KERNEL_TYPES). No functional change. Signed-off-by: Bhimeswararao Matsa <[email protected]>
2025-08-22i2c: omap24xx_i2c: remove unused members of struct omap_i2cRasmus Villemoes
The clk and clk_id members of struct omap_i2c are not used anywhere, and AFAICT never have been. Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Aniket Limaye <[email protected]>
2025-08-18i2c: npcm: fix consecutive dm_i2c_read/write errorStanley Chu
When doing a dm_i2c_read followed by a dm_i2c_write, the subsequent transaction may get npcm_i2c_check_sda error because the module is still busy in STOP condition in previous dm_i2c_read. Always check and wait for module to be out of busy before starting an i2c transaction. Signed-off-by: Stanley Chu <[email protected]> Signed-off-by: Jim Liu <[email protected]>
2025-08-06i2c: rcar_iic: Do not use unitialised variableAndrew Goodbody
In rcar_iic_xfer if nmsgs == 0 the ret will not be assigned to. As ret will always be 0 if the for loop is entered, may as well just return 0. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2025-07-16i2c: Kconfig: Tighten some i2c driver dependenciesTom Rini
A few i2c drivers cannot build without access to some platform specific header files. Express those requirements in Kconfig as well. Signed-off-by: Tom Rini <[email protected]>
2025-07-16i2c: Add missing <linux/delay.h> to iproc_i2c.cTom Rini
This driver makes delay function calls while relying on an indirection inclusion of <linux/delay.h>. Add the missing include directly. Signed-off-by: Tom Rini <[email protected]>
2025-07-12i2c: muxes: Add PCA9541 i2c arbitrator driverPadmarao Begari
Add a driver for the PCA9541 i2c bus arbitrator based on the Linux driver for the same device. Co-developed-by: Jonathan Stroud <[email protected]> Signed-off-by: Jonathan Stroud <[email protected]> Signed-off-by: Padmarao Begari <[email protected]>
2025-07-12i2c: muxes: pca954x: add pca9545 supportFrank Wunderlich
Add support for 4 channel pca9545 found on Bananapi R4. Signed-off-by: Frank Wunderlich <[email protected]> Acked-by: Michal Simek <[email protected]>
2025-07-11Kconfig: Test for !COMPILE_TEST in some locationsTom Rini
We have a few options that we cannot enable in a "allyesconfig" type build because we cannot use zero as a default value. - The logic around HAS_BOARD_SIZE_LIMIT assumes that if we have set this then we compare with it. Similarly, we need to set SPL_NO_BSS_LIMIT as the default there. - Both SYS_CUSTOM_LDSCRIPT and ENV_USE_DEFAULT_ENV_TEXT_FILE then prompt for a file name to use. - The SYS_I2C_SOFT driver is a legacy driver which requires a lot of configuration within the board config. file instead, so disable it. Signed-off-by: Tom Rini <[email protected]>
2025-06-24i2c: mux: Fix the crash when the i2c-arbitrator node is presentVenkatesh Yadav Abbarapu
Observing the crash when we add the i2c-arbitrator node in the device tree as per the DT bindings. The issue is with the child node of i2c-arbitrator@72 i.e., i2c@f1950000->i2c-arbitrator@72->i2c-arb, as the arbitrator uses the uclass of mux(UCLASS_I2C_MUX) and the mux uclass driver checks for the "reg" property using the i2c_mux_child_post_bind() function, if it won't find the "reg" property it will return -EINVAL which is leading to the crash. So, add the logic to check whether the child node has the "reg" property, if the "reg" property exists then read the "reg" and update the channel. https://www.kernel.org/doc/Documentation/devicetree/bindings/i2c/i2c-arb.txt Signed-off-by: Venkatesh Yadav Abbarapu <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2025-06-02i2c: designware_i2c Return -ETIMEDOUT for timeout errorsWojciech Szamocki
Change the return value for timeout errors in i2c-designware from 1 to -ETIMEDOUT. Returning errors as negative values is standard practice in the u-boot, which enhances error handling consistency across the codebase. The current behavior can lead to silent errors when functions check for negative return values to identify errors. For example, in `dm_i2c_reg_read` from i2c-uclass.c, a timeout results in an uninitialized value being returned, potentially causing unexpected behavior. Cc: Heiko Schocher <[email protected]> Cc: Tom Rini <[email protected]> Cc: Wojciech Szamocki <[email protected]> Signed-off-by: Wojciech Szamocki <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2025-04-22i2c: mediatek: remove duplicate entry in mt_i2c_regs_v1[]Martin Schiller
This removes a duplicate entry in mt_i2c_regs_v1[]. Signed-off-by: Martin Schiller <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2025-04-22i2c: mediatek: add missing empty entry at end of mkt_i2c_ids[]Martin Schiller
This adds the missing empty entry at the end of mtk_i2c_ids[]. Signed-off-by: Martin Schiller <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2025-04-22drivers: i2c: Kconfig: Add CONFIG_SYS_I2C_OMAP24XX_REPEATED_STARTAniket Limaye
Add a Kconfig option to disable sending Stop conditions between multiple i2c_msgs within a single xfer. Enable this config by default for ARCH_K3 platforms. Signed-off-by: Aniket Limaye <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2025-04-22i2c: omap24xx_i2c: support CONFIG for repeated start in DM_I2C xferAniket Limaye
Repeated Start Condition (Sr) can be used to transfer multiple i2c msgs without sending a Stop condition (P). So far, the driver default was to always send a Stop condition after every i2c msg. Add support for a config option (CONFIG_SYS_I2C_OMAP24XX_REPEATED_START) to disable sending the Stop condition by default. If this config is enabled, Stop condition will be sent only if explicitly requested in the msg flags OR if it is the last msg in the transfer. Consequently, handle the Repeated Start condition (Sr) in the next msg by not calling the wait_for_bb() check since it will simply timeout in the absence of a stop condition (BB will be 1 until Stop is programmed) Signed-off-by: Aniket Limaye <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2025-04-22i2c: omap24xx_i2c: Use new function __omap24_i2c_xfer_msg()Aniket Limaye
Remove __omap24_i2c_read/write() usage from omap_i2c_xfer() in favour of the more flexible __omap24_i2c_xfer_msg(). Consequently, these are also no longer needed when DM_I2C is enabled. New function __omap24_i2c_xfer_msg() will take care of individual read OR write transfers with a target device. It goes through below sequence: - Program the provided Target Chip address (OMAP_I2C_SA_REG) - Program the provided Data len (OMAP_I2C_CNT_REG) - Program the provided Control register flags (OMAP_I2C_CON_REG) - Read from or Write to the provided Data buffer (OMAP_I2C_DATA_REG) For a detailed programming guide, refer to the TRM[0] (12.1.3.4 I2C Programming Guide). This patch by itself should be a transparent change. However this is needed for implementing a proper Repeated Start (Sr) functionality for i2c_msgs. Previous implementation for omap_i2c_xfer called __omap24_i2c_read/write functions, with hardcoded addr=0 and alen=0 for each i2c_msg. Each of these calls would program the registers always with a Stop bit set, not allowing for a repeated start between i2c_msgs in the same xfer(). [0]: https://www.ti.com/lit/zip/spruj28 (TRM) Signed-off-by: Aniket Limaye <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2025-04-22i2c: omap24xx_i2c: Remove unused CONFIG_I2C_REPEATED_STARTAniket Limaye
Remove unused piece of code under CONFIG_I2C_REPEATED_START which does not have any Kconfig entry at all. Signed-off-by: Aniket Limaye <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2025-04-11Kbuild: Always use $(PHASE_)Tom Rini
It is confusing to have both "$(PHASE_)" and "$(XPL_)" be used in our Makefiles as part of the macros to determine when to do something in our Makefiles based on what phase of the build we are in. For consistency, bring this down to a single macro and use "$(PHASE_)" only. Signed-off-by: Tom Rini <[email protected]>
2025-03-12i2c: Add support for ADI SC5XX-family I2C peripheralNathan Barrett-Morrison
Co-developed-by: Greg Malysa <[email protected]> Signed-off-by: Greg Malysa <[email protected]> Co-developed-by: Ian Roberts <[email protected]> Signed-off-by: Ian Roberts <[email protected]> Co-developed-by: Angelo Dureghello <[email protected]> Signed-off-by: Angelo Dureghello <[email protected]> Signed-off-by: Vasileios Bimpikas <[email protected]> Signed-off-by: Utsav Agarwal <[email protected]> Signed-off-by: Arturs Artamonovs <[email protected]> Signed-off-by: Oliver Gaskell <[email protected]> Signed-off-by: Nathan Barrett-Morrison <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2024-12-11i2c: renesas: Fix R-Car spellingMarek Vasut
The correct spelling is R-Car, including the dash, update the usage. Kconfig strings and comment changes only, no functional change. Signed-off-by: Marek Vasut <[email protected]>
2024-10-25i2c: mxc_i2c: Convert to use livetree API for fdt accessTim Harvey
Convert to using livetree API functions. Without this if livetree is enabled (OF_LIVE) the mxc-i2c driver will fail to support scl-gpios and sda-gpios for i2c bus recovery. Signed-off-by: Tim Harvey <[email protected]>
2024-10-23i2c: rzg2l: include u-boot/schedule.hRasmus Villemoes
This TU currently relies on getting a declaration of schedule() through some nested include. Include the proper header directly. Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2024-10-21i2c: i2c-gpio: add support for i2c-gpio,sda-output-onlyAlex Shumsky
Some I2C slave devices are read-only and don't even answer with NACK. For example FD65x segment LED controllers. Make them usable with i2c-gpio,sda-output-only that are already supported by Linux 6.3+. Signed-off-by: Alex Shumsky <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2024-10-21i2c: muxes: pca954x: Add MAX735x/MAX736x supportMaksim Kiselev
Add support for the following Maxim chips using the existing PCA954x driver: - MAX7356 - MAX7357 - MAX7358 - MAX7367 - MAX7368 - MAX7369 All added Maxim chips behave like the PCA954x, where a single SMBUS byte write selects up to 8 channels to be bridged to the primary bus. Tested using the MAX7358. Signed-off-by: Maksim Kiselev <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2024-10-11global: Rename SPL_ to XPL_Simon Glass
Use XPL_ as the symbol to indicate an SPL build. This means that SPL_ is no-longer set. Signed-off-by: Simon Glass <[email protected]>
2024-10-11xpl: Rename spl_phase() to xpl_phase()Simon Glass
Rename this function to indicate that it refers to any xPL phase. Signed-off-by: Simon Glass <[email protected]>
2024-08-19Merge tag 'v2024.10-rc3' into nextTom Rini
Prepare v2024.10-rc3
2024-08-13i2c: Remove CFG_SYS_I2C_DIRECT_BUSSimon Glass
Now that this is always 1, remove it and the associated dead code. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2024-08-13i2c: Remove CFG_SYS_I2C_MAX_HOPSSimon Glass
Now that this is always 0, remove it and the associated dead code. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2024-08-13i2c: Drop reference to SYS_I2C_INIT_BOARDSimon Glass
This is not now used by any boards, so drop it. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2024-08-13fsl: mxc: Drop legacy I2cSimon Glass
Drop some old code from the mxc_i2c and ddr/fsl drivers. This will allow removal of very old common I2C code. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2024-08-09i2c: imx_lpi2c: Support read transfers longer than 256 bytesFedor Ross
The TXFIFO register of LPI2C only has one byte length, and if the length of the data that needs to be read exceeds 256 bytes, it needs to be written to TXFIFO multiple times. Signed-off-by: Fedor Ross <[email protected]>
2024-08-09i2c: imx_lpi2c: Replace hard-coded bus speed value with bus->speed_hzFedor Ross
Instead of using the hard-coded bus speed value I2C_SPEED_STANDARD_RATE, use the actual configured bus speed. This way the bus speed doesn't change suddenly after calling the imx_lpi2c_probe_chip() function for example. Signed-off-by: Fedor Ross <[email protected]>
2024-08-09i2c: imx_lpi2c: Fix a typo in bus_i2c_receiveFedor Ross
Fix a typo in a debug message. It should be 'for' not 'fot' . Signed-off-by: Fedor Ross <[email protected]>
2024-08-09i2c: samsung: Support platforms other than EXYNOS4 and EXYNOS5David Virag
Newer Samsung SoCs (including newer Exynos, ExynosAuto, Google Tensor) still use these IPs, or slightly newer versions of it. Make these drivers available on these platforms by guarding EXYNOS4/EXYNOS5 specific code behind their configs, and using CCF for clocks on other platforms. Tested S3C I2C driver on Exynos7885. This along with extended clock driver should enable S3C I2C on Exynos850. Signed-off-by: David Virag <[email protected]> Tested-by: Henrik Grimler <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2024-08-09i2c: samsung: Drop s3c24x0 specific code.David Virag
This has been dead code for many years now. Remove it. Signed-off-by: David Virag <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2024-08-09i2c: mux: Fix error path in i2c-arb-gpioMichal Simek
There is no reason to use goto and just call return. Better is to call return directly which is done for some if/else parts. Also make no sense to setup ret to -ETIMEDOUT and then to 0. Return timeout directly. Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2024-08-09i2c: pca954x: Remove pointer to GDMichal Simek
There is no reason to have any pointer to GD that's why remove it. Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2024-07-23arm: ti: Remove omap4 platform supportTom Rini
There are no longer any OMAP4 platforms in U-Boot, remove the related functionality. Signed-off-by: Tom Rini <[email protected]>
2024-07-22drivers: i2c: Remove duplicate newlinesMarek Vasut
Drop all duplicate newlines. No functional change. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2024-07-08i2c: mediatek: add support for optional arb and pmic clockChristian Marangi
Add support for optional arb and pmic clock for i2c provided in upstream linux DTSI. Signed-off-by: Christian Marangi <[email protected]> Reviewed-by: Heiko Schocher <[email protected]>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-07i2c: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from this driver directory and when needed add missing include files directly. Reviewed-by: Heiko Schocher <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-04-23i2c: Add support for Qualcomm Generic Interface (GENI) I2C controllerNeil Armstrong
Add Support for the Qualcomm Generic Interface (GENI) I2C interface found on newer Qualcomm SoCs. The Generic Interface (GENI) is a firmware based Qualcomm Universal Peripherals (QUP) Serial Engine (SE) Wrapper which can support multiple bus protocols depending on the firmware type loaded at early boot time based on system configuration. It also supports the "I2C Master Hub" which is a single function Wrapper that only FIFO mode I2C. It replaces the fixed-function QUP Wrapper found on older SoCs. The geni-se.h containing the generic GENI Serial Engine registers defines is imported from Linux. Only FIFO mode is implemented, neither SE DMA nor GPI DMA are implemented. Signed-off-by: Neil Armstrong <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>
2024-03-02Merge patch series "ARM: renesas: Rename R-Mobile to Renesas"Tom Rini
Marek Vasut <[email protected]> says: Rename R-Mobile to Renesas all over the place because the chips are made by Renesas, while only a subset of them is from the R-Mobile line.
2024-03-02ARM: renesas: Rename ARCH_RMOBILE to ARCH_RENESASMarek Vasut
Rename ARCH_RMOBILE to ARCH_RENESAS because all the chips are made by Renesas, while only a subset of them is from the R-Mobile line. Use the following command to perform the rename: " $ git grep -l 'ARCH_RMOBILE' | xargs -I {} sed -i 's@ARCH_RMOBILE@ARCH_RENESAS@g' {} " Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Paul Barker <[email protected]>
2024-02-28i2c: rzg2l: Add I2C driver for RZ/G2L familyPaul Barker
This driver supports the I2C module on the Renesas RZ/G2L (R9A07G044) SoC, also known as the RIIC module. This patch is based on both the u-boot driver in the Renesas RZ BSP 3.0.5 release [1] (commit 7fcc1fdc2534), and the Linux v6.7 driver (commit 0dd3ee311255). Support for deblocking the I2C bus is included as this may be needed after triggering a reset via the Power Management IC (PMIC) over I2C (the PMIC asserts the reset line before the SoC completes the I2C write transaction with obvious bus locking effects). If the SDA line is observed to be low during initialisation, we automatically attempt to deblock. [1]: https://github.com/renesas-rz/renesas-u-boot-cip Signed-off-by: Paul Barker <[email protected]> Reviewed-by: Marek Vasut <[email protected]>