Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1319906pxb; Tue, 8 Feb 2022 14:35:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzGSpLo62Ks/o7eOk8VBqhRIx83QElmIm7qJi/5Mo5dYcvnso96YC4GFVp40OC0xFsW9GE X-Received: by 2002:a63:2d86:: with SMTP id t128mr5275816pgt.200.1644359720080; Tue, 08 Feb 2022 14:35:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644359720; cv=none; d=google.com; s=arc-20160816; b=vjBaX9k76DtjBj6DLFD35DFPVFEkFGx8xjCZU5k0/hBS+RnoR3OXzv4L8jdPrFtF3H f8ip44wEBi7sBUIMJR8Miz2SAo5unnP1hsAqds9yw1lNtJ95gsJG5Yw+WlLdUea+r/tw CVEpUTpEB59z2UaLIIql0fIPf7mbKy+NM9s50AEHrwYZbDPLrmgA7OPJ/fFXd/Vw0D1R EVQRvcS9TnGbZie8KpbUokEpvnWNAForja9+ftJ3q7MDL2buyYG0vQqa1UU0RY2HxXM6 VzkYo6usSs4HezSJ5pi3oDQ7DylvDywnTiHadeZhZ2t/ObN/ZHa2fQK2TntN2mNxCZ14 PQyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=KUmu+SyX79IqC4JJ7btjA8fb9z3hZtQRTMNCGj6+80w=; b=nfpIoG9IV7zQK1iFJ32SEWc+EiDb5roEyS9vTlOaKMdhv6rupBztNR6vxc65rHApGO KynaQWQ0S4EK0h0/LkMRR/+9x8cHw3Aon8ye1QmeX76fbN67lvtpbgnwt2hUSuHMcMdn Z59n22UNUd5y19l+NM97+uuEpJ7vEYrlYwUw4NJXHFO/J9nsH10KAu9q9C1VcZ9QOJ0J kKSbTB49ggeUb6uIkE+344ZJxGi/D+eqbtiABsM2X7+VyYGw0eWex2XQrt7mJ8SA0S1I VY6SQ1MeRLgDudZ44+8OF0iDW29PjyIhWmvGFkd1VRCViZ4bVoV41HhbbxTqdWhZ4DIB Q47Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=ZaT9o8DR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e14si9321907plo.107.2022.02.08.14.35.06; Tue, 08 Feb 2022 14:35:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=ZaT9o8DR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348662AbiBHH7R (ORCPT + 99 others); Tue, 8 Feb 2022 02:59:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345198AbiBHH7Q (ORCPT ); Tue, 8 Feb 2022 02:59:16 -0500 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B2D4C0401F4 for ; Mon, 7 Feb 2022 23:59:15 -0800 (PST) Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id C893B3FFDA for ; Tue, 8 Feb 2022 07:59:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1644307147; bh=KUmu+SyX79IqC4JJ7btjA8fb9z3hZtQRTMNCGj6+80w=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ZaT9o8DR6x0Jh9WF0J4dBiIwXaB1MJ8fB5rID68l/ASmd5fboJQR14EGhmB9jFykd KNmLtHkZoPoI0qXApti2/hjMQY5C91wl/FU+xIZnUVQ8UdfGs7eVTwe2Ljx8CgPh3Q Qs1saJBR7zBpYuH70NB5cXrPXSVsS6XmPYehYWz2IlSKV1srZxvXCA3Cr6k9os+5By E/KP5bb64TtBohSBCb8DRaaBrnOVzxgXpe2tBT40vEKlaRHp4duxDjENN1hhoYtWcu koChDhbipP1H4ZkwsLQKDYa0b9JfM7usIqoVKFaqJgX0AERuaBkQtEV5OzT9kd2WcL Lez3NP6yxLxzA== Received: by mail-ej1-f70.google.com with SMTP id l18-20020a1709063d3200b006a93f7d4941so5376056ejf.1 for ; Mon, 07 Feb 2022 23:59:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=KUmu+SyX79IqC4JJ7btjA8fb9z3hZtQRTMNCGj6+80w=; b=kZ3n1INRUSK7dlz8rd5rDRHf4V1KZsm6Q4iN5z8eCn10+Otcre4YlyUkXxj+DWNuJ4 ERjCbflFiPPCSTP/sUWDhQEqO6WuNdJPzfGxySdbAlxQT4hxcwFL6g+eNZwGFlojNF1x O/0Xf7X7EwmGoSHtTycLJBDLWr6ySyoidc2If+0dVCOV3tM/53NOadxbYxOKIH/9XW8U 7cv1/Kk0kvBMDzq9m0q3yEVRQuCHY1OYZuo54LIr7D2d+hLz1HIGrL42AR8DJggGhv2K yQ35eX7QU+lVkBG/bjv3gkIPuyYxvmGNUKt8YyCoqBBIeH294qLo/5118+iGlbkJs52G 6wmA== X-Gm-Message-State: AOAM532/Z64B8vwrgMVLhxddoj5n6y/xHIPpVzD1OCtg1kjioga3Zef/ Z02RVy0lD9c9REjd1PXqgEIwLirN5qh91N8vKEypgrNIrVE2lSjmPLTv3gdHQx46ud5MV7NcRGC LZelH2Z4OJDnu0nuub9LIxAVWoNbw/ZeittFEhmaP4A== X-Received: by 2002:a17:907:3d9e:: with SMTP id he30mr2695744ejc.625.1644307147047; Mon, 07 Feb 2022 23:59:07 -0800 (PST) X-Received: by 2002:a17:907:3d9e:: with SMTP id he30mr2695737ejc.625.1644307146862; Mon, 07 Feb 2022 23:59:06 -0800 (PST) Received: from [192.168.0.92] (xdsl-188-155-168-84.adslplus.ch. [188.155.168.84]) by smtp.gmail.com with ESMTPSA id i24sm42682edt.86.2022.02.07.23.59.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Feb 2022 23:59:06 -0800 (PST) Message-ID: <30ac5fe7-9d96-a756-24b0-384361b48a2d@canonical.com> Date: Tue, 8 Feb 2022 08:59:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v1 6/6] i2c: npcm: Support NPCM845 Content-Language: en-US To: Tali Perry 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 References: <20220207063338.6570-1-warp5tw@gmail.com> <20220207063338.6570-7-warp5tw@gmail.com> <086655b0-b9d2-30ed-1496-47cdc6346003@canonical.com> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: >> -----Original Message----- >> From: Krzysztof Kozlowski >> Sent: Monday, February 7, 2022 5:27 PM >> To: Jonathan Neuschäfer ; Tyrone Ting >> Cc: avifishman70@gmail.com; tmaimon77@gmail.com; tali.perry1@gmail.com; venture@google.com; yuenn@google.com; benjaminfair@google.com; robh+dt@kernel.org; semen.protsenko@linaro.org; yangyicong@hisilicon.com; wsa@kernel.org; jie.deng@intel.com; sven@svenpeter.dev; bence98@sch.bme.hu; lukas.bulwahn@gmail.com; arnd@arndb.de; olof@lixom.net; andriy.shevchenko@linux.intel.com; IS20 Tali Perry ; IS20 Avi Fishman ; IS20 Tomer Maimon ; CS20 KWLiu ; CS20 JJLiu0 ; CS20 KFTing ; devicetree@vger.kernel.org; openbmc@lists.ozlabs.org; linux-i2c@vger.kernel.org; linux-kernel@vger.kernel.org >> Subject: Re: [PATCH v1 6/6] i2c: npcm: Support NPCM845 >> >> On 07/02/2022 13:00, Jonathan Neuschäfer 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 multiplatform 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. Best regards, Krzysztof