summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-tegra/tegra.c1
-rw-r--r--drivers/soc/tegra/fuse/fuse-tegra.c11
-rw-r--r--drivers/soc/tegra/fuse/tegra-apbmisc.c7
-rw-r--r--include/soc/tegra/fuse.h1
4 files changed, 14 insertions, 6 deletions
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c
index e5733fa7..c9176db 100644
--- a/arch/arm/mach-tegra/tegra.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -73,7 +73,6 @@ u32 tegra_uart_config[3] = {
static void __init tegra_init_early(void)
{
of_register_trusted_foundations();
- tegra_init_fuse();
tegra_cpu_reset_handler_init();
tegra_powergate_init();
}
diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c
index 03742ed..11a5043 100644
--- a/drivers/soc/tegra/fuse/fuse-tegra.c
+++ b/drivers/soc/tegra/fuse/fuse-tegra.c
@@ -23,6 +23,7 @@
#include <linux/of_address.h>
#include <linux/io.h>
+#include <soc/tegra/common.h>
#include <soc/tegra/fuse.h>
#include "fuse.h"
@@ -125,11 +126,14 @@ int tegra_fuse_create_sysfs(struct device *dev, int size,
return device_create_bin_file(dev, &fuse_bin_attr);
}
-void __init tegra_init_fuse(void)
+static int __init tegra_init_fuse(void)
{
struct device_node *np;
void __iomem *car_base;
+ if (!soc_is_tegra())
+ return 0;
+
tegra_init_apbmisc();
np = of_find_matching_node(NULL, car_match);
@@ -139,7 +143,7 @@ void __init tegra_init_fuse(void)
iounmap(car_base);
} else {
pr_err("Could not enable fuse clk. ioremap tegra car failed.\n");
- return;
+ return -ENXIO;
}
if (tegra_get_chip_id() == TEGRA20)
@@ -153,4 +157,7 @@ void __init tegra_init_fuse(void)
tegra_sku_info.core_process_id);
pr_debug("Tegra CPU Speedo ID %d, Soc Speedo ID %d\n",
tegra_sku_info.cpu_speedo_id, tegra_sku_info.soc_speedo_id);
+
+ return 0;
}
+early_initcall(tegra_init_fuse);
diff --git a/drivers/soc/tegra/fuse/tegra-apbmisc.c b/drivers/soc/tegra/fuse/tegra-apbmisc.c
index bfc1d54..3bf5aba 100644
--- a/drivers/soc/tegra/fuse/tegra-apbmisc.c
+++ b/drivers/soc/tegra/fuse/tegra-apbmisc.c
@@ -38,9 +38,12 @@ u32 tegra_read_chipid(void)
u8 tegra_get_chip_id(void)
{
- u32 id = tegra_read_chipid();
+ if (!apbmisc_base) {
+ WARN(1, "Tegra Chip ID not yet available\n");
+ return 0;
+ }
- return (id >> 8) & 0xff;
+ return (tegra_read_chipid() >> 8) & 0xff;
}
u32 tegra_read_straps(void)
diff --git a/include/soc/tegra/fuse.h b/include/soc/tegra/fuse.h
index 738712d..8e12494 100644
--- a/include/soc/tegra/fuse.h
+++ b/include/soc/tegra/fuse.h
@@ -56,7 +56,6 @@ struct tegra_sku_info {
u32 tegra_read_straps(void);
u32 tegra_read_chipid(void);
-void tegra_init_fuse(void);
int tegra_fuse_readl(unsigned long offset, u32 *value);
extern struct tegra_sku_info tegra_sku_info;
OpenPOWER on IntegriCloud