[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aK3ZFSQ9FUwuxT12@lizhi-Precision-Tower-5810>
Date: Tue, 26 Aug 2025 11:56:05 -0400
From: Frank Li <Frank.li@....com>
To: Jorge Marques <jorge.marques@...log.com>
Cc: Alexandre Belloni <alexandre.belloni@...tlin.com>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Kees Cook <kees@...nel.org>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>,
linux-i3c@...ts.infradead.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, gastmaier@...il.com,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH v7 0/2] Add ADI I3C Controller
On Mon, Aug 18, 2025 at 01:51:12PM +0200, Jorge Marques wrote:
> I3C Controller is subset of the I3C-basic specification to interface
> peripherals through I3C and I2C. The controller RTL is FPGA
> synthesizable and documentation is provided at
> https://analogdevicesinc.github.io/hdl/library/i3c_controller
>
> The main target for the I3C Controller IP is low-cost FPGAs.
> In this version the driver supports IBI (only the MDB), I3C and I2C
> transfers.
>
> The IP Core is versioned following ADI's open source HDL guidelines
> for devicetree bindings and drivers described at
> https://analogdevicesinc.github.io/hdl/user_guide/contributing.html#devicetree-bindings-drivers
> in summary, follows Semantic Versioning 2.0.0, with the dt-binding suffixed
> by -v<major>.
>
> If necessary, the contents of
> https://analogdevicesinc.github.io/hdl/user_guide/contributing.html#devicetree-bindings-drivers
> can be replicated to a file in a different series, similar to AMD Xilinx
> at Documentation/devicetree/bindings/xilinx.txt, but as adi.txt or
> similar.
>
> Depends on https://lore.kernel.org/linux-i3c/20250622-i3c-writesl-readsl-v2-0-2afd34ec6306@analog.com/T/#t
It is already in v6.17-rc1. You can remove this depends.
commit 733b439375b494e8a6950ab47d18a4b615b73cb3
Author: Jorge Marques <jorge.marques@...log.com>
Date: Tue Jun 24 11:06:04 2025 +0200
i3c: master: Add inline i3c_readl_fifo() and i3c_writel_fifo()
The I3C abstraction expects u8 buffers, but some controllers operate with
a 32-bit bus width FIFO and cannot flag valid bytes individually. To avoid
reading or writing outside the buffer bounds, use 32-bit accesses where
possible and apply memcpy for any remaining bytes
Signed-off-by: Jorge Marques <jorge.marques@...log.com>
Suggested-by: Wolfram Sang <wsa+renesas@...g-engineering.com>
Reviewed-by: Wolfram Sang <wsa+renesas@...g-engineering.com>
Tested-by: Wolfram Sang <wsa+renesas@...g-engineering.com>
Reviewed-by: Frank Li <Frank.Li@....com>
Link: https://lore.kernel.org/r/20250624-i3c-writesl-readsl-v3-1-63ccf0870f01@analog.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@...tlin.com>
>
> Signed-off-by: Jorge Marques <jorge.marques@...log.com>
> ---
> Changes in v7:
> - Edit cover linking guidelines to ADI IP Core versioning.
> Documentation/devicetree/bindings/i3c/adi,i3c-master.yaml:
> - Extend second clock description to explain relation to synthesized topology.
> - Link to v6: https://lore.kernel.org/r/20250717-adi-i3c-master-v6-0-6c687ed71bed@analog.com
>
> Changes in v6:
> - Format 0x05C undercase
> - Link to v5: https://lore.kernel.org/r/20250715-adi-i3c-master-v5-0-c89434cbaf5e@analog.com
>
> Changes in v5:
> Documentation/devicetree/bindings/i3c/adi,i3c-master.yaml:
> - Use semantic versioning major field for dt-binding compatible, with
> the format adi,<ip-name>-v<major>
>
> adi-i3c-master.c:
> - Rename MAX_DEVS to ADI_MAX_DEVS
> - Encapsulate REG_CMD_FIFO_0_DEV_ADDR var
> - Reorder struct adi_i3c_i2c_dev_data fields
> - Start addr at 0 instead of 8 at adi_i3c_master_get_rr_slot
> - Minor rework on adi_i3c_master_handle_ibi to most logic out of the
> lock. Even if length is 0 (BCR[2]=0), the mdb field is extracted and
> written to the slot buffer. Since the length is 0, the written data
> doesn't matter.
> In a future update with additional bytes support (e.g., bits 31-23),
> len would be incremented and an IBI FIFO would be read.
> - Version check against first stable release, major v1.
> Driver+RTL features updates affect the minor field, therefore check
> for major == 1.
> - Link to v4: https://lore.kernel.org/r/20250626-adi-i3c-master-v4-0-3846a1f66d5e@analog.com
>
> Changes in v4:
> Documentation/devicetree/bindings/i3c/adi,i3c-master.yaml:
> - Add -1.00.a suffix where missing
> - Extend clocks descriptions
> - Add minItems to clock-names, to match clocks
> - Use header in example
>
> adi-i3c-master.c:
> - Regmap:
> - Add new controller info registers (dyn_addr, dcr, bcr, pid)
> - Always decreasing fields
> - Add line break between registers
> - Reformat REG_DEV_CHAR_BSCR_IBI to use easier to read FIELD_GET,
> FIELD_PREP
> - Read controller info from regmap with explanation comment
> - Use linux/fpga/adi-axi-common.h macros
> - Use __counter_by macro on ncmds
> - Use __free macro
> - Use new i3c_writel_fifo and i3c_readl_fifo macros
> - Rename bytes to buf when nbytes is present
> - Use scoped_guard instead of spin_lock, spin_unlock
> - Reformat loops to read fifo status, use while single line alternative
> - Drop adi_i3c_master.max_devs, use MAX_DEVS directly
> - Use devm_clk_bulk_get_all_enabled, dropping clock name match (CHECK_DTB does it)
> - Init spin_lock
> - Init list head
> - Link to v3: https://lore.kernel.org/r/20250618-adi-i3c-master-v3-0-e66170a6cb95@analog.com
>
> Changes in v3:
> Documentation/devicetree/bindings/i3c/adi,i3c-master.yaml:
> - Small reworking of the description
> - Add -1.00.a suffix to compatible
>
> adi-i3c-master.c:
> - Misspelling
> - Remove REG_CMD_FIFO_0_LEN_MAX since it is a HDL parameter
> - Use adapter timeout value for I2C transfers, as in
> https://lore.kernel.org/linux-i3c/aEBd%2FFIKADYr%2F631@lizhi-Precision-Tower-5810/T/#t
>
> - Link to v2: https://lore.kernel.org/r/20250606-adi-i3c-master-v2-0-e68b9aad2630@analog.com
>
> Changes in v2:
> Documentation/devicetree/bindings/i3c/adi,i3c-master.yaml:
> - Move allof
> - Rename clocks to axi, i3c
>
> adi-i3c-master.c:
> - Update license year
> - Rework regmap to use FIELD_GET, FIELD_PREP
> - Reformat regmap to have FIELDS after REG, prefixed by reg name.
> - Add overflow safeguards to cmd, tx fifos
> - Fix macro related macros (mostly erroneous `| ~BITMASK`
> - Use guard macros, remove goto.
> - Simplify daa logic
> - Replace devm_clk_get with devm_clk_get_enabled
> - Solve 64bit->32bit warnings on x86_64 systems by casting to u32
> - Immediate clear irq request flags, then handle it.
>
> - Link to v1: https://lore.kernel.org/r/20250604-adi-i3c-master-v1-0-0488e80dafcb@analog.com
>
> ---
> Jorge Marques (2):
> dt-bindings: i3c: Add adi-i3c-master
> i3c: master: Add driver for Analog Devices I3C Controller IP
>
> .../devicetree/bindings/i3c/adi,i3c-master.yaml | 72 ++
> MAINTAINERS | 6 +
> drivers/i3c/master/Kconfig | 11 +
> drivers/i3c/master/Makefile | 1 +
> drivers/i3c/master/adi-i3c-master.c | 1019 ++++++++++++++++++++
> 5 files changed, 1109 insertions(+)
> ---
> base-commit: 51963783b876a2f493a3eac0ea9eba271cb6809a
> change-id: 20250604-adi-i3c-master-2a5148c58c47
> prerequisite-message-id: <20250622-i3c-writesl-readsl-v2-0-2afd34ec6306@...log.com>
> prerequisite-patch-id: 5443f14ca82fc08593960fafdb43488cce56f7d9
> prerequisite-patch-id: 647084f5fe09f4887f633b0b02b306912a156672
> prerequisite-patch-id: 6f582bb2ef1aafb66f26c515a19d5efa06ab8968
>
> Best regards,
> --
> Jorge Marques <jorge.marques@...log.com>
>
Powered by blists - more mailing lists