aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2014-09-10 01:40:54 -0400
committerVineet Gupta <vgupta@synopsys.com>2014-10-13 05:16:13 -0400
commitd7f8a085d4f48501b1fa253b48ec4ad7cb4d02cc (patch)
tree7c266b918c768bb632ef5a73d7d1bd5df20b8d70 /arch/arc
parent70e956483efd8a70e86fb2260dcd2395eb1affef (diff)
ARC: [plat*] move code out of .init_machine into common
All the platforms do the same thing in init_machine callback so move it out of callback into caller of callback Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc')
-rw-r--r--arch/arc/Kconfig1
-rw-r--r--arch/arc/kernel/setup.c10
-rw-r--r--arch/arc/plat-arcfpga/platform.c12
-rw-r--r--arch/arc/plat-tb10x/Kconfig1
-rw-r--r--arch/arc/plat-tb10x/tb10x.c13
5 files changed, 10 insertions, 27 deletions
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 9596b0ab108d..bf1e410ee448 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -9,6 +9,7 @@
9config ARC 9config ARC
10 def_bool y 10 def_bool y
11 select BUILDTIME_EXTABLE_SORT 11 select BUILDTIME_EXTABLE_SORT
12 select COMMON_CLK
12 select CLONE_BACKWARDS 13 select CLONE_BACKWARDS
13 # ARC Busybox based initramfs absolutely relies on DEVTMPFS for /dev 14 # ARC Busybox based initramfs absolutely relies on DEVTMPFS for /dev
14 select DEVTMPFS if !INITRAMFS_SOURCE="" 15 select DEVTMPFS if !INITRAMFS_SOURCE=""
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index da61f2205dc5..686e3fae4420 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -13,7 +13,9 @@
13#include <linux/console.h> 13#include <linux/console.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/cpu.h> 15#include <linux/cpu.h>
16#include <linux/clk-provider.h>
16#include <linux/of_fdt.h> 17#include <linux/of_fdt.h>
18#include <linux/of_platform.h>
17#include <linux/cache.h> 19#include <linux/cache.h>
18#include <asm/sections.h> 20#include <asm/sections.h>
19#include <asm/arcregs.h> 21#include <asm/arcregs.h>
@@ -379,7 +381,13 @@ void __init setup_arch(char **cmdline_p)
379 381
380static int __init customize_machine(void) 382static int __init customize_machine(void)
381{ 383{
382 /* Add platform devices */ 384 of_clk_init(NULL);
385 /*
386 * Traverses flattened DeviceTree - registering platform devices
387 * (if any) complete with their resources
388 */
389 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
390
383 if (machine_desc->init_machine) 391 if (machine_desc->init_machine)
384 machine_desc->init_machine(); 392 machine_desc->init_machine();
385 393
diff --git a/arch/arc/plat-arcfpga/platform.c b/arch/arc/plat-arcfpga/platform.c
index 57bd24f6a4bd..b23d5fc59a48 100644
--- a/arch/arc/plat-arcfpga/platform.c
+++ b/arch/arc/plat-arcfpga/platform.c
@@ -14,7 +14,6 @@
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/console.h> 16#include <linux/console.h>
17#include <linux/of_platform.h>
18#include <asm/setup.h> 17#include <asm/setup.h>
19#include <asm/clk.h> 18#include <asm/clk.h>
20#include <asm/mach_desc.h> 19#include <asm/mach_desc.h>
@@ -31,15 +30,6 @@ static void __init plat_fpga_early_init(void)
31#endif 30#endif
32} 31}
33 32
34static void __init plat_fpga_populate_dev(void)
35{
36 /*
37 * Traverses flattened DeviceTree - registering platform devices
38 * (if any) complete with their resources
39 */
40 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
41}
42
43/*----------------------- Machine Descriptions ------------------------------ 33/*----------------------- Machine Descriptions ------------------------------
44 * 34 *
45 * Machine description is simply a set of platform/board specific callbacks 35 * Machine description is simply a set of platform/board specific callbacks
@@ -57,7 +47,6 @@ static const char *legacy_fpga_compat[] __initconst = {
57MACHINE_START(LEGACY_FPGA, "legacy_fpga") 47MACHINE_START(LEGACY_FPGA, "legacy_fpga")
58 .dt_compat = legacy_fpga_compat, 48 .dt_compat = legacy_fpga_compat,
59 .init_early = plat_fpga_early_init, 49 .init_early = plat_fpga_early_init,
60 .init_machine = plat_fpga_populate_dev,
61#ifdef CONFIG_ISS_SMP_EXTN 50#ifdef CONFIG_ISS_SMP_EXTN
62 .init_smp = iss_model_init_smp, 51 .init_smp = iss_model_init_smp,
63#endif 52#endif
@@ -71,5 +60,4 @@ static const char *simulation_compat[] __initconst = {
71 60
72MACHINE_START(SIMULATION, "simulation") 61MACHINE_START(SIMULATION, "simulation")
73 .dt_compat = simulation_compat, 62 .dt_compat = simulation_compat,
74 .init_machine = plat_fpga_populate_dev,
75MACHINE_END 63MACHINE_END
diff --git a/arch/arc/plat-tb10x/Kconfig b/arch/arc/plat-tb10x/Kconfig
index 6994c188dc88..d14b3d3c5dfd 100644
--- a/arch/arc/plat-tb10x/Kconfig
+++ b/arch/arc/plat-tb10x/Kconfig
@@ -18,7 +18,6 @@
18 18
19menuconfig ARC_PLAT_TB10X 19menuconfig ARC_PLAT_TB10X
20 bool "Abilis TB10x" 20 bool "Abilis TB10x"
21 select COMMON_CLK
22 select PINCTRL 21 select PINCTRL
23 select PINCTRL_TB10X 22 select PINCTRL_TB10X
24 select PINMUX 23 select PINMUX
diff --git a/arch/arc/plat-tb10x/tb10x.c b/arch/arc/plat-tb10x/tb10x.c
index 06cb30929460..da0ac0960a4b 100644
--- a/arch/arc/plat-tb10x/tb10x.c
+++ b/arch/arc/plat-tb10x/tb10x.c
@@ -19,21 +19,9 @@
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21 21
22
23#include <linux/init.h> 22#include <linux/init.h>
24#include <linux/of_platform.h>
25#include <linux/clk-provider.h>
26#include <linux/pinctrl/consumer.h>
27
28#include <asm/mach_desc.h> 23#include <asm/mach_desc.h>
29 24
30
31static void __init tb10x_platform_init(void)
32{
33 of_clk_init(NULL);
34 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
35}
36
37static const char *tb10x_compat[] __initdata = { 25static const char *tb10x_compat[] __initdata = {
38 "abilis,arc-tb10x", 26 "abilis,arc-tb10x",
39 NULL, 27 NULL,
@@ -41,5 +29,4 @@ static const char *tb10x_compat[] __initdata = {
41 29
42MACHINE_START(TB10x, "tb10x") 30MACHINE_START(TB10x, "tb10x")
43 .dt_compat = tb10x_compat, 31 .dt_compat = tb10x_compat,
44 .init_machine = tb10x_platform_init,
45MACHINE_END 32MACHINE_END