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 14:07:57 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* r2300.c: R2000 and R3000 specific mmu/cache code.
|
|
|
|
*
|
2011-04-04 21:15:29 +00:00
|
|
|
* Copyright (C) 1996 David S. Miller (davem@davemloft.net)
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
|
|
|
* with a lot of changes to make this thing work for R3000s
|
|
|
|
* Tx39XX R4k style caches added. HK
|
|
|
|
* Copyright (C) 1998, 1999, 2000 Harald Koerfgen
|
|
|
|
* Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
|
|
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/sched.h>
|
2009-06-19 13:05:26 +00:00
|
|
|
#include <linux/smp.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
#include <linux/mm.h>
|
|
|
|
|
|
|
|
#include <asm/cacheops.h>
|
|
|
|
#include <asm/page.h>
|
|
|
|
#include <asm/pgtable.h>
|
|
|
|
#include <asm/mmu_context.h>
|
|
|
|
#include <asm/isadep.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
#include <asm/bootinfo.h>
|
|
|
|
#include <asm/cpu.h>
|
|
|
|
|
|
|
|
/* For R3000 cores with R4000 style caches */
|
|
|
|
static unsigned long icache_size, dcache_size; /* Size in bytes */
|
|
|
|
|
|
|
|
#include <asm/r4kcache.h>
|
|
|
|
|
|
|
|
/* This sequence is required to ensure icache is disabled immediately */
|
|
|
|
#define TX39_STOP_STREAMING() \
|
|
|
|
__asm__ __volatile__( \
|
2013-01-22 11:59:30 +00:00
|
|
|
".set push\n\t" \
|
|
|
|
".set noreorder\n\t" \
|
|
|
|
"b 1f\n\t" \
|
2005-04-16 22:20:36 +00:00
|
|
|
"nop\n\t" \
|
|
|
|
"1:\n\t" \
|
|
|
|
".set pop" \
|
|
|
|
)
|
|
|
|
|
|
|
|
/* TX39H-style cache flush routines. */
|
|
|
|
static void tx39h_flush_icache_all(void)
|
|
|
|
{
|
|
|
|
unsigned long flags, config;
|
|
|
|
|
|
|
|
/* disable icache (set ICE#) */
|
|
|
|
local_irq_save(flags);
|
|
|
|
config = read_c0_conf();
|
|
|
|
write_c0_conf(config & ~TX39_CONF_ICE);
|
|
|
|
TX39_STOP_STREAMING();
|
2006-02-09 15:39:06 +00:00
|
|
|
blast_icache16();
|
2005-04-16 22:20:36 +00:00
|
|
|
write_c0_conf(config);
|
|
|
|
local_irq_restore(flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void tx39h_dma_cache_wback_inv(unsigned long addr, unsigned long size)
|
|
|
|
{
|
|
|
|
/* Catch bad driver code */
|
|
|
|
BUG_ON(size == 0);
|
|
|
|
|
|
|
|
iob();
|
2006-02-09 15:39:06 +00:00
|
|
|
blast_inv_dcache_range(addr, addr + size);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* TX39H2,TX39H3 */
|
|
|
|
static inline void tx39_blast_dcache_page(unsigned long addr)
|
|
|
|
{
|
2007-10-11 22:46:15 +00:00
|
|
|
if (current_cpu_type() != CPU_TX3912)
|
2005-04-16 22:20:36 +00:00
|
|
|
blast_dcache16_page(addr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void tx39_blast_dcache_page_indexed(unsigned long addr)
|
|
|
|
{
|
|
|
|
blast_dcache16_page_indexed(addr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void tx39_blast_dcache(void)
|
|
|
|
{
|
|
|
|
blast_dcache16();
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void tx39_blast_icache_page(unsigned long addr)
|
|
|
|
{
|
|
|
|
unsigned long flags, config;
|
|
|
|
/* disable icache (set ICE#) */
|
|
|
|
local_irq_save(flags);
|
|
|
|
config = read_c0_conf();
|
|
|
|
write_c0_conf(config & ~TX39_CONF_ICE);
|
|
|
|
TX39_STOP_STREAMING();
|
|
|
|
blast_icache16_page(addr);
|
|
|
|
write_c0_conf(config);
|
|
|
|
local_irq_restore(flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void tx39_blast_icache_page_indexed(unsigned long addr)
|
|
|
|
{
|
|
|
|
unsigned long flags, config;
|
|
|
|
/* disable icache (set ICE#) */
|
|
|
|
local_irq_save(flags);
|
|
|
|
config = read_c0_conf();
|
|
|
|
write_c0_conf(config & ~TX39_CONF_ICE);
|
|
|
|
TX39_STOP_STREAMING();
|
|
|
|
blast_icache16_page_indexed(addr);
|
|
|
|
write_c0_conf(config);
|
|
|
|
local_irq_restore(flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void tx39_blast_icache(void)
|
|
|
|
{
|
|
|
|
unsigned long flags, config;
|
|
|
|
/* disable icache (set ICE#) */
|
|
|
|
local_irq_save(flags);
|
|
|
|
config = read_c0_conf();
|
|
|
|
write_c0_conf(config & ~TX39_CONF_ICE);
|
|
|
|
TX39_STOP_STREAMING();
|
|
|
|
blast_icache16();
|
|
|
|
write_c0_conf(config);
|
|
|
|
local_irq_restore(flags);
|
|
|
|
}
|
|
|
|
|
2008-04-05 14:13:23 +00:00
|
|
|
static void tx39__flush_cache_vmap(void)
|
|
|
|
{
|
|
|
|
tx39_blast_dcache();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void tx39__flush_cache_vunmap(void)
|
|
|
|
{
|
|
|
|
tx39_blast_dcache();
|
|
|
|
}
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
static inline void tx39_flush_cache_all(void)
|
|
|
|
{
|
|
|
|
if (!cpu_has_dc_aliases)
|
|
|
|
return;
|
|
|
|
|
|
|
|
tx39_blast_dcache();
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void tx39___flush_cache_all(void)
|
|
|
|
{
|
|
|
|
tx39_blast_dcache();
|
|
|
|
tx39_blast_icache();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void tx39_flush_cache_mm(struct mm_struct *mm)
|
|
|
|
{
|
|
|
|
if (!cpu_has_dc_aliases)
|
|
|
|
return;
|
|
|
|
|
2007-03-04 15:41:39 +00:00
|
|
|
if (cpu_context(smp_processor_id(), mm) != 0)
|
|
|
|
tx39_blast_dcache();
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void tx39_flush_cache_range(struct vm_area_struct *vma,
|
|
|
|
unsigned long start, unsigned long end)
|
|
|
|
{
|
2007-03-04 15:41:39 +00:00
|
|
|
if (!cpu_has_dc_aliases)
|
|
|
|
return;
|
2005-09-28 11:24:58 +00:00
|
|
|
if (!(cpu_context(smp_processor_id(), vma->vm_mm)))
|
2005-04-16 22:20:36 +00:00
|
|
|
return;
|
|
|
|
|
2007-03-04 15:41:39 +00:00
|
|
|
tx39_blast_dcache();
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void tx39_flush_cache_page(struct vm_area_struct *vma, unsigned long page, unsigned long pfn)
|
|
|
|
{
|
|
|
|
int exec = vma->vm_flags & VM_EXEC;
|
|
|
|
struct mm_struct *mm = vma->vm_mm;
|
|
|
|
pgd_t *pgdp;
|
2005-02-10 12:19:59 +00:00
|
|
|
pud_t *pudp;
|
2005-04-16 22:20:36 +00:00
|
|
|
pmd_t *pmdp;
|
|
|
|
pte_t *ptep;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If ownes no valid ASID yet, cannot possibly have gotten
|
|
|
|
* this page into the cache.
|
|
|
|
*/
|
|
|
|
if (cpu_context(smp_processor_id(), mm) == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
page &= PAGE_MASK;
|
|
|
|
pgdp = pgd_offset(mm, page);
|
2005-02-10 12:19:59 +00:00
|
|
|
pudp = pud_offset(pgdp, page);
|
|
|
|
pmdp = pmd_offset(pudp, page);
|
2005-04-16 22:20:36 +00:00
|
|
|
ptep = pte_offset(pmdp, page);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If the page isn't marked valid, the page cannot possibly be
|
|
|
|
* in the cache.
|
|
|
|
*/
|
|
|
|
if (!(pte_val(*ptep) & _PAGE_PRESENT))
|
|
|
|
return;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Doing flushes for another ASID than the current one is
|
|
|
|
* too difficult since stupid R4k caches do a TLB translation
|
|
|
|
* for every cache flush operation. So we do indexed flushes
|
|
|
|
* in that case, which doesn't overly flush the cache too much.
|
|
|
|
*/
|
|
|
|
if ((mm == current->active_mm) && (pte_val(*ptep) & _PAGE_VALID)) {
|
|
|
|
if (cpu_has_dc_aliases || exec)
|
|
|
|
tx39_blast_dcache_page(page);
|
|
|
|
if (exec)
|
|
|
|
tx39_blast_icache_page(page);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Do indexed flush, too much work to get the (possible) TLB refills
|
|
|
|
* to work correctly.
|
|
|
|
*/
|
|
|
|
if (cpu_has_dc_aliases || exec)
|
|
|
|
tx39_blast_dcache_page_indexed(page);
|
|
|
|
if (exec)
|
|
|
|
tx39_blast_icache_page_indexed(page);
|
|
|
|
}
|
|
|
|
|
2006-04-05 19:42:04 +00:00
|
|
|
static void local_tx39_flush_data_cache_page(void * addr)
|
|
|
|
{
|
2007-03-04 15:41:39 +00:00
|
|
|
tx39_blast_dcache_page((unsigned long)addr);
|
2006-04-05 19:42:04 +00:00
|
|
|
}
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
static void tx39_flush_data_cache_page(unsigned long addr)
|
|
|
|
{
|
|
|
|
tx39_blast_dcache_page(addr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void tx39_flush_icache_range(unsigned long start, unsigned long end)
|
|
|
|
{
|
|
|
|
if (end - start > dcache_size)
|
|
|
|
tx39_blast_dcache();
|
2006-02-09 15:39:06 +00:00
|
|
|
else
|
|
|
|
protected_blast_dcache_range(start, end);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
if (end - start > icache_size)
|
|
|
|
tx39_blast_icache();
|
|
|
|
else {
|
|
|
|
unsigned long flags, config;
|
|
|
|
/* disable icache (set ICE#) */
|
|
|
|
local_irq_save(flags);
|
|
|
|
config = read_c0_conf();
|
|
|
|
write_c0_conf(config & ~TX39_CONF_ICE);
|
|
|
|
TX39_STOP_STREAMING();
|
2006-02-09 15:39:06 +00:00
|
|
|
protected_blast_icache_range(start, end);
|
2005-04-16 22:20:36 +00:00
|
|
|
write_c0_conf(config);
|
|
|
|
local_irq_restore(flags);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-06-17 15:20:28 +00:00
|
|
|
static void tx39_flush_kernel_vmap_range(unsigned long vaddr, int size)
|
|
|
|
{
|
|
|
|
BUG();
|
|
|
|
}
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
static void tx39_dma_cache_wback_inv(unsigned long addr, unsigned long size)
|
|
|
|
{
|
2006-02-09 15:39:06 +00:00
|
|
|
unsigned long end;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
if (((size | addr) & (PAGE_SIZE - 1)) == 0) {
|
|
|
|
end = addr + size;
|
|
|
|
do {
|
|
|
|
tx39_blast_dcache_page(addr);
|
|
|
|
addr += PAGE_SIZE;
|
|
|
|
} while(addr != end);
|
|
|
|
} else if (size > dcache_size) {
|
|
|
|
tx39_blast_dcache();
|
|
|
|
} else {
|
2006-02-09 15:39:06 +00:00
|
|
|
blast_dcache_range(addr, addr + size);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void tx39_dma_cache_inv(unsigned long addr, unsigned long size)
|
|
|
|
{
|
2006-02-09 15:39:06 +00:00
|
|
|
unsigned long end;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
if (((size | addr) & (PAGE_SIZE - 1)) == 0) {
|
|
|
|
end = addr + size;
|
|
|
|
do {
|
|
|
|
tx39_blast_dcache_page(addr);
|
|
|
|
addr += PAGE_SIZE;
|
|
|
|
} while(addr != end);
|
|
|
|
} else if (size > dcache_size) {
|
|
|
|
tx39_blast_dcache();
|
|
|
|
} else {
|
2006-02-09 15:39:06 +00:00
|
|
|
blast_inv_dcache_range(addr, addr + size);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void tx39_flush_cache_sigtramp(unsigned long addr)
|
|
|
|
{
|
|
|
|
unsigned long ic_lsize = current_cpu_data.icache.linesz;
|
|
|
|
unsigned long dc_lsize = current_cpu_data.dcache.linesz;
|
|
|
|
unsigned long config;
|
|
|
|
unsigned long flags;
|
|
|
|
|
|
|
|
protected_writeback_dcache_line(addr & ~(dc_lsize - 1));
|
|
|
|
|
|
|
|
/* disable icache (set ICE#) */
|
|
|
|
local_irq_save(flags);
|
|
|
|
config = read_c0_conf();
|
|
|
|
write_c0_conf(config & ~TX39_CONF_ICE);
|
|
|
|
TX39_STOP_STREAMING();
|
|
|
|
protected_flush_icache_line(addr & ~(ic_lsize - 1));
|
|
|
|
write_c0_conf(config);
|
|
|
|
local_irq_restore(flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
static __init void tx39_probe_cache(void)
|
|
|
|
{
|
|
|
|
unsigned long config;
|
|
|
|
|
|
|
|
config = read_c0_conf();
|
|
|
|
|
|
|
|
icache_size = 1 << (10 + ((config & TX39_CONF_ICS_MASK) >>
|
|
|
|
TX39_CONF_ICS_SHIFT));
|
|
|
|
dcache_size = 1 << (10 + ((config & TX39_CONF_DCS_MASK) >>
|
|
|
|
TX39_CONF_DCS_SHIFT));
|
|
|
|
|
|
|
|
current_cpu_data.icache.linesz = 16;
|
2007-10-11 22:46:15 +00:00
|
|
|
switch (current_cpu_type()) {
|
2005-04-16 22:20:36 +00:00
|
|
|
case CPU_TX3912:
|
|
|
|
current_cpu_data.icache.ways = 1;
|
|
|
|
current_cpu_data.dcache.ways = 1;
|
|
|
|
current_cpu_data.dcache.linesz = 4;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CPU_TX3927:
|
|
|
|
current_cpu_data.icache.ways = 2;
|
|
|
|
current_cpu_data.dcache.ways = 2;
|
|
|
|
current_cpu_data.dcache.linesz = 16;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CPU_TX3922:
|
|
|
|
default:
|
|
|
|
current_cpu_data.icache.ways = 1;
|
|
|
|
current_cpu_data.dcache.ways = 1;
|
|
|
|
current_cpu_data.dcache.linesz = 16;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code
commit 3747069b25e419f6b51395f48127e9812abc3596 upstream.
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications. For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.
After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out. Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.
Note that some harmless section mismatch warnings may result, since
notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
and are flagged as __cpuinit -- so if we remove the __cpuinit from
the arch specific callers, we will also get section mismatch warnings.
As an intermediate step, we intend to turn the linux/init.h cpuinit
related content into no-ops as early as possible, since that will get
rid of these warnings. In any case, they are temporary and harmless.
Here, we remove all the MIPS __cpuinit from C code and __CPUINIT
from asm files. MIPS is interesting in this respect, because there
are also uasm users hiding behind their own renamed versions of the
__cpuinit macros.
[1] https://lkml.org/lkml/2013/5/20/589
[ralf@linux-mips.org: Folded in Paul's followup fix.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5494/
Patchwork: https://patchwork.linux-mips.org/patch/5495/
Patchwork: https://patchwork.linux-mips.org/patch/5509/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-06-18 13:38:59 +00:00
|
|
|
void tx39_cache_init(void)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
extern void build_clear_page(void);
|
|
|
|
extern void build_copy_page(void);
|
|
|
|
unsigned long config;
|
|
|
|
|
|
|
|
config = read_c0_conf();
|
|
|
|
config &= ~TX39_CONF_WBON;
|
|
|
|
write_c0_conf(config);
|
|
|
|
|
|
|
|
tx39_probe_cache();
|
|
|
|
|
2007-10-11 22:46:15 +00:00
|
|
|
switch (current_cpu_type()) {
|
2005-04-16 22:20:36 +00:00
|
|
|
case CPU_TX3912:
|
|
|
|
/* TX39/H core (writethru direct-map cache) */
|
2008-04-05 14:13:23 +00:00
|
|
|
__flush_cache_vmap = tx39__flush_cache_vmap;
|
|
|
|
__flush_cache_vunmap = tx39__flush_cache_vunmap;
|
2013-01-22 11:59:30 +00:00
|
|
|
flush_cache_all = tx39h_flush_icache_all;
|
2005-04-16 22:20:36 +00:00
|
|
|
__flush_cache_all = tx39h_flush_icache_all;
|
|
|
|
flush_cache_mm = (void *) tx39h_flush_icache_all;
|
|
|
|
flush_cache_range = (void *) tx39h_flush_icache_all;
|
|
|
|
flush_cache_page = (void *) tx39h_flush_icache_all;
|
|
|
|
flush_icache_range = (void *) tx39h_flush_icache_all;
|
2008-08-04 18:53:57 +00:00
|
|
|
local_flush_icache_range = (void *) tx39h_flush_icache_all;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
flush_cache_sigtramp = (void *) tx39h_flush_icache_all;
|
2006-04-05 19:42:04 +00:00
|
|
|
local_flush_data_cache_page = (void *) tx39h_flush_icache_all;
|
2005-04-16 22:20:36 +00:00
|
|
|
flush_data_cache_page = (void *) tx39h_flush_icache_all;
|
|
|
|
|
|
|
|
_dma_cache_wback_inv = tx39h_dma_cache_wback_inv;
|
|
|
|
|
|
|
|
shm_align_mask = PAGE_SIZE - 1;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CPU_TX3922:
|
|
|
|
case CPU_TX3927:
|
|
|
|
default:
|
|
|
|
/* TX39/H2,H3 core (writeback 2way-set-associative cache) */
|
|
|
|
/* board-dependent init code may set WBON */
|
|
|
|
|
2008-04-05 14:13:23 +00:00
|
|
|
__flush_cache_vmap = tx39__flush_cache_vmap;
|
|
|
|
__flush_cache_vunmap = tx39__flush_cache_vunmap;
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
flush_cache_all = tx39_flush_cache_all;
|
|
|
|
__flush_cache_all = tx39___flush_cache_all;
|
|
|
|
flush_cache_mm = tx39_flush_cache_mm;
|
|
|
|
flush_cache_range = tx39_flush_cache_range;
|
|
|
|
flush_cache_page = tx39_flush_cache_page;
|
|
|
|
flush_icache_range = tx39_flush_icache_range;
|
2008-08-26 13:30:41 +00:00
|
|
|
local_flush_icache_range = tx39_flush_icache_range;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2011-06-17 15:20:28 +00:00
|
|
|
__flush_kernel_vmap_range = tx39_flush_kernel_vmap_range;
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
flush_cache_sigtramp = tx39_flush_cache_sigtramp;
|
2006-04-05 19:42:04 +00:00
|
|
|
local_flush_data_cache_page = local_tx39_flush_data_cache_page;
|
2005-04-16 22:20:36 +00:00
|
|
|
flush_data_cache_page = tx39_flush_data_cache_page;
|
|
|
|
|
|
|
|
_dma_cache_wback_inv = tx39_dma_cache_wback_inv;
|
|
|
|
_dma_cache_wback = tx39_dma_cache_wback_inv;
|
|
|
|
_dma_cache_inv = tx39_dma_cache_inv;
|
|
|
|
|
|
|
|
shm_align_mask = max_t(unsigned long,
|
2013-01-22 11:59:30 +00:00
|
|
|
(dcache_size / current_cpu_data.dcache.ways) - 1,
|
|
|
|
PAGE_SIZE - 1);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2016-09-01 16:30:11 +00:00
|
|
|
__flush_icache_user_range = flush_icache_range;
|
|
|
|
__local_flush_icache_user_range = local_flush_icache_range;
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
current_cpu_data.icache.waysize = icache_size / current_cpu_data.icache.ways;
|
|
|
|
current_cpu_data.dcache.waysize = dcache_size / current_cpu_data.dcache.ways;
|
|
|
|
|
|
|
|
current_cpu_data.icache.sets =
|
|
|
|
current_cpu_data.icache.waysize / current_cpu_data.icache.linesz;
|
|
|
|
current_cpu_data.dcache.sets =
|
|
|
|
current_cpu_data.dcache.waysize / current_cpu_data.dcache.linesz;
|
|
|
|
|
|
|
|
if (current_cpu_data.dcache.waysize > PAGE_SIZE)
|
|
|
|
current_cpu_data.dcache.flags |= MIPS_CACHE_ALIASES;
|
|
|
|
|
|
|
|
current_cpu_data.icache.waybit = 0;
|
|
|
|
current_cpu_data.dcache.waybit = 0;
|
|
|
|
|
|
|
|
printk("Primary instruction cache %ldkB, linesize %d bytes\n",
|
|
|
|
icache_size >> 10, current_cpu_data.icache.linesz);
|
|
|
|
printk("Primary data cache %ldkB, linesize %d bytes\n",
|
|
|
|
dcache_size >> 10, current_cpu_data.dcache.linesz);
|
|
|
|
|
|
|
|
build_clear_page();
|
|
|
|
build_copy_page();
|
2005-07-15 15:23:23 +00:00
|
|
|
tx39h_flush_icache_all();
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|