From: Tony Lindgren <tony@atomide.com>
To: Kevin Hilman <khilman@deeprootsystems.com>
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Rajendra Nayak <rnayak@ti.com>
Subject: Re: [PATCH 03/27] OMAP3: PM: INTC context save/restore
Date: Wed, 14 Oct 2009 15:15:13 -0700 [thread overview]
Message-ID: <20091014221512.GN12700@atomide.com> (raw)
In-Reply-To: <1255557490-16787-4-git-send-email-khilman@deeprootsystems.com>
* Kevin Hilman <khilman@deeprootsystems.com> [091014 15:10]:
> From: Rajendra Nayak <rnayak@ti.com>
>
> Signed-off-by: Rajendra Nayak <rnayak@ti.com>
> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
> ---
> arch/arm/mach-omap2/irq.c | 66 ++++++++++++++++++++++++++++++++
> arch/arm/plat-omap/include/mach/irqs.h | 5 ++
> 2 files changed, 71 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
> index 8db0e3a..fa2524d 100644
> --- a/arch/arm/mach-omap2/irq.c
> +++ b/arch/arm/mach-omap2/irq.c
> @@ -25,6 +25,10 @@
> #define INTC_SYSSTATUS 0x0014
> #define INTC_SIR 0x0040
> #define INTC_CONTROL 0x0048
> +#define INTC_PROTECTION 0x004C
> +#define INTC_IDLE 0x0050
> +#define INTC_THRESHOLD 0x0068
> +#define INTC_MIR0 0x0084
> #define INTC_MIR_CLEAR0 0x0088
> #define INTC_MIR_SET0 0x008c
> #define INTC_PENDING_IRQ0 0x0098
> @@ -48,6 +52,18 @@ static struct omap_irq_bank {
> },
> };
>
> +/* Structure to save interrupt controller context */
> +struct omap3_intc_regs {
> + u32 sysconfig;
> + u32 protection;
> + u32 idle;
> + u32 threshold;
> + u32 ilr[INTCPS_NR_IRQS];
> + u32 mir[INTCPS_NR_MIR_REGS];
> +};
> +
> +static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)];
> +
> /* INTC bank register get/set */
>
> static void intc_bank_write_reg(u32 val, struct omap_irq_bank *bank, u16 reg)
> @@ -201,3 +217,53 @@ void __init omap_init_irq(void)
> }
> }
>
> +#ifdef CONFIG_ARCH_OMAP3
> +void omap3_intc_save_context(void)
> +{
> + int ind = 0, i = 0;
> + for (ind = 0; ind < ARRAY_SIZE(irq_banks); ind++) {
> + struct omap_irq_bank *bank = irq_banks + ind;
> + intc_context[ind].sysconfig =
> + intc_bank_read_reg(bank, INTC_SYSCONFIG);
> + intc_context[ind].protection =
> + intc_bank_read_reg(bank, INTC_PROTECTION);
> + intc_context[ind].idle =
> + intc_bank_read_reg(bank, INTC_IDLE);
> + intc_context[ind].threshold =
> + intc_bank_read_reg(bank, INTC_THRESHOLD);
> + for (i = 0; i < INTCPS_NR_IRQS; i++)
> + intc_context[ind].ilr[i] =
> + intc_bank_read_reg(bank, (0x100 + 0x4*ind));
> + for (i = 0; i < INTCPS_NR_MIR_REGS; i++)
> + intc_context[ind].mir[i] =
> + intc_bank_read_reg(&irq_banks[0], INTC_MIR0 +
> + (0x20 * i));
> + }
> +}
> +
These too look like they should work on 24xx and 34xx?
> +void omap3_intc_restore_context(void)
> +{
> + int ind = 0, i = 0;
> +
> + for (ind = 0; ind < ARRAY_SIZE(irq_banks); ind++) {
> + struct omap_irq_bank *bank = irq_banks + ind;
> + intc_bank_write_reg(intc_context[ind].sysconfig,
> + bank, INTC_SYSCONFIG);
> + intc_bank_write_reg(intc_context[ind].sysconfig,
> + bank, INTC_SYSCONFIG);
> + intc_bank_write_reg(intc_context[ind].protection,
> + bank, INTC_PROTECTION);
> + intc_bank_write_reg(intc_context[ind].idle,
> + bank, INTC_IDLE);
> + intc_bank_write_reg(intc_context[ind].threshold,
> + bank, INTC_THRESHOLD);
> + for (i = 0; i < INTCPS_NR_IRQS; i++)
> + intc_bank_write_reg(intc_context[ind].ilr[i],
> + bank, (0x100 + 0x4*ind));
> + for (i = 0; i < INTCPS_NR_MIR_REGS; i++)
> + intc_bank_write_reg(intc_context[ind].mir[i],
> + &irq_banks[0], INTC_MIR0 + (0x20 * i));
> + }
> + /* MIRs are saved and restore with other PRCM registers */
> +}
> +#endif /* CONFIG_ARCH_OMAP3 */
> diff --git a/arch/arm/plat-omap/include/mach/irqs.h b/arch/arm/plat-omap/include/mach/irqs.h
> index 6a6d028..2473910 100644
> --- a/arch/arm/plat-omap/include/mach/irqs.h
> +++ b/arch/arm/plat-omap/include/mach/irqs.h
> @@ -477,9 +477,14 @@
>
> #define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32))
>
> +#define INTCPS_NR_MIR_REGS 3
> +#define INTCPS_NR_IRQS 96
> +
> #ifndef __ASSEMBLY__
> extern void omap_init_irq(void);
> extern int omap_irq_pending(void);
> +void omap3_intc_save_context(void);
> +void omap3_intc_restore_context(void);
> #endif
>
> #include <mach/hardware.h>
> --
> 1.6.4.3
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/27] OMAP3: PM: INTC context save/restore
Date: Wed, 14 Oct 2009 15:15:13 -0700 [thread overview]
Message-ID: <20091014221512.GN12700@atomide.com> (raw)
In-Reply-To: <1255557490-16787-4-git-send-email-khilman@deeprootsystems.com>
* Kevin Hilman <khilman@deeprootsystems.com> [091014 15:10]:
> From: Rajendra Nayak <rnayak@ti.com>
>
> Signed-off-by: Rajendra Nayak <rnayak@ti.com>
> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
> ---
> arch/arm/mach-omap2/irq.c | 66 ++++++++++++++++++++++++++++++++
> arch/arm/plat-omap/include/mach/irqs.h | 5 ++
> 2 files changed, 71 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
> index 8db0e3a..fa2524d 100644
> --- a/arch/arm/mach-omap2/irq.c
> +++ b/arch/arm/mach-omap2/irq.c
> @@ -25,6 +25,10 @@
> #define INTC_SYSSTATUS 0x0014
> #define INTC_SIR 0x0040
> #define INTC_CONTROL 0x0048
> +#define INTC_PROTECTION 0x004C
> +#define INTC_IDLE 0x0050
> +#define INTC_THRESHOLD 0x0068
> +#define INTC_MIR0 0x0084
> #define INTC_MIR_CLEAR0 0x0088
> #define INTC_MIR_SET0 0x008c
> #define INTC_PENDING_IRQ0 0x0098
> @@ -48,6 +52,18 @@ static struct omap_irq_bank {
> },
> };
>
> +/* Structure to save interrupt controller context */
> +struct omap3_intc_regs {
> + u32 sysconfig;
> + u32 protection;
> + u32 idle;
> + u32 threshold;
> + u32 ilr[INTCPS_NR_IRQS];
> + u32 mir[INTCPS_NR_MIR_REGS];
> +};
> +
> +static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)];
> +
> /* INTC bank register get/set */
>
> static void intc_bank_write_reg(u32 val, struct omap_irq_bank *bank, u16 reg)
> @@ -201,3 +217,53 @@ void __init omap_init_irq(void)
> }
> }
>
> +#ifdef CONFIG_ARCH_OMAP3
> +void omap3_intc_save_context(void)
> +{
> + int ind = 0, i = 0;
> + for (ind = 0; ind < ARRAY_SIZE(irq_banks); ind++) {
> + struct omap_irq_bank *bank = irq_banks + ind;
> + intc_context[ind].sysconfig =
> + intc_bank_read_reg(bank, INTC_SYSCONFIG);
> + intc_context[ind].protection =
> + intc_bank_read_reg(bank, INTC_PROTECTION);
> + intc_context[ind].idle =
> + intc_bank_read_reg(bank, INTC_IDLE);
> + intc_context[ind].threshold =
> + intc_bank_read_reg(bank, INTC_THRESHOLD);
> + for (i = 0; i < INTCPS_NR_IRQS; i++)
> + intc_context[ind].ilr[i] =
> + intc_bank_read_reg(bank, (0x100 + 0x4*ind));
> + for (i = 0; i < INTCPS_NR_MIR_REGS; i++)
> + intc_context[ind].mir[i] =
> + intc_bank_read_reg(&irq_banks[0], INTC_MIR0 +
> + (0x20 * i));
> + }
> +}
> +
These too look like they should work on 24xx and 34xx?
> +void omap3_intc_restore_context(void)
> +{
> + int ind = 0, i = 0;
> +
> + for (ind = 0; ind < ARRAY_SIZE(irq_banks); ind++) {
> + struct omap_irq_bank *bank = irq_banks + ind;
> + intc_bank_write_reg(intc_context[ind].sysconfig,
> + bank, INTC_SYSCONFIG);
> + intc_bank_write_reg(intc_context[ind].sysconfig,
> + bank, INTC_SYSCONFIG);
> + intc_bank_write_reg(intc_context[ind].protection,
> + bank, INTC_PROTECTION);
> + intc_bank_write_reg(intc_context[ind].idle,
> + bank, INTC_IDLE);
> + intc_bank_write_reg(intc_context[ind].threshold,
> + bank, INTC_THRESHOLD);
> + for (i = 0; i < INTCPS_NR_IRQS; i++)
> + intc_bank_write_reg(intc_context[ind].ilr[i],
> + bank, (0x100 + 0x4*ind));
> + for (i = 0; i < INTCPS_NR_MIR_REGS; i++)
> + intc_bank_write_reg(intc_context[ind].mir[i],
> + &irq_banks[0], INTC_MIR0 + (0x20 * i));
> + }
> + /* MIRs are saved and restore with other PRCM registers */
> +}
> +#endif /* CONFIG_ARCH_OMAP3 */
> diff --git a/arch/arm/plat-omap/include/mach/irqs.h b/arch/arm/plat-omap/include/mach/irqs.h
> index 6a6d028..2473910 100644
> --- a/arch/arm/plat-omap/include/mach/irqs.h
> +++ b/arch/arm/plat-omap/include/mach/irqs.h
> @@ -477,9 +477,14 @@
>
> #define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32))
>
> +#define INTCPS_NR_MIR_REGS 3
> +#define INTCPS_NR_IRQS 96
> +
> #ifndef __ASSEMBLY__
> extern void omap_init_irq(void);
> extern int omap_irq_pending(void);
> +void omap3_intc_save_context(void);
> +void omap3_intc_restore_context(void);
> #endif
>
> #include <mach/hardware.h>
> --
> 1.6.4.3
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2009-10-14 22:15 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-14 21:57 [PATCH 00/27] OMAP3: PM: base off-mode support Kevin Hilman
2009-10-14 21:57 ` Kevin Hilman
2009-10-14 21:57 ` [PATCH 01/27] OMAP3: PM: GPMC context save/restore Kevin Hilman
2009-10-14 21:57 ` Kevin Hilman
2009-10-14 21:57 ` [PATCH 02/27] OMAP3: PM: GPIO " Kevin Hilman
2009-10-14 21:57 ` Kevin Hilman
2009-10-14 21:57 ` [PATCH 03/27] OMAP3: PM: INTC " Kevin Hilman
2009-10-14 21:57 ` Kevin Hilman
2009-10-14 21:57 ` [PATCH 04/27] OMAP3: PM: PRCM " Kevin Hilman
2009-10-14 21:57 ` Kevin Hilman
2009-10-14 21:57 ` [PATCH 05/27] OMAP3: PM: Populate scratchpad contents Kevin Hilman
2009-10-14 21:57 ` Kevin Hilman
2009-10-14 21:57 ` [PATCH 06/27] OMAP3: PM: SCM context save/restore Kevin Hilman
2009-10-14 21:57 ` Kevin Hilman
2009-10-14 21:57 ` [PATCH 07/27] OMAP3: PM: SRAM restore function Kevin Hilman
2009-10-14 21:57 ` Kevin Hilman
2009-10-14 21:57 ` [PATCH 08/27] OMAP3: PM: handle PER/NEON/CORE in idle Kevin Hilman
2009-10-14 21:57 ` Kevin Hilman
2009-10-14 21:57 ` [PATCH 09/27] OMAP3: PM: Restore MMU table entry Kevin Hilman
2009-10-14 21:57 ` Kevin Hilman
2009-10-14 21:57 ` [PATCH 10/27] OMAP3: PM: MPU off-mode support Kevin Hilman
2009-10-14 21:57 ` Kevin Hilman
2009-10-14 21:57 ` [PATCH 11/27] OMAP3: PM: CORE domain " Kevin Hilman
2009-10-14 21:57 ` Kevin Hilman
2009-10-14 21:57 ` [PATCH 12/27] OMAP: PM: DMA context save/restore for " Kevin Hilman
2009-10-14 21:57 ` Kevin Hilman
2009-10-14 21:57 ` [PATCH 13/27] OMAP3 PM: off-mode support for HS/EMU devices Kevin Hilman
2009-10-14 21:57 ` Kevin Hilman
2009-10-14 21:57 ` [PATCH 14/27] OMAP3: PM: save secure RAM only during init Kevin Hilman
2009-10-14 21:57 ` Kevin Hilman
2009-10-14 21:57 ` [PATCH 15/27] OMAP3: PM: Enable SDRAM auto-refresh during sleep Kevin Hilman
2009-10-14 21:57 ` Kevin Hilman
2009-10-14 21:57 ` [PATCH 16/27] OMAP3: PM: Save and restore also CM_CLKSEL1_PLL_IVA2 Kevin Hilman
2009-10-14 21:57 ` Kevin Hilman
2009-10-14 21:58 ` [PATCH 17/27] OMAP3: PM: Fix secure SRAM context save/restore Kevin Hilman
2009-10-14 21:58 ` Kevin Hilman
2009-10-14 21:58 ` [PATCH 18/27] ARM: OMAP: Add missing SMS_SYSCONFIG save/restore Kevin Hilman
2009-10-14 21:58 ` Kevin Hilman
2009-10-14 21:58 ` [PATCH 19/27] OMAP3: PM: Fix PLL_MOD CLKEN offset in scratchpad Kevin Hilman
2009-10-14 21:58 ` Kevin Hilman
2009-10-14 21:58 ` [PATCH 20/27] OMAP: PM: Clear DMA channel state after a wakeup Kevin Hilman
2009-10-14 21:58 ` Kevin Hilman
2009-10-14 21:58 ` [PATCH 21/27] OMAP: Store reboot mode in scratchpad on OMAP34xx Kevin Hilman
2009-10-14 21:58 ` Kevin Hilman
2009-10-14 21:58 ` [PATCH 22/27] OMAP3: PM: SDRC auto-refresh workaround for off-mode Kevin Hilman
2009-10-14 21:58 ` Kevin Hilman
2009-10-14 21:58 ` [PATCH 23/27] OMAP3: PM: Fix INTC context save/restore Kevin Hilman
2009-10-14 21:58 ` Kevin Hilman
2009-10-14 21:58 ` [PATCH 24/27] PM: Disable usb host HW save and restore Kevin Hilman
2009-10-14 21:58 ` Kevin Hilman
2009-10-14 21:58 ` [PATCH 25/27] OMAP3: PM: Wait for SDRC ready iso a blind delay Kevin Hilman
2009-10-14 21:58 ` Kevin Hilman
2009-10-14 21:58 ` [PATCH 26/27] OMAP3: PM debug: allow runtime toggle of PM features Kevin Hilman
2009-10-14 21:58 ` Kevin Hilman
2009-10-14 21:58 ` [PATCH 27/27] PM debug: allow configurable wakeup from suspend on OMAP GPtimer Kevin Hilman
2009-10-14 21:58 ` Kevin Hilman
2009-10-14 22:18 ` [PATCH 08/27] OMAP3: PM: handle PER/NEON/CORE in idle Tony Lindgren
2009-10-14 22:18 ` Tony Lindgren
2009-10-14 22:17 ` [PATCH 07/27] OMAP3: PM: SRAM restore function Tony Lindgren
2009-10-14 22:17 ` Tony Lindgren
2009-10-14 22:15 ` Tony Lindgren [this message]
2009-10-14 22:15 ` [PATCH 03/27] OMAP3: PM: INTC context save/restore Tony Lindgren
2009-10-14 22:13 ` [PATCH 02/27] OMAP3: PM: GPIO " Tony Lindgren
2009-10-14 22:13 ` Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091014221512.GN12700@atomide.com \
--to=tony@atomide.com \
--cc=khilman@deeprootsystems.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=rnayak@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.