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=-12.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 90B01C43461 for ; Thu, 17 Sep 2020 10:11:18 +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 3E52221734 for ; Thu, 17 Sep 2020 10:11:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="14Uj/4yH"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NPokwmFv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E52221734 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gO9gDcCHsZ8jlhU03XR/nPZd3JgH7agbPrkyUmzFyus=; b=14Uj/4yHy2L1HDtH0XoOfTmYi XlRF6Qid88grVJ2TbfYOwvXqs14/JEZHdP0WYoVXnOHxwaLT3hEw4OBT10H/4wzBmWMZJU1tnbVVN OmIA+CsPhEIj1/aMDFiLv8c/Lfj5aqNIHIG6EonWkJeRhGFwLLP7zhrja7PdJbycGKd3b43Hjbd5G uDUTAx/kuA96PKzp9lH2w1vySdyQp8AQZRw010C/q54OegzGBT7dqJq5agXOqVE6Ije+gJYLMIl1H e/IYP/2tuxsQulEyorM78rcD05AWEOeaDDPHBvwdrydvUuTWrJ2WmFchGWMBpZ72Yo6u9a3VmtyGY i3EucMbVA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIqrC-0000VD-7p; Thu, 17 Sep 2020 10:09:38 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIqpz-0008NC-Fo for linux-arm-kernel@lists.infradead.org; Thu, 17 Sep 2020 10:08:25 +0000 Received: by mail-wm1-x344.google.com with SMTP id d4so1381992wmd.5 for ; Thu, 17 Sep 2020 03:08:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NUyGgCyoC1I2akC3uVjZ2yqsqNamKvu1koU581xQ5q0=; b=NPokwmFvc00RyEnIY7d3kKxBS3lsjzXPwvmFpbEUiIWZSupOg9r8KHnHgZqVYrSSWi frxFGj5GSkVnxhMaEcrq8di7lWa+9c35NNkP2kg00tMzZLzkp7rYTB5X0tYLAN7sa2lt haOQqw1TEIfwIMFYBcAohNjBhQ9S5aNN8KuZexCQmNBqYKi3DdyMQiIcFjupdJZcUtpD NwrRVtcvjffaf+9KUkd0VYUH1WLmfQVnIoOMszH+ielX07UfaHhcrcuPbuRguB0OG5Qf 3om8XwOOYq8bSSXSSUI3c4GKkNRpiz0KFAETGtdM2ud6DGozhOAjSCulsiNsDSmiHEFj wGjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NUyGgCyoC1I2akC3uVjZ2yqsqNamKvu1koU581xQ5q0=; b=oiO2Wo2lQ9NsK6gcqvDVVccldYih4GLJ37Z3rnymhF9l5OThWYMFWZYNEPnRCz7Npt 7+sbmVbpfJ1pVVYb/UO8KZaXZdcykQ4E7msMCWtWk8tPM8MxIMhYakop68U/zX+pQCEQ vtOaJM4Ssc+gVS7E92sOrejhmKVB0rYqm4+D9MeED04Q0h+qjjULuoRoeT4dz/5JezLe 71vFN3n59SEZARpT5oxDe5V0Eqy+rWnz68dNeRp/9/hNByAAcK7eJawMtGxRedX6M2pe MZ1d0bgxwv8mRE2/0iRoJnFz7yw1bZrY8kPW8+mqUiLbgOzWYgvOgkGTgPWinE8gM9+R pFrA== X-Gm-Message-State: AOAM5310ihq1+FqXeVQGv0SRZpvf62LlFuQ6KBNQdl2wJpIugbbY+TOS RGhcjDe1aj3PgnASorX+zzQ= X-Google-Smtp-Source: ABdhPJzsPPiyeU6zd4gP5gpwmAKBoZ5OjGdiGNbz24uHaFHfG89gdkXjxpwiFYDRlPF+wGLUpWXGNQ== X-Received: by 2002:a1c:1d08:: with SMTP id d8mr9608681wmd.78.1600337302350; Thu, 17 Sep 2020 03:08:22 -0700 (PDT) Received: from localhost ([217.111.27.204]) by smtp.gmail.com with ESMTPSA id i11sm38592653wre.32.2020.09.17.03.08.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Sep 2020 03:08:21 -0700 (PDT) From: Thierry Reding To: Thierry Reding Subject: [PATCH v2 09/14] soc/tegra: fuse: Add Tegra234 support Date: Thu, 17 Sep 2020 12:07:47 +0200 Message-Id: <20200917100752.3516153-10-thierry.reding@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200917100752.3516153-1-thierry.reding@gmail.com> References: <20200917100752.3516153-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200917_060823_582258_D64FC24F X-CRM114-Status: GOOD ( 18.06 ) 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, Jon Hunter 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 From: Thierry Reding Add support for FUSE block found on the Tegra234 SoC, which is largely similar to the IP found on previous generations. Reviewed-by: Jon Hunter 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 946a2d9ad117..0e4eb2656f44 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 -- 2.28.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel