public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Tero Kristo <tero.kristo@nokia.com>
Cc: linux-omap@vger.kernel.org, Paul Walmsley <paul@pwsan.com>
Subject: Re: [PATCH 01/23] ARM: MMU: add a Non-cacheable Normal executable memory type
Date: Mon, 15 Dec 2008 11:06:21 -0800	[thread overview]
Message-ID: <20081215190620.GA10664@atomide.com> (raw)
In-Reply-To: <1229010762-3150-2-git-send-email-tero.kristo@nokia.com>

* Tero Kristo <tero.kristo@nokia.com> [081211 07:59]:
> From: Paul Walmsley <paul@pwsan.com>
> 
> Add a Non-cacheable Normal ARM executable memory type,
> MT_MEMORY_NONCACHED.  This is needed for the OMAP3 SDRAM clock change
> code, which must run from SRAM.  The SRAM must be marked as
> non-cacheable memory to avoid dirty cache line writebacks to SDRAM
> while the SDRAM controller is paused.

This should be discussed on LAKML.

Tony

> Signed-off-by: Paul Walmsley <paul@pwsan.com>
> ---
>  arch/arm/include/asm/mach/map.h |    1 +
>  arch/arm/mm/mmu.c               |   23 +++++++++++++++++++++++
>  2 files changed, 24 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
> index 39d949b..58cf91f 100644
> --- a/arch/arm/include/asm/mach/map.h
> +++ b/arch/arm/include/asm/mach/map.h
> @@ -26,6 +26,7 @@ struct map_desc {
>  #define MT_HIGH_VECTORS		8
>  #define MT_MEMORY		9
>  #define MT_ROM			10
> +#define MT_MEMORY_NONCACHED	11
>  
>  #ifdef CONFIG_MMU
>  extern void iotable_init(struct map_desc *, int);
> diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
> index 7f36c82..9ad6413 100644
> --- a/arch/arm/mm/mmu.c
> +++ b/arch/arm/mm/mmu.c
> @@ -242,6 +242,10 @@ static struct mem_type mem_types[] = {
>  		.prot_sect = PMD_TYPE_SECT,
>  		.domain    = DOMAIN_KERNEL,
>  	},
> +	[MT_MEMORY_NONCACHED] = {
> +		.prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
> +		.domain    = DOMAIN_KERNEL,
> +	},
>  };
>  
>  const struct mem_type *get_mem_type(unsigned int type)
> @@ -405,9 +409,28 @@ static void __init build_mem_type_table(void)
>  		kern_pgprot |= L_PTE_SHARED;
>  		vecs_pgprot |= L_PTE_SHARED;
>  		mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S;
> +		mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S;
>  #endif
>  	}
>  
> +	/*
> +	 * Non-cacheable Normal - intended for memory areas that must
> +	 * not cause cache line evictions when used
> +	 */
> +	if (cpu_arch >= CPU_ARCH_ARMv6) {
> +		if (cpu_arch >= CPU_ARCH_ARMv7 && (cr & CR_TRE)) {
> +			/* Non-cacheable Normal is XCB = 001 */
> +			mem_types[MT_MEMORY_NONCACHED].prot_sect |=
> +				PMD_SECT_BUFFERED;
> +		} else {
> +			/* For both ARMv6 and non-TEX-remapping ARMv7 */
> +			mem_types[MT_MEMORY_NONCACHED].prot_sect |=
> +				PMD_SECT_TEX(1);
> +		}
> +	} else {
> +		mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_BUFFERABLE;
> +	}
> +
>  	for (i = 0; i < 16; i++) {
>  		unsigned long v = pgprot_val(protection_map[i]);
>  		protection_map[i] = __pgprot(v | user_pgprot);
> -- 
> 1.5.4.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2008-12-15 19:06 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-11 15:52 OMAP3: DVFS core patch set Tero Kristo
2008-12-11 15:52 ` [PATCH 01/23] ARM: MMU: add a Non-cacheable Normal executable memory type Tero Kristo
2008-12-11 15:52   ` [PATCH 02/23] OMAP3 SRAM: mark OCM RAM as Non-cacheable Normal memory Tero Kristo
2008-12-11 15:52     ` [PATCH 03/23] OMAP3 SRAM: add ARM barriers to omap3_sram_configure_core_dpll Tero Kristo
2008-12-11 15:52       ` [PATCH 04/23] OMAP3 clock: add interconnect barriers to CORE DPLL M2 change Tero Kristo
2008-12-11 15:52         ` [PATCH 05/23] OMAP3 SRAM: clear the SDRC PWRENA bit during SDRC frequency change Tero Kristo
2008-12-11 15:52           ` [PATCH 06/23] OMAP3 SDRC: Add 166MHz, 83MHz SDRC settings for the BeagleBoard Tero Kristo
2008-12-11 15:52             ` [PATCH 07/23] OMAP3 SDRC: initialize SDRC_POWER at boot Tero Kristo
2008-12-11 15:52               ` [PATCH 08/23] OMAP3 SRAM: renumber registers to make space for argument passing Tero Kristo
2008-12-11 15:52                 ` [PATCH 09/23] OMAP3 clock: only unlock SDRC DLL if SDRC clk < 83MHz Tero Kristo
2008-12-11 15:52                   ` [PATCH 10/23] OMAP3 clock: use pr_debug() rather than pr_info() in some clock change code Tero Kristo
2008-12-11 15:52                     ` [PATCH 11/23] OMAP3 clock: remove wait for DPLL3 M2 clock to stabilize Tero Kristo
2008-12-11 15:52                       ` [PATCH 12/23] OMAP3 clock: initialize SDRC timings at kernel start Tero Kristo
2008-12-11 15:52                         ` [PATCH 13/23] OMAP3 clock: add a short delay when lowering CORE clk rate Tero Kristo
2008-12-11 15:52                           ` [PATCH 14/23] OMAP3 clock/SDRC: program SDRC_MR register during SDRC clock change Tero Kristo
2008-12-11 15:52                             ` [PATCH 15/23] OMAP3 SRAM: add more comments on the SRAM code Tero Kristo
2008-12-11 15:52                               ` [PATCH 16/23] OMAP3 SRAM: convert SRAM code to use macros rather than magic numbers Tero Kristo
2008-12-11 15:52                                 ` [PATCH 17/23] OMAP3: PM: Fixed VDD2 control to work from both sysfs and SRF API Tero Kristo
2008-12-11 15:52                                   ` [PATCH 18/23] OMAP3: PM: Added DVFS OPP locking interface for VDD1 and VDD2 Tero Kristo
2008-12-11 15:52                                     ` [PATCH 19/23] OMAP3: Fix rate calculation bug in omap3_select_table_rate Tero Kristo
2008-12-11 15:52                                       ` [PATCH 20/23] OMAP3: Add support for DPLL3 divisor values higher than 2 Tero Kristo
2008-12-11 15:52                                         ` [PATCH 21/23] OMAP3: PM: Prevented DVFS state switches when enabling off-mode Tero Kristo
2008-12-11 15:52                                           ` [PATCH 22/23] OMAP3: PM: Enable VDD2 OPP1 Tero Kristo
2008-12-11 15:52                                             ` [PATCH 23/23] OMAP3: PM: Fix linker error without CONFIG_PM option Tero Kristo
2008-12-11 16:06                                         ` [PATCH 20/23] OMAP3: Add support for DPLL3 divisor values higher than 2 Paul Walmsley
2008-12-11 16:38                                           ` Tero.Kristo
2008-12-15 19:07     ` [PATCH 02/23] OMAP3 SRAM: mark OCM RAM as Non-cacheable Normal memory Tony Lindgren
2008-12-15 19:06   ` Tony Lindgren [this message]
2008-12-15 19:58     ` [PATCH 01/23] ARM: MMU: add a Non-cacheable Normal executable memory type Paul Walmsley
2008-12-12  1:59 ` OMAP3: DVFS core patch set Paul Walmsley
2008-12-18  8:22   ` Paul Walmsley
2008-12-15 21:48 ` Kevin Hilman

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=20081215190620.GA10664@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=tero.kristo@nokia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox