From patchwork Sun Jun 7 18:54:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199459 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 3BBE6C433DF for ; Sun, 7 Jun 2020 18:57:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 18D2A2073B for ; Sun, 7 Jun 2020 18:57:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CkMC2yyR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727961AbgFGS5O (ORCPT ); Sun, 7 Jun 2020 14:57:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727101AbgFGS5M (ORCPT ); Sun, 7 Jun 2020 14:57:12 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 078B0C061A0E; Sun, 7 Jun 2020 11:57:12 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id j18so4707587lji.2; Sun, 07 Jun 2020 11:57:11 -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=o4M3bTUDA74h1lwoV4T2HnrphCh8yThUo/f/7p0LEJQ=; b=CkMC2yyRk6883zqpAxX3D1mm05jiHYAU2va3Na9qiT6EcqhE+YCtxioloddd5gIt7f kOwDXEteEPBfWLC1auewBMLUK0rtXuKeZSXs7Q4LnRgB/zcp1jsInTnUWcvh+rbJo9B4 gXnmvVRGMUm3XxXmbdtOxB2BTHlthJlo1eH3rShxEIdvw8xUOo4xKq0hSJLg+c4K9u9d AUp0UIv4qrSNp0u68DZjroN1XS0HGXzPqW9TXc3mg3tjUMwAM80UbGiUyoV4mvOIccwl Y2l/g88zwG8WC+DPQ4R+7JjgYJ4XgeM3CN7yu485J5ir2ZVC8fA1l0m9gUupKOwbn0ok 0sAA== 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=o4M3bTUDA74h1lwoV4T2HnrphCh8yThUo/f/7p0LEJQ=; b=Cxo3VTnV6z3kju5KJ2Z9m12oOg66ydLmY9zzZWSp6yzEWEu85ZGGJosnr0WBRCglPx z+aVl62YIQR0fJwsj/DamOuCXeJYoIqDU2Bs9JY0izJ7nG/7Pt5DDkE8p2blE+/PJ4xk xAdhZiOsXIpi9Wc4XoMCaqh7p5z/sEngcH9mfrtS9VpUX5n6DEEpkG4FfbLB8XKZukO9 4cVfavOIB+wHkUsyDhqmlmWfpYC3/SgfIGxhVWSWuOl3WvzPPcDH15igxB86OjWQac7o +bbXf8zq3JWjFOgiY58Rt7JSwHDYt3ZRRrexkfvHA2C86JiQFCvTZIhN66k4m8FqUS2L CTUA== X-Gm-Message-State: AOAM533stnr7foRCIHy9aWeKdkUWaihWKcnPsfXXLg1tNDKT1wTJKO7P FDPufJBB99BKZFihKHht1Vc= X-Google-Smtp-Source: ABdhPJxETMF3Q1N54rcAMjLTroZSTX4jtV3H9y1r8OIF+OopgvIIuIM9/RNrxzek11VHQAuD0bGIog== X-Received: by 2002:a2e:8115:: with SMTP id d21mr9773311ljg.167.1591556230516; Sun, 07 Jun 2020 11:57:10 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:09 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 01/39] clk: Export clk_hw_reparent() Date: Sun, 7 Jun 2020 21:54:52 +0300 Message-Id: <20200607185530.18113-2-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org We're going to turn Tegra124 Memory Controller driver into a loadable kernel module. The driver uses clk_hw_reparent(), which isn't an exported kernel symbol. Let's export that function in order to allow modularization of the Tegra driver. Signed-off-by: Dmitry Osipenko --- drivers/clk/clk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 3f588ed06ce3..2fa6394d9a1b 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -2439,6 +2439,7 @@ void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent) clk_core_reparent(hw->core, !new_parent ? NULL : new_parent->core); } +EXPORT_SYMBOL_GPL(clk_hw_reparent); /** * clk_has_parent - check if a clock is a possible parent for another From patchwork Sun Jun 7 18:54:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199440 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 1E018C433E0 for ; Sun, 7 Jun 2020 19:00:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F06922067B for ; Sun, 7 Jun 2020 19:00:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dVzKPShw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728157AbgFGTAj (ORCPT ); Sun, 7 Jun 2020 15:00:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728033AbgFGS5P (ORCPT ); Sun, 7 Jun 2020 14:57:15 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3A00C08C5C3; Sun, 7 Jun 2020 11:57:14 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id z9so17736691ljh.13; Sun, 07 Jun 2020 11:57:14 -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=GpFtIVnKnNndfebpkGzqwkaxd/wyRN7pW9EKTYyaD+o=; b=dVzKPShw4KgOD+DsB7SciXodU7w9VUVFbPFuBaWR1s1z0scCvNhSx+hpw7DAJwTx/O YXrQ3c7MVoaaRHpVLS7AvmJvyu/ZpsNv0KE89n0nu0ifIdn9S7AruNCHTTpTzT33pB6U Ka4/FclAqOgc6eMWkhNE2AefzhqucIaXMO8JtuxQZC6PM/6fmHERV+dTjkKyTnBEUZ4P WXfUE3bmKN7JQF+8kpAnyMy9DpCKvYHxvacGsSaMssAinTqBr6DnxGfYTw+Rb43NX8/X CH6zbNCCOfnGM54v56VMS5BzpkU8HArHeCfU6yGw/GtdGDo+XW3kYwyA1/suXSHcuQCD 6/tQ== 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=GpFtIVnKnNndfebpkGzqwkaxd/wyRN7pW9EKTYyaD+o=; b=YmqlOILiKcSaCkOynOCukg1KjWLk4XNlL3LLsmRbqHcBfXP8vv/LROaH6LtHln+6tQ HMdS+J+s0war6ARCVr2XSp5hI5u1duEdWdVWR+cpZj7EP6FtHtKbljDVKoHbzewR9I/R +t+LZ4Lf30PktW+EEN2cVWvVzNXrcBkbjt+uLmQ/nkb2xdGts6lkyX9bcJ9tTbqyIS7R zEY8oOcugm97RXf+BpQ/KPEY2vDioSXdMk/YyPrjz2oQCGOoYQ6Ag62WJx1J3XUgdCUu 0Vr+Seu06DGHmcl0/cExrKl4Bou4ofa1qQMhzbAFtw24QBhEod3vdk9YFMpWIulXKRIn ePig== X-Gm-Message-State: AOAM530Cc7frTCiNV2x5b96rL/3PWQ80PAD3srV5w7IQxC3tjKoGnq1j 8eT5laBHjv1XWsTvnkBHX1s= X-Google-Smtp-Source: ABdhPJx9HQOg7T9G9DNZloItTqEpDE+zxBogAZlWstcxnU5tM6I+j0lUX/A4nl13lbKimVaBTwXU5g== X-Received: by 2002:a2e:6f13:: with SMTP id k19mr10267726ljc.364.1591556233270; Sun, 07 Jun 2020 11:57:13 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:12 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 03/39] clk: tegra: Export Tegra20 EMC kernel symbols Date: Sun, 7 Jun 2020 21:54:54 +0300 Message-Id: <20200607185530.18113-4-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org We're going to modularize Tegra EMC drivers and some of the EMC clk driver symbols need to be exported, let's export them. Signed-off-by: Dmitry Osipenko --- drivers/clk/tegra/clk-tegra20-emc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/clk/tegra/clk-tegra20-emc.c b/drivers/clk/tegra/clk-tegra20-emc.c index 03bf0009a33c..dd74b8543bf1 100644 --- a/drivers/clk/tegra/clk-tegra20-emc.c +++ b/drivers/clk/tegra/clk-tegra20-emc.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -235,6 +236,7 @@ void tegra20_clk_set_emc_round_callback(tegra20_clk_emc_round_cb *round_cb, emc->cb_arg = cb_arg; } } +EXPORT_SYMBOL_GPL(tegra20_clk_set_emc_round_callback); bool tegra20_clk_emc_driver_available(struct clk_hw *emc_hw) { @@ -291,3 +293,4 @@ int tegra20_clk_prepare_emc_mc_same_freq(struct clk *emc_clk, bool same) return 0; } +EXPORT_SYMBOL_GPL(tegra20_clk_prepare_emc_mc_same_freq); From patchwork Sun Jun 7 18:54:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199441 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 44D4FC433E0 for ; Sun, 7 Jun 2020 19:00:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 214CC2067B for ; Sun, 7 Jun 2020 19:00:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GTlefWEC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728201AbgFGTAd (ORCPT ); Sun, 7 Jun 2020 15:00:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728157AbgFGS5R (ORCPT ); Sun, 7 Jun 2020 14:57:17 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 726D5C061A0E; Sun, 7 Jun 2020 11:57:17 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id 9so8118273ljv.5; Sun, 07 Jun 2020 11:57:17 -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=8/aMBkNYS1l8Movaag8RDV924EOkO8H/4xoiXZl2WiM=; b=GTlefWECu/G29LjpCAIpxjCOUFiA8eAXuiWyHiMbICAos73tv92mfFafb0TW5OvmQO CZ3wah4xZcJOe5t6GIlzYpN4m1UOskyr7Iybv0Rin7JLkxGc9BZqxgX8IW7GeAlscrP0 ziI0vTRXlxzHIDk7xOsD/Hg5FAvJYUXw/DwA50k2x8DimEndkp6GZYIJ/Yc84EOZo32G iuKgKqr8J/atODjv1abhjYZfHe+5JEazr7arX8SI+fJ8Jy5e2Rd7pjmAAt09ANEegYJq x5buSn9t6r3k3o+KLsg4Dt4pcCRpua2Nei8qqCRO8kxkbBSVp8b/upmXTzeJ4IUlvJHl 8hOw== 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=8/aMBkNYS1l8Movaag8RDV924EOkO8H/4xoiXZl2WiM=; b=unBZPGw5/6B6LlxsOeEWnVUxIB26CrycP0XeWJcIU2tXA+L+Mugu4ZQoAkUPfZsKXT 3UvKhtJBgun1tJxmNUyPKGxmyUnMF4iCiTIu0UGakcEl0lpTp5XbDfZPl54r/Y6WbSyc vZvJZg7s3JHX+tOkqZkc7DRyra6zUehVRUl9W8qZT8dusyQ3x3ctXvX5FfEh3Z1SQMGF QKoTRGT+0x+D0KtVhIh2fUteskaTbhI64mdZjZnBscZbrpdETgRBHWwn2jYFawuXJO97 1l4ekK17iRMIObt655kQvyYXIyXhoJKIXjOpvNqbArsJ0f3lYjVB62J+ri0EZbfRgunz Vk1g== X-Gm-Message-State: AOAM5302LMXf8bilbSARqbr6kCpQfuIslqwN94aOaNOE2E5xHqd8MZJY KX2fHMsmZawnkju3Si93T20= X-Google-Smtp-Source: ABdhPJyl2mCiNiylo8SFzh15mikFwk4nidSsQRH+DDDM7Vcu+uuHrcsG0hfKfbwp27Pa/rx/yHAxyA== X-Received: by 2002:a2e:97d8:: with SMTP id m24mr4441620ljj.166.1591556235980; Sun, 07 Jun 2020 11:57:15 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:15 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 05/39] memory: tegra30-emc: Make driver modular Date: Sun, 7 Jun 2020 21:54:56 +0300 Message-Id: <20200607185530.18113-6-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds modularization support to the Tegra30 EMC driver. Driver now can be compiled as a loadable kernel module. Signed-off-by: Dmitry Osipenko --- drivers/memory/tegra/Kconfig | 2 +- drivers/memory/tegra/mc.c | 3 +++ drivers/memory/tegra/tegra30-emc.c | 16 +++++++++++----- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/memory/tegra/Kconfig b/drivers/memory/tegra/Kconfig index 7e0e1ef87763..bd453de9d446 100644 --- a/drivers/memory/tegra/Kconfig +++ b/drivers/memory/tegra/Kconfig @@ -18,7 +18,7 @@ config TEGRA20_EMC external memory. config TEGRA30_EMC - bool "NVIDIA Tegra30 External Memory Controller driver" + tristate "NVIDIA Tegra30 External Memory Controller driver" default y depends on TEGRA_MC && ARCH_TEGRA_3x_SOC help diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c index ec8403557ed4..772aa021b5f6 100644 --- a/drivers/memory/tegra/mc.c +++ b/drivers/memory/tegra/mc.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -298,6 +299,7 @@ int tegra_mc_write_emem_configuration(struct tegra_mc *mc, unsigned long rate) return 0; } +EXPORT_SYMBOL_GPL(tegra_mc_write_emem_configuration); unsigned int tegra_mc_get_emem_device_count(struct tegra_mc *mc) { @@ -309,6 +311,7 @@ unsigned int tegra_mc_get_emem_device_count(struct tegra_mc *mc) return dram_count; } +EXPORT_SYMBOL_GPL(tegra_mc_get_emem_device_count); static int load_one_timing(struct tegra_mc *mc, struct tegra_mc_timing *timing, diff --git a/drivers/memory/tegra/tegra30-emc.c b/drivers/memory/tegra/tegra30-emc.c index 055af0e08a2e..205d8053fa75 100644 --- a/drivers/memory/tegra/tegra30-emc.c +++ b/drivers/memory/tegra/tegra30-emc.c @@ -1343,6 +1343,13 @@ static int tegra_emc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, emc); tegra_emc_debugfs_init(emc); + /* + * Don't allow the kernel module to be unloaded. Unloading adds some + * extra complexity which doesn't really worth the effort in a case of + * this driver. + */ + try_module_get(THIS_MODULE); + return 0; unset_cb: @@ -1393,6 +1400,7 @@ static const struct of_device_id tegra_emc_of_match[] = { { .compatible = "nvidia,tegra30-emc", }, {}, }; +MODULE_DEVICE_TABLE(of, tegra_emc_of_match); static struct platform_driver tegra_emc_driver = { .probe = tegra_emc_probe, @@ -1403,9 +1411,7 @@ static struct platform_driver tegra_emc_driver = { .suppress_bind_attrs = true, }, }; +module_platform_driver(tegra_emc_driver); -static int __init tegra_emc_init(void) -{ - return platform_driver_register(&tegra_emc_driver); -} -subsys_initcall(tegra_emc_init); +MODULE_DESCRIPTION("NVIDIA Tegra30 EMC driver"); +MODULE_LICENSE("GPL v2"); From patchwork Sun Jun 7 18:54:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199442 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 AA281C433E1 for ; Sun, 7 Jun 2020 19:00:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 82B722074B for ; Sun, 7 Jun 2020 19:00:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mtQay4Q9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730124AbgFGTAJ (ORCPT ); Sun, 7 Jun 2020 15:00:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728223AbgFGS5U (ORCPT ); Sun, 7 Jun 2020 14:57:20 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 323D9C08C5C3; Sun, 7 Jun 2020 11:57:20 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id n23so17763549ljh.7; Sun, 07 Jun 2020 11:57:20 -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=Ae1m7Ph3kgiom2IEFZ6dxXExK3ejRG1JB/t6vIr/Q3s=; b=mtQay4Q9ofUUP33sJvj4zMle5xvDPx3udaiiLallcoLxMfc/4jY4MBs/rgxUtbE/8s 5iK7PUd7EjTGOFB5ZGFJ4/mfhwcDHYWcA/RwOJeq3E0moenuvYytYcKBpC1Q+Hrz9XPS 3kEGZOXm/O6FolluFSVQySt6znSfaVMqEutG0Psw44Pt5bDyW7hdL+2XXo9i4uDrNaPX aKqJC+nWPql++kAoEjpiK11R3FE8I9V6ZuJPROLdtJlqn6mfhr4M+BaMlXYVMF/L1SnS j7RfZhrb6DcQ8N5EgqOfpJGC+dGenobV/OozuHeaLYjos/jdS+PbPjmgNNjy5XykU7Ys gTGQ== 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=Ae1m7Ph3kgiom2IEFZ6dxXExK3ejRG1JB/t6vIr/Q3s=; b=dUAzTPJHOB2YaZ4t+zci6SkW3J0n1mJXyY4T0l5X3jKm79FMvHW2BsISGoTJu4fuHJ BMsNQX1JQ3bzcFqZY5D1JDQZTeQHKwUjZ3mUIn/CwR6fTNtp0gYs1p9AbyYjAlSH9NvO SnJ4cs5l1+wMATAolSZnvUMPSqFYKIeVAxmcqnhReFqEBiMO7CUR8M1c6NKJtVK91NdM kzaxuDrSQVgZ/r/ubGQfOJeUPwVTb23UQ+YGFODbp1sMMDikRrzAZgLHefjjkyrfUks6 tqtWLQnr4yHCAFpF2Zrr5V3prdCTdbojXyhhFAeoxRdCED5fINZ34vczbZ1eY2WZTPB7 REcg== X-Gm-Message-State: AOAM532SG5jLBz+aIT8kB39OseFTk4ZsCxdrMQ21ER0xJ4xeL4PLhi+e zUsn08qs+7+bT2oH67P6aU4= X-Google-Smtp-Source: ABdhPJyXyPjJWmFFPoPBGaAtY7gStNO11rmSiuQdVjRgxt/rUh8kwxXQgH1XhGkcP3rI6EjRdmWxaA== X-Received: by 2002:a2e:575d:: with SMTP id r29mr5569086ljd.120.1591556238755; Sun, 07 Jun 2020 11:57:18 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:18 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 07/39] memory: tegra124-emc: Use devm_platform_ioremap_resource Date: Sun, 7 Jun 2020 21:54:58 +0300 Message-Id: <20200607185530.18113-8-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Utilize that relatively new helper which makes code a bit cleaner. Signed-off-by: Dmitry Osipenko --- drivers/memory/tegra/tegra124-emc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/memory/tegra/tegra124-emc.c b/drivers/memory/tegra/tegra124-emc.c index 95afb0fa4a06..46089ef023a8 100644 --- a/drivers/memory/tegra/tegra124-emc.c +++ b/drivers/memory/tegra/tegra124-emc.c @@ -1193,7 +1193,6 @@ static int tegra_emc_probe(struct platform_device *pdev) struct platform_device *mc; struct device_node *np; struct tegra_emc *emc; - struct resource *res; u32 ram_code; int err; @@ -1203,8 +1202,7 @@ static int tegra_emc_probe(struct platform_device *pdev) emc->dev = &pdev->dev; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - emc->regs = devm_ioremap_resource(&pdev->dev, res); + emc->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(emc->regs)) return PTR_ERR(emc->regs); From patchwork Sun Jun 7 18:54:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199458 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 F0BAAC433DF for ; Sun, 7 Jun 2020 18:57:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CFC2020810 for ; Sun, 7 Jun 2020 18:57:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hLlbN5QY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728065AbgFGS5X (ORCPT ); Sun, 7 Jun 2020 14:57:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728299AbgFGS5V (ORCPT ); Sun, 7 Jun 2020 14:57:21 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9843BC061A0E; Sun, 7 Jun 2020 11:57:21 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id h188so8854925lfd.7; Sun, 07 Jun 2020 11:57:21 -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=tzjWXOFJZUWh4EJTzInOXHHEbdt+siqMf/YejHURVDA=; b=hLlbN5QYcF1A4KVzUxLK2BgoLYJMQG7Blmal4anzav1J2m26hk7H82gnkxk1js+Xni 98o3OoyeT6oRqwdE1zr32OawoCqKpjc0jEO8PsYmabIVg12Ibet0bVUN3sN/vwbnCrLh s4gc82tZaSsdcozgTpT/gq7Gpb8/boqO1YTkDdaOX/rfFvSVEawK+e59GLxWCMffkz5G cIO/Z+0Hsn7hbZyeYMXaZ6cjmS+cq94dp4GV5yyAzHOdbtr8oxcaVg5uhiFCQjAKFC+C RCcxjNrZqBI4lXtlSxVPBJiZHnKQhQsZPkk39djKWeUjs/CVYbhnbdKxcdm/0/I6UyFI CbgA== 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=tzjWXOFJZUWh4EJTzInOXHHEbdt+siqMf/YejHURVDA=; b=t0d1lxHwwa2s1XzxohBoRB8zlQ2f48DhGbFsuz3+wpCx6x7YeN/u4KcDRpm7zov0W1 cSZee6P+DF9ly+PhBcDulP+XkXiL+DlYcKEZuBeyooRh0k29tt9NCtAzj3cLC0S0b9Dk uvIEG22H+1bQXjTWshWWPgjUdS2arGlGQpXM3MOi6bRS97KTyYATbepDuOJ61c/+VeX+ IO++Q3o+RPCDd4gQ5xVOlPPhYO8Qh1DqIMFyRpL/mz4/V1Am1cpZmDfaw1tZpp7zJIEL OcMR1JXKY6+T/JHKEa97HXmmbQjWDoW86hRNjTIBEx1b6MYX1fz6Lcs/zBKnLR8//9/I BuPg== X-Gm-Message-State: AOAM5338vTTuyD1+DaALVnb8u1eY3FVedbFjLRcvKsuP8QbKL7CMvASv CW2jUYXBweiGVKgRLKtC5dI= X-Google-Smtp-Source: ABdhPJz95THuT13m/xyIJeJooBD8AxA5DNApvVZa6hnrfOxX9B/baYyCOZvQxeb4UPEHYfdsisVEcw== X-Received: by 2002:ac2:5324:: with SMTP id f4mr10821248lfh.209.1591556240161; Sun, 07 Jun 2020 11:57:20 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:19 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 08/39] soc/tegra: fuse: Export tegra_read_ram_code() Date: Sun, 7 Jun 2020 21:54:59 +0300 Message-Id: <20200607185530.18113-9-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The tegra_read_ram_code() is used by EMC drivers and we're going to make these driver modular, hence this function needs to be exported. Signed-off-by: Dmitry Osipenko --- drivers/soc/tegra/fuse/tegra-apbmisc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/soc/tegra/fuse/tegra-apbmisc.c b/drivers/soc/tegra/fuse/tegra-apbmisc.c index 3cdd69d1bd4d..b3c930b805c5 100644 --- a/drivers/soc/tegra/fuse/tegra-apbmisc.c +++ b/drivers/soc/tegra/fuse/tegra-apbmisc.c @@ -3,6 +3,7 @@ * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. */ +#include #include #include #include @@ -65,6 +66,7 @@ u32 tegra_read_ram_code(void) return straps >> PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT; } +EXPORT_SYMBOL_GPL(tegra_read_ram_code); static const struct of_device_id apbmisc_match[] __initconst = { { .compatible = "nvidia,tegra20-apbmisc", }, From patchwork Sun Jun 7 18:55:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199444 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 0F205C433E0 for ; Sun, 7 Jun 2020 18:59:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E0A6B2074B for ; Sun, 7 Jun 2020 18:59:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fse29tBP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728462AbgFGS5b (ORCPT ); Sun, 7 Jun 2020 14:57:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728386AbgFGS51 (ORCPT ); Sun, 7 Jun 2020 14:57:27 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39DE8C08C5C5; Sun, 7 Jun 2020 11:57:27 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id r125so8829397lff.13; Sun, 07 Jun 2020 11:57:27 -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=mTclmq28GLYsw04BzrWHjRkTzltxC1UwK7DmWEtnz4Y=; b=fse29tBPjCLCBGxWqXOJ/MfHHJ3fn0Bo269sN3NRX+YD0d8ToTNKF0gqNBo/maO8fT kFIjTZugVG4HmmLMz4LPAb0pYq+Atsn1VUnnJIX3ZGRgm2IvjLMug4edPrhdRGIy1zMY bvYO0MVX1tQnApdAEg7Y9TSR4QDayyN/p9NMIVnr7pRfL62NVU1+aEN15pm0wf7j4ESS ZD5KW8SYw+vq0YdI4L5rA7ZTl3BXzElpZkgDGEDGs3u66qfWh3N6xFBt5/qEAOByOIEZ 1l5DF2NRWcRe5y0GuwNzZ0dF8vKfSKc/qSSp42v4Pqy0e6ODyynMnPpa+WAM3vlOc/iu hiGg== 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=mTclmq28GLYsw04BzrWHjRkTzltxC1UwK7DmWEtnz4Y=; b=ZukG4Gg1z/igz9T1+OosnoYVyOQZTZsou0PyAASY3ZIiNhlLGcnf6Cc5DXv7LKx1dX Xry6D+i3oCmBposZv95lXBtftFbJebHR4R2xSN83w4VqR9ZmJ2bAXn9hK+DLSDF4ujEp +ug8HIg7UnvotunHqrYvLQ8v47mXeXrsebFDlt9pshx+H+afQb8h6nMiQxGKawadi53B 4SI8AfDWcKJnU1HJN2yf7ofvuKWOcFEa1foNFKZTB6K4XHp2+M5FF3l9F+9K2yZzRj0J OPCw/mtMPQEMeiBpx455T2GbE28wmzaUsy0IMMCvViQhe7QVHJn1/9NGtdBb8My3ydIb WDag== X-Gm-Message-State: AOAM5313lY8czRRKCnc9rdSFmijbEtB+otfXNKrv53CtWrC54GCuM86w C9sxKrRh84PyD7G2Gu8wtPQ= X-Google-Smtp-Source: ABdhPJzGkIKOUsJIxQPWdbqCeRK86qvxiPaPJFhifu3GFKSbTYmdhlEp7pmaeio9U4olf8k8sHhgnQ== X-Received: by 2002:a19:6a0e:: with SMTP id u14mr10504765lfu.192.1591556245681; Sun, 07 Jun 2020 11:57:25 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:25 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 12/39] PM / devfreq: tegra20: Use MC timings for building OPP table Date: Sun, 7 Jun 2020 21:55:03 +0300 Message-Id: <20200607185530.18113-13-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The clk_round_rate() won't be usable for building OPP table once interconnect support will be added to the EMC driver because that CLK API function limits the rounded rate based on the clk rate that is imposed by active clk-users, and thus, the rounding won't work as expected if interconnect will set the minimum EMC clock rate before devfreq driver is loaded. The struct tegra_mc contains memory timings which could be used by the devfreq driver for building up OPP table instead of rounding clock rate, this patch implements this idea. Signed-off-by: Dmitry Osipenko --- drivers/devfreq/tegra20-devfreq.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/devfreq/tegra20-devfreq.c b/drivers/devfreq/tegra20-devfreq.c index 6469dc69c5e0..bf504ca4dea2 100644 --- a/drivers/devfreq/tegra20-devfreq.c +++ b/drivers/devfreq/tegra20-devfreq.c @@ -123,8 +123,7 @@ static int tegra_devfreq_probe(struct platform_device *pdev) { struct tegra_devfreq *tegra; struct tegra_mc *mc; - unsigned long max_rate; - unsigned long rate; + unsigned int i; int err; mc = tegra_get_memory_controller(); @@ -151,12 +150,17 @@ static int tegra_devfreq_probe(struct platform_device *pdev) tegra->regs = mc->regs; - max_rate = clk_round_rate(tegra->emc_clock, ULONG_MAX); - - for (rate = 0; rate <= max_rate; rate++) { - rate = clk_round_rate(tegra->emc_clock, rate); + if (!mc->num_timings) { + err = dev_pm_opp_add(&pdev->dev, + clk_get_rate(tegra->emc_clock), 0); + if (err) { + dev_err(&pdev->dev, "failed to add OPP: %d\n", err); + return err; + } + } - err = dev_pm_opp_add(&pdev->dev, rate, 0); + for (i = 0; i < mc->num_timings; i++) { + err = dev_pm_opp_add(&pdev->dev, mc->timings[i].rate, 0); if (err) { dev_err(&pdev->dev, "failed to add opp: %d\n", err); goto remove_opps; From patchwork Sun Jun 7 18:55:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199445 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 7824DC433DF for ; Sun, 7 Jun 2020 18:59:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4FE7420760 for ; Sun, 7 Jun 2020 18:59:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NzIgNQKU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728581AbgFGS5c (ORCPT ); Sun, 7 Jun 2020 14:57:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728299AbgFGS53 (ORCPT ); Sun, 7 Jun 2020 14:57:29 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A28B4C061A0E; Sun, 7 Jun 2020 11:57:28 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id 9so17748049ljc.8; Sun, 07 Jun 2020 11:57:28 -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=qWLmy17GC8FK7PHSQ8U9gnOM1EaYpHMCshqC+sIXbKQ=; b=NzIgNQKUOvSmdiStp+r13m7kYNJlX1EmKxR4cZmq4oNGkqloMlbFKVFpDLgfP82fUV IhiyVO5OD1OovrqeCa6sDsfRtqgJbzr+b6A1eOqRxF0AyEkX6KCr1I6xswHAYru0mgXX 1/i+SzrSuIZTOQiZhV7d7AVHBVfmi2/+V0BULy8JuRjo+LlxBdr5xaOPVsiyeyxkS/VJ MvHmTGYhQ179yNwdI+hBdfO+Fu/JYplHKRjR3kl9W3HC8A5++P+cb3cJfWQLnAhTwMUt ZLNNyE0OGq76kY0dt+nnxUhi5rkhfiY1hffSAKrRs3wPAlPB1c6WjxuGrsIL2Fu2yBT1 PGvQ== 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=qWLmy17GC8FK7PHSQ8U9gnOM1EaYpHMCshqC+sIXbKQ=; b=MrgSGI5RsbgEk+zK90I951RkIRYAREmd8PuI7exaV4tponSsYUG5gssPhKTgX5bqJI Vs5rv3w2jvveduiRioybJXT2+ix3QuGn2fpOpxn5NT+agTPkXq3lJ/pa9KNZtj3Eb+2+ VEZcvhL5nOa5cBDwJuRhHSUga4YcLeXXRI2Y7u0JjNGB42FRqYWE6PI3MLHqGtL9Kn0z s9a7S5yzjGJWUXJTkVtQLDBH3PVlWT+2/hCVDZf+xm5PVugNtNSW3yt5pV2LD2Bhj9CE 1eRme3LWrB2FSHsDld5KkSYH8IEcrkSw3MW6AevuqK1tFbEHHULt2r1ENbY1f/Mbr66g zYKg== X-Gm-Message-State: AOAM530olg8Q+pTKyP2/h3ygz0ItyT3lRuwl/D8nXRV+xjziIjhr3gI+ uxod4X/tm1wGfjvvyscusp0= X-Google-Smtp-Source: ABdhPJyk0rp2rmqT73OdLJlnWEpSNMMKaseG7J5aRmaZI7drexJ4GbV3PH0/DQWpuVTXz3D5k+jv5A== X-Received: by 2002:a05:651c:1207:: with SMTP id i7mr9321217lja.86.1591556247059; Sun, 07 Jun 2020 11:57:27 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:26 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 13/39] PM / devfreq: tegra30: Use MC timings for building OPP table Date: Sun, 7 Jun 2020 21:55:04 +0300 Message-Id: <20200607185530.18113-14-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The clk_round_rate() won't be usable for building OPP table once interconnect support will be added to the EMC driver because that CLK API function limits the rounded rate based on the clk rate that is imposed by active clk-users, and thus, the rounding won't work as expected if interconnect will set the minimum EMC clock rate before devfreq driver is loaded. The struct tegra_mc contains memory timings which could be used by the devfreq driver for building up OPP table instead of rounding clock rate, this patch implements this idea. Signed-off-by: Dmitry Osipenko --- drivers/devfreq/tegra30-devfreq.c | 98 ++++++++++++++++++++++--------- 1 file changed, 70 insertions(+), 28 deletions(-) diff --git a/drivers/devfreq/tegra30-devfreq.c b/drivers/devfreq/tegra30-devfreq.c index 423dd35c95b3..13f93c6038ab 100644 --- a/drivers/devfreq/tegra30-devfreq.c +++ b/drivers/devfreq/tegra30-devfreq.c @@ -19,6 +19,8 @@ #include #include +#include + #include "governor.h" #define ACTMON_GLB_STATUS 0x0 @@ -153,6 +155,18 @@ struct tegra_devfreq_device { unsigned long target_freq; }; +struct tegra_devfreq_soc_data { + const char *mc_compatible; +}; + +static const struct tegra_devfreq_soc_data tegra30_soc = { + .mc_compatible = "nvidia,tegra30-mc", +}; + +static const struct tegra_devfreq_soc_data tegra124_soc = { + .mc_compatible = "nvidia,tegra124-mc", +}; + struct tegra_devfreq { struct devfreq *devfreq; @@ -771,15 +785,44 @@ static struct devfreq_governor tegra_devfreq_governor = { .interrupt_driven = true, }; +static struct tegra_mc *tegra_get_memory_controller(const char *compatible) +{ + struct platform_device *pdev; + struct device_node *np; + struct tegra_mc *mc; + + np = of_find_compatible_node(NULL, NULL, compatible); + if (!np) + return ERR_PTR(-ENOENT); + + pdev = of_find_device_by_node(np); + of_node_put(np); + if (!pdev) + return ERR_PTR(-ENODEV); + + mc = platform_get_drvdata(pdev); + if (!mc) + return ERR_PTR(-EPROBE_DEFER); + + return mc; +} + static int tegra_devfreq_probe(struct platform_device *pdev) { + const struct tegra_devfreq_soc_data *soc_data; struct tegra_devfreq_device *dev; struct tegra_devfreq *tegra; struct devfreq *devfreq; + struct tegra_mc *mc; unsigned int i; - long rate; int err; + soc_data = of_device_get_match_data(&pdev->dev); + + mc = tegra_get_memory_controller(soc_data->mc_compatible); + if (IS_ERR(mc)) + return PTR_ERR(mc); + tegra = devm_kzalloc(&pdev->dev, sizeof(*tegra), GFP_KERNEL); if (!tegra) return -ENOMEM; @@ -825,6 +868,30 @@ static int tegra_devfreq_probe(struct platform_device *pdev) return err; } + if (!mc->num_timings) { + tegra->max_freq = clk_get_rate(tegra->clock) / KHZ; + + err = dev_pm_opp_add(&pdev->dev, tegra->max_freq, 0); + if (err) { + dev_err(&pdev->dev, "Failed to add OPP: %d\n", err); + return err; + } + } + + for (i = 0; i < mc->num_timings; i++) { + /* + * Memory Controller timings are sorted in ascending clock + * rate order, so the last timing will be the max freq. + */ + tegra->max_freq = mc->timings[i].rate / KHZ; + + err = dev_pm_opp_add(&pdev->dev, tegra->max_freq, 0); + if (err) { + dev_err(&pdev->dev, "Failed to add OPP: %d\n", err); + goto remove_opps; + } + } + reset_control_assert(tegra->reset); err = clk_prepare_enable(tegra->clock); @@ -836,37 +903,12 @@ static int tegra_devfreq_probe(struct platform_device *pdev) reset_control_deassert(tegra->reset); - rate = clk_round_rate(tegra->emc_clock, ULONG_MAX); - if (rate < 0) { - dev_err(&pdev->dev, "Failed to round clock rate: %ld\n", rate); - return rate; - } - - tegra->max_freq = rate / KHZ; - for (i = 0; i < ARRAY_SIZE(actmon_device_configs); i++) { dev = tegra->devices + i; dev->config = actmon_device_configs + i; dev->regs = tegra->regs + dev->config->offset; } - for (rate = 0; rate <= tegra->max_freq * KHZ; rate++) { - rate = clk_round_rate(tegra->emc_clock, rate); - - if (rate < 0) { - dev_err(&pdev->dev, - "Failed to round clock rate: %ld\n", rate); - err = rate; - goto remove_opps; - } - - err = dev_pm_opp_add(&pdev->dev, rate / KHZ, 0); - if (err) { - dev_err(&pdev->dev, "Failed to add OPP: %d\n", err); - goto remove_opps; - } - } - platform_set_drvdata(pdev, tegra); tegra->clk_rate_change_nb.notifier_call = tegra_actmon_clk_notify_cb; @@ -921,8 +963,8 @@ static int tegra_devfreq_remove(struct platform_device *pdev) } static const struct of_device_id tegra_devfreq_of_match[] = { - { .compatible = "nvidia,tegra30-actmon" }, - { .compatible = "nvidia,tegra124-actmon" }, + { .compatible = "nvidia,tegra30-actmon", .data = &tegra30_soc, }, + { .compatible = "nvidia,tegra124-actmon", .data = &tegra124_soc, }, { }, }; From patchwork Sun Jun 7 18:55:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199443 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 9161DC433E0 for ; Sun, 7 Jun 2020 19:00:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E0292074B for ; Sun, 7 Jun 2020 19:00:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MqvDq9q4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728953AbgFGTAE (ORCPT ); Sun, 7 Jun 2020 15:00:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728449AbgFGS5a (ORCPT ); Sun, 7 Jun 2020 14:57:30 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBA74C08C5C3; Sun, 7 Jun 2020 11:57:29 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id e4so17796909ljn.4; Sun, 07 Jun 2020 11:57:29 -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=AmHb/qTFiuR6DXvA/ffC/nHLs0yGE7r571S6zKct1lc=; b=MqvDq9q43i2GPx/wPz9ytYWKP88kiBVVzmPi0yFwA3iNTVJYOcWPcz/wxxrokVqKJs RY2CBx0Uao//TS1K+2h9Hc+mVgFzsOqbu/Ghe8Wpzd/eRdkCsSLBsj2LZPSrW6lMqLUo VmpVlTn5mXp4qTqfXzgx84FXF1U4PCk9QykLsBNdfTfwQyr8ngdKJ+vEl4rV8ZWB5MwE F7TqbOvhJWSg6W3qu+BZuiUWaHqkbGdTASKaQT9ITEb3xxfOq74uJ7WW9gSbB1Jjc8GK gfGjh9yRYpVg255ue2RW9chLZ4Z+DBiwIFORi9YjB1lPu9vbcQifGETMCB/Jx67aWBg3 P73g== 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=AmHb/qTFiuR6DXvA/ffC/nHLs0yGE7r571S6zKct1lc=; b=KIsUtS7nhPZ6Xy9hC8Bl8vdFSIqWLK0JylMTv+3e21kkqTwWdH+Y9Hyq1gKx61yb+m AE80SaE8oGDGoF6680iMtrk7UoCGES61h8oR/zmLJI8/YonvSTGaeHYuEUkPz9Q0CCYQ uH1a5q73tmUkAKZxiBZ8qifnsPaQesr/YuLOcJp3e9AoUISye5gsqMqO/QORDso7fiwF D3he9Zh5TLfPRK9jxcQtKlgV+6Fa87KOh5QLd5+azWBTQQ7u6vUo7LEyTFC/3iQstCgH sAFgZJINTQkvtpn+hXSRLML1eU6TmKJofmYQ0kv1r2IpjNDnELSXQrSL+7B8ChsGHqev /H8g== X-Gm-Message-State: AOAM533fOv85ep9sUmmeg9oy8zVDHxcGO/kamgBM8ROMnUmK08h7UJbB zsLPhvnhsb0PB/GqNfjAH+M= X-Google-Smtp-Source: ABdhPJwcOUSznwhDpkI4gzAVGoraSqC7sU2i1NNjjHI6KUrQgIoEDkkkPx49bixW8DPBHVbikgyv1w== X-Received: by 2002:a2e:9dd8:: with SMTP id x24mr10027334ljj.304.1591556248332; Sun, 07 Jun 2020 11:57:28 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:27 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 14/39] PM / devfreq: tegra20: Add error messages to tegra_devfreq_target() Date: Sun, 7 Jun 2020 21:55:05 +0300 Message-Id: <20200607185530.18113-15-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org It's useful to now when something goes wrong instead of failing silently, so let's add error messages to tegra_devfreq_target() to prevent situation where it fails silently. Signed-off-by: Dmitry Osipenko --- drivers/devfreq/tegra20-devfreq.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/devfreq/tegra20-devfreq.c b/drivers/devfreq/tegra20-devfreq.c index bf504ca4dea2..249d0dc44f6c 100644 --- a/drivers/devfreq/tegra20-devfreq.c +++ b/drivers/devfreq/tegra20-devfreq.c @@ -44,19 +44,25 @@ static int tegra_devfreq_target(struct device *dev, unsigned long *freq, int err; opp = devfreq_recommended_opp(dev, freq, flags); - if (IS_ERR(opp)) + if (IS_ERR(opp)) { + dev_err(dev, "failed to find opp for %lu Hz\n", *freq); return PTR_ERR(opp); + } rate = dev_pm_opp_get_freq(opp); dev_pm_opp_put(opp); err = clk_set_min_rate(tegra->emc_clock, rate); - if (err) + if (err) { + dev_err(dev, "failed to set min rate: %d\n", err); return err; + } err = clk_set_rate(tegra->emc_clock, 0); - if (err) + if (err) { + dev_err(dev, "failed to set rate: %d\n", err); goto restore_min_rate; + } return 0; From patchwork Sun Jun 7 18:55:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199446 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 4DB11C433E0 for ; Sun, 7 Jun 2020 18:59:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2AFDE2074B for ; Sun, 7 Jun 2020 18:59:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M1OyI1Bo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730294AbgFGS7k (ORCPT ); Sun, 7 Jun 2020 14:59:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728725AbgFGS5g (ORCPT ); Sun, 7 Jun 2020 14:57:36 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3608FC061A0E; Sun, 7 Jun 2020 11:57:35 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id n24so17735557lji.10; Sun, 07 Jun 2020 11:57:35 -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=dYJTTF8rWAxRJdQ4tpKkvqb5inrmde6SNOd9Wsb86uU=; b=M1OyI1BobX9/9LpEyl22fsRNK130NEOqmz32VAHPzSM1Jn0Jgeu+H0s0r2TeRcePle h9Is+YKeOhPizw0mpkiwJ3bB7FhpqJoPLtkpTUt+b0ss6gSBYfBvbgv63COEx8+GNrMa 9nEGUA9oostXE77s8kjPn3LzX5ZUdm79qr1Tmv0GPNFbayzfPxFE398B0XQ6r7Lifw9I T8LOy3FrPoBOlH+CEGWNBTfBif7g48muxQpid56Kj3+8BwtY8VHeLeivMLYcIOcehC54 MJ+mLF7s2GP9WvscYfNJE9FMO6KxtBgVDQbQC7ulsn/cmUL5YZQkRcICDW6v11nbbqnq Nmaw== 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=dYJTTF8rWAxRJdQ4tpKkvqb5inrmde6SNOd9Wsb86uU=; b=fUWhkFbPJY1uHlKLqquuPNvW/+XsvDBXtqvSmmAnK91JeqzGLNQBouRS3caIEjM80i bl1fXtxxiBu3EGHrZQHcA0IGX9PSLpiYQ85w4gyOj5vcHuC5ggH0oclSMza65sU308bV XaIVi0UIUthJQiwae+55RR/PnU4IlRcyOeycnEJLRTfupkZ+6hir3kcDaDYb4nbkS/Sf wgj0Dmaa0MwNhezFYLb+glLctF5z9EqDUn8Y+827mqyCrxML6kLbzLoVugrujCk9jGxU GEbY+30uo9gmOtxG8NJAPneSrnTH/2Z2ZOLQYYfGv9Ib1TcB7m6Y5S1D6Brn1alfelgH WScg== X-Gm-Message-State: AOAM53374YtfmQfgAOv1+vXuAuEvK1ImMcyzal8/cfWKwKKOTk2zcTjo y+jnRH7FoJzpWW9/Dg3Iirg= X-Google-Smtp-Source: ABdhPJx2csaExXW3XWL310NKGsrymfkpOB1JCiNFzP5oJ3MJ+j++QdDd02RZi3yI9m4WaFuHTaTeUw== X-Received: by 2002:a2e:b5d0:: with SMTP id g16mr7425214ljn.246.1591556253743; Sun, 07 Jun 2020 11:57:33 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:33 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 18/39] dt-bindings: memory: tegra20: mc: Document new interconnect property Date: Sun, 7 Jun 2020 21:55:09 +0300 Message-Id: <20200607185530.18113-19-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Memory controller is interconnected with memory clients and with the external memory controller. Document new interconnect property which turns memory controller into interconnect provider. Acked-by: Rob Herring Signed-off-by: Dmitry Osipenko --- .../bindings/memory-controllers/nvidia,tegra20-mc.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra20-mc.txt b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra20-mc.txt index e55328237df4..739b7c6f2e26 100644 --- a/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra20-mc.txt +++ b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra20-mc.txt @@ -16,6 +16,8 @@ Required properties: IOMMU specifier needed to encode an address. GART supports only a single address space that is shared by all devices, therefore no additional information needed for the address encoding. +- #interconnect-cells : Should be 1. This cell represents memory client. + The assignments may be found in header file . Example: mc: memory-controller@7000f000 { @@ -27,6 +29,7 @@ Example: interrupts = ; #reset-cells = <1>; #iommu-cells = <0>; + #interconnect-cells = <1>; }; video-codec@6001a000 { From patchwork Sun Jun 7 18:55:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199447 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 A2C65C433DF for ; Sun, 7 Jun 2020 18:59:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 824DE2074B for ; Sun, 7 Jun 2020 18:59:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Zx0/1hMm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730143AbgFGS7f (ORCPT ); Sun, 7 Jun 2020 14:59:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728763AbgFGS5i (ORCPT ); Sun, 7 Jun 2020 14:57:38 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3DC7C08C5C4; Sun, 7 Jun 2020 11:57:37 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id a9so14202620ljn.6; Sun, 07 Jun 2020 11:57:37 -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=cD6QbvUalU2rLnxp32Ky1as2vyVdkG0FzQ7kZtLukL0=; b=Zx0/1hMmV7JwuNDcTuFV87FFDLC9+B+dp2Kag8nEP32tfGG5AY7TIUMc5Q7YDrzw2m O4i4KTIf5oK4nZn4+oexDWc/UTRN6lcMtPrFqS5enX8R/af9d8R0wKnG5fCtg2cJFC6g OQzHs3HBAlv9Lkr8C3Fnk9aaYxFXGE+muRsGNuIHnABt/N5fl+QbyaL6jumFFJnlNPSm pfk7CwdRr8ZZJ0FxjpNXw6nQnHfAQk9TTrnaYl02uP8fPEKLhMoghDEQDVvIcmQUKlk5 pdrxaZcfM2bra4USw9NiHTFEqSyTlmhm6HWHgHhYchrb9QfP0xko0hFciysthIve7UHr HYog== 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=cD6QbvUalU2rLnxp32Ky1as2vyVdkG0FzQ7kZtLukL0=; b=CV/AvR4BxaXLDrtoVMajEwMqQmv8j6GPw7heiFLQ57hiVkSsvUT+WxSbCIKwi3n6yK pbBih4n3/FzVqM+69VYdWipcpZVB9bz4c90+J7M+MlBjtxOq1346/JCFGw3OZLBu1m1V C3hDzU9ICuuKPrR2URRjRQ20MjGfm0QlTrCZlni2atdoSFJXDl0Vt3e1lROsIvpCgwX7 19F40NLrPMgole14wh+4EUghE9NlCtNMWjfaDO0ZZIGQH5ny9/4f1UgnNNumD7aPIX7R s1n+Bt1/5KgHkCvR5Tu3gjgGPeijMCLRpHDXgbqCzKBoKI9GzLESWoD705od/JhbDjwH C/HQ== X-Gm-Message-State: AOAM530LAuMz4W/hWD07gZ+qqSyADK402eAT1EkoxqyRW8QISMoWtuhk ytGFgO9ZPWvRwxM8Sb69NJg= X-Google-Smtp-Source: ABdhPJxChLqhfKyGO8SHp6W8FYtkQdwFMh936C6G5u6017yDCRww2zRNxFkr6ioy8DMgy7hzU2gVdQ== X-Received: by 2002:a05:651c:333:: with SMTP id b19mr9508872ljp.204.1591556256356; Sun, 07 Jun 2020 11:57:36 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:35 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 20/39] dt-bindings: memory: tegra30: mc: Document new interconnect property Date: Sun, 7 Jun 2020 21:55:11 +0300 Message-Id: <20200607185530.18113-21-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Memory controller is interconnected with memory clients and with the external memory controller. Document new interconnect property which turns memory controller into interconnect provider. Acked-by: Rob Herring Signed-off-by: Dmitry Osipenko --- .../bindings/memory-controllers/nvidia,tegra30-mc.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-mc.yaml b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-mc.yaml index 84fd57bcf0dc..5436e6d420bc 100644 --- a/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-mc.yaml +++ b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-mc.yaml @@ -57,6 +57,9 @@ properties: "#iommu-cells": const: 1 + "#interconnect-cells": + const: 1 + patternProperties: "^emc-timings-[0-9]+$": type: object @@ -120,6 +123,7 @@ required: - clock-names - "#reset-cells" - "#iommu-cells" + - "#interconnect-cells" additionalProperties: false @@ -135,6 +139,7 @@ examples: #iommu-cells = <1>; #reset-cells = <1>; + #interconnect-cells = <1>; emc-timings-1 { nvidia,ram-code = <1>; From patchwork Sun Jun 7 18:55:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199448 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 04BC0C433E0 for ; Sun, 7 Jun 2020 18:59:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C8D01207F7 for ; Sun, 7 Jun 2020 18:59:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="s8/ZRady" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730265AbgFGS7T (ORCPT ); Sun, 7 Jun 2020 14:59:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728828AbgFGS5l (ORCPT ); Sun, 7 Jun 2020 14:57:41 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84AE2C08C5C3; Sun, 7 Jun 2020 11:57:40 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id r125so8829592lff.13; Sun, 07 Jun 2020 11:57:40 -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=I+CEcWwsfQJNuC0/u/b9qfD53y89kTF8Pb7X2lFn9BM=; b=s8/ZRady/oRoczVgqOH0nV22Yf2p7P/eW+c41mCuIx1onsLooYgbOGn9OxcxdFVELZ ga6AcWWtD7jDHC6TqnzzgQUDevfOhDVfv9O1UTdjxHon7eFWr3EKvQkvvj2XwmIr4VUW AI8TBScCywKlUOf9wW9ngWM0IVmCCOUHQkc3L4q/u/iWdqFX4/DUV4FVy7HpyXBGqBue cDKgxxmdtM1L1CEYwC3npK7ImbvG6wTk5/0oueCtQ7tv7lZCMzlMIX7MMM+MvUygNW4y s7IV0Fjr0RKfkaPH3r4BE8Ox5lcW1FRID0ExIXII1D57bxMLyZvXrXJyAxCaZWGUQEtP iUYg== 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=I+CEcWwsfQJNuC0/u/b9qfD53y89kTF8Pb7X2lFn9BM=; b=OFW45GfwSzCEBGweO9U0WUdJ2n9/lNyKTAsrKPR6PF5wFpKLqWg8XeZvMUnuHD6QSe 6EP3Iqi0x9K2shMlVzQjjZuVs51J2P0Hl1WKt3gEfE8KJDSgJlNPLN0qC4cEMWOurY+p 95BleIQy+Ebo/CMBwpNR4gcPk9bcm9VaoKFhKFJIDqG5spLRSwt5JMJdt4FMG0z59FyC f0w1mjR1GwfaSgEhbgvAP4Y3tEz6eay8egD+kgomWCFh1oE2X//TG22gQbUmafruQ1E5 9BsZ/IjT+dpmH7fejh9X6B39wvJyT9knQwlkdQGoAL/FchuUTOtY0WKtY0KncwSMRxuW 6tRw== X-Gm-Message-State: AOAM530I3L3T4bKFSQN6u7QSvaAywKLbD5GNPARKDM+2BkvDBUu5DH4a lByEF5GIk9l2cmJ+mXW+/7A= X-Google-Smtp-Source: ABdhPJxlQF+6iwxcnNY6hMFfSnwfFz8I64aW5E8IBj224MboabHNtwLz+4rN3BSIyQNWtELIFDPG3g== X-Received: by 2002:ac2:5df2:: with SMTP id z18mr10691408lfq.151.1591556259004; Sun, 07 Jun 2020 11:57:39 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:38 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 22/39] dt-bindings: host1x: Document new interconnect properties Date: Sun, 7 Jun 2020 21:55:13 +0300 Message-Id: <20200607185530.18113-23-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Most of Host1x devices have at least one memory client. These clients are directly connected to the memory controller. The new interconnect properties represent the memory client's connection to the memory controller. Signed-off-by: Dmitry Osipenko --- .../display/tegra/nvidia,tegra20-host1x.txt | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt b/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt index 47319214b5f6..ab4fbee7bccf 100644 --- a/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt +++ b/Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt @@ -20,6 +20,10 @@ Required properties: - reset-names: Must include the following entries: - host1x +Each host1x client module having to perform DMA through the Memory Controller +should have the interconnect endpoints set to the Memory Client and External +Memory respectively. + The host1x top-level node defines a number of children, each representing one of the following host1x client modules: @@ -36,6 +40,12 @@ of the following host1x client modules: - reset-names: Must include the following entries: - mpe + Optional properties: + - interconnects: Must contain entry for the MPE memory clients. + - interconnect-names: Must include name of the interconnect path for each + interconnect entry. Consult TRM documentation for information about + available memory clients, see MEMORY CONTROLLER section. + - vi: video input Required properties: @@ -65,6 +75,12 @@ of the following host1x client modules: - power-domains: Must include sor powergate node as csicil is in SOR partition. + Optional properties: + - interconnects: Must contain entry for the VI memory clients. + - interconnect-names: Must include name of the interconnect path for each + interconnect entry. Consult TRM documentation for information about + available memory clients, see MEMORY CONTROLLER section. + - epp: encoder pre-processor Required properties: @@ -78,6 +94,12 @@ of the following host1x client modules: - reset-names: Must include the following entries: - epp + Optional properties: + - interconnects: Must contain entry for the EPP memory clients. + - interconnect-names: Must include name of the interconnect path for each + interconnect entry. Consult TRM documentation for information about + available memory clients, see MEMORY CONTROLLER section. + - isp: image signal processor Required properties: @@ -91,6 +113,12 @@ of the following host1x client modules: - reset-names: Must include the following entries: - isp + Optional properties: + - interconnects: Must contain entry for the ISP memory clients. + - interconnect-names: Must include name of the interconnect path for each + interconnect entry. Consult TRM documentation for information about + available memory clients, see MEMORY CONTROLLER section. + - gr2d: 2D graphics engine Required properties: @@ -104,6 +132,12 @@ of the following host1x client modules: - reset-names: Must include the following entries: - 2d + Optional properties: + - interconnects: Must contain entry for the GR2D memory clients. + - interconnect-names: Must include name of the interconnect path for each + interconnect entry. Consult TRM documentation for information about + available memory clients, see MEMORY CONTROLLER section. + - gr3d: 3D graphics engine Required properties: @@ -122,6 +156,12 @@ of the following host1x client modules: - 3d - 3d2 (Only required on SoCs with two 3D clocks) + Optional properties: + - interconnects: Must contain entry for the GR3D memory clients. + - interconnect-names: Must include name of the interconnect path for each + interconnect entry. Consult TRM documentation for information about + available memory clients, see MEMORY CONTROLLER section. + - dc: display controller Required properties: @@ -149,6 +189,10 @@ of the following host1x client modules: - nvidia,hpd-gpio: specifies a GPIO used for hotplug detection - nvidia,edid: supplies a binary EDID blob - nvidia,panel: phandle of a display panel + - interconnects: Must contain entry for the DC memory clients. + - interconnect-names: Must include name of the interconnect path for each + interconnect entry. Consult TRM documentation for information about + available memory clients, see MEMORY CONTROLLER section. - hdmi: High Definition Multimedia Interface @@ -297,6 +341,12 @@ of the following host1x client modules: - reset-names: Must include the following entries: - vic + Optional properties: + - interconnects: Must contain entry for the VIC memory clients. + - interconnect-names: Must include name of the interconnect path for each + interconnect entry. Consult TRM documentation for information about + available memory clients, see MEMORY CONTROLLER section. + Example: / { @@ -410,6 +460,15 @@ Example: resets = <&tegra_car 27>; reset-names = "dc"; + interconnects = <&mc TEGRA20_MC_DISPLAY0A &emc>, + <&mc TEGRA20_MC_DISPLAY0B &emc>, + <&mc TEGRA20_MC_DISPLAY0C &emc>, + <&mc TEGRA20_MC_DISPLAY1B &emc>; + interconnect-names = "display0a", + "display0b", + "display0c", + "display1b"; + rgb { status = "disabled"; }; @@ -425,6 +484,15 @@ Example: resets = <&tegra_car 26>; reset-names = "dc"; + interconnects = <&mc TEGRA20_MC_DISPLAY0AB &emc>, + <&mc TEGRA20_MC_DISPLAY0BB &emc>, + <&mc TEGRA20_MC_DISPLAY0CB &emc>, + <&mc TEGRA20_MC_DISPLAY1BB &emc>; + interconnect-names = "display0a", + "display0b", + "display0c", + "display1b"; + rgb { status = "disabled"; }; From patchwork Sun Jun 7 18:55:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199449 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 E7265C433DF for ; Sun, 7 Jun 2020 18:59:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BBDF920814 for ; Sun, 7 Jun 2020 18:59:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="H6EFvpfB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728894AbgFGS7S (ORCPT ); Sun, 7 Jun 2020 14:59:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728299AbgFGS5m (ORCPT ); Sun, 7 Jun 2020 14:57:42 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D3C8C08C5C4; Sun, 7 Jun 2020 11:57:42 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id c17so17728626lji.11; Sun, 07 Jun 2020 11:57:42 -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=jzk01JZt0hk/WZz0ErESEIFFh3afX5T+P2xZ19G0ZC8=; b=H6EFvpfB2xKzGQVM7GlvYYIoxYwtjkbhoJkwKvJMfPrZKNgaVPmkI9RUcju0JJivlU kDqcGdHOFLTe82ZBs32El29xLgityeQwaxPqGc51TCweYPncdvtwwDsWX5/e3auwm1LI dNoSxTlwPsGRUE6qHXPbrWLimGEg/knuHNeiNMOWS5jvk0s9HQw9euzM7hLqBpCuXckV lfMpcQz+aFKpV0+0WqAALMyPoqAz8AxCoWZev89BRxYDQE1PQOPSqFrhQuWQjv74gIdp qUn6hXzTqGdLpnRT0d2H5aCiPPBW4Ym19jIdjJYEL7DTyxtY/n7kG1DjTrsKPcR/ws6B mUqQ== 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=jzk01JZt0hk/WZz0ErESEIFFh3afX5T+P2xZ19G0ZC8=; b=oPbXlW2ZOrU3WNmxOl24326YOS5+nJvO9FaH2Kxl3PGkP2M7mNXr9fOjKoWBnebdY3 jwG4Gytx9pFBqulsqfkFKwZ/Cq6+E7DGF26arU89XkmJ7dYt97mBE2YjbxCm/VBZTbQC Ua6awnei829Aw148ALwDUpECJi9bLgyIZiDa4ItsArNTV58ZHVunPUTWPa8lYuIAP4hc BjAaXh0Fy+GIMEUDSoLl9yMWh2dxMGtYM7g8KWHiB0vGvIKwc7P9BwWUiE7bDLBftu/z 8rEQp8IF56dO+I0bMmh0XBVaoqiVMfCMIR0Ykb4HTM+imsNqEVOFhX4cio9dAm5PC0WJ Nclw== X-Gm-Message-State: AOAM531urLEzLgFisxsV9UhnP+hITo9LboDfbSNyyWJPXZBXoacFejtR RUi3fs4qlxnk1F/wuPLecpw= X-Google-Smtp-Source: ABdhPJxzuE/lVkygD4rMhlrInafSJ4dmC6EWK116wb+R0vUiCEfDrZPnondr7VEVByoH7PawNhUD3A== X-Received: by 2002:a05:651c:512:: with SMTP id o18mr10077245ljp.226.1591556260742; Sun, 07 Jun 2020 11:57:40 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:39 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 23/39] dt-bindings: memory: tegra20: Add memory client IDs Date: Sun, 7 Jun 2020 21:55:14 +0300 Message-Id: <20200607185530.18113-24-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Each memory client have a unique hardware ID, this patch adds these IDs. Signed-off-by: Dmitry Osipenko --- include/dt-bindings/memory/tegra20-mc.h | 53 +++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/include/dt-bindings/memory/tegra20-mc.h b/include/dt-bindings/memory/tegra20-mc.h index 35e131eee198..6f8829508ad0 100644 --- a/include/dt-bindings/memory/tegra20-mc.h +++ b/include/dt-bindings/memory/tegra20-mc.h @@ -18,4 +18,57 @@ #define TEGRA20_MC_RESET_VDE 13 #define TEGRA20_MC_RESET_VI 14 +#define TEGRA20_MC_DISPLAY0A 0 +#define TEGRA20_MC_DISPLAY0AB 1 +#define TEGRA20_MC_DISPLAY0B 2 +#define TEGRA20_MC_DISPLAY0BB 3 +#define TEGRA20_MC_DISPLAY0C 4 +#define TEGRA20_MC_DISPLAY0CB 5 +#define TEGRA20_MC_DISPLAY1B 6 +#define TEGRA20_MC_DISPLAY1BB 7 +#define TEGRA20_MC_EPPUP 8 +#define TEGRA20_MC_G2PR 9 +#define TEGRA20_MC_G2SR 10 +#define TEGRA20_MC_MPEUNIFBR 11 +#define TEGRA20_MC_VIRUV 12 +#define TEGRA20_MC_AVPCARM7R 13 +#define TEGRA20_MC_DISPLAYHC 14 +#define TEGRA20_MC_DISPLAYHCB 15 +#define TEGRA20_MC_FDCDRD 16 +#define TEGRA20_MC_G2DR 17 +#define TEGRA20_MC_HOST1XDMAR 18 +#define TEGRA20_MC_HOST1XR 19 +#define TEGRA20_MC_IDXSRD 20 +#define TEGRA20_MC_MPCORER 21 +#define TEGRA20_MC_MPE_IPRED 22 +#define TEGRA20_MC_MPEAMEMRD 23 +#define TEGRA20_MC_MPECSRD 24 +#define TEGRA20_MC_PPCSAHBDMAR 25 +#define TEGRA20_MC_PPCSAHBSLVR 26 +#define TEGRA20_MC_TEXSRD 27 +#define TEGRA20_MC_VDEBSEVR 28 +#define TEGRA20_MC_VDEMBER 29 +#define TEGRA20_MC_VDEMCER 30 +#define TEGRA20_MC_VDETPER 31 +#define TEGRA20_MC_EPPU 32 +#define TEGRA20_MC_EPPV 33 +#define TEGRA20_MC_EPPY 34 +#define TEGRA20_MC_MPEUNIFBW 35 +#define TEGRA20_MC_VIWSB 36 +#define TEGRA20_MC_VIWU 37 +#define TEGRA20_MC_VIWV 38 +#define TEGRA20_MC_VIWY 39 +#define TEGRA20_MC_G2DW 40 +#define TEGRA20_MC_AVPCARM7W 41 +#define TEGRA20_MC_FDCDWR 42 +#define TEGRA20_MC_HOST1XW 43 +#define TEGRA20_MC_ISPW 44 +#define TEGRA20_MC_MPCOREW 45 +#define TEGRA20_MC_MPECSWR 46 +#define TEGRA20_MC_PPCSAHBDMAW 47 +#define TEGRA20_MC_PPCSAHBSLVW 48 +#define TEGRA20_MC_VDEBSEVW 49 +#define TEGRA20_MC_VDEMBEW 50 +#define TEGRA20_MC_VDETPMW 51 + #endif From patchwork Sun Jun 7 18:55:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199457 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 539CDC433DF for ; Sun, 7 Jun 2020 18:57:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 26589207BC for ; Sun, 7 Jun 2020 18:57:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NND7CpEG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728916AbgFGS5q (ORCPT ); Sun, 7 Jun 2020 14:57:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728902AbgFGS5p (ORCPT ); Sun, 7 Jun 2020 14:57:45 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3B38C08C5C3; Sun, 7 Jun 2020 11:57:44 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id r125so8829650lff.13; Sun, 07 Jun 2020 11:57:44 -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=THFCg3hKPmLC0meEu1tU7N3iWwUxXusX7wxKM7keO5E=; b=NND7CpEGn20ervIHoTdlyo6+Op+rxFkv0PTdj3otZabrL/ZgPfNXZeeO9+bJ//nNIk UZGGY4o9hdUzDBhZ98FOdoqE5sWo7vOtdzKnJOCRyEN3o6AotXOY9hFC0EtZ12G3E1nY Gbj83WvexpFRqVFoyX2qLsVG1fRRtijfmMTLwEebjlVfZ36eTXMtylzEgyRYeT9bB4Ki q6JdaV+l91GOk3kkVV/Rs6mHTTmCpPv/qt0RX6DoxowgQ+xajfZG4ucERlNtKvO4lpC2 u3fHtJYCQ8shpghn7IpP+ev37QZaTX2uTxAgDBGlAH3TQVc0mtmH78kG0le5jVeNngD8 TGrA== 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=THFCg3hKPmLC0meEu1tU7N3iWwUxXusX7wxKM7keO5E=; b=mVd5mjoJs4zrH29A+etIaFVfh0hK7EXQOfHdW+go55wJgI1Xbq9KZP3F0RwcAE5cs+ hOOxQx+0ZJ22ccmq9p2Worz6xRqMNhk94zcxWIf+s7guw+5AgWor/wZXdoNhACqIqjRF /OdSQR6rlYiaAMbraaJhQAmEfhNvqaoCTY+MOPDUNElkJVdSfpVZScYxDG/zwKNIRcAe rQdVYRbLPpL8UMTTbDdvMcRFD6sEkOZ5SEQNLvPhMZP86INUshEXFMapqUJu9+izZSGB GxmY53nYpXgN6uLfHge2d+giHNq3yUjlwnwKrcJSIqvFlpvTYcNy5MsSPUJ6qcCapbVI 3x6g== X-Gm-Message-State: AOAM533t7yNY1kzn2zGPst1NGrvdOPgqiN5ZiZzMId74xRsLTlsgwwkp 4MSzJLkfVCKfEP6j0elIN9Y= X-Google-Smtp-Source: ABdhPJxAtHo5jbvdut7LI2tbRskKxWJ0DGnB4bT2RT3mZaYwsIsN0IKDDQQpcmrKy90iwLiA8f+E+w== X-Received: by 2002:a19:c3c5:: with SMTP id t188mr10802411lff.149.1591556263342; Sun, 07 Jun 2020 11:57:43 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:42 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 25/39] ARM: tegra: Add interconnect properties to Tegra20 device-tree Date: Sun, 7 Jun 2020 21:55:16 +0300 Message-Id: <20200607185530.18113-26-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add interconnect properties to the memory controller, external memory controller and the display controller nodes in order to describe hardware interconnection. Signed-off-by: Dmitry Osipenko --- arch/arm/boot/dts/tegra20.dtsi | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi index c3b8ad53b967..974048e83541 100644 --- a/arch/arm/boot/dts/tegra20.dtsi +++ b/arch/arm/boot/dts/tegra20.dtsi @@ -109,6 +109,15 @@ dc@54200000 { nvidia,head = <0>; + interconnects = <&mc TEGRA20_MC_DISPLAY0A &emc>, + <&mc TEGRA20_MC_DISPLAY0B &emc>, + <&mc TEGRA20_MC_DISPLAY0C &emc>, + <&mc TEGRA20_MC_DISPLAY1B &emc>; + interconnect-names = "display0a", + "display0b", + "display0c", + "display1b"; + rgb { status = "disabled"; }; @@ -126,6 +135,15 @@ dc@54240000 { nvidia,head = <1>; + interconnects = <&mc TEGRA20_MC_DISPLAY0AB &emc>, + <&mc TEGRA20_MC_DISPLAY0BB &emc>, + <&mc TEGRA20_MC_DISPLAY0CB &emc>, + <&mc TEGRA20_MC_DISPLAY1BB &emc>; + interconnect-names = "display0a", + "display0b", + "display0c", + "display1b"; + rgb { status = "disabled"; }; @@ -626,15 +644,17 @@ mc: memory-controller@7000f000 { interrupts = ; #reset-cells = <1>; #iommu-cells = <0>; + #interconnect-cells = <1>; }; - memory-controller@7000f400 { + emc: memory-controller@7000f400 { compatible = "nvidia,tegra20-emc"; reg = <0x7000f400 0x200>; interrupts = ; clocks = <&tegra_car TEGRA20_CLK_EMC>; #address-cells = <1>; #size-cells = <0>; + #interconnect-cells = <0>; }; fuse@7000f800 { From patchwork Sun Jun 7 18:55:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199450 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 35F30C433E2 for ; Sun, 7 Jun 2020 18:58:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 149462074B for ; Sun, 7 Jun 2020 18:58:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LIq4c8Yb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730219AbgFGS6z (ORCPT ); Sun, 7 Jun 2020 14:58:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728923AbgFGS5r (ORCPT ); Sun, 7 Jun 2020 14:57:47 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E02DC061A0E; Sun, 7 Jun 2020 11:57:46 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id a9so14202982ljn.6; Sun, 07 Jun 2020 11:57:46 -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=AG+TQmILbbrHUh9/3fg4pGtkuDKOX+TOZbe0Aj0MBf0=; b=LIq4c8YbjlyO0sK/gqRyiPHgJQTiyjSMFqPnqw8CnrhRifowuVWK/bN5TPuol27HNH XQYOD4rqSMx+ziPSh4b0n/OKjA/EqAJw1igg7gKrXlJMwNQjd0iBbEKBVft6leByyE+o s4s0Sf2PwuayhukHlDP7Cgh2bqyxK9uZADTErRWShkosBV6huDREWh4EG44YCrxlc6Ak FMIl3qTb15u4Ten/09SY8bt2rT1YcgBZWVzJzf+HiHbhu6E7GoQMvGEEsqHC1PYic5nN FITSTnuJBt+7tI+pZ1JlBx2kpcQ6YF9rIFOF2TQLCEDFLt3/LPRophmf+lx0tOOBu6L3 sBnA== 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=AG+TQmILbbrHUh9/3fg4pGtkuDKOX+TOZbe0Aj0MBf0=; b=T+48c/iZc002h4zgZlsezt6wHRj8/1yyunom7pDG6ODYjNSPKHUZEq0NBgcCJVupkU Hqw0aOAzSLKKrXmBC53XD4mKYFdkzEqnOUkkROK4Nx+U8v9palNo7S3hhIVduXYPpZ4b iGSAH/nEIKKh0zH4qy1wa7fCRGSBC6Bm3p6qK6SWAAfxy9RnS5BxpbfW73zg8bCg9Wks bnICwkZZg0jgjNMq6dWBdup2IudknR5kHUzw6qnf4smR8BZVo4m84CeAxAe7/PmLlW63 FOINVn7HoMZNWO12yu4Z7zB8hdbJyk8ydDgeUSYN+Vl8RTs3w5Qn9CNW5r+CE5g4cnVt CfuA== X-Gm-Message-State: AOAM532GB8FiWymlqtCFdCjTAdnhYPd4yd7bXWKvecI0swrmjlLGR/s0 Rq+jpE5aYt6V0/uvUiYyY5E= X-Google-Smtp-Source: ABdhPJyzHgDDjmNOTd8FYboo4P8nIdCH9ClNwLd7hbY9gzNdY2NSabkELJ2Zn6ABhqGtUXsXbGNkzQ== X-Received: by 2002:a2e:911:: with SMTP id 17mr9786613ljj.411.1591556264654; Sun, 07 Jun 2020 11:57:44 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:44 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 26/39] ARM: tegra: Add interconnect properties to Tegra30 device-tree Date: Sun, 7 Jun 2020 21:55:17 +0300 Message-Id: <20200607185530.18113-27-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add interconnect properties to the memory controller, external memory controller and the display controller nodes in order to describe hardware interconnection. Signed-off-by: Dmitry Osipenko --- arch/arm/boot/dts/tegra30.dtsi | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi index d2d05f1da274..2b183025629f 100644 --- a/arch/arm/boot/dts/tegra30.dtsi +++ b/arch/arm/boot/dts/tegra30.dtsi @@ -208,6 +208,15 @@ dc@54200000 { nvidia,head = <0>; + interconnects = <&mc TEGRA30_MC_DISPLAY0A &emc>, + <&mc TEGRA30_MC_DISPLAY0B &emc>, + <&mc TEGRA30_MC_DISPLAY0C &emc>, + <&mc TEGRA30_MC_DISPLAY1B &emc>; + interconnect-names = "display0a", + "display0b", + "display0c", + "display1b"; + rgb { status = "disabled"; }; @@ -227,6 +236,15 @@ dc@54240000 { nvidia,head = <1>; + interconnects = <&mc TEGRA30_MC_DISPLAY0AB &emc>, + <&mc TEGRA30_MC_DISPLAY0BB &emc>, + <&mc TEGRA30_MC_DISPLAY0CB &emc>, + <&mc TEGRA30_MC_DISPLAY1BB &emc>; + interconnect-names = "display0a", + "display0b", + "display0c", + "display1b"; + rgb { status = "disabled"; }; @@ -733,15 +751,18 @@ mc: memory-controller@7000f000 { #iommu-cells = <1>; #reset-cells = <1>; + #interconnect-cells = <1>; }; - memory-controller@7000f400 { + emc: memory-controller@7000f400 { compatible = "nvidia,tegra30-emc"; reg = <0x7000f400 0x400>; interrupts = ; clocks = <&tegra_car TEGRA30_CLK_EMC>; nvidia,memory-controller = <&mc>; + + #interconnect-cells = <0>; }; fuse@7000f800 { From patchwork Sun Jun 7 18:55:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199451 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 0A2DAC433E0 for ; Sun, 7 Jun 2020 18:58:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D63832074B for ; Sun, 7 Jun 2020 18:58:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="d7V9jtJc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730210AbgFGS6y (ORCPT ); Sun, 7 Jun 2020 14:58:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728941AbgFGS5u (ORCPT ); Sun, 7 Jun 2020 14:57:50 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30229C061A0E; Sun, 7 Jun 2020 11:57:50 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id n24so17736028lji.10; Sun, 07 Jun 2020 11:57:50 -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=cheeB0fZKRZ//Ml/fXNdvoie/fMScv9EjJj9t5vhyMg=; b=d7V9jtJcvc5vO9jCeIgVSYZ+WELLgMvs2NOjcjbfikELvYAUdN+4lavIHaaSFPfqBs jV3DSDKn2Ia1XxUPRIwfOHdDJTBHkwzLbnbkkn529xLMfvlcnbJiJn4BoMJzlzkP1nLy bUvzu7vSyFhbnzD5e6DEdZ1L69I314R1rKEGKyJNuigUqC6bPmjA2RvyM5okPMkQr3Vn FgbF19BVOXj7WnlcqpDAF9dMZdZUqzsfKssXoQ5YEENhTYK0D+YR2tZ6cyowo9R3Ege3 oG+NrkVllri5gNmdKhgPmIqRGcADykZlFbdkmocli5m13YxcmiFivvQkW+h/TKX3zOC9 WryQ== 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=cheeB0fZKRZ//Ml/fXNdvoie/fMScv9EjJj9t5vhyMg=; b=S3LvaBCEgFyJzuLQE7TsHLNQvYLR/4upG0+iKX3CQSseOeN5Y3EgewEHaAaJg8mBeY 4VdC4QeqrY7jdBvFS75bj97LvcZeEu7Tmzl2ibUvUmwyfFFHSbeCDgtZG5JPPVIxpHWt 7ryBeoRVtzUQ24GIFvg4doPhZt0k0PqCgqZrjJ1S4x6dvNNu+1Aj/8UTddlZWuKLztHJ gql89jmqSdcmKmOfFndKbPNcwDysPOd9diP4ZAUzHnoZErKaE7Kavxr37p3LpvaXxQUY Mka5MYFFfGcox5YITzVDiRfotXi79C+mIODhWAZpVxOeV5eEBwp9gO+kgsSz0xoIK2VO I81A== X-Gm-Message-State: AOAM530YDJfu+08/q+H3VyvE1GpdjuBVLn6diahT6e4Z8G8fGYaRtAnd sl5GJIeJ4PJkwW/gIDnrvUw= X-Google-Smtp-Source: ABdhPJwQpY8ksMO/LvCcyofbXlo5qyf8SnLXRKK2DnwLIZoG+7H/HsHXQlM+b4uHolxZG4PPP/J2fw== X-Received: by 2002:a2e:9ac6:: with SMTP id p6mr9920940ljj.417.1591556268742; Sun, 07 Jun 2020 11:57:48 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:48 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 29/39] memory: tegra20-emc: Use devm_platform_ioremap_resource Date: Sun, 7 Jun 2020 21:55:20 +0300 Message-Id: <20200607185530.18113-30-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Utilize that relatively new helper which makes code a bit cleaner. Signed-off-by: Dmitry Osipenko --- drivers/memory/tegra/tegra20-emc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/memory/tegra/tegra20-emc.c b/drivers/memory/tegra/tegra20-emc.c index a95522020a25..79fdae042b57 100644 --- a/drivers/memory/tegra/tegra20-emc.c +++ b/drivers/memory/tegra/tegra20-emc.c @@ -689,7 +689,6 @@ static int tegra_emc_probe(struct platform_device *pdev) { struct device_node *np; struct tegra_emc *emc; - struct resource *res; int irq, err; /* driver has nothing to do in a case of memory timing absence */ @@ -724,8 +723,7 @@ static int tegra_emc_probe(struct platform_device *pdev) if (err) return err; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - emc->regs = devm_ioremap_resource(&pdev->dev, res); + emc->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(emc->regs)) return PTR_ERR(emc->regs); From patchwork Sun Jun 7 18:55:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199453 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 022ACC433DF for ; Sun, 7 Jun 2020 18:58:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D46C72074B for ; Sun, 7 Jun 2020 18:58:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AO2u+AL2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730167AbgFGS6b (ORCPT ); Sun, 7 Jun 2020 14:58:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728976AbgFGS5z (ORCPT ); Sun, 7 Jun 2020 14:57:55 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83CC1C08C5C4; Sun, 7 Jun 2020 11:57:55 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id n23so17764691ljh.7; Sun, 07 Jun 2020 11:57:55 -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=eu8MrObQX4qoANIG2fS7sLLDmIFV2OlYxi+5WWSLEXA=; b=AO2u+AL2md2fHE3/M+qhRZkJHkN57VNYPwF53yC0LlEiqDEayeGkoDRm4INYQiPTcu UILsBPr6RINt4PeXyF+jYKzk/q1onbl8mnOYntuXqnuGDQBbPJJ3Ha+AeuUrgLEXpeYD uU4rsDab0iIprBbs5g5bf79f69/B2lUe5Dv6y/VqKFHO1w73A1jMzWBSn0wEC+C7T67C LfRXy2lpoi+P57/z8WCIYUfRqAmmk6GzZZPgqfWABbsWV7A538i6yyUjKzRwePcilSv6 wwctvG1COSVGw79IgfkVRmMYkKsr+JCQnFCr+u3Zolc/RmA526GV9Ac+c0Zdzlt31+MG qBdA== 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=eu8MrObQX4qoANIG2fS7sLLDmIFV2OlYxi+5WWSLEXA=; b=JHb1dXPb5oT7gb+7OBYJ1r7dmFcNW40R6nk5bROOcF9L38vB66Xra4PKy1cQAz4y90 aYvup6koJ69m2fEhfbzvgsaVh+C5KBSVgRvTO0mtPWzmOjsysH48J93kCoa0/baHZetD 7D+TBlaw2HEqUwgUeiqPP1NagokjlvGsQXE9aZB2rlxUkw076f83xeXSubHjCbMUTyvC IVhPyjC3BsdFFcRcMSIcLdAoFqdxgCoeCJkn5zj5coz9hDXbWSn1Hf6o3GxNXlMg+Xpe hehpo9g5zdr8jXINxwDDE15rJIw1u2JdTYQuMOHRpSE7WAqISUfjPoLQcViLb4vb8GbV bTFA== X-Gm-Message-State: AOAM532/To7cX6QVkxUejDmKmowXv5kMOTh2YrA7Ft1iWE0VSdLkvBJ6 PinCWy0ZCsrQwvLcJ5dpqB4= X-Google-Smtp-Source: ABdhPJxB9BKEMaHB4+bqRbgTmGzlOqU21Wm2fXMTV5IfItU+9t4fvRuXNVDEZLm5kaRBchxCjOoJAA== X-Received: by 2002:a2e:4601:: with SMTP id t1mr8893308lja.82.1591556274043; Sun, 07 Jun 2020 11:57:54 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:53 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 33/39] memory: tegra30-emc: Continue probing if timings are missing in device-tree Date: Sun, 7 Jun 2020 21:55:24 +0300 Message-Id: <20200607185530.18113-34-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org EMC driver will become mandatory after turning it into interconnect provider because interconnect users, like display controller driver, will fail to probe using newer device-trees that have interconnect properties. Thus make EMC driver to probe even if timings are missing in device-tree. Signed-off-by: Dmitry Osipenko --- drivers/memory/tegra/tegra30-emc.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/memory/tegra/tegra30-emc.c b/drivers/memory/tegra/tegra30-emc.c index 205d8053fa75..76586edb34ee 100644 --- a/drivers/memory/tegra/tegra30-emc.c +++ b/drivers/memory/tegra/tegra30-emc.c @@ -988,6 +988,11 @@ static struct device_node *emc_find_node_by_ram_code(struct device *dev) u32 value, ram_code; int err; + if (of_get_child_count(dev->of_node) == 0) { + dev_info(dev, "device-tree doesn't have memory timings\n"); + return NULL; + } + ram_code = tegra_read_ram_code(); for_each_child_of_node(dev->of_node, np) { @@ -1057,6 +1062,9 @@ static long emc_round_rate(unsigned long rate, struct tegra_emc *emc = arg; unsigned int i; + if (!emc->num_timings) + return clk_get_rate(emc->clk); + min_rate = min(min_rate, emc->timings[emc->num_timings - 1].rate); for (i = 0; i < emc->num_timings; i++) { @@ -1263,12 +1271,6 @@ static int tegra_emc_probe(struct platform_device *pdev) struct tegra_emc *emc; int err; - if (of_get_child_count(pdev->dev.of_node) == 0) { - dev_info(&pdev->dev, - "device-tree node doesn't have memory timings\n"); - return -ENODEV; - } - np = of_parse_phandle(pdev->dev.of_node, "nvidia,memory-controller", 0); if (!np) { dev_err(&pdev->dev, "could not get memory controller node\n"); @@ -1280,10 +1282,6 @@ static int tegra_emc_probe(struct platform_device *pdev) if (!mc) return -ENOENT; - np = emc_find_node_by_ram_code(&pdev->dev); - if (!np) - return -EINVAL; - emc = devm_kzalloc(&pdev->dev, sizeof(*emc), GFP_KERNEL); if (!emc) { of_node_put(np); @@ -1297,10 +1295,13 @@ static int tegra_emc_probe(struct platform_device *pdev) emc->clk_nb.notifier_call = emc_clk_change_notify; emc->dev = &pdev->dev; - err = emc_load_timings_from_dt(emc, np); - of_node_put(np); - if (err) - return err; + np = emc_find_node_by_ram_code(&pdev->dev); + if (np) { + err = emc_load_timings_from_dt(emc, np); + of_node_put(np); + if (err) + return err; + } emc->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(emc->regs)) From patchwork Sun Jun 7 18:55:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199452 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 8DCEDC433DF for ; Sun, 7 Jun 2020 18:58:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B05C2074B for ; Sun, 7 Jun 2020 18:58:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GWSt104r" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728914AbgFGS6a (ORCPT ); Sun, 7 Jun 2020 14:58:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729032AbgFGS55 (ORCPT ); Sun, 7 Jun 2020 14:57:57 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC288C08C5C5; Sun, 7 Jun 2020 11:57:56 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id c17so17729129lji.11; Sun, 07 Jun 2020 11:57:56 -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=bdgqm+/7huoX/fTRFwXie9eA+evEAS0IOKC7SkRCFrM=; b=GWSt104r1PpleYPg2waaBbqTIg5UaHdz/8k8cljOgZTA5+K1/BocWKZSivmholAcfh VxnMey7Wibcjf77DE1mJ9FDOrez1PdFxpB9FvPQnzdkctvQqcc5CUrMumROhEMPSrLcI gulBQ5+oWmL0ZYBNA8OF9rnJHi0c7EQ6xF3R2tcDutNhwM/B5tyRb0dciY0yi3Mp0P8R EbvdWk789nsg8NhA0OBPIl81+0iurISuhV3KCRgAMFBtf3ftpYJXwVrwa9eOAiWSua+Y /zcqZuNxl6JFSpkQKgzS71CYVzr8t50aIphRZK6wQxKQONfw4JQeILD6DxVODx5vPp3z nwjg== 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=bdgqm+/7huoX/fTRFwXie9eA+evEAS0IOKC7SkRCFrM=; b=eXuTUB1vyeo76SuWCNQ5uq4aRnWrDqllTvVVKZok3CaW/eGQGTLQgv/TayBL2iMdnS ojSkfV4nK6EdmbMR3lr44ScKjQ7sSkPCVx6lp+7w+oCTuci/2e30F1XVd+Tt24zzBy5y Qt1/6fvH0yHDfOUNGkhQKmsApjk27TAxvu0hsH95xFo0BLEvOKrIE0pp/e0dEuQkVpiO 32tLG2g7Af3prESupkYqZvGpShAE91ign3EL+4e5RV12kOFfnqO8TfkuQ5pROZHrIZ+Q Ir7tEEKTq0ZV4JlE0cs6v4OYRZxwg53ozvri8ogReNICPMx5bFf+iQtrrgur7RLpKxbL YZOQ== X-Gm-Message-State: AOAM533mlR0d24SUvn8olrCXPP9K8OpNZEg+ITJ2nvzl4FwK7CjL8Aob KFnIUF2MKMOI4vwNJk5TTBwcDra/ X-Google-Smtp-Source: ABdhPJyC9zN6GMnk6H+gq1CRmmfjx2eSik+DDYlGDBGppw9fd95uHm8p3Ho/1YRzTKsBbZyJ8vtD3w== X-Received: by 2002:a2e:584e:: with SMTP id x14mr8750559ljd.380.1591556275341; Sun, 07 Jun 2020 11:57:55 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:54 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 34/39] memory: tegra30-emc: Register as interconnect provider Date: Sun, 7 Jun 2020 21:55:25 +0300 Message-Id: <20200607185530.18113-35-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Now external memory controller is a memory interconnection provider. This allows us to use interconnect API to change memory configuration. Signed-off-by: Dmitry Osipenko --- drivers/memory/tegra/tegra30-emc.c | 115 +++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/drivers/memory/tegra/tegra30-emc.c b/drivers/memory/tegra/tegra30-emc.c index 76586edb34ee..096ec5265084 100644 --- a/drivers/memory/tegra/tegra30-emc.c +++ b/drivers/memory/tegra/tegra30-emc.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -327,6 +328,7 @@ struct tegra_emc { struct device *dev; struct tegra_mc *mc; struct notifier_block clk_nb; + struct icc_provider provider; struct clk *clk; void __iomem *regs; unsigned int irq; @@ -1264,6 +1266,112 @@ static void tegra_emc_debugfs_init(struct tegra_emc *emc) emc, &tegra_emc_debug_max_rate_fops); } +static inline struct tegra_emc * +to_tegra_emc_provider(struct icc_provider *provider) +{ + return container_of(provider, struct tegra_emc, provider); +} + +static struct icc_node * +emc_of_icc_xlate(struct of_phandle_args *spec, void *data) +{ + struct icc_provider *provider = data; + struct icc_node *node; + + /* External Memory is the only possible ICC route */ + list_for_each_entry(node, &provider->nodes, node_list) { + if (node->id == TEGRA_ICC_EMEM) + return node; + } + + return ERR_PTR(-EINVAL); +} + +static int emc_icc_set(struct icc_node *src, struct icc_node *dst) +{ + struct tegra_emc *emc = to_tegra_emc_provider(dst->provider); + unsigned long long rate = icc_units_to_bps(dst->avg_bw); + unsigned int dram_data_bus_width_bytes = 4; + unsigned int ddr = 2; + int err; + + do_div(rate, ddr * dram_data_bus_width_bytes); + rate = min_t(u64, rate, U32_MAX); + + err = clk_set_min_rate(emc->clk, rate); + if (err) + return err; + + err = clk_set_rate(emc->clk, rate); + if (err) + return err; + + return 0; +} + +static int emc_icc_aggregate(struct icc_node *node, + u32 tag, u32 avg_bw, u32 peak_bw, + u32 *agg_avg, u32 *agg_peak) +{ + *agg_avg = min((u64)avg_bw + (*agg_avg), (u64)U32_MAX); + *agg_peak = max(*agg_peak, peak_bw); + + return 0; +} + +static int tegra_emc_interconnect_init(struct tegra_emc *emc) +{ + struct icc_node *node; + int err; + + /* older device-trees don't have interconnect properties */ + if (!of_find_property(emc->dev->of_node, "#interconnect-cells", NULL)) + return 0; + + emc->provider.dev = emc->dev; + emc->provider.set = emc_icc_set; + emc->provider.data = &emc->provider; + emc->provider.xlate = emc_of_icc_xlate; + emc->provider.aggregate = emc_icc_aggregate; + + err = icc_provider_add(&emc->provider); + if (err) + return err; + + /* create External Memory Controller node */ + node = icc_node_create(TEGRA_ICC_EMC); + err = PTR_ERR_OR_ZERO(node); + if (err) + goto del_provider; + + node->name = "External Memory Controller"; + icc_node_add(node, &emc->provider); + + /* link External Memory Controller to External Memory (DRAM) */ + err = icc_link_create(node, TEGRA_ICC_EMEM); + if (err) + goto remove_nodes; + + /* create External Memory node */ + node = icc_node_create(TEGRA_ICC_EMEM); + err = PTR_ERR_OR_ZERO(node); + if (err) + goto remove_nodes; + + node->name = "External Memory (DRAM)"; + icc_node_add(node, &emc->provider); + + return 0; + +remove_nodes: + icc_nodes_remove(&emc->provider); + +del_provider: + icc_provider_del(&emc->provider); + + return err; +} + static int tegra_emc_probe(struct platform_device *pdev) { struct platform_device *mc; @@ -1344,6 +1452,13 @@ static int tegra_emc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, emc); tegra_emc_debugfs_init(emc); + if (IS_ENABLED(CONFIG_INTERCONNECT)) { + err = tegra_emc_interconnect_init(emc); + if (err) + dev_err(&pdev->dev, "failed to initialize ICC: %d\n", + err); + } + /* * Don't allow the kernel module to be unloaded. Unloading adds some * extra complexity which doesn't really worth the effort in a case of From patchwork Sun Jun 7 18:55:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199456 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 3CCD0C433E1 for ; Sun, 7 Jun 2020 18:58:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 17E3C20884 for ; Sun, 7 Jun 2020 18:58:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hVX5Ont6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730022AbgFGS6G (ORCPT ); Sun, 7 Jun 2020 14:58:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729923AbgFGS6A (ORCPT ); Sun, 7 Jun 2020 14:58:00 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77359C08C5C7; Sun, 7 Jun 2020 11:57:59 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id n23so17764805ljh.7; Sun, 07 Jun 2020 11:57:59 -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=CY3FjRZp76KZl7tgz6s6CVjJ18LTSPB3H8v+jn0FVvg=; b=hVX5Ont6noNRP2P/2CCSf7FevOekRSrVKaunpciA4p+SogwZtz+xQzL4R/xkncA7Ru UY+985KTJr64ll+QcIVljePsWDFkFWzlYM9BK99+400sPBNdXNSXTNtVXuriMcEMPCMM xpQxTuY2+tL5/9FbxOcLccYaDdbw4SgEhY3NkrH6fMOHkMq2XEN/PU1VUeSOHOYbC3PA +aCDx3NDNIONWlAZwKkff0B8a7XiGSkKrLsT9GbSNGeZ8r/K1PPL1/gylpLS+50ClQXq DaPKESo7Il34FyXaqxZ7OI456IiJ0YR0w47Pnz1xECmGksALhndZA4DgfOVXAa5DIQfe xfsA== 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=CY3FjRZp76KZl7tgz6s6CVjJ18LTSPB3H8v+jn0FVvg=; b=R1ZGLVtBlha0Lxw5aK1kkhhhkgabDAFMM+JOoQ1ExIvIoPOZmsag1MPt+FJiwsKAw/ HlJfRdTPwgQeVyvh9xzE5JSwvrdgGb47RfjuQtT8fHA4gUxQlmppussFPOq8bGMBYZ8B GxygP5DHbdP7zQMFYDzi9ix5BM5oUIghnlB1S1mkDbntZJ514SFY4AHQUgfoJ3YNdvCM e6TnMVsjAjO3f4wv427kL4Xe58G7kapDId80BNir+OOnTohYi4MLBjL40TAo0WJ6igc7 Ore9xU7BurovnvjZ9TBny+sIXopmbJ4eui8Njia2r6pgnrDZrdQ3JKXoUEvLA9y6ft6r B/WQ== X-Gm-Message-State: AOAM532okr4kEiiS5O+Qb1IbbV17sAnBJYdEsvaqSPGtyGcTYqHS3INP oLlrKQ9xwv3BkXSMCsd556U= X-Google-Smtp-Source: ABdhPJw2XOdVWfb3p0+g7ckPPPPttWtk5v4VNsp8WSNUtVnAkpbl2b9c476TMJa1JB02XN/urafppQ== X-Received: by 2002:a05:651c:545:: with SMTP id q5mr9790721ljp.57.1591556278032; Sun, 07 Jun 2020 11:57:58 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:57 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 36/39] drm/tegra: dc: Tune up high priority request controls for Tegra20 Date: Sun, 7 Jun 2020 21:55:27 +0300 Message-Id: <20200607185530.18113-37-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Tegra20 has a high-priority-request control that allows to configure when display's memory client should perform read requests with a higher priority (Tegra30+ uses other means like Latency Allowance). This patch changes the controls configuration in order to get a more aggressive memory prefetching, which allows to reliably avoid FIFO underflow when running on a lower memory frequency. This allow us safely drop the memory bandwidth requirement by about two times in a most popular use-cases (only one display active, video overlay inactive, no scaling is done). Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/dc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 12b318bb8475..48dad375b470 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -1971,12 +1971,12 @@ static void tegra_crtc_atomic_enable(struct drm_crtc *crtc, tegra_dc_writel(dc, value, DC_CMD_INT_POLARITY); /* initialize timer */ - value = CURSOR_THRESHOLD(0) | WINDOW_A_THRESHOLD(0x20) | - WINDOW_B_THRESHOLD(0x20) | WINDOW_C_THRESHOLD(0x20); + value = CURSOR_THRESHOLD(0) | WINDOW_A_THRESHOLD(0x70) | + WINDOW_B_THRESHOLD(0x30) | WINDOW_C_THRESHOLD(0x70); tegra_dc_writel(dc, value, DC_DISP_DISP_MEM_HIGH_PRIORITY); - value = CURSOR_THRESHOLD(0) | WINDOW_A_THRESHOLD(1) | - WINDOW_B_THRESHOLD(1) | WINDOW_C_THRESHOLD(1); + value = CURSOR_THRESHOLD(0) | WINDOW_A_THRESHOLD(0) | + WINDOW_B_THRESHOLD(0) | WINDOW_C_THRESHOLD(0); tegra_dc_writel(dc, value, DC_DISP_DISP_MEM_HIGH_PRIORITY_TIMER); value = VBLANK_INT | WIN_A_UF_INT | WIN_B_UF_INT | WIN_C_UF_INT | From patchwork Sun Jun 7 18:55:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199454 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 084BDC433DF for ; Sun, 7 Jun 2020 18:58:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D6A8120814 for ; Sun, 7 Jun 2020 18:58:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZosR1+S0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729973AbgFGS6E (ORCPT ); Sun, 7 Jun 2020 14:58:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729924AbgFGS6B (ORCPT ); Sun, 7 Jun 2020 14:58:01 -0400 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAA22C08C5C8; Sun, 7 Jun 2020 11:58:00 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id 202so8873515lfe.5; Sun, 07 Jun 2020 11:58:00 -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=+LVvE0OiYzwk9TxoGPobpgcZWVTviUfu3oOilcfUerI=; b=ZosR1+S0wKnlNEWsZTicNwlJhxuVimCvmhd6fMtIiwenhy6LfBHPOfMCtwfYHiF2Rq g7KJxTKDT4P4RiLnVM/NF58FpJXbdfJd8BmQPAMynQYVvohifi3n3ZNwyfDSioMmtDCu M/3UNKyfD5nUNiCScokDeE8pBqaRDWdV8HBdGp4Y77PZ6GPV4/XrkY8Nnsp0UIUkilZY yBNcBmrMn29f9RlpZeOQ/H4sGyBJUGdJfmshdxVS4wdd+nOwl/LZvVxgAV6Cx8yt7oCq xAOyID17SplV0mqFeu7mLt5qtvkICv+ApHcgTvqK2yAzLFWNMtTxPQAbXKHIZDGaZD21 /0xQ== 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=+LVvE0OiYzwk9TxoGPobpgcZWVTviUfu3oOilcfUerI=; b=kaVtxa9aClXlCx8EEdDS6gc1iQs+ZLuolaxHc8dMiJvaXM/i1THaY7370tQ/Q1jedv g1P5uY+eIQo0DXH/PG0aA1vn9vgNAQkQWxFepRHnvTWaTsHEabyvcgmWi1Kn3+JTnlzc 6ElTp/ThPP90GzjCk4+NlaiLq2Vd7xpCqhrDvhS2qvRe6376Q27AeTkxiAEnGtJzSob6 cfl4ess7FxBIa3BrgMFtbv0kko2bgBTpOiBGb0d8PLeGYqXtIMHdqYkKK8RufUu+2rje ybNTadsiJAACens5S/7JzBZaw2oYuqvL1KRkqPRjUbzyxJGtLqyypHVFw1FvhpOkBLHl 7BTg== X-Gm-Message-State: AOAM531kG7D46Qx+SBjDCS2dBVVSKkhlih4ATy9bXD+mBBzAFiv5H30s L/yLQlyNVbIxrqYUJlpqLrs= X-Google-Smtp-Source: ABdhPJyjL9RxG3zPWpDaCfdXCkAaGiFQCA2lwegcUltZjdvev6ZW0rEtS9TYECcHb3oTiqV/xIye8w== X-Received: by 2002:ac2:4471:: with SMTP id y17mr10734107lfl.178.1591556279356; Sun, 07 Jun 2020 11:57:59 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:57:58 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 37/39] drm/tegra: dc: Extend debug stats with total number of events Date: Sun, 7 Jun 2020 21:55:28 +0300 Message-Id: <20200607185530.18113-38-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org It's useful to know the total number of underflow events and currently the debug stats are getting reset each time CRTC is being disabled. Let's account the overall number of events that doesn't get reset. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/dc.c | 10 ++++++++++ drivers/gpu/drm/tegra/dc.h | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 48dad375b470..6a5a017e37d5 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -1616,6 +1616,11 @@ static int tegra_dc_show_stats(struct seq_file *s, void *data) seq_printf(s, "underflow: %lu\n", dc->stats.underflow); seq_printf(s, "overflow: %lu\n", dc->stats.overflow); + seq_printf(s, "frames total: %lu\n", dc->stats.frames_total); + seq_printf(s, "vblank total: %lu\n", dc->stats.vblank_total); + seq_printf(s, "underflow total: %lu\n", dc->stats.underflow_total); + seq_printf(s, "overflow total: %lu\n", dc->stats.overflow_total); + return 0; } @@ -2178,6 +2183,7 @@ static irqreturn_t tegra_dc_irq(int irq, void *data) /* dev_dbg(dc->dev, "%s(): frame end\n", __func__); */ + dc->stats.frames_total++; dc->stats.frames++; } @@ -2186,6 +2192,7 @@ static irqreturn_t tegra_dc_irq(int irq, void *data) dev_dbg(dc->dev, "%s(): vertical blank\n", __func__); */ drm_crtc_handle_vblank(&dc->base); + dc->stats.vblank_total++; dc->stats.vblank++; } @@ -2193,6 +2200,7 @@ static irqreturn_t tegra_dc_irq(int irq, void *data) /* dev_dbg(dc->dev, "%s(): underflow\n", __func__); */ + dc->stats.underflow_total++; dc->stats.underflow++; } @@ -2200,11 +2208,13 @@ static irqreturn_t tegra_dc_irq(int irq, void *data) /* dev_dbg(dc->dev, "%s(): overflow\n", __func__); */ + dc->stats.overflow_total++; dc->stats.overflow++; } if (status & HEAD_UF_INT) { dev_dbg_ratelimited(dc->dev, "%s(): head underflow\n", __func__); + dc->stats.underflow_total++; dc->stats.underflow++; } diff --git a/drivers/gpu/drm/tegra/dc.h b/drivers/gpu/drm/tegra/dc.h index 3a0ff57c5169..3eb4eddc2288 100644 --- a/drivers/gpu/drm/tegra/dc.h +++ b/drivers/gpu/drm/tegra/dc.h @@ -41,6 +41,11 @@ struct tegra_dc_stats { unsigned long vblank; unsigned long underflow; unsigned long overflow; + + unsigned long frames_total; + unsigned long vblank_total; + unsigned long underflow_total; + unsigned long overflow_total; }; struct tegra_windowgroup_soc { From patchwork Sun Jun 7 18:55:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 199455 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 71609C433E0 for ; Sun, 7 Jun 2020 18:58:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A46F2081A for ; Sun, 7 Jun 2020 18:58:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uaKuXbv4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730016AbgFGS6F (ORCPT ); Sun, 7 Jun 2020 14:58:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729970AbgFGS6D (ORCPT ); Sun, 7 Jun 2020 14:58:03 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71EA2C08C5C3; Sun, 7 Jun 2020 11:58:03 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id c21so8860679lfb.3; Sun, 07 Jun 2020 11:58:03 -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=5WrxJdQGGJp0h0CB+IuS493cV6Sm3/0MyVvkHgYGkIo=; b=uaKuXbv4NPCMAB5PWw36K78TOvjq8+B5CEINpv0g86H4gsbK8SiR3wpwyYUwYx2QHO cOGczfOcfJ3JZp7X+U6ysfHmLuYRo1bDaM7zaB8PfhJ5BtENQ8Oe2ev6zBlRgnbyQ5XC DfOvK1n3gsVo5boBFUMcrl+bs9k6AXpc7Q3bm+dZnJ3/EZDnz+2+ba1/NAuUYVrO/8ta W1CA0glXMzKOI+epW+OoKM+y4Ev8D/Sn/NvlgLthGcj6wzaYMI3IeY2Jf4oIiJYutUSN ourQOypLAMqeFGoXX6Y641io2ItZJ1EmE8USSQLE29TelRyxoyqNlCOtCbEeG66iSTEm gQOg== 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=5WrxJdQGGJp0h0CB+IuS493cV6Sm3/0MyVvkHgYGkIo=; b=W9hTPdbqz8GS7BSDbPwEx0Hovk4Appa61MByGLcrTUrMBDJfwU5MHSClIEs96U5Dm3 ff4gt5JQYj/9pQCdLzVdk3+kwuhEiyKycMJksg+tXXbNzoVOP3EfU7rCCelEjzZNtfmc XaXg+JNNRKEHkul4EFwpLIhyuLwVvARiCydHSVMWgid9TVwhNueMAw0v+IOkgUXZwFMy Ts2OfvreXjZmEno/I7dQfk4X3lm51Smlq+t+PPz0XbzyzdPenJb9ROByxCiLFUj26QU0 cyttapPIk2/tY+OKoWVjNb7EhlfUTp9w2nNa0Uz2LmtzOYAfYP59MVwHPTNMJ4zjPlKh bi7g== X-Gm-Message-State: AOAM5305CZIKwrqCLlwiPRD8Z2VqRZqyTVcRkPCEaRkvh6v/9W0oAatL ofFB6NNe3lHLkj2fXvQD3GQ= X-Google-Smtp-Source: ABdhPJyolUdnd0FXTN33twcK0bltOioVetEv1cEk9SDsT3GY6Y9PN4k3i74XwSmZQuCoGrUPHJYBaQ== X-Received: by 2002:ac2:5dcb:: with SMTP id x11mr10646127lfq.110.1591556282023; Sun, 07 Jun 2020 11:58:02 -0700 (PDT) Received: from localhost.localdomain (79-139-237-54.dynamic.spd-mgts.ru. [79.139.237.54]) by smtp.gmail.com with ESMTPSA id e21sm3650953ljb.135.2020.06.07.11.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 11:58:01 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen Cc: =?utf-8?b?QXJ0dXIgxZp3aWdvxYQ=?= , linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v3 39/39] ARM: multi_v7_defconfig: Enable interconnect API Date: Sun, 7 Jun 2020 21:55:30 +0300 Message-Id: <20200607185530.18113-40-digetx@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200607185530.18113-1-digetx@gmail.com> References: <20200607185530.18113-1-digetx@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org NVIDIA Tegra now has interconnect providers that are used for memory bandwidth allocation. Signed-off-by: Dmitry Osipenko --- arch/arm/configs/multi_v7_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig index 95543914d3c7..d3b554045dbe 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig @@ -1086,6 +1086,7 @@ CONFIG_FSI_MASTER_ASPEED=m CONFIG_FSI_SCOM=m CONFIG_FSI_SBEFIFO=m CONFIG_FSI_OCC=m +CONFIG_INTERCONNECT=y CONFIG_EXT4_FS=y CONFIG_AUTOFS4_FS=y CONFIG_MSDOS_FS=y