Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4021817ybv; Tue, 25 Feb 2020 11:37:20 -0800 (PST) X-Google-Smtp-Source: APXvYqzWk1Cnnr8n/8wlr1PJ3VCvsy9kus9cFwOctYI/y+/0DAsaYWqdudxIDPsC2K0/y7XDI7zo X-Received: by 2002:a05:6808:8ca:: with SMTP id k10mr397759oij.164.1582659440777; Tue, 25 Feb 2020 11:37:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582659440; cv=none; d=google.com; s=arc-20160816; b=r+uzlVqepZrl3KXt9sNEKxAnliLUWhG48iW7ktHdSqaYUm6mkfWJxKEc7rsbDjI1J3 K3y7Do1HQZMWZlL9lcCNFBks1fxKqa5V46KzhuSiEuG8dTBEm4YdqS/YaBEieaTPoxD6 0bszOh098e1dIvUXVO4ACQdIatPyGgw2nFCIxicvBTeuPl/w5FlyXCi5ItBMLr2XOKND ZcJbS44Cpqhx4kG2bH9+aqG/WGSdoBR5SDdgSBbCSMzpNd9GGU3wymWEMmThtcxUy9wM 8R355kgm76fV/Mp7X6ONTVRjH2u7jdYzcOg/LW8JxM4vzoXaFmU1GZ+99aJPDSofgEQc RHkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=c7YvBhKYaRcug4SwCX6amT8Yl2lrmhMSeuLnOwXOQgU=; b=EHydDdZVjiGlhlNrb24dHkmn55t6dL3x+dfcIaGsx/FLeZgeTy+JnJ2eS2sOrf4Xz6 DT5nh+lPruciskkrVGfG4+MZN1UjfSR5iKX/uC6QoMGwkW1I/97a6d6as1RAXwlKxAFM KpDG0JEPFBGVXuAG7EX3yfepY+WjFTgTPetR9p7HK/dOg2vjJMyWCCKrKqU59FzQaxUN QnK3kMNoqLcFiyKTQoHUflP6NUXlWXo5tmkOWiKa04hlXwg08EnqhImtNEnn3x5aMu9w kOSEhKDJN426BSz34DgLHLipw632ZmNxDzKwN0wxDCGkXqjS9uAf5HuystfOpZwQppaH 3vbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RmxfSUoS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j25si64558oij.242.2020.02.25.11.37.08; Tue, 25 Feb 2020 11:37:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RmxfSUoS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731545AbgBYTam (ORCPT + 99 others); Tue, 25 Feb 2020 14:30:42 -0500 Received: from mail-pj1-f66.google.com ([209.85.216.66]:51172 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728753AbgBYTam (ORCPT ); Tue, 25 Feb 2020 14:30:42 -0500 Received: by mail-pj1-f66.google.com with SMTP id r67so149017pjb.0 for ; Tue, 25 Feb 2020 11:30:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=c7YvBhKYaRcug4SwCX6amT8Yl2lrmhMSeuLnOwXOQgU=; b=RmxfSUoSe9xuTRu3f6VvCjX9p3RqTXhWYFzxRKDqm+y+JTdxrf832YSyahg7MZHNLX xPJ2kfmZTGtuVhfDmeeI2m3eLecVz5um8uOSdxZNnifiBTLy/ZzPCVo7WiCz/lyxUok6 FWNVoaH1gkLXuOBrEU7qUhC+MMtTUR0yvbIhclvQTQKShrsbsa40s2xq9HGpuZsX5+tv I+cIv38b4L6tdkJYnodzLG8SbLgqZz/SyCc33w4YePCS7JW64TnWRI3gPc2HmTNY+3gS +esf0ZNXY+FkNEn6yHHD9N6Et03JhmWvGDVQW5olU6DN7Qh7Ryv4stkQrnZJKfjQ/jxK w1Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=c7YvBhKYaRcug4SwCX6amT8Yl2lrmhMSeuLnOwXOQgU=; b=ch8RVgJzm1P2Emu2A8URWtx//SDJ1XrOtIjiKJIp+Q8xce0Fw29cgQA+HyrSiP7Ibz w/lLz/LErIzofZqn4p/lW4uJT9opUjYOodDP5tKD7aSH2yate7WVoQND1sT0OOXSlIYq k91m2ramHP/H4IaEfVnpj60D8f+viUWeUb6z53i6opyZljjRppLCKYsMZ4wKotbNKN1Z xidFPkhrOKUYpGrR4910CwKf8BHLlVXwi5tg/8YBb+OXRq44VD1Q+Qal5E1x2QqNiKOJ BTvAX6X+FQmAPrmMEt/QDGcPY4oO0YtllpJaqxwL2x9CbY8qvcebYsPZ315NZchPa2Ie zlEg== X-Gm-Message-State: APjAAAUsTflSl8fvOrAFx6fTfY2EzGkr8yCXSAs9NU9/Ot5nYBC0tBft WGGaIDn50zSASK1hgvdm4H5cZ5FVQTHI7OG6DMwRtg== X-Received: by 2002:a17:90a:858a:: with SMTP id m10mr587460pjn.117.1582659039680; Tue, 25 Feb 2020 11:30:39 -0800 (PST) MIME-Version: 1.0 References: <20191121095350.158689-1-tali.perry1@gmail.com> <20191121095350.158689-3-tali.perry1@gmail.com> <20191125151618.GE2412@kunai> In-Reply-To: From: Brendan Higgins Date: Tue, 25 Feb 2020 11:30:22 -0800 Message-ID: Subject: Re: [PATCH v7 2/2] i2c: npcm: Add Nuvoton NPCM I2C controller driver To: Tali Perry Cc: Wolfram Sang , Rob Herring , Mark Rutland , Nancy Yuen , Patrick Venture , Benjamin Fair , Avi Fishman , Joel Stanley , Tomer Maimon , syniurge@gmail.com, linux-i2c@vger.kernel.org, OpenBMC Maillist , devicetree , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 26, 2019 at 1:23 AM Tali Perry wrote: > > Hi Wolfram, > > Thanks for your comments. > > The NPCM7XX BMC I2C\SMB controller HW module supports both SMB and I2C. > It's main features are: > 1. Supports Fast-Mode (400 KHz clock) I2C and Fast-Mode-plus (1 MHz clock= ) I2C > 2. Supports the =E2=80=98fairness=E2=80=99 arbitration protocol defined b= y the MCTP > SMBus/I2C Transport Binding Specification v1.0.0 > 3. 32KB packets : this is an I2C spec limitation. The HW has no limit > on packets size. It has a 16 bytes FIFO which can be reloaded over and > over. > 4. w\o size byte (for SMB block protocol). > 5. Both master and slave. It can also replace modes in run time > (requirement for IPMB and MCTP). > 6. Bus timing is selected to support both specs. > > Originally the HW spec stated SMB everywhere . Alright, so it sounds like the HW supports I2C and also has SMBus specific support? > Should I rename the SMB to I2C all over the driver? If the HW supports general I2C; then yes, you should use the I2C naming scheme. If you have SMBus specific support for some things, it might be helpful to tag on smb in the name for only those functions/data structures. Also, please don't top-post. > On Tue, Nov 26, 2019 at 8:47 AM Tali Perry wrote: > > > > Hi Wolfram, > > > > Thanks for your comments. > > > > The NPCM7XX BMC I2C\SMB controller HW module supports both SMB and I2C. > > It's main features are: > > 1. Supports Fast-Mode (400 KHz clock) I2C and Fast-Mode-plus (1 MHz clo= ck) I2C > > 2. Supports the =E2=80=98fairness=E2=80=99 arbitration protocol defined= by the MCTP SMBus/I2C Transport Binding Specification v1.0.0 > > 3. 32KB packets : this is an I2C spec limitation. The HW has no limit o= n packets size. It has a 16 bytes FIFO which can be reloaded over and over. > > 4. w\o size byte (for SMB block protocol). > > 5. Both master and slave. It can also replace modes in run time (requir= ement for IPMB and MCTP). > > 6. Bus timing is selected to support both specs. > > > > Originally the HW spec stated SMB everywhere . > > > > Should I rename the SMB to I2C all over the driver? And please don't reiterate yourself like this; it can confuse the conversat= ion. > > On Mon, Nov 25, 2019 at 5:16 PM Wolfram Sang wrote: > >> > >> On Thu, Nov 21, 2019 at 11:53:50AM +0200, Tali Perry wrote: > >> > Add Nuvoton NPCM BMC i2c controller driver. > >> > > >> > Signed-off-by: Tali Perry > >> > >> Looking at all this SMB_* naming of the registers and also the quirks, > >> this looks more like an SMBUS controller to me? > >> > >> > + // currently I2C slave IF only supports single byte operations= . > >> > + // in order to utilyze the npcm HW FIFO, the driver will ask f= or 16bytes > >> > + // at a time, pack them in buffer, and then transmit them all = together > >> > + // to the FIFO and onward to the bus . > >> > + // NACK on read will be once reached to bus->adap->quirks->max= _read_len > >> > + // sending a NACK whever the backend requests for it is not su= pported. > >> > >> This for example... > >> > >> > +static const struct i2c_adapter_quirks npcm_i2c_quirks =3D { > >> > + .max_read_len =3D 32768, > >> > + .max_write_len =3D 32768, > >> > + .max_num_msgs =3D 2, > >> > + .flags =3D I2C_AQ_COMB_WRITE_THEN_READ > >> > +}; > >> > >> ... and this. Like SMBus with the only exception of being able to send > >> 32K in a row. Or? > >>