From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 00C16C38142 for ; Mon, 23 Jan 2023 08:30:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:Cc:To:From:Date:References: In-Reply-To:Message-Id:Mime-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=A0UzpAxm9SZXq/a2UOEHVMbmdGuOQGW8f1AdpinucJA=; b=lZHVy8YS9qbqEb TO4jIi5/3rekkiosMkOh9cNDIjvymWDPJJl/oVJ9v9ld74ykdBriSUKsV+khIXJu7/i2EemZiLrP/ nTN3LElrqYDXWykWmrE9g3+aEh8LoOWbQ17WHbV8ldR+x3JkXxzRBUsywvTBkK5y1RO/+ci4l4ex4 BG8gJUdjW4SWsjLxln2R6yvUVZ4C3geJ8Px8BoztfFamGyYaU2HSp+H+hnPCoJD2VtrCyGF5mfTXt Wmco7CyvAi4yXDsKFa7G/RZbpH+4WE8bT65Zr0tDHg/M2RVmNhuvUGPpemhkrpFEIK0DDb2jzNjcf rSUV/3G4SkfqeLhouWQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pJsCv-00GM2P-Il; Mon, 23 Jan 2023 08:29:37 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pJsCs-00GM1I-6X for linux-arm-kernel@lists.infradead.org; Mon, 23 Jan 2023 08:29:36 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 3FF5B5C00E1; Mon, 23 Jan 2023 03:29:27 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Mon, 23 Jan 2023 03:29:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1674462567; x=1674548967; bh=ADDaCT7LRv 3SPIh6BoxXQg5cKChUVADCO5GhHss33LQ=; b=uM0NHdNbqPzET5M7qo4iHWWdtY zuuwLn65XOoH7/Nn4MteHGuyTGWgz1LRMVbcwjARg5mgoT0KTqluIxNgwsDcnmSa etYV0r45rxDr3R9jbkN/17KMiVX/VodOZgFusB3YktUG1wJ3eK2inMUtIQVKYlz2 hpdBqRrlikcy2QRUjm104sxOmuLPdx2ACWmm7UpXBud8IxsIziYClyDvpJ0CKvlL PrK7Fv1u6DzzEOILA55jTshI/UwOyLJ0rpBp3Jn9UN7EuxMwvgPWY0TDn6VKIhBP beZ06ohmMYio7jvTj7Wiiwm4f2v9OWSViNpSF9LG5bEOIUKXY10Yx6yTTR4Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1674462567; x=1674548967; bh=ADDaCT7LRv3SPIh6BoxXQg5cKChU VADCO5GhHss33LQ=; b=TwnoHPvaHl9DX5lfgadGkxMSdygLGUf41zGRT1WUpMPH zJ0SmxrCj+dOU5yVfY0Y268vLST0YUWZ44aVOsG4U6e1+/TNKQEuwQHUw4HJcC0z TYieS73mpjrBwcnqpgnK9kCIfIbyl6rRTahYAQ3b0oZRNmq97cN4XdWgl7FQfRW6 uVfEFLjyiwURAzr/dNQtNAVczmsmdBMOPtqbCymJdiLlZXo48jhKTxwLAUbSHKuZ FTO3Kc/fMPo8tOBRacaYhHLgyu+JkYY/ix1jL1XVrnCSCdjWq7F+KE6Nt51GpfY6 a6Ohqursr/UErKaawht0bfSzFwbTrTBdZnbqh6QECw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddujedguddvudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedt keetffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 085C2B60086; Mon, 23 Jan 2023 03:29:25 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-85-gd6d859e0cf-fm-20230116.001-gd6d859e0 Mime-Version: 1.0 Message-Id: <85b86d06-c63c-4481-a3dd-16b72572a5ee@app.fastmail.com> In-Reply-To: <20230123073305.149940-7-lchen@ambarella.com> References: <20230123073305.149940-1-lchen@ambarella.com> <20230123073305.149940-7-lchen@ambarella.com> Date: Mon, 23 Jan 2023 09:29:06 +0100 From: "Arnd Bergmann" To: "Li Chen" , "Li Chen" Cc: =?UTF-8?Q?Heiko_St=C3=BCbner?= , "Lubomir Rintel" , "Conor.Dooley" , "Robert Jarzmik" , "Sven Peter" , "Yinbo Zhu" , "Brian Norris" , "Hitomi Hasegawa" , "open list" , "moderated list:ARM/Ambarella SoC support" Subject: Re: [PATCH 06/15] soc: add Ambarella driver X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230123_002934_747528_AE8CDF13 X-CRM114-Status: GOOD ( 22.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jan 23, 2023, at 08:32, Li Chen wrote: > This driver add soc_id support for Ambarella, > which is stored inside "cpuid" AXI address mapping. > > Also provide sys_config(POC, aka power on configuration) > for other drivers. > > Signed-off-by: Li Chen The soc_id support looks ok > Change-Id: I4869a3497366ac7779e792835f8e0309239036a8 Please drop these lines in the submission, the IDs are not reachable outside of your own git, so we don't want these to show up in the public history. > +static struct ambarella_soc_id { > + unsigned int id; > + const char *name; > + const char *family; > +} soc_ids[] = { > + { 0x00483245, "s6lm", "10nm", }, > +}; I would suggest something more descriptive in the "family" field to let users know they are on an Ambarella SoC. Maybe just "Ambarella 10nm". > +static int __init ambarella_socinfo_init(void) > +{ > + struct soc_device_attribute *soc_dev_attr; > + struct soc_device *soc_dev; > + struct device_node *np; > + struct regmap *cpuid_regmap; > + unsigned int soc_id; > + > + cpuid_regmap = syscon_regmap_lookup_by_compatible("ambarella,cpuid"); > + if (IS_ERR(cpuid_regmap)) > + return PTR_ERR(cpuid_regmap); Is there anything else in this syscon node? If the block of registers only contains the identification bits, you could just make this file a platform_driver that binds to the node instead of using a syscon. If there are other unrelated registers in there, the compatible string should probably be changed to better describe the entire area based on the name in the datasheet. > +static unsigned int ambsys_config; > + > +unsigned int ambarella_sys_config(void) > +{ > + return ambsys_config; > +} > +EXPORT_SYMBOL(ambarella_sys_config); Which drivers use this bit? Can they be changed to use soc_device_match() instead to avoid the export? > +static int __init ambarella_soc_init(void) > +{ > + struct regmap *rct_regmap; > + int ret; > + > + rct_regmap = syscon_regmap_lookup_by_compatible("ambarella,rct"); > + if (IS_ERR(rct_regmap)) { > + pr_err("failed to get ambarella rct regmap\n"); > + return PTR_ERR(rct_regmap); > + } ... > +arch_initcall(ambarella_soc_init); It is not an error to use a chip from another manufacturer, please drop the pr_err() and return success here. > +#ifndef __SOC_AMBARELLA_MISC_H__ > +#define __SOC_AMBARELLA_MISC_H__ > + > +extern unsigned int ambarella_sys_config(void); > +extern struct proc_dir_entry *ambarella_proc_dir(void); > + The ambarella_proc_dir looks like a stale entry that should be removed. Ideally you should not need a private header at all. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel