Commit 07bf3283 authored by Olof Johansson's avatar Olof Johansson

Merge tag 'omap-for-v3.19/gic-regression-v2' of...

Merge tag 'omap-for-v3.19/gic-regression-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes

Merge "Urgent omap4 legacy interrupt regression fix for v3.19-rc series" from
Tony Lindgren:

A rather urgent pull request to fix omap4 legacy interrupts.

The legacy interrupts on omap4 got broken when gic got changed to
use irq_domain_add_linear() instead of the irq_domain_add_legacy(). We
still have the hardcoded legacy IRQ numbers in use in several places,
most notably the in the legacy DMA. It took a while to figure out
what the problem was and how it should be fixed for the -rc series.

Also include is a regression fix for the dra7 dwc3 suspend.

* tag 'omap-for-v3.19/gic-regression-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP: Work around hardcoded interrupts
  arm: boot: dts: dra7: enable dwc3 suspend PHY quirk
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parents f2c3c67f 0fb22a8f
...@@ -1257,6 +1257,8 @@ usb1: usb@48890000 { ...@@ -1257,6 +1257,8 @@ usb1: usb@48890000 {
tx-fifo-resize; tx-fifo-resize;
maximum-speed = "super-speed"; maximum-speed = "super-speed";
dr_mode = "otg"; dr_mode = "otg";
snps,dis_u3_susphy_quirk;
snps,dis_u2_susphy_quirk;
}; };
}; };
...@@ -1278,6 +1280,8 @@ usb2: usb@488d0000 { ...@@ -1278,6 +1280,8 @@ usb2: usb@488d0000 {
tx-fifo-resize; tx-fifo-resize;
maximum-speed = "high-speed"; maximum-speed = "high-speed";
dr_mode = "otg"; dr_mode = "otg";
snps,dis_u3_susphy_quirk;
snps,dis_u2_susphy_quirk;
}; };
}; };
...@@ -1299,6 +1303,8 @@ usb3: usb@48910000 { ...@@ -1299,6 +1303,8 @@ usb3: usb@48910000 {
tx-fifo-resize; tx-fifo-resize;
maximum-speed = "high-speed"; maximum-speed = "high-speed";
dr_mode = "otg"; dr_mode = "otg";
snps,dis_u3_susphy_quirk;
snps,dis_u2_susphy_quirk;
}; };
}; };
......
...@@ -211,6 +211,7 @@ extern struct device *omap2_get_iva_device(void); ...@@ -211,6 +211,7 @@ extern struct device *omap2_get_iva_device(void);
extern struct device *omap2_get_l3_device(void); extern struct device *omap2_get_l3_device(void);
extern struct device *omap4_get_dsp_device(void); extern struct device *omap4_get_dsp_device(void);
unsigned int omap4_xlate_irq(unsigned int hwirq);
void omap_gic_of_init(void); void omap_gic_of_init(void);
#ifdef CONFIG_CACHE_L2X0 #ifdef CONFIG_CACHE_L2X0
......
...@@ -256,6 +256,38 @@ static int __init omap4_sar_ram_init(void) ...@@ -256,6 +256,38 @@ static int __init omap4_sar_ram_init(void)
} }
omap_early_initcall(omap4_sar_ram_init); omap_early_initcall(omap4_sar_ram_init);
static struct of_device_id gic_match[] = {
{ .compatible = "arm,cortex-a9-gic", },
{ .compatible = "arm,cortex-a15-gic", },
{ },
};
static struct device_node *gic_node;
unsigned int omap4_xlate_irq(unsigned int hwirq)
{
struct of_phandle_args irq_data;
unsigned int irq;
if (!gic_node)
gic_node = of_find_matching_node(NULL, gic_match);
if (WARN_ON(!gic_node))
return hwirq;
irq_data.np = gic_node;
irq_data.args_count = 3;
irq_data.args[0] = 0;
irq_data.args[1] = hwirq - OMAP44XX_IRQ_GIC_START;
irq_data.args[2] = IRQ_TYPE_LEVEL_HIGH;
irq = irq_create_of_mapping(&irq_data);
if (WARN_ON(!irq))
irq = hwirq;
return irq;
}
void __init omap_gic_of_init(void) void __init omap_gic_of_init(void)
{ {
struct device_node *np; struct device_node *np;
......
...@@ -3534,9 +3534,15 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res) ...@@ -3534,9 +3534,15 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)
mpu_irqs_cnt = _count_mpu_irqs(oh); mpu_irqs_cnt = _count_mpu_irqs(oh);
for (i = 0; i < mpu_irqs_cnt; i++) { for (i = 0; i < mpu_irqs_cnt; i++) {
unsigned int irq;
if (oh->xlate_irq)
irq = oh->xlate_irq((oh->mpu_irqs + i)->irq);
else
irq = (oh->mpu_irqs + i)->irq;
(res + r)->name = (oh->mpu_irqs + i)->name; (res + r)->name = (oh->mpu_irqs + i)->name;
(res + r)->start = (oh->mpu_irqs + i)->irq; (res + r)->start = irq;
(res + r)->end = (oh->mpu_irqs + i)->irq; (res + r)->end = irq;
(res + r)->flags = IORESOURCE_IRQ; (res + r)->flags = IORESOURCE_IRQ;
r++; r++;
} }
......
...@@ -676,6 +676,7 @@ struct omap_hwmod { ...@@ -676,6 +676,7 @@ struct omap_hwmod {
spinlock_t _lock; spinlock_t _lock;
struct list_head node; struct list_head node;
struct omap_hwmod_ocp_if *_mpu_port; struct omap_hwmod_ocp_if *_mpu_port;
unsigned int (*xlate_irq)(unsigned int);
u16 flags; u16 flags;
u8 mpu_rt_idx; u8 mpu_rt_idx;
u8 response_lat; u8 response_lat;
......
...@@ -479,6 +479,7 @@ static struct omap_hwmod omap44xx_dma_system_hwmod = { ...@@ -479,6 +479,7 @@ static struct omap_hwmod omap44xx_dma_system_hwmod = {
.class = &omap44xx_dma_hwmod_class, .class = &omap44xx_dma_hwmod_class,
.clkdm_name = "l3_dma_clkdm", .clkdm_name = "l3_dma_clkdm",
.mpu_irqs = omap44xx_dma_system_irqs, .mpu_irqs = omap44xx_dma_system_irqs,
.xlate_irq = omap4_xlate_irq,
.main_clk = "l3_div_ck", .main_clk = "l3_div_ck",
.prcm = { .prcm = {
.omap4 = { .omap4 = {
...@@ -640,6 +641,7 @@ static struct omap_hwmod omap44xx_dss_dispc_hwmod = { ...@@ -640,6 +641,7 @@ static struct omap_hwmod omap44xx_dss_dispc_hwmod = {
.class = &omap44xx_dispc_hwmod_class, .class = &omap44xx_dispc_hwmod_class,
.clkdm_name = "l3_dss_clkdm", .clkdm_name = "l3_dss_clkdm",
.mpu_irqs = omap44xx_dss_dispc_irqs, .mpu_irqs = omap44xx_dss_dispc_irqs,
.xlate_irq = omap4_xlate_irq,
.sdma_reqs = omap44xx_dss_dispc_sdma_reqs, .sdma_reqs = omap44xx_dss_dispc_sdma_reqs,
.main_clk = "dss_dss_clk", .main_clk = "dss_dss_clk",
.prcm = { .prcm = {
...@@ -693,6 +695,7 @@ static struct omap_hwmod omap44xx_dss_dsi1_hwmod = { ...@@ -693,6 +695,7 @@ static struct omap_hwmod omap44xx_dss_dsi1_hwmod = {
.class = &omap44xx_dsi_hwmod_class, .class = &omap44xx_dsi_hwmod_class,
.clkdm_name = "l3_dss_clkdm", .clkdm_name = "l3_dss_clkdm",
.mpu_irqs = omap44xx_dss_dsi1_irqs, .mpu_irqs = omap44xx_dss_dsi1_irqs,
.xlate_irq = omap4_xlate_irq,
.sdma_reqs = omap44xx_dss_dsi1_sdma_reqs, .sdma_reqs = omap44xx_dss_dsi1_sdma_reqs,
.main_clk = "dss_dss_clk", .main_clk = "dss_dss_clk",
.prcm = { .prcm = {
...@@ -726,6 +729,7 @@ static struct omap_hwmod omap44xx_dss_dsi2_hwmod = { ...@@ -726,6 +729,7 @@ static struct omap_hwmod omap44xx_dss_dsi2_hwmod = {
.class = &omap44xx_dsi_hwmod_class, .class = &omap44xx_dsi_hwmod_class,
.clkdm_name = "l3_dss_clkdm", .clkdm_name = "l3_dss_clkdm",
.mpu_irqs = omap44xx_dss_dsi2_irqs, .mpu_irqs = omap44xx_dss_dsi2_irqs,
.xlate_irq = omap4_xlate_irq,
.sdma_reqs = omap44xx_dss_dsi2_sdma_reqs, .sdma_reqs = omap44xx_dss_dsi2_sdma_reqs,
.main_clk = "dss_dss_clk", .main_clk = "dss_dss_clk",
.prcm = { .prcm = {
...@@ -784,6 +788,7 @@ static struct omap_hwmod omap44xx_dss_hdmi_hwmod = { ...@@ -784,6 +788,7 @@ static struct omap_hwmod omap44xx_dss_hdmi_hwmod = {
*/ */
.flags = HWMOD_SWSUP_SIDLE, .flags = HWMOD_SWSUP_SIDLE,
.mpu_irqs = omap44xx_dss_hdmi_irqs, .mpu_irqs = omap44xx_dss_hdmi_irqs,
.xlate_irq = omap4_xlate_irq,
.sdma_reqs = omap44xx_dss_hdmi_sdma_reqs, .sdma_reqs = omap44xx_dss_hdmi_sdma_reqs,
.main_clk = "dss_48mhz_clk", .main_clk = "dss_48mhz_clk",
.prcm = { .prcm = {
......
...@@ -288,6 +288,7 @@ static struct omap_hwmod omap54xx_dma_system_hwmod = { ...@@ -288,6 +288,7 @@ static struct omap_hwmod omap54xx_dma_system_hwmod = {
.class = &omap54xx_dma_hwmod_class, .class = &omap54xx_dma_hwmod_class,
.clkdm_name = "dma_clkdm", .clkdm_name = "dma_clkdm",
.mpu_irqs = omap54xx_dma_system_irqs, .mpu_irqs = omap54xx_dma_system_irqs,
.xlate_irq = omap4_xlate_irq,
.main_clk = "l3_iclk_div", .main_clk = "l3_iclk_div",
.prcm = { .prcm = {
.omap4 = { .omap4 = {
......
...@@ -498,6 +498,7 @@ struct omap_prcm_irq_setup { ...@@ -498,6 +498,7 @@ struct omap_prcm_irq_setup {
u8 nr_irqs; u8 nr_irqs;
const struct omap_prcm_irq *irqs; const struct omap_prcm_irq *irqs;
int irq; int irq;
unsigned int (*xlate_irq)(unsigned int);
void (*read_pending_irqs)(unsigned long *events); void (*read_pending_irqs)(unsigned long *events);
void (*ocp_barrier)(void); void (*ocp_barrier)(void);
void (*save_and_clear_irqen)(u32 *saved_mask); void (*save_and_clear_irqen)(u32 *saved_mask);
......
...@@ -49,6 +49,7 @@ static struct omap_prcm_irq_setup omap4_prcm_irq_setup = { ...@@ -49,6 +49,7 @@ static struct omap_prcm_irq_setup omap4_prcm_irq_setup = {
.irqs = omap4_prcm_irqs, .irqs = omap4_prcm_irqs,
.nr_irqs = ARRAY_SIZE(omap4_prcm_irqs), .nr_irqs = ARRAY_SIZE(omap4_prcm_irqs),
.irq = 11 + OMAP44XX_IRQ_GIC_START, .irq = 11 + OMAP44XX_IRQ_GIC_START,
.xlate_irq = omap4_xlate_irq,
.read_pending_irqs = &omap44xx_prm_read_pending_irqs, .read_pending_irqs = &omap44xx_prm_read_pending_irqs,
.ocp_barrier = &omap44xx_prm_ocp_barrier, .ocp_barrier = &omap44xx_prm_ocp_barrier,
.save_and_clear_irqen = &omap44xx_prm_save_and_clear_irqen, .save_and_clear_irqen = &omap44xx_prm_save_and_clear_irqen,
...@@ -751,8 +752,10 @@ static int omap44xx_prm_late_init(void) ...@@ -751,8 +752,10 @@ static int omap44xx_prm_late_init(void)
} }
/* Once OMAP4 DT is filled as well */ /* Once OMAP4 DT is filled as well */
if (irq_num >= 0) if (irq_num >= 0) {
omap4_prcm_irq_setup.irq = irq_num; omap4_prcm_irq_setup.irq = irq_num;
omap4_prcm_irq_setup.xlate_irq = NULL;
}
} }
omap44xx_prm_enable_io_wakeup(); omap44xx_prm_enable_io_wakeup();
......
...@@ -187,6 +187,7 @@ int omap_prcm_event_to_irq(const char *name) ...@@ -187,6 +187,7 @@ int omap_prcm_event_to_irq(const char *name)
*/ */
void omap_prcm_irq_cleanup(void) void omap_prcm_irq_cleanup(void)
{ {
unsigned int irq;
int i; int i;
if (!prcm_irq_setup) { if (!prcm_irq_setup) {
...@@ -211,7 +212,11 @@ void omap_prcm_irq_cleanup(void) ...@@ -211,7 +212,11 @@ void omap_prcm_irq_cleanup(void)
kfree(prcm_irq_setup->priority_mask); kfree(prcm_irq_setup->priority_mask);
prcm_irq_setup->priority_mask = NULL; prcm_irq_setup->priority_mask = NULL;
irq_set_chained_handler(prcm_irq_setup->irq, NULL); if (prcm_irq_setup->xlate_irq)
irq = prcm_irq_setup->xlate_irq(prcm_irq_setup->irq);
else
irq = prcm_irq_setup->irq;
irq_set_chained_handler(irq, NULL);
if (prcm_irq_setup->base_irq > 0) if (prcm_irq_setup->base_irq > 0)
irq_free_descs(prcm_irq_setup->base_irq, irq_free_descs(prcm_irq_setup->base_irq,
...@@ -259,6 +264,7 @@ int omap_prcm_register_chain_handler(struct omap_prcm_irq_setup *irq_setup) ...@@ -259,6 +264,7 @@ int omap_prcm_register_chain_handler(struct omap_prcm_irq_setup *irq_setup)
int offset, i; int offset, i;
struct irq_chip_generic *gc; struct irq_chip_generic *gc;
struct irq_chip_type *ct; struct irq_chip_type *ct;
unsigned int irq;
if (!irq_setup) if (!irq_setup)
return -EINVAL; return -EINVAL;
...@@ -298,7 +304,11 @@ int omap_prcm_register_chain_handler(struct omap_prcm_irq_setup *irq_setup) ...@@ -298,7 +304,11 @@ int omap_prcm_register_chain_handler(struct omap_prcm_irq_setup *irq_setup)
1 << (offset & 0x1f); 1 << (offset & 0x1f);
} }
irq_set_chained_handler(irq_setup->irq, omap_prcm_irq_handler); if (irq_setup->xlate_irq)
irq = irq_setup->xlate_irq(irq_setup->irq);
else
irq = irq_setup->irq;
irq_set_chained_handler(irq, omap_prcm_irq_handler);
irq_setup->base_irq = irq_alloc_descs(-1, 0, irq_setup->nr_regs * 32, irq_setup->base_irq = irq_alloc_descs(-1, 0, irq_setup->nr_regs * 32,
0); 0);
......
...@@ -66,19 +66,24 @@ void __init omap_pmic_init(int bus, u32 clkrate, ...@@ -66,19 +66,24 @@ void __init omap_pmic_init(int bus, u32 clkrate,
omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1); omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1);
} }
#ifdef CONFIG_ARCH_OMAP4
void __init omap4_pmic_init(const char *pmic_type, void __init omap4_pmic_init(const char *pmic_type,
struct twl4030_platform_data *pmic_data, struct twl4030_platform_data *pmic_data,
struct i2c_board_info *devices, int nr_devices) struct i2c_board_info *devices, int nr_devices)
{ {
/* PMIC part*/ /* PMIC part*/
unsigned int irq;
omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE); omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE);
omap_mux_init_signal("fref_clk0_out.sys_drm_msecure", OMAP_PIN_OUTPUT); omap_mux_init_signal("fref_clk0_out.sys_drm_msecure", OMAP_PIN_OUTPUT);
omap_pmic_init(1, 400, pmic_type, 7 + OMAP44XX_IRQ_GIC_START, pmic_data); irq = omap4_xlate_irq(7 + OMAP44XX_IRQ_GIC_START);
omap_pmic_init(1, 400, pmic_type, irq, pmic_data);
/* Register additional devices on i2c1 bus if needed */ /* Register additional devices on i2c1 bus if needed */
if (devices) if (devices)
i2c_register_board_info(1, devices, nr_devices); i2c_register_board_info(1, devices, nr_devices);
} }
#endif
void __init omap_pmic_late_init(void) void __init omap_pmic_late_init(void)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment