aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-03-15 14:20:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-15 14:20:44 -0400
commit8ab84ef699e5495d37ace5801c5cb788cafcf9da (patch)
tree4a906353c5fff8c26e66fa6f9991c3b73fe70a93
parent13c76ad87216513db2487aac84155aa57dfd46ce (diff)
parentc637fa5294cefeda8be73cce20ba6693d22262dc (diff)
Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 core platform updates from Ingo Molnar: "Intel Quark and Geode SoC platform updates" * 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/platform/intel/quark: Drop IMR lock bit support x86/platform/intel/mid: Remove dead code x86/platform: Make platform/geode/net5501.c explicitly non-modular x86/platform: Make platform/geode/alix.c explicitly non-modular x86/platform: Make platform/geode/geos.c explicitly non-modular x86/platform: Make platform/intel-quark/imr_selftest.c explicitly non-modular x86/platform: Make platform/intel-quark/imr.c explicitly non-modular
-rw-r--r--arch/x86/include/asm/imr.h2
-rw-r--r--arch/x86/platform/geode/alix.c14
-rw-r--r--arch/x86/platform/geode/geos.c8
-rw-r--r--arch/x86/platform/geode/net5501.c8
-rw-r--r--arch/x86/platform/intel-mid/mfld.c5
-rw-r--r--arch/x86/platform/intel-mid/mrfl.c5
-rw-r--r--arch/x86/platform/intel-quark/imr.c59
-rw-r--r--arch/x86/platform/intel-quark/imr_selftest.c30
8 files changed, 29 insertions, 102 deletions
diff --git a/arch/x86/include/asm/imr.h b/arch/x86/include/asm/imr.h
index cd2ce4068441..ebea2c9d2cdc 100644
--- a/arch/x86/include/asm/imr.h
+++ b/arch/x86/include/asm/imr.h
@@ -53,7 +53,7 @@
53#define IMR_MASK (IMR_ALIGN - 1) 53#define IMR_MASK (IMR_ALIGN - 1)
54 54
55int imr_add_range(phys_addr_t base, size_t size, 55int imr_add_range(phys_addr_t base, size_t size,
56 unsigned int rmask, unsigned int wmask, bool lock); 56 unsigned int rmask, unsigned int wmask);
57 57
58int imr_remove_range(phys_addr_t base, size_t size); 58int imr_remove_range(phys_addr_t base, size_t size);
59 59
diff --git a/arch/x86/platform/geode/alix.c b/arch/x86/platform/geode/alix.c
index 76b6632d3143..1865c196f136 100644
--- a/arch/x86/platform/geode/alix.c
+++ b/arch/x86/platform/geode/alix.c
@@ -21,7 +21,7 @@
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/string.h> 23#include <linux/string.h>
24#include <linux/module.h> 24#include <linux/moduleparam.h>
25#include <linux/leds.h> 25#include <linux/leds.h>
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27#include <linux/gpio.h> 27#include <linux/gpio.h>
@@ -35,6 +35,11 @@
35#define BIOS_SIGNATURE_COREBOOT 0x500 35#define BIOS_SIGNATURE_COREBOOT 0x500
36#define BIOS_REGION_SIZE 0x10000 36#define BIOS_REGION_SIZE 0x10000
37 37
38/*
39 * This driver is not modular, but to keep back compatibility
40 * with existing use cases, continuing with module_param is
41 * the easiest way forward.
42 */
38static bool force = 0; 43static bool force = 0;
39module_param(force, bool, 0444); 44module_param(force, bool, 0444);
40/* FIXME: Award bios is not automatically detected as Alix platform */ 45/* FIXME: Award bios is not automatically detected as Alix platform */
@@ -192,9 +197,4 @@ static int __init alix_init(void)
192 197
193 return 0; 198 return 0;
194} 199}
195 200device_initcall(alix_init);
196module_init(alix_init);
197
198MODULE_AUTHOR("Ed Wildgoose <kernel@wildgooses.com>");
199MODULE_DESCRIPTION("PCEngines ALIX System Setup");
200MODULE_LICENSE("GPL");
diff --git a/arch/x86/platform/geode/geos.c b/arch/x86/platform/geode/geos.c
index aa733fba2471..4fcdb91318a0 100644
--- a/arch/x86/platform/geode/geos.c
+++ b/arch/x86/platform/geode/geos.c
@@ -19,7 +19,6 @@
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/string.h> 21#include <linux/string.h>
22#include <linux/module.h>
23#include <linux/leds.h> 22#include <linux/leds.h>
24#include <linux/platform_device.h> 23#include <linux/platform_device.h>
25#include <linux/gpio.h> 24#include <linux/gpio.h>
@@ -120,9 +119,4 @@ static int __init geos_init(void)
120 119
121 return 0; 120 return 0;
122} 121}
123 122device_initcall(geos_init);
124module_init(geos_init);
125
126MODULE_AUTHOR("Philip Prindeville <philipp@redfish-solutions.com>");
127MODULE_DESCRIPTION("Traverse Technologies Geos System Setup");
128MODULE_LICENSE("GPL");
diff --git a/arch/x86/platform/geode/net5501.c b/arch/x86/platform/geode/net5501.c
index 927e38c0089f..a2f6b982a729 100644
--- a/arch/x86/platform/geode/net5501.c
+++ b/arch/x86/platform/geode/net5501.c
@@ -20,7 +20,6 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/string.h> 22#include <linux/string.h>
23#include <linux/module.h>
24#include <linux/leds.h> 23#include <linux/leds.h>
25#include <linux/platform_device.h> 24#include <linux/platform_device.h>
26#include <linux/gpio.h> 25#include <linux/gpio.h>
@@ -146,9 +145,4 @@ static int __init net5501_init(void)
146 145
147 return 0; 146 return 0;
148} 147}
149 148device_initcall(net5501_init);
150module_init(net5501_init);
151
152MODULE_AUTHOR("Philip Prindeville <philipp@redfish-solutions.com>");
153MODULE_DESCRIPTION("Soekris net5501 System Setup");
154MODULE_LICENSE("GPL");
diff --git a/arch/x86/platform/intel-mid/mfld.c b/arch/x86/platform/intel-mid/mfld.c
index 23381d2174ae..1eb47b6298c2 100644
--- a/arch/x86/platform/intel-mid/mfld.c
+++ b/arch/x86/platform/intel-mid/mfld.c
@@ -52,10 +52,7 @@ static unsigned long __init mfld_calibrate_tsc(void)
52 /* mark tsc clocksource as reliable */ 52 /* mark tsc clocksource as reliable */
53 set_cpu_cap(&boot_cpu_data, X86_FEATURE_TSC_RELIABLE); 53 set_cpu_cap(&boot_cpu_data, X86_FEATURE_TSC_RELIABLE);
54 54
55 if (fast_calibrate) 55 return fast_calibrate;
56 return fast_calibrate;
57
58 return 0;
59} 56}
60 57
61static void __init penwell_arch_setup(void) 58static void __init penwell_arch_setup(void)
diff --git a/arch/x86/platform/intel-mid/mrfl.c b/arch/x86/platform/intel-mid/mrfl.c
index aaca91753d32..bd1adc621781 100644
--- a/arch/x86/platform/intel-mid/mrfl.c
+++ b/arch/x86/platform/intel-mid/mrfl.c
@@ -81,10 +81,7 @@ static unsigned long __init tangier_calibrate_tsc(void)
81 /* mark tsc clocksource as reliable */ 81 /* mark tsc clocksource as reliable */
82 set_cpu_cap(&boot_cpu_data, X86_FEATURE_TSC_RELIABLE); 82 set_cpu_cap(&boot_cpu_data, X86_FEATURE_TSC_RELIABLE);
83 83
84 if (fast_calibrate) 84 return fast_calibrate;
85 return fast_calibrate;
86
87 return 0;
88} 85}
89 86
90static void __init tangier_arch_setup(void) 87static void __init tangier_arch_setup(void)
diff --git a/arch/x86/platform/intel-quark/imr.c b/arch/x86/platform/intel-quark/imr.c
index bfadcd0f4944..17d6d2296e4d 100644
--- a/arch/x86/platform/intel-quark/imr.c
+++ b/arch/x86/platform/intel-quark/imr.c
@@ -1,5 +1,5 @@
1/** 1/**
2 * imr.c 2 * imr.c -- Intel Isolated Memory Region driver
3 * 3 *
4 * Copyright(c) 2013 Intel Corporation. 4 * Copyright(c) 2013 Intel Corporation.
5 * Copyright(c) 2015 Bryan O'Donoghue <pure.logic@nexus-software.ie> 5 * Copyright(c) 2015 Bryan O'Donoghue <pure.logic@nexus-software.ie>
@@ -31,7 +31,6 @@
31#include <linux/debugfs.h> 31#include <linux/debugfs.h>
32#include <linux/init.h> 32#include <linux/init.h>
33#include <linux/mm.h> 33#include <linux/mm.h>
34#include <linux/module.h>
35#include <linux/types.h> 34#include <linux/types.h>
36 35
37struct imr_device { 36struct imr_device {
@@ -135,11 +134,9 @@ static int imr_read(struct imr_device *idev, u32 imr_id, struct imr_regs *imr)
135 * @idev: pointer to imr_device structure. 134 * @idev: pointer to imr_device structure.
136 * @imr_id: IMR entry to write. 135 * @imr_id: IMR entry to write.
137 * @imr: IMR structure representing address and access masks. 136 * @imr: IMR structure representing address and access masks.
138 * @lock: indicates if the IMR lock bit should be applied.
139 * @return: 0 on success or error code passed from mbi_iosf on failure. 137 * @return: 0 on success or error code passed from mbi_iosf on failure.
140 */ 138 */
141static int imr_write(struct imr_device *idev, u32 imr_id, 139static int imr_write(struct imr_device *idev, u32 imr_id, struct imr_regs *imr)
142 struct imr_regs *imr, bool lock)
143{ 140{
144 unsigned long flags; 141 unsigned long flags;
145 u32 reg = imr_id * IMR_NUM_REGS + idev->reg_base; 142 u32 reg = imr_id * IMR_NUM_REGS + idev->reg_base;
@@ -163,15 +160,6 @@ static int imr_write(struct imr_device *idev, u32 imr_id,
163 if (ret) 160 if (ret)
164 goto failed; 161 goto failed;
165 162
166 /* Lock bit must be set separately to addr_lo address bits. */
167 if (lock) {
168 imr->addr_lo |= IMR_LOCK;
169 ret = iosf_mbi_write(QRK_MBI_UNIT_MM, MBI_REG_WRITE,
170 reg - IMR_NUM_REGS, imr->addr_lo);
171 if (ret)
172 goto failed;
173 }
174
175 local_irq_restore(flags); 163 local_irq_restore(flags);
176 return 0; 164 return 0;
177failed: 165failed:
@@ -270,17 +258,6 @@ static int imr_debugfs_register(struct imr_device *idev)
270} 258}
271 259
272/** 260/**
273 * imr_debugfs_unregister - unregister debugfs hooks.
274 *
275 * @idev: pointer to imr_device structure.
276 * @return:
277 */
278static void imr_debugfs_unregister(struct imr_device *idev)
279{
280 debugfs_remove(idev->file);
281}
282
283/**
284 * imr_check_params - check passed address range IMR alignment and non-zero size 261 * imr_check_params - check passed address range IMR alignment and non-zero size
285 * 262 *
286 * @base: base address of intended IMR. 263 * @base: base address of intended IMR.
@@ -334,11 +311,10 @@ static inline int imr_address_overlap(phys_addr_t addr, struct imr_regs *imr)
334 * @size: physical size of region in bytes must be aligned to 1KiB. 311 * @size: physical size of region in bytes must be aligned to 1KiB.
335 * @read_mask: read access mask. 312 * @read_mask: read access mask.
336 * @write_mask: write access mask. 313 * @write_mask: write access mask.
337 * @lock: indicates whether or not to permanently lock this region.
338 * @return: zero on success or negative value indicating error. 314 * @return: zero on success or negative value indicating error.
339 */ 315 */
340int imr_add_range(phys_addr_t base, size_t size, 316int imr_add_range(phys_addr_t base, size_t size,
341 unsigned int rmask, unsigned int wmask, bool lock) 317 unsigned int rmask, unsigned int wmask)
342{ 318{
343 phys_addr_t end; 319 phys_addr_t end;
344 unsigned int i; 320 unsigned int i;
@@ -411,7 +387,7 @@ int imr_add_range(phys_addr_t base, size_t size,
411 imr.rmask = rmask; 387 imr.rmask = rmask;
412 imr.wmask = wmask; 388 imr.wmask = wmask;
413 389
414 ret = imr_write(idev, reg, &imr, lock); 390 ret = imr_write(idev, reg, &imr);
415 if (ret < 0) { 391 if (ret < 0) {
416 /* 392 /*
417 * In the highly unlikely event iosf_mbi_write failed 393 * In the highly unlikely event iosf_mbi_write failed
@@ -422,7 +398,7 @@ int imr_add_range(phys_addr_t base, size_t size,
422 imr.addr_hi = 0; 398 imr.addr_hi = 0;
423 imr.rmask = IMR_READ_ACCESS_ALL; 399 imr.rmask = IMR_READ_ACCESS_ALL;
424 imr.wmask = IMR_WRITE_ACCESS_ALL; 400 imr.wmask = IMR_WRITE_ACCESS_ALL;
425 imr_write(idev, reg, &imr, false); 401 imr_write(idev, reg, &imr);
426 } 402 }
427failed: 403failed:
428 mutex_unlock(&idev->lock); 404 mutex_unlock(&idev->lock);
@@ -518,7 +494,7 @@ static int __imr_remove_range(int reg, phys_addr_t base, size_t size)
518 imr.rmask = IMR_READ_ACCESS_ALL; 494 imr.rmask = IMR_READ_ACCESS_ALL;
519 imr.wmask = IMR_WRITE_ACCESS_ALL; 495 imr.wmask = IMR_WRITE_ACCESS_ALL;
520 496
521 ret = imr_write(idev, reg, &imr, false); 497 ret = imr_write(idev, reg, &imr);
522 498
523failed: 499failed:
524 mutex_unlock(&idev->lock); 500 mutex_unlock(&idev->lock);
@@ -599,7 +575,7 @@ static void __init imr_fixup_memmap(struct imr_device *idev)
599 * We don't round up @size since it is already PAGE_SIZE aligned. 575 * We don't round up @size since it is already PAGE_SIZE aligned.
600 * See vmlinux.lds.S for details. 576 * See vmlinux.lds.S for details.
601 */ 577 */
602 ret = imr_add_range(base, size, IMR_CPU, IMR_CPU, false); 578 ret = imr_add_range(base, size, IMR_CPU, IMR_CPU);
603 if (ret < 0) { 579 if (ret < 0) {
604 pr_err("unable to setup IMR for kernel: %zu KiB (%lx - %lx)\n", 580 pr_err("unable to setup IMR for kernel: %zu KiB (%lx - %lx)\n",
605 size / 1024, start, end); 581 size / 1024, start, end);
@@ -614,7 +590,6 @@ static const struct x86_cpu_id imr_ids[] __initconst = {
614 { X86_VENDOR_INTEL, 5, 9 }, /* Intel Quark SoC X1000. */ 590 { X86_VENDOR_INTEL, 5, 9 }, /* Intel Quark SoC X1000. */
615 {} 591 {}
616}; 592};
617MODULE_DEVICE_TABLE(x86cpu, imr_ids);
618 593
619/** 594/**
620 * imr_init - entry point for IMR driver. 595 * imr_init - entry point for IMR driver.
@@ -640,22 +615,4 @@ static int __init imr_init(void)
640 imr_fixup_memmap(idev); 615 imr_fixup_memmap(idev);
641 return 0; 616 return 0;
642} 617}
643 618device_initcall(imr_init);
644/**
645 * imr_exit - exit point for IMR code.
646 *
647 * Deregisters debugfs, leave IMR state as-is.
648 *
649 * return:
650 */
651static void __exit imr_exit(void)
652{
653 imr_debugfs_unregister(&imr_dev);
654}
655
656module_init(imr_init);
657module_exit(imr_exit);
658
659MODULE_AUTHOR("Bryan O'Donoghue <pure.logic@nexus-software.ie>");
660MODULE_DESCRIPTION("Intel Isolated Memory Region driver");
661MODULE_LICENSE("Dual BSD/GPL");
diff --git a/arch/x86/platform/intel-quark/imr_selftest.c b/arch/x86/platform/intel-quark/imr_selftest.c
index 278e4da4222f..f5bad40936ac 100644
--- a/arch/x86/platform/intel-quark/imr_selftest.c
+++ b/arch/x86/platform/intel-quark/imr_selftest.c
@@ -1,5 +1,5 @@
1/** 1/**
2 * imr_selftest.c 2 * imr_selftest.c -- Intel Isolated Memory Region self-test driver
3 * 3 *
4 * Copyright(c) 2013 Intel Corporation. 4 * Copyright(c) 2013 Intel Corporation.
5 * Copyright(c) 2015 Bryan O'Donoghue <pure.logic@nexus-software.ie> 5 * Copyright(c) 2015 Bryan O'Donoghue <pure.logic@nexus-software.ie>
@@ -15,7 +15,6 @@
15#include <asm/imr.h> 15#include <asm/imr.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/mm.h> 17#include <linux/mm.h>
18#include <linux/module.h>
19#include <linux/types.h> 18#include <linux/types.h>
20 19
21#define SELFTEST KBUILD_MODNAME ": " 20#define SELFTEST KBUILD_MODNAME ": "
@@ -61,30 +60,30 @@ static void __init imr_self_test(void)
61 int ret; 60 int ret;
62 61
63 /* Test zero zero. */ 62 /* Test zero zero. */
64 ret = imr_add_range(0, 0, 0, 0, false); 63 ret = imr_add_range(0, 0, 0, 0);
65 imr_self_test_result(ret < 0, "zero sized IMR\n"); 64 imr_self_test_result(ret < 0, "zero sized IMR\n");
66 65
67 /* Test exact overlap. */ 66 /* Test exact overlap. */
68 ret = imr_add_range(base, size, IMR_CPU, IMR_CPU, false); 67 ret = imr_add_range(base, size, IMR_CPU, IMR_CPU);
69 imr_self_test_result(ret < 0, fmt_over, __va(base), __va(base + size)); 68 imr_self_test_result(ret < 0, fmt_over, __va(base), __va(base + size));
70 69
71 /* Test overlap with base inside of existing. */ 70 /* Test overlap with base inside of existing. */
72 base += size - IMR_ALIGN; 71 base += size - IMR_ALIGN;
73 ret = imr_add_range(base, size, IMR_CPU, IMR_CPU, false); 72 ret = imr_add_range(base, size, IMR_CPU, IMR_CPU);
74 imr_self_test_result(ret < 0, fmt_over, __va(base), __va(base + size)); 73 imr_self_test_result(ret < 0, fmt_over, __va(base), __va(base + size));
75 74
76 /* Test overlap with end inside of existing. */ 75 /* Test overlap with end inside of existing. */
77 base -= size + IMR_ALIGN * 2; 76 base -= size + IMR_ALIGN * 2;
78 ret = imr_add_range(base, size, IMR_CPU, IMR_CPU, false); 77 ret = imr_add_range(base, size, IMR_CPU, IMR_CPU);
79 imr_self_test_result(ret < 0, fmt_over, __va(base), __va(base + size)); 78 imr_self_test_result(ret < 0, fmt_over, __va(base), __va(base + size));
80 79
81 /* Test that a 1 KiB IMR @ zero with read/write all will bomb out. */ 80 /* Test that a 1 KiB IMR @ zero with read/write all will bomb out. */
82 ret = imr_add_range(0, IMR_ALIGN, IMR_READ_ACCESS_ALL, 81 ret = imr_add_range(0, IMR_ALIGN, IMR_READ_ACCESS_ALL,
83 IMR_WRITE_ACCESS_ALL, false); 82 IMR_WRITE_ACCESS_ALL);
84 imr_self_test_result(ret < 0, "1KiB IMR @ 0x00000000 - access-all\n"); 83 imr_self_test_result(ret < 0, "1KiB IMR @ 0x00000000 - access-all\n");
85 84
86 /* Test that a 1 KiB IMR @ zero with CPU only will work. */ 85 /* Test that a 1 KiB IMR @ zero with CPU only will work. */
87 ret = imr_add_range(0, IMR_ALIGN, IMR_CPU, IMR_CPU, false); 86 ret = imr_add_range(0, IMR_ALIGN, IMR_CPU, IMR_CPU);
88 imr_self_test_result(ret >= 0, "1KiB IMR @ 0x00000000 - cpu-access\n"); 87 imr_self_test_result(ret >= 0, "1KiB IMR @ 0x00000000 - cpu-access\n");
89 if (ret >= 0) { 88 if (ret >= 0) {
90 ret = imr_remove_range(0, IMR_ALIGN); 89 ret = imr_remove_range(0, IMR_ALIGN);
@@ -93,8 +92,7 @@ static void __init imr_self_test(void)
93 92
94 /* Test 2 KiB works. */ 93 /* Test 2 KiB works. */
95 size = IMR_ALIGN * 2; 94 size = IMR_ALIGN * 2;
96 ret = imr_add_range(0, size, IMR_READ_ACCESS_ALL, 95 ret = imr_add_range(0, size, IMR_READ_ACCESS_ALL, IMR_WRITE_ACCESS_ALL);
97 IMR_WRITE_ACCESS_ALL, false);
98 imr_self_test_result(ret >= 0, "2KiB IMR @ 0x00000000\n"); 96 imr_self_test_result(ret >= 0, "2KiB IMR @ 0x00000000\n");
99 if (ret >= 0) { 97 if (ret >= 0) {
100 ret = imr_remove_range(0, size); 98 ret = imr_remove_range(0, size);
@@ -106,7 +104,6 @@ static const struct x86_cpu_id imr_ids[] __initconst = {
106 { X86_VENDOR_INTEL, 5, 9 }, /* Intel Quark SoC X1000. */ 104 { X86_VENDOR_INTEL, 5, 9 }, /* Intel Quark SoC X1000. */
107 {} 105 {}
108}; 106};
109MODULE_DEVICE_TABLE(x86cpu, imr_ids);
110 107
111/** 108/**
112 * imr_self_test_init - entry point for IMR driver. 109 * imr_self_test_init - entry point for IMR driver.
@@ -125,13 +122,4 @@ static int __init imr_self_test_init(void)
125 * 122 *
126 * return: 123 * return:
127 */ 124 */
128static void __exit imr_self_test_exit(void) 125device_initcall(imr_self_test_init);
129{
130}
131
132module_init(imr_self_test_init);
133module_exit(imr_self_test_exit);
134
135MODULE_AUTHOR("Bryan O'Donoghue <pure.logic@nexus-software.ie>");
136MODULE_DESCRIPTION("Intel Isolated Memory Region self-test driver");
137MODULE_LICENSE("Dual BSD/GPL");