The way that resets are handled on these Tegra devices is that there is a
set of peripheral clocks & resets which are paired up. This is because they
are laid out in banks within the CAR (clock and reset) controller. In most
cases we're referring to those resets, so you'll often see a clock ID used
in conjection with the same reset ID for a given IP block.
In addition to those peripheral resets, there are a number of extra resets
that don't have a corresponding clock and which are exposed in registers
outside of the peripheral banks, but still part of the CAR. To support
those "special" registers, the TEGRA*_RESET() is used to denote resets
outside of the regular peripheral resets. Essentially it defines the offset
within the CAR at which special resets start. In the above case, Tegra114
has 5 banks with 32 peripheral resets each. The first special reset,
TEGRA114_RESET(0), therefore gets ID 5 * 32 + 0 = 160.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
---
include/dt-bindings/reset/tegra114-car.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
create mode 100644 include/dt-bindings/reset/tegra114-car.h
diff --git a/include/dt-bindings/reset/tegra114-car.h b/include/dt-bindings/reset/tegra114-car.h
new file mode 100644
index 000000000000..d7908d810ddf
--- /dev/null
+++ b/include/dt-bindings/reset/tegra114-car.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */
+/*
+ * This header provides Tegra114-specific constants for binding
+ * nvidia,tegra114-car.
+ */
+
+#ifndef _DT_BINDINGS_RESET_TEGRA114_CAR_H
+#define _DT_BINDINGS_RESET_TEGRA114_CAR_H
+
+#define TEGRA114_RESET(x) (5 * 32 + (x))
+#define TEGRA114_RST_DFLL_DVCO TEGRA114_RESET(0)
+
+#endif /* _DT_BINDINGS_RESET_TEGRA114_CAR_H */
--
2.48.1
On 28/08/2025 07:44, Svyatoslav Ryhel wrote: > The way that resets are handled on these Tegra devices is that there is a > set of peripheral clocks & resets which are paired up. This is because they > are laid out in banks within the CAR (clock and reset) controller. In most > cases we're referring to those resets, so you'll often see a clock ID used > in conjection with the same reset ID for a given IP block. > > In addition to those peripheral resets, there are a number of extra resets > that don't have a corresponding clock and which are exposed in registers > outside of the peripheral banks, but still part of the CAR. To support > those "special" registers, the TEGRA*_RESET() is used to denote resets > outside of the regular peripheral resets. Essentially it defines the offset > within the CAR at which special resets start. In the above case, Tegra114 > has 5 banks with 32 peripheral resets each. The first special reset, > TEGRA114_RESET(0), therefore gets ID 5 * 32 + 0 = 160. > > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> > Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> > --- > include/dt-bindings/reset/tegra114-car.h | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > create mode 100644 include/dt-bindings/reset/tegra114-car.h > > diff --git a/include/dt-bindings/reset/tegra114-car.h b/include/dt-bindings/reset/tegra114-car.h > new file mode 100644 > index 000000000000..d7908d810ddf > --- /dev/null > +++ b/include/dt-bindings/reset/tegra114-car.h Still incorrectly named. Use full compatible, just like the other file where we already switched to recommended format (see also writing bindings). I asked for this at v1 and then reminded about unresolved comments at v3. Best regards, Krzysztof
On Thursday, August 28, 2025 4:19 PM Krzysztof Kozlowski wrote: > On 28/08/2025 07:44, Svyatoslav Ryhel wrote: > > The way that resets are handled on these Tegra devices is that there is a > > set of peripheral clocks & resets which are paired up. This is because > > they > > are laid out in banks within the CAR (clock and reset) controller. In most > > cases we're referring to those resets, so you'll often see a clock ID used > > in conjection with the same reset ID for a given IP block. > > > > In addition to those peripheral resets, there are a number of extra resets > > that don't have a corresponding clock and which are exposed in registers > > outside of the peripheral banks, but still part of the CAR. To support > > those "special" registers, the TEGRA*_RESET() is used to denote resets > > outside of the regular peripheral resets. Essentially it defines the > > offset > > within the CAR at which special resets start. In the above case, Tegra114 > > has 5 banks with 32 peripheral resets each. The first special reset, > > TEGRA114_RESET(0), therefore gets ID 5 * 32 + 0 = 160. > > > > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> > > Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> > > --- > > > > include/dt-bindings/reset/tegra114-car.h | 13 +++++++++++++ > > 1 file changed, 13 insertions(+) > > create mode 100644 include/dt-bindings/reset/tegra114-car.h > > > > diff --git a/include/dt-bindings/reset/tegra114-car.h > > b/include/dt-bindings/reset/tegra114-car.h new file mode 100644 > > index 000000000000..d7908d810ddf > > --- /dev/null > > +++ b/include/dt-bindings/reset/tegra114-car.h > > Still incorrectly named. Use full compatible, just like the other file > where we already switched to recommended format (see also writing bindings). > > I asked for this at v1 and then reminded about unresolved comments at v3. > Ah, I guess you mean using 'nvidia,tegra114-car.h'? At least I hadn't realized practice had changed to include the vendor prefix. It can be said that 'tegra114-car.h' is also based on the compatible, so I hadn't quite understood the original comment. Mikko > > Best regards, > Krzysztof
On Thu, Aug 28, 2025 at 04:50:03PM +0900, Mikko Perttunen wrote: > > > > > > include/dt-bindings/reset/tegra114-car.h | 13 +++++++++++++ > > > 1 file changed, 13 insertions(+) > > > create mode 100644 include/dt-bindings/reset/tegra114-car.h > > > > > > diff --git a/include/dt-bindings/reset/tegra114-car.h > > > b/include/dt-bindings/reset/tegra114-car.h new file mode 100644 > > > index 000000000000..d7908d810ddf > > > --- /dev/null > > > +++ b/include/dt-bindings/reset/tegra114-car.h > > > > Still incorrectly named. Use full compatible, just like the other file > > where we already switched to recommended format (see also writing bindings). > > > > I asked for this at v1 and then reminded about unresolved comments at v3. > > > > Ah, I guess you mean using 'nvidia,tegra114-car.h'? At least I hadn't realized > practice had changed to include the vendor prefix. That practice is VERY old. For example first patches from my subsystem are around 2015. It is true, though, that we ask for this since 3-4 years. In the upstream Linux kernel 3-4 years is also very long time, though... > > It can be said that 'tegra114-car.h' is also based on the compatible, so I > hadn't quite understood the original comment. With that approach "tegra114.h" or "t.h" is also based on the compatible. Best regards, Krzysztof
© 2016 - 2025 Red Hat, Inc.