License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 17:07:57 +03:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2005-04-17 02:20:36 +04:00
|
|
|
/*
|
|
|
|
* linux/arch/parisc/kernel/time.c
|
|
|
|
*
|
|
|
|
* Copyright (C) 1991, 1992, 1995 Linus Torvalds
|
|
|
|
* Modifications for ARM (C) 1994, 1995, 1996,1997 Russell King
|
|
|
|
* Copyright (C) 1999 SuSE GmbH, (Philipp Rumpf, prumpf@tux.org)
|
|
|
|
*
|
|
|
|
* 1994-07-02 Alan Modra
|
|
|
|
* fixed set_rtc_mmss, fixed time.year for >= 2000, new mktime
|
|
|
|
* 1998-12-20 Updated NTP code according to technical memorandum Jan '96
|
|
|
|
* "A Kernel Model for Precision Timekeeping" by Dave Mills
|
|
|
|
*/
|
|
|
|
#include <linux/errno.h>
|
|
|
|
#include <linux/module.h>
|
2016-05-30 21:57:55 +03:00
|
|
|
#include <linux/rtc.h>
|
2005-04-17 02:20:36 +04:00
|
|
|
#include <linux/sched.h>
|
2017-02-01 18:36:40 +03:00
|
|
|
#include <linux/sched/clock.h>
|
2016-11-22 20:08:30 +03:00
|
|
|
#include <linux/sched_clock.h>
|
2005-04-17 02:20:36 +04:00
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/param.h>
|
|
|
|
#include <linux/string.h>
|
|
|
|
#include <linux/mm.h>
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/time.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/smp.h>
|
|
|
|
#include <linux/profile.h>
|
2007-01-03 01:54:16 +03:00
|
|
|
#include <linux/clocksource.h>
|
2008-09-10 18:24:07 +04:00
|
|
|
#include <linux/platform_device.h>
|
2009-02-09 02:43:36 +03:00
|
|
|
#include <linux/ftrace.h>
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2016-12-24 22:46:01 +03:00
|
|
|
#include <linux/uaccess.h>
|
2005-04-17 02:20:36 +04:00
|
|
|
#include <asm/io.h>
|
|
|
|
#include <asm/irq.h>
|
parisc: move definition of PAGE0 to asm/page.h
This was defined in asm/pdc.h which needs to include asm/page.h for
__PAGE_OFFSET. This leads to an include loop so that page.h eventually will
include pdc.h again. While this is no problem because of header guards, it is
a problem because some symbols may be undefined. Such an error is this:
In file included from include/linux/bitops.h:35:0,
from include/asm-generic/getorder.h:7,
from arch/parisc/include/asm/page.h:162,
from arch/parisc/include/asm/pdc.h:346,
from arch/parisc/include/asm/processor.h:16,
from arch/parisc/include/asm/spinlock.h:6,
from arch/parisc/include/asm/atomic.h:20,
from include/linux/atomic.h:4,
from include/linux/sysfs.h:20,
from include/linux/kobject.h:21,
from include/linux/device.h:17,
from include/linux/eisa.h:5,
from arch/parisc/kernel/pci.c:11:
arch/parisc/include/asm/bitops.h: In function ‘set_bit’:
arch/parisc/include/asm/bitops.h:82:2: error: implicit declaration of function ‘_atomic_spin_lock_irqsave’ [-Werror=implicit-function-declaration]
arch/parisc/include/asm/bitops.h:84:2: error: implicit declaration of function ‘_atomic_spin_unlock_irqrestore’ [-Werror=implicit-function-declaration]
Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-11 01:08:17 +04:00
|
|
|
#include <asm/page.h>
|
2005-04-17 02:20:36 +04:00
|
|
|
#include <asm/param.h>
|
|
|
|
#include <asm/pdc.h>
|
|
|
|
#include <asm/led.h>
|
|
|
|
|
|
|
|
#include <linux/timex.h>
|
|
|
|
|
2019-05-10 21:55:31 +03:00
|
|
|
static unsigned long clocktick __ro_after_init; /* timer cycles per tick */
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2006-10-05 01:12:52 +04:00
|
|
|
/*
|
|
|
|
* We keep time on PA-RISC Linux by using the Interval Timer which is
|
|
|
|
* a pair of registers; one is read-only and one is write-only; both
|
|
|
|
* accessed through CR16. The read-only register is 32 or 64 bits wide,
|
|
|
|
* and increments by 1 every CPU clock tick. The architecture only
|
|
|
|
* guarantees us a rate between 0.5 and 2, but all implementations use a
|
|
|
|
* rate of 1. The write-only register is 32-bits wide. When the lowest
|
|
|
|
* 32 bits of the read-only register compare equal to the write-only
|
|
|
|
* register, it raises a maskable external interrupt. Each processor has
|
|
|
|
* an Interval Timer of its own and they are not synchronised.
|
|
|
|
*
|
|
|
|
* We want to generate an interrupt every 1/HZ seconds. So we program
|
|
|
|
* CR16 to interrupt every @clocktick cycles. The it_value in cpu_data
|
|
|
|
* is programmed with the intended time of the next tick. We can be
|
|
|
|
* held off for an arbitrarily long period of time by interrupts being
|
|
|
|
* disabled, so we may miss one or more ticks.
|
|
|
|
*/
|
2009-02-09 02:43:36 +03:00
|
|
|
irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id)
|
2005-04-17 02:20:36 +04:00
|
|
|
{
|
2016-12-20 22:51:10 +03:00
|
|
|
unsigned long now;
|
2006-09-09 10:29:22 +04:00
|
|
|
unsigned long next_tick;
|
2016-12-20 22:51:10 +03:00
|
|
|
unsigned long ticks_elapsed = 0;
|
2006-09-10 23:57:55 +04:00
|
|
|
unsigned int cpu = smp_processor_id();
|
2008-12-31 06:12:10 +03:00
|
|
|
struct cpuinfo_parisc *cpuinfo = &per_cpu(cpu_data, cpu);
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2006-09-05 00:56:11 +04:00
|
|
|
/* gcc can optimize for "read-only" case with a local clocktick */
|
2006-09-10 23:57:55 +04:00
|
|
|
unsigned long cpt = clocktick;
|
2006-09-05 00:56:11 +04:00
|
|
|
|
2006-10-07 06:47:23 +04:00
|
|
|
profile_tick(CPU_PROFILING);
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2016-12-20 22:51:10 +03:00
|
|
|
/* Initialize next_tick to the old expected tick time. */
|
2006-10-07 16:01:11 +04:00
|
|
|
next_tick = cpuinfo->it_value;
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2016-12-20 22:51:10 +03:00
|
|
|
/* Calculate how many ticks have elapsed. */
|
2018-02-12 23:43:55 +03:00
|
|
|
now = mfctl(16);
|
2016-12-20 22:51:10 +03:00
|
|
|
do {
|
|
|
|
++ticks_elapsed;
|
|
|
|
next_tick += cpt;
|
|
|
|
} while (next_tick - now > cpt);
|
2006-09-10 23:57:55 +04:00
|
|
|
|
2016-12-20 22:51:10 +03:00
|
|
|
/* Store (in CR16 cycles) up to when we are accounting right now. */
|
2006-10-07 16:01:11 +04:00
|
|
|
cpuinfo->it_value = next_tick;
|
2006-09-05 00:56:11 +04:00
|
|
|
|
2016-12-20 22:51:10 +03:00
|
|
|
/* Go do system house keeping. */
|
|
|
|
if (cpu == 0)
|
|
|
|
xtime_update(ticks_elapsed);
|
|
|
|
|
|
|
|
update_process_times(user_mode(get_irq_regs()));
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2016-12-20 22:51:10 +03:00
|
|
|
/* Skip clockticks on purpose if we know we would miss those.
|
2009-06-01 04:20:23 +04:00
|
|
|
* The new CR16 must be "later" than current CR16 otherwise
|
|
|
|
* itimer would not fire until CR16 wrapped - e.g 4 seconds
|
|
|
|
* later on a 1Ghz processor. We'll account for the missed
|
2016-12-20 22:51:10 +03:00
|
|
|
* ticks on the next timer interrupt.
|
|
|
|
* We want IT to fire modulo clocktick even if we miss/skip some.
|
|
|
|
* But those interrupts don't in fact get delivered that regularly.
|
2009-06-01 04:20:23 +04:00
|
|
|
*
|
|
|
|
* "next_tick - now" will always give the difference regardless
|
|
|
|
* if one or the other wrapped. If "now" is "bigger" we'll end up
|
|
|
|
* with a very large unsigned number.
|
|
|
|
*/
|
2018-02-12 23:43:55 +03:00
|
|
|
now = mfctl(16);
|
|
|
|
while (next_tick - now > cpt)
|
2016-12-20 22:51:10 +03:00
|
|
|
next_tick += cpt;
|
2009-06-01 04:20:23 +04:00
|
|
|
|
2016-12-20 22:51:10 +03:00
|
|
|
/* Program the IT when to deliver the next interrupt.
|
|
|
|
* Only bottom 32-bits of next_tick are writable in CR16!
|
|
|
|
* Timer interrupt will be delivered at least a few hundred cycles
|
2018-02-12 23:43:55 +03:00
|
|
|
* after the IT fires, so if we are too close (<= 8000 cycles) to the
|
2016-12-20 22:51:10 +03:00
|
|
|
* next cycle, simply skip it.
|
2006-09-09 10:29:22 +04:00
|
|
|
*/
|
2018-02-12 23:43:55 +03:00
|
|
|
if (next_tick - now <= 8000)
|
2016-12-20 22:51:10 +03:00
|
|
|
next_tick += cpt;
|
|
|
|
mtctl(next_tick, 16);
|
2006-09-10 23:57:55 +04:00
|
|
|
|
2005-04-17 02:20:36 +04:00
|
|
|
return IRQ_HANDLED;
|
|
|
|
}
|
|
|
|
|
2005-10-22 06:42:18 +04:00
|
|
|
|
|
|
|
unsigned long profile_pc(struct pt_regs *regs)
|
|
|
|
{
|
|
|
|
unsigned long pc = instruction_pointer(regs);
|
|
|
|
|
|
|
|
if (regs->gr[0] & PSW_N)
|
|
|
|
pc -= 4;
|
|
|
|
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
if (in_lock_functions(pc))
|
|
|
|
pc = regs->gr[2];
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return pc;
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(profile_pc);
|
|
|
|
|
|
|
|
|
2007-01-03 01:54:16 +03:00
|
|
|
/* clock source code */
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2016-12-21 22:32:01 +03:00
|
|
|
static u64 notrace read_cr16(struct clocksource *cs)
|
2005-04-17 02:20:36 +04:00
|
|
|
{
|
2007-01-03 01:54:16 +03:00
|
|
|
return get_cycles();
|
2005-04-17 02:20:36 +04:00
|
|
|
}
|
2006-09-09 10:29:22 +04:00
|
|
|
|
2007-01-03 01:54:16 +03:00
|
|
|
static struct clocksource clocksource_cr16 = {
|
|
|
|
.name = "cr16",
|
|
|
|
.rating = 300,
|
|
|
|
.read = read_cr16,
|
|
|
|
.mask = CLOCKSOURCE_MASK(BITS_PER_LONG),
|
2007-02-27 04:15:18 +03:00
|
|
|
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
|
2007-01-03 01:54:16 +03:00
|
|
|
};
|
2006-09-09 10:29:22 +04:00
|
|
|
|
2006-09-03 11:02:16 +04:00
|
|
|
void __init start_cpu_itimer(void)
|
|
|
|
{
|
|
|
|
unsigned int cpu = smp_processor_id();
|
|
|
|
unsigned long next_tick = mfctl(16) + clocktick;
|
|
|
|
|
|
|
|
mtctl(next_tick, 16); /* kick off Interval Timer (CR16) */
|
|
|
|
|
2008-12-31 06:12:10 +03:00
|
|
|
per_cpu(cpu_data, cpu).it_value = next_tick;
|
2006-09-03 11:02:16 +04:00
|
|
|
}
|
|
|
|
|
2016-05-30 21:57:55 +03:00
|
|
|
#if IS_ENABLED(CONFIG_RTC_DRV_GENERIC)
|
|
|
|
static int rtc_generic_get_time(struct device *dev, struct rtc_time *tm)
|
|
|
|
{
|
|
|
|
struct pdc_tod tod_data;
|
|
|
|
|
|
|
|
memset(tm, 0, sizeof(*tm));
|
|
|
|
if (pdc_tod_read(&tod_data) < 0)
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
|
|
|
|
/* we treat tod_sec as unsigned, so this can work until year 2106 */
|
|
|
|
rtc_time64_to_tm(tod_data.tod_sec, tm);
|
2018-02-22 00:40:23 +03:00
|
|
|
return 0;
|
2016-05-30 21:57:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static int rtc_generic_set_time(struct device *dev, struct rtc_time *tm)
|
|
|
|
{
|
|
|
|
time64_t secs = rtc_tm_to_time64(tm);
|
|
|
|
|
|
|
|
if (pdc_tod_set(secs, 0) < 0)
|
|
|
|
return -EOPNOTSUPP;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct rtc_class_ops rtc_generic_ops = {
|
|
|
|
.read_time = rtc_generic_get_time,
|
|
|
|
.set_time = rtc_generic_set_time,
|
|
|
|
};
|
|
|
|
|
2008-09-10 18:24:07 +04:00
|
|
|
static int __init rtc_init(void)
|
|
|
|
{
|
2015-09-08 18:50:03 +03:00
|
|
|
struct platform_device *pdev;
|
2008-09-10 18:24:07 +04:00
|
|
|
|
2016-05-30 21:57:55 +03:00
|
|
|
pdev = platform_device_register_data(NULL, "rtc-generic", -1,
|
|
|
|
&rtc_generic_ops,
|
|
|
|
sizeof(rtc_generic_ops));
|
|
|
|
|
2015-09-08 18:50:03 +03:00
|
|
|
return PTR_ERR_OR_ZERO(pdev);
|
2008-09-10 18:24:07 +04:00
|
|
|
}
|
2015-09-08 18:50:03 +03:00
|
|
|
device_initcall(rtc_init);
|
2016-05-30 21:57:55 +03:00
|
|
|
#endif
|
2008-09-10 18:24:07 +04:00
|
|
|
|
2018-04-19 09:51:03 +03:00
|
|
|
void read_persistent_clock64(struct timespec64 *ts)
|
2005-04-17 02:20:36 +04:00
|
|
|
{
|
|
|
|
static struct pdc_tod tod_data;
|
2009-12-23 07:14:03 +03:00
|
|
|
if (pdc_tod_read(&tod_data) == 0) {
|
|
|
|
ts->tv_sec = tod_data.tod_sec;
|
|
|
|
ts->tv_nsec = tod_data.tod_usec * 1000;
|
|
|
|
} else {
|
|
|
|
printk(KERN_ERR "Error reading tod clock\n");
|
|
|
|
ts->tv_sec = 0;
|
|
|
|
ts->tv_nsec = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-04-20 22:34:15 +03:00
|
|
|
|
2016-11-22 20:08:30 +03:00
|
|
|
static u64 notrace read_cr16_sched_clock(void)
|
2016-04-20 22:34:15 +03:00
|
|
|
{
|
2016-11-22 20:08:30 +03:00
|
|
|
return get_cycles();
|
2016-04-20 22:34:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* timer interrupt and sched_clock() initialization
|
|
|
|
*/
|
|
|
|
|
2009-12-23 07:14:03 +03:00
|
|
|
void __init time_init(void)
|
|
|
|
{
|
2016-11-22 20:08:30 +03:00
|
|
|
unsigned long cr16_hz;
|
2005-04-17 02:20:36 +04:00
|
|
|
|
|
|
|
clocktick = (100 * PAGE0->mem_10msec) / HZ;
|
2006-09-03 11:02:16 +04:00
|
|
|
start_cpu_itimer(); /* get CPU 0 started */
|
2005-04-17 02:20:36 +04:00
|
|
|
|
2016-11-22 20:08:30 +03:00
|
|
|
cr16_hz = 100 * PAGE0->mem_10msec; /* Hz */
|
|
|
|
|
|
|
|
/* register as sched_clock source */
|
|
|
|
sched_clock_register(read_cr16_sched_clock, BITS_PER_LONG, cr16_hz);
|
2005-04-17 02:20:36 +04:00
|
|
|
}
|
2016-12-26 14:46:01 +03:00
|
|
|
|
|
|
|
static int __init init_cr16_clocksource(void)
|
|
|
|
{
|
|
|
|
/*
|
2017-01-08 13:01:11 +03:00
|
|
|
* The cr16 interval timers are not syncronized across CPUs on
|
|
|
|
* different sockets, so mark them unstable and lower rating on
|
|
|
|
* multi-socket SMP systems.
|
2016-12-26 14:46:01 +03:00
|
|
|
*/
|
2018-01-13 00:44:00 +03:00
|
|
|
if (num_online_cpus() > 1 && !running_on_qemu) {
|
2017-01-08 13:01:11 +03:00
|
|
|
int cpu;
|
|
|
|
unsigned long cpu0_loc;
|
|
|
|
cpu0_loc = per_cpu(cpu_data, 0).cpu_loc;
|
|
|
|
|
|
|
|
for_each_online_cpu(cpu) {
|
2017-10-18 23:25:00 +03:00
|
|
|
if (cpu == 0)
|
|
|
|
continue;
|
|
|
|
if ((cpu0_loc != 0) &&
|
|
|
|
(cpu0_loc == per_cpu(cpu_data, cpu).cpu_loc))
|
2017-01-08 13:01:11 +03:00
|
|
|
continue;
|
|
|
|
|
|
|
|
clocksource_cr16.name = "cr16_unstable";
|
|
|
|
clocksource_cr16.flags = CLOCK_SOURCE_UNSTABLE;
|
|
|
|
clocksource_cr16.rating = 0;
|
|
|
|
break;
|
|
|
|
}
|
2016-12-26 14:46:01 +03:00
|
|
|
}
|
|
|
|
|
2017-01-08 13:01:11 +03:00
|
|
|
/* XXX: We may want to mark sched_clock stable here if cr16 clocks are
|
|
|
|
* in sync:
|
|
|
|
* (clocksource_cr16.flags == CLOCK_SOURCE_IS_CONTINUOUS) */
|
|
|
|
|
2016-12-26 14:46:01 +03:00
|
|
|
/* register at clocksource framework */
|
|
|
|
clocksource_register_hz(&clocksource_cr16,
|
|
|
|
100 * PAGE0->mem_10msec);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
device_initcall(init_cr16_clocksource);
|