u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/8] Tegra124: Add common CPU (shared) files
Date: Tue, 08 Oct 2013 15:43:48 -0600	[thread overview]
Message-ID: <52547C94.5050607@wwwdotorg.org> (raw)
In-Reply-To: <1381185778-25722-5-git-send-email-twarren@nvidia.com>

On 10/07/2013 04:42 PM, Tom Warren wrote:
> These files are used by both SPL and main U-Boot.

> diff --git a/arch/arm/cpu/tegra-common/ap.c b/arch/arm/cpu/tegra-common/ap.c

> @@ -81,7 +81,14 @@ int tegra_get_chip_sku(void)
>  			return TEGRA_SOC_T114;
>  		}
>  		break;
> +	case CHIPID_TEGRA124:
> +		switch (sku_id) {
> +		}
> +		case SKU_ID_T124_ENG:
> +			return TEGRA_SOC_T124;
> +		break;
>  	}

Something is wrong with the block layout there. Is the switch's closing
} two lines too early?

> diff --git a/arch/arm/cpu/tegra-common/cache.c b/arch/arm/cpu/tegra-common/cache.c

> @@ -33,16 +24,17 @@ void config_cache(void)
>  		"orr r0, r0, #0x41\n"
>  		"mcr p15, 0, r0, c1, c0, 1\n");
>  
> -	/* Currently, only T114 needs this L2 cache change to boot Linux */
> +	/* Currently, only T1x4 needs this L2 cache change to boot Linux */
>  	reg = (readl(&gp->hidrev) & HIDREV_CHIPID_MASK);
> -	if (reg != (CHIPID_TEGRA114 << HIDREV_CHIPID_SHIFT))
> -		return;
> -	/*
> -	 * Systems with an architectural L2 cache must not use the PL310.
> -	 * Config L2CTLR here for a data RAM latency of 3 cycles.
> -	 */
> -	asm("mrc p15, 1, %0, c9, c0, 2" : : "r" (reg));
> -	reg &= ~7;
> -	reg |= 2;
> -	asm("mcr p15, 1, %0, c9, c0, 2" : : "r" (reg));
> +	reg = (reg >> HIDREV_CHIPID_SHIFT) & 0xFF;
> +	if ((reg == CHIPID_TEGRA114) || (reg == CHIPID_TEGRA124)) {
> +		/*
> +		 * SoCs with an architectural L2 cache must not use the PL310.
> +		 * Config L2CTLR here for a data RAM latency of 3 cycles.
> +		 */
> +		asm("mrc p15, 1, %0, c9, c0, 2" : : "r" (reg));
> +		reg &= ~7;
> +		reg |= 2;
> +		asm("mcr p15, 1, %0, c9, c0, 2" : : "r" (reg));
> +	}
>  }

Why change the indentation level here? The if (xxx) return could have
been enhanced to check for either chip without changing the indentation
level of the rest of the function.

Also, we shouldn't be checking for the SoC, but rather for the CPU core
type. On A9 we want to return. On A15, we want to continue. If we had
written the code to check the correct thing before, we wouldn't have to
touch this function at all when porting to Tegra124.

  reply	other threads:[~2013-10-08 21:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-07 22:42 [U-Boot] [PATCH 1/8] Tegra124: Add arch-tegra124 include/header files Tom Warren
2013-10-07 22:42 ` [U-Boot] [PATCH 2/8] Tegra124: Add changes to common arch-tegra header files Tom Warren
2013-10-08  7:16   ` Thierry Reding
2013-10-07 22:42 ` [U-Boot] [PATCH 3/8] Tegra124: Add SPL/AVP (arm720t) cpu files Tom Warren
2013-10-08  8:13   ` Thierry Reding
2013-10-08 21:34     ` Stephen Warren
2014-01-22 23:12     ` Stephen Warren
2013-10-08 21:36   ` Stephen Warren
2013-10-07 22:42 ` [U-Boot] [PATCH 4/8] Tegra124: Add CPU (armv7) files Tom Warren
2013-10-07 22:42 ` [U-Boot] [PATCH 5/8] Tegra124: Add common CPU (shared) files Tom Warren
2013-10-08 21:43   ` Stephen Warren [this message]
2013-10-07 22:42 ` [U-Boot] [PATCH 6/8] Tegra124: Add generic T124 build support Tom Warren
2013-10-08 21:45   ` Stephen Warren
2013-10-07 22:42 ` [U-Boot] [PATCH 7/8] Tegra124: Venice2: fdt: Add device-tree files Tom Warren
2013-10-08 21:55   ` Stephen Warren
2013-10-07 22:42 ` [U-Boot] [PATCH 8/8] Tegra124: Add Venice2 (T124) build Tom Warren
2013-10-08 22:06   ` Stephen Warren
2013-10-08  7:14 ` [U-Boot] [PATCH 1/8] Tegra124: Add arch-tegra124 include/header files Thierry Reding
2013-10-08 21:29 ` Stephen Warren

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=52547C94.5050607@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=u-boot@lists.denx.de \
    /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;
as well as URLs for NNTP newsgroup(s).