|
@@ -1234,3 +1234,81 @@ static irqreturn_t gpmc_handle_irq(int irq, void *dev)
|
|
|
|
|
|
regval = gpmc_read_reg(GPMC_IRQSTATUS);
|
|
regval = gpmc_read_reg(GPMC_IRQSTATUS);
|
|
|
|
|
|
|
|
+ if (!regval)
|
|
|
|
+ return IRQ_NONE;
|
|
|
|
+
|
|
|
|
+ for (i = 0; i < GPMC_NR_IRQ; i++)
|
|
|
|
+ if (regval & gpmc_client_irq[i].bitmask)
|
|
|
|
+ generic_handle_irq(gpmc_client_irq[i].irq);
|
|
|
|
+
|
|
|
|
+ gpmc_write_reg(GPMC_IRQSTATUS, regval);
|
|
|
|
+
|
|
|
|
+ return IRQ_HANDLED;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+#ifdef CONFIG_ARCH_OMAP3
|
|
|
|
+static struct omap3_gpmc_regs gpmc_context;
|
|
|
|
+
|
|
|
|
+void omap3_gpmc_save_context(void)
|
|
|
|
+{
|
|
|
|
+ int i;
|
|
|
|
+
|
|
|
|
+ gpmc_context.sysconfig = gpmc_read_reg(GPMC_SYSCONFIG);
|
|
|
|
+ gpmc_context.irqenable = gpmc_read_reg(GPMC_IRQENABLE);
|
|
|
|
+ gpmc_context.timeout_ctrl = gpmc_read_reg(GPMC_TIMEOUT_CONTROL);
|
|
|
|
+ gpmc_context.config = gpmc_read_reg(GPMC_CONFIG);
|
|
|
|
+ gpmc_context.prefetch_config1 = gpmc_read_reg(GPMC_PREFETCH_CONFIG1);
|
|
|
|
+ gpmc_context.prefetch_config2 = gpmc_read_reg(GPMC_PREFETCH_CONFIG2);
|
|
|
|
+ gpmc_context.prefetch_control = gpmc_read_reg(GPMC_PREFETCH_CONTROL);
|
|
|
|
+ for (i = 0; i < GPMC_CS_NUM; i++) {
|
|
|
|
+ gpmc_context.cs_context[i].is_valid = gpmc_cs_mem_enabled(i);
|
|
|
|
+ if (gpmc_context.cs_context[i].is_valid) {
|
|
|
|
+ gpmc_context.cs_context[i].config1 =
|
|
|
|
+ gpmc_cs_read_reg(i, GPMC_CS_CONFIG1);
|
|
|
|
+ gpmc_context.cs_context[i].config2 =
|
|
|
|
+ gpmc_cs_read_reg(i, GPMC_CS_CONFIG2);
|
|
|
|
+ gpmc_context.cs_context[i].config3 =
|
|
|
|
+ gpmc_cs_read_reg(i, GPMC_CS_CONFIG3);
|
|
|
|
+ gpmc_context.cs_context[i].config4 =
|
|
|
|
+ gpmc_cs_read_reg(i, GPMC_CS_CONFIG4);
|
|
|
|
+ gpmc_context.cs_context[i].config5 =
|
|
|
|
+ gpmc_cs_read_reg(i, GPMC_CS_CONFIG5);
|
|
|
|
+ gpmc_context.cs_context[i].config6 =
|
|
|
|
+ gpmc_cs_read_reg(i, GPMC_CS_CONFIG6);
|
|
|
|
+ gpmc_context.cs_context[i].config7 =
|
|
|
|
+ gpmc_cs_read_reg(i, GPMC_CS_CONFIG7);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void omap3_gpmc_restore_context(void)
|
|
|
|
+{
|
|
|
|
+ int i;
|
|
|
|
+
|
|
|
|
+ gpmc_write_reg(GPMC_SYSCONFIG, gpmc_context.sysconfig);
|
|
|
|
+ gpmc_write_reg(GPMC_IRQENABLE, gpmc_context.irqenable);
|
|
|
|
+ gpmc_write_reg(GPMC_TIMEOUT_CONTROL, gpmc_context.timeout_ctrl);
|
|
|
|
+ gpmc_write_reg(GPMC_CONFIG, gpmc_context.config);
|
|
|
|
+ gpmc_write_reg(GPMC_PREFETCH_CONFIG1, gpmc_context.prefetch_config1);
|
|
|
|
+ gpmc_write_reg(GPMC_PREFETCH_CONFIG2, gpmc_context.prefetch_config2);
|
|
|
|
+ gpmc_write_reg(GPMC_PREFETCH_CONTROL, gpmc_context.prefetch_control);
|
|
|
|
+ for (i = 0; i < GPMC_CS_NUM; i++) {
|
|
|
|
+ if (gpmc_context.cs_context[i].is_valid) {
|
|
|
|
+ gpmc_cs_write_reg(i, GPMC_CS_CONFIG1,
|
|
|
|
+ gpmc_context.cs_context[i].config1);
|
|
|
|
+ gpmc_cs_write_reg(i, GPMC_CS_CONFIG2,
|
|
|
|
+ gpmc_context.cs_context[i].config2);
|
|
|
|
+ gpmc_cs_write_reg(i, GPMC_CS_CONFIG3,
|
|
|
|
+ gpmc_context.cs_context[i].config3);
|
|
|
|
+ gpmc_cs_write_reg(i, GPMC_CS_CONFIG4,
|
|
|
|
+ gpmc_context.cs_context[i].config4);
|
|
|
|
+ gpmc_cs_write_reg(i, GPMC_CS_CONFIG5,
|
|
|
|
+ gpmc_context.cs_context[i].config5);
|
|
|
|
+ gpmc_cs_write_reg(i, GPMC_CS_CONFIG6,
|
|
|
|
+ gpmc_context.cs_context[i].config6);
|
|
|
|
+ gpmc_cs_write_reg(i, GPMC_CS_CONFIG7,
|
|
|
|
+ gpmc_context.cs_context[i].config7);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+#endif /* CONFIG_ARCH_OMAP3 */
|