Skip to content

Commit

Permalink
Merge branch irq/misc-6.3 into irq/irqchip-next
Browse files Browse the repository at this point in the history
* irq/misc-6.3:
  : .
  : - Cleanup Kconfig dependencies for LS_SCFG_MSI
  :
  : - Improve save/restore for the loongson-liointc irqchip
  :
  : - Correctly initialise status and enable registers for one
  :   of the ASpeed controllers
  : .
  irqchip/ls-scfg-msi: Simplify Kconfig dependencies
  irqchip/loongson-liointc: Save/restore int_edge/int_pol registers during S3/S4
  irqchip/aspeed-scu-ic: Correctly initialise status and enable registers

Signed-off-by: Marc Zyngier <maz@kernel.org>
  • Loading branch information
Marc Zyngier committed Feb 6, 2023
2 parents 5f61c69 + 9c1a7bf commit df2d85d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/irqchip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ config LS_EXTIRQ

config LS_SCFG_MSI
def_bool y if SOC_LS1021A || ARCH_LAYERSCAPE
depends on PCI && PCI_MSI
depends on PCI_MSI

config PARTITION_PERCPU
bool
Expand Down
5 changes: 4 additions & 1 deletion drivers/irqchip/irq-aspeed-scu-ic.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@

#define ASPEED_SCU_IC_REG 0x018
#define ASPEED_SCU_IC_SHIFT 0
#define ASPEED_SCU_IC_ENABLE GENMASK(6, ASPEED_SCU_IC_SHIFT)
#define ASPEED_SCU_IC_ENABLE GENMASK(15, ASPEED_SCU_IC_SHIFT)
#define ASPEED_SCU_IC_NUM_IRQS 7
#define ASPEED_SCU_IC_STATUS GENMASK(28, 16)
#define ASPEED_SCU_IC_STATUS_SHIFT 16

#define ASPEED_AST2600_SCU_IC0_REG 0x560
Expand Down Expand Up @@ -155,6 +156,8 @@ static int aspeed_scu_ic_of_init_common(struct aspeed_scu_ic *scu_ic,
rc = PTR_ERR(scu_ic->scu);
goto err;
}
regmap_write_bits(scu_ic->scu, scu_ic->reg, ASPEED_SCU_IC_STATUS, ASPEED_SCU_IC_STATUS);
regmap_write_bits(scu_ic->scu, scu_ic->reg, ASPEED_SCU_IC_ENABLE, 0);

irq = irq_of_parse_and_map(node, 0);
if (!irq) {
Expand Down
13 changes: 13 additions & 0 deletions drivers/irqchip/irq-loongson-liointc.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ struct liointc_priv {
struct liointc_handler_data handler[LIOINTC_NUM_PARENT];
void __iomem *core_isr[LIOINTC_NUM_CORES];
u8 map_cache[LIOINTC_CHIP_IRQ];
u32 int_pol;
u32 int_edge;
bool has_lpc_irq_errata;
};

Expand Down Expand Up @@ -138,6 +140,14 @@ static int liointc_set_type(struct irq_data *data, unsigned int type)
return 0;
}

static void liointc_suspend(struct irq_chip_generic *gc)
{
struct liointc_priv *priv = gc->private;

priv->int_pol = readl(gc->reg_base + LIOINTC_REG_INTC_POL);
priv->int_edge = readl(gc->reg_base + LIOINTC_REG_INTC_EDGE);
}

static void liointc_resume(struct irq_chip_generic *gc)
{
struct liointc_priv *priv = gc->private;
Expand All @@ -150,6 +160,8 @@ static void liointc_resume(struct irq_chip_generic *gc)
/* Restore map cache */
for (i = 0; i < LIOINTC_CHIP_IRQ; i++)
writeb(priv->map_cache[i], gc->reg_base + i);
writel(priv->int_pol, gc->reg_base + LIOINTC_REG_INTC_POL);
writel(priv->int_edge, gc->reg_base + LIOINTC_REG_INTC_EDGE);
/* Restore mask cache */
writel(gc->mask_cache, gc->reg_base + LIOINTC_REG_INTC_ENABLE);
irq_gc_unlock_irqrestore(gc, flags);
Expand Down Expand Up @@ -269,6 +281,7 @@ static int liointc_init(phys_addr_t addr, unsigned long size, int revision,
gc->private = priv;
gc->reg_base = base;
gc->domain = domain;
gc->suspend = liointc_suspend;
gc->resume = liointc_resume;

ct = gc->chip_types;
Expand Down

0 comments on commit df2d85d

Please sign in to comment.