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
|
2011-03-22 11:39:27 +08:00
|
|
|
/*
|
|
|
|
* linux/arch/m68k/kernel/setup.c
|
|
|
|
*
|
|
|
|
* Copyright (C) 1995 Hamish Macdonald
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file handles the architecture-dependent parts of system setup
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/mm.h>
|
|
|
|
#include <linux/sched.h>
|
|
|
|
#include <linux/delay.h>
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/fs.h>
|
|
|
|
#include <linux/console.h>
|
|
|
|
#include <linux/genhd.h>
|
|
|
|
#include <linux/errno.h>
|
|
|
|
#include <linux/string.h>
|
|
|
|
#include <linux/init.h>
|
2018-07-04 14:28:16 +08:00
|
|
|
#include <linux/memblock.h>
|
2011-03-22 11:39:27 +08:00
|
|
|
#include <linux/proc_fs.h>
|
|
|
|
#include <linux/seq_file.h>
|
|
|
|
#include <linux/module.h>
|
2019-01-15 12:18:56 +08:00
|
|
|
#include <linux/nvram.h>
|
2011-03-22 11:39:27 +08:00
|
|
|
#include <linux/initrd.h>
|
|
|
|
|
|
|
|
#include <asm/bootinfo.h>
|
2013-10-04 17:41:24 +08:00
|
|
|
#include <asm/byteorder.h>
|
2011-03-22 11:39:27 +08:00
|
|
|
#include <asm/sections.h>
|
|
|
|
#include <asm/setup.h>
|
|
|
|
#include <asm/fpu.h>
|
|
|
|
#include <asm/irq.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
#include <asm/machdep.h>
|
|
|
|
#ifdef CONFIG_AMIGA
|
|
|
|
#include <asm/amigahw.h>
|
|
|
|
#endif
|
|
|
|
#include <asm/atarihw.h>
|
2019-01-15 12:18:56 +08:00
|
|
|
#ifdef CONFIG_ATARI
|
2011-03-22 11:39:27 +08:00
|
|
|
#include <asm/atari_stram.h>
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_SUN3X
|
|
|
|
#include <asm/dvma.h>
|
|
|
|
#endif
|
2019-01-15 12:18:56 +08:00
|
|
|
#include <asm/macintosh.h>
|
2011-03-22 11:39:27 +08:00
|
|
|
#include <asm/natfeat.h>
|
|
|
|
|
|
|
|
#if !FPSTATESIZE || !NR_IRQS
|
|
|
|
#warning No CPU/platform type selected, your kernel will not work!
|
|
|
|
#warning Are you building an allnoconfig kernel?
|
|
|
|
#endif
|
|
|
|
|
|
|
|
unsigned long m68k_machtype;
|
|
|
|
EXPORT_SYMBOL(m68k_machtype);
|
|
|
|
unsigned long m68k_cputype;
|
|
|
|
EXPORT_SYMBOL(m68k_cputype);
|
|
|
|
unsigned long m68k_fputype;
|
|
|
|
unsigned long m68k_mmutype;
|
|
|
|
EXPORT_SYMBOL(m68k_mmutype);
|
|
|
|
#ifdef CONFIG_VME
|
|
|
|
unsigned long vme_brdtype;
|
|
|
|
EXPORT_SYMBOL(vme_brdtype);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int m68k_is040or060;
|
|
|
|
EXPORT_SYMBOL(m68k_is040or060);
|
|
|
|
|
|
|
|
extern unsigned long availmem;
|
|
|
|
|
|
|
|
int m68k_num_memory;
|
|
|
|
EXPORT_SYMBOL(m68k_num_memory);
|
|
|
|
int m68k_realnum_memory;
|
|
|
|
EXPORT_SYMBOL(m68k_realnum_memory);
|
|
|
|
unsigned long m68k_memoffset;
|
2013-10-03 03:50:56 +08:00
|
|
|
struct m68k_mem_info m68k_memory[NUM_MEMINFO];
|
2011-03-22 11:39:27 +08:00
|
|
|
EXPORT_SYMBOL(m68k_memory);
|
|
|
|
|
2013-10-03 03:50:56 +08:00
|
|
|
static struct m68k_mem_info m68k_ramdisk __initdata;
|
2011-03-22 11:39:27 +08:00
|
|
|
|
2013-06-26 03:15:24 +08:00
|
|
|
static char m68k_command_line[CL_SIZE] __initdata;
|
2011-03-22 11:39:27 +08:00
|
|
|
|
|
|
|
void (*mach_sched_init) (irq_handler_t handler) __initdata = NULL;
|
|
|
|
/* machine dependent irq functions */
|
|
|
|
void (*mach_init_IRQ) (void) __initdata = NULL;
|
|
|
|
void (*mach_get_model) (char *model);
|
|
|
|
void (*mach_get_hardware_list) (struct seq_file *m);
|
|
|
|
/* machine dependent timer functions */
|
|
|
|
int (*mach_hwclk) (int, struct rtc_time*);
|
|
|
|
EXPORT_SYMBOL(mach_hwclk);
|
|
|
|
unsigned int (*mach_get_ss)(void);
|
|
|
|
int (*mach_get_rtc_pll)(struct rtc_pll_info *);
|
|
|
|
int (*mach_set_rtc_pll)(struct rtc_pll_info *);
|
|
|
|
EXPORT_SYMBOL(mach_get_ss);
|
|
|
|
EXPORT_SYMBOL(mach_get_rtc_pll);
|
|
|
|
EXPORT_SYMBOL(mach_set_rtc_pll);
|
|
|
|
void (*mach_reset)( void );
|
|
|
|
void (*mach_halt)( void );
|
|
|
|
void (*mach_power_off)( void );
|
|
|
|
long mach_max_dma_address = 0x00ffffff; /* default set to the lower 16MB */
|
|
|
|
#ifdef CONFIG_HEARTBEAT
|
|
|
|
void (*mach_heartbeat) (int);
|
|
|
|
EXPORT_SYMBOL(mach_heartbeat);
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_M68K_L2_CACHE
|
|
|
|
void (*mach_l2_flush) (int);
|
|
|
|
#endif
|
|
|
|
#if defined(CONFIG_ISA) && defined(MULTI_ISA)
|
|
|
|
int isa_type;
|
|
|
|
int isa_sex;
|
|
|
|
EXPORT_SYMBOL(isa_type);
|
|
|
|
EXPORT_SYMBOL(isa_sex);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern int amiga_parse_bootinfo(const struct bi_record *);
|
|
|
|
extern int atari_parse_bootinfo(const struct bi_record *);
|
|
|
|
extern int mac_parse_bootinfo(const struct bi_record *);
|
|
|
|
extern int q40_parse_bootinfo(const struct bi_record *);
|
|
|
|
extern int bvme6000_parse_bootinfo(const struct bi_record *);
|
|
|
|
extern int mvme16x_parse_bootinfo(const struct bi_record *);
|
|
|
|
extern int mvme147_parse_bootinfo(const struct bi_record *);
|
|
|
|
extern int hp300_parse_bootinfo(const struct bi_record *);
|
|
|
|
extern int apollo_parse_bootinfo(const struct bi_record *);
|
|
|
|
|
|
|
|
extern void config_amiga(void);
|
|
|
|
extern void config_atari(void);
|
|
|
|
extern void config_mac(void);
|
|
|
|
extern void config_sun3(void);
|
|
|
|
extern void config_apollo(void);
|
|
|
|
extern void config_mvme147(void);
|
|
|
|
extern void config_mvme16x(void);
|
|
|
|
extern void config_bvme6000(void);
|
|
|
|
extern void config_hp300(void);
|
|
|
|
extern void config_q40(void);
|
|
|
|
extern void config_sun3x(void);
|
|
|
|
|
|
|
|
#define MASK_256K 0xfffc0000
|
|
|
|
|
|
|
|
extern void paging_init(void);
|
|
|
|
|
|
|
|
static void __init m68k_parse_bootinfo(const struct bi_record *record)
|
|
|
|
{
|
2013-10-04 17:41:24 +08:00
|
|
|
uint16_t tag;
|
|
|
|
|
2013-08-22 04:36:32 +08:00
|
|
|
save_bootinfo(record);
|
|
|
|
|
2013-10-04 17:41:24 +08:00
|
|
|
while ((tag = be16_to_cpu(record->tag)) != BI_LAST) {
|
2011-03-22 11:39:27 +08:00
|
|
|
int unknown = 0;
|
2013-10-04 17:41:24 +08:00
|
|
|
const void *data = record->data;
|
|
|
|
uint16_t size = be16_to_cpu(record->size);
|
2011-03-22 11:39:27 +08:00
|
|
|
|
2013-10-04 17:41:24 +08:00
|
|
|
switch (tag) {
|
2011-03-22 11:39:27 +08:00
|
|
|
case BI_MACHTYPE:
|
|
|
|
case BI_CPUTYPE:
|
|
|
|
case BI_FPUTYPE:
|
|
|
|
case BI_MMUTYPE:
|
|
|
|
/* Already set up by head.S */
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BI_MEMCHUNK:
|
|
|
|
if (m68k_num_memory < NUM_MEMINFO) {
|
2013-10-04 17:41:24 +08:00
|
|
|
const struct mem_info *m = data;
|
|
|
|
m68k_memory[m68k_num_memory].addr =
|
|
|
|
be32_to_cpu(m->addr);
|
|
|
|
m68k_memory[m68k_num_memory].size =
|
|
|
|
be32_to_cpu(m->size);
|
2011-03-22 11:39:27 +08:00
|
|
|
m68k_num_memory++;
|
|
|
|
} else
|
2013-06-26 19:15:58 +08:00
|
|
|
pr_warn("%s: too many memory chunks\n",
|
|
|
|
__func__);
|
2011-03-22 11:39:27 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case BI_RAMDISK:
|
2013-10-04 17:41:24 +08:00
|
|
|
{
|
|
|
|
const struct mem_info *m = data;
|
|
|
|
m68k_ramdisk.addr = be32_to_cpu(m->addr);
|
|
|
|
m68k_ramdisk.size = be32_to_cpu(m->size);
|
|
|
|
}
|
2011-03-22 11:39:27 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case BI_COMMAND_LINE:
|
2013-10-04 17:41:24 +08:00
|
|
|
strlcpy(m68k_command_line, data,
|
2011-03-22 11:39:27 +08:00
|
|
|
sizeof(m68k_command_line));
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
if (MACH_IS_AMIGA)
|
|
|
|
unknown = amiga_parse_bootinfo(record);
|
|
|
|
else if (MACH_IS_ATARI)
|
|
|
|
unknown = atari_parse_bootinfo(record);
|
|
|
|
else if (MACH_IS_MAC)
|
|
|
|
unknown = mac_parse_bootinfo(record);
|
|
|
|
else if (MACH_IS_Q40)
|
|
|
|
unknown = q40_parse_bootinfo(record);
|
|
|
|
else if (MACH_IS_BVME6000)
|
|
|
|
unknown = bvme6000_parse_bootinfo(record);
|
|
|
|
else if (MACH_IS_MVME16x)
|
|
|
|
unknown = mvme16x_parse_bootinfo(record);
|
|
|
|
else if (MACH_IS_MVME147)
|
|
|
|
unknown = mvme147_parse_bootinfo(record);
|
|
|
|
else if (MACH_IS_HP300)
|
|
|
|
unknown = hp300_parse_bootinfo(record);
|
|
|
|
else if (MACH_IS_APOLLO)
|
|
|
|
unknown = apollo_parse_bootinfo(record);
|
|
|
|
else
|
|
|
|
unknown = 1;
|
|
|
|
}
|
|
|
|
if (unknown)
|
2013-06-26 19:15:58 +08:00
|
|
|
pr_warn("%s: unknown tag 0x%04x ignored\n", __func__,
|
2013-10-04 17:41:24 +08:00
|
|
|
tag);
|
|
|
|
record = (struct bi_record *)((unsigned long)record + size);
|
2011-03-22 11:39:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
m68k_realnum_memory = m68k_num_memory;
|
|
|
|
#ifdef CONFIG_SINGLE_MEMORY_CHUNK
|
|
|
|
if (m68k_num_memory > 1) {
|
2013-06-26 19:15:58 +08:00
|
|
|
pr_warn("%s: ignoring last %i chunks of physical memory\n",
|
|
|
|
__func__, (m68k_num_memory - 1));
|
2011-03-22 11:39:27 +08:00
|
|
|
m68k_num_memory = 1;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void __init setup_arch(char **cmdline_p)
|
|
|
|
{
|
2013-09-09 15:00:50 +08:00
|
|
|
/* The bootinfo is located right after the kernel */
|
2011-10-19 09:50:34 +08:00
|
|
|
if (!CPU_IS_COLDFIRE)
|
|
|
|
m68k_parse_bootinfo((const struct bi_record *)_end);
|
2011-03-22 11:39:27 +08:00
|
|
|
|
|
|
|
if (CPU_IS_040)
|
|
|
|
m68k_is040or060 = 4;
|
|
|
|
else if (CPU_IS_060)
|
|
|
|
m68k_is040or060 = 6;
|
|
|
|
|
|
|
|
/* FIXME: m68k_fputype is passed in by Penguin booter, which can
|
|
|
|
* be confused by software FPU emulation. BEWARE.
|
|
|
|
* We should really do our own FPU check at startup.
|
|
|
|
* [what do we do with buggy 68LC040s? if we have problems
|
|
|
|
* with them, we should add a test to check_bugs() below] */
|
2016-08-29 15:01:24 +08:00
|
|
|
#if defined(CONFIG_FPU) && !defined(CONFIG_M68KFPU_EMU_ONLY)
|
2011-03-22 11:39:27 +08:00
|
|
|
/* clear the fpu if we have one */
|
2011-10-19 12:10:03 +08:00
|
|
|
if (m68k_fputype & (FPU_68881|FPU_68882|FPU_68040|FPU_68060|FPU_COLDFIRE)) {
|
2011-03-22 11:39:27 +08:00
|
|
|
volatile int zero = 0;
|
|
|
|
asm volatile ("frestore %0" : : "m" (zero));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (CPU_IS_060) {
|
|
|
|
u32 pcr;
|
|
|
|
|
|
|
|
asm (".chip 68060; movec %%pcr,%0; .chip 68k"
|
|
|
|
: "=d" (pcr));
|
|
|
|
if (((pcr >> 8) & 0xff) <= 5) {
|
2013-06-26 19:15:58 +08:00
|
|
|
pr_warn("Enabling workaround for errata I14\n");
|
2011-03-22 11:39:27 +08:00
|
|
|
asm (".chip 68060; movec %0,%%pcr; .chip 68k"
|
|
|
|
: : "d" (pcr | 0x20));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
init_mm.start_code = PAGE_OFFSET;
|
|
|
|
init_mm.end_code = (unsigned long)_etext;
|
|
|
|
init_mm.end_data = (unsigned long)_edata;
|
|
|
|
init_mm.brk = (unsigned long)_end;
|
|
|
|
|
2011-10-19 09:46:03 +08:00
|
|
|
#if defined(CONFIG_BOOTPARAM)
|
|
|
|
strncpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE);
|
|
|
|
m68k_command_line[CL_SIZE - 1] = 0;
|
|
|
|
#endif /* CONFIG_BOOTPARAM */
|
2016-09-05 13:23:50 +08:00
|
|
|
process_uboot_commandline(&m68k_command_line[0], CL_SIZE);
|
2011-03-22 11:39:27 +08:00
|
|
|
*cmdline_p = m68k_command_line;
|
|
|
|
memcpy(boot_command_line, *cmdline_p, CL_SIZE);
|
|
|
|
|
|
|
|
parse_early_param();
|
|
|
|
|
|
|
|
#ifdef CONFIG_DUMMY_CONSOLE
|
|
|
|
conswitchp = &dummy_con;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
switch (m68k_machtype) {
|
|
|
|
#ifdef CONFIG_AMIGA
|
|
|
|
case MACH_AMIGA:
|
|
|
|
config_amiga();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_ATARI
|
|
|
|
case MACH_ATARI:
|
|
|
|
config_atari();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_MAC
|
|
|
|
case MACH_MAC:
|
|
|
|
config_mac();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_SUN3
|
|
|
|
case MACH_SUN3:
|
|
|
|
config_sun3();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_APOLLO
|
|
|
|
case MACH_APOLLO:
|
|
|
|
config_apollo();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_MVME147
|
|
|
|
case MACH_MVME147:
|
|
|
|
config_mvme147();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_MVME16x
|
|
|
|
case MACH_MVME16x:
|
|
|
|
config_mvme16x();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_BVME6000
|
|
|
|
case MACH_BVME6000:
|
|
|
|
config_bvme6000();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_HP300
|
|
|
|
case MACH_HP300:
|
|
|
|
config_hp300();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_Q40
|
|
|
|
case MACH_Q40:
|
|
|
|
config_q40();
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_SUN3X
|
|
|
|
case MACH_SUN3X:
|
|
|
|
config_sun3x();
|
|
|
|
break;
|
2011-10-19 09:50:34 +08:00
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_COLDFIRE
|
|
|
|
case MACH_M54XX:
|
2016-08-25 21:10:59 +08:00
|
|
|
case MACH_M5441X:
|
2017-09-05 20:48:42 +08:00
|
|
|
cf_bootmem_alloc();
|
|
|
|
cf_mmu_context_init();
|
2011-10-19 09:50:34 +08:00
|
|
|
config_BSP(NULL, 0);
|
|
|
|
break;
|
2011-03-22 11:39:27 +08:00
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
panic("No configuration setup");
|
|
|
|
}
|
|
|
|
|
2013-10-18 15:05:22 +08:00
|
|
|
paging_init();
|
|
|
|
|
2011-03-22 11:39:27 +08:00
|
|
|
#ifdef CONFIG_NATFEAT
|
|
|
|
nf_init();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CONFIG_SUN3
|
|
|
|
#ifdef CONFIG_BLK_DEV_INITRD
|
|
|
|
if (m68k_ramdisk.size) {
|
2018-07-04 14:28:16 +08:00
|
|
|
memblock_reserve(m68k_ramdisk.addr, m68k_ramdisk.size);
|
2011-03-22 11:39:27 +08:00
|
|
|
initrd_start = (unsigned long)phys_to_virt(m68k_ramdisk.addr);
|
|
|
|
initrd_end = initrd_start + m68k_ramdisk.size;
|
2013-06-26 19:15:58 +08:00
|
|
|
pr_info("initrd: %08lx - %08lx\n", initrd_start, initrd_end);
|
2011-03-22 11:39:27 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_ATARI
|
|
|
|
if (MACH_IS_ATARI)
|
|
|
|
atari_stram_reserve_pages((void *)availmem);
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_SUN3X
|
|
|
|
if (MACH_IS_SUN3X) {
|
|
|
|
dvma_init();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* !CONFIG_SUN3 */
|
|
|
|
|
|
|
|
/* set ISA defs early as possible */
|
|
|
|
#if defined(CONFIG_ISA) && defined(MULTI_ISA)
|
|
|
|
if (MACH_IS_Q40) {
|
|
|
|
isa_type = ISA_TYPE_Q40;
|
|
|
|
isa_sex = 0;
|
|
|
|
}
|
|
|
|
#ifdef CONFIG_AMIGA_PCMCIA
|
|
|
|
if (MACH_IS_AMIGA && AMIGAHW_PRESENT(PCMCIA)) {
|
|
|
|
isa_type = ISA_TYPE_AG;
|
|
|
|
isa_sex = 1;
|
|
|
|
}
|
|
|
|
#endif
|
2013-04-06 08:26:35 +08:00
|
|
|
#ifdef CONFIG_ATARI_ROM_ISA
|
|
|
|
if (MACH_IS_ATARI) {
|
|
|
|
isa_type = ISA_TYPE_ENEC;
|
|
|
|
isa_sex = 0;
|
|
|
|
}
|
|
|
|
#endif
|
2011-03-22 11:39:27 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static int show_cpuinfo(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
const char *cpu, *mmu, *fpu;
|
|
|
|
unsigned long clockfreq, clockfactor;
|
|
|
|
|
|
|
|
#define LOOP_CYCLES_68020 (8)
|
|
|
|
#define LOOP_CYCLES_68030 (8)
|
|
|
|
#define LOOP_CYCLES_68040 (3)
|
|
|
|
#define LOOP_CYCLES_68060 (1)
|
2011-10-14 09:39:04 +08:00
|
|
|
#define LOOP_CYCLES_COLDFIRE (2)
|
2011-03-22 11:39:27 +08:00
|
|
|
|
|
|
|
if (CPU_IS_020) {
|
|
|
|
cpu = "68020";
|
|
|
|
clockfactor = LOOP_CYCLES_68020;
|
|
|
|
} else if (CPU_IS_030) {
|
|
|
|
cpu = "68030";
|
|
|
|
clockfactor = LOOP_CYCLES_68030;
|
|
|
|
} else if (CPU_IS_040) {
|
|
|
|
cpu = "68040";
|
|
|
|
clockfactor = LOOP_CYCLES_68040;
|
|
|
|
} else if (CPU_IS_060) {
|
|
|
|
cpu = "68060";
|
|
|
|
clockfactor = LOOP_CYCLES_68060;
|
2011-10-14 09:39:04 +08:00
|
|
|
} else if (CPU_IS_COLDFIRE) {
|
|
|
|
cpu = "ColdFire";
|
|
|
|
clockfactor = LOOP_CYCLES_COLDFIRE;
|
2011-03-22 11:39:27 +08:00
|
|
|
} else {
|
|
|
|
cpu = "680x0";
|
|
|
|
clockfactor = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef CONFIG_M68KFPU_EMU_ONLY
|
|
|
|
fpu = "none(soft float)";
|
|
|
|
#else
|
|
|
|
if (m68k_fputype & FPU_68881)
|
|
|
|
fpu = "68881";
|
|
|
|
else if (m68k_fputype & FPU_68882)
|
|
|
|
fpu = "68882";
|
|
|
|
else if (m68k_fputype & FPU_68040)
|
|
|
|
fpu = "68040";
|
|
|
|
else if (m68k_fputype & FPU_68060)
|
|
|
|
fpu = "68060";
|
|
|
|
else if (m68k_fputype & FPU_SUNFPA)
|
|
|
|
fpu = "Sun FPA";
|
2011-10-14 09:39:04 +08:00
|
|
|
else if (m68k_fputype & FPU_COLDFIRE)
|
|
|
|
fpu = "ColdFire";
|
2011-03-22 11:39:27 +08:00
|
|
|
else
|
|
|
|
fpu = "none";
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (m68k_mmutype & MMU_68851)
|
|
|
|
mmu = "68851";
|
|
|
|
else if (m68k_mmutype & MMU_68030)
|
|
|
|
mmu = "68030";
|
|
|
|
else if (m68k_mmutype & MMU_68040)
|
|
|
|
mmu = "68040";
|
|
|
|
else if (m68k_mmutype & MMU_68060)
|
|
|
|
mmu = "68060";
|
|
|
|
else if (m68k_mmutype & MMU_SUN3)
|
|
|
|
mmu = "Sun-3";
|
|
|
|
else if (m68k_mmutype & MMU_APOLLO)
|
|
|
|
mmu = "Apollo";
|
2011-10-14 09:39:04 +08:00
|
|
|
else if (m68k_mmutype & MMU_COLDFIRE)
|
|
|
|
mmu = "ColdFire";
|
2011-03-22 11:39:27 +08:00
|
|
|
else
|
|
|
|
mmu = "unknown";
|
|
|
|
|
|
|
|
clockfreq = loops_per_jiffy * HZ * clockfactor;
|
|
|
|
|
|
|
|
seq_printf(m, "CPU:\t\t%s\n"
|
|
|
|
"MMU:\t\t%s\n"
|
|
|
|
"FPU:\t\t%s\n"
|
|
|
|
"Clocking:\t%lu.%1luMHz\n"
|
|
|
|
"BogoMips:\t%lu.%02lu\n"
|
|
|
|
"Calibration:\t%lu loops\n",
|
|
|
|
cpu, mmu, fpu,
|
|
|
|
clockfreq/1000000,(clockfreq/100000)%10,
|
|
|
|
loops_per_jiffy/(500000/HZ),(loops_per_jiffy/(5000/HZ))%100,
|
|
|
|
loops_per_jiffy);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void *c_start(struct seq_file *m, loff_t *pos)
|
|
|
|
{
|
|
|
|
return *pos < 1 ? (void *)1 : NULL;
|
|
|
|
}
|
|
|
|
static void *c_next(struct seq_file *m, void *v, loff_t *pos)
|
|
|
|
{
|
|
|
|
++*pos;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
static void c_stop(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
const struct seq_operations cpuinfo_op = {
|
|
|
|
.start = c_start,
|
|
|
|
.next = c_next,
|
|
|
|
.stop = c_stop,
|
|
|
|
.show = show_cpuinfo,
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef CONFIG_PROC_HARDWARE
|
|
|
|
static int hardware_proc_show(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
char model[80];
|
|
|
|
unsigned long mem;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (mach_get_model)
|
|
|
|
mach_get_model(model);
|
|
|
|
else
|
|
|
|
strcpy(model, "Unknown m68k");
|
|
|
|
|
|
|
|
seq_printf(m, "Model:\t\t%s\n", model);
|
|
|
|
for (mem = 0, i = 0; i < m68k_num_memory; i++)
|
|
|
|
mem += m68k_memory[i].size;
|
|
|
|
seq_printf(m, "System Memory:\t%ldK\n", mem >> 10);
|
|
|
|
|
|
|
|
if (mach_get_hardware_list)
|
|
|
|
mach_get_hardware_list(m);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int __init proc_hardware_init(void)
|
|
|
|
{
|
2018-05-15 21:57:23 +08:00
|
|
|
proc_create_single("hardware", 0, NULL, hardware_proc_show);
|
2011-03-22 11:39:27 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
module_init(proc_hardware_init);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void check_bugs(void)
|
|
|
|
{
|
2016-08-29 15:12:32 +08:00
|
|
|
#if defined(CONFIG_FPU) && !defined(CONFIG_M68KFPU_EMU)
|
2011-03-22 11:39:27 +08:00
|
|
|
if (m68k_fputype == 0) {
|
2013-06-26 19:15:58 +08:00
|
|
|
pr_emerg("*** YOU DO NOT HAVE A FLOATING POINT UNIT, "
|
2011-03-22 11:39:27 +08:00
|
|
|
"WHICH IS REQUIRED BY LINUX/M68K ***\n");
|
2013-06-26 19:15:58 +08:00
|
|
|
pr_emerg("Upgrade your hardware or join the FPU "
|
2011-03-22 11:39:27 +08:00
|
|
|
"emulation project\n");
|
|
|
|
panic("no FPU");
|
|
|
|
}
|
|
|
|
#endif /* !CONFIG_M68KFPU_EMU */
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef CONFIG_ADB
|
|
|
|
static int __init adb_probe_sync_enable (char *str) {
|
|
|
|
extern int __adb_probe_sync;
|
|
|
|
__adb_probe_sync = 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
__setup("adb_sync", adb_probe_sync_enable);
|
|
|
|
#endif /* CONFIG_ADB */
|
2019-01-15 12:18:56 +08:00
|
|
|
|
|
|
|
#if IS_ENABLED(CONFIG_NVRAM)
|
|
|
|
#ifdef CONFIG_MAC
|
|
|
|
static unsigned char m68k_nvram_read_byte(int addr)
|
|
|
|
{
|
|
|
|
if (MACH_IS_MAC)
|
|
|
|
return mac_pram_read_byte(addr);
|
|
|
|
return 0xff;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void m68k_nvram_write_byte(unsigned char val, int addr)
|
|
|
|
{
|
|
|
|
if (MACH_IS_MAC)
|
|
|
|
mac_pram_write_byte(val, addr);
|
|
|
|
}
|
|
|
|
#endif /* CONFIG_MAC */
|
|
|
|
|
|
|
|
#ifdef CONFIG_ATARI
|
|
|
|
static ssize_t m68k_nvram_read(char *buf, size_t count, loff_t *ppos)
|
|
|
|
{
|
|
|
|
if (MACH_IS_ATARI)
|
|
|
|
return atari_nvram_read(buf, count, ppos);
|
|
|
|
else if (MACH_IS_MAC)
|
|
|
|
return nvram_read_bytes(buf, count, ppos);
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ssize_t m68k_nvram_write(char *buf, size_t count, loff_t *ppos)
|
|
|
|
{
|
|
|
|
if (MACH_IS_ATARI)
|
|
|
|
return atari_nvram_write(buf, count, ppos);
|
|
|
|
else if (MACH_IS_MAC)
|
|
|
|
return nvram_write_bytes(buf, count, ppos);
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static long m68k_nvram_set_checksum(void)
|
|
|
|
{
|
|
|
|
if (MACH_IS_ATARI)
|
|
|
|
return atari_nvram_set_checksum();
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static long m68k_nvram_initialize(void)
|
|
|
|
{
|
|
|
|
if (MACH_IS_ATARI)
|
|
|
|
return atari_nvram_initialize();
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
#endif /* CONFIG_ATARI */
|
|
|
|
|
|
|
|
static ssize_t m68k_nvram_get_size(void)
|
|
|
|
{
|
|
|
|
if (MACH_IS_ATARI)
|
|
|
|
return atari_nvram_get_size();
|
|
|
|
else if (MACH_IS_MAC)
|
|
|
|
return mac_pram_get_size();
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Atari device drivers call .read (to get checksum validation) whereas
|
|
|
|
* Mac and PowerMac device drivers just use .read_byte.
|
|
|
|
*/
|
|
|
|
const struct nvram_ops arch_nvram_ops = {
|
|
|
|
#ifdef CONFIG_MAC
|
|
|
|
.read_byte = m68k_nvram_read_byte,
|
|
|
|
.write_byte = m68k_nvram_write_byte,
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_ATARI
|
|
|
|
.read = m68k_nvram_read,
|
|
|
|
.write = m68k_nvram_write,
|
|
|
|
.set_checksum = m68k_nvram_set_checksum,
|
|
|
|
.initialize = m68k_nvram_initialize,
|
|
|
|
#endif
|
|
|
|
.get_size = m68k_nvram_get_size,
|
|
|
|
};
|
|
|
|
EXPORT_SYMBOL(arch_nvram_ops);
|
|
|
|
#endif /* CONFIG_NVRAM */
|