|
@@ -51,7 +51,6 @@
|
|
int tegra_sku_id;
|
|
int tegra_sku_id;
|
|
int tegra_cpu_process_id;
|
|
int tegra_cpu_process_id;
|
|
int tegra_core_process_id;
|
|
int tegra_core_process_id;
|
|
-int tegra_chip_id;
|
|
|
|
int tegra_cpu_speedo_id; /* only exist in Tegra30 and later */
|
|
int tegra_cpu_speedo_id; /* only exist in Tegra30 and later */
|
|
int tegra_soc_speedo_id;
|
|
int tegra_soc_speedo_id;
|
|
enum tegra_revision tegra_revision;
|
|
enum tegra_revision tegra_revision;
|
|
@@ -124,7 +123,7 @@ static enum tegra_revision tegra_get_revision(u32 id)
|
|
case 2:
|
|
case 2:
|
|
return TEGRA_REVISION_A02;
|
|
return TEGRA_REVISION_A02;
|
|
case 3:
|
|
case 3:
|
|
- if (tegra_chip_id == TEGRA20 &&
|
|
|
|
|
|
+ if (tegra_get_chip_id() == TEGRA20 &&
|
|
(tegra_spare_fuse(18) || tegra_spare_fuse(19)))
|
|
(tegra_spare_fuse(18) || tegra_spare_fuse(19)))
|
|
return TEGRA_REVISION_A03p;
|
|
return TEGRA_REVISION_A03p;
|
|
else
|
|
else
|
|
@@ -155,6 +154,13 @@ u32 tegra_read_chipid(void)
|
|
return readl_relaxed(IO_ADDRESS(TEGRA_APB_MISC_BASE) + 0x804);
|
|
return readl_relaxed(IO_ADDRESS(TEGRA_APB_MISC_BASE) + 0x804);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+u8 tegra_get_chip_id(void)
|
|
|
|
+{
|
|
|
|
+ u32 id = tegra_read_chipid();
|
|
|
|
+
|
|
|
|
+ return (id >> 8) & 0xff;
|
|
|
|
+}
|
|
|
|
+
|
|
static void __init tegra20_fuse_init_randomness(void)
|
|
static void __init tegra20_fuse_init_randomness(void)
|
|
{
|
|
{
|
|
u32 randomness[2];
|
|
u32 randomness[2];
|
|
@@ -185,6 +191,7 @@ void __init tegra_init_fuse(void)
|
|
{
|
|
{
|
|
u32 id;
|
|
u32 id;
|
|
u32 randomness[5];
|
|
u32 randomness[5];
|
|
|
|
+ u8 chip_id;
|
|
|
|
|
|
u32 reg = readl(IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x48));
|
|
u32 reg = readl(IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x48));
|
|
reg |= 1 << 28;
|
|
reg |= 1 << 28;
|
|
@@ -209,9 +216,9 @@ void __init tegra_init_fuse(void)
|
|
|
|
|
|
id = tegra_read_chipid();
|
|
id = tegra_read_chipid();
|
|
randomness[2] = id;
|
|
randomness[2] = id;
|
|
- tegra_chip_id = (id >> 8) & 0xff;
|
|
|
|
|
|
+ chip_id = (id >> 8) & 0xff;
|
|
|
|
|
|
- switch (tegra_chip_id) {
|
|
|
|
|
|
+ switch (chip_id) {
|
|
case TEGRA20:
|
|
case TEGRA20:
|
|
tegra_fuse_spare_bit = TEGRA20_FUSE_SPARE_BIT;
|
|
tegra_fuse_spare_bit = TEGRA20_FUSE_SPARE_BIT;
|
|
tegra_init_speedo_data = &tegra20_init_speedo_data;
|
|
tegra_init_speedo_data = &tegra20_init_speedo_data;
|
|
@@ -224,7 +231,7 @@ void __init tegra_init_fuse(void)
|
|
tegra_init_speedo_data = &tegra114_init_speedo_data;
|
|
tegra_init_speedo_data = &tegra114_init_speedo_data;
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
- pr_warn("Tegra: unknown chip id %d\n", tegra_chip_id);
|
|
|
|
|
|
+ pr_warn("Tegra: unknown chip id %d\n", chip_id);
|
|
tegra_fuse_spare_bit = TEGRA20_FUSE_SPARE_BIT;
|
|
tegra_fuse_spare_bit = TEGRA20_FUSE_SPARE_BIT;
|
|
tegra_init_speedo_data = &tegra_get_process_id;
|
|
tegra_init_speedo_data = &tegra_get_process_id;
|
|
}
|
|
}
|
|
@@ -235,7 +242,7 @@ void __init tegra_init_fuse(void)
|
|
randomness[4] = (tegra_cpu_speedo_id << 16) | tegra_soc_speedo_id;
|
|
randomness[4] = (tegra_cpu_speedo_id << 16) | tegra_soc_speedo_id;
|
|
|
|
|
|
add_device_randomness(randomness, sizeof(randomness));
|
|
add_device_randomness(randomness, sizeof(randomness));
|
|
- switch (tegra_chip_id) {
|
|
|
|
|
|
+ switch (chip_id) {
|
|
case TEGRA20:
|
|
case TEGRA20:
|
|
tegra20_fuse_init_randomness();
|
|
tegra20_fuse_init_randomness();
|
|
break;
|
|
break;
|