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 X-Spam-Level: X-Spam-Status: No, score=-13.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61857C433E2 for ; Mon, 7 Sep 2020 19:41:01 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F03F720C09 for ; Mon, 7 Sep 2020 19:41:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="1+KsEoL0"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="nJEgAsMf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F03F720C09 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GSu0SsevpLLJxSp5CcdI68tRRzwBn5B7He7zd/COys8=; b=1+KsEoL0X82cTbCXNFqL3XJX+ QFglwenaQicvqXsPnOSNrlrkKS1LygZKK+INd4fx26gwDDQQvsJX/wbh1L7p8Jw82Z1MFo4m1pIlE toM+7Vja+hq5vumDgeHrlOCjbH6rR1fQ5tuE1CxPB1BNokAKtTpS68rqTeqbeb3HJOBdyeG1TAvZW sbQo6HuSSyrtKry0YZOqkTVTw5NO3hdjYMvI+nytN2j9uKE4ooMCGQ3XS3NWua19KtrhpRZSUQQQT HVIBNXFiaIDlNK9LsX1RrOPzjxmIgEhIg8/fXA7gmc3ZLKUKoHe9VHbxXp0PXGvqMZtJ6ds7aTi/b YEPTSrJVA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFMzO-0002Sc-1l; Mon, 07 Sep 2020 19:39:42 +0000 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFMzL-0002SH-Rm for linux-arm-kernel@lists.infradead.org; Mon, 07 Sep 2020 19:39:40 +0000 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 07 Sep 2020 12:39:25 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 07 Sep 2020 12:39:38 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 07 Sep 2020 12:39:38 -0700 Received: from [10.26.73.157] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 7 Sep 2020 19:39:37 +0000 Subject: Re: [PATCH 7/9] soc/tegra: fuse: Add Tegra234 support To: Thierry Reding References: <20200716141856.544718-1-thierry.reding@gmail.com> <20200716141856.544718-8-thierry.reding@gmail.com> From: Jon Hunter Message-ID: <6ce08a40-24ec-7fec-efdf-652f220430e9@nvidia.com> Date: Mon, 7 Sep 2020 20:39:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200716141856.544718-8-thierry.reding@gmail.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) Content-Language: en-US DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1599507565; bh=irbQhR1/l7PqaEG7hcPcWO+4Azuji93vy4gwc+Fdomc=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=nJEgAsMfi10DQg+ZiSjQk1Q6Wbohyz4Z0YVSkkuKXb02jlu6t0ngnmJO0fE+2X9ns 21yxlbv2AA6HQ4THo3g3EokDZBatKz9gglnbLm4nSIGipIXeaJEzE2sHhFy/lbN/Jx DUX15B/OnnOZoNRpT9LNvTy8yckKQRIHeI1erAx5aWQbkBEFNxZb3HLWejAuN1Ff8J Cxy9w/XOLe0Hpta9m8bCNWHxMLKEfxbZlDBm5MX9FNpe7JrCAcbNywsfVlwk25s/jd wPzPYu9AFFIYHGQaRb8cIKCw6tM0+0akrre0Rx1DUfk4fbbKCR3xXMU3r46oDwtu6H VYe5xpRWJ2SmQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200907_153939_998016_4AD774B3 X-CRM114-Status: GOOD ( 22.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 16/07/2020 15:18, Thierry Reding wrote: > From: Thierry Reding > > Add support for FUSE block found on the Tegra234 SoC, which is largely > similar to the IP found on previous generations. > > Signed-off-by: Thierry Reding > --- > drivers/soc/tegra/fuse/fuse-tegra.c | 6 +++++- > drivers/soc/tegra/fuse/fuse-tegra30.c | 30 ++++++++++++++++++++++++++ > drivers/soc/tegra/fuse/fuse.h | 10 ++++++++- > drivers/soc/tegra/fuse/tegra-apbmisc.c | 1 + > include/soc/tegra/fuse.h | 1 + > 5 files changed, 46 insertions(+), 2 deletions(-) > > diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c > index 7e6b6ee59120..94b60a692b51 100644 > --- a/drivers/soc/tegra/fuse/fuse-tegra.c > +++ b/drivers/soc/tegra/fuse/fuse-tegra.c > @@ -49,6 +49,9 @@ static struct tegra_fuse *fuse = &(struct tegra_fuse) { > }; > > static const struct of_device_id tegra_fuse_match[] = { > +#ifdef CONFIG_ARCH_TEGRA_234_SOC > + { .compatible = "nvidia,tegra234-efuse", .data = &tegra234_fuse_soc }, > +#endif > #ifdef CONFIG_ARCH_TEGRA_194_SOC > { .compatible = "nvidia,tegra194-efuse", .data = &tegra194_fuse_soc }, > #endif > @@ -326,7 +329,8 @@ const struct attribute_group tegra_soc_attr_group = { > .attrs = tegra_soc_attr, > }; > > -#ifdef CONFIG_ARCH_TEGRA_194_SOC > +#if IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) || \ > + IS_ENABLED(CONFIG_ARCH_TEGRA_234_SOC) > static ssize_t platform_show(struct device *dev, struct device_attribute *attr, > char *buf) > { > diff --git a/drivers/soc/tegra/fuse/fuse-tegra30.c b/drivers/soc/tegra/fuse/fuse-tegra30.c > index 85accef41fa1..9ea7f0168457 100644 > --- a/drivers/soc/tegra/fuse/fuse-tegra30.c > +++ b/drivers/soc/tegra/fuse/fuse-tegra30.c > @@ -356,3 +356,33 @@ const struct tegra_fuse_soc tegra194_fuse_soc = { > .soc_attr_group = &tegra194_soc_attr_group, > }; > #endif > + > +#if defined(CONFIG_ARCH_TEGRA_234_SOC) > +static const struct nvmem_cell_lookup tegra234_fuse_lookups[] = { > + { > + .nvmem_name = "fuse", > + .cell_name = "xusb-pad-calibration", > + .dev_id = "3520000.padctl", > + .con_id = "calibration", > + }, { > + .nvmem_name = "fuse", > + .cell_name = "xusb-pad-calibration-ext", > + .dev_id = "3520000.padctl", > + .con_id = "calibration-ext", > + }, > +}; > + > +static const struct tegra_fuse_info tegra234_fuse_info = { > + .read = tegra30_fuse_read, > + .size = 0x300, > + .spare = 0x280, > +}; > + > +const struct tegra_fuse_soc tegra234_fuse_soc = { > + .init = tegra30_fuse_init, > + .info = &tegra234_fuse_info, > + .lookups = tegra234_fuse_lookups, > + .num_lookups = ARRAY_SIZE(tegra234_fuse_lookups), > + .soc_attr_group = &tegra194_soc_attr_group, > +}; > +#endif > diff --git a/drivers/soc/tegra/fuse/fuse.h b/drivers/soc/tegra/fuse/fuse.h > index 9d4fc315a007..e057a58e2060 100644 > --- a/drivers/soc/tegra/fuse/fuse.h > +++ b/drivers/soc/tegra/fuse/fuse.h > @@ -115,9 +115,17 @@ extern const struct tegra_fuse_soc tegra210_fuse_soc; > extern const struct tegra_fuse_soc tegra186_fuse_soc; > #endif > > +#if IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) || \ > + IS_ENABLED(CONFIG_ARCH_TEGRA_234_SOC) > +extern const struct attribute_group tegra194_soc_attr_group; > +#endif > + > #ifdef CONFIG_ARCH_TEGRA_194_SOC > extern const struct tegra_fuse_soc tegra194_fuse_soc; > -extern const struct attribute_group tegra194_soc_attr_group; > +#endif > + > +#ifdef CONFIG_ARCH_TEGRA_234_SOC > +extern const struct tegra_fuse_soc tegra234_fuse_soc; > #endif > > #endif > diff --git a/drivers/soc/tegra/fuse/tegra-apbmisc.c b/drivers/soc/tegra/fuse/tegra-apbmisc.c > index be6b7fc169ca..6aeac5ea2d70 100644 > --- a/drivers/soc/tegra/fuse/tegra-apbmisc.c > +++ b/drivers/soc/tegra/fuse/tegra-apbmisc.c > @@ -56,6 +56,7 @@ bool tegra_is_silicon(void) > { > switch (tegra_get_chip_id()) { > case TEGRA194: > + case TEGRA234: > if (tegra_get_platform() == 0) > return true; > > diff --git a/include/soc/tegra/fuse.h b/include/soc/tegra/fuse.h > index a9db917a1d06..c702bd2911bc 100644 > --- a/include/soc/tegra/fuse.h > +++ b/include/soc/tegra/fuse.h > @@ -14,6 +14,7 @@ > #define TEGRA210 0x21 > #define TEGRA186 0x18 > #define TEGRA194 0x19 > +#define TEGRA234 0x23 > > #define TEGRA_FUSE_SKU_CALIB_0 0xf0 > #define TEGRA30_FUSE_SATA_CALIB 0x124 > Reviewed-by: Jon Hunter Cheers Jon -- nvpublic _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel