aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/irqchip/irq-gic.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/irqchip/irq-gic.c')
-rw-r--r--drivers/irqchip/irq-gic.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 6365b59181ee..09fdf3d574cd 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -769,6 +769,33 @@ void gic_migrate_target(unsigned int new_cpu_id)
769 } 769 }
770 } 770 }
771} 771}
772
773/*
774 * gic_get_sgir_physaddr - get the physical address for the SGI register
775 *
776 * REturn the physical address of the SGI register to be used
777 * by some early assembly code when the kernel is not yet available.
778 */
779static unsigned long gic_dist_physaddr;
780
781unsigned long gic_get_sgir_physaddr(void)
782{
783 if (!gic_dist_physaddr)
784 return 0;
785 return gic_dist_physaddr + GIC_DIST_SOFTINT;
786}
787
788void __init gic_init_physaddr(struct device_node *node)
789{
790 struct resource res;
791 if (of_address_to_resource(node, 0, &res) == 0) {
792 gic_dist_physaddr = res.start;
793 pr_info("GIC physical location is %#lx\n", gic_dist_physaddr);
794 }
795}
796
797#else
798#define gic_init_physaddr(node) do { } while (0)
772#endif 799#endif
773 800
774static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq, 801static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
@@ -952,6 +979,8 @@ int __init gic_of_init(struct device_node *node, struct device_node *parent)
952 percpu_offset = 0; 979 percpu_offset = 0;
953 980
954 gic_init_bases(gic_cnt, -1, dist_base, cpu_base, percpu_offset, node); 981 gic_init_bases(gic_cnt, -1, dist_base, cpu_base, percpu_offset, node);
982 if (!gic_cnt)
983 gic_init_physaddr(node);
955 984
956 if (parent) { 985 if (parent) {
957 irq = irq_of_parse_and_map(node, 0); 986 irq = irq_of_parse_and_map(node, 0);