linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/23] ARM: tegra: Create a DT header defining swgroups ID
@ 2013-06-26  9:28 Hiroshi Doyu
  2013-06-26 10:06 ` Thierry Reding
  0 siblings, 1 reply; 4+ messages in thread
From: Hiroshi Doyu @ 2013-06-26  9:28 UTC (permalink / raw)
  To: linux-arm-kernel

Create a header file to define the swgroup IDs used by the IOMMU(SMMU)
binding. "swgroup" is a group of H/W clients in Tegra SoC from S/W POV.

This will allow the same header to be used by both device tree files,
and drivers implementing this binding, which guarantees that the two
stay in sync. This also makes device trees more readable by using names
instead of magic numbers.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
 include/dt-bindings/iommu/tegra-swgid.h | 47 +++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 include/dt-bindings/iommu/tegra-swgid.h

diff --git a/include/dt-bindings/iommu/tegra-swgid.h b/include/dt-bindings/iommu/tegra-swgid.h
new file mode 100644
index 0000000..b429ce1
--- /dev/null
+++ b/include/dt-bindings/iommu/tegra-swgid.h
@@ -0,0 +1,47 @@
+/*
+ * This header provides constants for binding nvidia,swgroup ID
+ */
+
+#ifndef _DT_BINDINGS_IOMMU_TEGRA_SWGID_H
+#define _DT_BINDINGS_IOMMU_TEGRA_SWGID_H
+
+#define SWGID_AFI 0
+#define SWGID_AVPC 1
+#define SWGID_DC 2
+#define SWGID_DCB 3
+#define SWGID_EPP 4
+#define SWGID_G2 5
+#define SWGID_HC 6
+#define SWGID_HDA 7
+#define SWGID_ISP 8
+#define SWGID_ISP2 SWGID_ISP
+/* UNUSED: 9 */
+/* UNUSED: 10 */
+#define SWGID_MPE 11
+#define SWGID_MSENC SWGID_MPE
+#define SWGID_NV 12
+#define SWGID_NV2 13
+#define SWGID_PPCS 14
+#define SWGID_SATA2 15
+#define SWGID_SATA 16
+#define SWGID_VDE 17
+#define SWGID_VI 18
+#define SWGID_VIC 19
+#define SWGID_XUSB_HOST 20
+#define SWGID_XUSB_DEV 21
+#define SWGID_A9AVP 22
+#define SWGID_TSEC 23
+#define SWGID_PPCS1 24
+/* UNUSED: 25 */
+/* UNUSED: 26 */
+/* UNUSED: 27 */
+/* UNUSED: 28 */
+/* UNUSED: 29 */
+/* UNUSED: 30 */
+/* UNUSED: 31 */
+
+/* Reserved: 32-63 */
+
+#define SWGID(x)	(1ULL << SWGID_##x)
+
+#endif /* _DT_BINDINGS_IOMMU_TEGRA_SWGID_H */
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 01/23] ARM: tegra: Create a DT header defining swgroups ID
  2013-06-26  9:28 [PATCH 01/23] ARM: tegra: Create a DT header defining swgroups ID Hiroshi Doyu
@ 2013-06-26 10:06 ` Thierry Reding
  2013-06-26 10:31   ` Hiroshi Doyu
  0 siblings, 1 reply; 4+ messages in thread
From: Thierry Reding @ 2013-06-26 10:06 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 26, 2013 at 12:28:04PM +0300, Hiroshi Doyu wrote:
[...]
> +#define SWGID_AFI 0
> +#define SWGID_AVPC 1
> +#define SWGID_DC 2
> +#define SWGID_DCB 3
> +#define SWGID_EPP 4
> +#define SWGID_G2 5
> +#define SWGID_HC 6
> +#define SWGID_HDA 7
> +#define SWGID_ISP 8
> +#define SWGID_ISP2 SWGID_ISP
> +/* UNUSED: 9 */
> +/* UNUSED: 10 */
> +#define SWGID_MPE 11
> +#define SWGID_MSENC SWGID_MPE
> +#define SWGID_NV 12
> +#define SWGID_NV2 13
> +#define SWGID_PPCS 14
> +#define SWGID_SATA2 15
> +#define SWGID_SATA 16
> +#define SWGID_VDE 17
> +#define SWGID_VI 18
> +#define SWGID_VIC 19
> +#define SWGID_XUSB_HOST 20
> +#define SWGID_XUSB_DEV 21
> +#define SWGID_A9AVP 22
> +#define SWGID_TSEC 23
> +#define SWGID_PPCS1 24
> +/* UNUSED: 25 */
> +/* UNUSED: 26 */
> +/* UNUSED: 27 */
> +/* UNUSED: 28 */
> +/* UNUSED: 29 */
> +/* UNUSED: 30 */
> +/* UNUSED: 31 */
> +
> +/* Reserved: 32-63 */
> +
> +#define SWGID(x)	(1ULL << SWGID_##x)

I'm not entirely sure where to find these mappings in the TRM. I see
that there's a list of the groups in 15.10.11, but where do the numbers
come from? And why are some of the names aliased? If it's for
readability only maybe we could add some more for SWGID_HC ->
SWGID_HOST1X and perhaps SWGID_NV -> SWGID_GR3D.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130626/3a0229ff/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 01/23] ARM: tegra: Create a DT header defining swgroups ID
  2013-06-26 10:06 ` Thierry Reding
@ 2013-06-26 10:31   ` Hiroshi Doyu
  2013-06-26 10:38     ` Thierry Reding
  0 siblings, 1 reply; 4+ messages in thread
From: Hiroshi Doyu @ 2013-06-26 10:31 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Thierry,

Thierry Reding <thierry.reding@gmail.com> wrote @ Wed, 26 Jun 2013 12:06:49 +0200:
...
> I'm not entirely sure where to find these mappings in the TRM. I see
> that there's a list of the groups in 15.10.11, but where do the numbers
> come from?

To convert swgroup ID bit to register address,

#define HWGRP_ASID_REG(x) ((x) * sizeof(u32) + SMMU_AFI_ASID)

in "[PATCH 15/23] iommu/tegra: smmu: Calculate ASID register offset by ID"

> And why are some of the names aliased? If it's for
> readability only maybe we could add some more for SWGID_HC ->
> SWGID_HOST1X and perhaps SWGID_NV -> SWGID_GR3D.

I used the exact same name from TRM register definition. I thought
that same naming in TRM may be better since this bit is converted to
register, but I'm quite open to rename if needed.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 01/23] ARM: tegra: Create a DT header defining swgroups ID
  2013-06-26 10:31   ` Hiroshi Doyu
@ 2013-06-26 10:38     ` Thierry Reding
  0 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2013-06-26 10:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 26, 2013 at 12:31:41PM +0200, Hiroshi Doyu wrote:
> Hi Thierry,
> 
> Thierry Reding <thierry.reding@gmail.com> wrote @ Wed, 26 Jun 2013 12:06:49 +0200:
> ...
> > I'm not entirely sure where to find these mappings in the TRM. I see
> > that there's a list of the groups in 15.10.11, but where do the numbers
> > come from?
> 
> To convert swgroup ID bit to register address,
> 
> #define HWGRP_ASID_REG(x) ((x) * sizeof(u32) + SMMU_AFI_ASID)
> 
> in "[PATCH 15/23] iommu/tegra: smmu: Calculate ASID register offset by ID"

Oh, I see. Thanks for pointing that out.

> > And why are some of the names aliased? If it's for
> > readability only maybe we could add some more for SWGID_HC ->
> > SWGID_HOST1X and perhaps SWGID_NV -> SWGID_GR3D.
> 
> I used the exact same name from TRM register definition. I thought
> that same naming in TRM may be better since this bit is converted to
> register, but I'm quite open to rename if needed.

I think it's fine to keep the names from the TRM. I was just wondering
why some groups can be referenced using multiple names, like ISP2 -> ISP
and MSENC -> MPE.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130626/a0a76dad/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-26 10:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-26  9:28 [PATCH 01/23] ARM: tegra: Create a DT header defining swgroups ID Hiroshi Doyu
2013-06-26 10:06 ` Thierry Reding
2013-06-26 10:31   ` Hiroshi Doyu
2013-06-26 10:38     ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).