summaryrefslogtreecommitdiff
path: root/drivers/memory/tegra/tegra264.c
AgeCommit message (Collapse)Author
2026-09-15memory: tegra: Refactor Tegra264 mc-err codeKetan Patil
The MC and HUB error-logging paths on Tegra264 used large switch statements that interleaved register offsets, bit positions and decoding parameters for each error type, which made them hard to read and review. Turn the error logging into a more structured implementation: - Describe each MCF error type with a tegra264_mc_fault descriptor filled in by a small per-type get_offsets() callback, and move the register access, client lookup and reporting into a common tegra264_mc_report_fault() helper. - Describe each HUB error type with a static tegra264_hub_error_handler table, since the HUB register offsets are fixed on Tegra264. No functional change intended. Signed-off-by: Ketan Patil <ketanp@nvidia.com> Link: https://patch.msgid.link/20260903182520.950555-4-ketanp@nvidia.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
2026-09-15memory: tegra: Parameterise Tegra264 MCF slice boundKetan Patil
Replace the hard-coded slice bound check in handle_mcf_irq() with a TEGRA264_MC_NUM_SLICES define, so the number of MCF slices is named rather than being an unexplained literal. Note that although the existing logic is correct, the actual number of MCF slices for Tegra264 is 5 and not 4. So define TEGRA264_MC_NUM_SLICES as 5 and update the logic accordingly. No functional change intended. Signed-off-by: Ketan Patil <ketanp@nvidia.com> Link: https://patch.msgid.link/20260903182520.950555-3-ketanp@nvidia.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
2026-09-15memory: tegra: Use named defines for Tegra264 MC aperturesKetan Patil
The Tegra264 memory controller error interrupts are distributed across several HUB/HUBC apertures, each accessed like a broadcast channel using a fixed index. These indices were kept in a bare mc_hubc_aperture_number[] array, and handle_hub_irq() took a parameter of the same name that shadowed it. This driver is only applicable to Tegra264 devices and so this abstraction is not needed. Replace the array with named TEGRA264_MC_APERTURE_* defines to simplify the code. No functional change intended. Signed-off-by: Ketan Patil <ketanp@nvidia.com> Link: https://patch.msgid.link/20260903182520.950555-2-ketanp@nvidia.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
2026-06-09memory: tegra264: drop redundant tegra264_mc_icc_aggregate()Sumit Gupta
tegra264_mc_icc_aggregate() does nothing on top of icc_std_aggregate except an early return on !mc->bwmgr_mrq_supported. tegra264_mc_icc_set() already returns early on the same condition, before reading any of the aggregated avg_bw / peak_bw values. This makes the early return in aggregate() redundant. So, set tegra264_mc_icc_ops.aggregate to icc_std_aggregate and drop the helper. Reported-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Sumit Gupta <sumitg@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Link: https://patch.msgid.link/20260527140127.49172-3-sumitg@nvidia.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
2026-05-27memory: tegra264: Add full set of MC clientsSumit Gupta
Extend the tegra264_mc_clients table to cover the full set of memory clients exposed by the SoC. The client name is used for MC fault reporting. Clients managed by the BPMP bandwidth manager additionally carry their bpmp_id and type. Entries in tegra264_mc_clients[] are sorted to match the order of the override and security register offsets used in previous SoCs. Signed-off-by: Sumit Gupta <sumitg@nvidia.com> Link: https://patch.msgid.link/20260518124306.2071481-4-sumitg@nvidia.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
2026-05-27memory: tegra264: Skip clients without bpmp_id or typeSumit Gupta
Some MC clients are present in tegra264_mc_clients[] only for fault-log naming and have no .bpmp_id or .type assigned. Skip forwarding bandwidth requests to BPMP for such clients in tegra264_mc_icc_set(). Signed-off-by: Sumit Gupta <sumitg@nvidia.com> Link: https://patch.msgid.link/20260518124306.2071481-2-sumitg@nvidia.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
2026-03-07memory: tegra: Add MC error logging support for Tegra264Ketan Patil
In Tegra264, different components from memory subsystems like Memory Controller Fabric (MCF), HUB, HUB Common (HUBC), Side Band Shim (SBS) and channels have different interrupt lines for receiving memory controller error interrupts. Add support for logging memory controller errors reported by these memory subsystems on Tegra264 by: - Renaming tegra_mc_error_names array to tegra20_mc_error_names because it has a different bit index for error names compared to Tegra264. - Defining the intmask registers and mask values supported for Tegra264. - Registering interrupt handlers for interrupts associated with these different MC components which read the interrupt status registers to determine the type of violation that occurred. Signed-off-by: Ketan Patil <ketanp@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Link: https://patch.msgid.link/20260226163115.1152181-7-ketanp@nvidia.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
2026-03-07memory: tegra: Prepare for supporting multiple intmask registersKetan Patil
Add a new structure for the intmask register e.g. MC_INTMASK_0 and it's mask value. Add an array of these new structures to prepare for supporting multiple intmask registers. This is done in preparation for adding support for Tegra264 which supports multiple intmask registers. Signed-off-by: Ketan Patil <ketanp@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Link: https://patch.msgid.link/20260226163115.1152181-6-ketanp@nvidia.com [krzk: Fix checkpatch warning] Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
2025-07-11memory: tegra: Add Tegra264 MC and EMC supportSumit Gupta
Add support to enable Memory Controller (MC) and External Memory Controller (EMC) drivers for Tegra264. The nodes for MC and EMC are mostly the same as Tegra234 but differ in number of channels and interrupt numbers. The patch also adds the bandwidth manager definitions required for Tegra264 and uses them to populate the memory client table. All of these are needed to properly enable memory interconnect (ICC) support. Signed-off-by: Sumit Gupta <sumitg@nvidia.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20250709222147.3758356-3-thierry.reding@gmail.com Signed-off-by: Thierry Reding <treding@nvidia.com>