From nobody Wed Jun 17 07:22:14 2026 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CFAA23909A7 for ; Mon, 27 Apr 2026 07:03:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777273422; cv=none; b=UEa4QOvzkskafu5jWQu1Ug7EWXHCqyS7e4wcg5ZFfVt6mbnkt7vvccteOzH5SO6TY9cgqfAwuRlZ6MAxsTRQcSVbM2GgZftnHCDn2M5lMd2j/GYrB8N2ZGHvl8AWgqc1P0ekX+4dph/r98toO4BHe/BqbFSlR40QkHEZuieGF/o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777273422; c=relaxed/simple; bh=idAm6JZdBMdmeJKkc8DR/+djQ9ywzFWWkJPRLet5UAg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ht4z/uTPkGpeKMBgZV3GcxmysTkqXVQCotXZGCzcyK1GRs5gOHpjG7P9mBzCweAVToMp54So3fUTZjXeKr6RRwAGYbZ/UVXMqprPTOVp6KzPoR2swmzNsE4HLOEO29wJIhQ1VG34YD58vVxcwUcNs+Rv8Of6Sf4G9JPKyEOpxG4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KB3aeIqu; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KB3aeIqu" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-43cff5dafc3so7926666f8f.1 for ; Mon, 27 Apr 2026 00:03:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777273419; x=1777878219; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DpcczuyftVggiNXKRP50iSyYabcce+E3E5UaiR04aCg=; b=KB3aeIqu+k6wjtgWAvZZ5+fbBzMjyAc3o4UPrFONlG2+JjdtpxLE160mmF5G6WVBmO zPbFHTCo6peZiWtF4CfitBDPOSt04KL/llEfhmMPrucyu+3tYB+OrrgJAmYwFEWVPLtP SeiUjiqtkQsL5BJxhED6g2pE7RStgd1vbSZYxXXoQAE7SXOUP8H2XNJYVVQKv9LZMxyh ovolkxMEiF0BVxpdOp20E4Vfd8bBNk5h5OD30bXfIWIJoGueUT8W09D1CkXtgFcbur3Q j7yi9DMuWuibN/qQWMGjhR7hftlsHQ9fpK+IfefmXORfY5jMFJyqrN5+RZSfYkxZdLAm uHDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777273419; x=1777878219; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=DpcczuyftVggiNXKRP50iSyYabcce+E3E5UaiR04aCg=; b=MM2Jp35OumZ7TVaNiaciQePZLuOn/C7qjH4i/0sFoGwxV6bkQ8gh2YB+mCqCc6V3sS 5uB4eHUVtpWo4LJldMJfzqdWkT/U5d/fANDPuX0GU5P9x53MvMpuIYNujZW2nnfdQ8SD lU8WY9TCFMYkYL/q1cacA70ntN8HuUE/WSvnHJkTu5GXTGKH5giC9/+s675fZzrhg32c D+RL4+itvb3/4znN3ybgxd3jWLIrpysCYwc9HovXcNwV7BJ0+mq6kHNDwZy94ph9Bfe8 zjRNg8ZUQ5bdjxDjuciG2gXK9LEUrAmio+JGBPUepifO4QmcNh7Eg2iQCCYNz3yisWd1 htVQ== X-Gm-Message-State: AOJu0YxirO6Vd9NsI0Bb+PxOz5XEd1pjXAqK/2Fh3ay180le+DU8ssSz WAu1Yc1KUrmaSHJ49ANSBIHEuvkTQQhQCSSa9vyrbSS1aVTczCpkADA9 X-Gm-Gg: AeBDietYhrQ5AEdscFyxQjtW6ZAFp8AF5//RRH3EP8tTns6ysj492P0KACglMbmluLG Dgyl7g4lfYR+bOAHWhVgp/1RrFAuKxNnEsNrcKvVuGBITDllj6sDgaRf7/htHgboi7Z2r40rLIM BTC5tp4f807mESih1I/aDABRZlZqiGMZGj6i80DjZVZOVMEn1EvjFmXs8j1bvfWaobQ3fjk+YQ+ 7OCfO2yze7Jgi+yptddCcl/IlZNpgn7mALKDvZJPWvQklbhDMsVHgNKO8YCrCc8d+1BYmmMCtnQ 0PnNV4TX5Z6vxDpkKhS107tZw1lh/2iaTzp+QC9nKcciPiFRYJL3nyeySfKF4QWmJTC0ARPfr9N MY5DwTWZq0Puif7FEAaYBv4A8X+lm09IDbQkKKvaCicTYt/S2rcgmeF8eJy5+S6JNsm9lTRm6H5 ELBUFaNnRVB0HDHfZ5HunWqpw= X-Received: by 2002:a05:6000:25c6:b0:43d:7af0:3a7c with SMTP id ffacd0b85a97d-43fe3e0d44emr62264642f8f.29.1777273419087; Mon, 27 Apr 2026 00:03:39 -0700 (PDT) Received: from xeon ([188.163.112.56]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e3a341sm84245734f8f.24.2026.04.27.00.03.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 00:03:38 -0700 (PDT) From: Svyatoslav Ryhel To: Krzysztof Kozlowski , Rob Herring , Conor Dooley , Thierry Reding , Jonathan Hunter , Mikko Perttunen , Svyatoslav Ryhel Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH v2 1/7] dt-bindings: memory: Document Tegra114 Memory Controller Date: Mon, 27 Apr 2026 10:03:06 +0300 Message-ID: <20260427070312.81679-2-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260427070312.81679-1-clamor95@gmail.com> References: <20260427070312.81679-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add Tegra114 support into existing Tegra124 MC schema with the most notable difference in the amount of EMEM timings. Each memory client has unique hardware ID, add these IDs. Signed-off-by: Svyatoslav Ryhel Reviewed-by: Rob Herring (Arm) --- .../nvidia,tegra124-mc.yaml | 31 +++------ include/dt-bindings/memory/tegra114-mc.h | 67 +++++++++++++++++++ 2 files changed, 75 insertions(+), 23 deletions(-) diff --git a/Documentation/devicetree/bindings/memory-controllers/nvidia,te= gra124-mc.yaml b/Documentation/devicetree/bindings/memory-controllers/nvidi= a,tegra124-mc.yaml index 7b18b4d11e0a..f8747cebb680 100644 --- a/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra124-= mc.yaml +++ b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra124-= mc.yaml @@ -19,7 +19,9 @@ description: | =20 properties: compatible: - const: nvidia,tegra124-mc + enum: + - nvidia,tegra114-mc + - nvidia,tegra124-mc =20 reg: maxItems: 1 @@ -64,29 +66,12 @@ patternProperties: =20 nvidia,emem-configuration: $ref: /schemas/types.yaml#/definitions/uint32-array - description: | + description: Values to be written to the EMEM register block. See section - "15.6.1 MC Registers" in the TRM. - items: - - description: MC_EMEM_ARB_CFG - - description: MC_EMEM_ARB_OUTSTANDING_REQ - - description: MC_EMEM_ARB_TIMING_RCD - - description: MC_EMEM_ARB_TIMING_RP - - description: MC_EMEM_ARB_TIMING_RC - - description: MC_EMEM_ARB_TIMING_RAS - - description: MC_EMEM_ARB_TIMING_FAW - - description: MC_EMEM_ARB_TIMING_RRD - - description: MC_EMEM_ARB_TIMING_RAP2PRE - - description: MC_EMEM_ARB_TIMING_WAP2PRE - - description: MC_EMEM_ARB_TIMING_R2R - - description: MC_EMEM_ARB_TIMING_W2W - - description: MC_EMEM_ARB_TIMING_R2W - - description: MC_EMEM_ARB_TIMING_W2R - - description: MC_EMEM_ARB_DA_TURNS - - description: MC_EMEM_ARB_DA_COVERS - - description: MC_EMEM_ARB_MISC0 - - description: MC_EMEM_ARB_MISC1 - - description: MC_EMEM_ARB_RING1_THROTTLE + "20.11.1 MC Registers" in the Tegea114 TRM or + "15.6.1 MC Registers" in the Tegra124 TRM. + minItems: 18 + maxItems: 19 =20 required: - clock-frequency diff --git a/include/dt-bindings/memory/tegra114-mc.h b/include/dt-bindings= /memory/tegra114-mc.h index dfe99c8a5ba5..5e0d6a1b91f2 100644 --- a/include/dt-bindings/memory/tegra114-mc.h +++ b/include/dt-bindings/memory/tegra114-mc.h @@ -40,4 +40,71 @@ #define TEGRA114_MC_RESET_VDE 14 #define TEGRA114_MC_RESET_VI 15 =20 +#define TEGRA114_MC_PTCR 0 +#define TEGRA114_MC_DISPLAY0A 1 +#define TEGRA114_MC_DISPLAY0AB 2 +#define TEGRA114_MC_DISPLAY0B 3 +#define TEGRA114_MC_DISPLAY0BB 4 +#define TEGRA114_MC_DISPLAY0C 5 +#define TEGRA114_MC_DISPLAY0CB 6 +#define TEGRA114_MC_DISPLAY1B 7 +#define TEGRA114_MC_DISPLAY1BB 8 +#define TEGRA114_MC_EPPUP 9 +#define TEGRA114_MC_G2PR 10 +#define TEGRA114_MC_G2SR 11 +#define TEGRA114_MC_MPEUNIFBR 12 +#define TEGRA114_MC_VIRUV 13 +#define TEGRA114_MC_AFIR 14 +#define TEGRA114_MC_AVPCARM7R 15 +#define TEGRA114_MC_DISPLAYHC 16 +#define TEGRA114_MC_DISPLAYHCB 17 +#define TEGRA114_MC_FDCDRD 18 +#define TEGRA114_MC_FDCDRD2 19 +#define TEGRA114_MC_G2DR 20 +#define TEGRA114_MC_HDAR 21 +#define TEGRA114_MC_HOST1XDMAR 22 +#define TEGRA114_MC_HOST1XR 23 +#define TEGRA114_MC_IDXSRD 24 +#define TEGRA114_MC_IDXSRD2 25 +#define TEGRA114_MC_MPE_IPRED 26 +#define TEGRA114_MC_MPEAMEMRD 27 +#define TEGRA114_MC_MPECSRD 28 +#define TEGRA114_MC_PPCSAHBDMAR 29 +#define TEGRA114_MC_PPCSAHBSLVR 30 +#define TEGRA114_MC_SATAR 31 +#define TEGRA114_MC_TEXSRD 32 +#define TEGRA114_MC_TEXSRD2 33 +#define TEGRA114_MC_VDEBSEVR 34 +#define TEGRA114_MC_VDEMBER 35 +#define TEGRA114_MC_VDEMCER 36 +#define TEGRA114_MC_VDETPER 37 +#define TEGRA114_MC_MPCORELPR 38 +#define TEGRA114_MC_MPCORER 39 +#define TEGRA114_MC_EPPU 40 +#define TEGRA114_MC_EPPV 41 +#define TEGRA114_MC_EPPY 42 +#define TEGRA114_MC_MPEUNIFBW 43 +#define TEGRA114_MC_VIWSB 44 +#define TEGRA114_MC_VIWU 45 +#define TEGRA114_MC_VIWV 46 +#define TEGRA114_MC_VIWY 47 +#define TEGRA114_MC_G2DW 48 +#define TEGRA114_MC_AFIW 49 +#define TEGRA114_MC_AVPCARM7W 50 +#define TEGRA114_MC_FDCDWR 51 +#define TEGRA114_MC_FDCDWR2 52 +#define TEGRA114_MC_HDAW 53 +#define TEGRA114_MC_HOST1XW 54 +#define TEGRA114_MC_ISPW 55 +#define TEGRA114_MC_MPCORELPW 56 +#define TEGRA114_MC_MPCOREW 57 +#define TEGRA114_MC_MPECSWR 58 +#define TEGRA114_MC_PPCSAHBDMAW 59 +#define TEGRA114_MC_PPCSAHBSLVW 60 +#define TEGRA114_MC_SATAW 61 +#define TEGRA114_MC_VDEBSEVW 62 +#define TEGRA114_MC_VDEDBGW 63 +#define TEGRA114_MC_VDEMBEW 64 +#define TEGRA114_MC_VDETPMW 65 + #endif --=20 2.51.0 From nobody Wed Jun 17 07:22:14 2026 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06E04390CAB for ; Mon, 27 Apr 2026 07:03:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777273423; cv=none; b=iFaQg8mg5vMqnRWfTBr6JVKtctsiFE4WnaZVHb0X1bx06adsIuDwjefS3ZXjMa0briLNSM5/2m05oeuikTgGfUYIgkIHRp6X3JaY7XazYzK17I9ldNMyfNU+7ENkiOgrXTki7JzYGiaeq48oj+Zap+8n1aMzMeBNX/YS7ZrSCT4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777273423; c=relaxed/simple; bh=flMFDcMoilUKZ2HI+QqMrSzjnoRTTOGEem++WXzh2jM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GJWkn3LBTs4Y8vkZFQlDj0UhYwxneavSwcxaBsrkErIBN1lcK6iiwoqteoy4RbYYvf0lrUIP4JIejLV7nhZA79gSOyXptSA2uOOflRfKiloKjVz4LEwbupNsKu+17ZAhD00WeSWHKf+asT1ULLJHFp1q9lCN6HH8lda0o6yPtpM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HeV+Wm3V; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HeV+Wm3V" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-43fe3e22e33so6374767f8f.0 for ; Mon, 27 Apr 2026 00:03:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777273420; x=1777878220; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fZ1HBa/aKFGSf/GyiqKwru3OQmj7Gbd7sN3EDBVCVtk=; b=HeV+Wm3VaxrdZL1n97/dwwtsG/8UWxwPsj8jkaDGFHCvCzS0LRs4RaeLGJOKd84Jj0 tIdSIFE5PMLYhr7ubjvdUYWljUx1lTVhOEfOoXo7hgpN1Ecl3La2vFz2ga9HKjstwMCm rlu7F9sdc0iFQ7on6iKKdeamEN73I69rA/sscQLZ1hY6rMaU9bWi8HmUjle2ff9IpACJ 2ayRa4RNhqMistt8dvTRsxTbVBKcv+gIK4/9FHae1cnGehzECEPRJfjnPh6qSawFgTco Iqi+6tkavRUrBeltPqkmAxl6MhOGHW9xjasoX6PF/ANGf1ZuzVBro26mdb+lOPl/JYSv xyLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777273420; x=1777878220; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fZ1HBa/aKFGSf/GyiqKwru3OQmj7Gbd7sN3EDBVCVtk=; b=r5Tj56jJ0Tq4JDrdaLLEBbnzQ27ede1mbB6bDfhUS/vGTAF4ozIvI96uJTRlL8xKz+ 5ARWk/VzflgHqdbKl5HWs5Hi9zr2M/r4viQp3gfpBeY9x0ZO6ULXjJaSCl0UvYy3hjcg bOV6GeEoyQNpwf2pHTkV+5DV9Xsrb/g06fEZxTovFRHW/Jd4DhPGamB26lyYAClbg8pE HH5ai92fHprvzkPUmd+zLZSMNK9LKUU/b4fcNmN49CVqkLsxfR0yCp2HgtW/yQHc6+cj bZUeR/ZPbpQKxSXdf7hJPwnQf+QcIUxq7lxn1U+Pvw+VZln3PJB3y935lFDPO+85zH91 RY7g== X-Gm-Message-State: AOJu0YxX9iEDmbGW3cDE/LnOKm/zMl3c4LrpLEBtAujs7T47qj3tFHho 0LeErXqPuvd3hGqZ/do1FEep+0prHZLbUVaSCHIeHhgZzhaT8f+MAolC X-Gm-Gg: AeBDiesv0cIS9CMaqzd7IrTunVRGW2HgtceDKbWK5OcNJ7SH8C4FEpsT5deOrz7MC9i trFzoKLg3rkLqb3Ir8oXGMNy34+rN+Do5dhTeFc8NFqt2k4udsE5Wyx7VEDmhZk8tcz6q7i9ECu +1r1HWMDVWiIuKiUQdrdnaMit1sgf26wnTlyWxBhz+v0cXBsqJk4h/ifOQO5CUXXt0jP/f4HYXH OviaGI2JkT/xdHqI7S5nAx+ENb8QLh3Ow6SBxEIIA2StW+uqhnbsspci47i6AVnadx9PM62QYEw zwzeInNuQkri5vsDCNxeYqbvtSa7TM3elBk2P1aboR41m85rrO6Tv9TacP9ZWmbuUhoEQxdyuCv aHJAMhSKQmEh0TiPeTwlf5IEsoZUu4BGkIqG7kmt/2fz3me/qPE3RFFBwG5tEuNzvWiDEEPYtQq tAYkCbH9vTlXUeaR4TV9uCq8U= X-Received: by 2002:a5d:5f46:0:b0:43d:761d:5423 with SMTP id ffacd0b85a97d-43fe3dcc03bmr63701741f8f.16.1777273420045; Mon, 27 Apr 2026 00:03:40 -0700 (PDT) Received: from xeon ([188.163.112.56]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e3a341sm84245734f8f.24.2026.04.27.00.03.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 00:03:39 -0700 (PDT) From: Svyatoslav Ryhel To: Krzysztof Kozlowski , Rob Herring , Conor Dooley , Thierry Reding , Jonathan Hunter , Mikko Perttunen , Svyatoslav Ryhel Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH v2 2/7] memory: tegra: Implement EMEM regs and ICC ops for Tegra114 Date: Mon, 27 Apr 2026 10:03:07 +0300 Message-ID: <20260427070312.81679-3-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260427070312.81679-1-clamor95@gmail.com> References: <20260427070312.81679-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Prepare Internal Memory Controller for introduction of External Memory Controller. Signed-off-by: Svyatoslav Ryhel Reviewed-by: Mikko Perttunen --- drivers/memory/tegra/tegra114.c | 193 ++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) diff --git a/drivers/memory/tegra/tegra114.c b/drivers/memory/tegra/tegra11= 4.c index 02dd4e26288a..2cb153091228 100644 --- a/drivers/memory/tegra/tegra114.c +++ b/drivers/memory/tegra/tegra114.c @@ -3,6 +3,7 @@ * Copyright (C) 2014-2026 NVIDIA CORPORATION. All rights reserved. */ =20 +#include #include #include =20 @@ -1101,6 +1102,195 @@ static const struct tegra_mc_reset tegra114_mc_rese= ts[] =3D { TEGRA114_MC_RESET(VI, 0x200, 0x204, 17), }; =20 +static void tegra114_mc_tune_client_latency(struct tegra_mc *mc, + const struct tegra_mc_client *client, + unsigned int bandwidth_mbytes_sec) +{ + u32 arb_tolerance_compensation_nsec, arb_tolerance_compensation_div; + unsigned int fifo_size =3D client->fifo_size; + u32 arb_nsec, la_ticks, value; + + /* see 20.3.1.1 Client Configuration in Tegra4 TRM v01p */ + if (bandwidth_mbytes_sec) + arb_nsec =3D fifo_size * NSEC_PER_USEC / bandwidth_mbytes_sec; + else + arb_nsec =3D U32_MAX; + + /* + * Latency allowness should be set with consideration for the module's + * latency tolerance and internal buffering capabilities. + * + * Display memory clients use isochronous transfers and have very low + * tolerance to a belated transfers. Hence we need to compensate the + * memory arbitration imperfection for them in order to prevent FIFO + * underflow condition when memory bus is busy. + * + * VI clients also need a stronger compensation. + */ + switch (client->swgroup) { + case TEGRA_SWGROUP_MPCORE: + case TEGRA_SWGROUP_PTC: + /* + * We always want lower latency for these clients, hence + * don't touch them. + */ + return; + + case TEGRA_SWGROUP_DC: + case TEGRA_SWGROUP_DCB: + arb_tolerance_compensation_nsec =3D 1050; + arb_tolerance_compensation_div =3D 2; + break; + + case TEGRA_SWGROUP_VI: + arb_tolerance_compensation_nsec =3D 1050; + arb_tolerance_compensation_div =3D 1; + break; + + default: + arb_tolerance_compensation_nsec =3D 150; + arb_tolerance_compensation_div =3D 1; + break; + } + + if (arb_nsec > arb_tolerance_compensation_nsec) + arb_nsec -=3D arb_tolerance_compensation_nsec; + else + arb_nsec =3D 0; + + arb_nsec /=3D arb_tolerance_compensation_div; + + /* + * Latency allowance is a number of ticks a request from a particular + * client may wait in the EMEM arbiter before it becomes a high-priority + * request. + */ + la_ticks =3D arb_nsec / mc->tick; + la_ticks =3D min(la_ticks, client->regs.la.mask); + + value =3D mc_readl(mc, client->regs.la.reg); + value &=3D ~(client->regs.la.mask << client->regs.la.shift); + value |=3D la_ticks << client->regs.la.shift; + mc_writel(mc, value, client->regs.la.reg); +} + +static int tegra114_mc_icc_set(struct icc_node *src, struct icc_node *dst) +{ + struct tegra_mc *mc =3D icc_provider_to_tegra_mc(src->provider); + const struct tegra_mc_client *client =3D &mc->soc->clients[src->id]; + u64 peak_bandwidth =3D icc_units_to_bps(src->peak_bw); + + /* + * Skip pre-initialization that is done by icc_node_add(), which sets + * bandwidth to maximum for all clients before drivers are loaded. + * + * This doesn't make sense for us because we don't have drivers for all + * clients and it's okay to keep configuration left from bootloader + * during boot, at least for today. + */ + if (src =3D=3D dst) + return 0; + + /* convert bytes/sec to megabytes/sec */ + do_div(peak_bandwidth, 1000000); + + tegra114_mc_tune_client_latency(mc, client, peak_bandwidth); + + return 0; +} + +static int tegra114_mc_icc_aggreate(struct icc_node *node, u32 tag, u32 av= g_bw, + u32 peak_bw, u32 *agg_avg, u32 *agg_peak) +{ + /* + * ISO clients need to reserve extra bandwidth up-front because + * there could be high bandwidth pressure during initial filling + * of the client's FIFO buffers. Secondly, we need to take into + * account impurities of the memory subsystem. + */ + if (tag & TEGRA_MC_ICC_TAG_ISO) + peak_bw =3D tegra_mc_scale_percents(peak_bw, 400); + + *agg_avg +=3D avg_bw; + *agg_peak =3D max(*agg_peak, peak_bw); + + return 0; +} + +static struct icc_node_data * +tegra114_mc_of_icc_xlate_extended(const struct of_phandle_args *spec, void= *data) +{ + struct tegra_mc *mc =3D icc_provider_to_tegra_mc(data); + const struct tegra_mc_client *client; + unsigned int i, idx =3D spec->args[0]; + struct icc_node_data *ndata; + struct icc_node *node; + + list_for_each_entry(node, &mc->provider.nodes, node_list) { + if (node->id !=3D idx) + continue; + + ndata =3D kzalloc_obj(*ndata); + if (!ndata) + return ERR_PTR(-ENOMEM); + + client =3D &mc->soc->clients[idx]; + ndata->node =3D node; + + switch (client->swgroup) { + case TEGRA_SWGROUP_DC: + case TEGRA_SWGROUP_DCB: + case TEGRA_SWGROUP_PTC: + case TEGRA_SWGROUP_VI: + /* these clients are isochronous by default */ + ndata->tag =3D TEGRA_MC_ICC_TAG_ISO; + break; + + default: + ndata->tag =3D TEGRA_MC_ICC_TAG_DEFAULT; + break; + } + + return ndata; + } + + for (i =3D 0; i < mc->soc->num_clients; i++) { + if (mc->soc->clients[i].id =3D=3D idx) + return ERR_PTR(-EPROBE_DEFER); + } + + dev_err(mc->dev, "invalid ICC client ID %u\n", idx); + + return ERR_PTR(-EINVAL); +} + +static const struct tegra_mc_icc_ops tegra114_mc_icc_ops =3D { + .xlate_extended =3D tegra114_mc_of_icc_xlate_extended, + .aggregate =3D tegra114_mc_icc_aggreate, + .set =3D tegra114_mc_icc_set, +}; + +static const unsigned long tegra114_mc_emem_regs[] =3D { + MC_EMEM_ARB_CFG, + MC_EMEM_ARB_OUTSTANDING_REQ, + MC_EMEM_ARB_TIMING_RCD, + MC_EMEM_ARB_TIMING_RP, + MC_EMEM_ARB_TIMING_RC, + MC_EMEM_ARB_TIMING_RAS, + MC_EMEM_ARB_TIMING_FAW, + MC_EMEM_ARB_TIMING_RRD, + MC_EMEM_ARB_TIMING_RAP2PRE, + MC_EMEM_ARB_TIMING_WAP2PRE, + MC_EMEM_ARB_TIMING_R2R, + MC_EMEM_ARB_TIMING_W2W, + MC_EMEM_ARB_TIMING_R2W, + MC_EMEM_ARB_TIMING_W2R, + MC_EMEM_ARB_DA_TURNS, + MC_EMEM_ARB_DA_COVERS, + MC_EMEM_ARB_MISC0, + MC_EMEM_ARB_RING1_THROTTLE, +}; + static const struct tegra_mc_intmask tegra114_mc_intmasks[] =3D { { .reg =3D MC_INTMASK, @@ -1116,11 +1306,14 @@ const struct tegra_mc_soc tegra114_mc_soc =3D { .atom_size =3D 32, .client_id_mask =3D 0x7f, .smmu =3D &tegra114_smmu_soc, + .emem_regs =3D tegra114_mc_emem_regs, + .num_emem_regs =3D ARRAY_SIZE(tegra114_mc_emem_regs), .intmasks =3D tegra114_mc_intmasks, .num_intmasks =3D ARRAY_SIZE(tegra114_mc_intmasks), .reset_ops =3D &tegra_mc_reset_ops_common, .resets =3D tegra114_mc_resets, .num_resets =3D ARRAY_SIZE(tegra114_mc_resets), + .icc_ops =3D &tegra114_mc_icc_ops, .ops =3D &tegra30_mc_ops, .regs =3D &tegra20_mc_regs, .handle_irq =3D tegra30_mc_irq_handlers, --=20 2.51.0 From nobody Wed Jun 17 07:22:14 2026 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DAB012857C7 for ; Mon, 27 Apr 2026 07:03:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777273424; cv=none; b=MLtvSf20LnBYBhCWgTpFcwnbC8n7aa5+/AG5tq90xS2kyD0+7JPc2bgGbHVOaCddvJC4MY4XwdDpK1mGzrY2Ow9AO6qAuzwpJ5p0H8DUvnDwouzlY4VkihvXTUmW7bGgOIlejN72FtbHvvmk7XQqTI7zxS0d4C0h5y/VOyZb4hc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777273424; c=relaxed/simple; bh=84Dqsd4+a5f1NKPye0gyTGquAHxSzQnz5E8L5x6vjSk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UK4thFlCI7IcCk0vNJBpvtftdlX9LiDm1vybddtHJB/lKhndSsLOdNUnOcQqyU4+blDpKbYAhzKDlyQdJu9w4u6kOCMzVzFgoA//hPIjkw/PSu8zo4iUl7DPVxdHTzp3Th0CfmVRs5TAaoetQspxnpbI7Ff+9/4UTwPP/tevdOk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KKUymfWs; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KKUymfWs" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-43cfde3c3f3so10011096f8f.3 for ; Mon, 27 Apr 2026 00:03:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777273421; x=1777878221; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1CfO1Q8+JOBgDtlGnZkxxf2jPv4aks+RLJbYHeFtCGM=; b=KKUymfWsG7qJfjuxz0mv5rENezIUVG2G+CXHS+4mJOKM4pZtiCgNhetoYOQOOvzEVV kd6cnHPe+kcCJT3yKJ0+Ks55qDfxueNC2n/ddmvjcFlMdnKz4sKFDFpaWThZtILZ13Zl hrECpWKl4SNkyV35egtchzUHL3Q5n5XylLzsgpWjl9XpXKSMjvng1XnuC76RUMVs7fu8 FRGHofLdqdFKvkPmp93j5srgCAZygn/NKsEvn1P0OLirOiFJammJw6evXsTBUjyliNE0 rYvF8EzOqOPi+go4i1YK0/hKvhC45kfxv79MSBrGQMTbIAIZifKU4T4Ac4fjvUhDM3o/ pPwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777273421; x=1777878221; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1CfO1Q8+JOBgDtlGnZkxxf2jPv4aks+RLJbYHeFtCGM=; b=Rj/U+tVNBBsxTIBDH/d8neJnjuo4PC4BgPcLLzPgNQkvQVVNY2r7ZoxsysJccpGfKo ND3jJRYqgtEdy+r4OQVSAPQY2OJjuZ3vdBe5FZiaG73Wps7o0KCgK4fmLLvq5Tv1mZw4 /MCJOpA0k/pZndWfr5o4FJaKiy61DApmiW9SS4EI2uqp2ramBCyslvcaLu8m/XK514jo rdYbU5fufOk3R3Os5Wcb8I9nBuSfpK92g2ImGNYTdOBGpOsQq7T1WKHMvyoRr6Vtggqh UfCsQv3JxFjrC5kypp9wkTzwo3N4l7Zhd4N1pjpa/w7FCL7vdDNVQFDHx0Zjc4KiclWM UxbQ== X-Gm-Message-State: AOJu0YxtfqH7feE2FX5e03v7E2PRq6x63sBEVc9GWNycV+IVerxI+Iia LwC0XetUfEP8Yw1D4XBP1FelO6CvXVc5kfhteL11lI1IF4VzBfg5RNAt X-Gm-Gg: AeBDievmCQA5LQsKkZokMP3Dmync0Tzzu9jClEewKQJMiyx+vxARlRz0YN9EXQ5BAzc 0qWmriab2/3w/BewUR7pfjneX6bDZ4sFajxfWasNSRnRSTWXZncwgSRPBwJiBVKknjTHKgTKjEY jk/7jIW7qRZXRiTpNVMRz83WwyNLvLh9e6oFlksgg2z5AowDwrtSoGnSBi5dnP6I/XhivEcJAdd zKtKlSFt8B/nmNJFmp4UGXcBSf24aKH+3Uv4705IEWpFKyqRJkWxG5iJUBwLygXASOY/uw+tsMQ vwDWPj6Z5Qosy0e+hd1cb7jdFVsmmtBG5EhLjXvbXvJgsZVQdLVOPrgDeeKaE/2yMSnyaw2aYb5 6I+L6Ek6GGip7PHk41Id9+PwvTC27gMgmcvtS0wViy9l6+CO1epIWFaLQR33B0bAZGHl8nCiNhG nFF8Fs9xfZyNEc6dNmre0qYYM= X-Received: by 2002:a5d:40cc:0:b0:43f:e721:76bf with SMTP id ffacd0b85a97d-43fe721784amr45151305f8f.41.1777273420997; Mon, 27 Apr 2026 00:03:40 -0700 (PDT) Received: from xeon ([188.163.112.56]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e3a341sm84245734f8f.24.2026.04.27.00.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 00:03:40 -0700 (PDT) From: Svyatoslav Ryhel To: Krzysztof Kozlowski , Rob Herring , Conor Dooley , Thierry Reding , Jonathan Hunter , Mikko Perttunen , Svyatoslav Ryhel Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH v2 3/7] dt-bindings: memory: Document Tegra114 External Memory Controller Date: Mon, 27 Apr 2026 10:03:08 +0300 Message-ID: <20260427070312.81679-4-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260427070312.81679-1-clamor95@gmail.com> References: <20260427070312.81679-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Include Tegra114 support into existing Tegra124 EMC schema with the most notable difference being the amount of EMC timings and a few SoC unique entries. Signed-off-by: Svyatoslav Ryhel Reviewed-by: Rob Herring (Arm) --- .../nvidia,tegra124-emc.yaml | 174 +++--------------- 1 file changed, 26 insertions(+), 148 deletions(-) diff --git a/Documentation/devicetree/bindings/memory-controllers/nvidia,te= gra124-emc.yaml b/Documentation/devicetree/bindings/memory-controllers/nvid= ia,tegra124-emc.yaml index f5f03bf36413..9398aae49093 100644 --- a/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra124-= emc.yaml +++ b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra124-= emc.yaml @@ -16,7 +16,9 @@ description: | =20 properties: compatible: - const: nvidia,tegra124-emc + enum: + - nvidia,tegra114-emc + - nvidia,tegra124-emc =20 reg: maxItems: 1 @@ -29,6 +31,9 @@ properties: items: - const: emc =20 + interrupts: + maxItems: 1 + "#interconnect-cells": const: 0 =20 @@ -164,153 +169,12 @@ patternProperties: nvidia,emc-configuration: description: EMC timing characterization data. These are the registers (s= ee - section "15.6.2 EMC Registers" in the TRM) whose values need= to + section "20.11.2 EMC Registers" in the Tegra114 TRM or secti= on + "15.6.2 EMC Registers" in the Tegra124 TRM) whose values nee= d to be specified, according to the board documentation. $ref: /schemas/types.yaml#/definitions/uint32-array - items: - - description: EMC_RC - - description: EMC_RFC - - description: EMC_RFC_SLR - - description: EMC_RAS - - description: EMC_RP - - description: EMC_R2W - - description: EMC_W2R - - description: EMC_R2P - - description: EMC_W2P - - description: EMC_RD_RCD - - description: EMC_WR_RCD - - description: EMC_RRD - - description: EMC_REXT - - description: EMC_WEXT - - description: EMC_WDV - - description: EMC_WDV_MASK - - description: EMC_QUSE - - description: EMC_QUSE_WIDTH - - description: EMC_IBDLY - - description: EMC_EINPUT - - description: EMC_EINPUT_DURATION - - description: EMC_PUTERM_EXTRA - - description: EMC_PUTERM_WIDTH - - description: EMC_PUTERM_ADJ - - description: EMC_CDB_CNTL_1 - - description: EMC_CDB_CNTL_2 - - description: EMC_CDB_CNTL_3 - - description: EMC_QRST - - description: EMC_QSAFE - - description: EMC_RDV - - description: EMC_RDV_MASK - - description: EMC_REFRESH - - description: EMC_BURST_REFRESH_NUM - - description: EMC_PRE_REFRESH_REQ_CNT - - description: EMC_PDEX2WR - - description: EMC_PDEX2RD - - description: EMC_PCHG2PDEN - - description: EMC_ACT2PDEN - - description: EMC_AR2PDEN - - description: EMC_RW2PDEN - - description: EMC_TXSR - - description: EMC_TXSRDLL - - description: EMC_TCKE - - description: EMC_TCKESR - - description: EMC_TPD - - description: EMC_TFAW - - description: EMC_TRPAB - - description: EMC_TCLKSTABLE - - description: EMC_TCLKSTOP - - description: EMC_TREFBW - - description: EMC_FBIO_CFG6 - - description: EMC_ODT_WRITE - - description: EMC_ODT_READ - - description: EMC_FBIO_CFG5 - - description: EMC_CFG_DIG_DLL - - description: EMC_CFG_DIG_DLL_PERIOD - - description: EMC_DLL_XFORM_DQS0 - - description: EMC_DLL_XFORM_DQS1 - - description: EMC_DLL_XFORM_DQS2 - - description: EMC_DLL_XFORM_DQS3 - - description: EMC_DLL_XFORM_DQS4 - - description: EMC_DLL_XFORM_DQS5 - - description: EMC_DLL_XFORM_DQS6 - - description: EMC_DLL_XFORM_DQS7 - - description: EMC_DLL_XFORM_DQS8 - - description: EMC_DLL_XFORM_DQS9 - - description: EMC_DLL_XFORM_DQS10 - - description: EMC_DLL_XFORM_DQS11 - - description: EMC_DLL_XFORM_DQS12 - - description: EMC_DLL_XFORM_DQS13 - - description: EMC_DLL_XFORM_DQS14 - - description: EMC_DLL_XFORM_DQS15 - - description: EMC_DLL_XFORM_QUSE0 - - description: EMC_DLL_XFORM_QUSE1 - - description: EMC_DLL_XFORM_QUSE2 - - description: EMC_DLL_XFORM_QUSE3 - - description: EMC_DLL_XFORM_QUSE4 - - description: EMC_DLL_XFORM_QUSE5 - - description: EMC_DLL_XFORM_QUSE6 - - description: EMC_DLL_XFORM_QUSE7 - - description: EMC_DLL_XFORM_ADDR0 - - description: EMC_DLL_XFORM_ADDR1 - - description: EMC_DLL_XFORM_ADDR2 - - description: EMC_DLL_XFORM_ADDR3 - - description: EMC_DLL_XFORM_ADDR4 - - description: EMC_DLL_XFORM_ADDR5 - - description: EMC_DLL_XFORM_QUSE8 - - description: EMC_DLL_XFORM_QUSE9 - - description: EMC_DLL_XFORM_QUSE10 - - description: EMC_DLL_XFORM_QUSE11 - - description: EMC_DLL_XFORM_QUSE12 - - description: EMC_DLL_XFORM_QUSE13 - - description: EMC_DLL_XFORM_QUSE14 - - description: EMC_DLL_XFORM_QUSE15 - - description: EMC_DLI_TRIM_TXDQS0 - - description: EMC_DLI_TRIM_TXDQS1 - - description: EMC_DLI_TRIM_TXDQS2 - - description: EMC_DLI_TRIM_TXDQS3 - - description: EMC_DLI_TRIM_TXDQS4 - - description: EMC_DLI_TRIM_TXDQS5 - - description: EMC_DLI_TRIM_TXDQS6 - - description: EMC_DLI_TRIM_TXDQS7 - - description: EMC_DLI_TRIM_TXDQS8 - - description: EMC_DLI_TRIM_TXDQS9 - - description: EMC_DLI_TRIM_TXDQS10 - - description: EMC_DLI_TRIM_TXDQS11 - - description: EMC_DLI_TRIM_TXDQS12 - - description: EMC_DLI_TRIM_TXDQS13 - - description: EMC_DLI_TRIM_TXDQS14 - - description: EMC_DLI_TRIM_TXDQS15 - - description: EMC_DLL_XFORM_DQ0 - - description: EMC_DLL_XFORM_DQ1 - - description: EMC_DLL_XFORM_DQ2 - - description: EMC_DLL_XFORM_DQ3 - - description: EMC_DLL_XFORM_DQ4 - - description: EMC_DLL_XFORM_DQ5 - - description: EMC_DLL_XFORM_DQ6 - - description: EMC_DLL_XFORM_DQ7 - - description: EMC_XM2CMDPADCTRL - - description: EMC_XM2CMDPADCTRL4 - - description: EMC_XM2CMDPADCTRL5 - - description: EMC_XM2DQPADCTRL2 - - description: EMC_XM2DQPADCTRL3 - - description: EMC_XM2CLKPADCTRL - - description: EMC_XM2CLKPADCTRL2 - - description: EMC_XM2COMPPADCTRL - - description: EMC_XM2VTTGENPADCTRL - - description: EMC_XM2VTTGENPADCTRL2 - - description: EMC_XM2VTTGENPADCTRL3 - - description: EMC_XM2DQSPADCTRL3 - - description: EMC_XM2DQSPADCTRL4 - - description: EMC_XM2DQSPADCTRL5 - - description: EMC_XM2DQSPADCTRL6 - - description: EMC_DSR_VTTGEN_DRV - - description: EMC_TXDSRVTTGEN - - description: EMC_FBIO_SPARE - - description: EMC_ZCAL_WAIT_CNT - - description: EMC_MRS_WAIT_CNT2 - - description: EMC_CTT - - description: EMC_CTT_DURATION - - description: EMC_CFG_PIPE - - description: EMC_DYN_SELF_REF_CONTROL - - description: EMC_QPOP + minItems: 97 + maxItems: 143 =20 required: - clock-frequency @@ -318,9 +182,7 @@ patternProperties: - nvidia,emc-auto-cal-config2 - nvidia,emc-auto-cal-config3 - nvidia,emc-auto-cal-interval - - nvidia,emc-bgbias-ctl0 - nvidia,emc-cfg - - nvidia,emc-cfg-2 - nvidia,emc-ctt-term-ctrl - nvidia,emc-mode-1 - nvidia,emc-mode-2 @@ -344,6 +206,22 @@ required: - "#interconnect-cells" - operating-points-v2 =20 +allOf: + - if: + properties: + compatible: + contains: + enum: + - nvidia,tegra124-emc + then: + patternProperties: + "^emc-timings-[0-9]+$": + patternProperties: + "^timing-[0-9]+$": + required: + - nvidia,emc-bgbias-ctl0 + - nvidia,emc-cfg-2 + additionalProperties: false =20 examples: --=20 2.51.0 From nobody Wed Jun 17 07:22:14 2026 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44859391838 for ; Mon, 27 Apr 2026 07:03:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777273428; cv=none; b=aTNgPunRVluRGVJ9GKi7dIiHOlm7pvYKKsFDiI72zYDf4R/wkKQW1f5JflD/o8R+xSHvlpmAkRoqIkV2RR8Ptb8E4wkRI3SrENvmwafilz+gOGlFUVWMwOGXuGW3pxQte8baQiCUsNG0nKR48WlNfxdsjSZOxlCG1db/xVh+mDs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777273428; c=relaxed/simple; bh=EArx4H6WJu3ESttLAy0aV488MjKilY/ra3E4U/NOvgM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iuPhIQ6NOP/+crsGepVGYJD2Ggmp6XclKviQotJSf9yVk4YsZN7vIQ4uSJxaNxN/xGB29dRoT8ad7Lb5cUsOjdKuQJ+80JwQ7/YJTxvVU3w2mzzlIZ6gb6iYSfkzI4HtGNM7qR5MYD0/ABWumkiQTPCbZPUq+QHG9UFskrFMA0E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=E46YVrtS; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="E46YVrtS" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-43eb05b1875so5712524f8f.3 for ; Mon, 27 Apr 2026 00:03:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777273423; x=1777878223; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fsBvPWASiBusu39oKHVBc+83MRymhCYvohu39kNvwW4=; b=E46YVrtSpSaeAwKU0PagF+k73WNbXZjrS+TwO57oEuWkxaVzM7ulynpCiu8N+YH6df mZHJ/Pg2NPNvIPXfR2pl05he8fixOxouG3A/eFwZTL9yzLIhyQmjKjAxv5JfowWFxJgI heX4A50t27Li4wSf0U+d6Ez2TJVafQR8kX6uRzCNbYRCkjpCiZrhlRBQgKYw1UnjfuHB H7eV7L75TG7KVLROACWgVdXk+piDHG5K7jV6GExrQyPsiN//+lDv+p6z6Nhmxq7MoT2J bWKVy5Q2cJzSQXIXUcx2kwkaBeb5rssrF3P1esgnGNsm/cGRBrfmRyK7SoFQXPPCuCkA AT5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777273423; x=1777878223; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fsBvPWASiBusu39oKHVBc+83MRymhCYvohu39kNvwW4=; b=ccXO3xEnCAdoVWOFZ9zRJjgELmqIeGjhAFBPGupOaohcTvKuP/QEpFcpLENCnb3Mih DlA9SHoRYubsJB999eSKi5lJ3YUjZzboo3KmZTfluNRoPApJ1ejgmN848BRJvLzZ+s4w Or392QCWXBSf97edrYaqiMeyX02NZ8TG+10NyGbw07/9H01jYFr3hVP+XSVGE6oOwIVz opofRf2tkVQelmfek16XX8Gtmd+S8/bxPRQVEDSWBQjoSC7SLPRdNBBMfSGneYygLv57 Hw0G4IiY2W2fG/07uMeQYI2v1NQFmx2/L6aA5yBiZ+QfamDAqaBVLlVJL2pKZleqeHIP ucOg== X-Gm-Message-State: AOJu0YzUBqqmMjHQ3Hvdg6DkgQc7h2YCoGZ0XGIv5/aW9TzRTPaLK0+w dCW5K5UrhXb66grfMKj2hepg/X7+M/SgHW7mX8JL6umAO+mop+B7O8GA X-Gm-Gg: AeBDietOMqFAuqQgDgokuUnYzsGX/0jKP9eEEE4y8oqfrC6KN3g7J78l3om5wCAolIR 4cPaMg9cdmAdozabkyzTbVuhcagyg9O5a2A2M+DtXlXXxShCtxAf6M2ys6WzafFBTyykeK86jMH GBZL8Kz2CX67e83ucXlEn5wuqegO8QNNoSICp7IRF40p5zd/rxe/aAgU3OHLCfhI1YUq5h2NLFZ fPwqxNKysHXQE5HzFRTAmUw6+OdJVqfe6f8wyYOUes0OwNs61+3P0bA45tXRQ5Nzr+RdlYRmqYt 9Hh7y7kglQBLbLRX7timiH05Qx8N2BnzjGjqxa1pWSHHusGWoTbVXGyFY4FSCvrwbbZBcgSurDU IPsEaBFBxAUhwgaT2Dphef1lLPSQagAKqEvAd9bWQUko2x1yvhSdbDW87NWPnnI92Ch7lmrxLta Bd2ZAKS8AdrQ2C6XqglEDt+5k= X-Received: by 2002:a05:6000:25c4:b0:43d:7b90:fa23 with SMTP id ffacd0b85a97d-43fe3dfd5ddmr65200789f8f.29.1777273422096; Mon, 27 Apr 2026 00:03:42 -0700 (PDT) Received: from xeon ([188.163.112.56]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e3a341sm84245734f8f.24.2026.04.27.00.03.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 00:03:41 -0700 (PDT) From: Svyatoslav Ryhel To: Krzysztof Kozlowski , Rob Herring , Conor Dooley , Thierry Reding , Jonathan Hunter , Mikko Perttunen , Svyatoslav Ryhel Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH v2 4/7] memory: tegra: Add Tegra114 EMC driver Date: Mon, 27 Apr 2026 10:03:09 +0300 Message-ID: <20260427070312.81679-5-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260427070312.81679-1-clamor95@gmail.com> References: <20260427070312.81679-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Introduce driver for the External Memory Controller (EMC) found in Tegra114 SoC. It controls the external DRAM on the board. The purpose of this driver is to program memory timing for external memory on the EMC clock rate change. Signed-off-by: Svyatoslav Ryhel Reviewed-by: Mikko Perttunen --- drivers/memory/tegra/Kconfig | 13 + drivers/memory/tegra/Makefile | 1 + drivers/memory/tegra/tegra114-emc.c | 1353 +++++++++++++++++++++++++++ 3 files changed, 1367 insertions(+) create mode 100644 drivers/memory/tegra/tegra114-emc.c diff --git a/drivers/memory/tegra/Kconfig b/drivers/memory/tegra/Kconfig index 92671f9df672..cf0bfead8c45 100644 --- a/drivers/memory/tegra/Kconfig +++ b/drivers/memory/tegra/Kconfig @@ -37,6 +37,19 @@ config TEGRA30_EMC This driver is required to change memory timings / clock rate for external memory. =20 +config TEGRA114_EMC + tristate "NVIDIA Tegra114 External Memory Controller driver" + default ARCH_TEGRA_114_SOC + depends on ARCH_TEGRA_114_SOC || COMPILE_TEST + select TEGRA124_CLK_EMC if ARCH_TEGRA + select PM_OPP + select TEGRA_EMC_COMMON + help + This driver is for the External Memory Controller (EMC) found on + Tegra114 chips. The EMC controls the external DRAM on the board. + This driver is required to change memory timings / clock rate for + external memory. + config TEGRA124_EMC tristate "NVIDIA Tegra124 External Memory Controller driver" default ARCH_TEGRA_124_SOC diff --git a/drivers/memory/tegra/Makefile b/drivers/memory/tegra/Makefile index 75ebb4cb4f29..28f22c957a34 100644 --- a/drivers/memory/tegra/Makefile +++ b/drivers/memory/tegra/Makefile @@ -17,6 +17,7 @@ obj-$(CONFIG_TEGRA_MC) +=3D tegra-mc.o obj-$(CONFIG_TEGRA_EMC_COMMON) +=3D tegra-emc-common.o obj-$(CONFIG_TEGRA20_EMC) +=3D tegra20-emc.o obj-$(CONFIG_TEGRA30_EMC) +=3D tegra30-emc.o +obj-$(CONFIG_TEGRA114_EMC) +=3D tegra114-emc.o obj-$(CONFIG_TEGRA124_EMC) +=3D tegra124-emc.o obj-$(CONFIG_TEGRA210_EMC_TABLE) +=3D tegra210-emc-table.o obj-$(CONFIG_TEGRA210_EMC) +=3D tegra210-emc.o diff --git a/drivers/memory/tegra/tegra114-emc.c b/drivers/memory/tegra/teg= ra114-emc.c new file mode 100644 index 000000000000..be6c699cb656 --- /dev/null +++ b/drivers/memory/tegra/tegra114-emc.c @@ -0,0 +1,1353 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Tegra114 External Memory Controller driver + * + * Based on downstream driver from NVIDIA and tegra124-emc.c + * Copyright (C) 2011-2014 NVIDIA Corporation + * + * Copyright (C) 2024 Svyatoslav Ryhel + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "mc.h" +#include "tegra-emc-common.h" + +#define EMC_INTSTATUS 0x0 +#define EMC_INTSTATUS_REFRESH_OVERFLOW BIT(3) +#define EMC_INTSTATUS_CLKCHANGE_COMPLETE BIT(4) + +#define EMC_INTMASK 0x4 + +#define EMC_DBG 0x8 +#define EMC_DBG_READ_MUX_ASSEMBLY BIT(0) +#define EMC_DBG_WRITE_MUX_ACTIVE BIT(1) +#define EMC_DBG_FORCE_UPDATE BIT(2) +#define EMC_DBG_CFG_PRIORITY BIT(24) + +#define EMC_CFG 0xc +#define EMC_CFG_DSR_VTTGEN_DRV_EN BIT(18) +#define EMC_CFG_PWR_MASK ((0xF << 28) | BIT(18)) +#define EMC_CFG_DYN_SREF BIT(28) +#define EMC_CFG_DRAM_ACPD BIT(29) +#define EMC_CFG_DRAM_CLKSTOP_SR BIT(30) +#define EMC_CFG_DRAM_CLKSTOP_PD BIT(31) + +#define EMC_ADR_CFG 0x10 +#define EMC_ADR_CFG_EMEM_NUMDEV BIT(0) + +#define EMC_REFCTRL 0x20 +#define EMC_REFCTRL_DEV_SEL_SHIFT 0 +#define EMC_REFCTRL_ENABLE BIT(31) + +#define EMC_TIMING_CONTROL 0x28 +#define EMC_RC 0x2c +#define EMC_RFC 0x30 +#define EMC_RAS 0x34 +#define EMC_RP 0x38 +#define EMC_R2W 0x3c +#define EMC_W2R 0x40 +#define EMC_R2P 0x44 +#define EMC_W2P 0x48 +#define EMC_RD_RCD 0x4c +#define EMC_WR_RCD 0x50 +#define EMC_RRD 0x54 +#define EMC_REXT 0x58 +#define EMC_WDV 0x5c +#define EMC_QUSE 0x60 +#define EMC_QRST 0x64 +#define EMC_QSAFE 0x68 +#define EMC_RDV 0x6c +#define EMC_REFRESH 0x70 +#define EMC_BURST_REFRESH_NUM 0x74 +#define EMC_PDEX2WR 0x78 +#define EMC_PDEX2RD 0x7c +#define EMC_PCHG2PDEN 0x80 +#define EMC_ACT2PDEN 0x84 +#define EMC_AR2PDEN 0x88 +#define EMC_RW2PDEN 0x8c +#define EMC_TXSR 0x90 +#define EMC_TCKE 0x94 +#define EMC_TFAW 0x98 +#define EMC_TRPAB 0x9c +#define EMC_TCLKSTABLE 0xa0 +#define EMC_TCLKSTOP 0xa4 +#define EMC_TREFBW 0xa8 +#define EMC_QUSE_EXTRA 0xac +#define EMC_ODT_WRITE 0xb0 +#define EMC_ODT_READ 0xb4 +#define EMC_WEXT 0xb8 +#define EMC_CTT 0xbc +#define EMC_RFC_SLR 0xc0 +#define EMC_MRS_WAIT_CNT2 0xc4 + +#define EMC_MRS_WAIT_CNT 0xc8 +#define EMC_MRS_WAIT_CNT_SHORT_WAIT_SHIFT 0 +#define EMC_MRS_WAIT_CNT_SHORT_WAIT_MASK \ + (0x3FF << EMC_MRS_WAIT_CNT_SHORT_WAIT_SHIFT) +#define EMC_MRS_WAIT_CNT_LONG_WAIT_SHIFT 16 +#define EMC_MRS_WAIT_CNT_LONG_WAIT_MASK \ + (0x3FF << EMC_MRS_WAIT_CNT_LONG_WAIT_SHIFT) + +#define EMC_MRS 0xcc +#define EMC_MODE_SET_DLL_RESET BIT(8) +#define EMC_MODE_SET_LONG_CNT BIT(26) +#define EMC_EMRS 0xd0 +#define EMC_REF 0xd4 +#define EMC_PRE 0xd8 + +#define EMC_SELF_REF 0xe0 +#define EMC_SELF_REF_CMD_ENABLED BIT(0) +#define EMC_SELF_REF_DEV_SEL_SHIFT 30 + +#define EMC_MRW 0xe8 + +#define EMC_MRR 0xec +#define EMC_MRR_MA_SHIFT 16 +#define LPDDR2_MR4_TEMP_SHIFT 0 + +#define EMC_XM2DQSPADCTRL3 0xf8 +#define EMC_FBIO_SPARE 0x100 + +#define EMC_FBIO_CFG5 0x104 +#define EMC_FBIO_CFG5_DRAM_TYPE_MASK 0x3 +#define EMC_FBIO_CFG5_DRAM_TYPE_SHIFT 0 + +#define EMC_FBIO_CFG6 0x114 +#define EMC_EMRS2 0x12c +#define EMC_MRW2 0x134 +#define EMC_MRW4 0x13c +#define EMC_EINPUT 0x14c +#define EMC_EINPUT_DURATION 0x150 +#define EMC_PUTERM_EXTRA 0x154 +#define EMC_TCKESR 0x158 +#define EMC_TPD 0x15c + +#define EMC_AUTO_CAL_CONFIG 0x2a4 +#define EMC_AUTO_CAL_CONFIG_AUTO_CAL_START BIT(31) +#define EMC_AUTO_CAL_INTERVAL 0x2a8 +#define EMC_AUTO_CAL_STATUS 0x2ac +#define EMC_AUTO_CAL_STATUS_ACTIVE BIT(31) +#define EMC_STATUS 0x2b4 +#define EMC_STATUS_TIMING_UPDATE_STALLED BIT(23) + +#define EMC_CFG_2 0x2b8 +#define EMC_CFG_2_CLKCHANGE_REQ_ENABLE BIT(0) +#define EMC_CFG_2_CLKCHANGE_PD_ENABLE BIT(1) +#define EMC_CFG_2_CLKCHANGE_SR_ENABLE BIT(2) + +#define EMC_CFG_DIG_DLL 0x2bc +#define EMC_CFG_DIG_DLL_PERIOD 0x2c0 +#define EMC_RDV_MASK 0x2cc +#define EMC_WDV_MASK 0x2d0 +#define EMC_CTT_DURATION 0x2d8 +#define EMC_CTT_TERM_CTRL 0x2dc +#define EMC_ZCAL_INTERVAL 0x2e0 +#define EMC_ZCAL_WAIT_CNT 0x2e4 + +#define EMC_ZQ_CAL 0x2ec +#define EMC_ZQ_CAL_CMD BIT(0) +#define EMC_ZQ_CAL_LONG BIT(4) +#define EMC_ZQ_CAL_LONG_CMD_DEV0 \ + (DRAM_DEV_SEL_0 | EMC_ZQ_CAL_LONG | EMC_ZQ_CAL_CMD) +#define EMC_ZQ_CAL_LONG_CMD_DEV1 \ + (DRAM_DEV_SEL_1 | EMC_ZQ_CAL_LONG | EMC_ZQ_CAL_CMD) + +#define EMC_XM2CMDPADCTRL 0x2f0 +#define EMC_XM2DQSPADCTRL 0x2f8 +#define EMC_XM2DQSPADCTRL2 0x2fc +#define EMC_XM2DQSPADCTRL2_RX_FT_REC_ENABLE BIT(0) +#define EMC_XM2DQSPADCTRL2_VREF_ENABLE BIT(5) +#define EMC_XM2DQPADCTRL 0x300 +#define EMC_XM2DQPADCTRL2 0x304 +#define EMC_XM2CLKPADCTRL 0x308 +#define EMC_XM2COMPPADCTRL 0x30c +#define EMC_XM2VTTGENPADCTRL 0x310 +#define EMC_XM2VTTGENPADCTRL2 0x314 +#define EMC_XM2QUSEPADCTRL 0x318 +#define EMC_XM2DQSPADCTRL4 0x320 +#define EMC_DLL_XFORM_DQS0 0x328 +#define EMC_DLL_XFORM_DQS1 0x32c +#define EMC_DLL_XFORM_DQS2 0x330 +#define EMC_DLL_XFORM_DQS3 0x334 +#define EMC_DLL_XFORM_DQS4 0x338 +#define EMC_DLL_XFORM_DQS5 0x33c +#define EMC_DLL_XFORM_DQS6 0x340 +#define EMC_DLL_XFORM_DQS7 0x344 +#define EMC_DLL_XFORM_QUSE0 0x348 +#define EMC_DLL_XFORM_QUSE1 0x34c +#define EMC_DLL_XFORM_QUSE2 0x350 +#define EMC_DLL_XFORM_QUSE3 0x354 +#define EMC_DLL_XFORM_QUSE4 0x358 +#define EMC_DLL_XFORM_QUSE5 0x35c +#define EMC_DLL_XFORM_QUSE6 0x360 +#define EMC_DLL_XFORM_QUSE7 0x364 +#define EMC_DLL_XFORM_DQ0 0x368 +#define EMC_DLL_XFORM_DQ1 0x36c +#define EMC_DLL_XFORM_DQ2 0x370 +#define EMC_DLL_XFORM_DQ3 0x374 +#define EMC_DLI_TRIM_TXDQS0 0x3a8 +#define EMC_DLI_TRIM_TXDQS1 0x3ac +#define EMC_DLI_TRIM_TXDQS2 0x3b0 +#define EMC_DLI_TRIM_TXDQS3 0x3b4 +#define EMC_DLI_TRIM_TXDQS4 0x3b8 +#define EMC_DLI_TRIM_TXDQS5 0x3bc +#define EMC_DLI_TRIM_TXDQS6 0x3c0 +#define EMC_DLI_TRIM_TXDQS7 0x3c4 +#define EMC_STALL_THEN_EXE_AFTER_CLKCHANGE 0x3cc +#define EMC_SEL_DPD_CTRL 0x3d8 +#define EMC_SEL_DPD_CTRL_DATA_SEL_DPD BIT(8) +#define EMC_SEL_DPD_CTRL_ODT_SEL_DPD BIT(5) +#define EMC_SEL_DPD_CTRL_RESET_SEL_DPD BIT(4) +#define EMC_SEL_DPD_CTRL_CA_SEL_DPD BIT(3) +#define EMC_SEL_DPD_CTRL_CLK_SEL_DPD BIT(2) +#define EMC_SEL_DPD_CTRL_DDR3_MASK \ + ((0xf << 2) | BIT(8)) +#define EMC_SEL_DPD_CTRL_MASK \ + ((0x3 << 2) | BIT(5) | BIT(8)) +#define EMC_PRE_REFRESH_REQ_CNT 0x3dc +#define EMC_DYN_SELF_REF_CONTROL 0x3e0 +#define EMC_TXSRDLL 0x3e4 +#define EMC_CCFIFO_ADDR 0x3e8 +#define EMC_CCFIFO_DATA 0x3ec +#define EMC_CCFIFO_STATUS 0x3f0 +#define EMC_CDB_CNTL_1 0x3f4 +#define EMC_CDB_CNTL_2 0x3f8 +#define EMC_XM2CLKPADCTRL2 0x3fc +#define EMC_AUTO_CAL_CONFIG2 0x458 +#define EMC_AUTO_CAL_CONFIG3 0x45c +#define EMC_IBDLY 0x468 +#define EMC_DLL_XFORM_ADDR0 0x46c +#define EMC_DLL_XFORM_ADDR1 0x470 +#define EMC_DLL_XFORM_ADDR2 0x474 +#define EMC_DSR_VTTGEN_DRV 0x47c +#define EMC_TXDSRVTTGEN 0x480 +#define EMC_XM2CMDPADCTRL4 0x484 + +#define DRAM_DEV_SEL_ALL 0 +#define DRAM_DEV_SEL_0 BIT(31) +#define DRAM_DEV_SEL_1 BIT(30) + +#define EMC_CFG_POWER_FEATURES_MASK \ + (EMC_CFG_DYN_SREF | EMC_CFG_DRAM_ACPD | EMC_CFG_DRAM_CLKSTOP_SR | \ + EMC_CFG_DRAM_CLKSTOP_PD | EMC_CFG_DSR_VTTGEN_DRV_EN) +#define EMC_REFCTRL_DEV_SEL(n) ((((n) > 1) ? 0 : 2) << EMC_REFCTRL_DEV_SEL= _SHIFT) +#define EMC_DRAM_DEV_SEL(n) (((n) > 1) ? DRAM_DEV_SEL_ALL : DRAM_DEV_SEL_0) + +/* Maximum amount of time in us. to wait for changes to become effective */ +#define EMC_STATUS_UPDATE_TIMEOUT 1000 + +enum emc_dram_type { + DRAM_TYPE_DDR3, + DRAM_TYPE_DDR1, + DRAM_TYPE_LPDDR2, + DRAM_TYPE_DDR2 +}; + +enum emc_dll_change { + DLL_CHANGE_NONE, + DLL_CHANGE_ON, + DLL_CHANGE_OFF +}; + +static const unsigned long emc_burst_regs[] =3D { + EMC_RC, + EMC_RFC, + EMC_RAS, + EMC_RP, + EMC_R2W, + EMC_W2R, + EMC_R2P, + EMC_W2P, + EMC_RD_RCD, + EMC_WR_RCD, + EMC_RRD, + EMC_REXT, + EMC_WEXT, + EMC_WDV, + EMC_WDV_MASK, + EMC_QUSE, + EMC_IBDLY, + EMC_EINPUT, + EMC_EINPUT_DURATION, + EMC_PUTERM_EXTRA, + EMC_CDB_CNTL_1, + EMC_CDB_CNTL_2, + EMC_QRST, + EMC_QSAFE, + EMC_RDV, + EMC_RDV_MASK, + EMC_REFRESH, + EMC_BURST_REFRESH_NUM, + EMC_PRE_REFRESH_REQ_CNT, + EMC_PDEX2WR, + EMC_PDEX2RD, + EMC_PCHG2PDEN, + EMC_ACT2PDEN, + EMC_AR2PDEN, + EMC_RW2PDEN, + EMC_TXSR, + EMC_TXSRDLL, + EMC_TCKE, + EMC_TCKESR, + EMC_TPD, + EMC_TFAW, + EMC_TRPAB, + EMC_TCLKSTABLE, + EMC_TCLKSTOP, + EMC_TREFBW, + EMC_QUSE_EXTRA, + EMC_FBIO_CFG6, + EMC_ODT_WRITE, + EMC_ODT_READ, + EMC_FBIO_CFG5, + EMC_CFG_DIG_DLL, + EMC_CFG_DIG_DLL_PERIOD, + EMC_DLL_XFORM_DQS0, + EMC_DLL_XFORM_DQS1, + EMC_DLL_XFORM_DQS2, + EMC_DLL_XFORM_DQS3, + EMC_DLL_XFORM_DQS4, + EMC_DLL_XFORM_DQS5, + EMC_DLL_XFORM_DQS6, + EMC_DLL_XFORM_DQS7, + EMC_DLL_XFORM_QUSE0, + EMC_DLL_XFORM_QUSE1, + EMC_DLL_XFORM_QUSE2, + EMC_DLL_XFORM_QUSE3, + EMC_DLL_XFORM_QUSE4, + EMC_DLL_XFORM_QUSE5, + EMC_DLL_XFORM_QUSE6, + EMC_DLL_XFORM_QUSE7, + EMC_DLI_TRIM_TXDQS0, + EMC_DLI_TRIM_TXDQS1, + EMC_DLI_TRIM_TXDQS2, + EMC_DLI_TRIM_TXDQS3, + EMC_DLI_TRIM_TXDQS4, + EMC_DLI_TRIM_TXDQS5, + EMC_DLI_TRIM_TXDQS6, + EMC_DLI_TRIM_TXDQS7, + EMC_DLL_XFORM_DQ0, + EMC_DLL_XFORM_DQ1, + EMC_DLL_XFORM_DQ2, + EMC_DLL_XFORM_DQ3, + EMC_XM2CMDPADCTRL, + EMC_XM2CMDPADCTRL4, + EMC_XM2DQPADCTRL2, + EMC_XM2CLKPADCTRL, + EMC_XM2COMPPADCTRL, + EMC_XM2VTTGENPADCTRL, + EMC_XM2VTTGENPADCTRL2, + EMC_XM2DQSPADCTRL3, + EMC_XM2DQSPADCTRL4, + EMC_DSR_VTTGEN_DRV, + EMC_TXDSRVTTGEN, + EMC_FBIO_SPARE, + EMC_ZCAL_WAIT_CNT, + EMC_MRS_WAIT_CNT2, + EMC_CTT, + EMC_CTT_DURATION, + EMC_DYN_SELF_REF_CONTROL, +}; + +struct emc_timing { + unsigned long rate; + + u32 emc_burst_data[ARRAY_SIZE(emc_burst_regs)]; + + u32 emc_auto_cal_config; + u32 emc_auto_cal_config2; + u32 emc_auto_cal_config3; + u32 emc_auto_cal_interval; + u32 emc_cfg; + u32 emc_ctt_term_ctrl; + u32 emc_mode_1; + u32 emc_mode_2; + u32 emc_mode_4; + u32 emc_mode_reset; + u32 emc_mrs_wait_cnt; + u32 emc_sel_dpd_ctrl; + u32 emc_xm2dqspadctrl2; + u32 emc_zcal_cnt_long; + u32 emc_zcal_interval; +}; + +struct tegra_emc { + struct device *dev; + struct tegra_mc *mc; + void __iomem *regs; + unsigned int irq; + struct clk *clk; + + enum emc_dram_type dram_type; + unsigned int dram_num; + + struct emc_timing last_timing; + struct emc_timing *timings; + unsigned int num_timings; + + struct { + struct dentry *root; + unsigned long min_rate; + unsigned long max_rate; + } debugfs; + + struct icc_provider provider; + struct tegra_emc_rate_requests reqs; +}; + +static irqreturn_t tegra114_emc_isr(int irq, void *data) +{ + struct tegra_emc *emc =3D data; + u32 intmask =3D EMC_INTSTATUS_REFRESH_OVERFLOW; + u32 status; + + status =3D readl_relaxed(emc->regs + EMC_INTSTATUS) & intmask; + if (!status) + return IRQ_NONE; + + /* notify about HW problem */ + if (status & EMC_INTSTATUS_REFRESH_OVERFLOW) + dev_err_ratelimited(emc->dev, + "refresh request overflow timeout\n"); + + /* clear interrupts */ + writel_relaxed(status, emc->regs + EMC_INTSTATUS); + + return IRQ_HANDLED; +} + +/* Timing change sequence functions */ + +static void emc_ccfifo_writel(struct tegra_emc *emc, u32 value, + unsigned long offset) +{ + writel(value, emc->regs + EMC_CCFIFO_DATA); + writel(offset, emc->regs + EMC_CCFIFO_ADDR); +} + +static void emc_seq_update_timing(struct tegra_emc *emc) +{ + int ret; + u32 value; + + writel(1, emc->regs + EMC_TIMING_CONTROL); + + ret =3D readl_poll_timeout_atomic(emc->regs + EMC_STATUS, value, + !(value & EMC_STATUS_TIMING_UPDATE_STALLED), + 1, EMC_STATUS_UPDATE_TIMEOUT); + if (ret) + dev_err(emc->dev, "timing update timed out\n"); +} + +static void emc_seq_disable_auto_cal(struct tegra_emc *emc) +{ + int ret; + u32 value; + + writel(0, emc->regs + EMC_AUTO_CAL_INTERVAL); + + ret =3D readl_poll_timeout_atomic(emc->regs + EMC_AUTO_CAL_STATUS, value, + !(value & EMC_AUTO_CAL_STATUS_ACTIVE), + 1, EMC_STATUS_UPDATE_TIMEOUT); + if (ret) + dev_err(emc->dev, "auto cal disable timed out\n"); +} + +static void emc_seq_wait_clkchange(struct tegra_emc *emc) +{ + int ret; + u32 value; + + ret =3D readl_poll_timeout_atomic(emc->regs + EMC_INTSTATUS, value, + value & EMC_INTSTATUS_CLKCHANGE_COMPLETE, + 1, EMC_STATUS_UPDATE_TIMEOUT); + if (ret) + dev_err(emc->dev, "clock change timed out\n"); +} + +static struct emc_timing *tegra114_emc_find_timing(struct tegra_emc *emc, + unsigned long rate) +{ + struct emc_timing *timing =3D NULL; + unsigned int i; + + for (i =3D 0; i < emc->num_timings; i++) { + if (emc->timings[i].rate =3D=3D rate) { + timing =3D &emc->timings[i]; + break; + } + } + + if (!timing) { + dev_err(emc->dev, "no timing for rate %lu\n", rate); + return NULL; + } + + return timing; +} + +static int tegra114_emc_prepare_timing_change(struct tegra_emc *emc, + unsigned long rate) +{ + struct emc_timing *timing =3D tegra114_emc_find_timing(emc, rate); + struct emc_timing *last =3D &emc->last_timing; + enum emc_dll_change dll_change; + unsigned int pre_wait =3D 0; + u32 val, mask; + bool next_dll_enabled =3D !(timing->emc_mode_1 & 0x1); + bool last_dll_enabled =3D !(last->emc_mode_1 & 0x1); + bool update =3D false; + unsigned int i; + + if (!timing) + return -ENOENT; + + if (next_dll_enabled =3D=3D last_dll_enabled) + dll_change =3D DLL_CHANGE_NONE; + else if (next_dll_enabled) + dll_change =3D DLL_CHANGE_ON; + else + dll_change =3D DLL_CHANGE_OFF; + + /* Clear CLKCHANGE_COMPLETE interrupts */ + writel(EMC_INTSTATUS_CLKCHANGE_COMPLETE, emc->regs + EMC_INTSTATUS); + + /* Disable dynamic self-refresh */ + val =3D readl(emc->regs + EMC_CFG); + if (val & EMC_CFG_PWR_MASK) { + val &=3D ~EMC_CFG_POWER_FEATURES_MASK; + writel(val, emc->regs + EMC_CFG); + + pre_wait =3D 5; + } + + /* Disable SEL_DPD_CTRL for clock change */ + if (emc->dram_type =3D=3D DRAM_TYPE_DDR3) + mask =3D EMC_SEL_DPD_CTRL_DDR3_MASK; + else + mask =3D EMC_SEL_DPD_CTRL_MASK; + + val =3D readl(emc->regs + EMC_SEL_DPD_CTRL); + if (val & mask) { + val &=3D ~mask; + writel(val, emc->regs + EMC_SEL_DPD_CTRL); + } + + /* Prepare DQ/DQS for clock change */ + val =3D readl(emc->regs + EMC_XM2DQSPADCTRL2); + if (timing->emc_xm2dqspadctrl2 & EMC_XM2DQSPADCTRL2_VREF_ENABLE && + !(val & EMC_XM2DQSPADCTRL2_VREF_ENABLE)) { + val |=3D EMC_XM2DQSPADCTRL2_VREF_ENABLE; + update =3D true; + } + + if (timing->emc_xm2dqspadctrl2 & EMC_XM2DQSPADCTRL2_RX_FT_REC_ENABLE && + !(val & EMC_XM2DQSPADCTRL2_RX_FT_REC_ENABLE)) { + val |=3D EMC_XM2DQSPADCTRL2_RX_FT_REC_ENABLE; + update =3D true; + } + + if (update) { + writel(val, emc->regs + EMC_XM2DQSPADCTRL2); + if (pre_wait < 30) + pre_wait =3D 30; + } + + /* Wait to settle */ + if (pre_wait) { + emc_seq_update_timing(emc); + udelay(pre_wait); + } + + /* Program CTT_TERM control */ + if (last->emc_ctt_term_ctrl !=3D timing->emc_ctt_term_ctrl) { + emc_seq_disable_auto_cal(emc); + writel(timing->emc_ctt_term_ctrl, + emc->regs + EMC_CTT_TERM_CTRL); + emc_seq_update_timing(emc); + } + + /* Program burst shadow registers */ + for (i =3D 0; i < ARRAY_SIZE(timing->emc_burst_data); ++i) + writel(timing->emc_burst_data[i], + emc->regs + emc_burst_regs[i]); + + writel(timing->emc_xm2dqspadctrl2, emc->regs + EMC_XM2DQSPADCTRL2); + writel(timing->emc_zcal_interval, emc->regs + EMC_ZCAL_INTERVAL); + + tegra_mc_write_emem_configuration(emc->mc, timing->rate); + + val =3D timing->emc_cfg & ~EMC_CFG_POWER_FEATURES_MASK; + emc_ccfifo_writel(emc, val, EMC_CFG); + + /* Program AUTO_CAL_CONFIG */ + if (timing->emc_auto_cal_config2 !=3D last->emc_auto_cal_config2) + emc_ccfifo_writel(emc, timing->emc_auto_cal_config2, + EMC_AUTO_CAL_CONFIG2); + + if (timing->emc_auto_cal_config3 !=3D last->emc_auto_cal_config3) + emc_ccfifo_writel(emc, timing->emc_auto_cal_config3, + EMC_AUTO_CAL_CONFIG3); + + if (timing->emc_auto_cal_config !=3D last->emc_auto_cal_config) { + val =3D timing->emc_auto_cal_config; + val &=3D EMC_AUTO_CAL_CONFIG_AUTO_CAL_START; + emc_ccfifo_writel(emc, val, EMC_AUTO_CAL_CONFIG); + } + + /* DDR3: predict MRS long wait count */ + if (emc->dram_type =3D=3D DRAM_TYPE_DDR3 && + dll_change =3D=3D DLL_CHANGE_ON) { + u32 cnt =3D 512; + + if (timing->emc_zcal_interval !=3D 0 && + last->emc_zcal_interval =3D=3D 0) + cnt -=3D emc->dram_num * 256; + + val =3D (timing->emc_mrs_wait_cnt + & EMC_MRS_WAIT_CNT_SHORT_WAIT_MASK) + >> EMC_MRS_WAIT_CNT_SHORT_WAIT_SHIFT; + if (cnt < val) + cnt =3D val; + + val =3D timing->emc_mrs_wait_cnt + & ~EMC_MRS_WAIT_CNT_LONG_WAIT_MASK; + val |=3D (cnt << EMC_MRS_WAIT_CNT_LONG_WAIT_SHIFT) + & EMC_MRS_WAIT_CNT_LONG_WAIT_MASK; + + writel(val, emc->regs + EMC_MRS_WAIT_CNT); + } + + /* DDR3: Turn off DLL and enter self-refresh */ + if (emc->dram_type =3D=3D DRAM_TYPE_DDR3 && dll_change =3D=3D DLL_CHANGE_= OFF) + emc_ccfifo_writel(emc, timing->emc_mode_1, EMC_EMRS); + + /* Disable refresh controller */ + emc_ccfifo_writel(emc, EMC_REFCTRL_DEV_SEL(emc->dram_num), + EMC_REFCTRL); + if (emc->dram_type =3D=3D DRAM_TYPE_DDR3) + emc_ccfifo_writel(emc, EMC_DRAM_DEV_SEL(emc->dram_num) | + EMC_SELF_REF_CMD_ENABLED, + EMC_SELF_REF); + + /* Flow control marker */ + emc_ccfifo_writel(emc, 1, EMC_STALL_THEN_EXE_AFTER_CLKCHANGE); + + /* DDR3: Exit self-refresh */ + if (emc->dram_type =3D=3D DRAM_TYPE_DDR3) + emc_ccfifo_writel(emc, EMC_DRAM_DEV_SEL(emc->dram_num), + EMC_SELF_REF); + emc_ccfifo_writel(emc, EMC_REFCTRL_DEV_SEL(emc->dram_num) | + EMC_REFCTRL_ENABLE, + EMC_REFCTRL); + + /* Set DRAM mode registers */ + if (emc->dram_type =3D=3D DRAM_TYPE_DDR3) { + if (timing->emc_mode_1 !=3D last->emc_mode_1) + emc_ccfifo_writel(emc, timing->emc_mode_1, EMC_EMRS); + if (timing->emc_mode_2 !=3D last->emc_mode_2) + emc_ccfifo_writel(emc, timing->emc_mode_2, EMC_EMRS2); + + if (timing->emc_mode_reset !=3D last->emc_mode_reset || + dll_change =3D=3D DLL_CHANGE_ON) { + val =3D timing->emc_mode_reset; + if (dll_change =3D=3D DLL_CHANGE_ON) { + val |=3D EMC_MODE_SET_DLL_RESET; + val |=3D EMC_MODE_SET_LONG_CNT; + } else { + val &=3D ~EMC_MODE_SET_DLL_RESET; + } + emc_ccfifo_writel(emc, val, EMC_MRS); + } + } else { + if (timing->emc_mode_2 !=3D last->emc_mode_2) + emc_ccfifo_writel(emc, timing->emc_mode_2, EMC_MRW2); + if (timing->emc_mode_1 !=3D last->emc_mode_1) + emc_ccfifo_writel(emc, timing->emc_mode_1, EMC_MRW); + if (timing->emc_mode_4 !=3D last->emc_mode_4) + emc_ccfifo_writel(emc, timing->emc_mode_4, EMC_MRW4); + } + + /* Issue ZCAL command if turning ZCAL on */ + if (timing->emc_zcal_interval !=3D 0 && last->emc_zcal_interval =3D=3D 0)= { + emc_ccfifo_writel(emc, EMC_ZQ_CAL_LONG_CMD_DEV0, EMC_ZQ_CAL); + if (emc->dram_num > 1) + emc_ccfifo_writel(emc, EMC_ZQ_CAL_LONG_CMD_DEV1, + EMC_ZQ_CAL); + } + + /* Write to RO register to remove stall after change */ + emc_ccfifo_writel(emc, 0, EMC_CCFIFO_STATUS); + + /* Disable AUTO_CAL for clock change */ + emc_seq_disable_auto_cal(emc); + + /* Read register to wait until programming has settled */ + mc_readl(emc->mc, MC_EMEM_ADR_CFG); + + return 0; +} + +static void tegra114_emc_complete_timing_change(struct tegra_emc *emc, + unsigned long rate) +{ + struct emc_timing *timing =3D tegra114_emc_find_timing(emc, rate); + struct emc_timing *last =3D &emc->last_timing; + + if (!timing) + return; + + /* Wait until the state machine has settled */ + emc_seq_wait_clkchange(emc); + + /* Restore AUTO_CAL */ + if (timing->emc_ctt_term_ctrl !=3D last->emc_ctt_term_ctrl) + writel(timing->emc_auto_cal_interval, + emc->regs + EMC_AUTO_CAL_INTERVAL); + + /* Restore dynamic self-refresh */ + if (timing->emc_cfg & EMC_CFG_PWR_MASK) + writel(timing->emc_cfg, emc->regs + EMC_CFG); + + /* Set ZCAL wait count */ + writel(timing->emc_zcal_cnt_long, emc->regs + EMC_ZCAL_WAIT_CNT); + + /* Wait for timing to settle */ + udelay(2); + + /* Reprogram SEL_DPD_CTRL */ + writel(timing->emc_sel_dpd_ctrl, emc->regs + EMC_SEL_DPD_CTRL); + emc_seq_update_timing(emc); + + emc->last_timing =3D *timing; +} + +/* Initialization and deinitialization */ + +static void emc_read_current_timing(struct tegra_emc *emc, + struct emc_timing *timing) +{ + unsigned int i; + + for (i =3D 0; i < ARRAY_SIZE(emc_burst_regs); ++i) + timing->emc_burst_data[i] =3D + readl(emc->regs + emc_burst_regs[i]); + + timing->emc_cfg =3D readl(emc->regs + EMC_CFG); + + timing->emc_auto_cal_interval =3D 0; + timing->emc_zcal_cnt_long =3D 0; + timing->emc_mode_1 =3D 0; + timing->emc_mode_2 =3D 0; + timing->emc_mode_4 =3D 0; + timing->emc_mode_reset =3D 0; +} + +static void emc_init(struct tegra_emc *emc) +{ + u32 emc_cfg, emc_dbg; + u32 intmask =3D EMC_INTSTATUS_REFRESH_OVERFLOW; + const char *dram_type_str; + + emc->dram_type =3D readl(emc->regs + EMC_FBIO_CFG5); + + emc->dram_type &=3D EMC_FBIO_CFG5_DRAM_TYPE_MASK; + emc->dram_type >>=3D EMC_FBIO_CFG5_DRAM_TYPE_SHIFT; + + emc->dram_num =3D tegra_mc_get_emem_device_count(emc->mc); + + emc_cfg =3D readl_relaxed(emc->regs + EMC_CFG_2); + + /* enable EMC and CAR to handshake on PLL divider/source changes */ + emc_cfg |=3D EMC_CFG_2_CLKCHANGE_REQ_ENABLE; + + /* configure clock change mode accordingly to DRAM type */ + if (emc->dram_type =3D=3D DRAM_TYPE_LPDDR2) + emc_cfg |=3D EMC_CFG_2_CLKCHANGE_PD_ENABLE; + else + emc_cfg &=3D ~EMC_CFG_2_CLKCHANGE_PD_ENABLE; + + writel_relaxed(emc_cfg, emc->regs + EMC_CFG_2); + + /* initialize interrupt */ + writel_relaxed(intmask, emc->regs + EMC_INTMASK); + writel_relaxed(0xffffffff, emc->regs + EMC_INTSTATUS); + + /* ensure that unwanted debug features are disabled */ + emc_dbg =3D readl_relaxed(emc->regs + EMC_DBG); + emc_dbg |=3D EMC_DBG_CFG_PRIORITY; + emc_dbg &=3D ~EMC_DBG_READ_MUX_ASSEMBLY; + emc_dbg &=3D ~EMC_DBG_WRITE_MUX_ACTIVE; + emc_dbg &=3D ~EMC_DBG_FORCE_UPDATE; + writel_relaxed(emc_dbg, emc->regs + EMC_DBG); + + switch (emc->dram_type) { + case DRAM_TYPE_DDR1: + dram_type_str =3D "DDR1"; + break; + case DRAM_TYPE_LPDDR2: + dram_type_str =3D "LPDDR2"; + break; + case DRAM_TYPE_DDR2: + dram_type_str =3D "DDR2"; + break; + case DRAM_TYPE_DDR3: + dram_type_str =3D "DDR3"; + break; + } + + dev_info_once(emc->dev, "%u %s %s attached\n", emc->dram_num, + dram_type_str, emc->dram_num =3D=3D 2 ? "devices" : "device"); + + emc_read_current_timing(emc, &emc->last_timing); +} + +static int load_one_timing_from_dt(struct tegra_emc *emc, + struct emc_timing *timing, + struct device_node *node) +{ + u32 value; + int err; + + err =3D of_property_read_u32(node, "clock-frequency", &value); + if (err) { + dev_err(emc->dev, "timing %pOFn: failed to read rate: %d\n", + node, err); + return err; + } + + timing->rate =3D value; + + err =3D of_property_read_u32_array(node, "nvidia,emc-configuration", + timing->emc_burst_data, + ARRAY_SIZE(timing->emc_burst_data)); + if (err) { + dev_err(emc->dev, + "timing %pOFn: failed to read emc burst data: %d\n", + node, err); + return err; + } + +#define EMC_READ_PROP(prop, dtprop) { \ + err =3D of_property_read_u32(node, dtprop, &timing->prop); \ + if (err) { \ + dev_err(emc->dev, "timing %pOFn: failed to read " #prop ": %d\n", \ + node, err); \ + return err; \ + } \ +} + + EMC_READ_PROP(emc_auto_cal_config, "nvidia,emc-auto-cal-config") + EMC_READ_PROP(emc_auto_cal_config2, "nvidia,emc-auto-cal-config2") + EMC_READ_PROP(emc_auto_cal_config3, "nvidia,emc-auto-cal-config3") + EMC_READ_PROP(emc_auto_cal_interval, "nvidia,emc-auto-cal-interval") + EMC_READ_PROP(emc_cfg, "nvidia,emc-cfg") + EMC_READ_PROP(emc_ctt_term_ctrl, "nvidia,emc-ctt-term-ctrl") + EMC_READ_PROP(emc_mode_1, "nvidia,emc-mode-1") + EMC_READ_PROP(emc_mode_2, "nvidia,emc-mode-2") + EMC_READ_PROP(emc_mode_4, "nvidia,emc-mode-4") + EMC_READ_PROP(emc_mode_reset, "nvidia,emc-mode-reset") + EMC_READ_PROP(emc_mrs_wait_cnt, "nvidia,emc-mrs-wait-cnt") + EMC_READ_PROP(emc_sel_dpd_ctrl, "nvidia,emc-sel-dpd-ctrl") + EMC_READ_PROP(emc_xm2dqspadctrl2, "nvidia,emc-xm2dqspadctrl2") + EMC_READ_PROP(emc_zcal_cnt_long, "nvidia,emc-zcal-cnt-long") + EMC_READ_PROP(emc_zcal_interval, "nvidia,emc-zcal-interval") + +#undef EMC_READ_PROP + + return 0; +} + +static int cmp_timings(const void *_a, const void *_b) +{ + const struct emc_timing *a =3D _a; + const struct emc_timing *b =3D _b; + + if (a->rate < b->rate) + return -1; + else if (a->rate =3D=3D b->rate) + return 0; + else + return 1; +} + +static int emc_check_mc_timings(struct tegra_emc *emc) +{ + struct tegra_mc *mc =3D emc->mc; + unsigned int i; + + if (emc->num_timings !=3D mc->num_timings) { + dev_err(emc->dev, "emc/mc timings number mismatch: %u %u\n", + emc->num_timings, mc->num_timings); + return -EINVAL; + } + + for (i =3D 0; i < mc->num_timings; i++) { + if (emc->timings[i].rate !=3D mc->timings[i].rate) { + dev_err(emc->dev, + "emc/mc timing rate mismatch: %lu %lu\n", + emc->timings[i].rate, mc->timings[i].rate); + return -EINVAL; + } + } + + return 0; +} + +static int tegra114_emc_load_timings_from_dt(struct tegra_emc *emc, + struct device_node *node) +{ + int child_count =3D of_get_child_count(node); + struct emc_timing *timing; + unsigned int i =3D 0; + int err; + + emc->timings =3D devm_kcalloc(emc->dev, child_count, sizeof(*timing), + GFP_KERNEL); + if (!emc->timings) + return -ENOMEM; + + emc->num_timings =3D child_count; + + for_each_child_of_node_scoped(node, child) { + timing =3D &emc->timings[i++]; + + err =3D load_one_timing_from_dt(emc, timing, child); + if (err) + return err; + } + + sort(emc->timings, emc->num_timings, sizeof(*timing), cmp_timings, + NULL); + + err =3D emc_check_mc_timings(emc); + if (err) + return err; + + dev_info_once(emc->dev, + "got %u timings for RAM code %u (min %luMHz max %luMHz)\n", + emc->num_timings, + tegra_read_ram_code(), + emc->timings[0].rate / 1000000, + emc->timings[emc->num_timings - 1].rate / 1000000); + + return 0; +} + +static struct device_node * +tegra114_emc_find_node_by_ram_code(struct device_node *node, u32 ram_code) +{ + struct device_node *np; + int err; + + for_each_child_of_node(node, np) { + u32 value; + + err =3D of_property_read_u32(np, "nvidia,ram-code", &value); + if (err || value !=3D ram_code) + continue; + + return np; + } + + return NULL; +} + +/* + * debugfs interface + * + * The memory controller driver exposes some files in debugfs that can be = used + * to control the EMC frequency. The top-level directory can be found here: + * + * /sys/kernel/debug/emc + * + * It contains the following files: + * + * - available_rates: This file contains a list of valid, space-separated + * EMC frequencies. + * + * - min_rate: Writing a value to this file sets the given frequency as = the + * floor of the permitted range. If this is higher than the currently + * configured EMC frequency, this will cause the frequency to be + * increased so that it stays within the valid range. + * + * - max_rate: Similarly to the min_rate file, writing a value to this f= ile + * sets the given frequency as the ceiling of the permitted range. If + * the value is lower than the currently configured EMC frequency, t= his + * will cause the frequency to be decreased so that it stays within = the + * valid range. + */ + +static bool tegra114_emc_validate_rate(struct tegra_emc *emc, unsigned lon= g rate) +{ + unsigned int i; + + for (i =3D 0; i < emc->num_timings; i++) + if (rate =3D=3D emc->timings[i].rate) + return true; + + return false; +} + +static int tegra114_emc_debug_available_rates_show(struct seq_file *s, + void *data) +{ + struct tegra_emc *emc =3D s->private; + const char *prefix =3D ""; + unsigned int i; + + for (i =3D 0; i < emc->num_timings; i++) { + seq_printf(s, "%s%lu", prefix, emc->timings[i].rate); + prefix =3D " "; + } + + seq_puts(s, "\n"); + + return 0; +} + +DEFINE_SHOW_ATTRIBUTE(tegra114_emc_debug_available_rates); + +static int tegra114_emc_debug_min_rate_get(void *data, u64 *rate) +{ + struct tegra_emc *emc =3D data; + + *rate =3D emc->debugfs.min_rate; + + return 0; +} + +static int tegra114_emc_debug_min_rate_set(void *data, u64 rate) +{ + struct tegra_emc *emc =3D data; + int err; + + if (!tegra114_emc_validate_rate(emc, rate)) + return -EINVAL; + + err =3D tegra_emc_set_min_rate(&emc->reqs, rate, TEGRA_EMC_RATE_DEBUG); + if (err < 0) + return err; + + emc->debugfs.min_rate =3D rate; + + return 0; +} + +DEFINE_DEBUGFS_ATTRIBUTE(tegra114_emc_debug_min_rate_fops, + tegra114_emc_debug_min_rate_get, + tegra114_emc_debug_min_rate_set, "%llu\n"); + +static int tegra114_emc_debug_max_rate_get(void *data, u64 *rate) +{ + struct tegra_emc *emc =3D data; + + *rate =3D emc->debugfs.max_rate; + + return 0; +} + +static int tegra114_emc_debug_max_rate_set(void *data, u64 rate) +{ + struct tegra_emc *emc =3D data; + int err; + + if (!tegra114_emc_validate_rate(emc, rate)) + return -EINVAL; + + err =3D tegra_emc_set_max_rate(&emc->reqs, rate, TEGRA_EMC_RATE_DEBUG); + if (err < 0) + return err; + + emc->debugfs.max_rate =3D rate; + + return 0; +} + +DEFINE_DEBUGFS_ATTRIBUTE(tegra114_emc_debug_max_rate_fops, + tegra114_emc_debug_max_rate_get, + tegra114_emc_debug_max_rate_set, "%llu\n"); + +static void emc_debugfs_init(struct device *dev, struct tegra_emc *emc) +{ + unsigned int i; + int err; + + emc->debugfs.min_rate =3D ULONG_MAX; + emc->debugfs.max_rate =3D 0; + + for (i =3D 0; i < emc->num_timings; i++) { + if (emc->timings[i].rate < emc->debugfs.min_rate) + emc->debugfs.min_rate =3D emc->timings[i].rate; + + if (emc->timings[i].rate > emc->debugfs.max_rate) + emc->debugfs.max_rate =3D emc->timings[i].rate; + } + + if (!emc->num_timings) { + emc->debugfs.min_rate =3D clk_get_rate(emc->clk); + emc->debugfs.max_rate =3D emc->debugfs.min_rate; + } + + err =3D clk_set_rate_range(emc->clk, emc->debugfs.min_rate, + emc->debugfs.max_rate); + if (err < 0) { + dev_err(dev, "failed to set rate range [%lu-%lu] for %pC\n", + emc->debugfs.min_rate, emc->debugfs.max_rate, + emc->clk); + return; + } + + emc->debugfs.root =3D debugfs_create_dir("emc", NULL); + + debugfs_create_file("available_rates", 0444, emc->debugfs.root, emc, + &tegra114_emc_debug_available_rates_fops); + debugfs_create_file("min_rate", 0644, emc->debugfs.root, + emc, &tegra114_emc_debug_min_rate_fops); + debugfs_create_file("max_rate", 0644, emc->debugfs.root, + emc, &tegra114_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_data * +emc_of_icc_xlate_extended(const struct of_phandle_args *spec, void *data) +{ + struct icc_provider *provider =3D data; + struct icc_node_data *ndata; + struct icc_node *node; + + /* External Memory is the only possible ICC route */ + list_for_each_entry(node, &provider->nodes, node_list) { + if (node->id !=3D TEGRA_ICC_EMEM) + continue; + + ndata =3D kzalloc_obj(*ndata); + if (!ndata) + return ERR_PTR(-ENOMEM); + + /* + * SRC and DST nodes should have matching TAG in order to have + * it set by default for a requested path. + */ + ndata->tag =3D TEGRA_MC_ICC_TAG_ISO; + ndata->node =3D node; + + return ndata; + } + + return ERR_PTR(-EPROBE_DEFER); +} + +static int emc_icc_set(struct icc_node *src, struct icc_node *dst) +{ + struct tegra_emc *emc =3D to_tegra_emc_provider(dst->provider); + unsigned long long peak_bw =3D icc_units_to_bps(dst->peak_bw); + unsigned long long avg_bw =3D icc_units_to_bps(dst->avg_bw); + unsigned long long rate =3D max(avg_bw, peak_bw); + unsigned int dram_data_bus_width_bytes =3D 4; + const unsigned int ddr =3D 2; + int err; + + /* + * Tegra114 EMC runs on a clock rate of SDRAM bus. This means that + * EMC clock rate is twice smaller than the peak data rate because + * data is sampled on both EMC clock edges. + */ + do_div(rate, ddr * dram_data_bus_width_bytes); + rate =3D min_t(u64, rate, U32_MAX); + + err =3D tegra_emc_set_min_rate(&emc->reqs, rate, TEGRA_EMC_RATE_ICC); + if (err) + return err; + + return 0; +} + +static int tegra114_emc_interconnect_init(struct tegra_emc *emc) +{ + const struct tegra_mc_soc *soc =3D emc->mc->soc; + struct icc_node *node; + int err; + + emc->provider.dev =3D emc->dev; + emc->provider.set =3D emc_icc_set; + emc->provider.data =3D &emc->provider; + emc->provider.aggregate =3D soc->icc_ops->aggregate; + emc->provider.xlate_extended =3D emc_of_icc_xlate_extended; + + icc_provider_init(&emc->provider); + + /* create External Memory Controller node */ + node =3D icc_node_create(TEGRA_ICC_EMC); + if (IS_ERR(node)) { + err =3D PTR_ERR(node); + goto err_msg; + } + + node->name =3D "External Memory Controller"; + icc_node_add(node, &emc->provider); + + /* link External Memory Controller to External Memory (DRAM) */ + err =3D icc_link_create(node, TEGRA_ICC_EMEM); + if (err) + goto remove_nodes; + + /* create External Memory node */ + node =3D icc_node_create(TEGRA_ICC_EMEM); + if (IS_ERR(node)) { + err =3D PTR_ERR(node); + goto remove_nodes; + } + + node->name =3D "External Memory (DRAM)"; + icc_node_add(node, &emc->provider); + + err =3D icc_provider_register(&emc->provider); + if (err) + goto remove_nodes; + + return 0; + +remove_nodes: + icc_nodes_remove(&emc->provider); +err_msg: + dev_err(emc->dev, "failed to initialize ICC: %d\n", err); + + return err; +} + +static void devm_tegra114_emc_unset_callback(void *data) +{ + tegra124_clk_set_emc_callbacks(NULL, NULL); +} + +static int tegra114_emc_probe(struct platform_device *pdev) +{ + struct tegra_core_opp_params opp_params =3D {}; + struct device *dev =3D &pdev->dev; + struct device_node *np; + struct tegra_emc *emc; + u32 ram_code; + int err; + + emc =3D devm_kzalloc(dev, sizeof(*emc), GFP_KERNEL); + if (!emc) + return -ENOMEM; + + emc->dev =3D dev; + + emc->regs =3D devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(emc->regs)) + return PTR_ERR(emc->regs); + + emc->mc =3D devm_tegra_memory_controller_get(dev); + if (IS_ERR(emc->mc)) + return PTR_ERR(emc->mc); + + ram_code =3D tegra_read_ram_code(); + + np =3D tegra114_emc_find_node_by_ram_code(dev->of_node, ram_code); + if (np) { + err =3D tegra114_emc_load_timings_from_dt(emc, np); + of_node_put(np); + if (err) + return err; + } else { + dev_info_once(dev, "no memory timings for RAM code %u found in DT\n", + ram_code); + } + + emc_init(emc); + + platform_set_drvdata(pdev, emc); + + tegra124_clk_set_emc_callbacks(tegra114_emc_prepare_timing_change, + tegra114_emc_complete_timing_change); + + err =3D devm_add_action_or_reset(dev, devm_tegra114_emc_unset_callback, + NULL); + if (err) + return err; + + err =3D platform_get_irq(pdev, 0); + if (err < 0) + return err; + + emc->irq =3D err; + + err =3D devm_request_irq(dev, emc->irq, tegra114_emc_isr, 0, + dev_name(dev), emc); + if (err) + return dev_err_probe(dev, err, "failed to request irq\n"); + + emc->clk =3D devm_clk_get(dev, "emc"); + if (IS_ERR(emc->clk)) + return dev_err_probe(dev, PTR_ERR(emc->clk), + "failed to get EMC clock\n"); + + opp_params.init_state =3D true; + + err =3D devm_tegra_core_dev_init_opp_table(dev, &opp_params); + if (err) + return err; + + tegra_emc_rate_requests_init(&emc->reqs, dev); + + if (IS_ENABLED(CONFIG_DEBUG_FS)) + emc_debugfs_init(dev, emc); + + tegra114_emc_interconnect_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; +}; + +static const struct of_device_id tegra114_emc_of_match[] =3D { + { .compatible =3D "nvidia,tegra114-emc" }, + { } +}; +MODULE_DEVICE_TABLE(of, tegra114_emc_of_match); + +static struct platform_driver tegra114_emc_driver =3D { + .probe =3D tegra114_emc_probe, + .driver =3D { + .name =3D "tegra114-emc", + .of_match_table =3D tegra114_emc_of_match, + .suppress_bind_attrs =3D true, + .sync_state =3D icc_sync_state, + }, +}; +module_platform_driver(tegra114_emc_driver); + +MODULE_AUTHOR("Svyatoslav Ryhel "); +MODULE_DESCRIPTION("NVIDIA Tegra114 EMC driver"); +MODULE_LICENSE("GPL"); --=20 2.51.0 From nobody Wed Jun 17 07:22:14 2026 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C2793921E6 for ; Mon, 27 Apr 2026 07:03:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777273427; cv=none; b=jicCfA4JUJMIH5Svs50pj/hRmR9jvr1nkC4z7VFkVcD5FYK+94lQW6K8v5mskO0cM77+MG+bbytr9gP6ZjNn9szMN8EFCOuTif23wnkWC++sh3TDC1Y1RvwDAlzThxZCI1UL0gIJCZrkgdPYuZtv1lMTqb9EVcVSZ3V/OGh+19k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777273427; c=relaxed/simple; bh=W6txuQCEUCrc1UvkuuAflUC4e6TGqcThPpWviWV42lE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Lg/4hFC4MySNSU6SbojGWpFakghp43X1pTLBmHRuz07Gjxld0sModRi65PyYpm7tjTW0LM39yVED3lQq5NXZCpc/kgVOs5QAyaolM0CXFza/98mJN6fT9APe5rUIG/h0bkXONudNqO9uZDqMSuPCifibBAxQZWxdQYaZwhdaImM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EmgOdeC8; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EmgOdeC8" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-43d0deb7ad5so8169099f8f.2 for ; Mon, 27 Apr 2026 00:03:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777273423; x=1777878223; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=90gzvuDE2Ybs7D8y5HYsbaHjQhyiyd4TKaAXDPG/a+8=; b=EmgOdeC8BKwA1JfMJS3UjuMbs5viwRI1nGL8PirOUkc843QnPBL9moM2P5QqUXTjJ7 tuck1iorPx5Rhnd/fhzsbb+OOUiAzHgBWx/VG2FpjwNtXKCuWAxGuuxRyoSLKnEyDGi9 Z9bgi7dkKYEAo74MbxQ+mWKfgOZ2BtlVK9iaTe07Pw8gxoJ+M+pdMXY88y1vSFeIsBDC 4kaiY7oQJbiDPCl5ov/C671FYHo9zI+iNN3afKsqNA1Z04/bchnxwTPHj9ZwoD6tt9Oj ZPMrOScOYqo6qzwmT1RsDcMITApfqgNbMAlq8fTaPQCC5+a8rXMA6w7LKtoh9QK5R8KU Cn0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777273423; x=1777878223; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=90gzvuDE2Ybs7D8y5HYsbaHjQhyiyd4TKaAXDPG/a+8=; b=VyBy2TyzednQFDaAXu82C+VMXasxb6gDsFvG7+yqG+C36UT/7tRQhuFDhofze3+SLp Vyn3m51kK+P9IyyRtWWbfyFistik+QELbX5hF1iNq+/5oAEvwXfKupCnCjeRLI/zUPSI LZcjOpLcpaaWtIqhguKtLE/VwCtIHYZGP4MVeQ9Z8UwfhqM2P6u5lHagy6J2x+ozTMqD kLXoA/FcIFPk35eFKj3GNYTBZrUP+XUCIxjoalM1WyBDoOtvfvSvWtZ/tpWY/dafHasE N6vJ3EFEQCKp1vXytWY+jpvX63HyOFWEpTzNbPsX5UM6FFZaTVOpYA8vf2heAG/BJjYA zy0A== X-Gm-Message-State: AOJu0YwWkp71bBAULjxLAUJ5o2DKFt8sU4knhrMGWOauYkEfvjZsDJHJ Q0va8+RGlLC4z9iVHxKGRu1gDLpG2ocVRlA4QBmfL91z88qk5ts+Jcbz X-Gm-Gg: AeBDiev1YQ7xz7kaFCJ59mJluQZjxxBtzqSnFZ41nXSnM7xdA9DH0SOBSmgso1WVo6W VFLocaFWLyFdH8NmCIdIlmQ7OpUX48wsQcpO+KVNHyT1iNZD43vvTxfVb6qGmJX1YbAqfk4nEDR 2pgTZ2KUnMjGSzBxN2JNi9yr2QWeEPIqfLLXOdkzLn4nn3Ote/Wmkp4AA7tZ2cKY5JK3ixjqebr oLgXi/sLuYeo7B1dodFMXZHHiHV+RFXSXmtfojfh2CseH5HT+4ARSmOjW0ktoHdnDlFKHQfLl1I Ieqo0YUUE6wKhfokIjHvUwHsduSfYPa22Z5VzwMX3Uuqn736XCvcsfl8SKF+IndVpZ5MO3bC5u7 F2/9x/ktaBOdL6pNgq5QszCR5WJjYc343UA0na1G+n77kw5TXAvgDHzOcFoYA+93UtKs5s4Dnsg DiuO0mod23byQWpAQtaYCD7R4= X-Received: by 2002:a05:6000:2c0e:b0:441:377f:82a7 with SMTP id ffacd0b85a97d-441377f82c8mr14271384f8f.32.1777273423028; Mon, 27 Apr 2026 00:03:43 -0700 (PDT) Received: from xeon ([188.163.112.56]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e3a341sm84245734f8f.24.2026.04.27.00.03.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 00:03:42 -0700 (PDT) From: Svyatoslav Ryhel To: Krzysztof Kozlowski , Rob Herring , Conor Dooley , Thierry Reding , Jonathan Hunter , Mikko Perttunen , Svyatoslav Ryhel Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH v2 5/7] ARM: tegra: Add EMC OPP and ICC properties to Tegra114 EMC and ACTMON device-tree nodes Date: Mon, 27 Apr 2026 10:03:10 +0300 Message-ID: <20260427070312.81679-6-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260427070312.81679-1-clamor95@gmail.com> References: <20260427070312.81679-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add EMC OPP tables and interconnect paths that will be used for dynamic memory bandwidth scaling based on memory utilization statistics. Signed-off-by: Svyatoslav Ryhel Reviewed-by: Mikko Perttunen --- .../dts/nvidia/tegra114-peripherals-opp.dtsi | 164 ++++++++++++++++++ arch/arm/boot/dts/nvidia/tegra114.dtsi | 9 + 2 files changed, 173 insertions(+) create mode 100644 arch/arm/boot/dts/nvidia/tegra114-peripherals-opp.dtsi diff --git a/arch/arm/boot/dts/nvidia/tegra114-peripherals-opp.dtsi b/arch/= arm/boot/dts/nvidia/tegra114-peripherals-opp.dtsi new file mode 100644 index 000000000000..b40a1c24abab --- /dev/null +++ b/arch/arm/boot/dts/nvidia/tegra114-peripherals-opp.dtsi @@ -0,0 +1,164 @@ +// SPDX-License-Identifier: GPL-2.0 + +/ { + emc_icc_dvfs_opp_table: opp-table-emc { + compatible =3D "operating-points-v2"; + + opp-12750000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <12750000>; + opp-supported-hw =3D <0x000F>; + }; + + opp-20400000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <20400000>; + opp-supported-hw =3D <0x000F>; + }; + + opp-40800000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <40800000>; + opp-supported-hw =3D <0x000F>; + }; + + opp-68000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <68000000>; + opp-supported-hw =3D <0x000F>; + }; + + opp-102000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <102000000>; + opp-supported-hw =3D <0x000F>; + }; + + opp-204000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <204000000>; + opp-supported-hw =3D <0x000F>; + opp-suspend; + }; + + opp-312000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <312000000>; + opp-supported-hw =3D <0x000F>; + }; + + opp-408000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <408000000>; + opp-supported-hw =3D <0x000F>; + }; + + /* + * T40X can work with 1050mV for 528MHz but T40T which is + * in the same group as T40X requires 1100mV. If there will + * be enough data that T40T can work reliably with 1050mV + * for 528MHz then voltage for 528MHz opp can be lowered. + * T40S should remain with 1100mV for 528MHz opp. + */ + opp-528000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <528000000>; + opp-supported-hw =3D <0x000F>; + }; + + opp-624000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <624000000>; + opp-supported-hw =3D <0x000F>; + }; + + opp-792000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <792000000>; + opp-supported-hw =3D <0x000F>; + }; + + opp-900000000-1200 { + opp-microvolt =3D <1200000 1200000 1390000>; + opp-hz =3D /bits/ 64 <900000000>; + opp-supported-hw =3D <0x000E>; + }; + }; + + emc_bw_dfs_opp_table: opp-table-actmon { + compatible =3D "operating-points-v2"; + + opp-12750000 { + opp-hz =3D /bits/ 64 <12750000>; + opp-supported-hw =3D <0x000F>; + opp-peak-kBps =3D <204000>; + }; + + opp-20400000 { + opp-hz =3D /bits/ 64 <20400000>; + opp-supported-hw =3D <0x000F>; + opp-peak-kBps =3D <326400>; + }; + + opp-40800000 { + opp-hz =3D /bits/ 64 <40800000>; + opp-supported-hw =3D <0x000F>; + opp-peak-kBps =3D <652800>; + }; + + opp-68000000 { + opp-hz =3D /bits/ 64 <68000000>; + opp-supported-hw =3D <0x000F>; + opp-peak-kBps =3D <1088000>; + }; + + opp-102000000 { + opp-hz =3D /bits/ 64 <102000000>; + opp-supported-hw =3D <0x000F>; + opp-peak-kBps =3D <1632000>; + }; + + opp-204000000 { + opp-hz =3D /bits/ 64 <204000000>; + opp-supported-hw =3D <0x000F>; + opp-peak-kBps =3D <3264000>; + opp-suspend; + }; + + opp-312000000 { + opp-hz =3D /bits/ 64 <312000000>; + opp-supported-hw =3D <0x000F>; + opp-peak-kBps =3D <4992000>; + }; + + opp-408000000 { + opp-hz =3D /bits/ 64 <408000000>; + opp-supported-hw =3D <0x000F>; + opp-peak-kBps =3D <6528000>; + }; + + opp-528000000 { + opp-hz =3D /bits/ 64 <528000000>; + opp-supported-hw =3D <0x000F>; + opp-peak-kBps =3D <8448000>; + }; + + opp-624000000 { + opp-hz =3D /bits/ 64 <624000000>; + opp-supported-hw =3D <0x000F>; + opp-peak-kBps =3D <9984000>; + }; + + opp-792000000 { + opp-hz =3D /bits/ 64 <792000000>; + opp-supported-hw =3D <0x000F>; + opp-peak-kBps =3D <12672000>; + }; + + opp-900000000 { + opp-hz =3D /bits/ 64 <900000000>; + opp-supported-hw =3D <0x000E>; + opp-peak-kBps =3D <14400000>; + }; + }; +}; diff --git a/arch/arm/boot/dts/nvidia/tegra114.dtsi b/arch/arm/boot/dts/nvi= dia/tegra114.dtsi index 7e8f90d33935..6c2b79b35938 100644 --- a/arch/arm/boot/dts/nvidia/tegra114.dtsi +++ b/arch/arm/boot/dts/nvidia/tegra114.dtsi @@ -8,6 +8,8 @@ #include #include =20 +#include "tegra114-peripherals-opp.dtsi" + / { compatible =3D "nvidia,tegra114"; interrupt-parent =3D <&lic>; @@ -323,6 +325,9 @@ actmon: actmon@6000c800 { clock-names =3D "actmon", "emc"; resets =3D <&tegra_car TEGRA114_CLK_ACTMON>; reset-names =3D "actmon"; + operating-points-v2 =3D <&emc_bw_dfs_opp_table>; + interconnects =3D <&mc TEGRA114_MC_MPCORER &emc>; + interconnect-names =3D "cpu-read"; #cooling-cells =3D <2>; }; =20 @@ -655,6 +660,7 @@ mc: memory-controller@70019000 { =20 #reset-cells =3D <1>; #iommu-cells =3D <1>; + #interconnect-cells =3D <1>; }; =20 emc: external-memory-controller@7001b000 { @@ -665,6 +671,9 @@ emc: external-memory-controller@7001b000 { clock-names =3D "emc"; =20 nvidia,memory-controller =3D <&mc>; + operating-points-v2 =3D <&emc_icc_dvfs_opp_table>; + + #interconnect-cells =3D <0>; }; =20 hda@70030000 { --=20 2.51.0 From nobody Wed Jun 17 07:22:14 2026 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFD8F39281E for ; Mon, 27 Apr 2026 07:03:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777273428; cv=none; b=Le8/jwGeL/Pb0Axa5igfyyJse8YANTR88w/pX++LSAhtHElWaoCJRqQPdJDnpwFeZ8lmZaAIlQ1nh/ItDnvhxEjbn4rGH2tq9DhBngTyA8y8lfYzRbMpPZV60YjvTyVwfmKxuSp8iyr/83/hJBmCt+7LnKC7cqprftqUEmvsNnI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777273428; c=relaxed/simple; bh=83bu0e2hUCx0MiN45S3ruSGlLf0W0sVvbitldUzcJRk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qz3j5ItWts9f9BypPdIfCn70mtXpyl9ydilqrFAm+mN3EWChnxgvcWArTPphsWek3jCPTAdlu/0fpe+xdzUzgQIS4Tf8vOUVEIX2IGm4L3q2GxsBBx925USh60gmaA9pKg0J0462eTIRCbjmm2MbAtsDdXkm4LnomztiLxygC1A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Mapzlhba; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Mapzlhba" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-43cf8d550bdso8420686f8f.0 for ; Mon, 27 Apr 2026 00:03:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777273424; x=1777878224; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qiCb3qX1nnHHHaqbj7n6PWSc1bwd0jpS7OTapvME0fc=; b=MapzlhbaTlNeFXfTKmFjK8ctVTaOM201dZLg1NvYTw5lj7xVRf8Vij+Kg1eGd+Fk3q +P9jZf1mJDBJFekBa7jVeyY7zP6186Hj1zQEslebsgMj5bYZHsx//voezPQx+HqWIfu1 OMoRHjdTSvZKsyEUOOqY5aYKQsE2cOvxut1jrJDtMFNQGMb7sPivM+C0gN9v+5Dm/hDw XQxU7LC7A+AolzN7x9V/kBf4uknfK/K1cSe3wbHQ6NJDbIGipOaVFHrL0lCTKdC3PI0O P6FTL4ChOhWuy+1LXYMRfae4l6XBvHwthH1EgjQz/HsOx4PC7S/PhPe3usuzqa+hozDn zkBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777273424; x=1777878224; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=qiCb3qX1nnHHHaqbj7n6PWSc1bwd0jpS7OTapvME0fc=; b=PmmLFILPUiQNVghuzmcbtkXgJXv+d/Rvk7con4LVHQh48+E/ohMP1CVuWRVpbTeJz3 XgVCp098w5c1e/6xe+QE2k5cuUNc+cv/9PCVwlN46KcsgMKLKIoW0J0vW1gAGiBZwVfy A0D9zL7w+AqM6NtUCoVZhkzYjOVCT8ibEVo7yO79PuIk4FbIi7NDdkm5Q9P264ekYVcS oE9J9USGnhlmuCZcdCXycchflL77jfxjPQ1BgDQSWCER0RHps4fG0tCHv+Up5yYA0IGO TXgCN62U9TU4E1+0qmlt7Qm9PF+U7vXD2ahPRj/XSc/TfQxfeZMRqrIb2/PZUF2C12CT vHeg== X-Gm-Message-State: AOJu0YxGNZqWmDvns24tfRw8DlXp8K2kqxActdOjx+4rqMHtpMi9E56j Jym3PCfBaWVfafZUU8THURfI+HwXYMU76616O1wUHfH1HIF1x5f7M5coP1gS8SeP X-Gm-Gg: AeBDieuSmzIxxaFzrAqbktr1SSKZKnP1J69lWDIgyAJrs60yfoA1OkmUEMVHkbG5/Qh btRSmhhXlbY4e184Og1IuqZs+wLOWOE72GN+5l75x0S4t5gGgjkF2xuuviYIbBrxGwCmYjU3kHi vfkXURf7iywx7tsC2nqX5oewUeQS7E2f97RjU678x49O60s1UTDUSFo1lr9CJYIHWCmubELibHu sd3tsuFQWNCKCXPaFwLvDBhG2sZ7dxMtyRMUAP0mdbuONTxJISAM0ZohgxzfYUEg2uwBf51aFMP NjavZBnzoklyJOXiOoZ37118EAJSi+QfTQpc7Ms+4P6Z84Q5jAixo+Zzqd7w2tkik9/dTQ2YAE5 xxdC9sNhKKKHnjOFBhYjkNngjJ7zsVMPMc8EC5+Dt7fJ+N2akVQjJZel2RLM42sCKitKj/OC68B sho5WWcWeTqTC2o0SGDupa6LQ= X-Received: by 2002:a05:6000:2c0c:b0:43f:e22e:e8da with SMTP id ffacd0b85a97d-43fe3dc5b0bmr63597483f8f.5.1777273424009; Mon, 27 Apr 2026 00:03:44 -0700 (PDT) Received: from xeon ([188.163.112.56]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e3a341sm84245734f8f.24.2026.04.27.00.03.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 00:03:43 -0700 (PDT) From: Svyatoslav Ryhel To: Krzysztof Kozlowski , Rob Herring , Conor Dooley , Thierry Reding , Jonathan Hunter , Mikko Perttunen , Svyatoslav Ryhel Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH v2 6/7] ARM: tegra: Add DC interconnections for Tegra114 Date: Mon, 27 Apr 2026 10:03:11 +0300 Message-ID: <20260427070312.81679-7-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260427070312.81679-1-clamor95@gmail.com> References: <20260427070312.81679-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add DC interconnections to Tegra114 device tree to reflect connections between MC, EMC and DC. Signed-off-by: Svyatoslav Ryhel Reviewed-by: Mikko Perttunen --- arch/arm/boot/dts/nvidia/tegra114.dtsi | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm/boot/dts/nvidia/tegra114.dtsi b/arch/arm/boot/dts/nvi= dia/tegra114.dtsi index 6c2b79b35938..f46406b06a07 100644 --- a/arch/arm/boot/dts/nvidia/tegra114.dtsi +++ b/arch/arm/boot/dts/nvidia/tegra114.dtsi @@ -125,6 +125,17 @@ dc@54200000 { =20 nvidia,head =3D <0>; =20 + interconnects =3D <&mc TEGRA114_MC_DISPLAY0A &emc>, + <&mc TEGRA114_MC_DISPLAY0B &emc>, + <&mc TEGRA114_MC_DISPLAY1B &emc>, + <&mc TEGRA114_MC_DISPLAY0C &emc>, + <&mc TEGRA114_MC_DISPLAYHC &emc>; + interconnect-names =3D "wina", + "winb", + "winb-vfilter", + "winc", + "cursor"; + rgb { status =3D "disabled"; }; @@ -144,6 +155,17 @@ dc@54240000 { =20 nvidia,head =3D <1>; =20 + interconnects =3D <&mc TEGRA114_MC_DISPLAY0AB &emc>, + <&mc TEGRA114_MC_DISPLAY0BB &emc>, + <&mc TEGRA114_MC_DISPLAY1BB &emc>, + <&mc TEGRA114_MC_DISPLAY0CB &emc>, + <&mc TEGRA114_MC_DISPLAYHCB &emc>; + interconnect-names =3D "wina", + "winb", + "winb-vfilter", + "winc", + "cursor"; + rgb { status =3D "disabled"; }; --=20 2.51.0 From nobody Wed Jun 17 07:22:14 2026 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DDEB392837 for ; Mon, 27 Apr 2026 07:03:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777273431; cv=none; b=ieqfoRM/KzAthpF/NFQqRSci6X0/kqsfrGIy9vcBOboilGmcxvf8Lu6GkKO/QnPKWszWKrxTx0/m7YclSscRKDCR0bEeMOstV/S5ja9OmLR+ukSsa81XZAKJQKD+Udnn9wePmSlCoD1Wzs8Urub5GwEa2Ki45i3Ckgxh+EKIZHg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777273431; c=relaxed/simple; bh=qSrCgh+4XtSTHFKXkD55JTmBjh0D3a80fDw/cAmrMBw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ApfQNQ1bgyle+eOmeb8LRcswSQuY2+NDJaabLDVVsJsHHfVtDMwghRqexyxe7+I352eYzVa5tZO9AeH6B38NpA3AWvfPdyaSmuji7jsjs5Vc5We5IZUwXQyfe52HW4uRlJmlS+LpGRTw+xe+vv+3f5+rKcsYJNcJGIx1vUSq/as= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jwN9HcTg; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jwN9HcTg" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-43d64313c39so7736767f8f.3 for ; Mon, 27 Apr 2026 00:03:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777273425; x=1777878225; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=brRZaSzk1Ki4surz9OOhhrisdsM0eqG68gsLgN0ZC/w=; b=jwN9HcTg3WKMnqnkQi2zNDiaaMjGEW08bF47CFGGf4rkBFnMIFTT9HjmQZ18ZOn6Cr laRS9ydcdmRtm3puwxFGrfRIhE4mqugVYNwJPeMyxea+5z99tKMzbnU3h4pu489FH5NT rSRsnDCeDMhgp3ur89NyMLnjBLTBVjARgFI1btuAoNV/7O7n1mDsinK+vv14E+acUV+T OCTXv0pHm+7k2gLaS2S1CLBvRPJ5H0el+94leKSK6E1qLtibfNVJWSCPYzf6eOc9+Zgd b7h2QuMUIbBsRyeyTuHJk5y9zA51AdxBJZw+8wtt9nEHdD+BWdRBXM3xUMpL69ZyC6pW w1WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777273425; x=1777878225; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=brRZaSzk1Ki4surz9OOhhrisdsM0eqG68gsLgN0ZC/w=; b=NQRgCL0EQzGwIJ/90V7jIXRsEPrljkx9UbZvawSeLFwCTsFF7+P/8j7kv7A3meeDnq aboQro2UxPTP8/YvcXfRXu8j9FNLNryGvfm7A15R9d3EkS1vqEPRCM3p6nSOv4NlvSGY UTEdWcIDYlpd/xEXSkf7KSZn2SV6HmN0KYmqSjzQXzrI9pyAwZqfrXDl4nBFTM2cWg85 82SUeVjh2qt3OB1MpZKexZQrHCz+mWQbSS0QV0PXXx2gsgidfHPgFxbJeuoxpg1lCEgm NwQdb/bEVIZuB0nAAXMIIXP1ckq9PR6rGeQaJ7yak/oU2wBUW9lgeQtUC7RcK/JNo+IN WJpg== X-Gm-Message-State: AOJu0YwG6vIfJCwnsTy2p7tCm+9kIf6g6dDxJXTJW/EAhB/T6PITkdlj MEFep+MoJ9WoRj7RE2oruSjFLZfj+OzYRl7IaONbigzlMP8ETqWOliyu X-Gm-Gg: AeBDietXojoYIWdTeoz9snET6gvUf9YUP6nooGmMBzTX3ob+wmYmrb7Kb+f+yeRsi44 zgu5W+J5I5qKBevCpbLLJ8syF17IqNFkGfxueEfabvk3LUeIcR9enIvoL3wnfnR7xvTqb/RBvcg Ps8GYhSgJa46bxVmIupts3F53yjR9Q9/7iqnRvo1J0IZuPrWo42TfmKi5VksjMDT+8PQvHBqHjc jQQ0ZIJCiwK8BVlt+SELXoJRWWC9GXbXjpfJAzrxmKi7/PBD2FVQPLyOLoDQCFzYAdRS64XjHPw iQbDn4ovMXr6mhl4+tTjnXPAcWKx5iIiWVuSFoveSADU3rpOwktSzXF+VxAibri4VnBD4qg4cjt 5Dlj2y69U8gWHDyex2dL/ga26PAUoobEM9zVowzZRVS6dqByUjH7pi8lEZVsaB8If3W2F7oNtAT l6D4XGJrR4jGlEpOGJv/El6hHouj8MDM26gg== X-Received: by 2002:a05:6000:2dc4:b0:441:37b5:fc04 with SMTP id ffacd0b85a97d-44137b5fc4amr13855964f8f.14.1777273425028; Mon, 27 Apr 2026 00:03:45 -0700 (PDT) Received: from xeon ([188.163.112.56]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e3a341sm84245734f8f.24.2026.04.27.00.03.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 00:03:44 -0700 (PDT) From: Svyatoslav Ryhel To: Krzysztof Kozlowski , Rob Herring , Conor Dooley , Thierry Reding , Jonathan Hunter , Mikko Perttunen , Svyatoslav Ryhel Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH v2 7/7] ARM: tegra: Configure Tegra114 power domains Date: Mon, 27 Apr 2026 10:03:12 +0300 Message-ID: <20260427070312.81679-8-clamor95@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260427070312.81679-1-clamor95@gmail.com> References: <20260427070312.81679-1-clamor95@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add power domains found in Tegra114 and configure operating-points-v2 for supported devices accordingly. Signed-off-by: Svyatoslav Ryhel Reviewed-by: Mikko Perttunen --- .../dts/nvidia/tegra114-peripherals-opp.dtsi | 1275 +++++++++++++++++ arch/arm/boot/dts/nvidia/tegra114.dtsi | 126 ++ 2 files changed, 1401 insertions(+) diff --git a/arch/arm/boot/dts/nvidia/tegra114-peripherals-opp.dtsi b/arch/= arm/boot/dts/nvidia/tegra114-peripherals-opp.dtsi index b40a1c24abab..bab6122dba48 100644 --- a/arch/arm/boot/dts/nvidia/tegra114-peripherals-opp.dtsi +++ b/arch/arm/boot/dts/nvidia/tegra114-peripherals-opp.dtsi @@ -1,6 +1,76 @@ // SPDX-License-Identifier: GPL-2.0 =20 / { + core_opp_table: opp-table-core { + compatible =3D "operating-points-v2"; + opp-shared; + + core_opp_900: opp-900000 { + opp-microvolt =3D <900000 900000 1390000>; + opp-level =3D <900000>; + }; + + core_opp_950: opp-950000 { + opp-microvolt =3D <950000 950000 1390000>; + opp-level =3D <950000>; + }; + + core_opp_1000: opp-1000000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-level =3D <1000000>; + }; + + core_opp_1050: opp-1050000 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-level =3D <1050000>; + }; + + core_opp_1100: opp-1100000 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-level =3D <1100000>; + }; + + core_opp_1120: opp-1120000 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-level =3D <1120000>; + }; + + core_opp_1150: opp-1150000 { + opp-microvolt =3D <1150000 1150000 1390000>; + opp-level =3D <1150000>; + }; + + core_opp_1170: opp-1170000 { + opp-microvolt =3D <1170000 1170000 1390000>; + opp-level =3D <1170000>; + }; + + core_opp_1200: opp-1200000 { + opp-microvolt =3D <1200000 1200000 1390000>; + opp-level =3D <1200000>; + }; + + core_opp_1250: opp-1250000 { + opp-microvolt =3D <1250000 1250000 1390000>; + opp-level =3D <1250000>; + }; + + core_opp_1300: opp-1300000 { + opp-microvolt =3D <1300000 1300000 1390000>; + opp-level =3D <1300000>; + }; + + core_opp_1350: opp-1350000 { + opp-microvolt =3D <1350000 1350000 1390000>; + opp-level =3D <1350000>; + }; + + core_opp_1390: opp-1390000 { + opp-microvolt =3D <1390000 1390000 1390000>; + opp-level =3D <1390000>; + }; + }; + emc_icc_dvfs_opp_table: opp-table-emc { compatible =3D "operating-points-v2"; =20 @@ -8,36 +78,42 @@ opp-12750000-900 { opp-microvolt =3D <900000 900000 1390000>; opp-hz =3D /bits/ 64 <12750000>; opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; }; =20 opp-20400000-900 { opp-microvolt =3D <900000 900000 1390000>; opp-hz =3D /bits/ 64 <20400000>; opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; }; =20 opp-40800000-900 { opp-microvolt =3D <900000 900000 1390000>; opp-hz =3D /bits/ 64 <40800000>; opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; }; =20 opp-68000000-900 { opp-microvolt =3D <900000 900000 1390000>; opp-hz =3D /bits/ 64 <68000000>; opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; }; =20 opp-102000000-900 { opp-microvolt =3D <900000 900000 1390000>; opp-hz =3D /bits/ 64 <102000000>; opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; }; =20 opp-204000000-900 { opp-microvolt =3D <900000 900000 1390000>; opp-hz =3D /bits/ 64 <204000000>; opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; opp-suspend; }; =20 @@ -45,12 +121,14 @@ opp-312000000-1000 { opp-microvolt =3D <1000000 1000000 1390000>; opp-hz =3D /bits/ 64 <312000000>; opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1000>; }; =20 opp-408000000-1000 { opp-microvolt =3D <1000000 1000000 1390000>; opp-hz =3D /bits/ 64 <408000000>; opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1000>; }; =20 /* @@ -64,24 +142,28 @@ opp-528000000-1100 { opp-microvolt =3D <1100000 1100000 1390000>; opp-hz =3D /bits/ 64 <528000000>; opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1100>; }; =20 opp-624000000-1100 { opp-microvolt =3D <1100000 1100000 1390000>; opp-hz =3D /bits/ 64 <624000000>; opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1100>; }; =20 opp-792000000-1100 { opp-microvolt =3D <1100000 1100000 1390000>; opp-hz =3D /bits/ 64 <792000000>; opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1100>; }; =20 opp-900000000-1200 { opp-microvolt =3D <1200000 1200000 1390000>; opp-hz =3D /bits/ 64 <900000000>; opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1200>; }; }; =20 @@ -161,4 +243,1197 @@ opp-900000000 { opp-peak-kBps =3D <14400000>; }; }; + + vi_dvfs_opp_table: opp-table-vi { + compatible =3D "operating-points-v2"; + + opp-114000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <114000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; + }; + + opp-216000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <216000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_950>; + }; + + opp-240000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <240000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1000>; + }; + + opp-312000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <312000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1050>; + }; + + opp-372000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <372000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1100>; + }; + + opp-408000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <408000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1050>; + }; + + opp-408000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <408000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1120>; + }; + }; + + epp_dvfs_opp_table: opp-table-epp { + compatible =3D "operating-points-v2"; + + opp-192000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <192000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_900>; + }; + + opp-240000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <240000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_900>; + }; + + opp-228000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <228000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_950>; + }; + + opp-300000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <300000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_950>; + }; + + opp-300000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <300000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1000>; + }; + + opp-384000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <384000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1000>; + }; + + opp-396000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <396000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1050>; + }; + + opp-468000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <468000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1050>; + }; + + opp-492000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <492000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1100>; + }; + + opp-528000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <528000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1100>; + }; + + opp-516000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <516000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1120>; + }; + + opp-564000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <564000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1120>; + }; + + opp-552000000-1170 { + opp-microvolt =3D <1170000 1170000 1390000>; + opp-hz =3D /bits/ 64 <552000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1170>; + }; + + opp-600000000-1170 { + opp-microvolt =3D <1170000 1170000 1390000>; + opp-hz =3D /bits/ 64 <600000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1170>; + }; + + opp-600000000-1250 { + opp-microvolt =3D <1250000 1250000 1390000>; + opp-hz =3D /bits/ 64 <600000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1250>; + }; + + opp-636000000-1200 { + opp-microvolt =3D <1200000 1200000 1390000>; + opp-hz =3D /bits/ 64 <636000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1200>; + }; + + opp-672000000-1250 { + opp-microvolt =3D <1250000 1250000 1390000>; + opp-hz =3D /bits/ 64 <672000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1250>; + }; + + opp-828000000-1390 { + opp-microvolt =3D <1390000 1390000 1390000>; + opp-hz =3D /bits/ 64 <828000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1390>; + }; + }; + + gr2d_dvfs_opp_table: opp-table-gr2d { + compatible =3D "operating-points-v2"; + + opp-192000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <192000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_900>; + }; + + opp-240000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <240000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_900>; + }; + + opp-228000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <228000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_950>; + }; + + opp-300000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <300000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_950>; + }; + + opp-300000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <300000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1000>; + }; + + opp-384000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <384000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1000>; + }; + + opp-396000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <396000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1050>; + }; + + opp-468000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <468000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1050>; + }; + + opp-492000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <492000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1100>; + }; + + opp-528000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <528000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1100>; + }; + + opp-516000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <516000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1120>; + }; + + opp-564000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <564000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1120>; + }; + + opp-552000000-1170 { + opp-microvolt =3D <1170000 1170000 1390000>; + opp-hz =3D /bits/ 64 <552000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1170>; + }; + + opp-600000000-1170 { + opp-microvolt =3D <1170000 1170000 1390000>; + opp-hz =3D /bits/ 64 <600000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1170>; + }; + + opp-600000000-1250 { + opp-microvolt =3D <1250000 1250000 1390000>; + opp-hz =3D /bits/ 64 <600000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1250>; + }; + + opp-636000000-1200 { + opp-microvolt =3D <1200000 1200000 1390000>; + opp-hz =3D /bits/ 64 <636000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1200>; + }; + + opp-672000000-1250 { + opp-microvolt =3D <1250000 1250000 1390000>; + opp-hz =3D /bits/ 64 <672000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1250>; + }; + + opp-828000000-1390 { + opp-microvolt =3D <1390000 1390000 1390000>; + opp-hz =3D /bits/ 64 <828000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1390>; + }; + }; + + gr3d_dvfs_opp_table: opp-table-gr3d { + compatible =3D "operating-points-v2"; + + opp-192000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <192000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_900>; + }; + + opp-240000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <240000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_900>; + }; + + opp-228000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <228000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_950>; + }; + + opp-300000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <300000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_950>; + }; + + opp-300000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <300000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1000>; + }; + + opp-384000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <384000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1000>; + }; + + opp-396000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <396000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1050>; + }; + + opp-468000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <468000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1050>; + }; + + opp-492000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <492000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1100>; + }; + + opp-528000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <528000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1100>; + }; + + opp-516000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <516000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1120>; + }; + + opp-564000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <564000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1120>; + }; + + opp-552000000-1170 { + opp-microvolt =3D <1170000 1170000 1390000>; + opp-hz =3D /bits/ 64 <552000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1170>; + }; + + opp-600000000-1170 { + opp-microvolt =3D <1170000 1170000 1390000>; + opp-hz =3D /bits/ 64 <600000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1170>; + }; + + opp-600000000-1250 { + opp-microvolt =3D <1250000 1250000 1390000>; + opp-hz =3D /bits/ 64 <600000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1250>; + }; + + opp-636000000-1200 { + opp-microvolt =3D <1200000 1200000 1390000>; + opp-hz =3D /bits/ 64 <636000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1200>; + }; + + opp-672000000-1250 { + opp-microvolt =3D <1250000 1250000 1390000>; + opp-hz =3D /bits/ 64 <672000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1250>; + }; + + opp-828000000-1390 { + opp-microvolt =3D <1390000 1390000 1390000>; + opp-hz =3D /bits/ 64 <828000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1390>; + }; + }; + + msenc_dvfs_opp_table: opp-table-msenc { + compatible =3D "operating-points-v2"; + + opp-144000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <144000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_900>; + }; + + opp-182000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <182000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_950>; + }; + + opp-204000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <204000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_900>; + }; + + opp-240000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <240000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1000>; + }; + + opp-252000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <252000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_950>; + }; + + opp-312000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <312000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1050>; + }; + + opp-324000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <324000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1000>; + }; + + opp-384000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <384000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1100>; + }; + + opp-408000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <408000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1050>; + }; + + opp-432000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <432000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1120>; + }; + + opp-456000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <456000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1100>; + }; + + opp-480000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <480000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1120>; + }; + + opp-480000000-1170 { + opp-microvolt =3D <1170000 1170000 1390000>; + opp-hz =3D /bits/ 64 <480000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1170>; + }; + }; + + tsec_dvfs_opp_table: opp-table-tsec { + compatible =3D "operating-points-v2"; + + opp-144000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <144000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_900>; + }; + + opp-182000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <182000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_950>; + }; + + opp-204000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <204000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_900>; + }; + + opp-240000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <240000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1000>; + }; + + opp-252000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <252000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_950>; + }; + + opp-312000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <312000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1050>; + }; + + opp-324000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <324000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1000>; + }; + + opp-384000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <384000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1100>; + }; + + opp-408000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <408000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1050>; + }; + + opp-432000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <432000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1120>; + }; + + opp-456000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <456000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1100>; + }; + + opp-480000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <480000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1120>; + }; + + opp-480000000-1170 { + opp-microvolt =3D <1170000 1170000 1390000>; + opp-hz =3D /bits/ 64 <480000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1170>; + }; + }; + + vde_dvfs_opp_table: opp-table-vde { + compatible =3D "operating-points-v2"; + + opp-144000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <144000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_900>; + }; + + opp-182000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <182000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_950>; + }; + + opp-204000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <204000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_900>; + }; + + opp-240000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <240000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1000>; + }; + + opp-252000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <252000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_950>; + }; + + opp-312000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <312000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1050>; + }; + + opp-324000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <324000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1000>; + }; + + opp-384000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <384000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1100>; + }; + + opp-408000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <408000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1050>; + }; + + opp-432000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <432000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1120>; + }; + + opp-456000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <456000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1100>; + }; + + opp-480000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <480000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1120>; + }; + + opp-480000000-1170 { + opp-microvolt =3D <1170000 1170000 1390000>; + opp-hz =3D /bits/ 64 <480000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1170>; + }; + }; + + host1x_dvfs_opp_table: opp-table-host1x { + compatible =3D "operating-points-v2"; + + opp-144000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <144000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_900>; + }; + + opp-180000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <180000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_900>; + }; + + opp-188000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <188000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_950>; + }; + + opp-228000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <228000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_950>; + }; + + opp-240000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <240000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1000>; + }; + + opp-276000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <276000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1000>; + }; + + opp-276000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <276000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1050>; + }; + + opp-324000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <324000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1100>; + }; + + opp-336000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <336000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1050>; + }; + + opp-336000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <336000000>; + opp-supported-hw =3D <0x0001>; + required-opps =3D <&core_opp_1120>; + }; + + opp-372000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <372000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1100>; + }; + + opp-384000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <384000000>; + opp-supported-hw =3D <0x000E>; + required-opps =3D <&core_opp_1120>; + }; + }; + + pll_m_dvfs_opp_table: opp-table-pllm { + compatible =3D "operating-points-v2"; + + opp-800000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <800000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; + }; + + opp-1066000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <1066000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1000>; + }; + }; + + pll_c_dvfs_opp_table: opp-table-pllc { + compatible =3D "operating-points-v2"; + + opp-800000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <800000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; + }; + + opp-1066000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <1066000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1000>; + }; + }; + + pll_c2_dvfs_opp_table: opp-table-pllc2 { + compatible =3D "operating-points-v2"; + + opp-800000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <800000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; + }; + + opp-1066000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <1066000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1000>; + }; + }; + + pll_c3_dvfs_opp_table: opp-table-pllc3 { + compatible =3D "operating-points-v2"; + + opp-800000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <800000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; + }; + + opp-1066000000-1000 { + opp-microvolt =3D <1000000 1000000 1390000>; + opp-hz =3D /bits/ 64 <1066000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1000>; + }; + }; + + sbc1_dvfs_opp_table: opp-table-sbc1 { + compatible =3D "operating-points-v2"; + + opp-48000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <48000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; + }; + + opp-52000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <52000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1100>; + }; + }; + + sbc2_dvfs_opp_table: opp-table-sbc2 { + compatible =3D "operating-points-v2"; + + opp-48000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <48000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; + }; + + opp-52000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <52000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1100>; + }; + }; + + sbc3_dvfs_opp_table: opp-table-sbc3 { + compatible =3D "operating-points-v2"; + + opp-48000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <48000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; + }; + + opp-52000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <52000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1100>; + }; + }; + + sbc4_dvfs_opp_table: opp-table-sbc4 { + compatible =3D "operating-points-v2"; + + opp-48000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <48000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; + }; + + opp-52000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <52000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1100>; + }; + }; + + sbc5_dvfs_opp_table: opp-table-sbc5 { + compatible =3D "operating-points-v2"; + + opp-48000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <48000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; + }; + + opp-52000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <52000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1100>; + }; + }; + + sbc6_dvfs_opp_table: opp-table-sbc6 { + compatible =3D "operating-points-v2"; + + opp-48000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <48000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; + }; + + opp-52000000-1100 { + opp-microvolt =3D <1100000 1100000 1390000>; + opp-hz =3D /bits/ 64 <52000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1100>; + }; + }; + + sdmmc1_dvfs_opp_table: opp-table-sdmmc1 { + compatible =3D "operating-points-v2"; + + opp-81600000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <81600000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_950>; + }; + + opp-156000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <156000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1120>; + }; + + opp-204000000-1250 { + opp-microvolt =3D <1250000 1250000 1390000>; + opp-hz =3D /bits/ 64 <204000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1250>; + }; + }; + + sdmmc3_dvfs_opp_table: opp-table-sdmmc3 { + compatible =3D "operating-points-v2"; + + opp-81600000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <81600000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_950>; + }; + + opp-156000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <156000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1120>; + }; + + opp-204000000-1250 { + opp-microvolt =3D <1250000 1250000 1390000>; + opp-hz =3D /bits/ 64 <204000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1250>; + }; + }; + + sdmmc4_dvfs_opp_table: opp-table-sdmmc4 { + compatible =3D "operating-points-v2"; + + opp-81600000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <81600000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_950>; + }; + + opp-156000000-1120 { + opp-microvolt =3D <1120000 1120000 1390000>; + opp-hz =3D /bits/ 64 <156000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1120>; + }; + + opp-200000000-1250 { + opp-microvolt =3D <1250000 1250000 1390000>; + opp-hz =3D /bits/ 64 <200000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1250>; + }; + }; + + hdmi_dvfs_opp_table: opp-table-hdmi { + compatible =3D "operating-points-v2"; + + opp-148500000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <148500000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; + }; + + opp-297000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <297000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1050>; + }; + }; + + disp1_dvfs_opp_table: opp-table-disp1 { + compatible =3D "operating-points-v2"; + + opp-166000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <166000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; + }; + + opp-297000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <297000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1050>; + }; + }; + + disp2_dvfs_opp_table: opp-table-disp2 { + compatible =3D "operating-points-v2"; + + opp-166000000-900 { + opp-microvolt =3D <900000 900000 1390000>; + opp-hz =3D /bits/ 64 <166000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_900>; + }; + + opp-297000000-1050 { + opp-microvolt =3D <1050000 1050000 1390000>; + opp-hz =3D /bits/ 64 <297000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_1050>; + }; + }; + + xusb_falcon_dvfs_opp_table: opp-table-xusb-falcon { + compatible =3D "operating-points-v2"; + + opp-336000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <336000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_950>; + }; + }; + + xusb_host_dvfs_opp_table: opp-table-xusb-host { + compatible =3D "operating-points-v2"; + + opp-112000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <112000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_950>; + }; + }; + + xusb_dev_dvfs_opp_table: opp-table-xusb-dev { + compatible =3D "operating-points-v2"; + + opp-58300000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <58300000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_950>; + }; + }; + + xusb_ss_dvfs_opp_table: opp-table-xusb-ss { + compatible =3D "operating-points-v2"; + + opp-122400000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <122400000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_950>; + }; + }; + + xusb_fs_dvfs_opp_table: opp-table-xusb-fs { + compatible =3D "operating-points-v2"; + + opp-48000000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <48000000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_950>; + }; + }; + + xusb_hs_dvfs_opp_table: opp-table-xusb-hs { + compatible =3D "operating-points-v2"; + + opp-61200000-950 { + opp-microvolt =3D <950000 950000 1390000>; + opp-hz =3D /bits/ 64 <61200000>; + opp-supported-hw =3D <0x000F>; + required-opps =3D <&core_opp_950>; + }; + }; + + /* Add usbd, usb2 and usb3 opp tables if needed */ }; diff --git a/arch/arm/boot/dts/nvidia/tegra114.dtsi b/arch/arm/boot/dts/nvi= dia/tegra114.dtsi index f46406b06a07..a5958f3a965b 100644 --- a/arch/arm/boot/dts/nvidia/tegra114.dtsi +++ b/arch/arm/boot/dts/nvidia/tegra114.dtsi @@ -58,6 +58,8 @@ vi@54080000 { clocks =3D <&tegra_car TEGRA114_CLK_VI>; resets =3D <&tegra_car 20>; reset-names =3D "vi"; + power-domains =3D <&pd_venc>; + operating-points-v2 =3D <&vi_dvfs_opp_table>; =20 iommus =3D <&mc TEGRA_SWGROUP_VI>; =20 @@ -71,6 +73,8 @@ epp@540c0000 { clocks =3D <&tegra_car TEGRA114_CLK_EPP>; resets =3D <&tegra_car TEGRA114_CLK_EPP>; reset-names =3D "epp"; + power-domains =3D <&pd_heg>; + operating-points-v2 =3D <&epp_dvfs_opp_table>; =20 iommus =3D <&mc TEGRA_SWGROUP_EPP>; =20 @@ -84,6 +88,7 @@ isp@54100000 { clocks =3D <&tegra_car TEGRA114_CLK_ISP>; resets =3D <&tegra_car TEGRA114_CLK_ISP>; reset-names =3D "isp"; + power-domains =3D <&pd_venc>; =20 iommus =3D <&mc TEGRA_SWGROUP_ISP>; =20 @@ -97,6 +102,8 @@ gr2d@54140000 { clocks =3D <&tegra_car TEGRA114_CLK_GR2D>; resets =3D <&tegra_car 21>, <&mc TEGRA114_MC_RESET_2D>; reset-names =3D "2d", "mc"; + power-domains =3D <&pd_heg>; + operating-points-v2 =3D <&gr2d_dvfs_opp_table>; =20 iommus =3D <&mc TEGRA_SWGROUP_G2>; }; @@ -107,6 +114,8 @@ gr3d@54180000 { clocks =3D <&tegra_car TEGRA114_CLK_GR3D>; resets =3D <&tegra_car 24>, <&mc TEGRA114_MC_RESET_3D>; reset-names =3D "3d", "mc"; + power-domains =3D <&pd_3d>; + operating-points-v2 =3D <&gr3d_dvfs_opp_table>; =20 iommus =3D <&mc TEGRA_SWGROUP_NV>; }; @@ -120,6 +129,8 @@ dc@54200000 { clock-names =3D "dc", "parent"; resets =3D <&tegra_car 27>; reset-names =3D "dc"; + power-domains =3D <&pd_core>; + operating-points-v2 =3D <&disp1_dvfs_opp_table>; =20 iommus =3D <&mc TEGRA_SWGROUP_DC>; =20 @@ -150,6 +161,8 @@ dc@54240000 { clock-names =3D "dc", "parent"; resets =3D <&tegra_car 26>; reset-names =3D "dc"; + power-domains =3D <&pd_core>; + operating-points-v2 =3D <&disp2_dvfs_opp_table>; =20 iommus =3D <&mc TEGRA_SWGROUP_DCB>; =20 @@ -180,6 +193,8 @@ hdmi@54280000 { clock-names =3D "hdmi", "parent"; resets =3D <&tegra_car 51>; reset-names =3D "hdmi"; + power-domains =3D <&pd_core>; + operating-points-v2 =3D <&hdmi_dvfs_opp_table>; status =3D "disabled"; }; =20 @@ -193,6 +208,7 @@ dsia: dsi@54300000 { resets =3D <&tegra_car 48>; reset-names =3D "dsi"; nvidia,mipi-calibrate =3D <&mipi 0x060>; /* DSIA & DSIB pads */ + power-domains =3D <&pd_core>; status =3D "disabled"; =20 #address-cells =3D <1>; @@ -209,6 +225,7 @@ dsib: dsi@54400000 { resets =3D <&tegra_car 82>; reset-names =3D "dsi"; nvidia,mipi-calibrate =3D <&mipi 0x180>; /* DSIC & DSID pads */ + power-domains =3D <&pd_core>; status =3D "disabled"; =20 #address-cells =3D <1>; @@ -222,6 +239,8 @@ msenc@544c0000 { clocks =3D <&tegra_car TEGRA114_CLK_MSENC>; resets =3D <&tegra_car TEGRA114_CLK_MSENC>; reset-names =3D "mpe"; + power-domains =3D <&pd_mpe>; + operating-points-v2 =3D <&msenc_dvfs_opp_table>; =20 iommus =3D <&mc TEGRA_SWGROUP_MSENC>; =20 @@ -234,6 +253,8 @@ tsec@54500000 { interrupts =3D ; clocks =3D <&tegra_car TEGRA114_CLK_TSEC>; resets =3D <&tegra_car TEGRA114_CLK_TSEC>; + power-domains =3D <&pd_core>; + operating-points-v2 =3D <&tsec_dvfs_opp_table>; =20 iommus =3D <&mc TEGRA_SWGROUP_TSEC>; =20 @@ -393,6 +414,8 @@ vde@6001a000 { reset-names =3D "vde", "mc"; resets =3D <&tegra_car 61>, <&mc TEGRA114_MC_RESET_VDE>; iommus =3D <&mc TEGRA_SWGROUP_VDE>; + power-domains =3D <&pd_vde>; + operating-points-v2 =3D <&vde_dvfs_opp_table>; }; =20 apbmisc@70000800 { @@ -470,6 +493,7 @@ pwm: pwm@7000a000 { clocks =3D <&tegra_car TEGRA114_CLK_PWM>; resets =3D <&tegra_car 17>; reset-names =3D "pwm"; + power-domains =3D <&pd_core>; status =3D "disabled"; }; =20 @@ -560,6 +584,8 @@ spi@7000d400 { reset-names =3D "spi"; dmas =3D <&apbdma 15>, <&apbdma 15>; dma-names =3D "rx", "tx"; + power-domains =3D <&pd_core>; + operating-points-v2 =3D <&sbc1_dvfs_opp_table>; status =3D "disabled"; }; =20 @@ -575,6 +601,8 @@ spi@7000d600 { reset-names =3D "spi"; dmas =3D <&apbdma 16>, <&apbdma 16>; dma-names =3D "rx", "tx"; + power-domains =3D <&pd_core>; + operating-points-v2 =3D <&sbc2_dvfs_opp_table>; status =3D "disabled"; }; =20 @@ -590,6 +618,8 @@ spi@7000d800 { reset-names =3D "spi"; dmas =3D <&apbdma 17>, <&apbdma 17>; dma-names =3D "rx", "tx"; + power-domains =3D <&pd_core>; + operating-points-v2 =3D <&sbc3_dvfs_opp_table>; status =3D "disabled"; }; =20 @@ -605,6 +635,8 @@ spi@7000da00 { reset-names =3D "spi"; dmas =3D <&apbdma 18>, <&apbdma 18>; dma-names =3D "rx", "tx"; + power-domains =3D <&pd_core>; + operating-points-v2 =3D <&sbc4_dvfs_opp_table>; status =3D "disabled"; }; =20 @@ -620,6 +652,8 @@ spi@7000dc00 { reset-names =3D "spi"; dmas =3D <&apbdma 27>, <&apbdma 27>; dma-names =3D "rx", "tx"; + power-domains =3D <&pd_core>; + operating-points-v2 =3D <&sbc5_dvfs_opp_table>; status =3D "disabled"; }; =20 @@ -635,6 +669,8 @@ spi@7000de00 { reset-names =3D "spi"; dmas =3D <&apbdma 28>, <&apbdma 28>; dma-names =3D "rx", "tx"; + power-domains =3D <&pd_core>; + operating-points-v2 =3D <&sbc6_dvfs_opp_table>; status =3D "disabled"; }; =20 @@ -661,6 +697,86 @@ tegra_pmc: pmc@7000e400 { clocks =3D <&tegra_car TEGRA114_CLK_PCLK>, <&clk32k_in>; clock-names =3D "pclk", "clk32k_in"; #clock-cells =3D <1>; + + pd_core: core-domain { + #power-domain-cells =3D <0>; + operating-points-v2 =3D <&core_opp_table>; + }; + + powergates { + /* + * TODO: Add DIS and DISB domains once DC is able + * to handle them properly. VENC and DISB should + * set DIS as their source power domain due to + * internal dependency. + */ + + pd_heg: heg { + clocks =3D <&tegra_car TEGRA114_CLK_GR2D>, + <&tegra_car TEGRA114_CLK_EPP>; + resets =3D <&mc TEGRA114_MC_RESET_2D>, + <&mc TEGRA114_MC_RESET_EPP>, + <&tegra_car TEGRA114_CLK_GR2D>, + <&tegra_car TEGRA114_CLK_EPP>; + power-domains =3D <&pd_core>; + #power-domain-cells =3D <0>; + }; + + pd_mpe: mpe { + clocks =3D <&tegra_car TEGRA114_CLK_MSENC>; + resets =3D <&mc TEGRA114_MC_RESET_MPE>, + <&tegra_car TEGRA114_CLK_MSENC>; + power-domains =3D <&pd_core>; + #power-domain-cells =3D <0>; + }; + + pd_3d: td { + clocks =3D <&tegra_car TEGRA114_CLK_GR3D>; + resets =3D <&mc TEGRA114_MC_RESET_3D>, + <&tegra_car TEGRA114_CLK_GR3D>; + power-domains =3D <&pd_core>; + #power-domain-cells =3D <0>; + }; + + pd_vde: vdec { + clocks =3D <&tegra_car TEGRA114_CLK_VDE>; + resets =3D <&mc TEGRA114_MC_RESET_VDE>, + <&tegra_car TEGRA114_CLK_VDE>; + power-domains =3D <&pd_core>; + #power-domain-cells =3D <0>; + }; + + pd_venc: venc { + clocks =3D <&tegra_car TEGRA114_CLK_ISP>, + <&tegra_car TEGRA114_CLK_VI>, + <&tegra_car TEGRA114_CLK_CSI>; + resets =3D <&mc TEGRA114_MC_RESET_ISP>, + <&mc TEGRA114_MC_RESET_VI>, + <&tegra_car TEGRA114_CLK_ISP>, + <&tegra_car 20 /* VI */>, + <&tegra_car TEGRA114_CLK_CSI>; + power-domains =3D <&pd_core>; + #power-domain-cells =3D <0>; + }; + + pd_xusbss: xusba { + clocks =3D <&tegra_car TEGRA114_CLK_XUSB_SS>; + resets =3D <&tegra_car TEGRA114_CLK_XUSB_SS>; + #power-domain-cells =3D <0>; + }; + + pd_xusbdev: xusbb { + clocks =3D <&tegra_car TEGRA114_CLK_XUSB_DEV>; + resets =3D <&tegra_car 95>; + #power-domain-cells =3D <0>; + }; + + pd_xusbhost: xusbc { + clocks =3D <&tegra_car TEGRA114_CLK_XUSB_HOST>; + resets =3D <&tegra_car TEGRA114_CLK_XUSB_HOST>; + #power-domain-cells =3D <0>; + }; + }; }; =20 fuse@7000f800 { @@ -670,6 +786,7 @@ fuse@7000f800 { clock-names =3D "fuse"; resets =3D <&tegra_car 39>; reset-names =3D "fuse"; + power-domains =3D <&pd_core>; }; =20 mc: memory-controller@70019000 { @@ -691,6 +808,7 @@ emc: external-memory-controller@7001b000 { interrupts =3D ; clocks =3D <&tegra_car TEGRA114_CLK_EMC>; clock-names =3D "emc"; + power-domains =3D <&pd_core>; =20 nvidia,memory-controller =3D <&mc>; operating-points-v2 =3D <&emc_icc_dvfs_opp_table>; @@ -885,6 +1003,8 @@ mmc@78000000 { clock-names =3D "sdhci"; resets =3D <&tegra_car 14>; reset-names =3D "sdhci"; + power-domains =3D <&pd_core>; + operating-points-v2 =3D <&sdmmc1_dvfs_opp_table>; status =3D "disabled"; }; =20 @@ -907,6 +1027,8 @@ mmc@78000400 { clock-names =3D "sdhci"; resets =3D <&tegra_car 69>; reset-names =3D "sdhci"; + power-domains =3D <&pd_core>; + operating-points-v2 =3D <&sdmmc3_dvfs_opp_table>; status =3D "disabled"; }; =20 @@ -918,6 +1040,8 @@ mmc@78000600 { clock-names =3D "sdhci"; resets =3D <&tegra_car 15>; reset-names =3D "sdhci"; + power-domains =3D <&pd_core>; + operating-points-v2 =3D <&sdmmc4_dvfs_opp_table>; status =3D "disabled"; }; =20 @@ -930,6 +1054,7 @@ usb@7d000000 { resets =3D <&tegra_car 22>; reset-names =3D "usb"; nvidia,phy =3D <&phy1>; + power-domains =3D <&pd_core>; status =3D "disabled"; }; =20 @@ -970,6 +1095,7 @@ usb@7d008000 { resets =3D <&tegra_car 59>; reset-names =3D "usb"; nvidia,phy =3D <&phy3>; + power-domains =3D <&pd_core>; status =3D "disabled"; }; =20 --=20 2.51.0