lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230425171347.GB1957523-robh@kernel.org>
Date:   Tue, 25 Apr 2023 12:13:47 -0500
From:   Rob Herring <robh@...nel.org>
To:     Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
Cc:     linux-media@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-i2c@...r.kernel.org,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Wolfram Sang <wsa@...nel.org>,
        Luca Ceresoli <luca.ceresoli@...tlin.com>,
        Andy Shevchenko <andriy.shevchenko@...el.com>,
        Matti Vaittinen <Matti.Vaittinen@...rohmeurope.com>,
        Laurent Pinchart <laurent.pinchart+renesas@...asonboard.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Peter Rosin <peda@...ntia.se>,
        Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Michael Tretter <m.tretter@...gutronix.de>,
        Hans Verkuil <hverkuil@...all.nl>,
        Mike Pagano <mpagano@...too.org>,
        Krzysztof HaƂasa <khalasa@...p.pl>,
        Marek Vasut <marex@...x.de>,
        Satish Nagireddy <satish.nagireddy@...cruise.com>,
        Luca Ceresoli <luca@...aceresoli.net>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: Re: [PATCH v11 1/7] i2c: add I2C Address Translator (ATR) support

On Fri, Apr 21, 2023 at 01:18:27PM +0300, Tomi Valkeinen wrote:
> From: Luca Ceresoli <luca@...aceresoli.net>
> 
> An ATR is a device that looks similar to an i2c-mux: it has an I2C
> slave "upstream" port and N master "downstream" ports, and forwards
> transactions from upstream to the appropriate downstream port. But it
> is different in that the forwarded transaction has a different slave
> address. The address used on the upstream bus is called the "alias"
> and is (potentially) different from the physical slave address of the
> downstream chip.
> 
> Add a helper file (just like i2c-mux.c for a mux or switch) to allow
> implementing ATR features in a device driver. The helper takes care or
> adapter creation/destruction and translates addresses at each transaction.
> 
> Signed-off-by: Luca Ceresoli <luca@...aceresoli.net>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  .../devicetree/bindings/i2c/i2c-atr.yaml      |  34 +
>  Documentation/i2c/i2c-address-translators.rst |  96 +++
>  Documentation/i2c/index.rst                   |   1 +
>  MAINTAINERS                                   |   8 +
>  drivers/i2c/Kconfig                           |   9 +
>  drivers/i2c/Makefile                          |   1 +
>  drivers/i2c/i2c-atr.c                         | 684 ++++++++++++++++++
>  include/linux/i2c-atr.h                       | 116 +++
>  8 files changed, 949 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/i2c/i2c-atr.yaml
>  create mode 100644 Documentation/i2c/i2c-address-translators.rst
>  create mode 100644 drivers/i2c/i2c-atr.c
>  create mode 100644 include/linux/i2c-atr.h
> 
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-atr.yaml b/Documentation/devicetree/bindings/i2c/i2c-atr.yaml
> new file mode 100644
> index 000000000000..d7f73d98110d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/i2c/i2c-atr.yaml
> @@ -0,0 +1,34 @@
> +# SPDX-License-Identifier: GPL-2.0

Dual license.

> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/i2c/i2c-atr.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Common i2c address translator properties.

Drop hard stop.

> +
> +maintainers:
> +  - Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
> +
> +description:
> +  An I2C Address Translator (ATR) is a device with an I2C slave parent
> +  ("upstream") port and N I2C master child ("downstream") ports, and
> +  forwards transactions from upstream to the appropriate downstream port
> +  with a modified slave address. The address used on the parent bus is
> +  called the "alias" and is (potentially) different from the physical
> +  slave address of the child bus. Address translation is done by the
> +  hardware.
> +
> +properties:
> +  i2c-alias-pool:
> +    $ref: /schemas/types.yaml#/definitions/uint16-array

We do support some flags in the upper 16-bits of I2C addresses. Any of 
those possibly needed here?

> +    description:
> +      I2C alias pool is a pool of I2C addresses on the main I2C bus that can be
> +      used to access the remote peripherals on the serializer's I2C bus. The
> +      addresses must be available, not used by any other peripheral. Each
> +      remote peripheral is assigned an alias from the pool, and transactions to
> +      that address will be forwarded to the remote peripheral, with the address
> +      translated to the remote peripheral's real address. This property is not
> +      needed if there are no I2C addressable remote peripherals.
> +
> +additionalProperties: true
> +...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ