You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle: - Minor updates and fixes to the Octeon ethernet driver in staging - A fix to VGA_MAP_MEM() for 64 bit platforms - Fix a workaround for 74K/1074K processors - The symlink arch/mips/boot/dts/include/dt-bindings was pointing to a a file with a name ending in \n. I think this may have been caused by a git bug with with patches sent by email - A build fix for VGA console on BCM1480-based systems - Fix PCI device access via "/sys/bus/pci/.../resource0" or similar work for Alchemy platforms - Fix potential data leak on MIPS R5 cores. This doesn't add proper support for any R5 features, just ensures a kernel without such support will be secure to run - Adding a macros for the CP0 Config5 register to be used by the R5 fix - Make get_cycles() actually return something useful where possible This also requires a preparatory patch for performance sake - Fix a warning about the use of smp_processor_id() in preemptible code. Again this includes a preparatory patch adding the infrastructure to be used by the actual patch - Finally remove pointless one-line comment * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: MIPS: Fix invalid symbolic link file MIPS: PCI: pci-bcm1480: Include missing vt.h header MIPS: Disable usermode switching of the FR bit for MIPS R5 CPUs. MIPS: Add MIPS R5 config5 register. MIPS: PCI: Use pci_resource_to_user to map pci memory space properly MIPS: 74K/1074K: Correct erratum workaround. MIPS: Cleanup CP0 PRId and CP1 FPIR register access masks MIPS: Remove useless comment about kprobe from arch/mips/Makefile MIPS: Fix VGA_MAP_MEM macro. MIPS: Reimplement get_cycles(). MIPS: Optimize current_cpu_type() for better code. MIPS: Fix accessing to per-cpu data when flushing the cache MIPS: Provide nice way to access boot CPU's data. staging: octeon-ethernet: rgmii: enable interrupts that we can handle staging: octeon-ethernet: remove skb alloc failure warnings staging: octeon-ethernet: make dropped packets to consume NAPI budget
This commit is contained in:
@@ -288,9 +288,6 @@ endif
|
||||
vmlinux.32: vmlinux
|
||||
$(OBJCOPY) -O $(32bit-bfd) $(OBJCOPYFLAGS) $< $@
|
||||
|
||||
|
||||
#obj-$(CONFIG_KPROBES) += kprobes.o
|
||||
|
||||
#
|
||||
# The 64-bit ELF tools are pretty broken so at this time we generate 64-bit
|
||||
# ELF files from 32-bit files by conversion.
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/syscore_ops.h>
|
||||
#include <asm/cpu.h>
|
||||
#include <asm/mach-au1x00/au1000.h>
|
||||
|
||||
/* control register offsets */
|
||||
@@ -358,7 +359,7 @@ static inline int au1200_coherency_bug(void)
|
||||
{
|
||||
#if defined(CONFIG_DMA_COHERENT)
|
||||
/* Au1200 AB USB does not support coherent memory */
|
||||
if (!(read_c0_prid() & 0xff)) {
|
||||
if (!(read_c0_prid() & PRID_REV_MASK)) {
|
||||
printk(KERN_INFO "Au1200 USB: this is chip revision AB !!\n");
|
||||
printk(KERN_INFO "Au1200 USB: update your board or re-configure"
|
||||
" the kernel\n");
|
||||
|
||||
@@ -306,14 +306,14 @@ void __init bcm63xx_cpu_init(void)
|
||||
|
||||
switch (c->cputype) {
|
||||
case CPU_BMIPS3300:
|
||||
if ((read_c0_prid() & 0xff00) != PRID_IMP_BMIPS3300_ALT)
|
||||
if ((read_c0_prid() & PRID_IMP_MASK) != PRID_IMP_BMIPS3300_ALT)
|
||||
__cpu_name[cpu] = "Broadcom BCM6338";
|
||||
/* fall-through */
|
||||
case CPU_BMIPS32:
|
||||
chipid_reg = BCM_6345_PERF_BASE;
|
||||
break;
|
||||
case CPU_BMIPS4350:
|
||||
switch ((read_c0_prid() & 0xff)) {
|
||||
switch ((read_c0_prid() & PRID_REV_MASK)) {
|
||||
case 0x04:
|
||||
chipid_reg = BCM_3368_PERF_BASE;
|
||||
break;
|
||||
|
||||
@@ -1 +1 @@
|
||||
../../../../../include/dt-bindings
|
||||
../../../../../include/dt-bindings
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <linux/smp.h>
|
||||
|
||||
#include <asm/cpu-info.h>
|
||||
#include <asm/cpu-type.h>
|
||||
#include <asm/time.h>
|
||||
|
||||
#include <asm/octeon/octeon.h>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include <asm/bootinfo.h>
|
||||
#include <asm/cpu.h>
|
||||
#include <asm/cpu-type.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
#include <asm/dec/prom.h>
|
||||
|
||||
@@ -13,12 +13,6 @@
|
||||
#include <asm/cpu-info.h>
|
||||
#include <cpu-feature-overrides.h>
|
||||
|
||||
#ifndef current_cpu_type
|
||||
#define current_cpu_type() current_cpu_data.cputype
|
||||
#endif
|
||||
|
||||
#define boot_cpu_type() cpu_data[0].cputype
|
||||
|
||||
/*
|
||||
* SMP assumption: Options of CPU 0 are a superset of all processors.
|
||||
* This is true for all known MIPS systems.
|
||||
|
||||
@@ -84,6 +84,7 @@ struct cpuinfo_mips {
|
||||
extern struct cpuinfo_mips cpu_data[];
|
||||
#define current_cpu_data cpu_data[smp_processor_id()]
|
||||
#define raw_current_cpu_data cpu_data[raw_smp_processor_id()]
|
||||
#define boot_cpu_data cpu_data[0]
|
||||
|
||||
extern void cpu_probe(void);
|
||||
extern void cpu_report(void);
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
/*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 2003, 2004 Ralf Baechle
|
||||
* Copyright (C) 2004 Maciej W. Rozycki
|
||||
*/
|
||||
#ifndef __ASM_CPU_TYPE_H
|
||||
#define __ASM_CPU_TYPE_H
|
||||
|
||||
#include <linux/smp.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
static inline int __pure __get_cpu_type(const int cpu_type)
|
||||
{
|
||||
switch (cpu_type) {
|
||||
#if defined(CONFIG_SYS_HAS_CPU_LOONGSON2E) || \
|
||||
defined(CONFIG_SYS_HAS_CPU_LOONGSON2F)
|
||||
case CPU_LOONGSON2:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_LOONGSON1B
|
||||
case CPU_LOONGSON1:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_MIPS32_R1
|
||||
case CPU_4KC:
|
||||
case CPU_ALCHEMY:
|
||||
case CPU_BMIPS3300:
|
||||
case CPU_BMIPS4350:
|
||||
case CPU_PR4450:
|
||||
case CPU_BMIPS32:
|
||||
case CPU_JZRISC:
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SYS_HAS_CPU_MIPS32_R1) || \
|
||||
defined(CONFIG_SYS_HAS_CPU_MIPS32_R2)
|
||||
case CPU_4KEC:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_MIPS32_R2
|
||||
case CPU_4KSC:
|
||||
case CPU_24K:
|
||||
case CPU_34K:
|
||||
case CPU_1004K:
|
||||
case CPU_74K:
|
||||
case CPU_M14KC:
|
||||
case CPU_M14KEC:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_MIPS64_R1
|
||||
case CPU_5KC:
|
||||
case CPU_5KE:
|
||||
case CPU_20KC:
|
||||
case CPU_25KF:
|
||||
case CPU_SB1:
|
||||
case CPU_SB1A:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_MIPS64_R2
|
||||
/*
|
||||
* All MIPS64 R2 processors have their own special symbols. That is,
|
||||
* there currently is no pure R2 core
|
||||
*/
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_R3000
|
||||
case CPU_R2000:
|
||||
case CPU_R3000:
|
||||
case CPU_R3000A:
|
||||
case CPU_R3041:
|
||||
case CPU_R3051:
|
||||
case CPU_R3052:
|
||||
case CPU_R3081:
|
||||
case CPU_R3081E:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_TX39XX
|
||||
case CPU_TX3912:
|
||||
case CPU_TX3922:
|
||||
case CPU_TX3927:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_VR41XX
|
||||
case CPU_VR41XX:
|
||||
case CPU_VR4111:
|
||||
case CPU_VR4121:
|
||||
case CPU_VR4122:
|
||||
case CPU_VR4131:
|
||||
case CPU_VR4133:
|
||||
case CPU_VR4181:
|
||||
case CPU_VR4181A:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_R4300
|
||||
case CPU_R4300:
|
||||
case CPU_R4310:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_R4X00
|
||||
case CPU_R4000PC:
|
||||
case CPU_R4000SC:
|
||||
case CPU_R4000MC:
|
||||
case CPU_R4200:
|
||||
case CPU_R4400PC:
|
||||
case CPU_R4400SC:
|
||||
case CPU_R4400MC:
|
||||
case CPU_R4600:
|
||||
case CPU_R4700:
|
||||
case CPU_R4640:
|
||||
case CPU_R4650:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_TX49XX
|
||||
case CPU_TX49XX:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_R5000
|
||||
case CPU_R5000:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_R5432
|
||||
case CPU_R5432:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_R5500
|
||||
case CPU_R5500:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_R6000
|
||||
case CPU_R6000:
|
||||
case CPU_R6000A:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_NEVADA
|
||||
case CPU_NEVADA:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_R8000
|
||||
case CPU_R8000:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_R10000
|
||||
case CPU_R10000:
|
||||
case CPU_R12000:
|
||||
case CPU_R14000:
|
||||
#endif
|
||||
#ifdef CONFIG_SYS_HAS_CPU_RM7000
|
||||
case CPU_RM7000:
|
||||
case CPU_SR71000:
|
||||
#endif
|
||||
#ifdef CONFIG_SYS_HAS_CPU_RM9000
|
||||
case CPU_RM9000:
|
||||
#endif
|
||||
#ifdef CONFIG_SYS_HAS_CPU_SB1
|
||||
case CPU_SB1:
|
||||
case CPU_SB1A:
|
||||
#endif
|
||||
#ifdef CONFIG_SYS_HAS_CPU_CAVIUM_OCTEON
|
||||
case CPU_CAVIUM_OCTEON:
|
||||
case CPU_CAVIUM_OCTEON_PLUS:
|
||||
case CPU_CAVIUM_OCTEON2:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_BMIPS4380
|
||||
case CPU_BMIPS4380:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_BMIPS5000
|
||||
case CPU_BMIPS5000:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_XLP
|
||||
case CPU_XLP:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_HAS_CPU_XLR
|
||||
case CPU_XLR:
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
unreachable();
|
||||
}
|
||||
|
||||
return cpu_type;
|
||||
}
|
||||
|
||||
static inline int __pure current_cpu_type(void)
|
||||
{
|
||||
const int cpu_type = current_cpu_data.cputype;
|
||||
|
||||
return __get_cpu_type(cpu_type);
|
||||
}
|
||||
|
||||
static inline int __pure boot_cpu_type(void)
|
||||
{
|
||||
const int cpu_type = cpu_data[0].cputype;
|
||||
|
||||
return __get_cpu_type(cpu_type);
|
||||
}
|
||||
|
||||
#endif /* __ASM_CPU_TYPE_H */
|
||||
@@ -3,15 +3,14 @@
|
||||
* various MIPS cpu types.
|
||||
*
|
||||
* Copyright (C) 1996 David S. Miller (davem@davemloft.net)
|
||||
* Copyright (C) 2004 Maciej W. Rozycki
|
||||
* Copyright (C) 2004, 2013 Maciej W. Rozycki
|
||||
*/
|
||||
#ifndef _ASM_CPU_H
|
||||
#define _ASM_CPU_H
|
||||
|
||||
/* Assigned Company values for bits 23:16 of the PRId Register
|
||||
(CP0 register 15, select 0). As of the MIPS32 and MIPS64 specs from
|
||||
MTI, the PRId register is defined in this (backwards compatible)
|
||||
way:
|
||||
/*
|
||||
As of the MIPS32 and MIPS64 specs from MTI, the PRId register (CP0
|
||||
register 15, select 0) is defined in this (backwards compatible) way:
|
||||
|
||||
+----------------+----------------+----------------+----------------+
|
||||
| Company Options| Company ID | Processor ID | Revision |
|
||||
@@ -23,6 +22,14 @@
|
||||
spec.
|
||||
*/
|
||||
|
||||
#define PRID_OPT_MASK 0xff000000
|
||||
|
||||
/*
|
||||
* Assigned Company values for bits 23:16 of the PRId register.
|
||||
*/
|
||||
|
||||
#define PRID_COMP_MASK 0xff0000
|
||||
|
||||
#define PRID_COMP_LEGACY 0x000000
|
||||
#define PRID_COMP_MIPS 0x010000
|
||||
#define PRID_COMP_BROADCOM 0x020000
|
||||
@@ -38,10 +45,17 @@
|
||||
#define PRID_COMP_INGENIC 0xd00000
|
||||
|
||||
/*
|
||||
* Assigned values for the product ID register. In order to detect a
|
||||
* certain CPU type exactly eventually additional registers may need to
|
||||
* be examined. These are valid when 23:16 == PRID_COMP_LEGACY
|
||||
* Assigned Processor ID (implementation) values for bits 15:8 of the PRId
|
||||
* register. In order to detect a certain CPU type exactly eventually
|
||||
* additional registers may need to be examined.
|
||||
*/
|
||||
|
||||
#define PRID_IMP_MASK 0xff00
|
||||
|
||||
/*
|
||||
* These are valid when 23:16 == PRID_COMP_LEGACY
|
||||
*/
|
||||
|
||||
#define PRID_IMP_R2000 0x0100
|
||||
#define PRID_IMP_AU1_REV1 0x0100
|
||||
#define PRID_IMP_AU1_REV2 0x0200
|
||||
@@ -182,11 +196,15 @@
|
||||
#define PRID_IMP_NETLOGIC_XLP2XX 0x1200
|
||||
|
||||
/*
|
||||
* Definitions for 7:0 on legacy processors
|
||||
* Particular Revision values for bits 7:0 of the PRId register.
|
||||
*/
|
||||
|
||||
#define PRID_REV_MASK 0x00ff
|
||||
|
||||
/*
|
||||
* Definitions for 7:0 on legacy processors
|
||||
*/
|
||||
|
||||
#define PRID_REV_TX4927 0x0022
|
||||
#define PRID_REV_TX4937 0x0030
|
||||
#define PRID_REV_R4400 0x0040
|
||||
@@ -227,6 +245,8 @@
|
||||
* 31 16 15 8 7 0
|
||||
*/
|
||||
|
||||
#define FPIR_IMP_MASK 0xff00
|
||||
|
||||
#define FPIR_IMP_NONE 0x0000
|
||||
|
||||
enum cpu_type_enum {
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
#include <linux/io.h>
|
||||
#include <linux/irq.h>
|
||||
|
||||
#include <asm/cpu.h>
|
||||
|
||||
/* cpu pipeline flush */
|
||||
void static inline au_sync(void)
|
||||
{
|
||||
@@ -140,7 +142,7 @@ static inline int au1xxx_cpu_needs_config_od(void)
|
||||
|
||||
static inline int alchemy_get_cputype(void)
|
||||
{
|
||||
switch (read_c0_prid() & 0xffff0000) {
|
||||
switch (read_c0_prid() & (PRID_OPT_MASK | PRID_COMP_MASK)) {
|
||||
case 0x00030000:
|
||||
return ALCHEMY_CPU_AU1000;
|
||||
break;
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H
|
||||
#define __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H
|
||||
|
||||
#include <asm/cpu.h>
|
||||
|
||||
/*
|
||||
* IP22 with a variety of processors so we can't use defaults for everything.
|
||||
*/
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#ifndef __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H
|
||||
#define __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H
|
||||
|
||||
#include <asm/cpu.h>
|
||||
|
||||
/*
|
||||
* IP27 only comes with R10000 family processors all using the same config
|
||||
*/
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#ifndef __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H
|
||||
#define __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H
|
||||
|
||||
#include <asm/cpu.h>
|
||||
|
||||
/*
|
||||
* IP28 only comes with R10000 family processors all using the same config
|
||||
*/
|
||||
|
||||
@@ -603,6 +603,13 @@
|
||||
#define MIPS_CONF4_MMUEXTDEF (_ULCAST_(3) << 14)
|
||||
#define MIPS_CONF4_MMUEXTDEF_MMUSIZEEXT (_ULCAST_(1) << 14)
|
||||
|
||||
#define MIPS_CONF5_NF (_ULCAST_(1) << 0)
|
||||
#define MIPS_CONF5_UFR (_ULCAST_(1) << 2)
|
||||
#define MIPS_CONF5_MSAEN (_ULCAST_(1) << 27)
|
||||
#define MIPS_CONF5_EVA (_ULCAST_(1) << 28)
|
||||
#define MIPS_CONF5_CV (_ULCAST_(1) << 29)
|
||||
#define MIPS_CONF5_K (_ULCAST_(1) << 30)
|
||||
|
||||
#define MIPS_CONF6_SYND (_ULCAST_(1) << 13)
|
||||
|
||||
#define MIPS_CONF7_WII (_ULCAST_(1) << 31)
|
||||
|
||||
@@ -83,6 +83,18 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
|
||||
extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
|
||||
enum pci_mmap_state mmap_state, int write_combine);
|
||||
|
||||
#define HAVE_ARCH_PCI_RESOURCE_TO_USER
|
||||
|
||||
static inline void pci_resource_to_user(const struct pci_dev *dev, int bar,
|
||||
const struct resource *rsrc, resource_size_t *start,
|
||||
resource_size_t *end)
|
||||
{
|
||||
phys_t size = resource_size(rsrc);
|
||||
|
||||
*start = fixup_bigphys_addr(rsrc->start, size);
|
||||
*end = rsrc->start + size;
|
||||
}
|
||||
|
||||
/*
|
||||
* Dynamic DMA mapping stuff.
|
||||
* MIPS has everything mapped statically.
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <asm/cpu-features.h>
|
||||
#include <asm/mipsregs.h>
|
||||
#include <asm/cpu-type.h>
|
||||
|
||||
/*
|
||||
* This is the clock rate of the i8253 PIT. A MIPS system may not have
|
||||
@@ -33,9 +35,38 @@
|
||||
|
||||
typedef unsigned int cycles_t;
|
||||
|
||||
/*
|
||||
* On R4000/R4400 before version 5.0 an erratum exists such that if the
|
||||
* cycle counter is read in the exact moment that it is matching the
|
||||
* compare register, no interrupt will be generated.
|
||||
*
|
||||
* There is a suggested workaround and also the erratum can't strike if
|
||||
* the compare interrupt isn't being used as the clock source device.
|
||||
* However for now the implementaton of this function doesn't get these
|
||||
* fine details right.
|
||||
*/
|
||||
static inline cycles_t get_cycles(void)
|
||||
{
|
||||
return 0;
|
||||
switch (boot_cpu_type()) {
|
||||
case CPU_R4400PC:
|
||||
case CPU_R4400SC:
|
||||
case CPU_R4400MC:
|
||||
if ((read_c0_prid() & 0xff) >= 0x0050)
|
||||
return read_c0_count();
|
||||
break;
|
||||
|
||||
case CPU_R4000PC:
|
||||
case CPU_R4000SC:
|
||||
case CPU_R4000MC:
|
||||
break;
|
||||
|
||||
default:
|
||||
if (cpu_has_counter)
|
||||
return read_c0_count();
|
||||
break;
|
||||
}
|
||||
|
||||
return 0; /* no usable counter */
|
||||
}
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#ifndef _ASM_VGA_H
|
||||
#define _ASM_VGA_H
|
||||
|
||||
#include <asm/addrspace.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
/*
|
||||
@@ -13,7 +14,7 @@
|
||||
* access the videoram directly without any black magic.
|
||||
*/
|
||||
|
||||
#define VGA_MAP_MEM(x, s) (0xb0000000L + (unsigned long)(x))
|
||||
#define VGA_MAP_MEM(x, s) CKSEG1ADDR(0x10000000L + (unsigned long)(x))
|
||||
|
||||
#define vga_readb(x) (*(x))
|
||||
#define vga_writeb(x, y) (*(y) = (x))
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <asm/bugs.h>
|
||||
#include <asm/cpu.h>
|
||||
#include <asm/cpu-type.h>
|
||||
#include <asm/fpu.h>
|
||||
#include <asm/mipsregs.h>
|
||||
#include <asm/watch.h>
|
||||
@@ -55,7 +56,7 @@ static inline void check_errata(void)
|
||||
{
|
||||
struct cpuinfo_mips *c = ¤t_cpu_data;
|
||||
|
||||
switch (c->cputype) {
|
||||
switch (current_cpu_type()) {
|
||||
case CPU_34K:
|
||||
/*
|
||||
* Erratum "RPS May Cause Incorrect Instruction Execution"
|
||||
@@ -122,7 +123,7 @@ static inline unsigned long cpu_get_fpu_id(void)
|
||||
*/
|
||||
static inline int __cpu_has_fpu(void)
|
||||
{
|
||||
return ((cpu_get_fpu_id() & 0xff00) != FPIR_IMP_NONE);
|
||||
return ((cpu_get_fpu_id() & FPIR_IMP_MASK) != FPIR_IMP_NONE);
|
||||
}
|
||||
|
||||
static inline void cpu_probe_vmbits(struct cpuinfo_mips *c)
|
||||
@@ -290,6 +291,17 @@ static inline unsigned int decode_config4(struct cpuinfo_mips *c)
|
||||
return config4 & MIPS_CONF_M;
|
||||
}
|
||||
|
||||
static inline unsigned int decode_config5(struct cpuinfo_mips *c)
|
||||
{
|
||||
unsigned int config5;
|
||||
|
||||
config5 = read_c0_config5();
|
||||
config5 &= ~MIPS_CONF5_UFR;
|
||||
write_c0_config5(config5);
|
||||
|
||||
return config5 & MIPS_CONF_M;
|
||||
}
|
||||
|
||||
static void decode_configs(struct cpuinfo_mips *c)
|
||||
{
|
||||
int ok;
|
||||
@@ -310,6 +322,8 @@ static void decode_configs(struct cpuinfo_mips *c)
|
||||
ok = decode_config3(c);
|
||||
if (ok)
|
||||
ok = decode_config4(c);
|
||||
if (ok)
|
||||
ok = decode_config5(c);
|
||||
|
||||
mips_probe_watch_registers(c);
|
||||
|
||||
@@ -322,7 +336,7 @@ static void decode_configs(struct cpuinfo_mips *c)
|
||||
|
||||
static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
{
|
||||
switch (c->processor_id & 0xff00) {
|
||||
switch (c->processor_id & PRID_IMP_MASK) {
|
||||
case PRID_IMP_R2000:
|
||||
c->cputype = CPU_R2000;
|
||||
__cpu_name[cpu] = "R2000";
|
||||
@@ -333,7 +347,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
c->tlbsize = 64;
|
||||
break;
|
||||
case PRID_IMP_R3000:
|
||||
if ((c->processor_id & 0xff) == PRID_REV_R3000A) {
|
||||
if ((c->processor_id & PRID_REV_MASK) == PRID_REV_R3000A) {
|
||||
if (cpu_has_confreg()) {
|
||||
c->cputype = CPU_R3081E;
|
||||
__cpu_name[cpu] = "R3081";
|
||||
@@ -353,7 +367,8 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
break;
|
||||
case PRID_IMP_R4000:
|
||||
if (read_c0_config() & CONF_SC) {
|
||||
if ((c->processor_id & 0xff) >= PRID_REV_R4400) {
|
||||
if ((c->processor_id & PRID_REV_MASK) >=
|
||||
PRID_REV_R4400) {
|
||||
c->cputype = CPU_R4400PC;
|
||||
__cpu_name[cpu] = "R4400PC";
|
||||
} else {
|
||||
@@ -361,7 +376,8 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
__cpu_name[cpu] = "R4000PC";
|
||||
}
|
||||
} else {
|
||||
if ((c->processor_id & 0xff) >= PRID_REV_R4400) {
|
||||
if ((c->processor_id & PRID_REV_MASK) >=
|
||||
PRID_REV_R4400) {
|
||||
c->cputype = CPU_R4400SC;
|
||||
__cpu_name[cpu] = "R4400SC";
|
||||
} else {
|
||||
@@ -454,7 +470,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
__cpu_name[cpu] = "TX3927";
|
||||
c->tlbsize = 64;
|
||||
} else {
|
||||
switch (c->processor_id & 0xff) {
|
||||
switch (c->processor_id & PRID_REV_MASK) {
|
||||
case PRID_REV_TX3912:
|
||||
c->cputype = CPU_TX3912;
|
||||
__cpu_name[cpu] = "TX3912";
|
||||
@@ -640,7 +656,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
{
|
||||
decode_configs(c);
|
||||
switch (c->processor_id & 0xff00) {
|
||||
switch (c->processor_id & PRID_IMP_MASK) {
|
||||
case PRID_IMP_4KC:
|
||||
c->cputype = CPU_4KC;
|
||||
__cpu_name[cpu] = "MIPS 4Kc";
|
||||
@@ -711,7 +727,7 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
{
|
||||
decode_configs(c);
|
||||
switch (c->processor_id & 0xff00) {
|
||||
switch (c->processor_id & PRID_IMP_MASK) {
|
||||
case PRID_IMP_AU1_REV1:
|
||||
case PRID_IMP_AU1_REV2:
|
||||
c->cputype = CPU_ALCHEMY;
|
||||
@@ -730,7 +746,7 @@ static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
break;
|
||||
case 4:
|
||||
__cpu_name[cpu] = "Au1200";
|
||||
if ((c->processor_id & 0xff) == 2)
|
||||
if ((c->processor_id & PRID_REV_MASK) == 2)
|
||||
__cpu_name[cpu] = "Au1250";
|
||||
break;
|
||||
case 5:
|
||||
@@ -748,12 +764,12 @@ static inline void cpu_probe_sibyte(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
{
|
||||
decode_configs(c);
|
||||
|
||||
switch (c->processor_id & 0xff00) {
|
||||
switch (c->processor_id & PRID_IMP_MASK) {
|
||||
case PRID_IMP_SB1:
|
||||
c->cputype = CPU_SB1;
|
||||
__cpu_name[cpu] = "SiByte SB1";
|
||||
/* FPU in pass1 is known to have issues. */
|
||||
if ((c->processor_id & 0xff) < 0x02)
|
||||
if ((c->processor_id & PRID_REV_MASK) < 0x02)
|
||||
c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR);
|
||||
break;
|
||||
case PRID_IMP_SB1A:
|
||||
@@ -766,7 +782,7 @@ static inline void cpu_probe_sibyte(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
{
|
||||
decode_configs(c);
|
||||
switch (c->processor_id & 0xff00) {
|
||||
switch (c->processor_id & PRID_IMP_MASK) {
|
||||
case PRID_IMP_SR71000:
|
||||
c->cputype = CPU_SR71000;
|
||||
__cpu_name[cpu] = "Sandcraft SR71000";
|
||||
@@ -779,7 +795,7 @@ static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
static inline void cpu_probe_nxp(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
{
|
||||
decode_configs(c);
|
||||
switch (c->processor_id & 0xff00) {
|
||||
switch (c->processor_id & PRID_IMP_MASK) {
|
||||
case PRID_IMP_PR4450:
|
||||
c->cputype = CPU_PR4450;
|
||||
__cpu_name[cpu] = "Philips PR4450";
|
||||
@@ -791,7 +807,7 @@ static inline void cpu_probe_nxp(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
{
|
||||
decode_configs(c);
|
||||
switch (c->processor_id & 0xff00) {
|
||||
switch (c->processor_id & PRID_IMP_MASK) {
|
||||
case PRID_IMP_BMIPS32_REV4:
|
||||
case PRID_IMP_BMIPS32_REV8:
|
||||
c->cputype = CPU_BMIPS32;
|
||||
@@ -806,7 +822,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
set_elf_platform(cpu, "bmips3300");
|
||||
break;
|
||||
case PRID_IMP_BMIPS43XX: {
|
||||
int rev = c->processor_id & 0xff;
|
||||
int rev = c->processor_id & PRID_REV_MASK;
|
||||
|
||||
if (rev >= PRID_REV_BMIPS4380_LO &&
|
||||
rev <= PRID_REV_BMIPS4380_HI) {
|
||||
@@ -832,7 +848,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
{
|
||||
decode_configs(c);
|
||||
switch (c->processor_id & 0xff00) {
|
||||
switch (c->processor_id & PRID_IMP_MASK) {
|
||||
case PRID_IMP_CAVIUM_CN38XX:
|
||||
case PRID_IMP_CAVIUM_CN31XX:
|
||||
case PRID_IMP_CAVIUM_CN30XX:
|
||||
@@ -875,7 +891,7 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu)
|
||||
decode_configs(c);
|
||||
/* JZRISC does not implement the CP0 counter. */
|
||||
c->options &= ~MIPS_CPU_COUNTER;
|
||||
switch (c->processor_id & 0xff00) {
|
||||
switch (c->processor_id & PRID_IMP_MASK) {
|
||||
case PRID_IMP_JZRISC:
|
||||
c->cputype = CPU_JZRISC;
|
||||
__cpu_name[cpu] = "Ingenic JZRISC";
|
||||
@@ -890,7 +906,7 @@ static inline void cpu_probe_netlogic(struct cpuinfo_mips *c, int cpu)
|
||||
{
|
||||
decode_configs(c);
|
||||
|
||||
if ((c->processor_id & 0xff00) == PRID_IMP_NETLOGIC_AU13XX) {
|
||||
if ((c->processor_id & PRID_IMP_MASK) == PRID_IMP_NETLOGIC_AU13XX) {
|
||||
c->cputype = CPU_ALCHEMY;
|
||||
__cpu_name[cpu] = "Au1300";
|
||||
/* following stuff is not for Alchemy */
|
||||
@@ -905,7 +921,7 @@ static inline void cpu_probe_netlogic(struct cpuinfo_mips *c, int cpu)
|
||||
MIPS_CPU_EJTAG |
|
||||
MIPS_CPU_LLSC);
|
||||
|
||||
switch (c->processor_id & 0xff00) {
|
||||
switch (c->processor_id & PRID_IMP_MASK) {
|
||||
case PRID_IMP_NETLOGIC_XLP2XX:
|
||||
c->cputype = CPU_XLP;
|
||||
__cpu_name[cpu] = "Broadcom XLPII";
|
||||
@@ -984,7 +1000,7 @@ void cpu_probe(void)
|
||||
c->cputype = CPU_UNKNOWN;
|
||||
|
||||
c->processor_id = read_c0_prid();
|
||||
switch (c->processor_id & 0xff0000) {
|
||||
switch (c->processor_id & PRID_COMP_MASK) {
|
||||
case PRID_COMP_LEGACY:
|
||||
cpu_probe_legacy(c, cpu);
|
||||
break;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <linux/sched.h>
|
||||
#include <asm/cpu.h>
|
||||
#include <asm/cpu-info.h>
|
||||
#include <asm/cpu-type.h>
|
||||
#include <asm/idle.h>
|
||||
#include <asm/mipsregs.h>
|
||||
|
||||
@@ -136,7 +137,7 @@ void __init check_wait(void)
|
||||
return;
|
||||
}
|
||||
|
||||
switch (c->cputype) {
|
||||
switch (current_cpu_type()) {
|
||||
case CPU_R3081:
|
||||
case CPU_R3081E:
|
||||
cpu_wait = r3081_wait;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user