All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: linux-omap@vger.kernel.org, nm@ti.com, mans@mansr.com,
	tony@atomide.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/5] omap4: l2x0: Construct the AUXCTRL value using defines
Date: Mon, 22 Nov 2010 12:11:01 -0800	[thread overview]
Message-ID: <8762vpp19m.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1290187866-26941-3-git-send-email-santosh.shilimkar@ti.com> (Santosh Shilimkar's message of "Fri, 19 Nov 2010 23:01:03 +0530")

Santosh Shilimkar <santosh.shilimkar@ti.com> writes:

> This patch removes the hardcoded value of auxctrl value and
> construct it using bitfields
>
> Bit 25 is reserved and is always set to 1. Same value
> of this bit is retained in this patch

Is this OMAP specific, or is this ARM generic?

> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Tested-by: Nishanth Menon <nm@ti.com>
> ---
>  arch/arm/mach-omap2/omap4-common.c |   13 +++++++++++--
>  1 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
> index 2f89555..c814604 100644
> --- a/arch/arm/mach-omap2/omap4-common.c
> +++ b/arch/arm/mach-omap2/omap4-common.c
> @@ -53,6 +53,8 @@ static void omap4_l2x0_disable(void)
>  
>  static int __init omap_l2_cache_init(void)
>  {
> +	u32 aux_ctrl = 0;
> +
>  	/*
>  	 * To avoid code running on other OMAPs in
>  	 * multi-omap builds
> @@ -72,10 +74,17 @@ static int __init omap_l2_cache_init(void)
>  	 * Way size - 32KB (es1.0)
>  	 * Way size - 64KB (es2.0 +)
>  	 */
> +	aux_ctrl = ((1 << L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT) |
> +			(0x1 << 25) |

it doesn't look right to have a single hard-coded constant here among
the others.   Either give this a name (RESERVED_ALWAYS_1, or something)
or add a comment to the code like is done in the changelog.

> +			(0x1 << L2X0_AUX_CTRL_NS_LOCKDOWN_SHIFT) |
> +			(0x1 << L2X0_AUX_CTRL_NS_INT_CTRL_SHIFT));
> +
>  	if (omap_rev() == OMAP4430_REV_ES1_0)
> -		l2x0_init(l2cache_base, 0x0e050000, 0xc0000fff);
> +		aux_ctrl |= 0x2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT;
>  	else
> -		l2x0_init(l2cache_base, 0x0e070000, 0xc0000fff);
> +		aux_ctrl |= 0x3 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT;
> +
> +	l2x0_init(l2cache_base, aux_ctrl, L2X0_AUX_CTRL_MASK);
>  
>  	/*
>  	 * Override default outer_cache.disable with a OMAP4

Kevin


WARNING: multiple messages have this Message-ID (diff)
From: khilman@deeprootsystems.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] omap4: l2x0: Construct the AUXCTRL value using defines
Date: Mon, 22 Nov 2010 12:11:01 -0800	[thread overview]
Message-ID: <8762vpp19m.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1290187866-26941-3-git-send-email-santosh.shilimkar@ti.com> (Santosh Shilimkar's message of "Fri, 19 Nov 2010 23:01:03 +0530")

Santosh Shilimkar <santosh.shilimkar@ti.com> writes:

> This patch removes the hardcoded value of auxctrl value and
> construct it using bitfields
>
> Bit 25 is reserved and is always set to 1. Same value
> of this bit is retained in this patch

Is this OMAP specific, or is this ARM generic?

> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Tested-by: Nishanth Menon <nm@ti.com>
> ---
>  arch/arm/mach-omap2/omap4-common.c |   13 +++++++++++--
>  1 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
> index 2f89555..c814604 100644
> --- a/arch/arm/mach-omap2/omap4-common.c
> +++ b/arch/arm/mach-omap2/omap4-common.c
> @@ -53,6 +53,8 @@ static void omap4_l2x0_disable(void)
>  
>  static int __init omap_l2_cache_init(void)
>  {
> +	u32 aux_ctrl = 0;
> +
>  	/*
>  	 * To avoid code running on other OMAPs in
>  	 * multi-omap builds
> @@ -72,10 +74,17 @@ static int __init omap_l2_cache_init(void)
>  	 * Way size - 32KB (es1.0)
>  	 * Way size - 64KB (es2.0 +)
>  	 */
> +	aux_ctrl = ((1 << L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT) |
> +			(0x1 << 25) |

it doesn't look right to have a single hard-coded constant here among
the others.   Either give this a name (RESERVED_ALWAYS_1, or something)
or add a comment to the code like is done in the changelog.

> +			(0x1 << L2X0_AUX_CTRL_NS_LOCKDOWN_SHIFT) |
> +			(0x1 << L2X0_AUX_CTRL_NS_INT_CTRL_SHIFT));
> +
>  	if (omap_rev() == OMAP4430_REV_ES1_0)
> -		l2x0_init(l2cache_base, 0x0e050000, 0xc0000fff);
> +		aux_ctrl |= 0x2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT;
>  	else
> -		l2x0_init(l2cache_base, 0x0e070000, 0xc0000fff);
> +		aux_ctrl |= 0x3 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT;
> +
> +	l2x0_init(l2cache_base, aux_ctrl, L2X0_AUX_CTRL_MASK);
>  
>  	/*
>  	 * Override default outer_cache.disable with a OMAP4

Kevin

  parent reply	other threads:[~2010-11-22 20:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-19 17:31 [PATCH 0/5] omap4: l2x0 fixes and cleanup Santosh Shilimkar
2010-11-19 17:31 ` Santosh Shilimkar
2010-11-19 17:31 ` [PATCH 1/5] ARM: l2x0: Add aux control register bitfields Santosh Shilimkar
2010-11-19 17:31   ` Santosh Shilimkar
2010-11-19 17:31   ` [PATCH 2/5] omap4: l2x0: Construct the AUXCTRL value using defines Santosh Shilimkar
2010-11-19 17:31     ` Santosh Shilimkar
2010-11-19 17:31     ` [PATCH 3/5] omap4: l2x0: enable instruction and data prefetching Santosh Shilimkar
2010-11-19 17:31       ` Santosh Shilimkar
2010-11-19 17:31       ` [PATCH 4/5] omap4: l2x0: Set share override bit Santosh Shilimkar
2010-11-19 17:31         ` Santosh Shilimkar
2010-11-19 17:31         ` [PATCH 5/5] omap4: l2x0: Enable early BRESP bit Santosh Shilimkar
2010-11-19 17:31           ` Santosh Shilimkar
2010-11-19 18:32           ` Måns Rullgård
2010-11-19 18:32             ` Måns Rullgård
2010-11-20 10:08             ` Santosh Shilimkar
2010-11-20 10:08               ` Santosh Shilimkar
2010-11-22 20:11     ` Kevin Hilman [this message]
2010-11-22 20:11       ` [PATCH 2/5] omap4: l2x0: Construct the AUXCTRL value using defines Kevin Hilman
2010-11-22 20:21       ` Måns Rullgård
2010-11-22 20:21         ` Måns Rullgård
2010-11-19 18:13   ` [PATCH 1/5] ARM: l2x0: Add aux control register bitfields Catalin Marinas
2010-11-19 18:13     ` Catalin Marinas
2010-12-02 11:57 ` [PATCH 0/5] omap4: l2x0 fixes and cleanup Santosh Shilimkar
2010-12-02 11:57   ` Santosh Shilimkar
2010-12-14  5:08   ` Santosh Shilimkar
2010-12-14  5:08     ` Santosh Shilimkar
2010-12-18 17:39     ` Tony Lindgren
2010-12-18 17:39       ` 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=8762vpp19m.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mans@mansr.com \
    --cc=nm@ti.com \
    --cc=santosh.shilimkar@ti.com \
    --cc=tony@atomide.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.