aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arc')
-rw-r--r--arch/arc/boot/dts/angel4.dts2
-rw-r--r--arch/arc/include/asm/processor.h2
-rw-r--r--arch/arc/kernel/perf_event.c7
-rw-r--r--arch/arc/plat-arcfpga/Kconfig7
-rw-r--r--arch/arc/plat-arcfpga/platform.c97
5 files changed, 8 insertions, 107 deletions
diff --git a/arch/arc/boot/dts/angel4.dts b/arch/arc/boot/dts/angel4.dts
index 5bb2fdaca02f..6b57475967a6 100644
--- a/arch/arc/boot/dts/angel4.dts
+++ b/arch/arc/boot/dts/angel4.dts
@@ -17,7 +17,7 @@
17 interrupt-parent = <&intc>; 17 interrupt-parent = <&intc>;
18 18
19 chosen { 19 chosen {
20 bootargs = "console=ttyARC0,115200n8 earlyprintk=ttyARC0"; 20 bootargs = "earlycon=arc_uart,mmio32,0xc0fc1000,115200n8 console=ttyARC0,115200n8";
21 }; 21 };
22 22
23 aliases { 23 aliases {
diff --git a/arch/arc/include/asm/processor.h b/arch/arc/include/asm/processor.h
index d99f9b37cd15..82588f3ba77f 100644
--- a/arch/arc/include/asm/processor.h
+++ b/arch/arc/include/asm/processor.h
@@ -62,6 +62,8 @@ unsigned long thread_saved_pc(struct task_struct *t);
62#define cpu_relax() do { } while (0) 62#define cpu_relax() do { } while (0)
63#endif 63#endif
64 64
65#define cpu_relax_lowlatency() cpu_relax()
66
65#define copy_segments(tsk, mm) do { } while (0) 67#define copy_segments(tsk, mm) do { } while (0)
66#define release_segments(mm) do { } while (0) 68#define release_segments(mm) do { } while (0)
67 69
diff --git a/arch/arc/kernel/perf_event.c b/arch/arc/kernel/perf_event.c
index 63177e4cb66d..b9a5685a990e 100644
--- a/arch/arc/kernel/perf_event.c
+++ b/arch/arc/kernel/perf_event.c
@@ -99,10 +99,6 @@ static int arc_pmu_event_init(struct perf_event *event)
99 struct hw_perf_event *hwc = &event->hw; 99 struct hw_perf_event *hwc = &event->hw;
100 int ret; 100 int ret;
101 101
102 /* ARC 700 PMU does not support sampling events */
103 if (is_sampling_event(event))
104 return -ENOENT;
105
106 switch (event->attr.type) { 102 switch (event->attr.type) {
107 case PERF_TYPE_HARDWARE: 103 case PERF_TYPE_HARDWARE:
108 if (event->attr.config >= PERF_COUNT_HW_MAX) 104 if (event->attr.config >= PERF_COUNT_HW_MAX)
@@ -298,6 +294,9 @@ static int arc_pmu_device_probe(struct platform_device *pdev)
298 .read = arc_pmu_read, 294 .read = arc_pmu_read,
299 }; 295 };
300 296
297 /* ARC 700 PMU does not support sampling events */
298 arc_pmu->pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT;
299
301 ret = perf_pmu_register(&arc_pmu->pmu, pdev->name, PERF_TYPE_RAW); 300 ret = perf_pmu_register(&arc_pmu->pmu, pdev->name, PERF_TYPE_RAW);
302 301
303 return ret; 302 return ret;
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
44config 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
51endif 44endif
diff --git a/arch/arc/plat-arcfpga/platform.c b/arch/arc/plat-arcfpga/platform.c
index 8c643c2967df..1038949a99a1 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)
28static 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 */
40static 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
53static 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
63static struct platform_device *fpga_early_devs[] __initdata = {
64 &arc_uart0_dev,
65};
66#endif /* CONFIG_SERIAL_ARC_CONSOLE */
67
68static 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) */
101static void arc_fpga_serial_init(void)
102{
103}
104#endif
105
106static void __init plat_fpga_early_init(void) 25static 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
117static 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
124static void __init plat_fpga_populate_dev(void) 34static 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 ------------------------------