Commit 8ab84ef6 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 13c76ad8 c637fa52
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
#define IMR_MASK (IMR_ALIGN - 1) #define IMR_MASK (IMR_ALIGN - 1)
int imr_add_range(phys_addr_t base, size_t size, int imr_add_range(phys_addr_t base, size_t size,
unsigned int rmask, unsigned int wmask, bool lock); unsigned int rmask, unsigned int wmask);
int imr_remove_range(phys_addr_t base, size_t size); int imr_remove_range(phys_addr_t base, size_t size);
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/module.h> #include <linux/moduleparam.h>
#include <linux/leds.h> #include <linux/leds.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/gpio.h> #include <linux/gpio.h>
...@@ -35,6 +35,11 @@ ...@@ -35,6 +35,11 @@
#define BIOS_SIGNATURE_COREBOOT 0x500 #define BIOS_SIGNATURE_COREBOOT 0x500
#define BIOS_REGION_SIZE 0x10000 #define BIOS_REGION_SIZE 0x10000
/*
* This driver is not modular, but to keep back compatibility
* with existing use cases, continuing with module_param is
* the easiest way forward.
*/
static bool force = 0; static bool force = 0;
module_param(force, bool, 0444); module_param(force, bool, 0444);
/* FIXME: Award bios is not automatically detected as Alix platform */ /* FIXME: Award bios is not automatically detected as Alix platform */
...@@ -192,9 +197,4 @@ static int __init alix_init(void) ...@@ -192,9 +197,4 @@ static int __init alix_init(void)
return 0; return 0;
} }
device_initcall(alix_init);
module_init(alix_init);
MODULE_AUTHOR("Ed Wildgoose <kernel@wildgooses.com>");
MODULE_DESCRIPTION("PCEngines ALIX System Setup");
MODULE_LICENSE("GPL");
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/module.h>
#include <linux/leds.h> #include <linux/leds.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/gpio.h> #include <linux/gpio.h>
...@@ -120,9 +119,4 @@ static int __init geos_init(void) ...@@ -120,9 +119,4 @@ static int __init geos_init(void)
return 0; return 0;
} }
device_initcall(geos_init);
module_init(geos_init);
MODULE_AUTHOR("Philip Prindeville <philipp@redfish-solutions.com>");
MODULE_DESCRIPTION("Traverse Technologies Geos System Setup");
MODULE_LICENSE("GPL");
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/module.h>
#include <linux/leds.h> #include <linux/leds.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/gpio.h> #include <linux/gpio.h>
...@@ -146,9 +145,4 @@ static int __init net5501_init(void) ...@@ -146,9 +145,4 @@ static int __init net5501_init(void)
return 0; return 0;
} }
device_initcall(net5501_init);
module_init(net5501_init);
MODULE_AUTHOR("Philip Prindeville <philipp@redfish-solutions.com>");
MODULE_DESCRIPTION("Soekris net5501 System Setup");
MODULE_LICENSE("GPL");
...@@ -52,10 +52,7 @@ static unsigned long __init mfld_calibrate_tsc(void) ...@@ -52,10 +52,7 @@ static unsigned long __init mfld_calibrate_tsc(void)
/* mark tsc clocksource as reliable */ /* mark tsc clocksource as reliable */
set_cpu_cap(&boot_cpu_data, X86_FEATURE_TSC_RELIABLE); set_cpu_cap(&boot_cpu_data, X86_FEATURE_TSC_RELIABLE);
if (fast_calibrate) return fast_calibrate;
return fast_calibrate;
return 0;
} }
static void __init penwell_arch_setup(void) static void __init penwell_arch_setup(void)
......
...@@ -81,10 +81,7 @@ static unsigned long __init tangier_calibrate_tsc(void) ...@@ -81,10 +81,7 @@ static unsigned long __init tangier_calibrate_tsc(void)
/* mark tsc clocksource as reliable */ /* mark tsc clocksource as reliable */
set_cpu_cap(&boot_cpu_data, X86_FEATURE_TSC_RELIABLE); set_cpu_cap(&boot_cpu_data, X86_FEATURE_TSC_RELIABLE);
if (fast_calibrate) return fast_calibrate;
return fast_calibrate;
return 0;
} }
static void __init tangier_arch_setup(void) static void __init tangier_arch_setup(void)
......
/** /**
* imr.c * imr.c -- Intel Isolated Memory Region driver
* *
* Copyright(c) 2013 Intel Corporation. * Copyright(c) 2013 Intel Corporation.
* Copyright(c) 2015 Bryan O'Donoghue <pure.logic@nexus-software.ie> * Copyright(c) 2015 Bryan O'Donoghue <pure.logic@nexus-software.ie>
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
struct imr_device { struct imr_device {
...@@ -135,11 +134,9 @@ static int imr_read(struct imr_device *idev, u32 imr_id, struct imr_regs *imr) ...@@ -135,11 +134,9 @@ static int imr_read(struct imr_device *idev, u32 imr_id, struct imr_regs *imr)
* @idev: pointer to imr_device structure. * @idev: pointer to imr_device structure.
* @imr_id: IMR entry to write. * @imr_id: IMR entry to write.
* @imr: IMR structure representing address and access masks. * @imr: IMR structure representing address and access masks.
* @lock: indicates if the IMR lock bit should be applied.
* @return: 0 on success or error code passed from mbi_iosf on failure. * @return: 0 on success or error code passed from mbi_iosf on failure.
*/ */
static int imr_write(struct imr_device *idev, u32 imr_id, static int imr_write(struct imr_device *idev, u32 imr_id, struct imr_regs *imr)
struct imr_regs *imr, bool lock)
{ {
unsigned long flags; unsigned long flags;
u32 reg = imr_id * IMR_NUM_REGS + idev->reg_base; 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,15 +160,6 @@ static int imr_write(struct imr_device *idev, u32 imr_id,
if (ret) if (ret)
goto failed; goto failed;
/* Lock bit must be set separately to addr_lo address bits. */
if (lock) {
imr->addr_lo |= IMR_LOCK;
ret = iosf_mbi_write(QRK_MBI_UNIT_MM, MBI_REG_WRITE,
reg - IMR_NUM_REGS, imr->addr_lo);
if (ret)
goto failed;
}
local_irq_restore(flags); local_irq_restore(flags);
return 0; return 0;
failed: failed:
...@@ -269,17 +257,6 @@ static int imr_debugfs_register(struct imr_device *idev) ...@@ -269,17 +257,6 @@ static int imr_debugfs_register(struct imr_device *idev)
return PTR_ERR_OR_ZERO(idev->file); return PTR_ERR_OR_ZERO(idev->file);
} }
/**
* imr_debugfs_unregister - unregister debugfs hooks.
*
* @idev: pointer to imr_device structure.
* @return:
*/
static void imr_debugfs_unregister(struct imr_device *idev)
{
debugfs_remove(idev->file);
}
/** /**
* imr_check_params - check passed address range IMR alignment and non-zero size * imr_check_params - check passed address range IMR alignment and non-zero size
* *
...@@ -334,11 +311,10 @@ static inline int imr_address_overlap(phys_addr_t addr, struct imr_regs *imr) ...@@ -334,11 +311,10 @@ static inline int imr_address_overlap(phys_addr_t addr, struct imr_regs *imr)
* @size: physical size of region in bytes must be aligned to 1KiB. * @size: physical size of region in bytes must be aligned to 1KiB.
* @read_mask: read access mask. * @read_mask: read access mask.
* @write_mask: write access mask. * @write_mask: write access mask.
* @lock: indicates whether or not to permanently lock this region.
* @return: zero on success or negative value indicating error. * @return: zero on success or negative value indicating error.
*/ */
int imr_add_range(phys_addr_t base, size_t size, int imr_add_range(phys_addr_t base, size_t size,
unsigned int rmask, unsigned int wmask, bool lock) unsigned int rmask, unsigned int wmask)
{ {
phys_addr_t end; phys_addr_t end;
unsigned int i; unsigned int i;
...@@ -411,7 +387,7 @@ int imr_add_range(phys_addr_t base, size_t size, ...@@ -411,7 +387,7 @@ int imr_add_range(phys_addr_t base, size_t size,
imr.rmask = rmask; imr.rmask = rmask;
imr.wmask = wmask; imr.wmask = wmask;
ret = imr_write(idev, reg, &imr, lock); ret = imr_write(idev, reg, &imr);
if (ret < 0) { if (ret < 0) {
/* /*
* In the highly unlikely event iosf_mbi_write failed * 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,7 +398,7 @@ int imr_add_range(phys_addr_t base, size_t size,
imr.addr_hi = 0; imr.addr_hi = 0;
imr.rmask = IMR_READ_ACCESS_ALL; imr.rmask = IMR_READ_ACCESS_ALL;
imr.wmask = IMR_WRITE_ACCESS_ALL; imr.wmask = IMR_WRITE_ACCESS_ALL;
imr_write(idev, reg, &imr, false); imr_write(idev, reg, &imr);
} }
failed: failed:
mutex_unlock(&idev->lock); mutex_unlock(&idev->lock);
...@@ -518,7 +494,7 @@ static int __imr_remove_range(int reg, phys_addr_t base, size_t size) ...@@ -518,7 +494,7 @@ static int __imr_remove_range(int reg, phys_addr_t base, size_t size)
imr.rmask = IMR_READ_ACCESS_ALL; imr.rmask = IMR_READ_ACCESS_ALL;
imr.wmask = IMR_WRITE_ACCESS_ALL; imr.wmask = IMR_WRITE_ACCESS_ALL;
ret = imr_write(idev, reg, &imr, false); ret = imr_write(idev, reg, &imr);
failed: failed:
mutex_unlock(&idev->lock); mutex_unlock(&idev->lock);
...@@ -599,7 +575,7 @@ static void __init imr_fixup_memmap(struct imr_device *idev) ...@@ -599,7 +575,7 @@ static void __init imr_fixup_memmap(struct imr_device *idev)
* We don't round up @size since it is already PAGE_SIZE aligned. * We don't round up @size since it is already PAGE_SIZE aligned.
* See vmlinux.lds.S for details. * See vmlinux.lds.S for details.
*/ */
ret = imr_add_range(base, size, IMR_CPU, IMR_CPU, false); ret = imr_add_range(base, size, IMR_CPU, IMR_CPU);
if (ret < 0) { if (ret < 0) {
pr_err("unable to setup IMR for kernel: %zu KiB (%lx - %lx)\n", pr_err("unable to setup IMR for kernel: %zu KiB (%lx - %lx)\n",
size / 1024, start, end); size / 1024, start, end);
...@@ -614,7 +590,6 @@ static const struct x86_cpu_id imr_ids[] __initconst = { ...@@ -614,7 +590,6 @@ static const struct x86_cpu_id imr_ids[] __initconst = {
{ X86_VENDOR_INTEL, 5, 9 }, /* Intel Quark SoC X1000. */ { X86_VENDOR_INTEL, 5, 9 }, /* Intel Quark SoC X1000. */
{} {}
}; };
MODULE_DEVICE_TABLE(x86cpu, imr_ids);
/** /**
* imr_init - entry point for IMR driver. * imr_init - entry point for IMR driver.
...@@ -640,22 +615,4 @@ static int __init imr_init(void) ...@@ -640,22 +615,4 @@ static int __init imr_init(void)
imr_fixup_memmap(idev); imr_fixup_memmap(idev);
return 0; return 0;
} }
device_initcall(imr_init);
/**
* imr_exit - exit point for IMR code.
*
* Deregisters debugfs, leave IMR state as-is.
*
* return:
*/
static void __exit imr_exit(void)
{
imr_debugfs_unregister(&imr_dev);
}
module_init(imr_init);
module_exit(imr_exit);
MODULE_AUTHOR("Bryan O'Donoghue <pure.logic@nexus-software.ie>");
MODULE_DESCRIPTION("Intel Isolated Memory Region driver");
MODULE_LICENSE("Dual BSD/GPL");
/** /**
* imr_selftest.c * imr_selftest.c -- Intel Isolated Memory Region self-test driver
* *
* Copyright(c) 2013 Intel Corporation. * Copyright(c) 2013 Intel Corporation.
* Copyright(c) 2015 Bryan O'Donoghue <pure.logic@nexus-software.ie> * Copyright(c) 2015 Bryan O'Donoghue <pure.logic@nexus-software.ie>
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <asm/imr.h> #include <asm/imr.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#define SELFTEST KBUILD_MODNAME ": " #define SELFTEST KBUILD_MODNAME ": "
...@@ -61,30 +60,30 @@ static void __init imr_self_test(void) ...@@ -61,30 +60,30 @@ static void __init imr_self_test(void)
int ret; int ret;
/* Test zero zero. */ /* Test zero zero. */
ret = imr_add_range(0, 0, 0, 0, false); ret = imr_add_range(0, 0, 0, 0);
imr_self_test_result(ret < 0, "zero sized IMR\n"); imr_self_test_result(ret < 0, "zero sized IMR\n");
/* Test exact overlap. */ /* Test exact overlap. */
ret = imr_add_range(base, size, IMR_CPU, IMR_CPU, false); ret = imr_add_range(base, size, IMR_CPU, IMR_CPU);
imr_self_test_result(ret < 0, fmt_over, __va(base), __va(base + size)); imr_self_test_result(ret < 0, fmt_over, __va(base), __va(base + size));
/* Test overlap with base inside of existing. */ /* Test overlap with base inside of existing. */
base += size - IMR_ALIGN; base += size - IMR_ALIGN;
ret = imr_add_range(base, size, IMR_CPU, IMR_CPU, false); ret = imr_add_range(base, size, IMR_CPU, IMR_CPU);
imr_self_test_result(ret < 0, fmt_over, __va(base), __va(base + size)); imr_self_test_result(ret < 0, fmt_over, __va(base), __va(base + size));
/* Test overlap with end inside of existing. */ /* Test overlap with end inside of existing. */
base -= size + IMR_ALIGN * 2; base -= size + IMR_ALIGN * 2;
ret = imr_add_range(base, size, IMR_CPU, IMR_CPU, false); ret = imr_add_range(base, size, IMR_CPU, IMR_CPU);
imr_self_test_result(ret < 0, fmt_over, __va(base), __va(base + size)); imr_self_test_result(ret < 0, fmt_over, __va(base), __va(base + size));
/* Test that a 1 KiB IMR @ zero with read/write all will bomb out. */ /* Test that a 1 KiB IMR @ zero with read/write all will bomb out. */
ret = imr_add_range(0, IMR_ALIGN, IMR_READ_ACCESS_ALL, ret = imr_add_range(0, IMR_ALIGN, IMR_READ_ACCESS_ALL,
IMR_WRITE_ACCESS_ALL, false); IMR_WRITE_ACCESS_ALL);
imr_self_test_result(ret < 0, "1KiB IMR @ 0x00000000 - access-all\n"); imr_self_test_result(ret < 0, "1KiB IMR @ 0x00000000 - access-all\n");
/* Test that a 1 KiB IMR @ zero with CPU only will work. */ /* Test that a 1 KiB IMR @ zero with CPU only will work. */
ret = imr_add_range(0, IMR_ALIGN, IMR_CPU, IMR_CPU, false); ret = imr_add_range(0, IMR_ALIGN, IMR_CPU, IMR_CPU);
imr_self_test_result(ret >= 0, "1KiB IMR @ 0x00000000 - cpu-access\n"); imr_self_test_result(ret >= 0, "1KiB IMR @ 0x00000000 - cpu-access\n");
if (ret >= 0) { if (ret >= 0) {
ret = imr_remove_range(0, IMR_ALIGN); ret = imr_remove_range(0, IMR_ALIGN);
...@@ -93,8 +92,7 @@ static void __init imr_self_test(void) ...@@ -93,8 +92,7 @@ static void __init imr_self_test(void)
/* Test 2 KiB works. */ /* Test 2 KiB works. */
size = IMR_ALIGN * 2; size = IMR_ALIGN * 2;
ret = imr_add_range(0, size, IMR_READ_ACCESS_ALL, ret = imr_add_range(0, size, IMR_READ_ACCESS_ALL, IMR_WRITE_ACCESS_ALL);
IMR_WRITE_ACCESS_ALL, false);
imr_self_test_result(ret >= 0, "2KiB IMR @ 0x00000000\n"); imr_self_test_result(ret >= 0, "2KiB IMR @ 0x00000000\n");
if (ret >= 0) { if (ret >= 0) {
ret = imr_remove_range(0, size); ret = imr_remove_range(0, size);
...@@ -106,7 +104,6 @@ static const struct x86_cpu_id imr_ids[] __initconst = { ...@@ -106,7 +104,6 @@ static const struct x86_cpu_id imr_ids[] __initconst = {
{ X86_VENDOR_INTEL, 5, 9 }, /* Intel Quark SoC X1000. */ { X86_VENDOR_INTEL, 5, 9 }, /* Intel Quark SoC X1000. */
{} {}
}; };
MODULE_DEVICE_TABLE(x86cpu, imr_ids);
/** /**
* imr_self_test_init - entry point for IMR driver. * imr_self_test_init - entry point for IMR driver.
...@@ -125,13 +122,4 @@ static int __init imr_self_test_init(void) ...@@ -125,13 +122,4 @@ static int __init imr_self_test_init(void)
* *
* return: * return:
*/ */
static void __exit imr_self_test_exit(void) device_initcall(imr_self_test_init);
{
}
module_init(imr_self_test_init);
module_exit(imr_self_test_exit);
MODULE_AUTHOR("Bryan O'Donoghue <pure.logic@nexus-software.ie>");
MODULE_DESCRIPTION("Intel Isolated Memory Region self-test driver");
MODULE_LICENSE("Dual BSD/GPL");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment