diff options
author | Vineet Gupta <Vineet.Gupta1@synopsys.com> | 2014-06-24 04:25:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-10 18:45:30 -0400 |
commit | 1b9bff759b03f79173035236ea6f5ff44d9aa866 (patch) | |
tree | aeec8246817f07c36a5946558f8e009c7f1c1dbf /arch/arc/plat-arcfpga | |
parent | 8dbe1d5e09a7faec8d22cadcc1011acab8fa6e2a (diff) |
ARC: [arcfpga] RIP early uart platform device stuff
With ARC uart driver switching to generic earlycon, we no longer need
this ugliness. You won't be missed.
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/arc/plat-arcfpga')
-rw-r--r-- | arch/arc/plat-arcfpga/Kconfig | 7 | ||||
-rw-r--r-- | arch/arc/plat-arcfpga/platform.c | 97 |
2 files changed, 2 insertions, 102 deletions
diff --git a/arch/arc/plat-arcfpga/Kconfig b/arch/arc/plat-arcfpga/Kconfig index e27bb5cc3c1e..b9f34cf55acf 100644 --- a/arch/arc/plat-arcfpga/Kconfig +++ b/arch/arc/plat-arcfpga/Kconfig | |||
@@ -41,11 +41,4 @@ config ISS_SMP_EXTN | |||
41 | -XTL (To enable CPU start/stop/set-PC for another CPU) | 41 | -XTL (To enable CPU start/stop/set-PC for another CPU) |
42 | It doesn't provide coherent Caches and/or Atomic Ops (LLOCK/SCOND) | 42 | It doesn't provide coherent Caches and/or Atomic Ops (LLOCK/SCOND) |
43 | 43 | ||
44 | config ARC_SERIAL_BAUD | ||
45 | int "UART Baud rate" | ||
46 | default "115200" | ||
47 | depends on SERIAL_ARC || SERIAL_ARC_CONSOLE | ||
48 | help | ||
49 | Baud rate for the ARC UART | ||
50 | |||
51 | endif | 44 | endif |
diff --git a/arch/arc/plat-arcfpga/platform.c b/arch/arc/plat-arcfpga/platform.c index 61c7e5997387..b8d0d456627f 100644 --- a/arch/arc/plat-arcfpga/platform.c +++ b/arch/arc/plat-arcfpga/platform.c | |||
@@ -22,115 +22,22 @@ | |||
22 | #include <plat/smp.h> | 22 | #include <plat/smp.h> |
23 | #include <plat/irq.h> | 23 | #include <plat/irq.h> |
24 | 24 | ||
25 | /*----------------------- Platform Devices -----------------------------*/ | ||
26 | |||
27 | #if IS_ENABLED(CONFIG_SERIAL_ARC) | ||
28 | static unsigned long arc_uart_info[] = { | ||
29 | 0, /* uart->is_emulated (runtime @running_on_hw) */ | ||
30 | 0, /* uart->port.uartclk */ | ||
31 | 0, /* uart->baud */ | ||
32 | 0 | ||
33 | }; | ||
34 | |||
35 | #if defined(CONFIG_SERIAL_ARC_CONSOLE) | ||
36 | /* | ||
37 | * static platform data - but only for early serial | ||
38 | * TBD: derive this from a special DT node | ||
39 | */ | ||
40 | static struct resource arc_uart0_res[] = { | ||
41 | { | ||
42 | .start = UART0_BASE, | ||
43 | .end = UART0_BASE + 0xFF, | ||
44 | .flags = IORESOURCE_MEM, | ||
45 | }, | ||
46 | { | ||
47 | .start = UART0_IRQ, | ||
48 | .end = UART0_IRQ, | ||
49 | .flags = IORESOURCE_IRQ, | ||
50 | }, | ||
51 | }; | ||
52 | |||
53 | static struct platform_device arc_uart0_dev = { | ||
54 | .name = "arc-uart", | ||
55 | .id = 0, | ||
56 | .num_resources = ARRAY_SIZE(arc_uart0_res), | ||
57 | .resource = arc_uart0_res, | ||
58 | .dev = { | ||
59 | .platform_data = &arc_uart_info, | ||
60 | }, | ||
61 | }; | ||
62 | |||
63 | static struct platform_device *fpga_early_devs[] __initdata = { | ||
64 | &arc_uart0_dev, | ||
65 | }; | ||
66 | #endif /* CONFIG_SERIAL_ARC_CONSOLE */ | ||
67 | |||
68 | static void arc_fpga_serial_init(void) | ||
69 | { | ||
70 | /* To let driver workaround ISS bug: baudh Reg can't be set to 0 */ | ||
71 | arc_uart_info[0] = !running_on_hw; | ||
72 | |||
73 | arc_uart_info[1] = arc_get_core_freq(); | ||
74 | |||
75 | arc_uart_info[2] = CONFIG_ARC_SERIAL_BAUD; | ||
76 | |||
77 | #if defined(CONFIG_SERIAL_ARC_CONSOLE) | ||
78 | early_platform_add_devices(fpga_early_devs, | ||
79 | ARRAY_SIZE(fpga_early_devs)); | ||
80 | |||
81 | /* | ||
82 | * ARC console driver registers (build time) as an early platform driver | ||
83 | * of class "earlyprintk". However it needs explicit cmdline toggle | ||
84 | * "earlyprintk=ttyARC0" to be successfuly runtime registered. | ||
85 | * Otherwise the early probe below fails to find the driver | ||
86 | */ | ||
87 | early_platform_driver_probe("earlyprintk", 1, 0); | ||
88 | |||
89 | /* | ||
90 | * This is to make sure that arc uart would be preferred console | ||
91 | * despite one/more of following: | ||
92 | * -command line lacked "console=ttyARC0" or | ||
93 | * -CONFIG_VT_CONSOLE was enabled (for no reason whatsoever) | ||
94 | * Note that this needs to be done after above early console is reg, | ||
95 | * otherwise the early console never gets a chance to run. | ||
96 | */ | ||
97 | add_preferred_console("ttyARC", 0, "115200"); | ||
98 | #endif /* CONFIG_SERIAL_ARC_CONSOLE */ | ||
99 | } | ||
100 | #else /* !IS_ENABLED(CONFIG_SERIAL_ARC) */ | ||
101 | static void arc_fpga_serial_init(void) | ||
102 | { | ||
103 | } | ||
104 | #endif | ||
105 | |||
106 | static void __init plat_fpga_early_init(void) | 25 | static void __init plat_fpga_early_init(void) |
107 | { | 26 | { |
108 | pr_info("[plat-arcfpga]: registering early dev resources\n"); | 27 | pr_info("[plat-arcfpga]: registering early dev resources\n"); |
109 | 28 | ||
110 | arc_fpga_serial_init(); | ||
111 | |||
112 | #ifdef CONFIG_ISS_SMP_EXTN | 29 | #ifdef CONFIG_ISS_SMP_EXTN |
113 | iss_model_init_early_smp(); | 30 | iss_model_init_early_smp(); |
114 | #endif | 31 | #endif |
115 | } | 32 | } |
116 | 33 | ||
117 | static struct of_dev_auxdata plat_auxdata_lookup[] __initdata = { | ||
118 | #if IS_ENABLED(CONFIG_SERIAL_ARC) | ||
119 | OF_DEV_AUXDATA("snps,arc-uart", UART0_BASE, "arc-uart", arc_uart_info), | ||
120 | #endif | ||
121 | {} | ||
122 | }; | ||
123 | |||
124 | static void __init plat_fpga_populate_dev(void) | 34 | static void __init plat_fpga_populate_dev(void) |
125 | { | 35 | { |
126 | pr_info("[plat-arcfpga]: registering device resources\n"); | ||
127 | |||
128 | /* | 36 | /* |
129 | * Traverses flattened DeviceTree - registering platform devices | 37 | * Traverses flattened DeviceTree - registering platform devices |
130 | * complete with their resources | 38 | * (if any) complete with their resources |
131 | */ | 39 | */ |
132 | of_platform_populate(NULL, of_default_bus_match_table, | 40 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
133 | plat_auxdata_lookup, NULL); | ||
134 | } | 41 | } |
135 | 42 | ||
136 | /*----------------------- Machine Descriptions ------------------------------ | 43 | /*----------------------- Machine Descriptions ------------------------------ |