Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3966707ybc; Tue, 26 Nov 2019 01:26:14 -0800 (PST) X-Google-Smtp-Source: APXvYqyCm30CqNM+2DVMdNL41OCO1+ODAqniVHO4QRErEjJ6PcttxrulYuyG8cBgzQ9Z4s4t8H1X X-Received: by 2002:a17:906:7c4e:: with SMTP id g14mr41639334ejp.150.1574760374843; Tue, 26 Nov 2019 01:26:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574760374; cv=none; d=google.com; s=arc-20160816; b=YEZjGjJT8uvg7T/6MLgCkE0eRrAQWe5Yw1jDSZE+dYDS3ZLrQXO/qYTN5rv49zAIkM bS5QeFGVUEAIR5bPef+wMsZJInEsTffNstqJ4inSK+0tAtbOwXDOnMWxbQz8Ts0Eff8o Z5GFuQoAC5QUr3pzy4+SUBgHp3dbwcJUstvq3aSVTtbGbb/MbRVYXHKieByLd/F3L+Pn WGmk6T3tN4E7ZkiNDoijk3p414D8tTjQDhbHEKO9DuCEvaOyfZw8jorEym51M/jcC6gD BSnqpVG9FscJDCya6E6NMHPdyJH2XZpX1yityK7Ug/In6gFhg/MoQIjqpze3KP4h6fNS iV9A== 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=nP42ri7Gfuyq7+jTSAaeHSR6UUUTuVIMdi0iTbY+h84=; b=x2yZlAwLONLBfehVDIzjznnJ/a2ic7yB/xEFPddcTkZwFuM3y197Jbza4Oq2Jo+iXl TYNb4PMH+HTDkRVd/pWBIdPMUT0w62xDDyMGOZRHbxeFsjCbwGm90WZ+LL793AWQCoNI XeskBX3nU+xn4Sbo+SeOI/aXMa1G0HcZKLKW2EaemtC4qxGeW6wmewh7GcpYdAOHt/7r +xa5LhE5EDnXT4YkVqFXy7HtRgfOIaUq/+EkmDMcvQlUgx8bSp/8SyS7jTM2V93tgLzg 4O5HZHlJ+qwHwnCP2b/LgoWxJj57Zth55FsBDnBtZ7Sn0k14zg8dJt5YGd/TmW+UdN66 IGAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ovYMWZh7; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a30si7453709eda.259.2019.11.26.01.25.50; Tue, 26 Nov 2019 01:26:14 -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=@gmail.com header.s=20161025 header.b=ovYMWZh7; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727547AbfKZJWp (ORCPT + 99 others); Tue, 26 Nov 2019 04:22:45 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:44874 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727446AbfKZJWp (ORCPT ); Tue, 26 Nov 2019 04:22:45 -0500 Received: by mail-lf1-f67.google.com with SMTP id v201so12413831lfa.11; Tue, 26 Nov 2019 01:22:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=nP42ri7Gfuyq7+jTSAaeHSR6UUUTuVIMdi0iTbY+h84=; b=ovYMWZh7rJIAiQIsOphqx1xCiq5HXT19ucp08A6Hyajw4ROMLr8llSUbHC6t4TQbbK ACgpjDob4IqxBrXWeNyQ5DWuHtKzhfrodRgDe4HZf/I2BlO9dhb3KFOYPGGzQqpr4Tzr Kl7nncerWp7c7U/GWoDkqcdJA+K99QdIKjNxi/eA7+Yv9A/t6aCYgQZ1FltbxaTzzoTE 4AsFg2bM2KX0RP0FCJD/O/IG2nDPuPaGlcdLAqqPOOCj4YZLwBtna/a3teKAk5JeJkwa k4Y0SxxyKhf06vtLD9Dqg7qh8UPyothUXTyyVUQ2V+T4JeSm4OLreRurbik48BVaGIKV G4Ug== 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=nP42ri7Gfuyq7+jTSAaeHSR6UUUTuVIMdi0iTbY+h84=; b=aYzwSDYwp0LMXU1ubKhSGt8LjA+WbD/rAZDwrn2fVQwZ+Rc/E/u65XupxAWFjgjrkt jfshW28p3gLHKDPumbAq3dEjoblgomURSW0sctMNNP5KilcHBqXHeP0Y7fV2x+ClRAOC hQWCm0vu1eH3++/v0k2MTca4H4QAB+QJn5Jv9DhTqz3pTCPyNJ41RP6Gs07THV1OQn2Y KiHeznXpejc+XPghYFhmj16OcPVJ8pfeXBQFQxQHhZK6mZtVefLHoRILW775+NGtsxsb FYBfs78Y0t4UU6SDWP4Lh1Resktij2gyIyBtAQSTYcg+csB+yJty9DiRW6TWOrzov1U8 DaqQ== X-Gm-Message-State: APjAAAUJczQmjehFtfAspbAF/lescnkWAVdfxaeLRiq5mTsIOUWUtAcJ Dbv5iIG1Zq2ByreIYxw/wQQaYSqpUK6ts9VlbTQ= X-Received: by 2002:ac2:5283:: with SMTP id q3mr23177580lfm.21.1574760162745; Tue, 26 Nov 2019 01:22:42 -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: Tali Perry Date: Tue, 26 Nov 2019 11:27:54 +0200 Message-ID: Subject: Re: [PATCH v7 2/2] i2c: npcm: Add Nuvoton NPCM I2C controller driver To: Wolfram Sang Cc: Rob Herring , Mark Rutland , Nancy Yuen , Patrick Venture , Benjamin Fair , avifishman70@gmail.com, joel@jms.id.au, 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 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 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 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 . Should I rename the SMB to I2C all over the driver? Thanks, Tali Perry 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 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 (requirem= ent 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? > > Thanks, > Tali Perry > > > 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 for= 16bytes >> > + // at a time, pack them in buffer, and then transmit them all to= gether >> > + // to the FIFO and onward to the bus . >> > + // NACK on read will be once reached to bus->adap->quirks->max_r= ead_len >> > + // sending a NACK whever the backend requests for it is not supp= orted. >> >> 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? >>