Re: [PATCH 01/12] GPMC context save/restore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 1 Sep 2008, Rajendra Nayak wrote:

> This patch adds the context save restore functions for GPMC
> 
> Signed-off-by: Rajendra Nayak <rnayak@xxxxxx>
> ---
>  arch/arm/mach-omap2/gpmc.c             |   66 +++++++++++++++++++++++++++++++++
>  arch/arm/plat-omap/include/mach/gpmc.h |   29 ++++++++++++++
>  2 files changed, 95 insertions(+)
> 
> Index: linux-omap-2.6/arch/arm/mach-omap2/gpmc.c
> ===================================================================
> --- linux-omap-2.6.orig/arch/arm/mach-omap2/gpmc.c	2008-09-01
> 18:11:29.000000000 +0530
> +++ linux-omap-2.6/arch/arm/mach-omap2/gpmc.c	2008-09-01 18:11:36.000000000 +0530
> @@ -58,6 +58,7 @@ 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_ctx;
> 
>  static u32 gpmc_base;
> 
> @@ -437,3 +438,68 @@ void __init gpmc_init(void)
> 
>  	gpmc_mem_init();
>  }
> +
> +#ifdef CONFIG_ARCH_OMAP3
> +void omap3_save_gpmc_ctx()
> +{
> +	int i;
> +	gpmc_ctx.sysconfig = gpmc_read_reg(GPMC_SYSCONFIG);
> +	gpmc_ctx.irqenable = gpmc_read_reg(GPMC_IRQENABLE);
> +	gpmc_ctx.timeout_ctrl = gpmc_read_reg(GPMC_TIMEOUT_CONTROL);
> +	gpmc_ctx.config = gpmc_read_reg(GPMC_CONFIG);
> +	gpmc_ctx.prefetch_config1 = gpmc_read_reg(GPMC_PREFETCH_CONFIG1);
> +	gpmc_ctx.prefetch_config2 = gpmc_read_reg(GPMC_PREFETCH_CONFIG2);
> +	gpmc_ctx.prefetch_control = gpmc_read_reg(GPMC_PREFETCH_CONTROL);
> +	for (i = 0; i < GPMC_CS_NUM; i++) {
> +		gpmc_ctx.cs_context[i].is_valid =
> +				(gpmc_cs_read_reg(i, GPMC_CS_CONFIG7))
> +								& (1 << 6);

Please use a preprocessor macro in place of (1 << 6).  
"GPMC_CS_CONFIG7_CSVALID" perhaps?


- Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux