[U-Boot] [PATCH] Tegra: Split tegra_get_chip_type() into _soc and _sku functions

Stephen Warren swarren at wwwdotorg.org
Tue Apr 2 23:24:51 CEST 2013


On 04/02/2013 02:55 PM, Tom Warren wrote:
> As suggested by Stephen Warren, use tegra_get_soc_type() to return
> the pure CHIPID for a Tegra SoC (i.e. 0x20 for Tegra20, 0x30 for
> Tegra30, etc.) and rename tegra_get_chip_type() to reflect its true
> function, i.e. tegra_get_soc_sku(), which returns an ID like
> TEGRA_SOC_T25, TEGRA_SOC_T33, etc.

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

> @@ -150,7 +150,7 @@ void init_pllx(void)
>  	debug("init_pllx entry\n");
>  
>  	/* get chip type */
> -	chip_type = tegra_get_chip_type();
> +	chip_type = tegra_get_soc_sku();
>  	debug(" init_pllx: chip_type = %d\n", chip_type);

Here, I think you need to retrieve both soc_type and soc_sku; the code
immediately after the above that accesss pll_x_table arguably wants to
use the SKU, yet the code that conditionally calls
adjust_pllp_out_freqs() probably only cares about soc_type.

> @@ -303,7 +303,7 @@ void clock_enable_coresight(int enable)

> -		chip = tegra_get_chip_type();
> +		chip = tegra_get_soc_sku();

I think this should be converted to soc_type not soc_sku, since
Tegra20/25 are handled identically, so the SKU is irrelevant. Tegra30/33
will likely also be identical here.

>  		if (chip == TEGRA_SOC_T30 || chip == TEGRA_SOC_T114)
>  			src = CLK_DIVIDER(NVBL_PLLP_KHZ, 204000);
>  		else if (chip == TEGRA_SOC_T20 || chip == TEGRA_SOC_T25)

> diff --git a/arch/arm/cpu/arm720t/tegra-common/cpu.h b/arch/arm/cpu/arm720t/tegra-common/cpu.h

> -int tegra_get_chip_type(void);
> +int tegra_get_soc_sku(void);

Aren't both tegra_get_soc_type() and tegra_get_soc_sku() going to be
used, and hence need prototyping?

Oh, I guess you didn't mean to add tegra_get_soc_sku() here, since this
patch protoypes both new functions in arch/arm/include/asm/arch-tegra/ap.h.


More information about the U-Boot mailing list