Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1728874pxb; Wed, 9 Feb 2022 03:17:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJyefpV2bSL58Nl5Ufp8mkcf2Tmzp0gQVps6abAG6xc1XlV/JGY6cvBipwcPRENMxzmLnOAa X-Received: by 2002:a62:b618:: with SMTP id j24mr1865216pff.42.1644405426919; Wed, 09 Feb 2022 03:17:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644405426; cv=none; d=google.com; s=arc-20160816; b=yqn1oCoHoNl7HITBYoVosJv4/3RkLzrRgYrOTXwWyrIQ5m7mgUozTWkGG6L/UyuTpx jFJKnltePlxvjab6zFvj7mTdov5G3hCY5SxUwb2Ax0TIDMcAGEMrqrpuvXDeOpZ+aOZ+ LeXnCQuB3LIqn6QxxD6wRPIxjjDiCrGJXKsKQabP9esBZI2tkFeF4BoDk3KGQYfI3Znv saM8UhmrZbH4DGmo8AnRm8ZfaksnBeBDuMRfSMcrIYFAMpxXOq7h50Lh4TJ8Xsog3+f2 18rQs+kreo170pfMkN2533YvVMNWFjNezbvnykAn1iAlR+zQ+kIllrgNyGTpRohgwTym t0Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=52Mlxc/AZaE8Cndi19CrmZAb2xd8snlWb6gzXeW+f8c=; b=imubSHnsj0Ti2ka/JXzCcJUg2/cBQIGarzH49s3xGn2ztqjT1E6zWBjV8k4xEv5xDB 7iMcadB98FiXw+7XIKTnCyrag/VC6YhAOes5lrmfCgZ7iVIWRA0nOmMSl+G5TwC6bgLq F23/JuX99uZg/iB3WmpzU9BVX/+T85eyZuWp/bTh29lkuodY7Ey0A78iHi4KgkCcbgWX SNXbN/42FEdpsBfXHd6r53OD2egeDcSSU4rVHxG9iAQ6hK71kiQYDxyJpK/UPisy5071 cKlHRrIohetojlEtY9Qt1E93UN7pOul547BJXD4ynNMyNXxJc7MD5F+8YkLuhrDV/FP8 6pfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LIoXET1V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x13si19183648pge.418.2022.02.09.03.17.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 03:17:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LIoXET1V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8E26EE06C406; Wed, 9 Feb 2022 01:45:05 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351873AbiBHIv1 (ORCPT + 99 others); Tue, 8 Feb 2022 03:51:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351868AbiBHIvY (ORCPT ); Tue, 8 Feb 2022 03:51:24 -0500 Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99D6EC03FEC8; Tue, 8 Feb 2022 00:51:23 -0800 (PST) Received: by mail-qv1-xf36.google.com with SMTP id c14so5599387qvl.12; Tue, 08 Feb 2022 00:51:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=52Mlxc/AZaE8Cndi19CrmZAb2xd8snlWb6gzXeW+f8c=; b=LIoXET1Vcm+0Yo/759v2FqsPM9tUsLx5soPaRzhSfagqaev0i/jq4YTBq0QXQKPdRn Kbs1VbKM9Vys9h4DE73AhMh80HqZqIG2ciDb+cZAARKQHBryRqURWDb9PWl4iykUvLbx vhFCNNRDwT9aWmNTKkotXhcTvlI0jVPKnUeMRvIF3F5xyP3uidSK1o+FyDLyVobzE5Xc +RYq4C22VTpWstKp9vrwLat1X3z0vDt0sPLkTADDz1kEv0wGLwyOmR6ZxECbWsNA4Plv PyAIXzKAaKValqytpOhB/H/LFIwFoJLFeYiLPMNP5/P/cp2GJJU75tKzVP5CXWisQu/D xx9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=52Mlxc/AZaE8Cndi19CrmZAb2xd8snlWb6gzXeW+f8c=; b=U9Ia4OpCwKrSB4WWagEh9WvIWggsaIO1in+ZRP0FOmVqYjT2S91v9AeU4OILl5prPq oAzRnffNqUkKc7wJKDb9r7LNguubOCFNpBqYzCsSYmqeJVNZv2mqlXprwbqIu3K62N6K g2PS/WaBp+NBgZZspx4Zib33E4z6l9Lhw725j7TqlSdzhucuovMu0rdzYcwo9hd8QBGf hOSC+TOEqrTIeet6DbSKGxQIA1aY3aaYrvqM8TMXny96IxLtFOC51Y9UoE3KPxDDXNwe cvFeXci4kDOoVAYbPUeXNQ1DH5fvXPVYDwdU3dprRoX4smxSwKDezCouFvuECMI2I3Ay D3NA== X-Gm-Message-State: AOAM533rYDeALvVu2U0NpaG6bh5tzsAig44gdZMJmKKkxdUjZ6zCFFEP 2AhzhbHT9bWthVtMk2fuMjnEwAQAiPugYoiVXNA= X-Received: by 2002:a05:6214:1cc7:: with SMTP id g7mr2429769qvd.124.1644310282674; Tue, 08 Feb 2022 00:51:22 -0800 (PST) MIME-Version: 1.0 References: <20220207063338.6570-1-warp5tw@gmail.com> <20220207063338.6570-7-warp5tw@gmail.com> <086655b0-b9d2-30ed-1496-47cdc6346003@canonical.com> <30ac5fe7-9d96-a756-24b0-384361b48a2d@canonical.com> In-Reply-To: <30ac5fe7-9d96-a756-24b0-384361b48a2d@canonical.com> From: Tali Perry Date: Tue, 8 Feb 2022 10:51:11 +0200 Message-ID: Subject: Re: [PATCH v1 6/6] i2c: npcm: Support NPCM845 To: Krzysztof Kozlowski Cc: =?UTF-8?Q?Jonathan_Neusch=C3=A4fer?= , Tyrone Ting , avifishman70@gmail.com, Tomer Maimon , Patrick Venture , Nancy Yuen , Benjamin Fair , Rob Herring , semen.protsenko@linaro.org, yangyicong@hisilicon.com, Wolfram Sang , jie.deng@intel.com, sven@svenpeter.dev, bence98@sch.bme.hu, lukas.bulwahn@gmail.com, arnd@arndb.de, olof@lixom.net, Andy Shevchenko , Tali Perry , Avi Fishman , tomer.maimon@nuvoton.com, KWLIU@nuvoton.com, JJLIU0@nuvoton.com, kfting@nuvoton.com, devicetree , OpenBMC Maillist , Linux I2C , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >On 08/02/2022 08:14, Tali Perry wrote: >>> Subject: Re: [PATCH v1 6/6] i2c: npcm: Support NPCM845 >>> >>> On 07/02/2022 13:00, Jonathan Neusch=C3=A4fer wrote: >>>> Hello, >>>> >>>> On Mon, Feb 07, 2022 at 02:33:38PM +0800, Tyrone Ting wrote: >>>>> From: Tyrone Ting >>>>> >>>>> NPCM8XX uses a similar i2c module as NPCM7XX. >>>>> The only difference is that the internal HW FIFO is larger. >>>>> >>>>> Related Makefile and Kconfig files are modified to support as well. >>>>> >>>>> Fixes: 56a1485b102e ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller >>>>> driver") >>>> >>>> It's not really a bug fix, but rather an additional feature. >>>> Therefore, I suggest removing the Fixes tag from this patch. >>>> >>>>> Signed-off-by: Tyrone Ting >>>>> Signed-off-by: Tali Perry >>>>> --- >>>> [...] >>>>> /* init register and default value required to enable module */ >>>>> #define NPCM_I2CSEGCTL 0xE4 >>>>> +#ifdef CONFIG_ARCH_NPCM7XX >>>>> #define NPCM_I2CSEGCTL_INIT_VAL 0x0333F000 >>>>> +#else >>>>> +#define NPCM_I2CSEGCTL_INIT_VAL 0x9333F000 >>>>> +#endif >>>> >>>> This is going to cause problems when someone tries to compile a kernel >>>> that runs on both NPCM7xx and NPCM8xx (because the driver will then >>>> only work on NPCM7xx). >>> >>> Yes, good catch. >>> >>> The NPCM7XX is multiplatform, I guess NPCM8xx will be as well, so this = looks like an invalid code. How such code is supposed to work on multiplatf= orm kernel? >>> >> >> NPCM7xx and NPCM8xx are very different devices. >> They share same driver sources for some of the modules but it's not ABI. >> Users cannot compile a single kernel with two separate DTS. >> In case of the i2c controller, the npcm7xx has a 16 byte HW FIFO, >> and the NPCM8xx has 32 bytes HW FIFO. >> This also means that registers fields are slightly different. >> For init data we can move it to the DTS, but register field sizes >> can't be handled with this approach. >> > >What do you mean they cannot compile a kernel with different DTS? Of >course they can - when we talk about multiplatform sub-architectures! >Maybe there is something specific in NPCMxxx which stops it but then it >should not be marked multiplatform. > NCPM7xx is ARM32 bit (dual core Cortex A9) NPCM8xx is ARM64 bit (quad core Cortex A35) They have completely different architecture so not ABI compliant. I2C module is similar, but the devices are quite different and have separate architectures. Sorry for the confusion. This is the first patch we try to upstream for NPCM8xx. In the coming weeks we will upstream the architecture of NPCM8xx as well. > >Best regards, >Krzysztof Thanks! Tali