Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1139438rdg; Fri, 13 Oct 2023 11:19:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGYs4niospYH+zXpx4G5in2Q8A/hTsu3nbcQQxOnT4eyRyhE8Q99LlFWM7MScUxVBH2Uw1q X-Received: by 2002:a05:6a20:4292:b0:13f:c40c:379 with SMTP id o18-20020a056a20429200b0013fc40c0379mr30813222pzj.13.1697221186560; Fri, 13 Oct 2023 11:19:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697221186; cv=none; d=google.com; s=arc-20160816; b=zWKoI1EsiAYGHb7Q7u+7pwtYW0ubcbihpbtNquvWKheMwNwyUDjgMYjI26mFVzjmxm dlzIIvA0uZM8agmGM71H8OtHus+MjXKoRVjIIX6GT4k+F4vdkOS+VWalm+SeC68yaW8E 0cTye1GLEoTeLnjhgQAEuAGYQ2FSyI7dsS38vou2D3bUh3PCgMLIlQ4OFXrR1hWUOxhx FRmRtVHR01/Ctmt34fR1acP34TNc9C5vc4poWUwtWOiMcPT6MyaKU0yg2LsdE1URCE77 ONWOwNK6a//usisIwtIVjLKoZANkft2vWijRXgGUhDHm0LSmTpd4MhRP5BzMx6dxr1TF YC8Q== 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=rEgHxjwiwSD+JRPgq4r1DGbDGCyxlMf5LLDf02rxVSQ=; fh=YvtvLGd+Mrvaw205oH+HuaBDY7G5nSApY/iFw4GI1nw=; b=Nhd62XxhLTyUiZ0Za6NBsqb3IDMRqUz8VUSsiAJTjmMiuHX1a1m1y/Vw0q4fYjocfO kRHnchR2vsWSrTH+NSkT3LnflndKycUHyg78KzKw2jg7DxS/xp6b6m8D7HQgX8Webdso ucBckH8TR+tML2XBWKy4IBTS9AEhhNGiRh2fJVrhXf2fT1Gwj009fb19BYJ4Zu6wz/T2 te7LsUoEOQIVmpd9485TZcYysA7jyRvgmMRIVX0l4Bl05IITHNBWOW2RpyAOV0lQAvjg mo1uVc9+XfCiZT0dl5NV0SDTfvNJLIfm5/ZYl//TrsmWuBHsRFKbfjuwIrPQ+krEN4xO hOwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=czzPJTEw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id i75-20020a636d4e000000b005740ab95917si5199961pgc.45.2023.10.13.11.19.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 11:19:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=czzPJTEw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id AFCB682ACAFA; Fri, 13 Oct 2023 11:19:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230469AbjJMSTe (ORCPT + 99 others); Fri, 13 Oct 2023 14:19:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229958AbjJMSTd (ORCPT ); Fri, 13 Oct 2023 14:19:33 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09BDE91 for ; Fri, 13 Oct 2023 11:19:30 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-50433d8385cso3149669e87.0 for ; Fri, 13 Oct 2023 11:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1697221168; x=1697825968; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=rEgHxjwiwSD+JRPgq4r1DGbDGCyxlMf5LLDf02rxVSQ=; b=czzPJTEweFW02bQ/pslv2EJzlCyCKGIAaMFjiNC/Iwiu/N7A7N1c5vYjDE3jfOQ+MO selRqnhrmtQIYTuPwfHiVGnbZsunAs61PNjjcWDintga7vGEOclBM6h5tl7aNLHNMjpF tvJElZTgoNetDYJW7xUnIo5rn1o2P+sxvG+RA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697221168; x=1697825968; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rEgHxjwiwSD+JRPgq4r1DGbDGCyxlMf5LLDf02rxVSQ=; b=xRcQ1GL01xgX9ai+kXfhukLime+Uo3ilL2Ttg1PVRA0Km0C07do7hihfMlR0XK4e6e O4B18cz/iFbWZpFMu1fa+eP8LgwDIYr4bPaWX37cIPNxqvoxl/L1iAaWyCMuldas8JB7 T4WODbgZKInE+dzw2zpRSPXjw/w346mh0b7UYArLh4SFYnUhE2Q8Kq5FG9H+NjLL+meR V1CNEnEhVIgALOi5zFcBrdje4B95CMS3e2HU7anZBgOpqVJPNLB7K3NKoE5Am9iaAJSY pKNZKsGy5IqpilSSe1ALr4CeqRbO4iCEAnRyBCoPf7I6Sh5DTFyT1OzQMQMlf/8ffJLA +IEQ== X-Gm-Message-State: AOJu0YyXndZDeiFnUitU54KEgPuDy5oxbsCRgrdTg9BulN8K4wn4vt2I bQiyFmoGHwjsIstlBheg9cQLbhpqQdyv4jhJcVIJVQ== X-Received: by 2002:ac2:5976:0:b0:507:96cd:928c with SMTP id h22-20020ac25976000000b0050796cd928cmr3079950lfp.48.1697221167978; Fri, 13 Oct 2023 11:19:27 -0700 (PDT) MIME-Version: 1.0 References: <20231012230237.2676469-1-wenst@chromium.org> <20231012230237.2676469-3-wenst@chromium.org> <20231013-washer-mortally-b27c196ac50f@spud> <20231013-panic-vaseline-350c10e7d585@spud> In-Reply-To: <20231013-panic-vaseline-350c10e7d585@spud> From: Chen-Yu Tsai Date: Fri, 13 Oct 2023 11:19:16 -0700 Message-ID: Subject: Re: [PATCH 2/9] dt-bindings: arm: mediatek: Add MT8186 Tentacruel / Tentacool Chromebooks To: Conor Dooley Cc: Matthias Brugger , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 13 Oct 2023 11:19:43 -0700 (PDT) On Fri, Oct 13, 2023 at 10:55=E2=80=AFAM Conor Dooley wr= ote: > > On Fri, Oct 13, 2023 at 10:29:25AM -0700, Chen-Yu Tsai wrote: > > On Fri, Oct 13, 2023 at 8:11=E2=80=AFAM Conor Dooley = wrote: > > > > > > On Fri, Oct 13, 2023 at 07:02:28AM +0800, Chen-Yu Tsai wrote: > > > > Add entries for MT8186 based Tentacruel / Tentacool Chromebooks. Th= e two > > > > are based on the same board design: the former is a convertible dev= ice > > > > with a touchscreen, stylus, and some extra buttons; the latter is a > > > > clamshell device and lacks these additional features. > > > > > > > > The two devices both have two variants. The difference is a second > > > > source touchpad controller that shares the same address as the orig= inal, > > > > but is incompatible. > > > > > > > The extra SKU IDs for the Tentacruel devices map to different senso= r > > > > components attached to the Embedded Controller. These are not visib= le > > > > to the main processor. > > > > > > Wha? Given your ordering, is a "google,tentacruel-sku262144" a super-= set > > > of "google,tentacruel-sku262145"? If not, this compatible ordering > > > doesn't make sense. I can't tell from your description, and the > > > absence of a > > > items: > > > - const: google,tentacruel-sku262145 > > > - const: google,tentacruel-sku262146 > > > - const: google,tentacruel-sku262147 > > > - const: google,tentacruel > > > - const: mediatek,mt8186 > > > suggests that there is no google,tentacruel-sku262145 > > > device? > > > > AFAIK all four SKUs exist. And as far as the main processor is concerne= d, > > they look completely identical, so they should share the same device tr= ee. > > As mentioned in the commit message, the differences are only visible to > > the embedded controller, which fuses the sensor inputs. > > Then it makes very little sense to write a binding like this. > If this was just for the 252144 SKU, this would be fine. > For the other SKUs, there is no way to uniquely identify them, as > all four of google,tentacruel-sku262144, google,tentacruel-sku262145, > google,tentacruel-sku262146 and google,tentacruel-sku262147 must be > present. > Given that, why even bother including the SKUs in the first place, > since no information can be derived from them that cannot be derived > from google,tentacruel? > There's something that I am clearly missing here... There are incompatible variants of google,tentacruel. This is why this patch has four google,tentacruel based entries. Of them, two are Tentacool, which are clamshell laptops, and two of them are Tentacruel, which are convertibles. Within each group there are two variants: the second variant swaps out the I2C touchpad controller. These two controllers use the same I2C address but use different compatible strings, so it's not possible to have them coexist within the same device tree file like we do for many other second source components. So the relationship looks like the following: google,tentacruel --- Tentacruel --- google,tentacruel-sku26214[4567] | | | -- google,tentacruel-sku2621{48,49,50,51} | -- Tentacool ---- google,tentacruel-sku327681 | --- google,tentacruel-sku327683 Also, the devices themselves only know their own SKU ID. The firmware will generate a list of compatible strings like: google,tentacruel-rev4-sku262144 google,tentacruel-rev4 google,tentacruel-sku262144 google,tentacruel and try to find a match in the kernel FIT image. The method we currently use is to include all the applicable board compatible strings. > Also, why is the order inverted, with the lower SKUs being super-sets of > the higher ones? The Hana one you show below makes a little more sense > in that regard. Either way works. The SKU IDs have no particular order. Nor do the individual bits in the SKU ID have meaning. They are just arbitrarily assigned by the manufacturer. They just have to all be present so any of the SKUs will match. Hope that explains things better. Regards ChenYu > > Writing it this way avoids having four identical device tree files. > > > > We also do this for many other device families, though those cover > > different revisions, such as: > > > > - description: Google Hana (Lenovo Chromebook N23 Yoga, C330, 300= e,...) > > items: > > - const: google,hana-rev6 > > - const: google,hana-rev5 > > - const: google,hana-rev4 > > - const: google,hana-rev3 > > - const: google,hana > > - const: mediatek,mt8173 > > > > > > ChenYu > > > > > Cheers, > > > Conor. > > > > > > > > > > > Signed-off-by: Chen-Yu Tsai > > > > --- > > > > .../devicetree/bindings/arm/mediatek.yaml | 26 +++++++++++++++= ++++ > > > > 1 file changed, 26 insertions(+) > > > > > > > > diff --git a/Documentation/devicetree/bindings/arm/mediatek.yaml b/= Documentation/devicetree/bindings/arm/mediatek.yaml > > > > index 60337b439744..aa7e6734b336 100644 > > > > --- a/Documentation/devicetree/bindings/arm/mediatek.yaml > > > > +++ b/Documentation/devicetree/bindings/arm/mediatek.yaml > > > > @@ -206,6 +206,32 @@ properties: > > > > - enum: > > > > - mediatek,mt8183-pumpkin > > > > - const: mediatek,mt8183 > > > > + - description: Google Tentacruel (ASUS Chromebook CM14 Flip = CM1402F) > > > > + items: > > > > + - const: google,tentacruel-sku262144 > > > > + - const: google,tentacruel-sku262145 > > > > + - const: google,tentacruel-sku262146 > > > > + - const: google,tentacruel-sku262147 > > > > + - const: google,tentacruel > > > > + - const: mediatek,mt8186 > > > > + - description: Google Tentacruel (ASUS Chromebook CM14 Flip = CM1402F) > > > > + items: > > > > + - const: google,tentacruel-sku262148 > > > > + - const: google,tentacruel-sku262149 > > > > + - const: google,tentacruel-sku262150 > > > > + - const: google,tentacruel-sku262151 > > > > + - const: google,tentacruel > > > > + - const: mediatek,mt8186 > > > > + - description: Google Tentacool (ASUS Chromebook CM14 CM1402= C) > > > > + items: > > > > + - const: google,tentacruel-sku327681 > > > > + - const: google,tentacruel > > > > + - const: mediatek,mt8186 > > > > + - description: Google Tentacool (ASUS Chromebook CM14 CM1402= C) > > > > + items: > > > > + - const: google,tentacruel-sku327683 > > > > + - const: google,tentacruel > > > > + - const: mediatek,mt8186 > > > > - items: > > > > - enum: > > > > - mediatek,mt8186-evb > > > > -- > > > > 2.42.0.655.g421f12c284-goog > > > >