Message ID | 1351462748-5224-4-git-send-email-thomas.petazzoni@free-electrons.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 10/28/2012 11:19 PM, Thomas Petazzoni wrote: > Now that the drivers/irqchip/ directory has a minimal infrastructure > to support the addition of irq controller driver, we move the irq > controller driver for Armada 370 and Armada XP ARM SoCs from the > arch/arm/mach-mvebu/ directory to the drivers/irqchip/ directory and > update the irqchip infrastructure to take into account this new > driver. > > [...] > diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile > index 6b5a6e0..5148ffd 100644 > --- a/drivers/irqchip/Makefile > +++ b/drivers/irqchip/Makefile > @@ -1,2 +1,3 @@ > obj-$(CONFIG_IRQCHIP) += irqchip.o > obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o > +obj-$(CONFIG_ARCH_MVEBU) += irq-armada-370-xp.o Thomas, using ARCH_MVEBU for enabling irq-armada-370-xp here will lead to incompatibilities with Orion SoCs when they move over to ARCH_MVEBU. Although, it is ok for the moment please choose either a CONFIG_ common for both Armada 370 and XP. With a Kconfig within drivers/irqchip you could define a ARMADA_370_XP_IRQ and select that in MACH_ARMADA_370 and MACH_ARMADA_XP or MACH_ARMADA_370_XP, which all already exist. As soon as the patch is through, I can provide (and use) a irq-orion based on irqchip. I can provide it earlier but to actually use it there are still some other patches required on Dove. Other Orions could switch now, I guess. Sebastian
Sebastian, On Mon, 29 Oct 2012 10:18:24 +0100, Sebastian Hesselbarth wrote: > using ARCH_MVEBU for enabling irq-armada-370-xp here will lead to > incompatibilities with Orion SoCs when they move over to ARCH_MVEBU. Not really: the driver is probed depending on the DT compatible string. So we can perfectly have two irqchip drivers being enabled on ARCH_MVEBU. > Although, it is ok for the moment please choose either a CONFIG_ > common for both Armada 370 and XP. > > With a Kconfig within drivers/irqchip you could define a > ARMADA_370_XP_IRQ and select that in MACH_ARMADA_370 and MACH_ARMADA_XP > or MACH_ARMADA_370_XP, which all already exist. But agreed, I could use MACH_ARMADA_370_XP. I don't know if we want to add Kconfig options for each irqchip driver. > As soon as the patch is through, I can provide (and use) a irq-orion > based on irqchip. I can provide it earlier but to actually use it there > are still some other patches required on Dove. Other Orions could > switch now, I guess. Are you sure? The irqchip drivers only work for sub-architecture that are fully converted to the Device Tree. And I don't think all of mach-orion5x, mach-dove, mach-kirkwood and mach-mv78xx0 are converted to the DT. Best regards, Thomas
On 10/29/2012 10:24 AM, Thomas Petazzoni wrote: >> using ARCH_MVEBU for enabling irq-armada-370-xp here will lead to >> incompatibilities with Orion SoCs when they move over to ARCH_MVEBU. > > Not really: the driver is probed depending on the DT compatible string. > So we can perfectly have two irqchip drivers being enabled on > ARCH_MVEBU. I agreed but this will always build irq-armada-370-xp into the kernel although I maybe want a orion-only kernel. Although multi-platform will be great for ARM, I doubt that every kernel will be multi-platform? >> With a Kconfig within drivers/irqchip you could define a >> ARMADA_370_XP_IRQ and select that in MACH_ARMADA_370 and MACH_ARMADA_XP >> or MACH_ARMADA_370_XP, which all already exist. > > But agreed, I could use MACH_ARMADA_370_XP. I don't know if we want to > add Kconfig options for each irqchip driver. Ok. >> As soon as the patch is through, I can provide (and use) a irq-orion >> based on irqchip. I can provide it earlier but to actually use it there >> are still some other patches required on Dove. Other Orions could >> switch now, I guess. > > Are you sure? The irqchip drivers only work for sub-architecture that > are fully converted to the Device Tree. And I don't think all of > mach-orion5x, mach-dove, mach-kirkwood and mach-mv78xx0 are converted > to the DT. Hmm, I do have an experimental branch of Dove with irqchip enabled that works perfectly fine even with non-DT code in it. Actually, it is based on 3.7-rc3 which means it is before your patches. But the irq controller itself is referenced from DT, of course. Sebastian
Hello, On Mon, 29 Oct 2012 10:38:59 +0100, Sebastian Hesselbarth wrote: > > Not really: the driver is probed depending on the DT compatible string. > > So we can perfectly have two irqchip drivers being enabled on > > ARCH_MVEBU. > > I agreed but this will always build irq-armada-370-xp into the kernel > although I maybe want a orion-only kernel. Although multi-platform will > be great for ARM, I doubt that every kernel will be multi-platform? Agreed. > >> As soon as the patch is through, I can provide (and use) a irq-orion > >> based on irqchip. I can provide it earlier but to actually use it there > >> are still some other patches required on Dove. Other Orions could > >> switch now, I guess. > > > > Are you sure? The irqchip drivers only work for sub-architecture that > > are fully converted to the Device Tree. And I don't think all of > > mach-orion5x, mach-dove, mach-kirkwood and mach-mv78xx0 are converted > > to the DT. > > Hmm, I do have an experimental branch of Dove with irqchip enabled that > works perfectly fine even with non-DT code in it. Actually, it is based > on 3.7-rc3 which means it is before your patches. > > But the irq controller itself is referenced from DT, of course. Yes, you need at least to probe the irq controller from DT. But neither mach-orion5x nor mach-mv78xx0 have DT at all, and they need irq-orion. I am currently in contact with an engineer from LaCie, who has put his hands on a mach-orion5x platform, I hope to work with him to get DT support in mach-orion5x. Best regards, Thomas
On Mon, Oct 29, 2012 at 10:38:59AM +0100, Sebastian Hesselbarth wrote: > On 10/29/2012 10:24 AM, Thomas Petazzoni wrote: > >>using ARCH_MVEBU for enabling irq-armada-370-xp here will lead to > >>incompatibilities with Orion SoCs when they move over to ARCH_MVEBU. > > > >Not really: the driver is probed depending on the DT compatible string. > >So we can perfectly have two irqchip drivers being enabled on > >ARCH_MVEBU. > > I agreed but this will always build irq-armada-370-xp into the kernel > although I maybe want a orion-only kernel. Although multi-platform will > be great for ARM, I doubt that every kernel will be multi-platform? Actually, there are multiple multi-platform kernels, kirkwood is v5 where as 370/XP is v6. So a kirkwood build will not need irq-armada-370-xp. Andrew
diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile index 57f996b..7f4e9f4 100644 --- a/arch/arm/mach-mvebu/Makefile +++ b/arch/arm/mach-mvebu/Makefile @@ -2,4 +2,4 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \ -I$(srctree)/arch/arm/plat-orion/include obj-y += system-controller.o -obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o irq-armada-370-xp.o addr-map.o +obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o addr-map.o diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c index 3d6c540..8e94888 100644 --- a/arch/arm/mach-mvebu/armada-370-xp.c +++ b/arch/arm/mach-mvebu/armada-370-xp.c @@ -16,6 +16,7 @@ #include <linux/init.h> #include <linux/of_platform.h> #include <linux/io.h> +#include <linux/irqchip.h> #include <linux/time-armada-370-xp.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> @@ -57,8 +58,7 @@ static const char * const armada_370_xp_dt_board_dt_compat[] = { DT_MACHINE_START(ARMADA_XP_DT, "Marvell Aramada 370/XP (Device Tree)") .init_machine = armada_370_xp_dt_init, .map_io = armada_370_xp_map_io, - .init_irq = armada_370_xp_init_irq, - .handle_irq = armada_370_xp_handle_irq, + .init_irq = irqchip_init, .timer = &armada_370_xp_timer, .restart = mvebu_restart, .dt_compat = armada_370_xp_dt_board_dt_compat, diff --git a/arch/arm/mach-mvebu/common.h b/arch/arm/mach-mvebu/common.h index 02f89ea..f0eaa21 100644 --- a/arch/arm/mach-mvebu/common.h +++ b/arch/arm/mach-mvebu/common.h @@ -17,7 +17,4 @@ void mvebu_restart(char mode, const char *cmd); -void armada_370_xp_init_irq(void); -void armada_370_xp_handle_irq(struct pt_regs *regs); - #endif diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile index 6b5a6e0..5148ffd 100644 --- a/drivers/irqchip/Makefile +++ b/drivers/irqchip/Makefile @@ -1,2 +1,3 @@ obj-$(CONFIG_IRQCHIP) += irqchip.o obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o +obj-$(CONFIG_ARCH_MVEBU) += irq-armada-370-xp.o diff --git a/arch/arm/mach-mvebu/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c similarity index 87% rename from arch/arm/mach-mvebu/irq-armada-370-xp.c rename to drivers/irqchip/irq-armada-370-xp.c index 5f5f939..140c6b3 100644 --- a/arch/arm/mach-mvebu/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -23,6 +23,7 @@ #include <linux/of_irq.h> #include <linux/irqdomain.h> #include <asm/mach/arch.h> +#include <asm/mach/irq.h> #include <asm/exception.h> /* Interrupt Controller Registers Map */ @@ -77,8 +78,11 @@ static struct irq_domain_ops armada_370_xp_mpic_irq_ops = { .xlate = irq_domain_xlate_onecell, }; -static int __init armada_370_xp_mpic_of_init(struct device_node *node, - struct device_node *parent) +static asmlinkage void +armada_370_xp_handle_irq(struct pt_regs *regs); + +int __init armada_370_xp_mpic_of_init(struct device_node *node, + struct device_node *parent) { u32 control; @@ -98,11 +102,14 @@ static int __init armada_370_xp_mpic_of_init(struct device_node *node, panic("Unable to add Armada_370_Xp MPIC irq domain (DT)\n"); irq_set_default_host(armada_370_xp_mpic_domain); + + handle_arch_irq = armada_370_xp_handle_irq; + return 0; } -asmlinkage void __exception_irq_entry armada_370_xp_handle_irq(struct pt_regs - *regs) +static asmlinkage void __exception_irq_entry +armada_370_xp_handle_irq(struct pt_regs *regs) { u32 irqstat, irqnr; @@ -121,13 +128,3 @@ asmlinkage void __exception_irq_entry armada_370_xp_handle_irq(struct pt_regs break; } while (1); } - -static const struct of_device_id mpic_of_match[] __initconst = { - {.compatible = "marvell,mpic", .data = armada_370_xp_mpic_of_init}, - {}, -}; - -void __init armada_370_xp_init_irq(void) -{ - of_irq_init(mpic_of_match); -} diff --git a/drivers/irqchip/irqchip.c b/drivers/irqchip/irqchip.c index e2496e4..f36d423 100644 --- a/drivers/irqchip/irqchip.c +++ b/drivers/irqchip/irqchip.c @@ -20,6 +20,12 @@ static const struct of_device_id irqchip_of_match[] __initconst = { .data = bcm2835_irqchip_init, }, #endif +#ifdef CONFIG_ARCH_MVEBU + { + .compatible = "marvell,mpic", + .data = armada_370_xp_mpic_of_init, + }, +#endif {}, }; diff --git a/drivers/irqchip/irqchip.h b/drivers/irqchip/irqchip.h index 1075537..0a0d7af 100644 --- a/drivers/irqchip/irqchip.h +++ b/drivers/irqchip/irqchip.h @@ -12,5 +12,7 @@ #define _IRQCHIP_H int bcm2835_irqchip_init(struct device_node *node, struct device_node *parent); +int armada_370_xp_mpic_of_init(struct device_node *node, + struct device_node *parent); #endif