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

irqchip/sunxi-nmi: Support sun6i-a31-r-intc compatible

The R_INTC on the A31 is undocumented. It was previously supported
by the sun6i-a31-sc-nmi compatible. This compatible however required
the register region to start at the first used register, rather than
the boundaries laid out in the SoC's memory map. The new compatible
fixes the alignment, while also naming it properly.

Since the only difference between the old and new compatibles are
a fixed offset for the registers, and since the old one is deprecated,
this patch adds a set of register defines for the new compatible,
while modifying the old set to reference the new set minus a fixed
offset.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

authored by

Chen-Yu Tsai and committed by
Marc Zyngier
173bda53 cd647575

+26 -3
+26 -3
drivers/irqchip/irq-sunxi-nmi.c
··· 27 27 28 28 #define SUNXI_NMI_IRQ_BIT BIT(0) 29 29 30 - #define SUN6I_NMI_CTRL 0x00 31 - #define SUN6I_NMI_PENDING 0x04 32 - #define SUN6I_NMI_ENABLE 0x34 30 + #define SUN6I_R_INTC_CTRL 0x0c 31 + #define SUN6I_R_INTC_PENDING 0x10 32 + #define SUN6I_R_INTC_ENABLE 0x40 33 + 34 + /* 35 + * For deprecated sun6i-a31-sc-nmi compatible. 36 + * Registers are offset by 0x0c. 37 + */ 38 + #define SUN6I_R_INTC_NMI_OFFSET 0x0c 39 + #define SUN6I_NMI_CTRL (SUN6I_R_INTC_CTRL - SUN6I_R_INTC_NMI_OFFSET) 40 + #define SUN6I_NMI_PENDING (SUN6I_R_INTC_PENDING - SUN6I_R_INTC_NMI_OFFSET) 41 + #define SUN6I_NMI_ENABLE (SUN6I_R_INTC_ENABLE - SUN6I_R_INTC_NMI_OFFSET) 33 42 34 43 #define SUN7I_NMI_CTRL 0x00 35 44 #define SUN7I_NMI_PENDING 0x04 ··· 59 50 u32 ctrl; 60 51 u32 pend; 61 52 u32 enable; 53 + }; 54 + 55 + static const struct sunxi_sc_nmi_reg_offs sun6i_r_intc_reg_offs __initconst = { 56 + .ctrl = SUN6I_R_INTC_CTRL, 57 + .pend = SUN6I_R_INTC_PENDING, 58 + .enable = SUN6I_R_INTC_ENABLE, 62 59 }; 63 60 64 61 static const struct sunxi_sc_nmi_reg_offs sun6i_reg_offs __initconst = { ··· 231 216 232 217 return ret; 233 218 } 219 + 220 + static int __init sun6i_r_intc_irq_init(struct device_node *node, 221 + struct device_node *parent) 222 + { 223 + return sunxi_sc_nmi_irq_init(node, &sun6i_r_intc_reg_offs); 224 + } 225 + IRQCHIP_DECLARE(sun6i_r_intc, "allwinner,sun6i-a31-r-intc", 226 + sun6i_r_intc_irq_init); 234 227 235 228 static int __init sun6i_sc_nmi_irq_init(struct device_node *node, 236 229 struct device_node *parent)