Skip to contentSkip to conversation

Add generic GIC compat strings

PATCH Superseded Nikolay Borisov 3 participants 6 messages May 21, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Add generic GIC compat strings

Currently the GIC (in drivers/irqchip/irq-gic.c) is referred to with implementation-specific strings (e.g. "arm.cortex-a9-gic"), which is a little unwieldy due to the number of different CPUs we now have with GIC support.

These 2 patches add the generic arm,gic-v[1,2] compat strings and also change the respective documentation.

Nikolay Borisov (2):
irqchip: Add generic gic-v1/gic-v2 compat strings. documentation/devicetree: Update GIC compat strings

 Documentation/devicetree/bindings/arm/gic.txt | 2 ++
 drivers/irqchip/irq-gic.c                     | 2 ++
 2 files changed, 4 insertions(+)
Signature · 1 line
1.8.1.5
#1 lore raw

PATCH 1/2 irqchip: Add generic gic-v1/gic-v2 compat strings.

The current set of GIC compatible strings only contains specific implementations (e.g. arm,cortex-a9-gic) rather than revisions of the standard (e.g. arm,gic-v2), so each new implementation must either claim to be an extension of an existing implementation or have a new string added to the driver. This may be problematic when workarounds are required for bugs in particular implementations, as said workaround may end up targeting a wider set of implementations than intended.

To prevent these issues, this patch adds compatible strings for the revisions of the GIC spec which all GIC implementations should be able to claim conformance to in addition to any particular implementation specific string, e.g.

compatible = "$VENDOR,specific-gic-variant", "arm,gic-v2";

---
 drivers/irqchip/irq-gic.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/irqchip/irq-gic.c +2 -0
index 57d165e..89e9b05 100644
@@ -1073,6 +1073,8 @@ gic_of_init(struct device_node *node, struct device_node *parent)
 }
 IRQCHIP_DECLARE(cortex_a15_gic, "arm,cortex-a15-gic", gic_of_init);
 IRQCHIP_DECLARE(cortex_a9_gic, "arm,cortex-a9-gic", gic_of_init);
+IRQCHIP_DECLARE(gic_v1, "arm,gic-v1", gic_of_init);
+IRQCHIP_DECLARE(gic_v2, "arm,gic-v2", gic_of_init);
 IRQCHIP_DECLARE(msm_8660_qgic, "qcom,msm-8660-qgic", gic_of_init);
 IRQCHIP_DECLARE(msm_qgic2, "qcom,msm-qgic2", gic_of_init);
 
Signature · 1 line
1.8.1.5
#2 lore raw

PATCH 1/2 irqchip: Add generic gic-v1/gic-v2 compat strings.

[adding devicetree at vger.kernel.org]

Quoted 8 lines · Nikolay Borisov

The current set of GIC compatible strings only contains specific implementations (e.g. arm,cortex-a9-gic) rather than revisions of the standard (e.g. arm,gic-v2), so each new implementation must either claim to be an extension of an existing implementation or have a new string added to the driver. This may be problematic when workarounds are required for bugs in particular implementations, as said workaround may end up targeting a wider set of implementations than intended.

Quoted 6 lines

To prevent these issues, this patch adds compatible strings for the revisions of the GIC spec which all GIC implementations should be able to claim conformance to in addition to any particular implementation specific string, e.g.

compatible = "$VENDOR,specific-gic-variant", "arm,gic-v2";

This makes sense to me, so:

Cheers,
Mark.

Quoted 22 lines
---
 drivers/irqchip/irq-gic.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/irqchip/irq-gic.c +2 -0
index 57d165e..89e9b05 100644
@@ -1073,6 +1073,8 @@ gic_of_init(struct device_node *node, struct device_node *parent)
 }
 IRQCHIP_DECLARE(cortex_a15_gic, "arm,cortex-a15-gic", gic_of_init);
 IRQCHIP_DECLARE(cortex_a9_gic, "arm,cortex-a9-gic", gic_of_init);
+IRQCHIP_DECLARE(gic_v1, "arm,gic-v1", gic_of_init);
+IRQCHIP_DECLARE(gic_v2, "arm,gic-v2", gic_of_init);
 IRQCHIP_DECLARE(msm_8660_qgic, "qcom,msm-8660-qgic", gic_of_init);
 IRQCHIP_DECLARE(msm_qgic2, "qcom,msm-qgic2", gic_of_init);
 
Signature · 1 line
1.8.1.5
#3 lore raw

PATCH 2/2 documentation/devicetree: Update GIC compat strings

In reply to Nikolay Borisov

Document the addition of 2 new, implementation-agnostic compatible strings. This allows for more flexibility such that new implementation can either state whether they are an extension of an existing implementation, a brand new implementation or just that they conform to a standard revision of the GIC spec.

---
 Documentation/devicetree/bindings/arm/gic.txt | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/arm/gic.txt +2 -0
index 5573c08..223b4cc 100644
@@ -12,6 +12,8 @@ Main node required properties:
 
 - compatible : should be one of:
 	"arm,gic-400"
+	"arm,gic-v1"
+	"arm,gic-v2"
 	"arm,cortex-a15-gic"
 	"arm,cortex-a9-gic"
 	"arm,cortex-a7-gic"
Signature · 1 line
1.8.1.5
#4 lore raw

PATCH 2/2 documentation/devicetree: Update GIC compat strings

[Adding devicetree at vger.kernel.org]

Quoted 7 lines · Nikolay Borisov

Document the addition of 2 new, implementation-agnostic compatible strings. This allows for more flexibility such that new implementation can either state whether they are an extension of an existing implementation, a brand new implementation or just that they conform to a standard revision of the GIC spec.

From my POV it makes sense to have these to make it possible to write

DTs with new GIC variants which are implementations of the standard rather than extensions of existing implementations.

However, DTs using these should also state exactly what variant they are, and those strings should be documented (even if not supported directly by the driver). It would be nice to have that mentioned in the commit message.

Otherwise:

Cheers,
Mark.

Quoted 22 lines
---
 Documentation/devicetree/bindings/arm/gic.txt | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/arm/gic.txt +2 -0
index 5573c08..223b4cc 100644
@@ -12,6 +12,8 @@ Main node required properties:
 
 - compatible : should be one of:
 	"arm,gic-400"
+	"arm,gic-v1"
+	"arm,gic-v2"
 	"arm,cortex-a15-gic"
 	"arm,cortex-a9-gic"
 	"arm,cortex-a7-gic"
Signature · 1 line
1.8.1.5
#5 lore raw

PATCH 2/2 documentation/devicetree: Update GIC compat strings

Nikolay,

Quoted 9 lines · Mark Rutland

[Adding devicetree at vger.kernel.org]

Quoted 5 lines · Nikolay Borisov

Document the addition of 2 new, implementation-agnostic compatible strings. This allows for more flexibility such that new implementation can either state whether they are an extension of an existing implementation, a brand new implementation or just that they conform to a standard revision of the GIC spec.

Quoted 8 lines

From my POV it makes sense to have these to make it possible to write DTs with new GIC variants which are implementations of the standard rather than extensions of existing implementations.

However, DTs using these should also state exactly what variant they are, and those strings should be documented (even if not supported directly by the driver). It would be nice to have that mentioned in the commit message.

Please tweak the commit message as Mark suggested and resend, including me in the Cc. I'll queue it up for tglx.

Quoted 4 lines

Otherwise:

Also, please include Mark's Acks.

thx,

Jason.