Merge branch 'irq-irqdomain-arm-for-linus' of git://git.kernel.org/pub/scm/linux...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 16 Dec 2014 01:30:09 +0000 (17:30 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 16 Dec 2014 01:30:09 +0000 (17:30 -0800)
Pull irq domain ARM updates from Thomas Gleixner:
 "This set of changes make use of hierarchical irqdomains to provide:

   - MSI/ITS support for GICv3
   - MSI support for GICv2m
   - Interrupt polarity extender for GICv1

  Marc has come more cleanups for the existing extension hooks of GIC in
  the pipeline, but they are going to be 3.20 material"

* 'irq-irqdomain-arm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (22 commits)
  irqchip: gicv3-its: Fix ITT allocation
  irqchip: gicv3-its: Move some alloc/free code to activate/deactivate
  irqchip: gicv3-its: Fix domain free in multi-MSI case
  irqchip: gic: Remove warning by including linux/irqdomain.h
  irqchip: gic-v2m: Add DT bindings for GICv2m
  irqchip: gic-v2m: Add support for ARM GICv2m MSI(-X) doorbell
  irqchip: mtk-sysirq: dt-bindings: Add bindings for mediatek sysirq
  irqchip: mtk-sysirq: Add sysirq interrupt polarity support
  irqchip: gic: Support hierarchy irq domain.
  irqchip: GICv3: Binding updates for ITS
  irqchip: GICv3: ITS: enable compilation of the ITS driver
  irqchip: GICv3: ITS: plug ITS init into main GICv3 code
  irqchip: GICv3: ITS: DT probing and initialization
  irqchip: GICv3: ITS: MSI support
  irqchip: GICv3: ITS: device allocation and configuration
  irqchip: GICv3: ITS: tables allocators
  irqchip: GICv3: ITS: LPI allocator
  irqchip: GICv3: ITS: irqchip implementation
  irqchip: GICv3: ITS command queue
  irqchip: GICv3: rework redistributor structure
  ...

1  2 
Documentation/devicetree/bindings/arm/gic.txt
arch/arm64/Kconfig
arch/arm64/include/asm/Kbuild
drivers/irqchip/Kconfig
drivers/irqchip/Makefile
drivers/irqchip/irq-gic.c

@@@ -17,7 -17,6 +17,7 @@@ Main node required properties
        "arm,cortex-a7-gic"
        "arm,arm11mp-gic"
        "brcm,brahma-b15-gic"
 +      "arm,arm1176jzf-devchip-gic"
  - interrupt-controller : Identifies the node as an interrupt controller
  - #interrupt-cells : Specifies the number of cells needed to encode an
    interrupt source.  The type shall be a <u32> and the value shall be 3.
@@@ -97,3 -96,56 +97,56 @@@ Example
                      <0x2c006000 0x2000>;
                interrupts = <1 9 0xf04>;
        };
+ * GICv2m extension for MSI/MSI-x support (Optional)
+ Certain revisions of GIC-400 supports MSI/MSI-x via V2M register frame(s).
+ This is enabled by specifying v2m sub-node(s).
+ Required properties:
+ - compatible      : The value here should contain "arm,gic-v2m-frame".
+ - msi-controller    : Identifies the node as an MSI controller.
+ - reg             : GICv2m MSI interface register base and size
+ Optional properties:
+ - arm,msi-base-spi  : When the MSI_TYPER register contains an incorrect
+                     value, this property should contain the SPI base of
+                     the MSI frame, overriding the HW value.
+ - arm,msi-num-spis  : When the MSI_TYPER register contains an incorrect
+                     value, this property should contain the number of
+                     SPIs assigned to the frame, overriding the HW value.
+ Example:
+       interrupt-controller@e1101000 {
+               compatible = "arm,gic-400";
+               #interrupt-cells = <3>;
+               #address-cells = <2>;
+               #size-cells = <2>;
+               interrupt-controller;
+               interrupts = <1 8 0xf04>;
+               ranges = <0 0 0 0xe1100000 0 0x100000>;
+               reg = <0x0 0xe1110000 0 0x01000>,
+                     <0x0 0xe112f000 0 0x02000>,
+                     <0x0 0xe1140000 0 0x10000>,
+                     <0x0 0xe1160000 0 0x10000>;
+               v2m0: v2m@0x8000 {
+                       compatible = "arm,gic-v2m-frame";
+                       msi-controller;
+                       reg = <0x0 0x80000 0 0x1000>;
+               };
+               ....
+               v2mN: v2m@0x9000 {
+                       compatible = "arm,gic-v2m-frame";
+                       msi-controller;
+                       reg = <0x0 0x90000 0 0x1000>;
+               };
+       };
diff --combined arch/arm64/Kconfig
@@@ -1,8 -1,6 +1,8 @@@
  config ARM64
        def_bool y
 +      select ARCH_BINFMT_ELF_RANDOMIZE_PIE
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
 +      select ARCH_HAS_GCOV_PROFILE_ALL
        select ARCH_HAS_SG_CHAIN
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_USE_CMPXCHG_LOCKREF
@@@ -14,7 -12,9 +14,9 @@@
        select ARM_ARCH_TIMER
        select ARM_GIC
        select AUDIT_ARCH_COMPAT_GENERIC
+       select ARM_GIC_V2M if PCI_MSI
        select ARM_GIC_V3
+       select ARM_GIC_V3_ITS if PCI_MSI
        select BUILDTIME_EXTABLE_SORT
        select CLONE_BACKWARDS
        select COMMON_CLK
@@@ -25,9 -25,9 +27,9 @@@
        select GENERIC_CLOCKEVENTS_BROADCAST if SMP
        select GENERIC_CPU_AUTOPROBE
        select GENERIC_EARLY_IOREMAP
 -      select GENERIC_IOMAP
        select GENERIC_IRQ_PROBE
        select GENERIC_IRQ_SHOW
 +      select GENERIC_PCI_IOMAP
        select GENERIC_SCHED_CLOCK
        select GENERIC_SMP_IDLE_THREAD
        select GENERIC_STRNCPY_FROM_USER
        select GENERIC_TIME_VSYSCALL
        select HANDLE_DOMAIN_IRQ
        select HARDIRQS_SW_RESEND
 +      select HAVE_ALIGNED_STRUCT_PAGE if SLUB
        select HAVE_ARCH_AUDITSYSCALL
        select HAVE_ARCH_JUMP_LABEL
        select HAVE_ARCH_KGDB
 +      select HAVE_ARCH_SECCOMP_FILTER
        select HAVE_ARCH_TRACEHOOK
        select HAVE_BPF_JIT
        select HAVE_C_RECORDMCOUNT
        select HAVE_CC_STACKPROTECTOR
 +      select HAVE_CMPXCHG_DOUBLE
        select HAVE_DEBUG_BUGVERBOSE
        select HAVE_DEBUG_KMEMLEAK
        select HAVE_DMA_API_DEBUG
@@@ -146,11 -143,6 +148,11 @@@ source "kernel/Kconfig.freezer
  
  menu "Platform selection"
  
 +config ARCH_SEATTLE
 +      bool "AMD Seattle SoC Family"
 +      help
 +        This enables support for AMD Seattle SOC Family
 +
  config ARCH_THUNDER
        bool "Cavium Inc. Thunder SoC Family"
        help
@@@ -175,6 -167,9 +177,6 @@@ endmen
  
  menu "Bus support"
  
 -config ARM_AMBA
 -      bool
 -
  config PCI
        bool "PCI support"
        help
@@@ -199,114 -194,6 +201,114 @@@ endmen
  
  menu "Kernel Features"
  
 +menu "ARM errata workarounds via the alternatives framework"
 +
 +config ARM64_ERRATUM_826319
 +      bool "Cortex-A53: 826319: System might deadlock if a write cannot complete until read data is accepted"
 +      default y
 +      help
 +        This option adds an alternative code sequence to work around ARM
 +        erratum 826319 on Cortex-A53 parts up to r0p2 with an AMBA 4 ACE or
 +        AXI master interface and an L2 cache.
 +
 +        If a Cortex-A53 uses an AMBA AXI4 ACE interface to other processors
 +        and is unable to accept a certain write via this interface, it will
 +        not progress on read data presented on the read data channel and the
 +        system can deadlock.
 +
 +        The workaround promotes data cache clean instructions to
 +        data cache clean-and-invalidate.
 +        Please note that this does not necessarily enable the workaround,
 +        as it depends on the alternative framework, which will only patch
 +        the kernel if an affected CPU is detected.
 +
 +        If unsure, say Y.
 +
 +config ARM64_ERRATUM_827319
 +      bool "Cortex-A53: 827319: Data cache clean instructions might cause overlapping transactions to the interconnect"
 +      default y
 +      help
 +        This option adds an alternative code sequence to work around ARM
 +        erratum 827319 on Cortex-A53 parts up to r0p2 with an AMBA 5 CHI
 +        master interface and an L2 cache.
 +
 +        Under certain conditions this erratum can cause a clean line eviction
 +        to occur at the same time as another transaction to the same address
 +        on the AMBA 5 CHI interface, which can cause data corruption if the
 +        interconnect reorders the two transactions.
 +
 +        The workaround promotes data cache clean instructions to
 +        data cache clean-and-invalidate.
 +        Please note that this does not necessarily enable the workaround,
 +        as it depends on the alternative framework, which will only patch
 +        the kernel if an affected CPU is detected.
 +
 +        If unsure, say Y.
 +
 +config ARM64_ERRATUM_824069
 +      bool "Cortex-A53: 824069: Cache line might not be marked as clean after a CleanShared snoop"
 +      default y
 +      help
 +        This option adds an alternative code sequence to work around ARM
 +        erratum 824069 on Cortex-A53 parts up to r0p2 when it is connected
 +        to a coherent interconnect.
 +
 +        If a Cortex-A53 processor is executing a store or prefetch for
 +        write instruction at the same time as a processor in another
 +        cluster is executing a cache maintenance operation to the same
 +        address, then this erratum might cause a clean cache line to be
 +        incorrectly marked as dirty.
 +
 +        The workaround promotes data cache clean instructions to
 +        data cache clean-and-invalidate.
 +        Please note that this option does not necessarily enable the
 +        workaround, as it depends on the alternative framework, which will
 +        only patch the kernel if an affected CPU is detected.
 +
 +        If unsure, say Y.
 +
 +config ARM64_ERRATUM_819472
 +      bool "Cortex-A53: 819472: Store exclusive instructions might cause data corruption"
 +      default y
 +      help
 +        This option adds an alternative code sequence to work around ARM
 +        erratum 819472 on Cortex-A53 parts up to r0p1 with an L2 cache
 +        present when it is connected to a coherent interconnect.
 +
 +        If the processor is executing a load and store exclusive sequence at
 +        the same time as a processor in another cluster is executing a cache
 +        maintenance operation to the same address, then this erratum might
 +        cause data corruption.
 +
 +        The workaround promotes data cache clean instructions to
 +        data cache clean-and-invalidate.
 +        Please note that this does not necessarily enable the workaround,
 +        as it depends on the alternative framework, which will only patch
 +        the kernel if an affected CPU is detected.
 +
 +        If unsure, say Y.
 +
 +config ARM64_ERRATUM_832075
 +      bool "Cortex-A57: 832075: possible deadlock on mixing exclusive memory accesses with device loads"
 +      default y
 +      help
 +        This option adds an alternative code sequence to work around ARM
 +        erratum 832075 on Cortex-A57 parts up to r1p2.
 +
 +        Affected Cortex-A57 parts might deadlock when exclusive load/store
 +        instructions to Write-Back memory are mixed with Device loads.
 +
 +        The workaround is to promote device loads to use Load-Acquire
 +        semantics.
 +        Please note that this does not necessarily enable the workaround,
 +        as it depends on the alternative framework, which will only patch
 +        the kernel if an affected CPU is detected.
 +
 +        If unsure, say Y.
 +
 +endmenu
 +
 +
  choice
        prompt "Page size"
        default ARM64_4K_PAGES
@@@ -347,7 -234,7 +349,7 @@@ config ARM64_VA_BITS_4
  
  config ARM64_VA_BITS_48
        bool "48-bit"
 -      depends on BROKEN
 +      depends on !ARM_SMMU
  
  endchoice
  
@@@ -459,19 -346,6 +461,19 @@@ config ARCH_HAS_CACHE_LINE_SIZ
  
  source "mm/Kconfig"
  
 +config SECCOMP
 +      bool "Enable seccomp to safely compute untrusted bytecode"
 +      ---help---
 +        This kernel feature is useful for number crunching applications
 +        that may need to compute untrusted bytecode during their
 +        execution. By using pipes or other transports made available to
 +        the process as file descriptors supporting the read/write
 +        syscalls, it's possible to isolate those applications in
 +        their own address space using seccomp. Once seccomp is
 +        enabled via prctl(PR_SET_SECCOMP), it cannot be disabled
 +        and the task is only allowed to execute a few safe syscalls
 +        defined by each seccomp mode.
 +
  config XEN_DOM0
        def_bool y
        depends on XEN
@@@ -488,58 -362,6 +490,58 @@@ config FORCE_MAX_ZONEORDE
        default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE)
        default "11"
  
 +menuconfig ARMV8_DEPRECATED
 +      bool "Emulate deprecated/obsolete ARMv8 instructions"
 +      depends on COMPAT
 +      help
 +        Legacy software support may require certain instructions
 +        that have been deprecated or obsoleted in the architecture.
 +
 +        Enable this config to enable selective emulation of these
 +        features.
 +
 +        If unsure, say Y
 +
 +if ARMV8_DEPRECATED
 +
 +config SWP_EMULATION
 +      bool "Emulate SWP/SWPB instructions"
 +      help
 +        ARMv8 obsoletes the use of A32 SWP/SWPB instructions such that
 +        they are always undefined. Say Y here to enable software
 +        emulation of these instructions for userspace using LDXR/STXR.
 +
 +        In some older versions of glibc [<=2.8] SWP is used during futex
 +        trylock() operations with the assumption that the code will not
 +        be preempted. This invalid assumption may be more likely to fail
 +        with SWP emulation enabled, leading to deadlock of the user
 +        application.
 +
 +        NOTE: when accessing uncached shared regions, LDXR/STXR rely
 +        on an external transaction monitoring block called a global
 +        monitor to maintain update atomicity. If your system does not
 +        implement a global monitor, this option can cause programs that
 +        perform SWP operations to uncached memory to deadlock.
 +
 +        If unsure, say Y
 +
 +config CP15_BARRIER_EMULATION
 +      bool "Emulate CP15 Barrier instructions"
 +      help
 +        The CP15 barrier instructions - CP15ISB, CP15DSB, and
 +        CP15DMB - are deprecated in ARMv8 (and ARMv7). It is
 +        strongly recommended to use the ISB, DSB, and DMB
 +        instructions instead.
 +
 +        Say Y here to enable software emulation of these
 +        instructions for AArch32 userspace code. When this option is
 +        enabled, CP15 barrier usage is traced which can help
 +        identify software that needs updating.
 +
 +        If unsure, say Y
 +
 +endif
 +
  endmenu
  
  menu "Boot options"
@@@ -580,17 -402,6 +582,17 @@@ config EF
          allow the kernel to be booted as an EFI application. This
          is only useful on systems that have UEFI firmware.
  
 +config DMI
 +      bool "Enable support for SMBIOS (DMI) tables"
 +      depends on EFI
 +      default y
 +      help
 +        This enables SMBIOS/DMI feature for systems.
 +
 +        This option is only useful on systems that have UEFI firmware.
 +        However, even with this option, the resultant kernel should
 +        continue to boot on existing non-UEFI platforms.
 +
  endmenu
  
  menu "Userspace binary formats"
@@@ -14,6 -14,7 +14,6 @@@ generic-y += early_ioremap.
  generic-y += emergency-restart.h
  generic-y += errno.h
  generic-y += ftrace.h
 -generic-y += hash.h
  generic-y += hw_irq.h
  generic-y += ioctl.h
  generic-y += ioctls.h
@@@ -27,6 -28,7 +27,7 @@@ generic-y += local64.
  generic-y += mcs_spinlock.h
  generic-y += mman.h
  generic-y += msgbuf.h
+ generic-y += msi.h
  generic-y += mutex.h
  generic-y += pci.h
  generic-y += pci-bridge.h
diff --combined drivers/irqchip/Kconfig
@@@ -5,8 -5,15 +5,15 @@@ config IRQCHI
  config ARM_GIC
        bool
        select IRQ_DOMAIN
+       select IRQ_DOMAIN_HIERARCHY
        select MULTI_IRQ_HANDLER
  
+ config ARM_GIC_V2M
+       bool
+       depends on ARM_GIC
+       depends on PCI && PCI_MSI
+       select PCI_MSI_IRQ_DOMAIN
  config GIC_NON_BANKED
        bool
  
@@@ -14,6 -21,11 +21,11 @@@ config ARM_GIC_V
        bool
        select IRQ_DOMAIN
        select MULTI_IRQ_HANDLER
+       select IRQ_DOMAIN_HIERARCHY
+ config ARM_GIC_V3_ITS
+       bool
+       select PCI_MSI_IRQ_DOMAIN
  
  config ARM_NVIC
        bool
@@@ -48,19 -60,14 +60,19 @@@ config ATMEL_AIC5_IR
        select MULTI_IRQ_HANDLER
        select SPARSE_IRQ
  
 +config BCM7120_L2_IRQ
 +      bool
 +      select GENERIC_IRQ_CHIP
 +      select IRQ_DOMAIN
 +
  config BRCMSTB_L2_IRQ
        bool
 -      depends on ARM
        select GENERIC_IRQ_CHIP
        select IRQ_DOMAIN
  
  config DW_APB_ICTL
        bool
 +      select GENERIC_IRQ_CHIP
        select IRQ_DOMAIN
  
  config IMGPDC_IRQ
@@@ -130,7 -137,3 +142,7 @@@ config KEYSTONE_IR
        help
                Support for Texas Instruments Keystone 2 IRQ controller IP which
                is part of the Keystone 2 IPC mechanism
 +
 +config MIPS_GIC
 +      bool
 +      select MIPS_CM
diff --combined drivers/irqchip/Makefile
@@@ -19,7 -19,9 +19,9 @@@ obj-$(CONFIG_ARCH_SUNXI)              += irq-sun4i.
  obj-$(CONFIG_ARCH_SUNXI)              += irq-sunxi-nmi.o
  obj-$(CONFIG_ARCH_SPEAR3XX)           += spear-shirq.o
  obj-$(CONFIG_ARM_GIC)                 += irq-gic.o irq-gic-common.o
+ obj-$(CONFIG_ARM_GIC_V2M)             += irq-gic-v2m.o
  obj-$(CONFIG_ARM_GIC_V3)              += irq-gic-v3.o irq-gic-common.o
+ obj-$(CONFIG_ARM_GIC_V3_ITS)          += irq-gic-v3-its.o
  obj-$(CONFIG_ARM_NVIC)                        += irq-nvic.o
  obj-$(CONFIG_ARM_VIC)                 += irq-vic.o
  obj-$(CONFIG_ATMEL_AIC_IRQ)           += irq-atmel-aic-common.o irq-atmel-aic.o
@@@ -35,7 -37,7 +37,8 @@@ obj-$(CONFIG_TB10X_IRQC)              += irq-tb10x.
  obj-$(CONFIG_XTENSA)                  += irq-xtensa-pic.o
  obj-$(CONFIG_XTENSA_MX)                       += irq-xtensa-mx.o
  obj-$(CONFIG_IRQ_CROSSBAR)            += irq-crossbar.o
 -obj-$(CONFIG_BRCMSTB_L2_IRQ)          += irq-brcmstb-l2.o \
 -                                         irq-bcm7120-l2.o
 +obj-$(CONFIG_BCM7120_L2_IRQ)          += irq-bcm7120-l2.o
 +obj-$(CONFIG_BRCMSTB_L2_IRQ)          += irq-brcmstb-l2.o
  obj-$(CONFIG_KEYSTONE_IRQ)            += irq-keystone.o
 +obj-$(CONFIG_MIPS_GIC)                        += irq-mips-gic.o
+ obj-$(CONFIG_ARCH_MEDIATEK)           += irq-mtk-sysirq.o
@@@ -788,17 -788,16 +788,16 @@@ static int gic_irq_domain_map(struct ir
  {
        if (hw < 32) {
                irq_set_percpu_devid(irq);
-               irq_set_chip_and_handler(irq, &gic_chip,
-                                        handle_percpu_devid_irq);
+               irq_domain_set_info(d, irq, hw, &gic_chip, d->host_data,
+                                   handle_percpu_devid_irq, NULL, NULL);
                set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN);
        } else {
-               irq_set_chip_and_handler(irq, &gic_chip,
-                                        handle_fasteoi_irq);
+               irq_domain_set_info(d, irq, hw, &gic_chip, d->host_data,
+                                   handle_fasteoi_irq, NULL, NULL);
                set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
  
                gic_routable_irq_domain_ops->map(d, irq, hw);
        }
-       irq_set_chip_data(irq, d->host_data);
        return 0;
  }
  
@@@ -858,6 -857,31 +857,31 @@@ static struct notifier_block gic_cpu_no
  };
  #endif
  
+ static int gic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
+                               unsigned int nr_irqs, void *arg)
+ {
+       int i, ret;
+       irq_hw_number_t hwirq;
+       unsigned int type = IRQ_TYPE_NONE;
+       struct of_phandle_args *irq_data = arg;
+       ret = gic_irq_domain_xlate(domain, irq_data->np, irq_data->args,
+                                  irq_data->args_count, &hwirq, &type);
+       if (ret)
+               return ret;
+       for (i = 0; i < nr_irqs; i++)
+               gic_irq_domain_map(domain, virq + i, hwirq + i);
+       return 0;
+ }
+ static const struct irq_domain_ops gic_irq_domain_hierarchy_ops = {
+       .xlate = gic_irq_domain_xlate,
+       .alloc = gic_irq_domain_alloc,
+       .free = irq_domain_free_irqs_top,
+ };
  static const struct irq_domain_ops gic_irq_domain_ops = {
        .map = gic_irq_domain_map,
        .unmap = gic_irq_domain_unmap,
@@@ -947,18 -971,6 +971,6 @@@ void __init gic_init_bases(unsigned in
        for (i = 0; i < NR_GIC_CPU_IF; i++)
                gic_cpu_map[i] = 0xff;
  
-       /*
-        * For primary GICs, skip over SGIs.
-        * For secondary GICs, skip over PPIs, too.
-        */
-       if (gic_nr == 0 && (irq_start & 31) > 0) {
-               hwirq_base = 16;
-               if (irq_start != -1)
-                       irq_start = (irq_start & ~31) + 16;
-       } else {
-               hwirq_base = 32;
-       }
        /*
         * Find out how many interrupts are supported.
         * The GIC only supports up to 1020 interrupt sources.
                gic_irqs = 1020;
        gic->gic_irqs = gic_irqs;
  
-       gic_irqs -= hwirq_base; /* calculate # of irqs to allocate */
+       if (node) {             /* DT case */
+               const struct irq_domain_ops *ops = &gic_irq_domain_hierarchy_ops;
+               if (!of_property_read_u32(node, "arm,routable-irqs",
+                                         &nr_routable_irqs)) {
+                       ops = &gic_irq_domain_ops;
+                       gic_irqs = nr_routable_irqs;
+               }
+               gic->domain = irq_domain_add_linear(node, gic_irqs, ops, gic);
+       } else {                /* Non-DT case */
+               /*
+                * For primary GICs, skip over SGIs.
+                * For secondary GICs, skip over PPIs, too.
+                */
+               if (gic_nr == 0 && (irq_start & 31) > 0) {
+                       hwirq_base = 16;
+                       if (irq_start != -1)
+                               irq_start = (irq_start & ~31) + 16;
+               } else {
+                       hwirq_base = 32;
+               }
+               gic_irqs -= hwirq_base; /* calculate # of irqs to allocate */
  
-       if (of_property_read_u32(node, "arm,routable-irqs",
-                                &nr_routable_irqs)) {
                irq_base = irq_alloc_descs(irq_start, 16, gic_irqs,
                                           numa_node_id());
                if (IS_ERR_VALUE(irq_base)) {
  
                gic->domain = irq_domain_add_legacy(node, gic_irqs, irq_base,
                                        hwirq_base, &gic_irq_domain_ops, gic);
-       } else {
-               gic->domain = irq_domain_add_linear(node, nr_routable_irqs,
-                                                   &gic_irq_domain_ops,
-                                                   gic);
        }
  
        if (WARN_ON(!gic->domain))
@@@ -1037,12 -1066,14 +1066,16 @@@ gic_of_init(struct device_node *node, s
                irq = irq_of_parse_and_map(node, 0);
                gic_cascade_irq(gic_cnt, irq);
        }
+       if (IS_ENABLED(CONFIG_ARM_GIC_V2M))
+               gicv2m_of_init(node, gic_data[gic_cnt].domain);
        gic_cnt++;
        return 0;
  }
  IRQCHIP_DECLARE(gic_400, "arm,gic-400", gic_of_init);
 +IRQCHIP_DECLARE(arm11mp_gic, "arm,arm11mp-gic", gic_of_init);
 +IRQCHIP_DECLARE(arm1176jzf_dc_gic, "arm,arm1176jzf-devchip-gic", gic_of_init);
  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(cortex_a7_gic, "arm,cortex-a7-gic", gic_of_init);