* [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
2013-02-08 7:29 [PATCH 0/4] ARM: tegra: Unify board-dt-tegra{20,30,114} Hiroshi Doyu
2013-02-08 7:29 ` Hiroshi Doyu
@ 2013-02-08 7:29 ` Hiroshi Doyu
2013-02-08 7:29 ` Hiroshi Doyu
2013-02-08 7:29 ` Hiroshi Doyu
3 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-08 7:29 UTC (permalink / raw)
To: linux-tegra
Cc: arnd, Hiroshi Doyu, Stephen Warren, Russell King,
linux-arm-kernel, linux-kernel
Refactored tegra{20,30,114}_init_early() so that we have the unified
tegra_init_early().
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
arch/arm/mach-tegra/board-dt-tegra114.c | 2 +-
arch/arm/mach-tegra/board-dt-tegra20.c | 2 +-
arch/arm/mach-tegra/board-dt-tegra30.c | 4 ++--
arch/arm/mach-tegra/board.h | 4 +---
arch/arm/mach-tegra/common.c | 26 ++------------------------
arch/arm/mach-tegra/hotplug.c | 31 +++++++++++++++++--------------
arch/arm/mach-tegra/sleep.h | 10 +++++-----
7 files changed, 29 insertions(+), 50 deletions(-)
diff --git a/arch/arm/mach-tegra/board-dt-tegra114.c b/arch/arm/mach-tegra/board-dt-tegra114.c
index 085d636..08e8294 100644
--- a/arch/arm/mach-tegra/board-dt-tegra114.c
+++ b/arch/arm/mach-tegra/board-dt-tegra114.c
@@ -36,7 +36,7 @@ static const char * const tegra114_dt_board_compat[] = {
DT_MACHINE_START(TEGRA114_DT, "NVIDIA Tegra114 (Flattened Device Tree)")
.smp = smp_ops(tegra_smp_ops),
.map_io = tegra_map_common_io,
- .init_early = tegra114_init_early,
+ .init_early = tegra_init_early,
.init_irq = tegra_dt_init_irq,
.init_time = clocksource_of_init,
.init_machine = tegra114_dt_init,
diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c b/arch/arm/mach-tegra/board-dt-tegra20.c
index a0edf25..fca18e9 100644
--- a/arch/arm/mach-tegra/board-dt-tegra20.c
+++ b/arch/arm/mach-tegra/board-dt-tegra20.c
@@ -145,7 +145,7 @@ static const char *tegra20_dt_board_compat[] = {
DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)")
.map_io = tegra_map_common_io,
.smp = smp_ops(tegra_smp_ops),
- .init_early = tegra20_init_early,
+ .init_early = tegra_init_early,
.init_irq = tegra_dt_init_irq,
.init_time = clocksource_of_init,
.init_machine = tegra_dt_init,
diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c
index bf68567..63f8139 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/board-dt-tegra30.c
@@ -3,7 +3,7 @@
*
* NVIDIA Tegra30 device tree board support
*
- * Copyright (C) 2011 NVIDIA Corporation
+ * Copyright (C) 2011, 2013, NVIDIA Corporation
*
* Derived from:
*
@@ -50,7 +50,7 @@ static const char *tegra30_dt_board_compat[] = {
DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30 (Flattened Device Tree)")
.smp = smp_ops(tegra_smp_ops),
.map_io = tegra_map_common_io,
- .init_early = tegra30_init_early,
+ .init_early = tegra_init_early,
.init_irq = tegra_dt_init_irq,
.init_time = clocksource_of_init,
.init_machine = tegra30_dt_init,
diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h
index 86851c8..60431de 100644
--- a/arch/arm/mach-tegra/board.h
+++ b/arch/arm/mach-tegra/board.h
@@ -26,9 +26,7 @@
void tegra_assert_system_reset(char mode, const char *cmd);
-void __init tegra20_init_early(void);
-void __init tegra30_init_early(void);
-void __init tegra114_init_early(void);
+void __init tegra_init_early(void);
void __init tegra_map_common_io(void);
void __init tegra_init_irq(void);
void __init tegra_dt_init_irq(void);
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 5449a3f..f0315c9 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -94,7 +94,7 @@ static void __init tegra_init_cache(void)
}
-static void __init tegra_init_early(void)
+void __init tegra_init_early(void)
{
tegra_cpu_reset_handler_init();
tegra_apb_io_init();
@@ -102,31 +102,9 @@ static void __init tegra_init_early(void)
tegra_init_cache();
tegra_pmc_init();
tegra_powergate_init();
+ tegra_hotplug_init();
}
-#ifdef CONFIG_ARCH_TEGRA_2x_SOC
-void __init tegra20_init_early(void)
-{
- tegra_init_early();
- tegra20_hotplug_init();
-}
-#endif
-
-#ifdef CONFIG_ARCH_TEGRA_3x_SOC
-void __init tegra30_init_early(void)
-{
- tegra_init_early();
- tegra30_hotplug_init();
-}
-#endif
-
-#ifdef CONFIG_ARCH_TEGRA_114_SOC
-void __init tegra114_init_early(void)
-{
- tegra_init_early();
-}
-#endif
-
void __init tegra_init_late(void)
{
tegra_powergate_debugfs_init();
diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
index a599f6e..9bcecb8 100644
--- a/arch/arm/mach-tegra/hotplug.c
+++ b/arch/arm/mach-tegra/hotplug.c
@@ -1,8 +1,7 @@
/*
- *
* Copyright (C) 2002 ARM Ltd.
* All Rights Reserved
- * Copyright (c) 2010, 2012 NVIDIA Corporation. All rights reserved.
+ * Copyright (c) 2010, 2012-2013, NVIDIA Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -15,6 +14,7 @@
#include <asm/cacheflush.h>
#include <asm/smp_plat.h>
+#include "fuse.h"
#include "sleep.h"
static void (*tegra_hotplug_shutdown)(void);
@@ -56,18 +56,21 @@ int tegra_cpu_disable(unsigned int cpu)
return cpu == 0 ? -EPERM : 0;
}
-#ifdef CONFIG_ARCH_TEGRA_2x_SOC
-extern void tegra20_hotplug_shutdown(void);
-void __init tegra20_hotplug_init(void)
+void __init tegra_hotplug_init(void)
{
- tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
-}
+ switch (tegra_chip_id) {
+#ifdef CONFIG_ARCH_TEGRA_2x_SOC
+ case TEGRA20:
+ tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
+ break;
#endif
-
-#ifdef CONFIG_ARCH_TEGRA_3x_SOC
-extern void tegra30_hotplug_shutdown(void);
-void __init tegra30_hotplug_init(void)
-{
- tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
-}
+#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
+ case TEGRA30:
+ tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
+ break;
#endif
+ default:
+ BUG_ON(IS_ENABLED(CONFIG_HOTPLUG_CPU));
+ break;
+ }
+}
diff --git a/arch/arm/mach-tegra/sleep.h b/arch/arm/mach-tegra/sleep.h
index 4ffae54..970ebd5 100644
--- a/arch/arm/mach-tegra/sleep.h
+++ b/arch/arm/mach-tegra/sleep.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2012, NVIDIA Corporation. All rights reserved.
+ * Copyright (c) 2010-2013, NVIDIA Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -124,11 +124,11 @@ int tegra_sleep_cpu_finish(unsigned long);
void tegra_disable_clean_inv_dcache(void);
#ifdef CONFIG_HOTPLUG_CPU
-void tegra20_hotplug_init(void);
-void tegra30_hotplug_init(void);
+void tegra20_hotplug_shutdown(void);
+void tegra30_hotplug_shutdown(void);
+void tegra_hotplug_init(void);
#else
-static inline void tegra20_hotplug_init(void) {}
-static inline void tegra30_hotplug_init(void) {}
+static inline void tegra_hotplug_init(void) {}
#endif
void tegra20_cpu_shutdown(int cpu);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-08 7:29 ` Hiroshi Doyu
0 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-08 7:29 UTC (permalink / raw)
To: linux-arm-kernel
Refactored tegra{20,30,114}_init_early() so that we have the unified
tegra_init_early().
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
arch/arm/mach-tegra/board-dt-tegra114.c | 2 +-
arch/arm/mach-tegra/board-dt-tegra20.c | 2 +-
arch/arm/mach-tegra/board-dt-tegra30.c | 4 ++--
arch/arm/mach-tegra/board.h | 4 +---
arch/arm/mach-tegra/common.c | 26 ++------------------------
arch/arm/mach-tegra/hotplug.c | 31 +++++++++++++++++--------------
arch/arm/mach-tegra/sleep.h | 10 +++++-----
7 files changed, 29 insertions(+), 50 deletions(-)
diff --git a/arch/arm/mach-tegra/board-dt-tegra114.c b/arch/arm/mach-tegra/board-dt-tegra114.c
index 085d636..08e8294 100644
--- a/arch/arm/mach-tegra/board-dt-tegra114.c
+++ b/arch/arm/mach-tegra/board-dt-tegra114.c
@@ -36,7 +36,7 @@ static const char * const tegra114_dt_board_compat[] = {
DT_MACHINE_START(TEGRA114_DT, "NVIDIA Tegra114 (Flattened Device Tree)")
.smp = smp_ops(tegra_smp_ops),
.map_io = tegra_map_common_io,
- .init_early = tegra114_init_early,
+ .init_early = tegra_init_early,
.init_irq = tegra_dt_init_irq,
.init_time = clocksource_of_init,
.init_machine = tegra114_dt_init,
diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c b/arch/arm/mach-tegra/board-dt-tegra20.c
index a0edf25..fca18e9 100644
--- a/arch/arm/mach-tegra/board-dt-tegra20.c
+++ b/arch/arm/mach-tegra/board-dt-tegra20.c
@@ -145,7 +145,7 @@ static const char *tegra20_dt_board_compat[] = {
DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)")
.map_io = tegra_map_common_io,
.smp = smp_ops(tegra_smp_ops),
- .init_early = tegra20_init_early,
+ .init_early = tegra_init_early,
.init_irq = tegra_dt_init_irq,
.init_time = clocksource_of_init,
.init_machine = tegra_dt_init,
diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c
index bf68567..63f8139 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/board-dt-tegra30.c
@@ -3,7 +3,7 @@
*
* NVIDIA Tegra30 device tree board support
*
- * Copyright (C) 2011 NVIDIA Corporation
+ * Copyright (C) 2011, 2013, NVIDIA Corporation
*
* Derived from:
*
@@ -50,7 +50,7 @@ static const char *tegra30_dt_board_compat[] = {
DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30 (Flattened Device Tree)")
.smp = smp_ops(tegra_smp_ops),
.map_io = tegra_map_common_io,
- .init_early = tegra30_init_early,
+ .init_early = tegra_init_early,
.init_irq = tegra_dt_init_irq,
.init_time = clocksource_of_init,
.init_machine = tegra30_dt_init,
diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h
index 86851c8..60431de 100644
--- a/arch/arm/mach-tegra/board.h
+++ b/arch/arm/mach-tegra/board.h
@@ -26,9 +26,7 @@
void tegra_assert_system_reset(char mode, const char *cmd);
-void __init tegra20_init_early(void);
-void __init tegra30_init_early(void);
-void __init tegra114_init_early(void);
+void __init tegra_init_early(void);
void __init tegra_map_common_io(void);
void __init tegra_init_irq(void);
void __init tegra_dt_init_irq(void);
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 5449a3f..f0315c9 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -94,7 +94,7 @@ static void __init tegra_init_cache(void)
}
-static void __init tegra_init_early(void)
+void __init tegra_init_early(void)
{
tegra_cpu_reset_handler_init();
tegra_apb_io_init();
@@ -102,31 +102,9 @@ static void __init tegra_init_early(void)
tegra_init_cache();
tegra_pmc_init();
tegra_powergate_init();
+ tegra_hotplug_init();
}
-#ifdef CONFIG_ARCH_TEGRA_2x_SOC
-void __init tegra20_init_early(void)
-{
- tegra_init_early();
- tegra20_hotplug_init();
-}
-#endif
-
-#ifdef CONFIG_ARCH_TEGRA_3x_SOC
-void __init tegra30_init_early(void)
-{
- tegra_init_early();
- tegra30_hotplug_init();
-}
-#endif
-
-#ifdef CONFIG_ARCH_TEGRA_114_SOC
-void __init tegra114_init_early(void)
-{
- tegra_init_early();
-}
-#endif
-
void __init tegra_init_late(void)
{
tegra_powergate_debugfs_init();
diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
index a599f6e..9bcecb8 100644
--- a/arch/arm/mach-tegra/hotplug.c
+++ b/arch/arm/mach-tegra/hotplug.c
@@ -1,8 +1,7 @@
/*
- *
* Copyright (C) 2002 ARM Ltd.
* All Rights Reserved
- * Copyright (c) 2010, 2012 NVIDIA Corporation. All rights reserved.
+ * Copyright (c) 2010, 2012-2013, NVIDIA Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -15,6 +14,7 @@
#include <asm/cacheflush.h>
#include <asm/smp_plat.h>
+#include "fuse.h"
#include "sleep.h"
static void (*tegra_hotplug_shutdown)(void);
@@ -56,18 +56,21 @@ int tegra_cpu_disable(unsigned int cpu)
return cpu == 0 ? -EPERM : 0;
}
-#ifdef CONFIG_ARCH_TEGRA_2x_SOC
-extern void tegra20_hotplug_shutdown(void);
-void __init tegra20_hotplug_init(void)
+void __init tegra_hotplug_init(void)
{
- tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
-}
+ switch (tegra_chip_id) {
+#ifdef CONFIG_ARCH_TEGRA_2x_SOC
+ case TEGRA20:
+ tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
+ break;
#endif
-
-#ifdef CONFIG_ARCH_TEGRA_3x_SOC
-extern void tegra30_hotplug_shutdown(void);
-void __init tegra30_hotplug_init(void)
-{
- tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
-}
+#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
+ case TEGRA30:
+ tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
+ break;
#endif
+ default:
+ BUG_ON(IS_ENABLED(CONFIG_HOTPLUG_CPU));
+ break;
+ }
+}
diff --git a/arch/arm/mach-tegra/sleep.h b/arch/arm/mach-tegra/sleep.h
index 4ffae54..970ebd5 100644
--- a/arch/arm/mach-tegra/sleep.h
+++ b/arch/arm/mach-tegra/sleep.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2012, NVIDIA Corporation. All rights reserved.
+ * Copyright (c) 2010-2013, NVIDIA Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -124,11 +124,11 @@ int tegra_sleep_cpu_finish(unsigned long);
void tegra_disable_clean_inv_dcache(void);
#ifdef CONFIG_HOTPLUG_CPU
-void tegra20_hotplug_init(void);
-void tegra30_hotplug_init(void);
+void tegra20_hotplug_shutdown(void);
+void tegra30_hotplug_shutdown(void);
+void tegra_hotplug_init(void);
#else
-static inline void tegra20_hotplug_init(void) {}
-static inline void tegra30_hotplug_init(void) {}
+static inline void tegra_hotplug_init(void) {}
#endif
void tegra20_cpu_shutdown(int cpu);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-08 7:29 ` Hiroshi Doyu
0 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-08 7:29 UTC (permalink / raw)
To: linux-tegra
Cc: arnd, Hiroshi Doyu, Stephen Warren, Russell King,
linux-arm-kernel, linux-kernel
Refactored tegra{20,30,114}_init_early() so that we have the unified
tegra_init_early().
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
arch/arm/mach-tegra/board-dt-tegra114.c | 2 +-
arch/arm/mach-tegra/board-dt-tegra20.c | 2 +-
arch/arm/mach-tegra/board-dt-tegra30.c | 4 ++--
arch/arm/mach-tegra/board.h | 4 +---
arch/arm/mach-tegra/common.c | 26 ++------------------------
arch/arm/mach-tegra/hotplug.c | 31 +++++++++++++++++--------------
arch/arm/mach-tegra/sleep.h | 10 +++++-----
7 files changed, 29 insertions(+), 50 deletions(-)
diff --git a/arch/arm/mach-tegra/board-dt-tegra114.c b/arch/arm/mach-tegra/board-dt-tegra114.c
index 085d636..08e8294 100644
--- a/arch/arm/mach-tegra/board-dt-tegra114.c
+++ b/arch/arm/mach-tegra/board-dt-tegra114.c
@@ -36,7 +36,7 @@ static const char * const tegra114_dt_board_compat[] = {
DT_MACHINE_START(TEGRA114_DT, "NVIDIA Tegra114 (Flattened Device Tree)")
.smp = smp_ops(tegra_smp_ops),
.map_io = tegra_map_common_io,
- .init_early = tegra114_init_early,
+ .init_early = tegra_init_early,
.init_irq = tegra_dt_init_irq,
.init_time = clocksource_of_init,
.init_machine = tegra114_dt_init,
diff --git a/arch/arm/mach-tegra/board-dt-tegra20.c b/arch/arm/mach-tegra/board-dt-tegra20.c
index a0edf25..fca18e9 100644
--- a/arch/arm/mach-tegra/board-dt-tegra20.c
+++ b/arch/arm/mach-tegra/board-dt-tegra20.c
@@ -145,7 +145,7 @@ static const char *tegra20_dt_board_compat[] = {
DT_MACHINE_START(TEGRA_DT, "nVidia Tegra20 (Flattened Device Tree)")
.map_io = tegra_map_common_io,
.smp = smp_ops(tegra_smp_ops),
- .init_early = tegra20_init_early,
+ .init_early = tegra_init_early,
.init_irq = tegra_dt_init_irq,
.init_time = clocksource_of_init,
.init_machine = tegra_dt_init,
diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c
index bf68567..63f8139 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/board-dt-tegra30.c
@@ -3,7 +3,7 @@
*
* NVIDIA Tegra30 device tree board support
*
- * Copyright (C) 2011 NVIDIA Corporation
+ * Copyright (C) 2011, 2013, NVIDIA Corporation
*
* Derived from:
*
@@ -50,7 +50,7 @@ static const char *tegra30_dt_board_compat[] = {
DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30 (Flattened Device Tree)")
.smp = smp_ops(tegra_smp_ops),
.map_io = tegra_map_common_io,
- .init_early = tegra30_init_early,
+ .init_early = tegra_init_early,
.init_irq = tegra_dt_init_irq,
.init_time = clocksource_of_init,
.init_machine = tegra30_dt_init,
diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h
index 86851c8..60431de 100644
--- a/arch/arm/mach-tegra/board.h
+++ b/arch/arm/mach-tegra/board.h
@@ -26,9 +26,7 @@
void tegra_assert_system_reset(char mode, const char *cmd);
-void __init tegra20_init_early(void);
-void __init tegra30_init_early(void);
-void __init tegra114_init_early(void);
+void __init tegra_init_early(void);
void __init tegra_map_common_io(void);
void __init tegra_init_irq(void);
void __init tegra_dt_init_irq(void);
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 5449a3f..f0315c9 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -94,7 +94,7 @@ static void __init tegra_init_cache(void)
}
-static void __init tegra_init_early(void)
+void __init tegra_init_early(void)
{
tegra_cpu_reset_handler_init();
tegra_apb_io_init();
@@ -102,31 +102,9 @@ static void __init tegra_init_early(void)
tegra_init_cache();
tegra_pmc_init();
tegra_powergate_init();
+ tegra_hotplug_init();
}
-#ifdef CONFIG_ARCH_TEGRA_2x_SOC
-void __init tegra20_init_early(void)
-{
- tegra_init_early();
- tegra20_hotplug_init();
-}
-#endif
-
-#ifdef CONFIG_ARCH_TEGRA_3x_SOC
-void __init tegra30_init_early(void)
-{
- tegra_init_early();
- tegra30_hotplug_init();
-}
-#endif
-
-#ifdef CONFIG_ARCH_TEGRA_114_SOC
-void __init tegra114_init_early(void)
-{
- tegra_init_early();
-}
-#endif
-
void __init tegra_init_late(void)
{
tegra_powergate_debugfs_init();
diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
index a599f6e..9bcecb8 100644
--- a/arch/arm/mach-tegra/hotplug.c
+++ b/arch/arm/mach-tegra/hotplug.c
@@ -1,8 +1,7 @@
/*
- *
* Copyright (C) 2002 ARM Ltd.
* All Rights Reserved
- * Copyright (c) 2010, 2012 NVIDIA Corporation. All rights reserved.
+ * Copyright (c) 2010, 2012-2013, NVIDIA Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -15,6 +14,7 @@
#include <asm/cacheflush.h>
#include <asm/smp_plat.h>
+#include "fuse.h"
#include "sleep.h"
static void (*tegra_hotplug_shutdown)(void);
@@ -56,18 +56,21 @@ int tegra_cpu_disable(unsigned int cpu)
return cpu == 0 ? -EPERM : 0;
}
-#ifdef CONFIG_ARCH_TEGRA_2x_SOC
-extern void tegra20_hotplug_shutdown(void);
-void __init tegra20_hotplug_init(void)
+void __init tegra_hotplug_init(void)
{
- tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
-}
+ switch (tegra_chip_id) {
+#ifdef CONFIG_ARCH_TEGRA_2x_SOC
+ case TEGRA20:
+ tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
+ break;
#endif
-
-#ifdef CONFIG_ARCH_TEGRA_3x_SOC
-extern void tegra30_hotplug_shutdown(void);
-void __init tegra30_hotplug_init(void)
-{
- tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
-}
+#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
+ case TEGRA30:
+ tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
+ break;
#endif
+ default:
+ BUG_ON(IS_ENABLED(CONFIG_HOTPLUG_CPU));
+ break;
+ }
+}
diff --git a/arch/arm/mach-tegra/sleep.h b/arch/arm/mach-tegra/sleep.h
index 4ffae54..970ebd5 100644
--- a/arch/arm/mach-tegra/sleep.h
+++ b/arch/arm/mach-tegra/sleep.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2012, NVIDIA Corporation. All rights reserved.
+ * Copyright (c) 2010-2013, NVIDIA Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -124,11 +124,11 @@ int tegra_sleep_cpu_finish(unsigned long);
void tegra_disable_clean_inv_dcache(void);
#ifdef CONFIG_HOTPLUG_CPU
-void tegra20_hotplug_init(void);
-void tegra30_hotplug_init(void);
+void tegra20_hotplug_shutdown(void);
+void tegra30_hotplug_shutdown(void);
+void tegra_hotplug_init(void);
#else
-static inline void tegra20_hotplug_init(void) {}
-static inline void tegra30_hotplug_init(void) {}
+static inline void tegra_hotplug_init(void) {}
#endif
void tegra20_cpu_shutdown(int cpu);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 43+ messages in thread
[parent not found: <1360308574-19658-2-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
2013-02-08 7:29 ` Hiroshi Doyu
(?)
@ 2013-02-08 7:47 ` Felipe Balbi
-1 siblings, 0 replies; 43+ messages in thread
From: Felipe Balbi @ 2013-02-08 7:47 UTC (permalink / raw)
To: Hiroshi Doyu
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, arnd-r2nGTMty4D4,
Stephen Warren, Russell King,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 1839 bytes --]
Hi,
On Fri, Feb 08, 2013 at 09:29:31AM +0200, Hiroshi Doyu wrote:
> @@ -56,18 +56,21 @@ int tegra_cpu_disable(unsigned int cpu)
> return cpu == 0 ? -EPERM : 0;
> }
>
> -#ifdef CONFIG_ARCH_TEGRA_2x_SOC
> -extern void tegra20_hotplug_shutdown(void);
> -void __init tegra20_hotplug_init(void)
> +void __init tegra_hotplug_init(void)
> {
> - tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
> -}
> + switch (tegra_chip_id) {
> +#ifdef CONFIG_ARCH_TEGRA_2x_SOC
> + case TEGRA20:
> + tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
> + break;
> #endif
> -
> -#ifdef CONFIG_ARCH_TEGRA_3x_SOC
> -extern void tegra30_hotplug_shutdown(void);
> -void __init tegra30_hotplug_init(void)
> -{
> - tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
> -}
> +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
how about using:
#if IS_BUILTIN(CONFIG_ARCH_TEGRA_3x_SOC)
instead ?
> diff --git a/arch/arm/mach-tegra/sleep.h b/arch/arm/mach-tegra/sleep.h
> index 4ffae54..970ebd5 100644
> --- a/arch/arm/mach-tegra/sleep.h
> +++ b/arch/arm/mach-tegra/sleep.h
> @@ -1,5 +1,5 @@
> /*
> - * Copyright (c) 2010-2012, NVIDIA Corporation. All rights reserved.
> + * Copyright (c) 2010-2013, NVIDIA Corporation. All rights reserved.
> *
> * This program is free software; you can redistribute it and/or modify it
> * under the terms and conditions of the GNU General Public License,
> @@ -124,11 +124,11 @@ int tegra_sleep_cpu_finish(unsigned long);
> void tegra_disable_clean_inv_dcache(void);
>
> #ifdef CONFIG_HOTPLUG_CPU
> -void tegra20_hotplug_init(void);
> -void tegra30_hotplug_init(void);
> +void tegra20_hotplug_shutdown(void);
> +void tegra30_hotplug_shutdown(void);
aren't these two called only by tegra_hotplug_init() now ? That means
they don't need to be exposed.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-08 7:47 ` Felipe Balbi
0 siblings, 0 replies; 43+ messages in thread
From: Felipe Balbi @ 2013-02-08 7:47 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Fri, Feb 08, 2013 at 09:29:31AM +0200, Hiroshi Doyu wrote:
> @@ -56,18 +56,21 @@ int tegra_cpu_disable(unsigned int cpu)
> return cpu == 0 ? -EPERM : 0;
> }
>
> -#ifdef CONFIG_ARCH_TEGRA_2x_SOC
> -extern void tegra20_hotplug_shutdown(void);
> -void __init tegra20_hotplug_init(void)
> +void __init tegra_hotplug_init(void)
> {
> - tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
> -}
> + switch (tegra_chip_id) {
> +#ifdef CONFIG_ARCH_TEGRA_2x_SOC
> + case TEGRA20:
> + tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
> + break;
> #endif
> -
> -#ifdef CONFIG_ARCH_TEGRA_3x_SOC
> -extern void tegra30_hotplug_shutdown(void);
> -void __init tegra30_hotplug_init(void)
> -{
> - tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
> -}
> +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
how about using:
#if IS_BUILTIN(CONFIG_ARCH_TEGRA_3x_SOC)
instead ?
> diff --git a/arch/arm/mach-tegra/sleep.h b/arch/arm/mach-tegra/sleep.h
> index 4ffae54..970ebd5 100644
> --- a/arch/arm/mach-tegra/sleep.h
> +++ b/arch/arm/mach-tegra/sleep.h
> @@ -1,5 +1,5 @@
> /*
> - * Copyright (c) 2010-2012, NVIDIA Corporation. All rights reserved.
> + * Copyright (c) 2010-2013, NVIDIA Corporation. All rights reserved.
> *
> * This program is free software; you can redistribute it and/or modify it
> * under the terms and conditions of the GNU General Public License,
> @@ -124,11 +124,11 @@ int tegra_sleep_cpu_finish(unsigned long);
> void tegra_disable_clean_inv_dcache(void);
>
> #ifdef CONFIG_HOTPLUG_CPU
> -void tegra20_hotplug_init(void);
> -void tegra30_hotplug_init(void);
> +void tegra20_hotplug_shutdown(void);
> +void tegra30_hotplug_shutdown(void);
aren't these two called only by tegra_hotplug_init() now ? That means
they don't need to be exposed.
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130208/78dcda85/attachment-0001.sig>
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-08 7:47 ` Felipe Balbi
0 siblings, 0 replies; 43+ messages in thread
From: Felipe Balbi @ 2013-02-08 7:47 UTC (permalink / raw)
To: Hiroshi Doyu
Cc: linux-tegra, arnd, Stephen Warren, Russell King,
linux-arm-kernel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1839 bytes --]
Hi,
On Fri, Feb 08, 2013 at 09:29:31AM +0200, Hiroshi Doyu wrote:
> @@ -56,18 +56,21 @@ int tegra_cpu_disable(unsigned int cpu)
> return cpu == 0 ? -EPERM : 0;
> }
>
> -#ifdef CONFIG_ARCH_TEGRA_2x_SOC
> -extern void tegra20_hotplug_shutdown(void);
> -void __init tegra20_hotplug_init(void)
> +void __init tegra_hotplug_init(void)
> {
> - tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
> -}
> + switch (tegra_chip_id) {
> +#ifdef CONFIG_ARCH_TEGRA_2x_SOC
> + case TEGRA20:
> + tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
> + break;
> #endif
> -
> -#ifdef CONFIG_ARCH_TEGRA_3x_SOC
> -extern void tegra30_hotplug_shutdown(void);
> -void __init tegra30_hotplug_init(void)
> -{
> - tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
> -}
> +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
how about using:
#if IS_BUILTIN(CONFIG_ARCH_TEGRA_3x_SOC)
instead ?
> diff --git a/arch/arm/mach-tegra/sleep.h b/arch/arm/mach-tegra/sleep.h
> index 4ffae54..970ebd5 100644
> --- a/arch/arm/mach-tegra/sleep.h
> +++ b/arch/arm/mach-tegra/sleep.h
> @@ -1,5 +1,5 @@
> /*
> - * Copyright (c) 2010-2012, NVIDIA Corporation. All rights reserved.
> + * Copyright (c) 2010-2013, NVIDIA Corporation. All rights reserved.
> *
> * This program is free software; you can redistribute it and/or modify it
> * under the terms and conditions of the GNU General Public License,
> @@ -124,11 +124,11 @@ int tegra_sleep_cpu_finish(unsigned long);
> void tegra_disable_clean_inv_dcache(void);
>
> #ifdef CONFIG_HOTPLUG_CPU
> -void tegra20_hotplug_init(void);
> -void tegra30_hotplug_init(void);
> +void tegra20_hotplug_shutdown(void);
> +void tegra30_hotplug_shutdown(void);
aren't these two called only by tegra_hotplug_init() now ? That means
they don't need to be exposed.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 43+ messages in thread
[parent not found: <20130208074720.GB21879-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>]
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
2013-02-08 7:47 ` Felipe Balbi
(?)
@ 2013-02-08 8:09 ` Hiroshi Doyu
-1 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-08 8:09 UTC (permalink / raw)
To: balbi-l0cyMroinI0
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, arnd-r2nGTMty4D4,
swarren-3lzwWm7+Weoh9ZMKESR00Q, linux-lFZ/pmaqli7XmaaqVzeoHQ,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Hi Felipe,
Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org> wrote @ Fri, 8 Feb 2013 08:47:20 +0100:
> > +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
>
> how about using:
>
> #if IS_BUILTIN(CONFIG_ARCH_TEGRA_3x_SOC)
>
> instead ?
Why is IS_BUILTIN() prefered?
> > -void tegra20_hotplug_init(void);
> > -void tegra30_hotplug_init(void);
> > +void tegra20_hotplug_shutdown(void);
> > +void tegra30_hotplug_shutdown(void);
>
> aren't these two called only by tegra_hotplug_init() now ?
Yes
> That means they don't need to be exposed.
tegra{20,30}_hotplug_shutdown are defined in sleep-tegra{20,30}.S and
used in hotplug.c So I think that the above are necessary here.
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-08 8:09 ` Hiroshi Doyu
0 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-08 8:09 UTC (permalink / raw)
To: linux-arm-kernel
Hi Felipe,
Felipe Balbi <balbi@ti.com> wrote @ Fri, 8 Feb 2013 08:47:20 +0100:
> > +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
>
> how about using:
>
> #if IS_BUILTIN(CONFIG_ARCH_TEGRA_3x_SOC)
>
> instead ?
Why is IS_BUILTIN() prefered?
> > -void tegra20_hotplug_init(void);
> > -void tegra30_hotplug_init(void);
> > +void tegra20_hotplug_shutdown(void);
> > +void tegra30_hotplug_shutdown(void);
>
> aren't these two called only by tegra_hotplug_init() now ?
Yes
> That means they don't need to be exposed.
tegra{20,30}_hotplug_shutdown are defined in sleep-tegra{20,30}.S and
used in hotplug.c So I think that the above are necessary here.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-08 8:09 ` Hiroshi Doyu
0 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-08 8:09 UTC (permalink / raw)
To: balbi; +Cc: linux-tegra, arnd, swarren, linux, linux-arm-kernel, linux-kernel
Hi Felipe,
Felipe Balbi <balbi@ti.com> wrote @ Fri, 8 Feb 2013 08:47:20 +0100:
> > +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
>
> how about using:
>
> #if IS_BUILTIN(CONFIG_ARCH_TEGRA_3x_SOC)
>
> instead ?
Why is IS_BUILTIN() prefered?
> > -void tegra20_hotplug_init(void);
> > -void tegra30_hotplug_init(void);
> > +void tegra20_hotplug_shutdown(void);
> > +void tegra30_hotplug_shutdown(void);
>
> aren't these two called only by tegra_hotplug_init() now ?
Yes
> That means they don't need to be exposed.
tegra{20,30}_hotplug_shutdown are defined in sleep-tegra{20,30}.S and
used in hotplug.c So I think that the above are necessary here.
^ permalink raw reply [flat|nested] 43+ messages in thread
[parent not found: <20130208.100942.592982910310763762.hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
2013-02-08 8:09 ` Hiroshi Doyu
(?)
@ 2013-02-09 12:18 ` Arnd Bergmann
-1 siblings, 0 replies; 43+ messages in thread
From: Arnd Bergmann @ 2013-02-09 12:18 UTC (permalink / raw)
To: Hiroshi Doyu
Cc: balbi-l0cyMroinI0, linux-tegra-u79uwXL29TY76Z2rM5mHXA,
swarren-3lzwWm7+Weoh9ZMKESR00Q, linux-lFZ/pmaqli7XmaaqVzeoHQ,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
On Friday 08 February 2013, Hiroshi Doyu wrote:
> > > +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
> >
> > how about using:
> >
> > #if IS_BUILTIN(CONFIG_ARCH_TEGRA_3x_SOC)
> >
> > instead ?
>
> Why is IS_BUILTIN() prefered?
>
Inside of a function, if(IS_ENABLED(CONFIG_FOO)) or the respective IS_BUILTIN is
preferred over #ifdef because it provides better compile coverage and better
readability. Also, IS_ENABLED() is nice when you want to check if something
is builtin or module, without having to write a complex expression.
If you just replace the #ifdef with #if IS_BUILTIN as Felipe suggested, I see
no real benefit, but it would be nice to write this as
void __init tegra_hotplug_init(void)
{
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
return;
if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC)) && tegra_chip_id == TEGRA20)
tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC)) && tegra_chip_id == TEGRA30)
tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
}
which completely avoids all preprocessor conditionals and replaces them
with compile-time choices based on constant expressions to eliminate the
code paths for disabled platforms.
Arnd
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-09 12:18 ` Arnd Bergmann
0 siblings, 0 replies; 43+ messages in thread
From: Arnd Bergmann @ 2013-02-09 12:18 UTC (permalink / raw)
To: linux-arm-kernel
On Friday 08 February 2013, Hiroshi Doyu wrote:
> > > +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
> >
> > how about using:
> >
> > #if IS_BUILTIN(CONFIG_ARCH_TEGRA_3x_SOC)
> >
> > instead ?
>
> Why is IS_BUILTIN() prefered?
>
Inside of a function, if(IS_ENABLED(CONFIG_FOO)) or the respective IS_BUILTIN is
preferred over #ifdef because it provides better compile coverage and better
readability. Also, IS_ENABLED() is nice when you want to check if something
is builtin or module, without having to write a complex expression.
If you just replace the #ifdef with #if IS_BUILTIN as Felipe suggested, I see
no real benefit, but it would be nice to write this as
void __init tegra_hotplug_init(void)
{
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
return;
if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC)) && tegra_chip_id == TEGRA20)
tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC)) && tegra_chip_id == TEGRA30)
tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
}
which completely avoids all preprocessor conditionals and replaces them
with compile-time choices based on constant expressions to eliminate the
code paths for disabled platforms.
Arnd
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-09 12:18 ` Arnd Bergmann
0 siblings, 0 replies; 43+ messages in thread
From: Arnd Bergmann @ 2013-02-09 12:18 UTC (permalink / raw)
To: Hiroshi Doyu
Cc: balbi, linux-tegra, swarren, linux, linux-arm-kernel, linux-kernel
On Friday 08 February 2013, Hiroshi Doyu wrote:
> > > +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
> >
> > how about using:
> >
> > #if IS_BUILTIN(CONFIG_ARCH_TEGRA_3x_SOC)
> >
> > instead ?
>
> Why is IS_BUILTIN() prefered?
>
Inside of a function, if(IS_ENABLED(CONFIG_FOO)) or the respective IS_BUILTIN is
preferred over #ifdef because it provides better compile coverage and better
readability. Also, IS_ENABLED() is nice when you want to check if something
is builtin or module, without having to write a complex expression.
If you just replace the #ifdef with #if IS_BUILTIN as Felipe suggested, I see
no real benefit, but it would be nice to write this as
void __init tegra_hotplug_init(void)
{
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
return;
if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC)) && tegra_chip_id == TEGRA20)
tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC)) && tegra_chip_id == TEGRA30)
tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
}
which completely avoids all preprocessor conditionals and replaces them
with compile-time choices based on constant expressions to eliminate the
code paths for disabled platforms.
Arnd
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
2013-02-08 7:29 ` Hiroshi Doyu
(?)
@ 2013-02-08 12:29 ` Marc Dietrich
-1 siblings, 0 replies; 43+ messages in thread
From: Marc Dietrich @ 2013-02-08 12:29 UTC (permalink / raw)
To: Hiroshi Doyu
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, arnd-r2nGTMty4D4,
Stephen Warren, Russell King,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Hiroshi,
Am Freitag, 8. Februar 2013, 09:29:31 schrieb Hiroshi Doyu:
> Refactored tegra{20,30,114}_init_early() so that we have the unified
> tegra_init_early().
>
> Signed-off-by: Hiroshi Doyu <hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
[...]
> diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
> index a599f6e..9bcecb8 100644
> --- a/arch/arm/mach-tegra/hotplug.c
> +++ b/arch/arm/mach-tegra/hotplug.c
> @@ -1,8 +1,7 @@
> /*
> - *
> * Copyright (C) 2002 ARM Ltd.
> * All Rights Reserved
> - * Copyright (c) 2010, 2012 NVIDIA Corporation. All rights reserved.
> + * Copyright (c) 2010, 2012-2013, NVIDIA Corporation. All rights reserved.
> *
> * This program is free software; you can redistribute it and/or modify
> * it under the terms of the GNU General Public License version 2 as
> @@ -15,6 +14,7 @@
> #include <asm/cacheflush.h>
> #include <asm/smp_plat.h>
>
> +#include "fuse.h"
> #include "sleep.h"
>
> static void (*tegra_hotplug_shutdown)(void);
> @@ -56,18 +56,21 @@ int tegra_cpu_disable(unsigned int cpu)
> return cpu == 0 ? -EPERM : 0;
> }
>
> -#ifdef CONFIG_ARCH_TEGRA_2x_SOC
> -extern void tegra20_hotplug_shutdown(void);
> -void __init tegra20_hotplug_init(void)
> +void __init tegra_hotplug_init(void)
> {
> - tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
> -}
> + switch (tegra_chip_id) {
> +#ifdef CONFIG_ARCH_TEGRA_2x_SOC
> + case TEGRA20:
> + tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
> + break;
> #endif
> -
> -#ifdef CONFIG_ARCH_TEGRA_3x_SOC
> -extern void tegra30_hotplug_shutdown(void);
> -void __init tegra30_hotplug_init(void)
> -{
> - tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
> -}
> +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
> + case TEGRA30:
> + tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
> + break;
> #endif
> + default:
> + BUG_ON(IS_ENABLED(CONFIG_HOTPLUG_CPU));
> + break;
> + }
> +}
are these ifdefs really needed? Multisoc kernels will enable them all anyway
and there is a case structure which protects the assignments. Also the hotplug
functions are very tiny, so there shouldn't be a big loss.
Marc
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-08 12:29 ` Marc Dietrich
0 siblings, 0 replies; 43+ messages in thread
From: Marc Dietrich @ 2013-02-08 12:29 UTC (permalink / raw)
To: linux-arm-kernel
Hiroshi,
Am Freitag, 8. Februar 2013, 09:29:31 schrieb Hiroshi Doyu:
> Refactored tegra{20,30,114}_init_early() so that we have the unified
> tegra_init_early().
>
> Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
[...]
> diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
> index a599f6e..9bcecb8 100644
> --- a/arch/arm/mach-tegra/hotplug.c
> +++ b/arch/arm/mach-tegra/hotplug.c
> @@ -1,8 +1,7 @@
> /*
> - *
> * Copyright (C) 2002 ARM Ltd.
> * All Rights Reserved
> - * Copyright (c) 2010, 2012 NVIDIA Corporation. All rights reserved.
> + * Copyright (c) 2010, 2012-2013, NVIDIA Corporation. All rights reserved.
> *
> * This program is free software; you can redistribute it and/or modify
> * it under the terms of the GNU General Public License version 2 as
> @@ -15,6 +14,7 @@
> #include <asm/cacheflush.h>
> #include <asm/smp_plat.h>
>
> +#include "fuse.h"
> #include "sleep.h"
>
> static void (*tegra_hotplug_shutdown)(void);
> @@ -56,18 +56,21 @@ int tegra_cpu_disable(unsigned int cpu)
> return cpu == 0 ? -EPERM : 0;
> }
>
> -#ifdef CONFIG_ARCH_TEGRA_2x_SOC
> -extern void tegra20_hotplug_shutdown(void);
> -void __init tegra20_hotplug_init(void)
> +void __init tegra_hotplug_init(void)
> {
> - tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
> -}
> + switch (tegra_chip_id) {
> +#ifdef CONFIG_ARCH_TEGRA_2x_SOC
> + case TEGRA20:
> + tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
> + break;
> #endif
> -
> -#ifdef CONFIG_ARCH_TEGRA_3x_SOC
> -extern void tegra30_hotplug_shutdown(void);
> -void __init tegra30_hotplug_init(void)
> -{
> - tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
> -}
> +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
> + case TEGRA30:
> + tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
> + break;
> #endif
> + default:
> + BUG_ON(IS_ENABLED(CONFIG_HOTPLUG_CPU));
> + break;
> + }
> +}
are these ifdefs really needed? Multisoc kernels will enable them all anyway
and there is a case structure which protects the assignments. Also the hotplug
functions are very tiny, so there shouldn't be a big loss.
Marc
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-08 12:29 ` Marc Dietrich
0 siblings, 0 replies; 43+ messages in thread
From: Marc Dietrich @ 2013-02-08 12:29 UTC (permalink / raw)
To: Hiroshi Doyu
Cc: linux-tegra, arnd, Stephen Warren, Russell King,
linux-arm-kernel, linux-kernel
Hiroshi,
Am Freitag, 8. Februar 2013, 09:29:31 schrieb Hiroshi Doyu:
> Refactored tegra{20,30,114}_init_early() so that we have the unified
> tegra_init_early().
>
> Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
[...]
> diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
> index a599f6e..9bcecb8 100644
> --- a/arch/arm/mach-tegra/hotplug.c
> +++ b/arch/arm/mach-tegra/hotplug.c
> @@ -1,8 +1,7 @@
> /*
> - *
> * Copyright (C) 2002 ARM Ltd.
> * All Rights Reserved
> - * Copyright (c) 2010, 2012 NVIDIA Corporation. All rights reserved.
> + * Copyright (c) 2010, 2012-2013, NVIDIA Corporation. All rights reserved.
> *
> * This program is free software; you can redistribute it and/or modify
> * it under the terms of the GNU General Public License version 2 as
> @@ -15,6 +14,7 @@
> #include <asm/cacheflush.h>
> #include <asm/smp_plat.h>
>
> +#include "fuse.h"
> #include "sleep.h"
>
> static void (*tegra_hotplug_shutdown)(void);
> @@ -56,18 +56,21 @@ int tegra_cpu_disable(unsigned int cpu)
> return cpu == 0 ? -EPERM : 0;
> }
>
> -#ifdef CONFIG_ARCH_TEGRA_2x_SOC
> -extern void tegra20_hotplug_shutdown(void);
> -void __init tegra20_hotplug_init(void)
> +void __init tegra_hotplug_init(void)
> {
> - tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
> -}
> + switch (tegra_chip_id) {
> +#ifdef CONFIG_ARCH_TEGRA_2x_SOC
> + case TEGRA20:
> + tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
> + break;
> #endif
> -
> -#ifdef CONFIG_ARCH_TEGRA_3x_SOC
> -extern void tegra30_hotplug_shutdown(void);
> -void __init tegra30_hotplug_init(void)
> -{
> - tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
> -}
> +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
> + case TEGRA30:
> + tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
> + break;
> #endif
> + default:
> + BUG_ON(IS_ENABLED(CONFIG_HOTPLUG_CPU));
> + break;
> + }
> +}
are these ifdefs really needed? Multisoc kernels will enable them all anyway
and there is a case structure which protects the assignments. Also the hotplug
functions are very tiny, so there shouldn't be a big loss.
Marc
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
2013-02-08 12:29 ` Marc Dietrich
(?)
@ 2013-02-08 17:09 ` Stephen Warren
-1 siblings, 0 replies; 43+ messages in thread
From: Stephen Warren @ 2013-02-08 17:09 UTC (permalink / raw)
To: Marc Dietrich
Cc: Hiroshi Doyu, linux-tegra-u79uwXL29TY76Z2rM5mHXA,
arnd-r2nGTMty4D4, Russell King,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
On 02/08/2013 05:29 AM, Marc Dietrich wrote:
> Hiroshi,
>
> Am Freitag, 8. Februar 2013, 09:29:31 schrieb Hiroshi Doyu:
>> Refactored tegra{20,30,114}_init_early() so that we have the unified
>> tegra_init_early().
>> diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
>> +void __init tegra_hotplug_init(void)
>> {
>> + switch (tegra_chip_id) {
>> +#ifdef CONFIG_ARCH_TEGRA_2x_SOC
>> + case TEGRA20:
>> + tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
>> + break;
>> #endif
>> +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
>> + case TEGRA30:
>> + tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
>> + break;
>> #endif
>> + default:
>> + BUG_ON(IS_ENABLED(CONFIG_HOTPLUG_CPU));
>> + break;
>> + }
>> +}
>
> are these ifdefs really needed? Multisoc kernels will enable them all anyway
> and there is a case structure which protects the assignments. Also the hotplug
> functions are very tiny, so there shouldn't be a big loss.
The files that contain/implement those functions are separate for each
SoC and only included in the build when the individual SoCs are enabled.
While multi-platform SoCs do make sense for distros, we also very
specifically want to support the case where only Tegra, and only a
single Tegra SoC, is enabled, hence this separation.
(and Tegra doesn't support multi-platform yet; maybe in another kernel
release or two)
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-08 17:09 ` Stephen Warren
0 siblings, 0 replies; 43+ messages in thread
From: Stephen Warren @ 2013-02-08 17:09 UTC (permalink / raw)
To: linux-arm-kernel
On 02/08/2013 05:29 AM, Marc Dietrich wrote:
> Hiroshi,
>
> Am Freitag, 8. Februar 2013, 09:29:31 schrieb Hiroshi Doyu:
>> Refactored tegra{20,30,114}_init_early() so that we have the unified
>> tegra_init_early().
>> diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
>> +void __init tegra_hotplug_init(void)
>> {
>> + switch (tegra_chip_id) {
>> +#ifdef CONFIG_ARCH_TEGRA_2x_SOC
>> + case TEGRA20:
>> + tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
>> + break;
>> #endif
>> +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
>> + case TEGRA30:
>> + tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
>> + break;
>> #endif
>> + default:
>> + BUG_ON(IS_ENABLED(CONFIG_HOTPLUG_CPU));
>> + break;
>> + }
>> +}
>
> are these ifdefs really needed? Multisoc kernels will enable them all anyway
> and there is a case structure which protects the assignments. Also the hotplug
> functions are very tiny, so there shouldn't be a big loss.
The files that contain/implement those functions are separate for each
SoC and only included in the build when the individual SoCs are enabled.
While multi-platform SoCs do make sense for distros, we also very
specifically want to support the case where only Tegra, and only a
single Tegra SoC, is enabled, hence this separation.
(and Tegra doesn't support multi-platform yet; maybe in another kernel
release or two)
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-08 17:09 ` Stephen Warren
0 siblings, 0 replies; 43+ messages in thread
From: Stephen Warren @ 2013-02-08 17:09 UTC (permalink / raw)
To: Marc Dietrich
Cc: Hiroshi Doyu, linux-tegra, arnd, Russell King, linux-arm-kernel,
linux-kernel
On 02/08/2013 05:29 AM, Marc Dietrich wrote:
> Hiroshi,
>
> Am Freitag, 8. Februar 2013, 09:29:31 schrieb Hiroshi Doyu:
>> Refactored tegra{20,30,114}_init_early() so that we have the unified
>> tegra_init_early().
>> diff --git a/arch/arm/mach-tegra/hotplug.c b/arch/arm/mach-tegra/hotplug.c
>> +void __init tegra_hotplug_init(void)
>> {
>> + switch (tegra_chip_id) {
>> +#ifdef CONFIG_ARCH_TEGRA_2x_SOC
>> + case TEGRA20:
>> + tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
>> + break;
>> #endif
>> +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
>> + case TEGRA30:
>> + tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
>> + break;
>> #endif
>> + default:
>> + BUG_ON(IS_ENABLED(CONFIG_HOTPLUG_CPU));
>> + break;
>> + }
>> +}
>
> are these ifdefs really needed? Multisoc kernels will enable them all anyway
> and there is a case structure which protects the assignments. Also the hotplug
> functions are very tiny, so there shouldn't be a big loss.
The files that contain/implement those functions are separate for each
SoC and only included in the build when the individual SoCs are enabled.
While multi-platform SoCs do make sense for distros, we also very
specifically want to support the case where only Tegra, and only a
single Tegra SoC, is enabled, hence this separation.
(and Tegra doesn't support multi-platform yet; maybe in another kernel
release or two)
^ permalink raw reply [flat|nested] 43+ messages in thread
[parent not found: <51153136.7010705-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>]
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
2013-02-08 17:09 ` Stephen Warren
(?)
@ 2013-02-10 17:28 ` Marc Dietrich
-1 siblings, 0 replies; 43+ messages in thread
From: Marc Dietrich @ 2013-02-10 17:28 UTC (permalink / raw)
To: Stephen Warren
Cc: Hiroshi Doyu, linux-tegra-u79uwXL29TY76Z2rM5mHXA,
arnd-r2nGTMty4D4, Russell King,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
On Friday 08 February 2013 10:09:10 Stephen Warren wrote:
> On 02/08/2013 05:29 AM, Marc Dietrich wrote:
> > Hiroshi,
> >
> > Am Freitag, 8. Februar 2013, 09:29:31 schrieb Hiroshi Doyu:
> >> Refactored tegra{20,30,114}_init_early() so that we have the unified
> >> tegra_init_early().
> >>
> >> diff --git a/arch/arm/mach-tegra/hotplug.c
> >> b/arch/arm/mach-tegra/hotplug.c
> >>
> >> +void __init tegra_hotplug_init(void)
> >>
> >> {
> >>
> >> + switch (tegra_chip_id) {
> >> +#ifdef CONFIG_ARCH_TEGRA_2x_SOC
> >> + case TEGRA20:
> >> + tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
> >> + break;
> >>
> >> #endif
> >>
> >> +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
> >> + case TEGRA30:
> >> + tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
> >> + break;
> >>
> >> #endif
> >>
> >> + default:
> >> + BUG_ON(IS_ENABLED(CONFIG_HOTPLUG_CPU));
> >> + break;
> >> + }
> >> +}
> >
> > are these ifdefs really needed? Multisoc kernels will enable them all
> > anyway and there is a case structure which protects the assignments. Also
> > the hotplug functions are very tiny, so there shouldn't be a big loss.
>
> The files that contain/implement those functions are separate for each
> SoC and only included in the build when the individual SoCs are enabled.
>
> While multi-platform SoCs do make sense for distros, we also very
> specifically want to support the case where only Tegra, and only a
> single Tegra SoC, is enabled, hence this separation.
Huh? so tegra_defconfig is not supported?
grep "TEGRA_.*_SOC" tegra_defconfig:
CONFIG_ARCH_TEGRA_2x_SOC=y
CONFIG_ARCH_TEGRA_3x_SOC=y
Marc
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-10 17:28 ` Marc Dietrich
0 siblings, 0 replies; 43+ messages in thread
From: Marc Dietrich @ 2013-02-10 17:28 UTC (permalink / raw)
To: linux-arm-kernel
On Friday 08 February 2013 10:09:10 Stephen Warren wrote:
> On 02/08/2013 05:29 AM, Marc Dietrich wrote:
> > Hiroshi,
> >
> > Am Freitag, 8. Februar 2013, 09:29:31 schrieb Hiroshi Doyu:
> >> Refactored tegra{20,30,114}_init_early() so that we have the unified
> >> tegra_init_early().
> >>
> >> diff --git a/arch/arm/mach-tegra/hotplug.c
> >> b/arch/arm/mach-tegra/hotplug.c
> >>
> >> +void __init tegra_hotplug_init(void)
> >>
> >> {
> >>
> >> + switch (tegra_chip_id) {
> >> +#ifdef CONFIG_ARCH_TEGRA_2x_SOC
> >> + case TEGRA20:
> >> + tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
> >> + break;
> >>
> >> #endif
> >>
> >> +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
> >> + case TEGRA30:
> >> + tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
> >> + break;
> >>
> >> #endif
> >>
> >> + default:
> >> + BUG_ON(IS_ENABLED(CONFIG_HOTPLUG_CPU));
> >> + break;
> >> + }
> >> +}
> >
> > are these ifdefs really needed? Multisoc kernels will enable them all
> > anyway and there is a case structure which protects the assignments. Also
> > the hotplug functions are very tiny, so there shouldn't be a big loss.
>
> The files that contain/implement those functions are separate for each
> SoC and only included in the build when the individual SoCs are enabled.
>
> While multi-platform SoCs do make sense for distros, we also very
> specifically want to support the case where only Tegra, and only a
> single Tegra SoC, is enabled, hence this separation.
Huh? so tegra_defconfig is not supported?
grep "TEGRA_.*_SOC" tegra_defconfig:
CONFIG_ARCH_TEGRA_2x_SOC=y
CONFIG_ARCH_TEGRA_3x_SOC=y
Marc
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-10 17:28 ` Marc Dietrich
0 siblings, 0 replies; 43+ messages in thread
From: Marc Dietrich @ 2013-02-10 17:28 UTC (permalink / raw)
To: Stephen Warren
Cc: Hiroshi Doyu, linux-tegra, arnd, Russell King, linux-arm-kernel,
linux-kernel
On Friday 08 February 2013 10:09:10 Stephen Warren wrote:
> On 02/08/2013 05:29 AM, Marc Dietrich wrote:
> > Hiroshi,
> >
> > Am Freitag, 8. Februar 2013, 09:29:31 schrieb Hiroshi Doyu:
> >> Refactored tegra{20,30,114}_init_early() so that we have the unified
> >> tegra_init_early().
> >>
> >> diff --git a/arch/arm/mach-tegra/hotplug.c
> >> b/arch/arm/mach-tegra/hotplug.c
> >>
> >> +void __init tegra_hotplug_init(void)
> >>
> >> {
> >>
> >> + switch (tegra_chip_id) {
> >> +#ifdef CONFIG_ARCH_TEGRA_2x_SOC
> >> + case TEGRA20:
> >> + tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
> >> + break;
> >>
> >> #endif
> >>
> >> +#if defined(CONFIG_ARCH_TEGRA_3x_SOC)
> >> + case TEGRA30:
> >> + tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
> >> + break;
> >>
> >> #endif
> >>
> >> + default:
> >> + BUG_ON(IS_ENABLED(CONFIG_HOTPLUG_CPU));
> >> + break;
> >> + }
> >> +}
> >
> > are these ifdefs really needed? Multisoc kernels will enable them all
> > anyway and there is a case structure which protects the assignments. Also
> > the hotplug functions are very tiny, so there shouldn't be a big loss.
>
> The files that contain/implement those functions are separate for each
> SoC and only included in the build when the individual SoCs are enabled.
>
> While multi-platform SoCs do make sense for distros, we also very
> specifically want to support the case where only Tegra, and only a
> single Tegra SoC, is enabled, hence this separation.
Huh? so tegra_defconfig is not supported?
grep "TEGRA_.*_SOC" tegra_defconfig:
CONFIG_ARCH_TEGRA_2x_SOC=y
CONFIG_ARCH_TEGRA_3x_SOC=y
Marc
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
2013-02-10 17:28 ` Marc Dietrich
(?)
@ 2013-02-10 20:20 ` Stephen Warren
-1 siblings, 0 replies; 43+ messages in thread
From: Stephen Warren @ 2013-02-10 20:20 UTC (permalink / raw)
To: Marc Dietrich
Cc: Hiroshi Doyu, linux-tegra-u79uwXL29TY76Z2rM5mHXA,
arnd-r2nGTMty4D4, Russell King,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
1On 02/10/2013 10:28 AM, Marc Dietrich wrote:
> On Friday 08 February 2013 10:09:10 Stephen Warren wrote:
>> On 02/08/2013 05:29 AM, Marc Dietrich wrote:
>>> Hiroshi,
>>>
>>> Am Freitag, 8. Februar 2013, 09:29:31 schrieb Hiroshi Doyu:
>>>> Refactored tegra{20,30,114}_init_early() so that we have the unified
>>>> tegra_init_early().
...
>>> are these ifdefs really needed? Multisoc kernels will enable them all
>>> anyway and there is a case structure which protects the assignments. Also
>>> the hotplug functions are very tiny, so there shouldn't be a big loss.
>>
>> The files that contain/implement those functions are separate for each
>> SoC and only included in the build when the individual SoCs are enabled.
>>
>> While multi-platform SoCs do make sense for distros, we also very
>> specifically want to support the case where only Tegra, and only a
>> single Tegra SoC, is enabled, hence this separation.
>
> Huh? so tegra_defconfig is not supported?
>
> grep "TEGRA_.*_SOC" tegra_defconfig:
>
> CONFIG_ARCH_TEGRA_2x_SOC=y
> CONFIG_ARCH_TEGRA_3x_SOC=y
I don't understand the question.
But to be clear. There are now 3 variants of Tegra supported. (Tegra20,
Tegra30, Tegra114). We want to be able to build a minimal-size kernel
(e.g. for embedded applications) that supports just one, any combination
of two, or all three Tegra variants.
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-10 20:20 ` Stephen Warren
0 siblings, 0 replies; 43+ messages in thread
From: Stephen Warren @ 2013-02-10 20:20 UTC (permalink / raw)
To: linux-arm-kernel
1On 02/10/2013 10:28 AM, Marc Dietrich wrote:
> On Friday 08 February 2013 10:09:10 Stephen Warren wrote:
>> On 02/08/2013 05:29 AM, Marc Dietrich wrote:
>>> Hiroshi,
>>>
>>> Am Freitag, 8. Februar 2013, 09:29:31 schrieb Hiroshi Doyu:
>>>> Refactored tegra{20,30,114}_init_early() so that we have the unified
>>>> tegra_init_early().
...
>>> are these ifdefs really needed? Multisoc kernels will enable them all
>>> anyway and there is a case structure which protects the assignments. Also
>>> the hotplug functions are very tiny, so there shouldn't be a big loss.
>>
>> The files that contain/implement those functions are separate for each
>> SoC and only included in the build when the individual SoCs are enabled.
>>
>> While multi-platform SoCs do make sense for distros, we also very
>> specifically want to support the case where only Tegra, and only a
>> single Tegra SoC, is enabled, hence this separation.
>
> Huh? so tegra_defconfig is not supported?
>
> grep "TEGRA_.*_SOC" tegra_defconfig:
>
> CONFIG_ARCH_TEGRA_2x_SOC=y
> CONFIG_ARCH_TEGRA_3x_SOC=y
I don't understand the question.
But to be clear. There are now 3 variants of Tegra supported. (Tegra20,
Tegra30, Tegra114). We want to be able to build a minimal-size kernel
(e.g. for embedded applications) that supports just one, any combination
of two, or all three Tegra variants.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-10 20:20 ` Stephen Warren
0 siblings, 0 replies; 43+ messages in thread
From: Stephen Warren @ 2013-02-10 20:20 UTC (permalink / raw)
To: Marc Dietrich
Cc: Hiroshi Doyu, linux-tegra, arnd, Russell King, linux-arm-kernel,
linux-kernel
1On 02/10/2013 10:28 AM, Marc Dietrich wrote:
> On Friday 08 February 2013 10:09:10 Stephen Warren wrote:
>> On 02/08/2013 05:29 AM, Marc Dietrich wrote:
>>> Hiroshi,
>>>
>>> Am Freitag, 8. Februar 2013, 09:29:31 schrieb Hiroshi Doyu:
>>>> Refactored tegra{20,30,114}_init_early() so that we have the unified
>>>> tegra_init_early().
...
>>> are these ifdefs really needed? Multisoc kernels will enable them all
>>> anyway and there is a case structure which protects the assignments. Also
>>> the hotplug functions are very tiny, so there shouldn't be a big loss.
>>
>> The files that contain/implement those functions are separate for each
>> SoC and only included in the build when the individual SoCs are enabled.
>>
>> While multi-platform SoCs do make sense for distros, we also very
>> specifically want to support the case where only Tegra, and only a
>> single Tegra SoC, is enabled, hence this separation.
>
> Huh? so tegra_defconfig is not supported?
>
> grep "TEGRA_.*_SOC" tegra_defconfig:
>
> CONFIG_ARCH_TEGRA_2x_SOC=y
> CONFIG_ARCH_TEGRA_3x_SOC=y
I don't understand the question.
But to be clear. There are now 3 variants of Tegra supported. (Tegra20,
Tegra30, Tegra114). We want to be able to build a minimal-size kernel
(e.g. for embedded applications) that supports just one, any combination
of two, or all three Tegra variants.
^ permalink raw reply [flat|nested] 43+ messages in thread
[parent not found: <51180121.6040803-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>]
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
2013-02-10 20:20 ` Stephen Warren
(?)
@ 2013-02-10 21:16 ` Marc Dietrich
-1 siblings, 0 replies; 43+ messages in thread
From: Marc Dietrich @ 2013-02-10 21:16 UTC (permalink / raw)
To: Stephen Warren
Cc: Hiroshi Doyu, linux-tegra-u79uwXL29TY76Z2rM5mHXA,
arnd-r2nGTMty4D4, Russell King,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
On Sunday 10 February 2013 13:20:49 Stephen Warren wrote:
> 1On 02/10/2013 10:28 AM, Marc Dietrich wrote:
> > On Friday 08 February 2013 10:09:10 Stephen Warren wrote:
> >> On 02/08/2013 05:29 AM, Marc Dietrich wrote:
> >>> Hiroshi,
> >>>
> >>> Am Freitag, 8. Februar 2013, 09:29:31 schrieb Hiroshi Doyu:
> >>>> Refactored tegra{20,30,114}_init_early() so that we have the unified
> >>>> tegra_init_early().
>
> ...
>
> >>> are these ifdefs really needed? Multisoc kernels will enable them all
> >>> anyway and there is a case structure which protects the assignments.
> >>> Also
> >>> the hotplug functions are very tiny, so there shouldn't be a big loss.
> >>
> >> The files that contain/implement those functions are separate for each
> >> SoC and only included in the build when the individual SoCs are enabled.
> >>
> >> While multi-platform SoCs do make sense for distros, we also very
> >> specifically want to support the case where only Tegra, and only a
> >> single Tegra SoC, is enabled, hence this separation.
> >
> > Huh? so tegra_defconfig is not supported?
> >
> > grep "TEGRA_.*_SOC" tegra_defconfig:
> >
> > CONFIG_ARCH_TEGRA_2x_SOC=y
> > CONFIG_ARCH_TEGRA_3x_SOC=y
>
> I don't understand the question.
>
> But to be clear. There are now 3 variants of Tegra supported. (Tegra20,
> Tegra30, Tegra114). We want to be able to build a minimal-size kernel
> (e.g. for embedded applications) that supports just one, any combination
> of two, or all three Tegra variants.
ah, ok - I just skipped the "also" in your sentence above. But still, the
#ifdefs look strange to me and save only a few byte of code. Just me few
cents.
Marc
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-10 21:16 ` Marc Dietrich
0 siblings, 0 replies; 43+ messages in thread
From: Marc Dietrich @ 2013-02-10 21:16 UTC (permalink / raw)
To: linux-arm-kernel
On Sunday 10 February 2013 13:20:49 Stephen Warren wrote:
> 1On 02/10/2013 10:28 AM, Marc Dietrich wrote:
> > On Friday 08 February 2013 10:09:10 Stephen Warren wrote:
> >> On 02/08/2013 05:29 AM, Marc Dietrich wrote:
> >>> Hiroshi,
> >>>
> >>> Am Freitag, 8. Februar 2013, 09:29:31 schrieb Hiroshi Doyu:
> >>>> Refactored tegra{20,30,114}_init_early() so that we have the unified
> >>>> tegra_init_early().
>
> ...
>
> >>> are these ifdefs really needed? Multisoc kernels will enable them all
> >>> anyway and there is a case structure which protects the assignments.
> >>> Also
> >>> the hotplug functions are very tiny, so there shouldn't be a big loss.
> >>
> >> The files that contain/implement those functions are separate for each
> >> SoC and only included in the build when the individual SoCs are enabled.
> >>
> >> While multi-platform SoCs do make sense for distros, we also very
> >> specifically want to support the case where only Tegra, and only a
> >> single Tegra SoC, is enabled, hence this separation.
> >
> > Huh? so tegra_defconfig is not supported?
> >
> > grep "TEGRA_.*_SOC" tegra_defconfig:
> >
> > CONFIG_ARCH_TEGRA_2x_SOC=y
> > CONFIG_ARCH_TEGRA_3x_SOC=y
>
> I don't understand the question.
>
> But to be clear. There are now 3 variants of Tegra supported. (Tegra20,
> Tegra30, Tegra114). We want to be able to build a minimal-size kernel
> (e.g. for embedded applications) that supports just one, any combination
> of two, or all three Tegra variants.
ah, ok - I just skipped the "also" in your sentence above. But still, the
#ifdefs look strange to me and save only a few byte of code. Just me few
cents.
Marc
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-10 21:16 ` Marc Dietrich
0 siblings, 0 replies; 43+ messages in thread
From: Marc Dietrich @ 2013-02-10 21:16 UTC (permalink / raw)
To: Stephen Warren
Cc: Hiroshi Doyu, linux-tegra, arnd, Russell King, linux-arm-kernel,
linux-kernel
On Sunday 10 February 2013 13:20:49 Stephen Warren wrote:
> 1On 02/10/2013 10:28 AM, Marc Dietrich wrote:
> > On Friday 08 February 2013 10:09:10 Stephen Warren wrote:
> >> On 02/08/2013 05:29 AM, Marc Dietrich wrote:
> >>> Hiroshi,
> >>>
> >>> Am Freitag, 8. Februar 2013, 09:29:31 schrieb Hiroshi Doyu:
> >>>> Refactored tegra{20,30,114}_init_early() so that we have the unified
> >>>> tegra_init_early().
>
> ...
>
> >>> are these ifdefs really needed? Multisoc kernels will enable them all
> >>> anyway and there is a case structure which protects the assignments.
> >>> Also
> >>> the hotplug functions are very tiny, so there shouldn't be a big loss.
> >>
> >> The files that contain/implement those functions are separate for each
> >> SoC and only included in the build when the individual SoCs are enabled.
> >>
> >> While multi-platform SoCs do make sense for distros, we also very
> >> specifically want to support the case where only Tegra, and only a
> >> single Tegra SoC, is enabled, hence this separation.
> >
> > Huh? so tegra_defconfig is not supported?
> >
> > grep "TEGRA_.*_SOC" tegra_defconfig:
> >
> > CONFIG_ARCH_TEGRA_2x_SOC=y
> > CONFIG_ARCH_TEGRA_3x_SOC=y
>
> I don't understand the question.
>
> But to be clear. There are now 3 variants of Tegra supported. (Tegra20,
> Tegra30, Tegra114). We want to be able to build a minimal-size kernel
> (e.g. for embedded applications) that supports just one, any combination
> of two, or all three Tegra variants.
ah, ok - I just skipped the "also" in your sentence above. But still, the
#ifdefs look strange to me and save only a few byte of code. Just me few
cents.
Marc
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
2013-02-10 21:16 ` Marc Dietrich
(?)
@ 2013-02-11 4:18 ` Hiroshi Doyu
-1 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-11 4:18 UTC (permalink / raw)
To: marvin24-Mmb7MZpHnFY
Cc: swarren-3lzwWm7+Weoh9ZMKESR00Q,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, arnd-r2nGTMty4D4,
linux-lFZ/pmaqli7XmaaqVzeoHQ,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Hi Marc,
Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org> wrote @ Sun, 10 Feb 2013 22:16:14 +0100:
> ah, ok - I just skipped the "also" in your sentence above. But still, the
> #ifdefs look strange to me and save only a few byte of code. Just me few
> cents.
What about the following as Arnd suggested[1]?
void __init tegra_hotplug_init(void)
{
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
return;
if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC)) && tegra_chip_id == TEGRA20)
tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC)) && tegra_chip_id == TEGRA30)
tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
}
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-February/148632.html
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-11 4:18 ` Hiroshi Doyu
0 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-11 4:18 UTC (permalink / raw)
To: linux-arm-kernel
Hi Marc,
Marc Dietrich <marvin24@gmx.de> wrote @ Sun, 10 Feb 2013 22:16:14 +0100:
> ah, ok - I just skipped the "also" in your sentence above. But still, the
> #ifdefs look strange to me and save only a few byte of code. Just me few
> cents.
What about the following as Arnd suggested[1]?
void __init tegra_hotplug_init(void)
{
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
return;
if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC)) && tegra_chip_id == TEGRA20)
tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC)) && tegra_chip_id == TEGRA30)
tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
}
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-February/148632.html
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 1/4] ARM: tegra: Unify tegra{20,30,114}_init_early()
@ 2013-02-11 4:18 ` Hiroshi Doyu
0 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-11 4:18 UTC (permalink / raw)
To: marvin24
Cc: swarren, linux-tegra, arnd, linux, linux-arm-kernel, linux-kernel
Hi Marc,
Marc Dietrich <marvin24@gmx.de> wrote @ Sun, 10 Feb 2013 22:16:14 +0100:
> ah, ok - I just skipped the "also" in your sentence above. But still, the
> #ifdefs look strange to me and save only a few byte of code. Just me few
> cents.
What about the following as Arnd suggested[1]?
void __init tegra_hotplug_init(void)
{
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU))
return;
if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC)) && tegra_chip_id == TEGRA20)
tegra_hotplug_shutdown = tegra20_hotplug_shutdown;
if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC)) && tegra_chip_id == TEGRA30)
tegra_hotplug_shutdown = tegra30_hotplug_shutdown;
}
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-February/148632.html
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 2/4] ARM: tegra: Unify board-dt-tegra{30,114}.c
2013-02-08 7:29 [PATCH 0/4] ARM: tegra: Unify board-dt-tegra{20,30,114} Hiroshi Doyu
2013-02-08 7:29 ` Hiroshi Doyu
@ 2013-02-08 7:29 ` Hiroshi Doyu
2013-02-08 7:29 ` Hiroshi Doyu
2013-02-08 7:29 ` Hiroshi Doyu
3 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-08 7:29 UTC (permalink / raw)
To: linux-tegra
Cc: arnd, Hiroshi Doyu, Stephen Warren, Russell King,
linux-arm-kernel, linux-kernel
Refactored that Tegra114 uses board-dt-tegra30.
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
arch/arm/mach-tegra/Makefile | 2 +-
arch/arm/mach-tegra/board-dt-tegra114.c | 46 -------------------------------
arch/arm/mach-tegra/board-dt-tegra30.c | 3 +-
3 files changed, 3 insertions(+), 48 deletions(-)
delete mode 100644 arch/arm/mach-tegra/board-dt-tegra114.c
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index f6b46ae..1a08ecd 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -29,7 +29,7 @@ obj-$(CONFIG_TEGRA_PCI) += pcie.o
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o
obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o
-obj-$(CONFIG_ARCH_TEGRA_114_SOC) += board-dt-tegra114.o
+obj-$(CONFIG_ARCH_TEGRA_114_SOC) += board-dt-tegra30.o
ifeq ($(CONFIG_CPU_IDLE),y)
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += cpuidle-tegra114.o
endif
diff --git a/arch/arm/mach-tegra/board-dt-tegra114.c b/arch/arm/mach-tegra/board-dt-tegra114.c
deleted file mode 100644
index 08e8294..0000000
--- a/arch/arm/mach-tegra/board-dt-tegra114.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * NVIDIA Tegra114 device tree board support
- *
- * Copyright (C) 2013 NVIDIA Corporation
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#include <linux/of.h>
-#include <linux/of_platform.h>
-#include <linux/clocksource.h>
-
-#include <asm/mach/arch.h>
-
-#include "board.h"
-#include "common.h"
-
-static void __init tegra114_dt_init(void)
-{
- of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
-
-static const char * const tegra114_dt_board_compat[] = {
- "nvidia,tegra114",
- NULL,
-};
-
-DT_MACHINE_START(TEGRA114_DT, "NVIDIA Tegra114 (Flattened Device Tree)")
- .smp = smp_ops(tegra_smp_ops),
- .map_io = tegra_map_common_io,
- .init_early = tegra_init_early,
- .init_irq = tegra_dt_init_irq,
- .init_time = clocksource_of_init,
- .init_machine = tegra114_dt_init,
- .init_late = tegra_init_late,
- .restart = tegra_assert_system_reset,
- .dt_compat = tegra114_dt_board_compat,
-MACHINE_END
diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c
index 63f8139..82cd85c 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/board-dt-tegra30.c
@@ -44,10 +44,11 @@ static void __init tegra30_dt_init(void)
static const char *tegra30_dt_board_compat[] = {
"nvidia,tegra30",
+ "nvidia,tegra114",
NULL
};
-DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30 (Flattened Device Tree)")
+DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30/114 (Flattened Device Tree)")
.smp = smp_ops(tegra_smp_ops),
.map_io = tegra_map_common_io,
.init_early = tegra_init_early,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 2/4] ARM: tegra: Unify board-dt-tegra{30,114}.c
@ 2013-02-08 7:29 ` Hiroshi Doyu
0 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-08 7:29 UTC (permalink / raw)
To: linux-arm-kernel
Refactored that Tegra114 uses board-dt-tegra30.
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
arch/arm/mach-tegra/Makefile | 2 +-
arch/arm/mach-tegra/board-dt-tegra114.c | 46 -------------------------------
arch/arm/mach-tegra/board-dt-tegra30.c | 3 +-
3 files changed, 3 insertions(+), 48 deletions(-)
delete mode 100644 arch/arm/mach-tegra/board-dt-tegra114.c
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index f6b46ae..1a08ecd 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -29,7 +29,7 @@ obj-$(CONFIG_TEGRA_PCI) += pcie.o
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o
obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o
-obj-$(CONFIG_ARCH_TEGRA_114_SOC) += board-dt-tegra114.o
+obj-$(CONFIG_ARCH_TEGRA_114_SOC) += board-dt-tegra30.o
ifeq ($(CONFIG_CPU_IDLE),y)
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += cpuidle-tegra114.o
endif
diff --git a/arch/arm/mach-tegra/board-dt-tegra114.c b/arch/arm/mach-tegra/board-dt-tegra114.c
deleted file mode 100644
index 08e8294..0000000
--- a/arch/arm/mach-tegra/board-dt-tegra114.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * NVIDIA Tegra114 device tree board support
- *
- * Copyright (C) 2013 NVIDIA Corporation
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#include <linux/of.h>
-#include <linux/of_platform.h>
-#include <linux/clocksource.h>
-
-#include <asm/mach/arch.h>
-
-#include "board.h"
-#include "common.h"
-
-static void __init tegra114_dt_init(void)
-{
- of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
-
-static const char * const tegra114_dt_board_compat[] = {
- "nvidia,tegra114",
- NULL,
-};
-
-DT_MACHINE_START(TEGRA114_DT, "NVIDIA Tegra114 (Flattened Device Tree)")
- .smp = smp_ops(tegra_smp_ops),
- .map_io = tegra_map_common_io,
- .init_early = tegra_init_early,
- .init_irq = tegra_dt_init_irq,
- .init_time = clocksource_of_init,
- .init_machine = tegra114_dt_init,
- .init_late = tegra_init_late,
- .restart = tegra_assert_system_reset,
- .dt_compat = tegra114_dt_board_compat,
-MACHINE_END
diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c
index 63f8139..82cd85c 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/board-dt-tegra30.c
@@ -44,10 +44,11 @@ static void __init tegra30_dt_init(void)
static const char *tegra30_dt_board_compat[] = {
"nvidia,tegra30",
+ "nvidia,tegra114",
NULL
};
-DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30 (Flattened Device Tree)")
+DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30/114 (Flattened Device Tree)")
.smp = smp_ops(tegra_smp_ops),
.map_io = tegra_map_common_io,
.init_early = tegra_init_early,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 2/4] ARM: tegra: Unify board-dt-tegra{30,114}.c
@ 2013-02-08 7:29 ` Hiroshi Doyu
0 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-08 7:29 UTC (permalink / raw)
To: linux-tegra
Cc: arnd, Hiroshi Doyu, Stephen Warren, Russell King,
linux-arm-kernel, linux-kernel
Refactored that Tegra114 uses board-dt-tegra30.
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
arch/arm/mach-tegra/Makefile | 2 +-
arch/arm/mach-tegra/board-dt-tegra114.c | 46 -------------------------------
arch/arm/mach-tegra/board-dt-tegra30.c | 3 +-
3 files changed, 3 insertions(+), 48 deletions(-)
delete mode 100644 arch/arm/mach-tegra/board-dt-tegra114.c
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index f6b46ae..1a08ecd 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -29,7 +29,7 @@ obj-$(CONFIG_TEGRA_PCI) += pcie.o
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o
obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o
-obj-$(CONFIG_ARCH_TEGRA_114_SOC) += board-dt-tegra114.o
+obj-$(CONFIG_ARCH_TEGRA_114_SOC) += board-dt-tegra30.o
ifeq ($(CONFIG_CPU_IDLE),y)
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += cpuidle-tegra114.o
endif
diff --git a/arch/arm/mach-tegra/board-dt-tegra114.c b/arch/arm/mach-tegra/board-dt-tegra114.c
deleted file mode 100644
index 08e8294..0000000
--- a/arch/arm/mach-tegra/board-dt-tegra114.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * NVIDIA Tegra114 device tree board support
- *
- * Copyright (C) 2013 NVIDIA Corporation
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#include <linux/of.h>
-#include <linux/of_platform.h>
-#include <linux/clocksource.h>
-
-#include <asm/mach/arch.h>
-
-#include "board.h"
-#include "common.h"
-
-static void __init tegra114_dt_init(void)
-{
- of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
-
-static const char * const tegra114_dt_board_compat[] = {
- "nvidia,tegra114",
- NULL,
-};
-
-DT_MACHINE_START(TEGRA114_DT, "NVIDIA Tegra114 (Flattened Device Tree)")
- .smp = smp_ops(tegra_smp_ops),
- .map_io = tegra_map_common_io,
- .init_early = tegra_init_early,
- .init_irq = tegra_dt_init_irq,
- .init_time = clocksource_of_init,
- .init_machine = tegra114_dt_init,
- .init_late = tegra_init_late,
- .restart = tegra_assert_system_reset,
- .dt_compat = tegra114_dt_board_compat,
-MACHINE_END
diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c
index 63f8139..82cd85c 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/board-dt-tegra30.c
@@ -44,10 +44,11 @@ static void __init tegra30_dt_init(void)
static const char *tegra30_dt_board_compat[] = {
"nvidia,tegra30",
+ "nvidia,tegra114",
NULL
};
-DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30 (Flattened Device Tree)")
+DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30/114 (Flattened Device Tree)")
.smp = smp_ops(tegra_smp_ops),
.map_io = tegra_map_common_io,
.init_early = tegra_init_early,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 3/4] ARM: tegra: Unify board-dt-tegra{20,30}.c to tegra.c
2013-02-08 7:29 [PATCH 0/4] ARM: tegra: Unify board-dt-tegra{20,30,114} Hiroshi Doyu
2013-02-08 7:29 ` Hiroshi Doyu
@ 2013-02-08 7:29 ` Hiroshi Doyu
2013-02-08 7:29 ` Hiroshi Doyu
2013-02-08 7:29 ` Hiroshi Doyu
3 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-08 7:29 UTC (permalink / raw)
To: linux-tegra
Cc: Russell King, arnd, Stephen Warren, linux-kernel,
linux-arm-kernel, Hiroshi Doyu
Refactored that Tegra{20,30,114} use the same board file.
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
arch/arm/mach-tegra/Makefile | 5 ++--
.../arm/mach-tegra/{board-dt-tegra30.c => tegra.c} | 27 ++++++++++----------
2 files changed, 15 insertions(+), 17 deletions(-)
rename arch/arm/mach-tegra/{board-dt-tegra30.c => tegra.c} (71%)
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index 1a08ecd..ee866337 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -27,9 +27,8 @@ obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o
obj-$(CONFIG_TEGRA_PCI) += pcie.o
-obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o
-obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o
-obj-$(CONFIG_ARCH_TEGRA_114_SOC) += board-dt-tegra30.o
+obj-y += tegra.o
+
ifeq ($(CONFIG_CPU_IDLE),y)
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += cpuidle-tegra114.o
endif
diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/tegra.c
similarity index 71%
rename from arch/arm/mach-tegra/board-dt-tegra30.c
rename to arch/arm/mach-tegra/tegra.c
index 82cd85c..62ae39a 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -1,14 +1,7 @@
/*
- * arch/arm/mach-tegra/board-dt-tegra30.c
- *
- * NVIDIA Tegra30 device tree board support
+ * NVIDIA Tegra SoC device tree board support
*
* Copyright (C) 2011, 2013, NVIDIA Corporation
- *
- * Derived from:
- *
- * arch/arm/mach-tegra/board-dt-tegra20.c
- *
* Copyright (C) 2010 Secret Lab Technologies, Ltd.
* Copyright (C) 2010 Google, Inc.
*
@@ -37,25 +30,31 @@
#include "common.h"
#include "iomap.h"
-static void __init tegra30_dt_init(void)
+static struct of_dev_auxdata tegra_auxdata_lookup[] __initdata = {
+ {},
+};
+
+static void __init tegra_dt_init(void)
{
- of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+ of_platform_populate(NULL, of_default_bus_match_table,
+ tegra_auxdata_lookup, NULL);
}
-static const char *tegra30_dt_board_compat[] = {
+static const char * const tegra_dt_board_compat[] = {
+ "nvidia,tegra20",
"nvidia,tegra30",
"nvidia,tegra114",
NULL
};
-DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30/114 (Flattened Device Tree)")
+DT_MACHINE_START(TEGRA_DT, "NVIDIA Tegra SoC (Flattened Device Tree)")
.smp = smp_ops(tegra_smp_ops),
.map_io = tegra_map_common_io,
.init_early = tegra_init_early,
.init_irq = tegra_dt_init_irq,
.init_time = clocksource_of_init,
- .init_machine = tegra30_dt_init,
+ .init_machine = tegra_dt_init,
.init_late = tegra_init_late,
.restart = tegra_assert_system_reset,
- .dt_compat = tegra30_dt_board_compat,
+ .dt_compat = tegra_dt_board_compat,
MACHINE_END
--
1.7.9.5
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 3/4] ARM: tegra: Unify board-dt-tegra{20,30}.c to tegra.c
@ 2013-02-08 7:29 ` Hiroshi Doyu
0 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-08 7:29 UTC (permalink / raw)
To: linux-arm-kernel
Refactored that Tegra{20,30,114} use the same board file.
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
arch/arm/mach-tegra/Makefile | 5 ++--
.../arm/mach-tegra/{board-dt-tegra30.c => tegra.c} | 27 ++++++++++----------
2 files changed, 15 insertions(+), 17 deletions(-)
rename arch/arm/mach-tegra/{board-dt-tegra30.c => tegra.c} (71%)
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index 1a08ecd..ee866337 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -27,9 +27,8 @@ obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o
obj-$(CONFIG_TEGRA_PCI) += pcie.o
-obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o
-obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o
-obj-$(CONFIG_ARCH_TEGRA_114_SOC) += board-dt-tegra30.o
+obj-y += tegra.o
+
ifeq ($(CONFIG_CPU_IDLE),y)
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += cpuidle-tegra114.o
endif
diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/tegra.c
similarity index 71%
rename from arch/arm/mach-tegra/board-dt-tegra30.c
rename to arch/arm/mach-tegra/tegra.c
index 82cd85c..62ae39a 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -1,14 +1,7 @@
/*
- * arch/arm/mach-tegra/board-dt-tegra30.c
- *
- * NVIDIA Tegra30 device tree board support
+ * NVIDIA Tegra SoC device tree board support
*
* Copyright (C) 2011, 2013, NVIDIA Corporation
- *
- * Derived from:
- *
- * arch/arm/mach-tegra/board-dt-tegra20.c
- *
* Copyright (C) 2010 Secret Lab Technologies, Ltd.
* Copyright (C) 2010 Google, Inc.
*
@@ -37,25 +30,31 @@
#include "common.h"
#include "iomap.h"
-static void __init tegra30_dt_init(void)
+static struct of_dev_auxdata tegra_auxdata_lookup[] __initdata = {
+ {},
+};
+
+static void __init tegra_dt_init(void)
{
- of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+ of_platform_populate(NULL, of_default_bus_match_table,
+ tegra_auxdata_lookup, NULL);
}
-static const char *tegra30_dt_board_compat[] = {
+static const char * const tegra_dt_board_compat[] = {
+ "nvidia,tegra20",
"nvidia,tegra30",
"nvidia,tegra114",
NULL
};
-DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30/114 (Flattened Device Tree)")
+DT_MACHINE_START(TEGRA_DT, "NVIDIA Tegra SoC (Flattened Device Tree)")
.smp = smp_ops(tegra_smp_ops),
.map_io = tegra_map_common_io,
.init_early = tegra_init_early,
.init_irq = tegra_dt_init_irq,
.init_time = clocksource_of_init,
- .init_machine = tegra30_dt_init,
+ .init_machine = tegra_dt_init,
.init_late = tegra_init_late,
.restart = tegra_assert_system_reset,
- .dt_compat = tegra30_dt_board_compat,
+ .dt_compat = tegra_dt_board_compat,
MACHINE_END
--
1.7.9.5
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 3/4] ARM: tegra: Unify board-dt-tegra{20,30}.c to tegra.c
@ 2013-02-08 7:29 ` Hiroshi Doyu
0 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-08 7:29 UTC (permalink / raw)
To: linux-tegra
Cc: arnd, Hiroshi Doyu, Stephen Warren, Russell King,
linux-arm-kernel, linux-kernel
Refactored that Tegra{20,30,114} use the same board file.
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
arch/arm/mach-tegra/Makefile | 5 ++--
.../arm/mach-tegra/{board-dt-tegra30.c => tegra.c} | 27 ++++++++++----------
2 files changed, 15 insertions(+), 17 deletions(-)
rename arch/arm/mach-tegra/{board-dt-tegra30.c => tegra.c} (71%)
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index 1a08ecd..ee866337 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -27,9 +27,8 @@ obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o
obj-$(CONFIG_TEGRA_PCI) += pcie.o
-obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-dt-tegra20.o
-obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o
-obj-$(CONFIG_ARCH_TEGRA_114_SOC) += board-dt-tegra30.o
+obj-y += tegra.o
+
ifeq ($(CONFIG_CPU_IDLE),y)
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += cpuidle-tegra114.o
endif
diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/tegra.c
similarity index 71%
rename from arch/arm/mach-tegra/board-dt-tegra30.c
rename to arch/arm/mach-tegra/tegra.c
index 82cd85c..62ae39a 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -1,14 +1,7 @@
/*
- * arch/arm/mach-tegra/board-dt-tegra30.c
- *
- * NVIDIA Tegra30 device tree board support
+ * NVIDIA Tegra SoC device tree board support
*
* Copyright (C) 2011, 2013, NVIDIA Corporation
- *
- * Derived from:
- *
- * arch/arm/mach-tegra/board-dt-tegra20.c
- *
* Copyright (C) 2010 Secret Lab Technologies, Ltd.
* Copyright (C) 2010 Google, Inc.
*
@@ -37,25 +30,31 @@
#include "common.h"
#include "iomap.h"
-static void __init tegra30_dt_init(void)
+static struct of_dev_auxdata tegra_auxdata_lookup[] __initdata = {
+ {},
+};
+
+static void __init tegra_dt_init(void)
{
- of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+ of_platform_populate(NULL, of_default_bus_match_table,
+ tegra_auxdata_lookup, NULL);
}
-static const char *tegra30_dt_board_compat[] = {
+static const char * const tegra_dt_board_compat[] = {
+ "nvidia,tegra20",
"nvidia,tegra30",
"nvidia,tegra114",
NULL
};
-DT_MACHINE_START(TEGRA30_DT, "NVIDIA Tegra30/114 (Flattened Device Tree)")
+DT_MACHINE_START(TEGRA_DT, "NVIDIA Tegra SoC (Flattened Device Tree)")
.smp = smp_ops(tegra_smp_ops),
.map_io = tegra_map_common_io,
.init_early = tegra_init_early,
.init_irq = tegra_dt_init_irq,
.init_time = clocksource_of_init,
- .init_machine = tegra30_dt_init,
+ .init_machine = tegra_dt_init,
.init_late = tegra_init_late,
.restart = tegra_assert_system_reset,
- .dt_compat = tegra30_dt_board_compat,
+ .dt_compat = tegra_dt_board_compat,
MACHINE_END
--
1.7.9.5
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 4/4] ARM: tegra: Restore USB/PCIE info in new DT board file
2013-02-08 7:29 [PATCH 0/4] ARM: tegra: Unify board-dt-tegra{20,30,114} Hiroshi Doyu
2013-02-08 7:29 ` Hiroshi Doyu
@ 2013-02-08 7:29 ` Hiroshi Doyu
2013-02-08 7:29 ` Hiroshi Doyu
2013-02-08 7:29 ` Hiroshi Doyu
3 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-08 7:29 UTC (permalink / raw)
To: linux-tegra
Cc: Russell King, arnd, Stephen Warren, linux-kernel,
linux-arm-kernel, Hiroshi Doyu
Mainly for the compatibility for the existing driver.
This would be removed once new USB/PCIE DT supports come.
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
arch/arm/mach-tegra/tegra.c | 92 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 90 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c
index 62ae39a..82fea64 100644
--- a/arch/arm/mach-tegra/tegra.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -23,6 +23,8 @@
#include <linux/of_fdt.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
+#include <linux/platform_data/tegra_usb.h>
+#include <linux/usb/tegra_usb_phy.h>
#include <asm/mach/arch.h>
@@ -30,9 +32,63 @@
#include "common.h"
#include "iomap.h"
+#ifdef USB_EHCI_TEGRA
+static struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = {
+ .reset_gpio = -1,
+ .clk = "cdev2",
+};
+
+static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
+ {
+ .operating_mode = TEGRA_USB_OTG,
+ .power_down_on_bus_suspend = 1,
+ .vbus_gpio = -1,
+ },
+ {
+ .operating_mode = TEGRA_USB_HOST,
+ .power_down_on_bus_suspend = 1,
+ .vbus_gpio = -1,
+ .phy_config = &tegra_ehci2_ulpi_phy_config,
+ },
+ {
+ .operating_mode = TEGRA_USB_HOST,
+ .power_down_on_bus_suspend = 1,
+ .vbus_gpio = -1,
+ },
+};
+
static struct of_dev_auxdata tegra_auxdata_lookup[] __initdata = {
- {},
+ OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xc5000000, "tegra-ehci.0", &tegra_ehci_pdata[0]),
+ OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xc5004000, "tegra-ehci.1", &tegra_ehci_pdata[1]),
+ OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xC5008000, "tegra-ehci.2", &tegra_ehci_pdata[2]),
+ {}
};
+#else
+#define tegra_auxdata_lookup NULL
+#endif
+
+#if defined(CONFIG_TEGRA_PCI) && defined(CONFIG_ARCH_TEGRA_2x_SOC)
+static void __init trimslice_init(void)
+{
+ int err;
+
+ err = tegra_pcie_init(true, true);
+ if (err)
+ pr_err("%s failed: %d\n", __func__, err);
+}
+static void __init harmony_init(void)
+{
+ harmony_pcie_init();
+}
+static void __init paz00_init(void)
+{
+ tegra_paz00_wifikill_init();
+}
+#else
+#define trimslice_init NULL
+#define harmony_init NULL
+#define paz00_init NULL
+#endif
static void __init tegra_dt_init(void)
{
@@ -40,6 +96,38 @@ static void __init tegra_dt_init(void)
tegra_auxdata_lookup, NULL);
}
+static void __init tegra_dt_init_late(void)
+{
+ int i;
+ struct {
+ const char *name;
+ void (*init)(void);
+ } board[] = {
+ {
+ .name = "compulab,trimslice",
+ .init = trimslice_init,
+ },
+ {
+ .name = "nvidia,harmony",
+ .init = harmony_init,
+ },
+ {
+ .name = "compal,paz00",
+ .init = paz00_init
+ },
+ };
+
+ tegra_init_late();
+
+ for (i = 0; i < ARRAY_SIZE(board); i++) {
+ if (of_machine_is_compatible(board[i].name)) {
+ if (board[i].init)
+ board[i].init();
+ break;
+ }
+ }
+}
+
static const char * const tegra_dt_board_compat[] = {
"nvidia,tegra20",
"nvidia,tegra30",
@@ -54,7 +142,7 @@ DT_MACHINE_START(TEGRA_DT, "NVIDIA Tegra SoC (Flattened Device Tree)")
.init_irq = tegra_dt_init_irq,
.init_time = clocksource_of_init,
.init_machine = tegra_dt_init,
- .init_late = tegra_init_late,
+ .init_late = tegra_dt_init_late,
.restart = tegra_assert_system_reset,
.dt_compat = tegra_dt_board_compat,
MACHINE_END
--
1.7.9.5
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 4/4] ARM: tegra: Restore USB/PCIE info in new DT board file
@ 2013-02-08 7:29 ` Hiroshi Doyu
0 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-08 7:29 UTC (permalink / raw)
To: linux-arm-kernel
Mainly for the compatibility for the existing driver.
This would be removed once new USB/PCIE DT supports come.
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
arch/arm/mach-tegra/tegra.c | 92 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 90 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c
index 62ae39a..82fea64 100644
--- a/arch/arm/mach-tegra/tegra.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -23,6 +23,8 @@
#include <linux/of_fdt.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
+#include <linux/platform_data/tegra_usb.h>
+#include <linux/usb/tegra_usb_phy.h>
#include <asm/mach/arch.h>
@@ -30,9 +32,63 @@
#include "common.h"
#include "iomap.h"
+#ifdef USB_EHCI_TEGRA
+static struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = {
+ .reset_gpio = -1,
+ .clk = "cdev2",
+};
+
+static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
+ {
+ .operating_mode = TEGRA_USB_OTG,
+ .power_down_on_bus_suspend = 1,
+ .vbus_gpio = -1,
+ },
+ {
+ .operating_mode = TEGRA_USB_HOST,
+ .power_down_on_bus_suspend = 1,
+ .vbus_gpio = -1,
+ .phy_config = &tegra_ehci2_ulpi_phy_config,
+ },
+ {
+ .operating_mode = TEGRA_USB_HOST,
+ .power_down_on_bus_suspend = 1,
+ .vbus_gpio = -1,
+ },
+};
+
static struct of_dev_auxdata tegra_auxdata_lookup[] __initdata = {
- {},
+ OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xc5000000, "tegra-ehci.0", &tegra_ehci_pdata[0]),
+ OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xc5004000, "tegra-ehci.1", &tegra_ehci_pdata[1]),
+ OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xC5008000, "tegra-ehci.2", &tegra_ehci_pdata[2]),
+ {}
};
+#else
+#define tegra_auxdata_lookup NULL
+#endif
+
+#if defined(CONFIG_TEGRA_PCI) && defined(CONFIG_ARCH_TEGRA_2x_SOC)
+static void __init trimslice_init(void)
+{
+ int err;
+
+ err = tegra_pcie_init(true, true);
+ if (err)
+ pr_err("%s failed: %d\n", __func__, err);
+}
+static void __init harmony_init(void)
+{
+ harmony_pcie_init();
+}
+static void __init paz00_init(void)
+{
+ tegra_paz00_wifikill_init();
+}
+#else
+#define trimslice_init NULL
+#define harmony_init NULL
+#define paz00_init NULL
+#endif
static void __init tegra_dt_init(void)
{
@@ -40,6 +96,38 @@ static void __init tegra_dt_init(void)
tegra_auxdata_lookup, NULL);
}
+static void __init tegra_dt_init_late(void)
+{
+ int i;
+ struct {
+ const char *name;
+ void (*init)(void);
+ } board[] = {
+ {
+ .name = "compulab,trimslice",
+ .init = trimslice_init,
+ },
+ {
+ .name = "nvidia,harmony",
+ .init = harmony_init,
+ },
+ {
+ .name = "compal,paz00",
+ .init = paz00_init
+ },
+ };
+
+ tegra_init_late();
+
+ for (i = 0; i < ARRAY_SIZE(board); i++) {
+ if (of_machine_is_compatible(board[i].name)) {
+ if (board[i].init)
+ board[i].init();
+ break;
+ }
+ }
+}
+
static const char * const tegra_dt_board_compat[] = {
"nvidia,tegra20",
"nvidia,tegra30",
@@ -54,7 +142,7 @@ DT_MACHINE_START(TEGRA_DT, "NVIDIA Tegra SoC (Flattened Device Tree)")
.init_irq = tegra_dt_init_irq,
.init_time = clocksource_of_init,
.init_machine = tegra_dt_init,
- .init_late = tegra_init_late,
+ .init_late = tegra_dt_init_late,
.restart = tegra_assert_system_reset,
.dt_compat = tegra_dt_board_compat,
MACHINE_END
--
1.7.9.5
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 4/4] ARM: tegra: Restore USB/PCIE info in new DT board file
@ 2013-02-08 7:29 ` Hiroshi Doyu
0 siblings, 0 replies; 43+ messages in thread
From: Hiroshi Doyu @ 2013-02-08 7:29 UTC (permalink / raw)
To: linux-tegra
Cc: arnd, Hiroshi Doyu, Stephen Warren, Russell King,
linux-arm-kernel, linux-kernel
Mainly for the compatibility for the existing driver.
This would be removed once new USB/PCIE DT supports come.
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
arch/arm/mach-tegra/tegra.c | 92 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 90 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c
index 62ae39a..82fea64 100644
--- a/arch/arm/mach-tegra/tegra.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -23,6 +23,8 @@
#include <linux/of_fdt.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
+#include <linux/platform_data/tegra_usb.h>
+#include <linux/usb/tegra_usb_phy.h>
#include <asm/mach/arch.h>
@@ -30,9 +32,63 @@
#include "common.h"
#include "iomap.h"
+#ifdef USB_EHCI_TEGRA
+static struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = {
+ .reset_gpio = -1,
+ .clk = "cdev2",
+};
+
+static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
+ {
+ .operating_mode = TEGRA_USB_OTG,
+ .power_down_on_bus_suspend = 1,
+ .vbus_gpio = -1,
+ },
+ {
+ .operating_mode = TEGRA_USB_HOST,
+ .power_down_on_bus_suspend = 1,
+ .vbus_gpio = -1,
+ .phy_config = &tegra_ehci2_ulpi_phy_config,
+ },
+ {
+ .operating_mode = TEGRA_USB_HOST,
+ .power_down_on_bus_suspend = 1,
+ .vbus_gpio = -1,
+ },
+};
+
static struct of_dev_auxdata tegra_auxdata_lookup[] __initdata = {
- {},
+ OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xc5000000, "tegra-ehci.0", &tegra_ehci_pdata[0]),
+ OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xc5004000, "tegra-ehci.1", &tegra_ehci_pdata[1]),
+ OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xC5008000, "tegra-ehci.2", &tegra_ehci_pdata[2]),
+ {}
};
+#else
+#define tegra_auxdata_lookup NULL
+#endif
+
+#if defined(CONFIG_TEGRA_PCI) && defined(CONFIG_ARCH_TEGRA_2x_SOC)
+static void __init trimslice_init(void)
+{
+ int err;
+
+ err = tegra_pcie_init(true, true);
+ if (err)
+ pr_err("%s failed: %d\n", __func__, err);
+}
+static void __init harmony_init(void)
+{
+ harmony_pcie_init();
+}
+static void __init paz00_init(void)
+{
+ tegra_paz00_wifikill_init();
+}
+#else
+#define trimslice_init NULL
+#define harmony_init NULL
+#define paz00_init NULL
+#endif
static void __init tegra_dt_init(void)
{
@@ -40,6 +96,38 @@ static void __init tegra_dt_init(void)
tegra_auxdata_lookup, NULL);
}
+static void __init tegra_dt_init_late(void)
+{
+ int i;
+ struct {
+ const char *name;
+ void (*init)(void);
+ } board[] = {
+ {
+ .name = "compulab,trimslice",
+ .init = trimslice_init,
+ },
+ {
+ .name = "nvidia,harmony",
+ .init = harmony_init,
+ },
+ {
+ .name = "compal,paz00",
+ .init = paz00_init
+ },
+ };
+
+ tegra_init_late();
+
+ for (i = 0; i < ARRAY_SIZE(board); i++) {
+ if (of_machine_is_compatible(board[i].name)) {
+ if (board[i].init)
+ board[i].init();
+ break;
+ }
+ }
+}
+
static const char * const tegra_dt_board_compat[] = {
"nvidia,tegra20",
"nvidia,tegra30",
@@ -54,7 +142,7 @@ DT_MACHINE_START(TEGRA_DT, "NVIDIA Tegra SoC (Flattened Device Tree)")
.init_irq = tegra_dt_init_irq,
.init_time = clocksource_of_init,
.init_machine = tegra_dt_init,
- .init_late = tegra_init_late,
+ .init_late = tegra_dt_init_late,
.restart = tegra_assert_system_reset,
.dt_compat = tegra_dt_board_compat,
MACHINE_END
--
1.7.9.5
^ permalink raw reply related [flat|nested] 43+ messages in thread
[parent not found: <1360308574-19658-5-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH 4/4] ARM: tegra: Restore USB/PCIE info in new DT board file
2013-02-08 7:29 ` Hiroshi Doyu
(?)
@ 2013-02-08 17:58 ` Stephen Warren
-1 siblings, 0 replies; 43+ messages in thread
From: Stephen Warren @ 2013-02-08 17:58 UTC (permalink / raw)
To: Hiroshi Doyu
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, arnd-r2nGTMty4D4,
Russell King, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
On 02/08/2013 12:29 AM, Hiroshi Doyu wrote:
> Mainly for the compatibility for the existing driver.
> This would be removed once new USB/PCIE DT supports come.
This series makes Tegra20 broken between commit 3/4 and 4/4. Why not do
the following instead:
1) Patch 1/4 as-is.
2) Rename board-dt-tegra20.c to tegra.c with no code changes to it.
3) Add Tegra30/114 compatible values into tegra.c, and delete the old
Tegra30/114-specific board files.
Fewer patches, and each patch builds and runs on all systems without any
issue.
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 4/4] ARM: tegra: Restore USB/PCIE info in new DT board file
@ 2013-02-08 17:58 ` Stephen Warren
0 siblings, 0 replies; 43+ messages in thread
From: Stephen Warren @ 2013-02-08 17:58 UTC (permalink / raw)
To: linux-arm-kernel
On 02/08/2013 12:29 AM, Hiroshi Doyu wrote:
> Mainly for the compatibility for the existing driver.
> This would be removed once new USB/PCIE DT supports come.
This series makes Tegra20 broken between commit 3/4 and 4/4. Why not do
the following instead:
1) Patch 1/4 as-is.
2) Rename board-dt-tegra20.c to tegra.c with no code changes to it.
3) Add Tegra30/114 compatible values into tegra.c, and delete the old
Tegra30/114-specific board files.
Fewer patches, and each patch builds and runs on all systems without any
issue.
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 4/4] ARM: tegra: Restore USB/PCIE info in new DT board file
@ 2013-02-08 17:58 ` Stephen Warren
0 siblings, 0 replies; 43+ messages in thread
From: Stephen Warren @ 2013-02-08 17:58 UTC (permalink / raw)
To: Hiroshi Doyu
Cc: linux-tegra, arnd, Russell King, linux-arm-kernel, linux-kernel
On 02/08/2013 12:29 AM, Hiroshi Doyu wrote:
> Mainly for the compatibility for the existing driver.
> This would be removed once new USB/PCIE DT supports come.
This series makes Tegra20 broken between commit 3/4 and 4/4. Why not do
the following instead:
1) Patch 1/4 as-is.
2) Rename board-dt-tegra20.c to tegra.c with no code changes to it.
3) Add Tegra30/114 compatible values into tegra.c, and delete the old
Tegra30/114-specific board files.
Fewer patches, and each patch builds and runs on all systems without any
issue.
^ permalink raw reply [flat|nested] 43+ messages in thread