Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irqchip/mips-gic: Add new DT property to reserve IPIs

The new property will allow to specify the range of GIC hwirqs to use for IPIs.

This is an optinal property. We preserve the previous behaviour of allocating
the last 2 * gic_vpes if it's not specified or DT is not supported.

Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: <jason@lakedaemon.net>
Cc: <marc.zyngier@arm.com>
Cc: <jiang.liu@linux.intel.com>
Cc: <linux-mips@linux-mips.org>
Cc: <lisa.parratt@imgtec.com>
Cc: Qais Yousef <qsyousef@gmail.com>
Link: http://lkml.kernel.org/r/1449580830-23652-20-git-send-email-qais.yousef@imgtec.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

authored by

Qais Yousef and committed by
Thomas Gleixner
16a8083c 7eb8c99d

+17 -2
+7
Documentation/devicetree/bindings/interrupt-controller/mips-gic.txt
··· 23 23 - mti,reserved-cpu-vectors : Specifies the list of CPU interrupt vectors 24 24 to which the GIC may not route interrupts. Valid values are 2 - 7. 25 25 This property is ignored if the CPU is started in EIC mode. 26 + - mti,reserved-ipi-vectors : Specifies the range of GIC interrupts that are 27 + reserved for IPIs. 28 + It accepts 2 values, the 1st is the starting interrupt and the 2nd is the size 29 + of the reserved range. 30 + If not specified, the driver will allocate the last 2 * number of VPEs in the 31 + system. 26 32 27 33 Required properties for timer sub-node: 28 34 - compatible : Should be "mti,gic-timer". ··· 50 44 #interrupt-cells = <3>; 51 45 52 46 mti,reserved-cpu-vectors = <7>; 47 + mti,reserved-ipi-vectors = <40 8>; 53 48 54 49 timer { 55 50 compatible = "mti,gic-timer";
+10 -2
drivers/irqchip/irq-mips-gic.c
··· 957 957 struct device_node *node) 958 958 { 959 959 unsigned int gicconfig; 960 + unsigned int v[2]; 960 961 961 962 __gic_base_addr = gic_base_addr; 962 963 ··· 1028 1027 1029 1028 gic_ipi_domain->bus_token = DOMAIN_BUS_IPI; 1030 1029 1031 - /* Make the last 2 * gic_vpes available for IPIs */ 1032 - bitmap_set(ipi_resrv, gic_shared_intrs - 2 * gic_vpes, 2 * gic_vpes); 1030 + if (node && 1031 + !of_property_read_u32_array(node, "mti,reserved-ipi-vectors", v, 2)) { 1032 + bitmap_set(ipi_resrv, v[0], v[1]); 1033 + } else { 1034 + /* Make the last 2 * gic_vpes available for IPIs */ 1035 + bitmap_set(ipi_resrv, 1036 + gic_shared_intrs - 2 * gic_vpes, 1037 + 2 * gic_vpes); 1038 + } 1033 1039 1034 1040 gic_basic_init(); 1035 1041 }