Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7838441rwp; Wed, 19 Jul 2023 00:40:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlFjUwYTPtlcX+upQldo2FZYWAXt3VKhc0EcaoEBtkDSwPr3brXtQsxbrx6W+o4Hnlq1OSwZ X-Received: by 2002:a05:6358:3402:b0:129:c9c0:ca64 with SMTP id h2-20020a056358340200b00129c9c0ca64mr17391105rwd.15.1689752428005; Wed, 19 Jul 2023 00:40:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689752427; cv=none; d=google.com; s=arc-20160816; b=xEAJijNFmrj0QhKY4V+B646+gvOIPB1fOJfOlBrhF9ZqZsObkuxRbj9FR2Jf8DHc5M 1IvfGcCsLP3NhdUtzfG69JOSzgc4i6oUueG2iJVDIMNIvZ8bZdAtQ7xzQndXOUUewPT3 BvyBZ64kEb/rLcKp5Tb+2KVduoMR6Sd0x2IfGZ44odcIoqJIJhbDvyp4RtREnePzk+/i FbPxPFoq4xN0FuxJsVLjX3SOtrTmAwMMmHlf2kNicA04Uf8xzTXsAjq/nAhY47+ohU3E 9DRMaT0lD3Br/kOSHsqwuvxdyQpDYSy4453GCFmfIj5E0zUzgW85jiD+SpnlKjAlcKNY Vi2g== 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=XxaW537ugikYpFh7/sHgGUrbaaEUOyt7euj4aROoEws=; fh=3ZldOe2oz5+a9+t/VyQHX5aDa9bed3cUhZjQZFIpuZc=; b=v+0KWESZ4pKs2XZvG5fQAXpRhuZs35bNoMNa3TgX7WY00gFXeiSwDoOpy5l5F3cMJs Sd0mgEhDrvyb/NbeZS2Lh8plDu9/2vChpWwTWlmMbFQUtA0e0H4xQYPQOhGoTyheCI2T APlP5b3VJjvppOAoVp15bK0i6IzK97bYPcqnFjvYsAfbEUUd6qfMk+Pm6xXiWwTChR4g j5sIRRdZADPRbYE/xv96Rl0Dr98p4bqb9yrRIyiUbo9MdmPcJyHQEC6kjTAE6G1ya7Xv j3kf4r72sXN35yT/CYI9YFh/RUoqpHpOEY59R6pjL3eAQSVDnWahLksQR3FdoImdYAtO dOtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=O8CEihVe; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t63-20020a638142000000b00543d2b94731si2916442pgd.479.2023.07.19.00.40.15; Wed, 19 Jul 2023 00:40:27 -0700 (PDT) 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=@collabora.com header.s=mail header.b=O8CEihVe; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230188AbjGSHVk (ORCPT + 99 others); Wed, 19 Jul 2023 03:21:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230171AbjGSHVQ (ORCPT ); Wed, 19 Jul 2023 03:21:16 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C616526A0; Wed, 19 Jul 2023 00:21:03 -0700 (PDT) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id A916D66003AA; Wed, 19 Jul 2023 08:21:01 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1689751262; bh=eoZISowr7QrTo8XDR+V8qw4PjxQY2Bmj/1UAP+hq3Bw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=O8CEihVe9gOmBSC26nZD06STF1dGhxdcsNFXM7+PnStUGpVMmyZKkCL7ow8wCn+W1 xRwu8DZbjhcBjG8wuR8B9OIysr4NJIzgjeYt3KuxtpZ/D06G2ZYCERnb98L6jKZ1yu 9tvDkVPeFTIIb6OfmwhXcSQ2rUC9bexVellw2MjIIS8n5lnJjRTeIE2k9+sHTjlU9u okBDAlAX5FEJ6Mj7OO61Pj43hBeggQ5JCVGYlFqWL3qg022x9XJOLLqRO1vwVo7vX1 a0hHsq5jdqKK2tAoxbLRndDczxP84rAayJmHOo/Ex8qifEPOEYVPJtZmzBPFFt03ba M/z3owyipvJ3A== Message-ID: Date: Wed, 19 Jul 2023 09:20:59 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH 1/3] soc: mediatek: mtk-socinfo: Add driver for getting chip information Content-Language: en-US To: William-tw Lin , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , Kevin Hilman Cc: Project_Global_Chrome_Upstream_Group@mediatek.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org References: <20230718112143.14036-1-william-tw.lin@mediatek.com> <20230718112143.14036-2-william-tw.lin@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20230718112143.14036-2-william-tw.lin@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham 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 Il 18/07/23 13:21, William-tw Lin ha scritto: > Add driver for socinfo retrieval. This patch includes the following: > 1. mtk-socinfo driver for chip info retrieval > 2. Related changes to Makefile and Kconfig > > Signed-off-by: William-tw Lin > --- > drivers/soc/mediatek/Kconfig | 18 +++ > drivers/soc/mediatek/Makefile | 1 + > drivers/soc/mediatek/mtk-socinfo.c | 203 +++++++++++++++++++++++++++ > drivers/soc/mediatek/mtk-socinfo.h | 213 +++++++++++++++++++++++++++++ > 4 files changed, 435 insertions(+) > create mode 100644 drivers/soc/mediatek/mtk-socinfo.c > create mode 100644 drivers/soc/mediatek/mtk-socinfo.h > ..snip.. > + > +/* begin 8186 info */ > +#define mtk_mt8186_EFUSE_DATA_COUNT 1 > +static struct efuse_data mtk_mt8186_efuse_data_info[][mtk_mt8186_EFUSE_DATA_COUNT] = { > + {{.nvmem_cell_name = "socinfo-data1", .efuse_data = 0x81861001}}, > + {{.nvmem_cell_name = "socinfo-data1", .efuse_data = 0x81862001}}, > +}; I'm *sure* that there's a way to avoid specifying the soc-specific compatible, as the efuse_data is used only for validation, while what you do here is to simply read the SoC ID from eFuse array. In theory, this driver could simply have compatible = "mediatek,socinfo"; as compatible string, without any SoC-specific string in the devicetree, at all, so that the SoC ID would get recognized completely dynamically - and adding the name and other strings would be a consequence. > + > +static struct name_data mtk_mt8186_name_data_info[] = { > + {.soc_name = "MT8186", > + .soc_segment_name = "MT8186GV/AZA", > + .marketing_name = "Kompanio 520"}, > + {.soc_name = "MT8186T", > + .soc_segment_name = "MT8186TV/AZA", > + .marketing_name = "Kompanio 528"}, > +}; > +/* end 8186 info */ > + Regards, Angelo