All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Asmaa Mnebhi <asmaa@nvidia.com>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	Khalil Blaiech <kblaiech@nvidia.com>
Subject: Re: [PATCH v1 6/7] i2c-mlxbf.c: support BlueField-3 SoC
Date: Thu, 18 Aug 2022 09:11:50 -0600	[thread overview]
Message-ID: <20220818151150.GK1829017-robh@kernel.org> (raw)
In-Reply-To: <20220816225412.9095-7-asmaa@nvidia.com>

On Tue, Aug 16, 2022 at 06:54:11PM -0400, Asmaa Mnebhi wrote:
> BlueField-3 SoC has the same I2C IP logic as previous
> BlueField-1 and 2 SoCs but it has different registers' addresses.
> This is an effort to keep this driver generic accross all
> BlueField generations.
> This patch breaks down the "smbus" resource into 3 separate
> resources to enable us to use common registers' offsets for all
> BlueField SoCs:
> struct mlxbf_i2c_resource *timer;
> struct mlxbf_i2c_resource *mst;
> struct mlxbf_i2c_resource *slv;
> 
> Of course, all offsets had to be adjusted accordingly, and we took
> this chance to reorganize the macros depending on the register block
> they target.
> 
> There are only 2 registers' offsets that do not fit within this
> schema so their offsets are passed as SoC-specific parameters:
> smbus_master_rs_bytes_off
> smbus_master_fsm_off
> 
> Reviewed-by: Khalil Blaiech <kblaiech@nvidia.com>
> Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com>
> ---
>  .../bindings/i2c/mellanox,i2c-mlxbf.yaml      |  30 +-

Bindings go in a separate patch.

>  MAINTAINERS                                   |   1 +
>  drivers/i2c/busses/i2c-mlxbf.c                | 397 ++++++++++--------
>  3 files changed, 258 insertions(+), 170 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml b/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml
> index 93198d5d43a6..cb3a012914e0 100644
> --- a/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml
> +++ b/Documentation/devicetree/bindings/i2c/mellanox,i2c-mlxbf.yaml
> @@ -8,6 +8,7 @@ title: Mellanox I2C SMBus on BlueField SoCs
>  
>  maintainers:
>    - Khalil Blaiech <kblaiech@nvidia.com>
> +  - Asmaa Mnebhi <asmaa@nvidia.com>
>  
>  allOf:
>    - $ref: /schemas/i2c/i2c-controller.yaml#
> @@ -17,11 +18,15 @@ properties:
>      enum:
>        - mellanox,i2c-mlxbf1
>        - mellanox,i2c-mlxbf2
> +      - mellanox,i2c-mlxbf3
>  
>    reg:
> -    minItems: 3
> +    minItems: 5

You just broke platforms with 3 entries.

> +    maxItems: 6
>      items:
> -      - description: Smbus block registers
> +      - description: Smbus timer registers
> +      - description: Smbus master registers
> +      - description: Smbus slave registers

You can't add new registers at the beginning of the list for existing 
users.

Either add to the end or it has to be conditional (if/then schema).

>        - description: Cause master registers
>        - description: Cause slave registers
>        - description: Cause coalesce registers
> @@ -58,7 +63,9 @@ examples:
>    - |
>      i2c@2804000 {
>          compatible = "mellanox,i2c-mlxbf1";
> -        reg = <0x02804000 0x800>,
> +        reg = <0x02804000 0x40>,
> +              <0x02804200 0x200>,
> +              <0x02804400 0x200>,
>                <0x02801200 0x020>,
>                <0x02801260 0x020>;
>          interrupts = <57>;
> @@ -68,10 +75,25 @@ examples:
>    - |
>      i2c@2808800 {
>          compatible = "mellanox,i2c-mlxbf2";
> -        reg = <0x02808800 0x600>,
> +        reg = <0x02808800 0x40>,
> +              <0x02808a00 0x200>,
> +              <0x02808c00 0x200>,
>                <0x02808e00 0x020>,
>                <0x02808e20 0x020>,
>                <0x02808e40 0x010>;
>          interrupts = <57>;
>          clock-frequency = <400000>;
>      };
> +
> +  - |
> +    i2c@2808800 {
> +        compatible = "mellanox,i2c-mlxbf3";
> +        reg = <0x13404480 0x40>,
> +              <0x13404200 0x200>,
> +              <0x13404000 0x200>,
> +              <0x13404400 0x020>,
> +              <0x13404420 0x020>,
> +              <0x13404440 0x010>;
> +        interrupts = <35>;
> +        clock-frequency = <400000>;
> +    };

  reply	other threads:[~2022-08-18 15:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16 22:54 [PATCH v1 0/7] i2c-mlxbf.c: bug fixes and new feature support Asmaa Mnebhi
2022-08-16 22:54 ` [PATCH v1 1/7] i2c-mlxbf.c: Fix frequency calculation Asmaa Mnebhi
2022-08-16 22:54 ` [PATCH v1 2/7] i2c-mlxbf.c: remove IRQF_ONESHOT Asmaa Mnebhi
2022-08-16 22:54 ` [PATCH v1 3/7] i2c-mlxbf: add multi slave functionality Asmaa Mnebhi
2022-08-18 16:25   ` Wolfram Sang
2022-08-18 16:41     ` Asmaa Mnebhi
2022-08-16 22:54 ` [PATCH v1 4/7] i2c-mlxbf.c: incorrect base address passed during io write Asmaa Mnebhi
2022-08-18 16:27   ` Wolfram Sang
2022-08-18 16:40     ` Asmaa Mnebhi
2022-08-18 17:21       ` Asmaa Mnebhi
2022-08-18 20:24         ` Wolfram Sang
2022-08-18 20:30           ` Asmaa Mnebhi
2022-08-16 22:54 ` [PATCH v1 5/7] i2c-mlxbf: prevent stack overflow in mlxbf_i2c_smbus_start_transaction() Asmaa Mnebhi
2022-08-16 22:54 ` [PATCH v1 6/7] i2c-mlxbf.c: support BlueField-3 SoC Asmaa Mnebhi
2022-08-18 15:11   ` Rob Herring [this message]
2022-08-18 20:43     ` Asmaa Mnebhi
2022-08-16 22:54 ` [PATCH v1 7/7] i2c-mlxbf.c: support lock mechanism Asmaa Mnebhi
2022-08-18 16:24 ` [PATCH v1 0/7] i2c-mlxbf.c: bug fixes and new feature support Wolfram Sang
2022-08-18 16:42   ` Asmaa Mnebhi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220818151150.GK1829017-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=asmaa@nvidia.com \
    --cc=kblaiech@nvidia.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.