All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <menon.nishanth@gmail.com>
To: Kevin Hilman <khilman@deeprootsystems.com>
Cc: linux-omap@vger.kernel.org, Rajendra Nayak <rnayak@ti.com>
Subject: Re: [PATCH 01/28] OMAP3: PM: GPMC context save/restore
Date: Sat, 03 Oct 2009 09:48:52 -0500	[thread overview]
Message-ID: <4AC76454.20605@gmail.com> (raw)
In-Reply-To: <1254441538-9257-2-git-send-email-khilman@deeprootsystems.com>

Kevin Hilman said the following on 10/01/2009 06:58 PM:
> From: Rajendra Nayak <rnayak@ti.com>
>
> This patch adds the context save restore functions for GPMC
>
> Signed-off-by: Rajendra Nayak <rnayak@ti.com>
> ---
>  arch/arm/mach-omap2/gpmc.c             |   93 ++++++++++++++++++++++++++++++++
>  arch/arm/plat-omap/include/mach/gpmc.h |    3 +
>  2 files changed, 96 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
> index 1587682..86ea936 100644
> --- a/arch/arm/mach-omap2/gpmc.c
> +++ b/arch/arm/mach-omap2/gpmc.c
> @@ -62,10 +62,38 @@
>  #define ENABLE_PREFETCH		(0x1 << 7)
>  #define DMA_MPU_MODE		2
>  
> +/* Structure to save gpmc cs context */
> +struct gpmc_cs_config {
> +	u32 config1;
> +	u32 config2;
> +	u32 config3;
> +	u32 config4;
> +	u32 config5;
> +	u32 config6;
> +	u32 config7;
> +	int is_valid;
> +};
> +
> +/*
> + * Structure to save/restore gpmc context
> + * to support core off on OMAP3
> + */
> +struct omap3_gpmc_regs {
> +	u32 sysconfig;
> +	u32 irqenable;
> +	u32 timeout_ctrl;
> +	u32 config;
> +	u32 prefetch_config1;
> +	u32 prefetch_config2;
> +	u32 prefetch_control;
> +	struct gpmc_cs_config cs_context[GPMC_CS_NUM];
> +};
> +
>  static struct resource	gpmc_mem_root;
>  static struct resource	gpmc_cs_mem[GPMC_CS_NUM];
>  static DEFINE_SPINLOCK(gpmc_mem_lock);
>  static unsigned		gpmc_cs_map;
> +static struct omap3_gpmc_regs gpmc_context;
>  
>  static void __iomem *gpmc_base;
>  
> @@ -516,3 +544,68 @@ void __init gpmc_init(void)
>  	gpmc_write_reg(GPMC_SYSCONFIG, l);
>  	gpmc_mem_init();
>  }
> +
> +#ifdef CONFIG_ARCH_OMAP3
>   
apologies if this is a dumb question - why is this under #ifdef -> if
the save save restore structures are not under #ifdef?
> +void omap3_gpmc_save_context()
> +{
> +	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_read_reg(i, GPMC_CS_CONFIG7))
> +							& GPMC_CONFIG7_CSVALID;
> +		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);
> +		}
>   
here is a theoretical bug:
1: GPMC, 1, 2, 3 4 5 configured 6 7 not configured.
2. Save and restore 1: save and restore variables which are static will
contain 1-5 and not 6&7
3. next I disable 2,3
3. save will save 1,4,5 BUT my variable will contain 1,2,3,4,5 ->
restore will rename 2,3 (which I did not intend)..

Regards,
Nishanth Menon

  parent reply	other threads:[~2009-10-03 14:56 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-01 23:58 [PATCH 00/28] OMAP3: PM: base OFF-mode support Kevin Hilman
2009-10-01 23:58 ` [PATCH 01/28] OMAP3: PM: GPMC context save/restore Kevin Hilman
2009-10-01 23:58   ` [PATCH 02/28] OMAP3: PM: GPIO " Kevin Hilman
2009-10-01 23:58     ` [PATCH 03/28] OMAP3: PM: INTC " Kevin Hilman
2009-10-01 23:58       ` [PATCH 04/28] OMAP3: PM: PRCM " Kevin Hilman
2009-10-01 23:58         ` [PATCH 05/28] OMAP3: PM: Populate scratchpad contents Kevin Hilman
2009-10-01 23:58           ` [PATCH 06/28] OMAP3: PM: SCM context save/restore Kevin Hilman
2009-10-01 23:58             ` [PATCH 07/28] OMAP3: PM: SRAM restore function Kevin Hilman
2009-10-01 23:58               ` [PATCH 08/28] OMAP3: PM: handle PER/NEON/CORE in idle Kevin Hilman
2009-10-01 23:58                 ` [PATCH 09/28] OMAP3: PM: Restore MMU table entry Kevin Hilman
2009-10-01 23:58                   ` [PATCH 10/28] OMAP3: PM: MPU off-mode support Kevin Hilman
2009-10-01 23:58                     ` [PATCH 11/28] OMAP3: PM: CORE domain " Kevin Hilman
2009-10-01 23:58                       ` [PATCH 12/28] OMAP: PM: DMA context save / restore Kevin Hilman
2009-10-01 23:58                         ` [PATCH 13/28] OMAP: PM: off-mode support for DMA on EMU/HS devices Kevin Hilman
2009-10-01 23:58                           ` [PATCH 14/28] OMAP3 PM: off-mode support for HS/EMU devices Kevin Hilman
2009-10-01 23:58                             ` [PATCH 15/28] OMAP3: PM: save secure RAM only during init Kevin Hilman
2009-10-01 23:58                               ` [PATCH 16/28] OMAP3: PM: Enable SDRAM auto-refresh during sleep Kevin Hilman
2009-10-01 23:58                                 ` [PATCH 17/28] PM: Added three PLL registers to the PRCM context save Kevin Hilman
2009-10-01 23:58                                   ` [PATCH 18/28] PM: Changed secure RAM storage size from 0x8000 to 0x803F Kevin Hilman
2009-10-01 23:58                                     ` [PATCH 19/28] OMAP3: PM: Save and restore also CM_CLKSEL1_PLL_IVA2 Kevin Hilman
2009-10-01 23:58                                       ` [PATCH 20/28] OMAP3: PM: Fix secure SRAM context save/restore Kevin Hilman
2009-10-01 23:58                                         ` [PATCH 21/28] ARM: OMAP: Add missing SMS_SYSCONFIG save/restore Kevin Hilman
2009-10-01 23:58                                           ` [PATCH 22/28] OMAP3: PM: Fix PLL_MOD CLKEN offset in scratchpad Kevin Hilman
2009-10-01 23:58                                             ` [PATCH 23/28] OMAP: PM: Clear DMA channel state after a wakeup Kevin Hilman
2009-10-01 23:58                                               ` [PATCH 24/28] OMAP: Store reboot mode in scratchpad on OMAP34xx Kevin Hilman
2009-10-01 23:58                                                 ` [PATCH 25/28] OMAP3: PM: SDRC auto-refresh workaround for off-mode Kevin Hilman
2009-10-01 23:58                                                   ` [PATCH 26/28] OMAP3: PM: Fix INTC context save/restore Kevin Hilman
2009-10-01 23:58                                                     ` [PATCH 27/28] PM: Disable usb host HW save and restore Kevin Hilman
2009-10-01 23:58                                                       ` [PATCH 28/28] OMAP3: PM: Wait for SDRC ready iso a blind delay Kevin Hilman
2009-10-03 14:53     ` [PATCH 02/28] OMAP3: PM: GPIO context save/restore Nishanth Menon
2009-10-05 17:35       ` Kevin Hilman
2009-10-05 18:02         ` Nishanth Menon
2009-10-05 18:21           ` Kevin Hilman
2009-10-03 14:48   ` Nishanth Menon [this message]
2009-10-05 17:17     ` [PATCH 01/28] OMAP3: PM: GPMC " Kevin Hilman
2009-10-05 17:31       ` Nishanth Menon
2009-10-05 17:29     ` Kevin Hilman
2009-10-05 17:58       ` Nishanth Menon
2009-10-05 18:15         ` Kevin Hilman
2009-10-05 18:32           ` Nishanth Menon

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=4AC76454.20605@gmail.com \
    --to=menon.nishanth@gmail.com \
    --cc=khilman@deeprootsystems.com \
    --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.