[PATCH] irqchip: gic: report GICD_IIDR

From: Mark Rutland
Date: Wed Apr 29 2015 - 08:54:03 EST


The GICD_IIDR register provides information about the implementer and
revision of the GIC distributor. In some cases this information is
useful for debugging, so log this when probing the GIC.

Signed-off-by: Mark Rutland <mark.rutland@xxxxxxx>
---
drivers/irqchip/irq-gic.c | 4 ++++
include/linux/irqchip/arm-gic.h | 1 +
2 files changed, 5 insertions(+)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 7b315e3..02c8bb4 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -959,6 +959,7 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start,
irq_hw_number_t hwirq_base;
struct gic_chip_data *gic;
int gic_irqs, irq_base, i;
+ unsigned long iidr;

BUG_ON(gic_nr >= MAX_GIC_NR);

@@ -996,6 +997,9 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start,
gic_set_base_accessor(gic, gic_get_common_base);
}

+ iidr = readl_relaxed(gic_data_dist_base(gic) + GIC_DIST_IIDR);
+ pr_info("GICD_IIDR reports 0x%08lx\n", (unsigned long)iidr);
+
/*
* Initialize the CPU interface map to all CPUs.
* It will be refined as each CPU probes its ID.
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h
index 36ec4ae..c29df66 100644
--- a/include/linux/irqchip/arm-gic.h
+++ b/include/linux/irqchip/arm-gic.h
@@ -29,6 +29,7 @@

#define GIC_DIST_CTRL 0x000
#define GIC_DIST_CTR 0x004
+#define GIC_DIST_IIDR 0x008
#define GIC_DIST_IGROUP 0x080
#define GIC_DIST_ENABLE_SET 0x100
#define GIC_DIST_ENABLE_CLEAR 0x180
--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/