From: Ketan Patil <ketanp@nvidia.com>
To: <krzk@kernel.org>, <thierry.reding@kernel.org>, <jonathanh@nvidia.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
Ketan Patil <ketanp@nvidia.com>
Subject: [PATCH 1/3] memory: tegra: Use named defines for Tegra264 MC apertures
Date: Thu, 3 Sep 2026 18:25:18 +0000 [thread overview]
Message-ID: <20260903182520.950555-2-ketanp@nvidia.com> (raw)
In-Reply-To: <20260903182520.950555-1-ketanp@nvidia.com>
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>
---
drivers/memory/tegra/tegra264.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/drivers/memory/tegra/tegra264.c b/drivers/memory/tegra/tegra264.c
index 790349295dcc..56e55269eed7 100644
--- a/drivers/memory/tegra/tegra264.c
+++ b/drivers/memory/tegra/tegra264.c
@@ -717,11 +717,15 @@ static const char *const tegra264_rt_error_names[16] = {
};
/*
- * MC instance aperture mapping for hubc registers
+ * On Tegra264 the memory controller error interrupts are distributed across
+ * several HUB/HUBC apertures. Each aperture is accessed like a broadcast
+ * channel through mc_ch_readl()/mc_ch_writel() using its fixed index.
*/
-static const int mc_hubc_aperture_number[5] = {
- 7, 8, 9, 10, 11
-};
+#define TEGRA264_MC_APERTURE_DISP 7
+#define TEGRA264_MC_APERTURE_SYSTEM 8
+#define TEGRA264_MC_APERTURE_VISION 9
+#define TEGRA264_MC_APERTURE_UPHY 10
+#define TEGRA264_MC_APERTURE_TOP 11
/*
* tegra264_mc_icc_set() - Pass MC client info to the BPMP-FW
@@ -1057,27 +1061,27 @@ static irqreturn_t handle_hub_irq(int irq, void *data, int mc_hubc_aperture_numb
static irqreturn_t handle_disp_hub_irq(int irq, void *data)
{
- return handle_hub_irq(irq, data, mc_hubc_aperture_number[0]);
+ return handle_hub_irq(irq, data, TEGRA264_MC_APERTURE_DISP);
}
static irqreturn_t handle_system_hub_irq(int irq, void *data)
{
- return handle_hub_irq(irq, data, mc_hubc_aperture_number[1]);
+ return handle_hub_irq(irq, data, TEGRA264_MC_APERTURE_SYSTEM);
}
static irqreturn_t handle_vision_hub_irq(int irq, void *data)
{
- return handle_hub_irq(irq, data, mc_hubc_aperture_number[2]);
+ return handle_hub_irq(irq, data, TEGRA264_MC_APERTURE_VISION);
}
static irqreturn_t handle_uphy_hub_irq(int irq, void *data)
{
- return handle_hub_irq(irq, data, mc_hubc_aperture_number[3]);
+ return handle_hub_irq(irq, data, TEGRA264_MC_APERTURE_UPHY);
}
static irqreturn_t handle_top_hub_irq(int irq, void *data)
{
- return handle_hub_irq(irq, data, mc_hubc_aperture_number[4]);
+ return handle_hub_irq(irq, data, TEGRA264_MC_APERTURE_TOP);
}
static irqreturn_t handle_generic_irq(struct tegra_mc *mc, unsigned long intstat_reg)
--
2.43.0
next prev parent reply other threads:[~2026-09-03 18:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 18:25 [PATCH 0/3] memory: tegra: Refactor Tegra264 mc-err code Ketan Patil
2026-09-03 18:25 ` Ketan Patil [this message]
2026-09-03 18:25 ` [PATCH 2/3] memory: tegra: Parameterise Tegra264 MCF slice bound Ketan Patil
2026-09-03 18:25 ` [PATCH 3/3] memory: tegra: Refactor Tegra264 mc-err code Ketan Patil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260903182520.950555-2-ketanp@nvidia.com \
--to=ketanp@nvidia.com \
--cc=jonathanh@nvidia.com \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox