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 22:07:57 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2008-11-06 22:40:46 +08:00
|
|
|
#include <variant/core.h>
|
2006-12-10 18:18:48 +08:00
|
|
|
#include <asm/regs.h>
|
|
|
|
#include <asm/asmmacro.h>
|
|
|
|
#include <asm/cacheasm.h>
|
2005-06-24 13:01:12 +08:00
|
|
|
/*
|
|
|
|
* RB-Data: RedBoot data/bss
|
|
|
|
* P: Boot-Parameters
|
|
|
|
* L: Kernel-Loader
|
|
|
|
*
|
|
|
|
* The Linux-Kernel image including the loader must be loaded
|
|
|
|
* to a position so that the kernel and the boot parameters
|
|
|
|
* can fit in the space before the load address.
|
|
|
|
* ______________________________________________________
|
|
|
|
* |_RB-Data_|_P_|__________|_L_|___Linux-Kernel___|______|
|
|
|
|
* ^
|
|
|
|
* ^ Load address
|
|
|
|
* ______________________________________________________
|
|
|
|
* |___Linux-Kernel___|_P_|_L_|___________________________|
|
|
|
|
*
|
|
|
|
* The loader copies the parameter to the position that will
|
|
|
|
* be the end of the kernel and itself to the end of the
|
|
|
|
* parameter list.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Make sure we have enough space for the 'uncompressor' */
|
|
|
|
|
|
|
|
#define STACK_SIZE 32768
|
|
|
|
#define HEAP_SIZE (131072*4)
|
|
|
|
|
|
|
|
# a2: Parameter list
|
|
|
|
# a3: Size of parameter list
|
|
|
|
|
|
|
|
.section .start, "ax"
|
|
|
|
|
|
|
|
.globl __start
|
|
|
|
/* this must be the first byte of the loader! */
|
|
|
|
__start:
|
|
|
|
entry sp, 32 # we do not intend to return
|
|
|
|
_call0 _start
|
|
|
|
__start_a0:
|
|
|
|
.align 4
|
|
|
|
|
|
|
|
.section .text, "ax"
|
2017-12-04 12:55:35 +08:00
|
|
|
.literal_position
|
2005-06-24 13:01:12 +08:00
|
|
|
.begin literal_prefix .text
|
|
|
|
|
|
|
|
/* put literals in here! */
|
|
|
|
|
|
|
|
.globl _start
|
|
|
|
_start:
|
|
|
|
|
|
|
|
/* 'reset' window registers */
|
|
|
|
|
|
|
|
movi a4, 1
|
2012-10-15 07:55:38 +08:00
|
|
|
wsr a4, ps
|
2005-06-24 13:01:12 +08:00
|
|
|
rsync
|
|
|
|
|
2012-10-15 07:55:38 +08:00
|
|
|
rsr a5, windowbase
|
2005-06-24 13:01:12 +08:00
|
|
|
ssl a5
|
|
|
|
sll a4, a4
|
2012-10-15 07:55:38 +08:00
|
|
|
wsr a4, windowstart
|
2005-06-24 13:01:12 +08:00
|
|
|
rsync
|
|
|
|
|
|
|
|
movi a4, 0x00040000
|
2012-10-15 07:55:38 +08:00
|
|
|
wsr a4, ps
|
2005-06-24 13:01:12 +08:00
|
|
|
rsync
|
|
|
|
|
|
|
|
/* copy the loader to its address
|
|
|
|
* Note: The loader itself is a very small piece, so we assume we
|
|
|
|
* don't partially overlap. We also assume (even more important)
|
|
|
|
* that the kernel image is out of the way. Usually, when the
|
|
|
|
* load address of this image is not at an arbitrary address,
|
|
|
|
* but aligned to some 10K's we shouldn't overlap.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Note: The assembler cannot relax "addi a0, a0, ..." to an
|
|
|
|
l32r, so we load to a4 first. */
|
|
|
|
|
2006-12-10 18:18:48 +08:00
|
|
|
# addi a4, a0, __start - __start_a0
|
|
|
|
# mov a0, a4
|
|
|
|
|
|
|
|
movi a4, __start
|
|
|
|
movi a5, __start_a0
|
|
|
|
add a4, a0, a4
|
|
|
|
sub a0, a4, a5
|
|
|
|
|
2005-06-24 13:01:12 +08:00
|
|
|
movi a4, __start
|
|
|
|
movi a5, __reloc_end
|
|
|
|
|
|
|
|
# a0: address where this code has been loaded
|
|
|
|
# a4: compiled address of __start
|
|
|
|
# a5: compiled end address
|
|
|
|
|
|
|
|
mov.n a7, a0
|
|
|
|
mov.n a8, a4
|
|
|
|
|
|
|
|
1:
|
|
|
|
l32i a10, a7, 0
|
|
|
|
l32i a11, a7, 4
|
|
|
|
s32i a10, a8, 0
|
|
|
|
s32i a11, a8, 4
|
|
|
|
l32i a10, a7, 8
|
|
|
|
l32i a11, a7, 12
|
|
|
|
s32i a10, a8, 8
|
|
|
|
s32i a11, a8, 12
|
|
|
|
addi a8, a8, 16
|
|
|
|
addi a7, a7, 16
|
|
|
|
blt a8, a5, 1b
|
|
|
|
|
|
|
|
|
|
|
|
/* We have to flush and invalidate the caches here before we jump. */
|
|
|
|
|
|
|
|
#if XCHAL_DCACHE_IS_WRITEBACK
|
2006-12-10 18:18:48 +08:00
|
|
|
|
|
|
|
___flush_dcache_all a5 a6
|
|
|
|
|
2005-06-24 13:01:12 +08:00
|
|
|
#endif
|
2006-12-10 18:18:48 +08:00
|
|
|
|
|
|
|
___invalidate_icache_all a5 a6
|
|
|
|
isync
|
2005-06-24 13:01:12 +08:00
|
|
|
|
|
|
|
movi a11, _reloc
|
|
|
|
jx a11
|
|
|
|
|
|
|
|
.globl _reloc
|
|
|
|
_reloc:
|
|
|
|
|
|
|
|
/* RedBoot is now at the end of the memory, so we don't have
|
|
|
|
* to copy the parameter list. Keep the code around; in case
|
|
|
|
* we need it again. */
|
|
|
|
#if 0
|
|
|
|
# a0: load address
|
|
|
|
# a2: start address of parameter list
|
|
|
|
# a3: length of parameter list
|
|
|
|
# a4: __start
|
|
|
|
|
|
|
|
/* copy the parameter list out of the way */
|
|
|
|
|
|
|
|
movi a6, _param_start
|
|
|
|
add a3, a2, a3
|
|
|
|
2:
|
|
|
|
l32i a8, a2, 0
|
|
|
|
s32i a8, a6, 0
|
|
|
|
addi a2, a2, 4
|
|
|
|
addi a6, a6, 4
|
|
|
|
blt a2, a3, 2b
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* clear BSS section */
|
|
|
|
movi a6, __bss_start
|
|
|
|
movi a7, __bss_end
|
|
|
|
movi.n a5, 0
|
|
|
|
3:
|
|
|
|
s32i a5, a6, 0
|
|
|
|
addi a6, a6, 4
|
|
|
|
blt a6, a7, 3b
|
|
|
|
|
|
|
|
movi a5, -16
|
|
|
|
movi a1, _stack + STACK_SIZE
|
|
|
|
and a1, a1, a5
|
|
|
|
|
|
|
|
/* Uncompress the kernel */
|
|
|
|
|
|
|
|
# a0: load address
|
|
|
|
# a2: boot parameter
|
|
|
|
# a4: __start
|
|
|
|
|
|
|
|
movi a3, __image_load
|
|
|
|
sub a4, a3, a4
|
|
|
|
add a8, a0, a4
|
|
|
|
|
|
|
|
# a1 Stack
|
|
|
|
# a8(a4) Load address of the image
|
|
|
|
|
|
|
|
movi a6, _image_start
|
|
|
|
movi a10, _image_end
|
|
|
|
movi a7, 0x1000000
|
|
|
|
sub a11, a10, a6
|
|
|
|
movi a9, complen
|
|
|
|
s32i a11, a9, 0
|
|
|
|
|
|
|
|
movi a0, 0
|
|
|
|
|
|
|
|
# a6 destination
|
|
|
|
# a7 maximum size of destination
|
|
|
|
# a8 source
|
|
|
|
# a9 ptr to length
|
|
|
|
|
|
|
|
.extern gunzip
|
|
|
|
movi a4, gunzip
|
|
|
|
beqz a4, 1f
|
|
|
|
|
|
|
|
callx4 a4
|
|
|
|
|
|
|
|
j 2f
|
|
|
|
|
|
|
|
|
|
|
|
# a6 destination start
|
|
|
|
# a7 maximum size of destination
|
|
|
|
# a8 source start
|
|
|
|
# a9 ptr to length
|
|
|
|
# a10 destination end
|
|
|
|
|
|
|
|
1:
|
|
|
|
l32i a9, a8, 0
|
|
|
|
l32i a11, a8, 4
|
|
|
|
s32i a9, a6, 0
|
|
|
|
s32i a11, a6, 4
|
|
|
|
l32i a9, a8, 8
|
|
|
|
l32i a11, a8, 12
|
|
|
|
s32i a9, a6, 8
|
|
|
|
s32i a11, a6, 12
|
|
|
|
addi a6, a6, 16
|
|
|
|
addi a8, a8, 16
|
|
|
|
blt a6, a10, 1b
|
|
|
|
|
|
|
|
|
|
|
|
/* jump to the kernel */
|
|
|
|
2:
|
|
|
|
#if XCHAL_DCACHE_IS_WRITEBACK
|
2006-12-10 18:18:48 +08:00
|
|
|
|
|
|
|
___flush_dcache_all a5 a6
|
|
|
|
|
2005-06-24 13:01:12 +08:00
|
|
|
#endif
|
2006-12-10 18:18:48 +08:00
|
|
|
|
|
|
|
___invalidate_icache_all a5 a6
|
|
|
|
|
|
|
|
isync
|
2005-06-24 13:01:12 +08:00
|
|
|
|
|
|
|
# a2 Boot parameter list
|
|
|
|
|
|
|
|
movi a0, _image_start
|
|
|
|
jx a0
|
|
|
|
|
|
|
|
.align 16
|
|
|
|
.data
|
|
|
|
.globl avail_ram
|
|
|
|
avail_ram:
|
|
|
|
.long _heap
|
|
|
|
.globl end_avail
|
|
|
|
end_avail:
|
|
|
|
.long _heap + HEAP_SIZE
|
|
|
|
|
|
|
|
.comm _stack, STACK_SIZE
|
|
|
|
.comm _heap, HEAP_SIZE
|
|
|
|
|
|
|
|
.globl end_avail
|
|
|
|
.comm complen, 4
|
|
|
|
|
|
|
|
.end literal_prefix
|