Commit Graph

13 Commits

Author SHA1 Message Date
Ketan Patil
1cfbb80f3c platform: tegra: mc-utils: Enable debugfs node
Enable debugfs node of mc-utils number of mc channels for t264.
Due to this change, we don't have to enable debug logs while verifying
mc-utils. This will save our time during bringup.

Bug 4090660

Change-Id: I1cf15d182ddeed7f2c93dc5bc65cebdc16590d2b
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3104229
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:08 +00:00
Ketan Patil
3bc182a772 platform: tegra: mc-utils: Correct register offset
The offset of MC_EMEM_ADR_CFG_CHANNEL_ENABLE_0 register is incorrect in
the driver, correct it as per the latest spec.

Bug 4090660

Change-Id: I0eec6fd8a82bdc5152af7a0742bbd00541507818
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3101731
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:08 +00:00
Ketan Patil
deaa196fd0 platform: tegra: mc-utils: Cleanup unnecessary functions
No client need the dram_clk_to_mc_clk, tegra_dram_types functions from
mc-utils. Hence remove these functions.
get_dram_num_channels is needed by resman team, hence update it to
return number of channels for t264.

Bug 4090660

Change-Id: I3e7571be73cfd94b3e2feebb6320a57b46b5fd48
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/3047611
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:08 +00:00
Ketan Patil
2710f2b3bd platform: tegra: Update compatible string check
On T264 simulation platform, the top level compatible strings is updated
to nvidia,t264sim. Because of which, the mc-utils driver is not able to
probe. Update the mc-utils driver to check for this new compatible
string as well.

Bug 4090660

Change-Id: I4c29cc9cf0cf87c72cd6f9dceb66473ce4cf4feb
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/2933473
Reviewed-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:08 +00:00
Ketan Patil
446ff87f28 platform: tegra: Update DRAM clk to MC clk formula
As per info received from HW team, we should not hardcode 1600 in DRAM
clock to MC clock conversion function. DRAM clk to EMC clk ratio is
always 4:1 while EMC clk to MC clk ratio can be found in CAR register
CLK_RST_CONTROLLER_CLK_SOURCE_EMC_0.MC_EMC_SAME_FREQ bit.
If it's 0 then MC frequency is half of EMC frequency, otherwise MC freq
is same as EMC freq. Hence update DRAM clock to MC clock function as per
above logic.

Bug 4090660

Change-Id: I5a7586aeee29fe1c98437cf0dd5b820d8f540072
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/2915138
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:08 +00:00
Ketan Patil
13412069a0 platform: tegra: Add mc-utils support for T264
mc-utils driver should support the following functionality on T264.
Update mc-utils driver for these functionalities for T264:
- EMC freq to BW conversion
- BW to freq conversion
- DRAM clock to MC clock coversion

Bug 4090660

Change-Id: If5ee54d49024d03620dad01049fe35bbcaf3f812
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/2900181
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:08 +00:00
Ketan Patil
86efe596c5 platform: tegra: Copy mc-utils driver
mc-utils driver support is needed on T264, and it should be present in
nvidia-t264 repo, so as to avoid leaking any information. Also, we need
to make sure once T264 is public the existing mc-utils driver can be
updated easily for T264 support.
Hence first copy the existing mc-utils driver from nvidia-oot into
nvidia-t264, then make changes for T264 and finally when T264 is public,
just cherry-pick the addional changes in nvidia-oot and clean up driver
from nvidia-t264. This change is doing the first step i.e. copying
existing mc-utils driver code from nvidia-oot into nvidia-t264.

Bug 4090660

Change-Id: I95eff8d3f7fef267a5c0f0e2137c4343a615d4aa
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-t264/+/2911970
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2025-07-24 10:19:08 +00:00
Laxman Dewangan
217b544137 mc-utils: Prepare tree for collapsing T264 OOT drivers
Remove some of the files which were added as optional for
non-existing of T264 patches. As T264 OOT drivers are
collapsing into the core tree, remove such optional files.

Change-Id: I83116585369f4893d14b527356752fbf2a9a80c8
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
2025-07-24 10:19:08 +00:00
Ketan Patil
2841339c6f mc-utils: Add support for t239
t239 was using mc-utils driver from kernel-nvidia folder as it was using
kernel k5.10; t239 is moving to kernel k6.1, hence update the mc-utils
driver from nvidia-oot to support t239.

Bug 4436559

Change-Id: I880a2fce377d65951983dea8876ca2954e9ddbc8
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3083702
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2024-03-06 23:29:21 -08:00
Ketan Patil
a56b9fc61c mc-utils: Update driver so as to support multiple SOCs
Current mc-utils driver is specific to T234 without any support for
extending it to future SOCs. Add such support so that it can be easily
extended for future chips.
- Create a struct of function pointers of all present operations
- Set these function pointers as per SOCs

Bug 4090660

Change-Id: I93e9da987bce1e563eb03aeeb0ac8bcb9da48023
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2911894
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-02 11:03:17 -07:00
Laxman Dewangan
40e4e98fbe mc-utils: Use SPDX license GPL 2.0 format
Use SPDX license GPL-V2.0 format and change Nvidia
copyright year to include 2023.

Bug 4078035

Change-Id: Ia37ad697df18900322ff46c2190081ebd61c81f0
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2891214
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-04-22 04:22:50 -07:00
Ashish Mhetre
7a504c1633 platform: tegra: Remove EMC register access for HV
EMC registers are currently accessed to get DRAM parameters.
As these are platform specific and static, DRAM parameters are added in
device-tree. In case of hypervisor environment, read DRAM properties
from device-tree instead of accessing EMC registers.
Also, MC and EMC register access by kernel is going to be blocked from
hypervisor. So, remove access to these registers.

Bug 3938091

Change-Id: I8a85bef7c34a919a48b3f0999f631f264540585a
Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2848653
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-01-31 04:19:34 -08:00
Jon Hunter
46858f60e8 mc-utils: Move driver into sub-directory
The mc-utils driver shares a Makefile with several others drivers in the
drivers/platform/tegra directory and this means that we cannot compile
the mc-utils driver independently of these other drivers and package the
mc-utils driver without all of the other drivers. Therefore, move the
mc-utils driver into its own sub-directory and add its own Makefile so
that we can build and package this driver independently.

Bug 3841177

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Change-Id: If8962fc1ede9fb4318341a7961106f799156cdad
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2827672
(cherry picked from commit a18d0a5a739144dc00a7200ec53397966fc543ba)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2829120
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-21 06:25:16 -08:00