Merge remote-tracking branch 'wireless-next/master' into HEAD
This commit is contained in:
commit
04a4e1fdd2
518 changed files with 18941 additions and 5284 deletions
|
@ -359,11 +359,9 @@ struct inode_operations {
|
||||||
ssize_t (*listxattr) (struct dentry *, char *, size_t);
|
ssize_t (*listxattr) (struct dentry *, char *, size_t);
|
||||||
int (*removexattr) (struct dentry *, const char *);
|
int (*removexattr) (struct dentry *, const char *);
|
||||||
void (*update_time)(struct inode *, struct timespec *, int);
|
void (*update_time)(struct inode *, struct timespec *, int);
|
||||||
int (*atomic_open)(struct inode *, struct dentry *,
|
int (*atomic_open)(struct inode *, struct dentry *, struct file *,
|
||||||
|
unsigned open_flag, umode_t create_mode, int *opened);
|
||||||
int (*tmpfile) (struct inode *, struct dentry *, umode_t);
|
int (*tmpfile) (struct inode *, struct dentry *, umode_t);
|
||||||
} ____cacheline_aligned;
|
|
||||||
struct file *, unsigned open_flag,
|
|
||||||
umode_t create_mode, int *opened);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Again, all methods are called without any locks being held, unless
|
Again, all methods are called without any locks being held, unless
|
||||||
|
@ -470,9 +468,11 @@ otherwise noted.
|
||||||
method the filesystem can look up, possibly create and open the file in
|
method the filesystem can look up, possibly create and open the file in
|
||||||
one atomic operation. If it cannot perform this (e.g. the file type
|
one atomic operation. If it cannot perform this (e.g. the file type
|
||||||
turned out to be wrong) it may signal this by returning 1 instead of
|
turned out to be wrong) it may signal this by returning 1 instead of
|
||||||
usual 0 or -ve . This method is only called if the last
|
usual 0 or -ve . This method is only called if the last component is
|
||||||
component is negative or needs lookup. Cached positive dentries are
|
negative or needs lookup. Cached positive dentries are still handled by
|
||||||
still handled by f_op->open().
|
f_op->open(). If the file was created, the FILE_CREATED flag should be
|
||||||
|
set in "opened". In case of O_EXCL the method must only succeed if the
|
||||||
|
file didn't exist and hence FILE_CREATED shall always be set on success.
|
||||||
|
|
||||||
tmpfile: called in the end of O_TMPFILE open(). Optional, equivalent to
|
tmpfile: called in the end of O_TMPFILE open(). Optional, equivalent to
|
||||||
atomically creating, opening and unlinking a file in given directory.
|
atomically creating, opening and unlinking a file in given directory.
|
||||||
|
|
|
@ -1362,6 +1362,12 @@ To add ARP targets:
|
||||||
To remove an ARP target:
|
To remove an ARP target:
|
||||||
# echo -192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
|
# echo -192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
|
||||||
|
|
||||||
|
To configure the interval between learning packet transmits:
|
||||||
|
# echo 12 > /sys/class/net/bond0/bonding/lp_interval
|
||||||
|
NOTE: the lp_inteval is the number of seconds between instances where
|
||||||
|
the bonding driver sends learning packets to each slaves peer switch. The
|
||||||
|
default interval is 1 second.
|
||||||
|
|
||||||
Example Configuration
|
Example Configuration
|
||||||
---------------------
|
---------------------
|
||||||
We begin with the same example that is shown in section 3.3,
|
We begin with the same example that is shown in section 3.3,
|
||||||
|
|
|
@ -66,9 +66,7 @@ rq->cfs.load value, which is the sum of the weights of the tasks queued on the
|
||||||
runqueue.
|
runqueue.
|
||||||
|
|
||||||
CFS maintains a time-ordered rbtree, where all runnable tasks are sorted by the
|
CFS maintains a time-ordered rbtree, where all runnable tasks are sorted by the
|
||||||
p->se.vruntime key (there is a subtraction using rq->cfs.min_vruntime to
|
p->se.vruntime key. CFS picks the "leftmost" task from this tree and sticks to it.
|
||||||
account for possible wraparounds). CFS picks the "leftmost" task from this
|
|
||||||
tree and sticks to it.
|
|
||||||
As the system progresses forwards, the executed tasks are put into the tree
|
As the system progresses forwards, the executed tasks are put into the tree
|
||||||
more and more to the right --- slowly but surely giving a chance for every task
|
more and more to the right --- slowly but surely giving a chance for every task
|
||||||
to become the "leftmost task" and thus get on the CPU within a deterministic
|
to become the "leftmost task" and thus get on the CPU within a deterministic
|
||||||
|
|
|
@ -6816,6 +6816,14 @@ L: linux-hexagon@vger.kernel.org
|
||||||
S: Supported
|
S: Supported
|
||||||
F: arch/hexagon/
|
F: arch/hexagon/
|
||||||
|
|
||||||
|
QUALCOMM WCN36XX WIRELESS DRIVER
|
||||||
|
M: Eugene Krasnikov <k.eugene.e@gmail.com>
|
||||||
|
L: wcn36xx@lists.infradead.org
|
||||||
|
W: http://wireless.kernel.org/en/users/Drivers/wcn36xx
|
||||||
|
T: git git://github.com/KrasnikovEugene/wcn36xx.git
|
||||||
|
S: Supported
|
||||||
|
F: drivers/net/wireless/ath/wcn36xx/
|
||||||
|
|
||||||
QUICKCAM PARALLEL PORT WEBCAMS
|
QUICKCAM PARALLEL PORT WEBCAMS
|
||||||
M: Hans Verkuil <hverkuil@xs4all.nl>
|
M: Hans Verkuil <hverkuil@xs4all.nl>
|
||||||
L: linux-media@vger.kernel.org
|
L: linux-media@vger.kernel.org
|
||||||
|
|
|
@ -288,9 +288,6 @@ endif
|
||||||
vmlinux.32: vmlinux
|
vmlinux.32: vmlinux
|
||||||
$(OBJCOPY) -O $(32bit-bfd) $(OBJCOPYFLAGS) $< $@
|
$(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
|
# The 64-bit ELF tools are pretty broken so at this time we generate 64-bit
|
||||||
# ELF files from 32-bit files by conversion.
|
# ELF files from 32-bit files by conversion.
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/spinlock.h>
|
#include <linux/spinlock.h>
|
||||||
#include <linux/syscore_ops.h>
|
#include <linux/syscore_ops.h>
|
||||||
|
#include <asm/cpu.h>
|
||||||
#include <asm/mach-au1x00/au1000.h>
|
#include <asm/mach-au1x00/au1000.h>
|
||||||
|
|
||||||
/* control register offsets */
|
/* control register offsets */
|
||||||
|
@ -358,7 +359,7 @@ static inline int au1200_coherency_bug(void)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_DMA_COHERENT)
|
#if defined(CONFIG_DMA_COHERENT)
|
||||||
/* Au1200 AB USB does not support coherent memory */
|
/* 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: this is chip revision AB !!\n");
|
||||||
printk(KERN_INFO "Au1200 USB: update your board or re-configure"
|
printk(KERN_INFO "Au1200 USB: update your board or re-configure"
|
||||||
" the kernel\n");
|
" the kernel\n");
|
||||||
|
|
|
@ -306,14 +306,14 @@ void __init bcm63xx_cpu_init(void)
|
||||||
|
|
||||||
switch (c->cputype) {
|
switch (c->cputype) {
|
||||||
case CPU_BMIPS3300:
|
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";
|
__cpu_name[cpu] = "Broadcom BCM6338";
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
case CPU_BMIPS32:
|
case CPU_BMIPS32:
|
||||||
chipid_reg = BCM_6345_PERF_BASE;
|
chipid_reg = BCM_6345_PERF_BASE;
|
||||||
break;
|
break;
|
||||||
case CPU_BMIPS4350:
|
case CPU_BMIPS4350:
|
||||||
switch ((read_c0_prid() & 0xff)) {
|
switch ((read_c0_prid() & PRID_REV_MASK)) {
|
||||||
case 0x04:
|
case 0x04:
|
||||||
chipid_reg = BCM_3368_PERF_BASE;
|
chipid_reg = BCM_3368_PERF_BASE;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <linux/smp.h>
|
#include <linux/smp.h>
|
||||||
|
|
||||||
#include <asm/cpu-info.h>
|
#include <asm/cpu-info.h>
|
||||||
|
#include <asm/cpu-type.h>
|
||||||
#include <asm/time.h>
|
#include <asm/time.h>
|
||||||
|
|
||||||
#include <asm/octeon/octeon.h>
|
#include <asm/octeon/octeon.h>
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include <asm/bootinfo.h>
|
#include <asm/bootinfo.h>
|
||||||
#include <asm/cpu.h>
|
#include <asm/cpu.h>
|
||||||
|
#include <asm/cpu-type.h>
|
||||||
#include <asm/processor.h>
|
#include <asm/processor.h>
|
||||||
|
|
||||||
#include <asm/dec/prom.h>
|
#include <asm/dec/prom.h>
|
||||||
|
|
|
@ -13,12 +13,6 @@
|
||||||
#include <asm/cpu-info.h>
|
#include <asm/cpu-info.h>
|
||||||
#include <cpu-feature-overrides.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.
|
* SMP assumption: Options of CPU 0 are a superset of all processors.
|
||||||
* This is true for all known MIPS systems.
|
* This is true for all known MIPS systems.
|
||||||
|
|
|
@ -84,6 +84,7 @@ struct cpuinfo_mips {
|
||||||
extern struct cpuinfo_mips cpu_data[];
|
extern struct cpuinfo_mips cpu_data[];
|
||||||
#define current_cpu_data cpu_data[smp_processor_id()]
|
#define current_cpu_data cpu_data[smp_processor_id()]
|
||||||
#define raw_current_cpu_data cpu_data[raw_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_probe(void);
|
||||||
extern void cpu_report(void);
|
extern void cpu_report(void);
|
||||||
|
|
203
arch/mips/include/asm/cpu-type.h
Normal file
203
arch/mips/include/asm/cpu-type.h
Normal file
|
@ -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.
|
* various MIPS cpu types.
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996 David S. Miller (davem@davemloft.net)
|
* 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
|
#ifndef _ASM_CPU_H
|
||||||
#define _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
|
As of the MIPS32 and MIPS64 specs from MTI, the PRId register (CP0
|
||||||
MTI, the PRId register is defined in this (backwards compatible)
|
register 15, select 0) is defined in this (backwards compatible) way:
|
||||||
way:
|
|
||||||
|
|
||||||
+----------------+----------------+----------------+----------------+
|
+----------------+----------------+----------------+----------------+
|
||||||
| Company Options| Company ID | Processor ID | Revision |
|
| Company Options| Company ID | Processor ID | Revision |
|
||||||
|
@ -23,6 +22,14 @@
|
||||||
spec.
|
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_LEGACY 0x000000
|
||||||
#define PRID_COMP_MIPS 0x010000
|
#define PRID_COMP_MIPS 0x010000
|
||||||
#define PRID_COMP_BROADCOM 0x020000
|
#define PRID_COMP_BROADCOM 0x020000
|
||||||
|
@ -38,10 +45,17 @@
|
||||||
#define PRID_COMP_INGENIC 0xd00000
|
#define PRID_COMP_INGENIC 0xd00000
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Assigned values for the product ID register. In order to detect a
|
* Assigned Processor ID (implementation) values for bits 15:8 of the PRId
|
||||||
* certain CPU type exactly eventually additional registers may need to
|
* register. In order to detect a certain CPU type exactly eventually
|
||||||
* be examined. These are valid when 23:16 == PRID_COMP_LEGACY
|
* 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_R2000 0x0100
|
||||||
#define PRID_IMP_AU1_REV1 0x0100
|
#define PRID_IMP_AU1_REV1 0x0100
|
||||||
#define PRID_IMP_AU1_REV2 0x0200
|
#define PRID_IMP_AU1_REV2 0x0200
|
||||||
|
@ -182,11 +196,15 @@
|
||||||
#define PRID_IMP_NETLOGIC_XLP2XX 0x1200
|
#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
|
#define PRID_REV_MASK 0x00ff
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Definitions for 7:0 on legacy processors
|
||||||
|
*/
|
||||||
|
|
||||||
#define PRID_REV_TX4927 0x0022
|
#define PRID_REV_TX4927 0x0022
|
||||||
#define PRID_REV_TX4937 0x0030
|
#define PRID_REV_TX4937 0x0030
|
||||||
#define PRID_REV_R4400 0x0040
|
#define PRID_REV_R4400 0x0040
|
||||||
|
@ -227,6 +245,8 @@
|
||||||
* 31 16 15 8 7 0
|
* 31 16 15 8 7 0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define FPIR_IMP_MASK 0xff00
|
||||||
|
|
||||||
#define FPIR_IMP_NONE 0x0000
|
#define FPIR_IMP_NONE 0x0000
|
||||||
|
|
||||||
enum cpu_type_enum {
|
enum cpu_type_enum {
|
||||||
|
|
|
@ -43,6 +43,8 @@
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
#include <linux/irq.h>
|
#include <linux/irq.h>
|
||||||
|
|
||||||
|
#include <asm/cpu.h>
|
||||||
|
|
||||||
/* cpu pipeline flush */
|
/* cpu pipeline flush */
|
||||||
void static inline au_sync(void)
|
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)
|
static inline int alchemy_get_cputype(void)
|
||||||
{
|
{
|
||||||
switch (read_c0_prid() & 0xffff0000) {
|
switch (read_c0_prid() & (PRID_OPT_MASK | PRID_COMP_MASK)) {
|
||||||
case 0x00030000:
|
case 0x00030000:
|
||||||
return ALCHEMY_CPU_AU1000;
|
return ALCHEMY_CPU_AU1000;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
#ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H
|
#ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H
|
||||||
#define __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.
|
* 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
|
#ifndef __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H
|
||||||
#define __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
|
* IP27 only comes with R10000 family processors all using the same config
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
#ifndef __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H
|
#ifndef __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H
|
||||||
#define __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
|
* 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 (_ULCAST_(3) << 14)
|
||||||
#define MIPS_CONF4_MMUEXTDEF_MMUSIZEEXT (_ULCAST_(1) << 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_CONF6_SYND (_ULCAST_(1) << 13)
|
||||||
|
|
||||||
#define MIPS_CONF7_WII (_ULCAST_(1) << 31)
|
#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,
|
extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
|
||||||
enum pci_mmap_state mmap_state, int write_combine);
|
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.
|
* Dynamic DMA mapping stuff.
|
||||||
* MIPS has everything mapped statically.
|
* MIPS has everything mapped statically.
|
||||||
|
|
|
@ -10,7 +10,9 @@
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
|
|
||||||
|
#include <asm/cpu-features.h>
|
||||||
#include <asm/mipsregs.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
|
* This is the clock rate of the i8253 PIT. A MIPS system may not have
|
||||||
|
@ -33,9 +35,38 @@
|
||||||
|
|
||||||
typedef unsigned int cycles_t;
|
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)
|
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__ */
|
#endif /* __KERNEL__ */
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#ifndef _ASM_VGA_H
|
#ifndef _ASM_VGA_H
|
||||||
#define _ASM_VGA_H
|
#define _ASM_VGA_H
|
||||||
|
|
||||||
|
#include <asm/addrspace.h>
|
||||||
#include <asm/byteorder.h>
|
#include <asm/byteorder.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -13,7 +14,7 @@
|
||||||
* access the videoram directly without any black magic.
|
* 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_readb(x) (*(x))
|
||||||
#define vga_writeb(x, y) (*(y) = (x))
|
#define vga_writeb(x, y) (*(y) = (x))
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#include <asm/bugs.h>
|
#include <asm/bugs.h>
|
||||||
#include <asm/cpu.h>
|
#include <asm/cpu.h>
|
||||||
|
#include <asm/cpu-type.h>
|
||||||
#include <asm/fpu.h>
|
#include <asm/fpu.h>
|
||||||
#include <asm/mipsregs.h>
|
#include <asm/mipsregs.h>
|
||||||
#include <asm/watch.h>
|
#include <asm/watch.h>
|
||||||
|
@ -55,7 +56,7 @@ static inline void check_errata(void)
|
||||||
{
|
{
|
||||||
struct cpuinfo_mips *c = ¤t_cpu_data;
|
struct cpuinfo_mips *c = ¤t_cpu_data;
|
||||||
|
|
||||||
switch (c->cputype) {
|
switch (current_cpu_type()) {
|
||||||
case CPU_34K:
|
case CPU_34K:
|
||||||
/*
|
/*
|
||||||
* Erratum "RPS May Cause Incorrect Instruction Execution"
|
* 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)
|
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)
|
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;
|
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)
|
static void decode_configs(struct cpuinfo_mips *c)
|
||||||
{
|
{
|
||||||
int ok;
|
int ok;
|
||||||
|
@ -310,6 +322,8 @@ static void decode_configs(struct cpuinfo_mips *c)
|
||||||
ok = decode_config3(c);
|
ok = decode_config3(c);
|
||||||
if (ok)
|
if (ok)
|
||||||
ok = decode_config4(c);
|
ok = decode_config4(c);
|
||||||
|
if (ok)
|
||||||
|
ok = decode_config5(c);
|
||||||
|
|
||||||
mips_probe_watch_registers(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)
|
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:
|
case PRID_IMP_R2000:
|
||||||
c->cputype = CPU_R2000;
|
c->cputype = CPU_R2000;
|
||||||
__cpu_name[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;
|
c->tlbsize = 64;
|
||||||
break;
|
break;
|
||||||
case PRID_IMP_R3000:
|
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()) {
|
if (cpu_has_confreg()) {
|
||||||
c->cputype = CPU_R3081E;
|
c->cputype = CPU_R3081E;
|
||||||
__cpu_name[cpu] = "R3081";
|
__cpu_name[cpu] = "R3081";
|
||||||
|
@ -353,7 +367,8 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
|
||||||
break;
|
break;
|
||||||
case PRID_IMP_R4000:
|
case PRID_IMP_R4000:
|
||||||
if (read_c0_config() & CONF_SC) {
|
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;
|
c->cputype = CPU_R4400PC;
|
||||||
__cpu_name[cpu] = "R4400PC";
|
__cpu_name[cpu] = "R4400PC";
|
||||||
} else {
|
} else {
|
||||||
|
@ -361,7 +376,8 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
|
||||||
__cpu_name[cpu] = "R4000PC";
|
__cpu_name[cpu] = "R4000PC";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((c->processor_id & 0xff) >= PRID_REV_R4400) {
|
if ((c->processor_id & PRID_REV_MASK) >=
|
||||||
|
PRID_REV_R4400) {
|
||||||
c->cputype = CPU_R4400SC;
|
c->cputype = CPU_R4400SC;
|
||||||
__cpu_name[cpu] = "R4400SC";
|
__cpu_name[cpu] = "R4400SC";
|
||||||
} else {
|
} else {
|
||||||
|
@ -454,7 +470,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
|
||||||
__cpu_name[cpu] = "TX3927";
|
__cpu_name[cpu] = "TX3927";
|
||||||
c->tlbsize = 64;
|
c->tlbsize = 64;
|
||||||
} else {
|
} else {
|
||||||
switch (c->processor_id & 0xff) {
|
switch (c->processor_id & PRID_REV_MASK) {
|
||||||
case PRID_REV_TX3912:
|
case PRID_REV_TX3912:
|
||||||
c->cputype = CPU_TX3912;
|
c->cputype = CPU_TX3912;
|
||||||
__cpu_name[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)
|
static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu)
|
||||||
{
|
{
|
||||||
decode_configs(c);
|
decode_configs(c);
|
||||||
switch (c->processor_id & 0xff00) {
|
switch (c->processor_id & PRID_IMP_MASK) {
|
||||||
case PRID_IMP_4KC:
|
case PRID_IMP_4KC:
|
||||||
c->cputype = CPU_4KC;
|
c->cputype = CPU_4KC;
|
||||||
__cpu_name[cpu] = "MIPS 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)
|
static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu)
|
||||||
{
|
{
|
||||||
decode_configs(c);
|
decode_configs(c);
|
||||||
switch (c->processor_id & 0xff00) {
|
switch (c->processor_id & PRID_IMP_MASK) {
|
||||||
case PRID_IMP_AU1_REV1:
|
case PRID_IMP_AU1_REV1:
|
||||||
case PRID_IMP_AU1_REV2:
|
case PRID_IMP_AU1_REV2:
|
||||||
c->cputype = CPU_ALCHEMY;
|
c->cputype = CPU_ALCHEMY;
|
||||||
|
@ -730,7 +746,7 @@ static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu)
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
__cpu_name[cpu] = "Au1200";
|
__cpu_name[cpu] = "Au1200";
|
||||||
if ((c->processor_id & 0xff) == 2)
|
if ((c->processor_id & PRID_REV_MASK) == 2)
|
||||||
__cpu_name[cpu] = "Au1250";
|
__cpu_name[cpu] = "Au1250";
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
|
@ -748,12 +764,12 @@ static inline void cpu_probe_sibyte(struct cpuinfo_mips *c, unsigned int cpu)
|
||||||
{
|
{
|
||||||
decode_configs(c);
|
decode_configs(c);
|
||||||
|
|
||||||
switch (c->processor_id & 0xff00) {
|
switch (c->processor_id & PRID_IMP_MASK) {
|
||||||
case PRID_IMP_SB1:
|
case PRID_IMP_SB1:
|
||||||
c->cputype = CPU_SB1;
|
c->cputype = CPU_SB1;
|
||||||
__cpu_name[cpu] = "SiByte SB1";
|
__cpu_name[cpu] = "SiByte SB1";
|
||||||
/* FPU in pass1 is known to have issues. */
|
/* 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);
|
c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR);
|
||||||
break;
|
break;
|
||||||
case PRID_IMP_SB1A:
|
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)
|
static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c, unsigned int cpu)
|
||||||
{
|
{
|
||||||
decode_configs(c);
|
decode_configs(c);
|
||||||
switch (c->processor_id & 0xff00) {
|
switch (c->processor_id & PRID_IMP_MASK) {
|
||||||
case PRID_IMP_SR71000:
|
case PRID_IMP_SR71000:
|
||||||
c->cputype = CPU_SR71000;
|
c->cputype = CPU_SR71000;
|
||||||
__cpu_name[cpu] = "Sandcraft 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)
|
static inline void cpu_probe_nxp(struct cpuinfo_mips *c, unsigned int cpu)
|
||||||
{
|
{
|
||||||
decode_configs(c);
|
decode_configs(c);
|
||||||
switch (c->processor_id & 0xff00) {
|
switch (c->processor_id & PRID_IMP_MASK) {
|
||||||
case PRID_IMP_PR4450:
|
case PRID_IMP_PR4450:
|
||||||
c->cputype = CPU_PR4450;
|
c->cputype = CPU_PR4450;
|
||||||
__cpu_name[cpu] = "Philips 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)
|
static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu)
|
||||||
{
|
{
|
||||||
decode_configs(c);
|
decode_configs(c);
|
||||||
switch (c->processor_id & 0xff00) {
|
switch (c->processor_id & PRID_IMP_MASK) {
|
||||||
case PRID_IMP_BMIPS32_REV4:
|
case PRID_IMP_BMIPS32_REV4:
|
||||||
case PRID_IMP_BMIPS32_REV8:
|
case PRID_IMP_BMIPS32_REV8:
|
||||||
c->cputype = CPU_BMIPS32;
|
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");
|
set_elf_platform(cpu, "bmips3300");
|
||||||
break;
|
break;
|
||||||
case PRID_IMP_BMIPS43XX: {
|
case PRID_IMP_BMIPS43XX: {
|
||||||
int rev = c->processor_id & 0xff;
|
int rev = c->processor_id & PRID_REV_MASK;
|
||||||
|
|
||||||
if (rev >= PRID_REV_BMIPS4380_LO &&
|
if (rev >= PRID_REV_BMIPS4380_LO &&
|
||||||
rev <= PRID_REV_BMIPS4380_HI) {
|
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)
|
static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu)
|
||||||
{
|
{
|
||||||
decode_configs(c);
|
decode_configs(c);
|
||||||
switch (c->processor_id & 0xff00) {
|
switch (c->processor_id & PRID_IMP_MASK) {
|
||||||
case PRID_IMP_CAVIUM_CN38XX:
|
case PRID_IMP_CAVIUM_CN38XX:
|
||||||
case PRID_IMP_CAVIUM_CN31XX:
|
case PRID_IMP_CAVIUM_CN31XX:
|
||||||
case PRID_IMP_CAVIUM_CN30XX:
|
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);
|
decode_configs(c);
|
||||||
/* JZRISC does not implement the CP0 counter. */
|
/* JZRISC does not implement the CP0 counter. */
|
||||||
c->options &= ~MIPS_CPU_COUNTER;
|
c->options &= ~MIPS_CPU_COUNTER;
|
||||||
switch (c->processor_id & 0xff00) {
|
switch (c->processor_id & PRID_IMP_MASK) {
|
||||||
case PRID_IMP_JZRISC:
|
case PRID_IMP_JZRISC:
|
||||||
c->cputype = CPU_JZRISC;
|
c->cputype = CPU_JZRISC;
|
||||||
__cpu_name[cpu] = "Ingenic 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);
|
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;
|
c->cputype = CPU_ALCHEMY;
|
||||||
__cpu_name[cpu] = "Au1300";
|
__cpu_name[cpu] = "Au1300";
|
||||||
/* following stuff is not for Alchemy */
|
/* 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_EJTAG |
|
||||||
MIPS_CPU_LLSC);
|
MIPS_CPU_LLSC);
|
||||||
|
|
||||||
switch (c->processor_id & 0xff00) {
|
switch (c->processor_id & PRID_IMP_MASK) {
|
||||||
case PRID_IMP_NETLOGIC_XLP2XX:
|
case PRID_IMP_NETLOGIC_XLP2XX:
|
||||||
c->cputype = CPU_XLP;
|
c->cputype = CPU_XLP;
|
||||||
__cpu_name[cpu] = "Broadcom XLPII";
|
__cpu_name[cpu] = "Broadcom XLPII";
|
||||||
|
@ -984,7 +1000,7 @@ void cpu_probe(void)
|
||||||
c->cputype = CPU_UNKNOWN;
|
c->cputype = CPU_UNKNOWN;
|
||||||
|
|
||||||
c->processor_id = read_c0_prid();
|
c->processor_id = read_c0_prid();
|
||||||
switch (c->processor_id & 0xff0000) {
|
switch (c->processor_id & PRID_COMP_MASK) {
|
||||||
case PRID_COMP_LEGACY:
|
case PRID_COMP_LEGACY:
|
||||||
cpu_probe_legacy(c, cpu);
|
cpu_probe_legacy(c, cpu);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <asm/cpu.h>
|
#include <asm/cpu.h>
|
||||||
#include <asm/cpu-info.h>
|
#include <asm/cpu-info.h>
|
||||||
|
#include <asm/cpu-type.h>
|
||||||
#include <asm/idle.h>
|
#include <asm/idle.h>
|
||||||
#include <asm/mipsregs.h>
|
#include <asm/mipsregs.h>
|
||||||
|
|
||||||
|
@ -136,7 +137,7 @@ void __init check_wait(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (c->cputype) {
|
switch (current_cpu_type()) {
|
||||||
case CPU_R3081:
|
case CPU_R3081:
|
||||||
case CPU_R3081E:
|
case CPU_R3081E:
|
||||||
cpu_wait = r3081_wait;
|
cpu_wait = r3081_wait;
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <linux/export.h>
|
#include <linux/export.h>
|
||||||
|
|
||||||
#include <asm/cpu-features.h>
|
#include <asm/cpu-features.h>
|
||||||
|
#include <asm/cpu-type.h>
|
||||||
#include <asm/div64.h>
|
#include <asm/div64.h>
|
||||||
#include <asm/smtc_ipi.h>
|
#include <asm/smtc_ipi.h>
|
||||||
#include <asm/time.h>
|
#include <asm/time.h>
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include <asm/break.h>
|
#include <asm/break.h>
|
||||||
#include <asm/cop2.h>
|
#include <asm/cop2.h>
|
||||||
#include <asm/cpu.h>
|
#include <asm/cpu.h>
|
||||||
|
#include <asm/cpu-type.h>
|
||||||
#include <asm/dsp.h>
|
#include <asm/dsp.h>
|
||||||
#include <asm/fpu.h>
|
#include <asm/fpu.h>
|
||||||
#include <asm/fpu_emulator.h>
|
#include <asm/fpu_emulator.h>
|
||||||
|
@ -622,7 +623,7 @@ static int simulate_rdhwr(struct pt_regs *regs, int rd, int rt)
|
||||||
regs->regs[rt] = read_c0_count();
|
regs->regs[rt] = read_c0_count();
|
||||||
return 0;
|
return 0;
|
||||||
case 3: /* Count register resolution */
|
case 3: /* Count register resolution */
|
||||||
switch (current_cpu_data.cputype) {
|
switch (current_cpu_type()) {
|
||||||
case CPU_20KC:
|
case CPU_20KC:
|
||||||
case CPU_25KF:
|
case CPU_25KF:
|
||||||
regs->regs[rt] = 1;
|
regs->regs[rt] = 1;
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <asm/bootinfo.h>
|
#include <asm/bootinfo.h>
|
||||||
#include <asm/cacheops.h>
|
#include <asm/cacheops.h>
|
||||||
#include <asm/cpu-features.h>
|
#include <asm/cpu-features.h>
|
||||||
|
#include <asm/cpu-type.h>
|
||||||
#include <asm/page.h>
|
#include <asm/page.h>
|
||||||
#include <asm/pgtable.h>
|
#include <asm/pgtable.h>
|
||||||
#include <asm/r4kcache.h>
|
#include <asm/r4kcache.h>
|
||||||
|
@ -186,9 +187,10 @@ static void probe_octeon(void)
|
||||||
unsigned long dcache_size;
|
unsigned long dcache_size;
|
||||||
unsigned int config1;
|
unsigned int config1;
|
||||||
struct cpuinfo_mips *c = ¤t_cpu_data;
|
struct cpuinfo_mips *c = ¤t_cpu_data;
|
||||||
|
int cputype = current_cpu_type();
|
||||||
|
|
||||||
config1 = read_c0_config1();
|
config1 = read_c0_config1();
|
||||||
switch (c->cputype) {
|
switch (cputype) {
|
||||||
case CPU_CAVIUM_OCTEON:
|
case CPU_CAVIUM_OCTEON:
|
||||||
case CPU_CAVIUM_OCTEON_PLUS:
|
case CPU_CAVIUM_OCTEON_PLUS:
|
||||||
c->icache.linesz = 2 << ((config1 >> 19) & 7);
|
c->icache.linesz = 2 << ((config1 >> 19) & 7);
|
||||||
|
@ -199,7 +201,7 @@ static void probe_octeon(void)
|
||||||
c->icache.sets * c->icache.ways * c->icache.linesz;
|
c->icache.sets * c->icache.ways * c->icache.linesz;
|
||||||
c->icache.waybit = ffs(icache_size / c->icache.ways) - 1;
|
c->icache.waybit = ffs(icache_size / c->icache.ways) - 1;
|
||||||
c->dcache.linesz = 128;
|
c->dcache.linesz = 128;
|
||||||
if (c->cputype == CPU_CAVIUM_OCTEON_PLUS)
|
if (cputype == CPU_CAVIUM_OCTEON_PLUS)
|
||||||
c->dcache.sets = 2; /* CN5XXX has two Dcache sets */
|
c->dcache.sets = 2; /* CN5XXX has two Dcache sets */
|
||||||
else
|
else
|
||||||
c->dcache.sets = 1; /* CN3XXX has one Dcache set */
|
c->dcache.sets = 1; /* CN3XXX has one Dcache set */
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <linux/highmem.h>
|
#include <linux/highmem.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/linkage.h>
|
#include <linux/linkage.h>
|
||||||
|
#include <linux/preempt.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/smp.h>
|
#include <linux/smp.h>
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
|
@ -24,6 +25,7 @@
|
||||||
#include <asm/cacheops.h>
|
#include <asm/cacheops.h>
|
||||||
#include <asm/cpu.h>
|
#include <asm/cpu.h>
|
||||||
#include <asm/cpu-features.h>
|
#include <asm/cpu-features.h>
|
||||||
|
#include <asm/cpu-type.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <asm/page.h>
|
#include <asm/page.h>
|
||||||
#include <asm/pgtable.h>
|
#include <asm/pgtable.h>
|
||||||
|
@ -601,6 +603,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
|
||||||
/* Catch bad driver code */
|
/* Catch bad driver code */
|
||||||
BUG_ON(size == 0);
|
BUG_ON(size == 0);
|
||||||
|
|
||||||
|
preempt_disable();
|
||||||
if (cpu_has_inclusive_pcaches) {
|
if (cpu_has_inclusive_pcaches) {
|
||||||
if (size >= scache_size)
|
if (size >= scache_size)
|
||||||
r4k_blast_scache();
|
r4k_blast_scache();
|
||||||
|
@ -621,6 +624,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
|
||||||
R4600_HIT_CACHEOP_WAR_IMPL;
|
R4600_HIT_CACHEOP_WAR_IMPL;
|
||||||
blast_dcache_range(addr, addr + size);
|
blast_dcache_range(addr, addr + size);
|
||||||
}
|
}
|
||||||
|
preempt_enable();
|
||||||
|
|
||||||
bc_wback_inv(addr, size);
|
bc_wback_inv(addr, size);
|
||||||
__sync();
|
__sync();
|
||||||
|
@ -631,6 +635,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
|
||||||
/* Catch bad driver code */
|
/* Catch bad driver code */
|
||||||
BUG_ON(size == 0);
|
BUG_ON(size == 0);
|
||||||
|
|
||||||
|
preempt_disable();
|
||||||
if (cpu_has_inclusive_pcaches) {
|
if (cpu_has_inclusive_pcaches) {
|
||||||
if (size >= scache_size)
|
if (size >= scache_size)
|
||||||
r4k_blast_scache();
|
r4k_blast_scache();
|
||||||
|
@ -655,6 +660,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
|
||||||
R4600_HIT_CACHEOP_WAR_IMPL;
|
R4600_HIT_CACHEOP_WAR_IMPL;
|
||||||
blast_inv_dcache_range(addr, addr + size);
|
blast_inv_dcache_range(addr, addr + size);
|
||||||
}
|
}
|
||||||
|
preempt_enable();
|
||||||
|
|
||||||
bc_inv(addr, size);
|
bc_inv(addr, size);
|
||||||
__sync();
|
__sync();
|
||||||
|
@ -780,20 +786,30 @@ static inline void rm7k_erratum31(void)
|
||||||
|
|
||||||
static inline void alias_74k_erratum(struct cpuinfo_mips *c)
|
static inline void alias_74k_erratum(struct cpuinfo_mips *c)
|
||||||
{
|
{
|
||||||
|
unsigned int imp = c->processor_id & PRID_IMP_MASK;
|
||||||
|
unsigned int rev = c->processor_id & PRID_REV_MASK;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Early versions of the 74K do not update the cache tags on a
|
* Early versions of the 74K do not update the cache tags on a
|
||||||
* vtag miss/ptag hit which can occur in the case of KSEG0/KUSEG
|
* vtag miss/ptag hit which can occur in the case of KSEG0/KUSEG
|
||||||
* aliases. In this case it is better to treat the cache as always
|
* aliases. In this case it is better to treat the cache as always
|
||||||
* having aliases.
|
* having aliases.
|
||||||
*/
|
*/
|
||||||
if ((c->processor_id & 0xff) <= PRID_REV_ENCODE_332(2, 4, 0))
|
switch (imp) {
|
||||||
c->dcache.flags |= MIPS_CACHE_VTAG;
|
case PRID_IMP_74K:
|
||||||
if ((c->processor_id & 0xff) == PRID_REV_ENCODE_332(2, 4, 0))
|
if (rev <= PRID_REV_ENCODE_332(2, 4, 0))
|
||||||
write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND);
|
c->dcache.flags |= MIPS_CACHE_VTAG;
|
||||||
if (((c->processor_id & 0xff00) == PRID_IMP_1074K) &&
|
if (rev == PRID_REV_ENCODE_332(2, 4, 0))
|
||||||
((c->processor_id & 0xff) <= PRID_REV_ENCODE_332(1, 1, 0))) {
|
write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND);
|
||||||
c->dcache.flags |= MIPS_CACHE_VTAG;
|
break;
|
||||||
write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND);
|
case PRID_IMP_1074K:
|
||||||
|
if (rev <= PRID_REV_ENCODE_332(1, 1, 0)) {
|
||||||
|
c->dcache.flags |= MIPS_CACHE_VTAG;
|
||||||
|
write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
BUG();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -809,7 +825,7 @@ static void probe_pcache(void)
|
||||||
unsigned long config1;
|
unsigned long config1;
|
||||||
unsigned int lsize;
|
unsigned int lsize;
|
||||||
|
|
||||||
switch (c->cputype) {
|
switch (current_cpu_type()) {
|
||||||
case CPU_R4600: /* QED style two way caches? */
|
case CPU_R4600: /* QED style two way caches? */
|
||||||
case CPU_R4700:
|
case CPU_R4700:
|
||||||
case CPU_R5000:
|
case CPU_R5000:
|
||||||
|
@ -1025,7 +1041,8 @@ static void probe_pcache(void)
|
||||||
* presumably no vendor is shipping his hardware in the "bad"
|
* presumably no vendor is shipping his hardware in the "bad"
|
||||||
* configuration.
|
* configuration.
|
||||||
*/
|
*/
|
||||||
if ((prid & 0xff00) == PRID_IMP_R4000 && (prid & 0xff) < 0x40 &&
|
if ((prid & PRID_IMP_MASK) == PRID_IMP_R4000 &&
|
||||||
|
(prid & PRID_REV_MASK) < PRID_REV_R4400 &&
|
||||||
!(config & CONF_SC) && c->icache.linesz != 16 &&
|
!(config & CONF_SC) && c->icache.linesz != 16 &&
|
||||||
PAGE_SIZE <= 0x8000)
|
PAGE_SIZE <= 0x8000)
|
||||||
panic("Improper R4000SC processor configuration detected");
|
panic("Improper R4000SC processor configuration detected");
|
||||||
|
@ -1045,7 +1062,7 @@ static void probe_pcache(void)
|
||||||
* normally they'd suffer from aliases but magic in the hardware deals
|
* normally they'd suffer from aliases but magic in the hardware deals
|
||||||
* with that for us so we don't need to take care ourselves.
|
* with that for us so we don't need to take care ourselves.
|
||||||
*/
|
*/
|
||||||
switch (c->cputype) {
|
switch (current_cpu_type()) {
|
||||||
case CPU_20KC:
|
case CPU_20KC:
|
||||||
case CPU_25KF:
|
case CPU_25KF:
|
||||||
case CPU_SB1:
|
case CPU_SB1:
|
||||||
|
@ -1065,7 +1082,7 @@ static void probe_pcache(void)
|
||||||
case CPU_34K:
|
case CPU_34K:
|
||||||
case CPU_74K:
|
case CPU_74K:
|
||||||
case CPU_1004K:
|
case CPU_1004K:
|
||||||
if (c->cputype == CPU_74K)
|
if (current_cpu_type() == CPU_74K)
|
||||||
alias_74k_erratum(c);
|
alias_74k_erratum(c);
|
||||||
if ((read_c0_config7() & (1 << 16))) {
|
if ((read_c0_config7() & (1 << 16))) {
|
||||||
/* effectively physically indexed dcache,
|
/* effectively physically indexed dcache,
|
||||||
|
@ -1078,7 +1095,7 @@ static void probe_pcache(void)
|
||||||
c->dcache.flags |= MIPS_CACHE_ALIASES;
|
c->dcache.flags |= MIPS_CACHE_ALIASES;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (c->cputype) {
|
switch (current_cpu_type()) {
|
||||||
case CPU_20KC:
|
case CPU_20KC:
|
||||||
/*
|
/*
|
||||||
* Some older 20Kc chips doesn't have the 'VI' bit in
|
* Some older 20Kc chips doesn't have the 'VI' bit in
|
||||||
|
@ -1207,7 +1224,7 @@ static void setup_scache(void)
|
||||||
* processors don't have a S-cache that would be relevant to the
|
* processors don't have a S-cache that would be relevant to the
|
||||||
* Linux memory management.
|
* Linux memory management.
|
||||||
*/
|
*/
|
||||||
switch (c->cputype) {
|
switch (current_cpu_type()) {
|
||||||
case CPU_R4000SC:
|
case CPU_R4000SC:
|
||||||
case CPU_R4000MC:
|
case CPU_R4000MC:
|
||||||
case CPU_R4400SC:
|
case CPU_R4400SC:
|
||||||
|
@ -1384,9 +1401,8 @@ static void r4k_cache_error_setup(void)
|
||||||
{
|
{
|
||||||
extern char __weak except_vec2_generic;
|
extern char __weak except_vec2_generic;
|
||||||
extern char __weak except_vec2_sb1;
|
extern char __weak except_vec2_sb1;
|
||||||
struct cpuinfo_mips *c = ¤t_cpu_data;
|
|
||||||
|
|
||||||
switch (c->cputype) {
|
switch (current_cpu_type()) {
|
||||||
case CPU_SB1:
|
case CPU_SB1:
|
||||||
case CPU_SB1A:
|
case CPU_SB1A:
|
||||||
set_uncached_handler(0x100, &except_vec2_sb1, 0x80);
|
set_uncached_handler(0x100, &except_vec2_sb1, 0x80);
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include <linux/highmem.h>
|
#include <linux/highmem.h>
|
||||||
|
|
||||||
#include <asm/cache.h>
|
#include <asm/cache.h>
|
||||||
|
#include <asm/cpu-type.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
|
||||||
#include <dma-coherence.h>
|
#include <dma-coherence.h>
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
#include <asm/bugs.h>
|
#include <asm/bugs.h>
|
||||||
#include <asm/cacheops.h>
|
#include <asm/cacheops.h>
|
||||||
|
#include <asm/cpu-type.h>
|
||||||
#include <asm/inst.h>
|
#include <asm/inst.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <asm/page.h>
|
#include <asm/page.h>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
|
|
||||||
|
#include <asm/cpu-type.h>
|
||||||
#include <asm/mipsregs.h>
|
#include <asm/mipsregs.h>
|
||||||
#include <asm/bcache.h>
|
#include <asm/bcache.h>
|
||||||
#include <asm/cacheops.h>
|
#include <asm/cacheops.h>
|
||||||
|
@ -71,7 +72,7 @@ static inline int mips_sc_is_activated(struct cpuinfo_mips *c)
|
||||||
unsigned int tmp;
|
unsigned int tmp;
|
||||||
|
|
||||||
/* Check the bypass bit (L2B) */
|
/* Check the bypass bit (L2B) */
|
||||||
switch (c->cputype) {
|
switch (current_cpu_type()) {
|
||||||
case CPU_34K:
|
case CPU_34K:
|
||||||
case CPU_74K:
|
case CPU_74K:
|
||||||
case CPU_1004K:
|
case CPU_1004K:
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
|
|
||||||
#include <asm/cpu.h>
|
#include <asm/cpu.h>
|
||||||
|
#include <asm/cpu-type.h>
|
||||||
#include <asm/bootinfo.h>
|
#include <asm/bootinfo.h>
|
||||||
#include <asm/mmu_context.h>
|
#include <asm/mmu_context.h>
|
||||||
#include <asm/pgtable.h>
|
#include <asm/pgtable.h>
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include <linux/cache.h>
|
#include <linux/cache.h>
|
||||||
|
|
||||||
#include <asm/cacheflush.h>
|
#include <asm/cacheflush.h>
|
||||||
|
#include <asm/cpu-type.h>
|
||||||
#include <asm/pgtable.h>
|
#include <asm/pgtable.h>
|
||||||
#include <asm/war.h>
|
#include <asm/war.h>
|
||||||
#include <asm/uasm.h>
|
#include <asm/uasm.h>
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include <linux/timex.h>
|
#include <linux/timex.h>
|
||||||
#include <linux/mc146818rtc.h>
|
#include <linux/mc146818rtc.h>
|
||||||
|
|
||||||
|
#include <asm/cpu.h>
|
||||||
#include <asm/mipsregs.h>
|
#include <asm/mipsregs.h>
|
||||||
#include <asm/mipsmtregs.h>
|
#include <asm/mipsmtregs.h>
|
||||||
#include <asm/hardirq.h>
|
#include <asm/hardirq.h>
|
||||||
|
@ -76,7 +77,7 @@ static void __init estimate_frequencies(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (CONFIG_KVM_GUEST) && defined (CONFIG_KVM_HOST_FREQ)
|
#if defined (CONFIG_KVM_GUEST) && defined (CONFIG_KVM_HOST_FREQ)
|
||||||
unsigned int prid = read_c0_prid() & 0xffff00;
|
unsigned int prid = read_c0_prid() & (PRID_COMP_MASK | PRID_IMP_MASK);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XXXKYMA: hardwire the CPU frequency to Host Freq/4
|
* XXXKYMA: hardwire the CPU frequency to Host Freq/4
|
||||||
|
@ -169,7 +170,7 @@ unsigned int get_c0_compare_int(void)
|
||||||
|
|
||||||
void __init plat_time_init(void)
|
void __init plat_time_init(void)
|
||||||
{
|
{
|
||||||
unsigned int prid = read_c0_prid() & 0xffff00;
|
unsigned int prid = read_c0_prid() & (PRID_COMP_MASK | PRID_IMP_MASK);
|
||||||
unsigned int freq;
|
unsigned int freq;
|
||||||
|
|
||||||
estimate_frequencies();
|
estimate_frequencies();
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*/
|
*/
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
|
|
||||||
|
#include <asm/cpu.h>
|
||||||
#include <asm/setup.h>
|
#include <asm/setup.h>
|
||||||
#include <asm/time.h>
|
#include <asm/time.h>
|
||||||
#include <asm/irq.h>
|
#include <asm/irq.h>
|
||||||
|
@ -34,7 +35,7 @@ static void __iomem *status_reg = (void __iomem *)0xbf000410;
|
||||||
*/
|
*/
|
||||||
static unsigned int __init estimate_cpu_frequency(void)
|
static unsigned int __init estimate_cpu_frequency(void)
|
||||||
{
|
{
|
||||||
unsigned int prid = read_c0_prid() & 0xffff00;
|
unsigned int prid = read_c0_prid() & (PRID_COMP_MASK | PRID_IMP_MASK);
|
||||||
unsigned int tick = 0;
|
unsigned int tick = 0;
|
||||||
unsigned int freq;
|
unsigned int freq;
|
||||||
unsigned int orig;
|
unsigned int orig;
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#include <linux/irq.h>
|
#include <linux/irq.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
|
|
||||||
|
#include <asm/cpu.h>
|
||||||
#include <asm/mipsregs.h>
|
#include <asm/mipsregs.h>
|
||||||
#include <asm/netlogic/xlr/fmn.h>
|
#include <asm/netlogic/xlr/fmn.h>
|
||||||
#include <asm/netlogic/xlr/xlr.h>
|
#include <asm/netlogic/xlr/xlr.h>
|
||||||
|
@ -187,7 +188,7 @@ void xlr_board_info_setup(void)
|
||||||
int processor_id, num_core;
|
int processor_id, num_core;
|
||||||
|
|
||||||
num_core = hweight32(nlm_current_node()->coremask);
|
num_core = hweight32(nlm_current_node()->coremask);
|
||||||
processor_id = read_c0_prid() & 0xff00;
|
processor_id = read_c0_prid() & PRID_IMP_MASK;
|
||||||
|
|
||||||
setup_cpu_fmninfo(cpu, num_core);
|
setup_cpu_fmninfo(cpu, num_core);
|
||||||
switch (processor_id) {
|
switch (processor_id) {
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <linux/oprofile.h>
|
#include <linux/oprofile.h>
|
||||||
#include <linux/smp.h>
|
#include <linux/smp.h>
|
||||||
#include <asm/cpu-info.h>
|
#include <asm/cpu-info.h>
|
||||||
|
#include <asm/cpu-type.h>
|
||||||
|
|
||||||
#include "op_impl.h"
|
#include "op_impl.h"
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
#include <linux/console.h>
|
#include <linux/console.h>
|
||||||
#include <linux/tty.h>
|
#include <linux/tty.h>
|
||||||
|
#include <linux/vt.h>
|
||||||
|
|
||||||
#include <asm/sibyte/bcm1480_regs.h>
|
#include <asm/sibyte/bcm1480_regs.h>
|
||||||
#include <asm/sibyte/bcm1480_scd.h>
|
#include <asm/sibyte/bcm1480_scd.h>
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
|
|
||||||
#include <asm/bootinfo.h>
|
#include <asm/bootinfo.h>
|
||||||
|
#include <asm/cpu.h>
|
||||||
#include <asm/mipsregs.h>
|
#include <asm/mipsregs.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <asm/sibyte/sb1250.h>
|
#include <asm/sibyte/sb1250.h>
|
||||||
|
@ -119,7 +120,7 @@ void __init bcm1480_setup(void)
|
||||||
uint64_t sys_rev;
|
uint64_t sys_rev;
|
||||||
int plldiv;
|
int plldiv;
|
||||||
|
|
||||||
sb1_pass = read_c0_prid() & 0xff;
|
sb1_pass = read_c0_prid() & PRID_REV_MASK;
|
||||||
sys_rev = __raw_readq(IOADDR(A_SCD_SYSTEM_REVISION));
|
sys_rev = __raw_readq(IOADDR(A_SCD_SYSTEM_REVISION));
|
||||||
soc_type = SYS_SOC_TYPE(sys_rev);
|
soc_type = SYS_SOC_TYPE(sys_rev);
|
||||||
part_type = G_SYS_PART(sys_rev);
|
part_type = G_SYS_PART(sys_rev);
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
|
|
||||||
#include <asm/bootinfo.h>
|
#include <asm/bootinfo.h>
|
||||||
|
#include <asm/cpu.h>
|
||||||
#include <asm/mipsregs.h>
|
#include <asm/mipsregs.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <asm/sibyte/sb1250.h>
|
#include <asm/sibyte/sb1250.h>
|
||||||
|
@ -182,7 +183,7 @@ void __init sb1250_setup(void)
|
||||||
int plldiv;
|
int plldiv;
|
||||||
int bad_config = 0;
|
int bad_config = 0;
|
||||||
|
|
||||||
sb1_pass = read_c0_prid() & 0xff;
|
sb1_pass = read_c0_prid() & PRID_REV_MASK;
|
||||||
sys_rev = __raw_readq(IOADDR(A_SCD_SYSTEM_REVISION));
|
sys_rev = __raw_readq(IOADDR(A_SCD_SYSTEM_REVISION));
|
||||||
soc_type = SYS_SOC_TYPE(sys_rev);
|
soc_type = SYS_SOC_TYPE(sys_rev);
|
||||||
soc_pass = G_SYS_REVISION(sys_rev);
|
soc_pass = G_SYS_REVISION(sys_rev);
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <asm/bootinfo.h>
|
#include <asm/bootinfo.h>
|
||||||
|
#include <asm/cpu.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <asm/reboot.h>
|
#include <asm/reboot.h>
|
||||||
#include <asm/sni.h>
|
#include <asm/sni.h>
|
||||||
|
@ -173,7 +174,7 @@ void __init plat_mem_setup(void)
|
||||||
system_type = "RM300-Cxx";
|
system_type = "RM300-Cxx";
|
||||||
break;
|
break;
|
||||||
case SNI_BRD_PCI_DESKTOP:
|
case SNI_BRD_PCI_DESKTOP:
|
||||||
switch (read_c0_prid() & 0xff00) {
|
switch (read_c0_prid() & PRID_IMP_MASK) {
|
||||||
case PRID_IMP_R4600:
|
case PRID_IMP_R4600:
|
||||||
case PRID_IMP_R4700:
|
case PRID_IMP_R4700:
|
||||||
system_type = "RM200-C20";
|
system_type = "RM200-C20";
|
||||||
|
|
|
@ -361,7 +361,7 @@ config CMDLINE_OVERRIDE
|
||||||
|
|
||||||
config VMALLOC_RESERVE
|
config VMALLOC_RESERVE
|
||||||
hex
|
hex
|
||||||
default 0x1000000
|
default 0x2000000
|
||||||
|
|
||||||
config HARDWALL
|
config HARDWALL
|
||||||
bool "Hardwall support to allow access to user dynamic network"
|
bool "Hardwall support to allow access to user dynamic network"
|
||||||
|
|
|
@ -21,7 +21,7 @@ struct alloc_buffer_stacks_param {
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_alloc_buffer_stacks(gxio_mpipe_context_t * context,
|
int gxio_mpipe_alloc_buffer_stacks(gxio_mpipe_context_t *context,
|
||||||
unsigned int count, unsigned int first,
|
unsigned int count, unsigned int first,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,7 @@ struct init_buffer_stack_aux_param {
|
||||||
unsigned int buffer_size_enum;
|
unsigned int buffer_size_enum;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_init_buffer_stack_aux(gxio_mpipe_context_t * context,
|
int gxio_mpipe_init_buffer_stack_aux(gxio_mpipe_context_t *context,
|
||||||
void *mem_va, size_t mem_size,
|
void *mem_va, size_t mem_size,
|
||||||
unsigned int mem_flags, unsigned int stack,
|
unsigned int mem_flags, unsigned int stack,
|
||||||
unsigned int buffer_size_enum)
|
unsigned int buffer_size_enum)
|
||||||
|
@ -80,7 +80,7 @@ struct alloc_notif_rings_param {
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_alloc_notif_rings(gxio_mpipe_context_t * context,
|
int gxio_mpipe_alloc_notif_rings(gxio_mpipe_context_t *context,
|
||||||
unsigned int count, unsigned int first,
|
unsigned int count, unsigned int first,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
|
@ -102,7 +102,7 @@ struct init_notif_ring_aux_param {
|
||||||
unsigned int ring;
|
unsigned int ring;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_init_notif_ring_aux(gxio_mpipe_context_t * context, void *mem_va,
|
int gxio_mpipe_init_notif_ring_aux(gxio_mpipe_context_t *context, void *mem_va,
|
||||||
size_t mem_size, unsigned int mem_flags,
|
size_t mem_size, unsigned int mem_flags,
|
||||||
unsigned int ring)
|
unsigned int ring)
|
||||||
{
|
{
|
||||||
|
@ -133,7 +133,7 @@ struct request_notif_ring_interrupt_param {
|
||||||
unsigned int ring;
|
unsigned int ring;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_request_notif_ring_interrupt(gxio_mpipe_context_t * context,
|
int gxio_mpipe_request_notif_ring_interrupt(gxio_mpipe_context_t *context,
|
||||||
int inter_x, int inter_y,
|
int inter_x, int inter_y,
|
||||||
int inter_ipi, int inter_event,
|
int inter_ipi, int inter_event,
|
||||||
unsigned int ring)
|
unsigned int ring)
|
||||||
|
@ -158,7 +158,7 @@ struct enable_notif_ring_interrupt_param {
|
||||||
unsigned int ring;
|
unsigned int ring;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_enable_notif_ring_interrupt(gxio_mpipe_context_t * context,
|
int gxio_mpipe_enable_notif_ring_interrupt(gxio_mpipe_context_t *context,
|
||||||
unsigned int ring)
|
unsigned int ring)
|
||||||
{
|
{
|
||||||
struct enable_notif_ring_interrupt_param temp;
|
struct enable_notif_ring_interrupt_param temp;
|
||||||
|
@ -179,7 +179,7 @@ struct alloc_notif_groups_param {
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_alloc_notif_groups(gxio_mpipe_context_t * context,
|
int gxio_mpipe_alloc_notif_groups(gxio_mpipe_context_t *context,
|
||||||
unsigned int count, unsigned int first,
|
unsigned int count, unsigned int first,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
|
@ -201,7 +201,7 @@ struct init_notif_group_param {
|
||||||
gxio_mpipe_notif_group_bits_t bits;
|
gxio_mpipe_notif_group_bits_t bits;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_init_notif_group(gxio_mpipe_context_t * context,
|
int gxio_mpipe_init_notif_group(gxio_mpipe_context_t *context,
|
||||||
unsigned int group,
|
unsigned int group,
|
||||||
gxio_mpipe_notif_group_bits_t bits)
|
gxio_mpipe_notif_group_bits_t bits)
|
||||||
{
|
{
|
||||||
|
@ -223,7 +223,7 @@ struct alloc_buckets_param {
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_alloc_buckets(gxio_mpipe_context_t * context, unsigned int count,
|
int gxio_mpipe_alloc_buckets(gxio_mpipe_context_t *context, unsigned int count,
|
||||||
unsigned int first, unsigned int flags)
|
unsigned int first, unsigned int flags)
|
||||||
{
|
{
|
||||||
struct alloc_buckets_param temp;
|
struct alloc_buckets_param temp;
|
||||||
|
@ -244,7 +244,7 @@ struct init_bucket_param {
|
||||||
MPIPE_LBL_INIT_DAT_BSTS_TBL_t bucket_info;
|
MPIPE_LBL_INIT_DAT_BSTS_TBL_t bucket_info;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_init_bucket(gxio_mpipe_context_t * context, unsigned int bucket,
|
int gxio_mpipe_init_bucket(gxio_mpipe_context_t *context, unsigned int bucket,
|
||||||
MPIPE_LBL_INIT_DAT_BSTS_TBL_t bucket_info)
|
MPIPE_LBL_INIT_DAT_BSTS_TBL_t bucket_info)
|
||||||
{
|
{
|
||||||
struct init_bucket_param temp;
|
struct init_bucket_param temp;
|
||||||
|
@ -265,7 +265,7 @@ struct alloc_edma_rings_param {
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_alloc_edma_rings(gxio_mpipe_context_t * context,
|
int gxio_mpipe_alloc_edma_rings(gxio_mpipe_context_t *context,
|
||||||
unsigned int count, unsigned int first,
|
unsigned int count, unsigned int first,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
|
@ -288,7 +288,7 @@ struct init_edma_ring_aux_param {
|
||||||
unsigned int channel;
|
unsigned int channel;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_init_edma_ring_aux(gxio_mpipe_context_t * context, void *mem_va,
|
int gxio_mpipe_init_edma_ring_aux(gxio_mpipe_context_t *context, void *mem_va,
|
||||||
size_t mem_size, unsigned int mem_flags,
|
size_t mem_size, unsigned int mem_flags,
|
||||||
unsigned int ring, unsigned int channel)
|
unsigned int ring, unsigned int channel)
|
||||||
{
|
{
|
||||||
|
@ -315,7 +315,7 @@ int gxio_mpipe_init_edma_ring_aux(gxio_mpipe_context_t * context, void *mem_va,
|
||||||
EXPORT_SYMBOL(gxio_mpipe_init_edma_ring_aux);
|
EXPORT_SYMBOL(gxio_mpipe_init_edma_ring_aux);
|
||||||
|
|
||||||
|
|
||||||
int gxio_mpipe_commit_rules(gxio_mpipe_context_t * context, const void *blob,
|
int gxio_mpipe_commit_rules(gxio_mpipe_context_t *context, const void *blob,
|
||||||
size_t blob_size)
|
size_t blob_size)
|
||||||
{
|
{
|
||||||
const void *params = blob;
|
const void *params = blob;
|
||||||
|
@ -332,7 +332,7 @@ struct register_client_memory_param {
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_register_client_memory(gxio_mpipe_context_t * context,
|
int gxio_mpipe_register_client_memory(gxio_mpipe_context_t *context,
|
||||||
unsigned int iotlb, HV_PTE pte,
|
unsigned int iotlb, HV_PTE pte,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
|
@ -355,7 +355,7 @@ struct link_open_aux_param {
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_link_open_aux(gxio_mpipe_context_t * context,
|
int gxio_mpipe_link_open_aux(gxio_mpipe_context_t *context,
|
||||||
_gxio_mpipe_link_name_t name, unsigned int flags)
|
_gxio_mpipe_link_name_t name, unsigned int flags)
|
||||||
{
|
{
|
||||||
struct link_open_aux_param temp;
|
struct link_open_aux_param temp;
|
||||||
|
@ -374,7 +374,7 @@ struct link_close_aux_param {
|
||||||
int mac;
|
int mac;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_link_close_aux(gxio_mpipe_context_t * context, int mac)
|
int gxio_mpipe_link_close_aux(gxio_mpipe_context_t *context, int mac)
|
||||||
{
|
{
|
||||||
struct link_close_aux_param temp;
|
struct link_close_aux_param temp;
|
||||||
struct link_close_aux_param *params = &temp;
|
struct link_close_aux_param *params = &temp;
|
||||||
|
@ -393,7 +393,7 @@ struct link_set_attr_aux_param {
|
||||||
int64_t val;
|
int64_t val;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_link_set_attr_aux(gxio_mpipe_context_t * context, int mac,
|
int gxio_mpipe_link_set_attr_aux(gxio_mpipe_context_t *context, int mac,
|
||||||
uint32_t attr, int64_t val)
|
uint32_t attr, int64_t val)
|
||||||
{
|
{
|
||||||
struct link_set_attr_aux_param temp;
|
struct link_set_attr_aux_param temp;
|
||||||
|
@ -415,8 +415,8 @@ struct get_timestamp_aux_param {
|
||||||
uint64_t cycles;
|
uint64_t cycles;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_get_timestamp_aux(gxio_mpipe_context_t * context, uint64_t * sec,
|
int gxio_mpipe_get_timestamp_aux(gxio_mpipe_context_t *context, uint64_t *sec,
|
||||||
uint64_t * nsec, uint64_t * cycles)
|
uint64_t *nsec, uint64_t *cycles)
|
||||||
{
|
{
|
||||||
int __result;
|
int __result;
|
||||||
struct get_timestamp_aux_param temp;
|
struct get_timestamp_aux_param temp;
|
||||||
|
@ -440,7 +440,7 @@ struct set_timestamp_aux_param {
|
||||||
uint64_t cycles;
|
uint64_t cycles;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_set_timestamp_aux(gxio_mpipe_context_t * context, uint64_t sec,
|
int gxio_mpipe_set_timestamp_aux(gxio_mpipe_context_t *context, uint64_t sec,
|
||||||
uint64_t nsec, uint64_t cycles)
|
uint64_t nsec, uint64_t cycles)
|
||||||
{
|
{
|
||||||
struct set_timestamp_aux_param temp;
|
struct set_timestamp_aux_param temp;
|
||||||
|
@ -460,8 +460,7 @@ struct adjust_timestamp_aux_param {
|
||||||
int64_t nsec;
|
int64_t nsec;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_adjust_timestamp_aux(gxio_mpipe_context_t * context,
|
int gxio_mpipe_adjust_timestamp_aux(gxio_mpipe_context_t *context, int64_t nsec)
|
||||||
int64_t nsec)
|
|
||||||
{
|
{
|
||||||
struct adjust_timestamp_aux_param temp;
|
struct adjust_timestamp_aux_param temp;
|
||||||
struct adjust_timestamp_aux_param *params = &temp;
|
struct adjust_timestamp_aux_param *params = &temp;
|
||||||
|
@ -475,25 +474,6 @@ int gxio_mpipe_adjust_timestamp_aux(gxio_mpipe_context_t * context,
|
||||||
|
|
||||||
EXPORT_SYMBOL(gxio_mpipe_adjust_timestamp_aux);
|
EXPORT_SYMBOL(gxio_mpipe_adjust_timestamp_aux);
|
||||||
|
|
||||||
struct adjust_timestamp_freq_param {
|
|
||||||
int32_t ppb;
|
|
||||||
};
|
|
||||||
|
|
||||||
int gxio_mpipe_adjust_timestamp_freq(gxio_mpipe_context_t * context,
|
|
||||||
int32_t ppb)
|
|
||||||
{
|
|
||||||
struct adjust_timestamp_freq_param temp;
|
|
||||||
struct adjust_timestamp_freq_param *params = &temp;
|
|
||||||
|
|
||||||
params->ppb = ppb;
|
|
||||||
|
|
||||||
return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
|
|
||||||
sizeof(*params),
|
|
||||||
GXIO_MPIPE_OP_ADJUST_TIMESTAMP_FREQ);
|
|
||||||
}
|
|
||||||
|
|
||||||
EXPORT_SYMBOL(gxio_mpipe_adjust_timestamp_freq);
|
|
||||||
|
|
||||||
struct config_edma_ring_blks_param {
|
struct config_edma_ring_blks_param {
|
||||||
unsigned int ering;
|
unsigned int ering;
|
||||||
unsigned int max_blks;
|
unsigned int max_blks;
|
||||||
|
@ -501,7 +481,7 @@ struct config_edma_ring_blks_param {
|
||||||
unsigned int db;
|
unsigned int db;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_config_edma_ring_blks(gxio_mpipe_context_t * context,
|
int gxio_mpipe_config_edma_ring_blks(gxio_mpipe_context_t *context,
|
||||||
unsigned int ering, unsigned int max_blks,
|
unsigned int ering, unsigned int max_blks,
|
||||||
unsigned int min_snf_blks, unsigned int db)
|
unsigned int min_snf_blks, unsigned int db)
|
||||||
{
|
{
|
||||||
|
@ -520,11 +500,29 @@ int gxio_mpipe_config_edma_ring_blks(gxio_mpipe_context_t * context,
|
||||||
|
|
||||||
EXPORT_SYMBOL(gxio_mpipe_config_edma_ring_blks);
|
EXPORT_SYMBOL(gxio_mpipe_config_edma_ring_blks);
|
||||||
|
|
||||||
|
struct adjust_timestamp_freq_param {
|
||||||
|
int32_t ppb;
|
||||||
|
};
|
||||||
|
|
||||||
|
int gxio_mpipe_adjust_timestamp_freq(gxio_mpipe_context_t *context, int32_t ppb)
|
||||||
|
{
|
||||||
|
struct adjust_timestamp_freq_param temp;
|
||||||
|
struct adjust_timestamp_freq_param *params = &temp;
|
||||||
|
|
||||||
|
params->ppb = ppb;
|
||||||
|
|
||||||
|
return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
|
||||||
|
sizeof(*params),
|
||||||
|
GXIO_MPIPE_OP_ADJUST_TIMESTAMP_FREQ);
|
||||||
|
}
|
||||||
|
|
||||||
|
EXPORT_SYMBOL(gxio_mpipe_adjust_timestamp_freq);
|
||||||
|
|
||||||
struct arm_pollfd_param {
|
struct arm_pollfd_param {
|
||||||
union iorpc_pollfd pollfd;
|
union iorpc_pollfd pollfd;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_arm_pollfd(gxio_mpipe_context_t * context, int pollfd_cookie)
|
int gxio_mpipe_arm_pollfd(gxio_mpipe_context_t *context, int pollfd_cookie)
|
||||||
{
|
{
|
||||||
struct arm_pollfd_param temp;
|
struct arm_pollfd_param temp;
|
||||||
struct arm_pollfd_param *params = &temp;
|
struct arm_pollfd_param *params = &temp;
|
||||||
|
@ -541,7 +539,7 @@ struct close_pollfd_param {
|
||||||
union iorpc_pollfd pollfd;
|
union iorpc_pollfd pollfd;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_close_pollfd(gxio_mpipe_context_t * context, int pollfd_cookie)
|
int gxio_mpipe_close_pollfd(gxio_mpipe_context_t *context, int pollfd_cookie)
|
||||||
{
|
{
|
||||||
struct close_pollfd_param temp;
|
struct close_pollfd_param temp;
|
||||||
struct close_pollfd_param *params = &temp;
|
struct close_pollfd_param *params = &temp;
|
||||||
|
@ -558,7 +556,7 @@ struct get_mmio_base_param {
|
||||||
HV_PTE base;
|
HV_PTE base;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_get_mmio_base(gxio_mpipe_context_t * context, HV_PTE *base)
|
int gxio_mpipe_get_mmio_base(gxio_mpipe_context_t *context, HV_PTE *base)
|
||||||
{
|
{
|
||||||
int __result;
|
int __result;
|
||||||
struct get_mmio_base_param temp;
|
struct get_mmio_base_param temp;
|
||||||
|
@ -579,7 +577,7 @@ struct check_mmio_offset_param {
|
||||||
unsigned long size;
|
unsigned long size;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_check_mmio_offset(gxio_mpipe_context_t * context,
|
int gxio_mpipe_check_mmio_offset(gxio_mpipe_context_t *context,
|
||||||
unsigned long offset, unsigned long size)
|
unsigned long offset, unsigned long size)
|
||||||
{
|
{
|
||||||
struct check_mmio_offset_param temp;
|
struct check_mmio_offset_param temp;
|
||||||
|
|
|
@ -15,12 +15,11 @@
|
||||||
/* This file is machine-generated; DO NOT EDIT! */
|
/* This file is machine-generated; DO NOT EDIT! */
|
||||||
#include "gxio/iorpc_mpipe_info.h"
|
#include "gxio/iorpc_mpipe_info.h"
|
||||||
|
|
||||||
|
|
||||||
struct instance_aux_param {
|
struct instance_aux_param {
|
||||||
_gxio_mpipe_link_name_t name;
|
_gxio_mpipe_link_name_t name;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_info_instance_aux(gxio_mpipe_info_context_t * context,
|
int gxio_mpipe_info_instance_aux(gxio_mpipe_info_context_t *context,
|
||||||
_gxio_mpipe_link_name_t name)
|
_gxio_mpipe_link_name_t name)
|
||||||
{
|
{
|
||||||
struct instance_aux_param temp;
|
struct instance_aux_param temp;
|
||||||
|
@ -39,10 +38,10 @@ struct enumerate_aux_param {
|
||||||
_gxio_mpipe_link_mac_t mac;
|
_gxio_mpipe_link_mac_t mac;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_info_enumerate_aux(gxio_mpipe_info_context_t * context,
|
int gxio_mpipe_info_enumerate_aux(gxio_mpipe_info_context_t *context,
|
||||||
unsigned int idx,
|
unsigned int idx,
|
||||||
_gxio_mpipe_link_name_t * name,
|
_gxio_mpipe_link_name_t *name,
|
||||||
_gxio_mpipe_link_mac_t * mac)
|
_gxio_mpipe_link_mac_t *mac)
|
||||||
{
|
{
|
||||||
int __result;
|
int __result;
|
||||||
struct enumerate_aux_param temp;
|
struct enumerate_aux_param temp;
|
||||||
|
@ -50,7 +49,7 @@ int gxio_mpipe_info_enumerate_aux(gxio_mpipe_info_context_t * context,
|
||||||
|
|
||||||
__result =
|
__result =
|
||||||
hv_dev_pread(context->fd, 0, (HV_VirtAddr) params, sizeof(*params),
|
hv_dev_pread(context->fd, 0, (HV_VirtAddr) params, sizeof(*params),
|
||||||
(((uint64_t) idx << 32) |
|
(((uint64_t)idx << 32) |
|
||||||
GXIO_MPIPE_INFO_OP_ENUMERATE_AUX));
|
GXIO_MPIPE_INFO_OP_ENUMERATE_AUX));
|
||||||
*name = params->name;
|
*name = params->name;
|
||||||
*mac = params->mac;
|
*mac = params->mac;
|
||||||
|
@ -64,7 +63,7 @@ struct get_mmio_base_param {
|
||||||
HV_PTE base;
|
HV_PTE base;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_info_get_mmio_base(gxio_mpipe_info_context_t * context,
|
int gxio_mpipe_info_get_mmio_base(gxio_mpipe_info_context_t *context,
|
||||||
HV_PTE *base)
|
HV_PTE *base)
|
||||||
{
|
{
|
||||||
int __result;
|
int __result;
|
||||||
|
@ -86,7 +85,7 @@ struct check_mmio_offset_param {
|
||||||
unsigned long size;
|
unsigned long size;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_mpipe_info_check_mmio_offset(gxio_mpipe_info_context_t * context,
|
int gxio_mpipe_info_check_mmio_offset(gxio_mpipe_info_context_t *context,
|
||||||
unsigned long offset, unsigned long size)
|
unsigned long offset, unsigned long size)
|
||||||
{
|
{
|
||||||
struct check_mmio_offset_param temp;
|
struct check_mmio_offset_param temp;
|
||||||
|
|
|
@ -21,7 +21,7 @@ struct alloc_asids_param {
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_trio_alloc_asids(gxio_trio_context_t * context, unsigned int count,
|
int gxio_trio_alloc_asids(gxio_trio_context_t *context, unsigned int count,
|
||||||
unsigned int first, unsigned int flags)
|
unsigned int first, unsigned int flags)
|
||||||
{
|
{
|
||||||
struct alloc_asids_param temp;
|
struct alloc_asids_param temp;
|
||||||
|
@ -44,7 +44,7 @@ struct alloc_memory_maps_param {
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_trio_alloc_memory_maps(gxio_trio_context_t * context,
|
int gxio_trio_alloc_memory_maps(gxio_trio_context_t *context,
|
||||||
unsigned int count, unsigned int first,
|
unsigned int count, unsigned int first,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
|
@ -67,7 +67,7 @@ struct alloc_scatter_queues_param {
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_trio_alloc_scatter_queues(gxio_trio_context_t * context,
|
int gxio_trio_alloc_scatter_queues(gxio_trio_context_t *context,
|
||||||
unsigned int count, unsigned int first,
|
unsigned int count, unsigned int first,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
|
@ -91,7 +91,7 @@ struct alloc_pio_regions_param {
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_trio_alloc_pio_regions(gxio_trio_context_t * context,
|
int gxio_trio_alloc_pio_regions(gxio_trio_context_t *context,
|
||||||
unsigned int count, unsigned int first,
|
unsigned int count, unsigned int first,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
|
@ -115,7 +115,7 @@ struct init_pio_region_aux_param {
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_trio_init_pio_region_aux(gxio_trio_context_t * context,
|
int gxio_trio_init_pio_region_aux(gxio_trio_context_t *context,
|
||||||
unsigned int pio_region, unsigned int mac,
|
unsigned int pio_region, unsigned int mac,
|
||||||
uint32_t bus_address_hi, unsigned int flags)
|
uint32_t bus_address_hi, unsigned int flags)
|
||||||
{
|
{
|
||||||
|
@ -145,7 +145,7 @@ struct init_memory_map_mmu_aux_param {
|
||||||
unsigned int order_mode;
|
unsigned int order_mode;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_trio_init_memory_map_mmu_aux(gxio_trio_context_t * context,
|
int gxio_trio_init_memory_map_mmu_aux(gxio_trio_context_t *context,
|
||||||
unsigned int map, unsigned long va,
|
unsigned int map, unsigned long va,
|
||||||
uint64_t size, unsigned int asid,
|
uint64_t size, unsigned int asid,
|
||||||
unsigned int mac, uint64_t bus_address,
|
unsigned int mac, uint64_t bus_address,
|
||||||
|
@ -175,7 +175,7 @@ struct get_port_property_param {
|
||||||
struct pcie_trio_ports_property trio_ports;
|
struct pcie_trio_ports_property trio_ports;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_trio_get_port_property(gxio_trio_context_t * context,
|
int gxio_trio_get_port_property(gxio_trio_context_t *context,
|
||||||
struct pcie_trio_ports_property *trio_ports)
|
struct pcie_trio_ports_property *trio_ports)
|
||||||
{
|
{
|
||||||
int __result;
|
int __result;
|
||||||
|
@ -198,7 +198,7 @@ struct config_legacy_intr_param {
|
||||||
unsigned int intx;
|
unsigned int intx;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_trio_config_legacy_intr(gxio_trio_context_t * context, int inter_x,
|
int gxio_trio_config_legacy_intr(gxio_trio_context_t *context, int inter_x,
|
||||||
int inter_y, int inter_ipi, int inter_event,
|
int inter_y, int inter_ipi, int inter_event,
|
||||||
unsigned int mac, unsigned int intx)
|
unsigned int mac, unsigned int intx)
|
||||||
{
|
{
|
||||||
|
@ -227,7 +227,7 @@ struct config_msi_intr_param {
|
||||||
unsigned int asid;
|
unsigned int asid;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_trio_config_msi_intr(gxio_trio_context_t * context, int inter_x,
|
int gxio_trio_config_msi_intr(gxio_trio_context_t *context, int inter_x,
|
||||||
int inter_y, int inter_ipi, int inter_event,
|
int inter_y, int inter_ipi, int inter_event,
|
||||||
unsigned int mac, unsigned int mem_map,
|
unsigned int mac, unsigned int mem_map,
|
||||||
uint64_t mem_map_base, uint64_t mem_map_limit,
|
uint64_t mem_map_base, uint64_t mem_map_limit,
|
||||||
|
@ -259,7 +259,7 @@ struct set_mps_mrs_param {
|
||||||
unsigned int mac;
|
unsigned int mac;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_trio_set_mps_mrs(gxio_trio_context_t * context, uint16_t mps,
|
int gxio_trio_set_mps_mrs(gxio_trio_context_t *context, uint16_t mps,
|
||||||
uint16_t mrs, unsigned int mac)
|
uint16_t mrs, unsigned int mac)
|
||||||
{
|
{
|
||||||
struct set_mps_mrs_param temp;
|
struct set_mps_mrs_param temp;
|
||||||
|
@ -279,7 +279,7 @@ struct force_rc_link_up_param {
|
||||||
unsigned int mac;
|
unsigned int mac;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_trio_force_rc_link_up(gxio_trio_context_t * context, unsigned int mac)
|
int gxio_trio_force_rc_link_up(gxio_trio_context_t *context, unsigned int mac)
|
||||||
{
|
{
|
||||||
struct force_rc_link_up_param temp;
|
struct force_rc_link_up_param temp;
|
||||||
struct force_rc_link_up_param *params = &temp;
|
struct force_rc_link_up_param *params = &temp;
|
||||||
|
@ -296,7 +296,7 @@ struct force_ep_link_up_param {
|
||||||
unsigned int mac;
|
unsigned int mac;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_trio_force_ep_link_up(gxio_trio_context_t * context, unsigned int mac)
|
int gxio_trio_force_ep_link_up(gxio_trio_context_t *context, unsigned int mac)
|
||||||
{
|
{
|
||||||
struct force_ep_link_up_param temp;
|
struct force_ep_link_up_param temp;
|
||||||
struct force_ep_link_up_param *params = &temp;
|
struct force_ep_link_up_param *params = &temp;
|
||||||
|
@ -313,7 +313,7 @@ struct get_mmio_base_param {
|
||||||
HV_PTE base;
|
HV_PTE base;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_trio_get_mmio_base(gxio_trio_context_t * context, HV_PTE *base)
|
int gxio_trio_get_mmio_base(gxio_trio_context_t *context, HV_PTE *base)
|
||||||
{
|
{
|
||||||
int __result;
|
int __result;
|
||||||
struct get_mmio_base_param temp;
|
struct get_mmio_base_param temp;
|
||||||
|
@ -334,7 +334,7 @@ struct check_mmio_offset_param {
|
||||||
unsigned long size;
|
unsigned long size;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_trio_check_mmio_offset(gxio_trio_context_t * context,
|
int gxio_trio_check_mmio_offset(gxio_trio_context_t *context,
|
||||||
unsigned long offset, unsigned long size)
|
unsigned long offset, unsigned long size)
|
||||||
{
|
{
|
||||||
struct check_mmio_offset_param temp;
|
struct check_mmio_offset_param temp;
|
||||||
|
|
|
@ -19,7 +19,7 @@ struct cfg_interrupt_param {
|
||||||
union iorpc_interrupt interrupt;
|
union iorpc_interrupt interrupt;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_usb_host_cfg_interrupt(gxio_usb_host_context_t * context, int inter_x,
|
int gxio_usb_host_cfg_interrupt(gxio_usb_host_context_t *context, int inter_x,
|
||||||
int inter_y, int inter_ipi, int inter_event)
|
int inter_y, int inter_ipi, int inter_event)
|
||||||
{
|
{
|
||||||
struct cfg_interrupt_param temp;
|
struct cfg_interrupt_param temp;
|
||||||
|
@ -41,7 +41,7 @@ struct register_client_memory_param {
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_usb_host_register_client_memory(gxio_usb_host_context_t * context,
|
int gxio_usb_host_register_client_memory(gxio_usb_host_context_t *context,
|
||||||
HV_PTE pte, unsigned int flags)
|
HV_PTE pte, unsigned int flags)
|
||||||
{
|
{
|
||||||
struct register_client_memory_param temp;
|
struct register_client_memory_param temp;
|
||||||
|
@ -61,7 +61,7 @@ struct get_mmio_base_param {
|
||||||
HV_PTE base;
|
HV_PTE base;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_usb_host_get_mmio_base(gxio_usb_host_context_t * context, HV_PTE *base)
|
int gxio_usb_host_get_mmio_base(gxio_usb_host_context_t *context, HV_PTE *base)
|
||||||
{
|
{
|
||||||
int __result;
|
int __result;
|
||||||
struct get_mmio_base_param temp;
|
struct get_mmio_base_param temp;
|
||||||
|
@ -82,7 +82,7 @@ struct check_mmio_offset_param {
|
||||||
unsigned long size;
|
unsigned long size;
|
||||||
};
|
};
|
||||||
|
|
||||||
int gxio_usb_host_check_mmio_offset(gxio_usb_host_context_t * context,
|
int gxio_usb_host_check_mmio_offset(gxio_usb_host_context_t *context,
|
||||||
unsigned long offset, unsigned long size)
|
unsigned long offset, unsigned long size)
|
||||||
{
|
{
|
||||||
struct check_mmio_offset_param temp;
|
struct check_mmio_offset_param temp;
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include <gxio/kiorpc.h>
|
#include <gxio/kiorpc.h>
|
||||||
#include <gxio/usb_host.h>
|
#include <gxio/usb_host.h>
|
||||||
|
|
||||||
int gxio_usb_host_init(gxio_usb_host_context_t * context, int usb_index,
|
int gxio_usb_host_init(gxio_usb_host_context_t *context, int usb_index,
|
||||||
int is_ehci)
|
int is_ehci)
|
||||||
{
|
{
|
||||||
char file[32];
|
char file[32];
|
||||||
|
@ -63,7 +63,7 @@ int gxio_usb_host_init(gxio_usb_host_context_t * context, int usb_index,
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(gxio_usb_host_init);
|
EXPORT_SYMBOL_GPL(gxio_usb_host_init);
|
||||||
|
|
||||||
int gxio_usb_host_destroy(gxio_usb_host_context_t * context)
|
int gxio_usb_host_destroy(gxio_usb_host_context_t *context)
|
||||||
{
|
{
|
||||||
iounmap((void __force __iomem *)(context->mmio_base));
|
iounmap((void __force __iomem *)(context->mmio_base));
|
||||||
hv_dev_close(context->fd);
|
hv_dev_close(context->fd);
|
||||||
|
@ -76,14 +76,14 @@ int gxio_usb_host_destroy(gxio_usb_host_context_t * context)
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(gxio_usb_host_destroy);
|
EXPORT_SYMBOL_GPL(gxio_usb_host_destroy);
|
||||||
|
|
||||||
void *gxio_usb_host_get_reg_start(gxio_usb_host_context_t * context)
|
void *gxio_usb_host_get_reg_start(gxio_usb_host_context_t *context)
|
||||||
{
|
{
|
||||||
return context->mmio_base;
|
return context->mmio_base;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL_GPL(gxio_usb_host_get_reg_start);
|
EXPORT_SYMBOL_GPL(gxio_usb_host_get_reg_start);
|
||||||
|
|
||||||
size_t gxio_usb_host_get_reg_len(gxio_usb_host_context_t * context)
|
size_t gxio_usb_host_get_reg_len(gxio_usb_host_context_t *context)
|
||||||
{
|
{
|
||||||
return HV_USB_HOST_MMIO_SIZE;
|
return HV_USB_HOST_MMIO_SIZE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,7 +176,18 @@ typedef union
|
||||||
*/
|
*/
|
||||||
uint_reg_t stack_idx : 5;
|
uint_reg_t stack_idx : 5;
|
||||||
/* Reserved. */
|
/* Reserved. */
|
||||||
uint_reg_t __reserved_2 : 5;
|
uint_reg_t __reserved_2 : 3;
|
||||||
|
/*
|
||||||
|
* Instance ID. For devices that support automatic buffer return between
|
||||||
|
* mPIPE instances, this field indicates the buffer owner. If the INST
|
||||||
|
* field does not match the mPIPE's instance number when a packet is
|
||||||
|
* egressed, buffers with HWB set will be returned to the other mPIPE
|
||||||
|
* instance. Note that not all devices support multi-mPIPE buffer
|
||||||
|
* return. The MPIPE_EDMA_INFO.REMOTE_BUFF_RTN_SUPPORT bit indicates
|
||||||
|
* whether the INST field in the buffer descriptor is populated by iDMA
|
||||||
|
* hardware. This field is ignored on writes.
|
||||||
|
*/
|
||||||
|
uint_reg_t inst : 2;
|
||||||
/*
|
/*
|
||||||
* Reads as one to indicate that this is a hardware managed buffer.
|
* Reads as one to indicate that this is a hardware managed buffer.
|
||||||
* Ignored on writes since all buffers on a given stack are the same size.
|
* Ignored on writes since all buffers on a given stack are the same size.
|
||||||
|
@ -205,7 +216,8 @@ typedef union
|
||||||
uint_reg_t c : 2;
|
uint_reg_t c : 2;
|
||||||
uint_reg_t size : 3;
|
uint_reg_t size : 3;
|
||||||
uint_reg_t hwb : 1;
|
uint_reg_t hwb : 1;
|
||||||
uint_reg_t __reserved_2 : 5;
|
uint_reg_t inst : 2;
|
||||||
|
uint_reg_t __reserved_2 : 3;
|
||||||
uint_reg_t stack_idx : 5;
|
uint_reg_t stack_idx : 5;
|
||||||
uint_reg_t __reserved_1 : 6;
|
uint_reg_t __reserved_1 : 6;
|
||||||
int_reg_t va : 35;
|
int_reg_t va : 35;
|
||||||
|
@ -231,9 +243,9 @@ typedef union
|
||||||
/* Reserved. */
|
/* Reserved. */
|
||||||
uint_reg_t __reserved_0 : 3;
|
uint_reg_t __reserved_0 : 3;
|
||||||
/* eDMA ring being accessed */
|
/* eDMA ring being accessed */
|
||||||
uint_reg_t ring : 5;
|
uint_reg_t ring : 6;
|
||||||
/* Reserved. */
|
/* Reserved. */
|
||||||
uint_reg_t __reserved_1 : 18;
|
uint_reg_t __reserved_1 : 17;
|
||||||
/*
|
/*
|
||||||
* This field of the address selects the region (address space) to be
|
* This field of the address selects the region (address space) to be
|
||||||
* accessed. For the egress DMA post region, this field must be 5.
|
* accessed. For the egress DMA post region, this field must be 5.
|
||||||
|
@ -250,8 +262,8 @@ typedef union
|
||||||
uint_reg_t svc_dom : 5;
|
uint_reg_t svc_dom : 5;
|
||||||
uint_reg_t __reserved_2 : 6;
|
uint_reg_t __reserved_2 : 6;
|
||||||
uint_reg_t region : 3;
|
uint_reg_t region : 3;
|
||||||
uint_reg_t __reserved_1 : 18;
|
uint_reg_t __reserved_1 : 17;
|
||||||
uint_reg_t ring : 5;
|
uint_reg_t ring : 6;
|
||||||
uint_reg_t __reserved_0 : 3;
|
uint_reg_t __reserved_0 : 3;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,13 +16,13 @@
|
||||||
#ifndef __ARCH_MPIPE_CONSTANTS_H__
|
#ifndef __ARCH_MPIPE_CONSTANTS_H__
|
||||||
#define __ARCH_MPIPE_CONSTANTS_H__
|
#define __ARCH_MPIPE_CONSTANTS_H__
|
||||||
|
|
||||||
#define MPIPE_NUM_CLASSIFIERS 10
|
#define MPIPE_NUM_CLASSIFIERS 16
|
||||||
#define MPIPE_CLS_MHZ 1200
|
#define MPIPE_CLS_MHZ 1200
|
||||||
|
|
||||||
#define MPIPE_NUM_EDMA_RINGS 32
|
#define MPIPE_NUM_EDMA_RINGS 64
|
||||||
|
|
||||||
#define MPIPE_NUM_SGMII_MACS 16
|
#define MPIPE_NUM_SGMII_MACS 16
|
||||||
#define MPIPE_NUM_XAUI_MACS 4
|
#define MPIPE_NUM_XAUI_MACS 16
|
||||||
#define MPIPE_NUM_LOOPBACK_CHANNELS 4
|
#define MPIPE_NUM_LOOPBACK_CHANNELS 4
|
||||||
#define MPIPE_NUM_NON_LB_CHANNELS 28
|
#define MPIPE_NUM_NON_LB_CHANNELS 28
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,14 @@ typedef union
|
||||||
* descriptors toggles each time the ring tail pointer wraps.
|
* descriptors toggles each time the ring tail pointer wraps.
|
||||||
*/
|
*/
|
||||||
uint_reg_t gen : 1;
|
uint_reg_t gen : 1;
|
||||||
|
/**
|
||||||
|
* For devices with EDMA reorder support, this field allows the
|
||||||
|
* descriptor to select the egress FIFO. The associated DMA ring must
|
||||||
|
* have ALLOW_EFIFO_SEL enabled.
|
||||||
|
*/
|
||||||
|
uint_reg_t efifo_sel : 6;
|
||||||
/** Reserved. Must be zero. */
|
/** Reserved. Must be zero. */
|
||||||
uint_reg_t r0 : 7;
|
uint_reg_t r0 : 1;
|
||||||
/** Checksum generation enabled for this transfer. */
|
/** Checksum generation enabled for this transfer. */
|
||||||
uint_reg_t csum : 1;
|
uint_reg_t csum : 1;
|
||||||
/**
|
/**
|
||||||
|
@ -110,7 +116,8 @@ typedef union
|
||||||
uint_reg_t notif : 1;
|
uint_reg_t notif : 1;
|
||||||
uint_reg_t ns : 1;
|
uint_reg_t ns : 1;
|
||||||
uint_reg_t csum : 1;
|
uint_reg_t csum : 1;
|
||||||
uint_reg_t r0 : 7;
|
uint_reg_t r0 : 1;
|
||||||
|
uint_reg_t efifo_sel : 6;
|
||||||
uint_reg_t gen : 1;
|
uint_reg_t gen : 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -126,14 +133,16 @@ typedef union
|
||||||
/** Reserved. */
|
/** Reserved. */
|
||||||
uint_reg_t __reserved_1 : 3;
|
uint_reg_t __reserved_1 : 3;
|
||||||
/**
|
/**
|
||||||
* Instance ID. For devices that support more than one mPIPE instance,
|
* Instance ID. For devices that support automatic buffer return between
|
||||||
* this field indicates the buffer owner. If the INST field does not
|
* mPIPE instances, this field indicates the buffer owner. If the INST
|
||||||
* match the mPIPE's instance number when a packet is egressed, buffers
|
* field does not match the mPIPE's instance number when a packet is
|
||||||
* with HWB set will be returned to the other mPIPE instance.
|
* egressed, buffers with HWB set will be returned to the other mPIPE
|
||||||
|
* instance. Note that not all devices support multi-mPIPE buffer
|
||||||
|
* return. The MPIPE_EDMA_INFO.REMOTE_BUFF_RTN_SUPPORT bit indicates
|
||||||
|
* whether the INST field in the buffer descriptor is populated by iDMA
|
||||||
|
* hardware.
|
||||||
*/
|
*/
|
||||||
uint_reg_t inst : 1;
|
uint_reg_t inst : 2;
|
||||||
/** Reserved. */
|
|
||||||
uint_reg_t __reserved_2 : 1;
|
|
||||||
/**
|
/**
|
||||||
* Always set to one by hardware in iDMA packet descriptors. For eDMA,
|
* Always set to one by hardware in iDMA packet descriptors. For eDMA,
|
||||||
* indicates whether the buffer will be released to the buffer stack
|
* indicates whether the buffer will be released to the buffer stack
|
||||||
|
@ -166,8 +175,7 @@ typedef union
|
||||||
uint_reg_t c : 2;
|
uint_reg_t c : 2;
|
||||||
uint_reg_t size : 3;
|
uint_reg_t size : 3;
|
||||||
uint_reg_t hwb : 1;
|
uint_reg_t hwb : 1;
|
||||||
uint_reg_t __reserved_2 : 1;
|
uint_reg_t inst : 2;
|
||||||
uint_reg_t inst : 1;
|
|
||||||
uint_reg_t __reserved_1 : 3;
|
uint_reg_t __reserved_1 : 3;
|
||||||
uint_reg_t stack_idx : 5;
|
uint_reg_t stack_idx : 5;
|
||||||
uint_reg_t __reserved_0 : 6;
|
uint_reg_t __reserved_0 : 6;
|
||||||
|
@ -408,7 +416,10 @@ typedef union
|
||||||
/**
|
/**
|
||||||
* Sequence number applied when packet is distributed. Classifier
|
* Sequence number applied when packet is distributed. Classifier
|
||||||
* selects which sequence number is to be applied by writing the 13-bit
|
* selects which sequence number is to be applied by writing the 13-bit
|
||||||
* SQN-selector into this field.
|
* SQN-selector into this field. For devices that support EXT_SQN (as
|
||||||
|
* indicated in IDMA_INFO.EXT_SQN_SUPPORT), the GP_SQN can be extended to
|
||||||
|
* 32-bits via the IDMA_CTL.EXT_SQN register. In this case the
|
||||||
|
* PACKET_SQN will be reduced to 32 bits.
|
||||||
*/
|
*/
|
||||||
uint_reg_t gp_sqn : 16;
|
uint_reg_t gp_sqn : 16;
|
||||||
/**
|
/**
|
||||||
|
@ -451,14 +462,16 @@ typedef union
|
||||||
/** Reserved. */
|
/** Reserved. */
|
||||||
uint_reg_t __reserved_5 : 3;
|
uint_reg_t __reserved_5 : 3;
|
||||||
/**
|
/**
|
||||||
* Instance ID. For devices that support more than one mPIPE instance,
|
* Instance ID. For devices that support automatic buffer return between
|
||||||
* this field indicates the buffer owner. If the INST field does not
|
* mPIPE instances, this field indicates the buffer owner. If the INST
|
||||||
* match the mPIPE's instance number when a packet is egressed, buffers
|
* field does not match the mPIPE's instance number when a packet is
|
||||||
* with HWB set will be returned to the other mPIPE instance.
|
* egressed, buffers with HWB set will be returned to the other mPIPE
|
||||||
|
* instance. Note that not all devices support multi-mPIPE buffer
|
||||||
|
* return. The MPIPE_EDMA_INFO.REMOTE_BUFF_RTN_SUPPORT bit indicates
|
||||||
|
* whether the INST field in the buffer descriptor is populated by iDMA
|
||||||
|
* hardware.
|
||||||
*/
|
*/
|
||||||
uint_reg_t inst : 1;
|
uint_reg_t inst : 2;
|
||||||
/** Reserved. */
|
|
||||||
uint_reg_t __reserved_6 : 1;
|
|
||||||
/**
|
/**
|
||||||
* Always set to one by hardware in iDMA packet descriptors. For eDMA,
|
* Always set to one by hardware in iDMA packet descriptors. For eDMA,
|
||||||
* indicates whether the buffer will be released to the buffer stack
|
* indicates whether the buffer will be released to the buffer stack
|
||||||
|
@ -491,8 +504,7 @@ typedef union
|
||||||
uint_reg_t c : 2;
|
uint_reg_t c : 2;
|
||||||
uint_reg_t size : 3;
|
uint_reg_t size : 3;
|
||||||
uint_reg_t hwb : 1;
|
uint_reg_t hwb : 1;
|
||||||
uint_reg_t __reserved_6 : 1;
|
uint_reg_t inst : 2;
|
||||||
uint_reg_t inst : 1;
|
|
||||||
uint_reg_t __reserved_5 : 3;
|
uint_reg_t __reserved_5 : 3;
|
||||||
uint_reg_t stack_idx : 5;
|
uint_reg_t stack_idx : 5;
|
||||||
uint_reg_t __reserved_4 : 6;
|
uint_reg_t __reserved_4 : 6;
|
||||||
|
|
|
@ -16,21 +16,21 @@
|
||||||
#ifndef __ARCH_TRIO_CONSTANTS_H__
|
#ifndef __ARCH_TRIO_CONSTANTS_H__
|
||||||
#define __ARCH_TRIO_CONSTANTS_H__
|
#define __ARCH_TRIO_CONSTANTS_H__
|
||||||
|
|
||||||
#define TRIO_NUM_ASIDS 16
|
#define TRIO_NUM_ASIDS 32
|
||||||
#define TRIO_NUM_TLBS_PER_ASID 16
|
#define TRIO_NUM_TLBS_PER_ASID 16
|
||||||
|
|
||||||
#define TRIO_NUM_TPIO_REGIONS 8
|
#define TRIO_NUM_TPIO_REGIONS 8
|
||||||
#define TRIO_LOG2_NUM_TPIO_REGIONS 3
|
#define TRIO_LOG2_NUM_TPIO_REGIONS 3
|
||||||
|
|
||||||
#define TRIO_NUM_MAP_MEM_REGIONS 16
|
#define TRIO_NUM_MAP_MEM_REGIONS 32
|
||||||
#define TRIO_LOG2_NUM_MAP_MEM_REGIONS 4
|
#define TRIO_LOG2_NUM_MAP_MEM_REGIONS 5
|
||||||
#define TRIO_NUM_MAP_SQ_REGIONS 8
|
#define TRIO_NUM_MAP_SQ_REGIONS 8
|
||||||
#define TRIO_LOG2_NUM_MAP_SQ_REGIONS 3
|
#define TRIO_LOG2_NUM_MAP_SQ_REGIONS 3
|
||||||
|
|
||||||
#define TRIO_LOG2_NUM_SQ_FIFO_ENTRIES 6
|
#define TRIO_LOG2_NUM_SQ_FIFO_ENTRIES 6
|
||||||
|
|
||||||
#define TRIO_NUM_PUSH_DMA_RINGS 32
|
#define TRIO_NUM_PUSH_DMA_RINGS 64
|
||||||
|
|
||||||
#define TRIO_NUM_PULL_DMA_RINGS 32
|
#define TRIO_NUM_PULL_DMA_RINGS 64
|
||||||
|
|
||||||
#endif /* __ARCH_TRIO_CONSTANTS_H__ */
|
#endif /* __ARCH_TRIO_CONSTANTS_H__ */
|
||||||
|
|
|
@ -182,10 +182,9 @@ static inline __attribute_const__ int get_order(unsigned long size)
|
||||||
|
|
||||||
#define PAGE_OFFSET (-(_AC(1, UL) << (MAX_VA_WIDTH - 1)))
|
#define PAGE_OFFSET (-(_AC(1, UL) << (MAX_VA_WIDTH - 1)))
|
||||||
#define KERNEL_HIGH_VADDR _AC(0xfffffff800000000, UL) /* high 32GB */
|
#define KERNEL_HIGH_VADDR _AC(0xfffffff800000000, UL) /* high 32GB */
|
||||||
#define FIXADDR_BASE (KERNEL_HIGH_VADDR - 0x400000000) /* 4 GB */
|
#define FIXADDR_BASE (KERNEL_HIGH_VADDR - 0x300000000) /* 4 GB */
|
||||||
#define FIXADDR_TOP (KERNEL_HIGH_VADDR - 0x300000000) /* 4 GB */
|
#define FIXADDR_TOP (KERNEL_HIGH_VADDR - 0x200000000) /* 4 GB */
|
||||||
#define _VMALLOC_START FIXADDR_TOP
|
#define _VMALLOC_START FIXADDR_TOP
|
||||||
#define HUGE_VMAP_BASE (KERNEL_HIGH_VADDR - 0x200000000) /* 4 GB */
|
|
||||||
#define MEM_SV_START (KERNEL_HIGH_VADDR - 0x100000000) /* 256 MB */
|
#define MEM_SV_START (KERNEL_HIGH_VADDR - 0x100000000) /* 256 MB */
|
||||||
#define MEM_MODULE_START (MEM_SV_START + (256*1024*1024)) /* 256 MB */
|
#define MEM_MODULE_START (MEM_SV_START + (256*1024*1024)) /* 256 MB */
|
||||||
#define MEM_MODULE_END (MEM_MODULE_START + (256*1024*1024))
|
#define MEM_MODULE_END (MEM_MODULE_START + (256*1024*1024))
|
||||||
|
|
|
@ -55,17 +55,9 @@
|
||||||
#define PKMAP_BASE ((FIXADDR_BOOT_START - PAGE_SIZE*LAST_PKMAP) & PGDIR_MASK)
|
#define PKMAP_BASE ((FIXADDR_BOOT_START - PAGE_SIZE*LAST_PKMAP) & PGDIR_MASK)
|
||||||
|
|
||||||
#ifdef CONFIG_HIGHMEM
|
#ifdef CONFIG_HIGHMEM
|
||||||
# define __VMAPPING_END (PKMAP_BASE & ~(HPAGE_SIZE-1))
|
# define _VMALLOC_END (PKMAP_BASE & ~(HPAGE_SIZE-1))
|
||||||
#else
|
#else
|
||||||
# define __VMAPPING_END (FIXADDR_START & ~(HPAGE_SIZE-1))
|
# define _VMALLOC_END (FIXADDR_START & ~(HPAGE_SIZE-1))
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_HUGEVMAP
|
|
||||||
#define HUGE_VMAP_END __VMAPPING_END
|
|
||||||
#define HUGE_VMAP_BASE (HUGE_VMAP_END - CONFIG_NR_HUGE_VMAPS * HPAGE_SIZE)
|
|
||||||
#define _VMALLOC_END HUGE_VMAP_BASE
|
|
||||||
#else
|
|
||||||
#define _VMALLOC_END __VMAPPING_END
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -52,12 +52,10 @@
|
||||||
* memory allocation code). The vmalloc code puts in an internal
|
* memory allocation code). The vmalloc code puts in an internal
|
||||||
* guard page between each allocation.
|
* guard page between each allocation.
|
||||||
*/
|
*/
|
||||||
#define _VMALLOC_END HUGE_VMAP_BASE
|
#define _VMALLOC_END MEM_SV_START
|
||||||
#define VMALLOC_END _VMALLOC_END
|
#define VMALLOC_END _VMALLOC_END
|
||||||
#define VMALLOC_START _VMALLOC_START
|
#define VMALLOC_START _VMALLOC_START
|
||||||
|
|
||||||
#define HUGE_VMAP_END (HUGE_VMAP_BASE + PGDIR_SIZE)
|
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
/* We have no pud since we are a three-level page table. */
|
/* We have no pud since we are a three-level page table. */
|
||||||
|
|
|
@ -56,89 +56,89 @@
|
||||||
#define GXIO_MPIPE_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000)
|
#define GXIO_MPIPE_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000)
|
||||||
#define GXIO_MPIPE_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001)
|
#define GXIO_MPIPE_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001)
|
||||||
|
|
||||||
int gxio_mpipe_alloc_buffer_stacks(gxio_mpipe_context_t * context,
|
int gxio_mpipe_alloc_buffer_stacks(gxio_mpipe_context_t *context,
|
||||||
unsigned int count, unsigned int first,
|
unsigned int count, unsigned int first,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
|
|
||||||
int gxio_mpipe_init_buffer_stack_aux(gxio_mpipe_context_t * context,
|
int gxio_mpipe_init_buffer_stack_aux(gxio_mpipe_context_t *context,
|
||||||
void *mem_va, size_t mem_size,
|
void *mem_va, size_t mem_size,
|
||||||
unsigned int mem_flags, unsigned int stack,
|
unsigned int mem_flags, unsigned int stack,
|
||||||
unsigned int buffer_size_enum);
|
unsigned int buffer_size_enum);
|
||||||
|
|
||||||
|
|
||||||
int gxio_mpipe_alloc_notif_rings(gxio_mpipe_context_t * context,
|
int gxio_mpipe_alloc_notif_rings(gxio_mpipe_context_t *context,
|
||||||
unsigned int count, unsigned int first,
|
unsigned int count, unsigned int first,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
|
|
||||||
int gxio_mpipe_init_notif_ring_aux(gxio_mpipe_context_t * context, void *mem_va,
|
int gxio_mpipe_init_notif_ring_aux(gxio_mpipe_context_t *context, void *mem_va,
|
||||||
size_t mem_size, unsigned int mem_flags,
|
size_t mem_size, unsigned int mem_flags,
|
||||||
unsigned int ring);
|
unsigned int ring);
|
||||||
|
|
||||||
int gxio_mpipe_request_notif_ring_interrupt(gxio_mpipe_context_t * context,
|
int gxio_mpipe_request_notif_ring_interrupt(gxio_mpipe_context_t *context,
|
||||||
int inter_x, int inter_y,
|
int inter_x, int inter_y,
|
||||||
int inter_ipi, int inter_event,
|
int inter_ipi, int inter_event,
|
||||||
unsigned int ring);
|
unsigned int ring);
|
||||||
|
|
||||||
int gxio_mpipe_enable_notif_ring_interrupt(gxio_mpipe_context_t * context,
|
int gxio_mpipe_enable_notif_ring_interrupt(gxio_mpipe_context_t *context,
|
||||||
unsigned int ring);
|
unsigned int ring);
|
||||||
|
|
||||||
int gxio_mpipe_alloc_notif_groups(gxio_mpipe_context_t * context,
|
int gxio_mpipe_alloc_notif_groups(gxio_mpipe_context_t *context,
|
||||||
unsigned int count, unsigned int first,
|
unsigned int count, unsigned int first,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
|
|
||||||
int gxio_mpipe_init_notif_group(gxio_mpipe_context_t * context,
|
int gxio_mpipe_init_notif_group(gxio_mpipe_context_t *context,
|
||||||
unsigned int group,
|
unsigned int group,
|
||||||
gxio_mpipe_notif_group_bits_t bits);
|
gxio_mpipe_notif_group_bits_t bits);
|
||||||
|
|
||||||
int gxio_mpipe_alloc_buckets(gxio_mpipe_context_t * context, unsigned int count,
|
int gxio_mpipe_alloc_buckets(gxio_mpipe_context_t *context, unsigned int count,
|
||||||
unsigned int first, unsigned int flags);
|
unsigned int first, unsigned int flags);
|
||||||
|
|
||||||
int gxio_mpipe_init_bucket(gxio_mpipe_context_t * context, unsigned int bucket,
|
int gxio_mpipe_init_bucket(gxio_mpipe_context_t *context, unsigned int bucket,
|
||||||
MPIPE_LBL_INIT_DAT_BSTS_TBL_t bucket_info);
|
MPIPE_LBL_INIT_DAT_BSTS_TBL_t bucket_info);
|
||||||
|
|
||||||
int gxio_mpipe_alloc_edma_rings(gxio_mpipe_context_t * context,
|
int gxio_mpipe_alloc_edma_rings(gxio_mpipe_context_t *context,
|
||||||
unsigned int count, unsigned int first,
|
unsigned int count, unsigned int first,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
|
|
||||||
int gxio_mpipe_init_edma_ring_aux(gxio_mpipe_context_t * context, void *mem_va,
|
int gxio_mpipe_init_edma_ring_aux(gxio_mpipe_context_t *context, void *mem_va,
|
||||||
size_t mem_size, unsigned int mem_flags,
|
size_t mem_size, unsigned int mem_flags,
|
||||||
unsigned int ring, unsigned int channel);
|
unsigned int ring, unsigned int channel);
|
||||||
|
|
||||||
|
|
||||||
int gxio_mpipe_commit_rules(gxio_mpipe_context_t * context, const void *blob,
|
int gxio_mpipe_commit_rules(gxio_mpipe_context_t *context, const void *blob,
|
||||||
size_t blob_size);
|
size_t blob_size);
|
||||||
|
|
||||||
int gxio_mpipe_register_client_memory(gxio_mpipe_context_t * context,
|
int gxio_mpipe_register_client_memory(gxio_mpipe_context_t *context,
|
||||||
unsigned int iotlb, HV_PTE pte,
|
unsigned int iotlb, HV_PTE pte,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
|
|
||||||
int gxio_mpipe_link_open_aux(gxio_mpipe_context_t * context,
|
int gxio_mpipe_link_open_aux(gxio_mpipe_context_t *context,
|
||||||
_gxio_mpipe_link_name_t name, unsigned int flags);
|
_gxio_mpipe_link_name_t name, unsigned int flags);
|
||||||
|
|
||||||
int gxio_mpipe_link_close_aux(gxio_mpipe_context_t * context, int mac);
|
int gxio_mpipe_link_close_aux(gxio_mpipe_context_t *context, int mac);
|
||||||
|
|
||||||
int gxio_mpipe_link_set_attr_aux(gxio_mpipe_context_t * context, int mac,
|
int gxio_mpipe_link_set_attr_aux(gxio_mpipe_context_t *context, int mac,
|
||||||
uint32_t attr, int64_t val);
|
uint32_t attr, int64_t val);
|
||||||
|
|
||||||
int gxio_mpipe_get_timestamp_aux(gxio_mpipe_context_t * context, uint64_t * sec,
|
int gxio_mpipe_get_timestamp_aux(gxio_mpipe_context_t *context, uint64_t *sec,
|
||||||
uint64_t * nsec, uint64_t * cycles);
|
uint64_t *nsec, uint64_t *cycles);
|
||||||
|
|
||||||
int gxio_mpipe_set_timestamp_aux(gxio_mpipe_context_t * context, uint64_t sec,
|
int gxio_mpipe_set_timestamp_aux(gxio_mpipe_context_t *context, uint64_t sec,
|
||||||
uint64_t nsec, uint64_t cycles);
|
uint64_t nsec, uint64_t cycles);
|
||||||
|
|
||||||
int gxio_mpipe_adjust_timestamp_aux(gxio_mpipe_context_t * context,
|
int gxio_mpipe_adjust_timestamp_aux(gxio_mpipe_context_t *context,
|
||||||
int64_t nsec);
|
int64_t nsec);
|
||||||
|
|
||||||
int gxio_mpipe_adjust_timestamp_freq(gxio_mpipe_context_t * context,
|
int gxio_mpipe_adjust_timestamp_freq(gxio_mpipe_context_t *context,
|
||||||
int32_t ppb);
|
int32_t ppb);
|
||||||
|
|
||||||
int gxio_mpipe_arm_pollfd(gxio_mpipe_context_t * context, int pollfd_cookie);
|
int gxio_mpipe_arm_pollfd(gxio_mpipe_context_t *context, int pollfd_cookie);
|
||||||
|
|
||||||
int gxio_mpipe_close_pollfd(gxio_mpipe_context_t * context, int pollfd_cookie);
|
int gxio_mpipe_close_pollfd(gxio_mpipe_context_t *context, int pollfd_cookie);
|
||||||
|
|
||||||
int gxio_mpipe_get_mmio_base(gxio_mpipe_context_t * context, HV_PTE *base);
|
int gxio_mpipe_get_mmio_base(gxio_mpipe_context_t *context, HV_PTE *base);
|
||||||
|
|
||||||
int gxio_mpipe_check_mmio_offset(gxio_mpipe_context_t * context,
|
int gxio_mpipe_check_mmio_offset(gxio_mpipe_context_t *context,
|
||||||
unsigned long offset, unsigned long size);
|
unsigned long offset, unsigned long size);
|
||||||
|
|
||||||
#endif /* !__GXIO_MPIPE_LINUX_RPC_H__ */
|
#endif /* !__GXIO_MPIPE_LINUX_RPC_H__ */
|
||||||
|
|
|
@ -33,18 +33,18 @@
|
||||||
#define GXIO_MPIPE_INFO_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001)
|
#define GXIO_MPIPE_INFO_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001)
|
||||||
|
|
||||||
|
|
||||||
int gxio_mpipe_info_instance_aux(gxio_mpipe_info_context_t * context,
|
int gxio_mpipe_info_instance_aux(gxio_mpipe_info_context_t *context,
|
||||||
_gxio_mpipe_link_name_t name);
|
_gxio_mpipe_link_name_t name);
|
||||||
|
|
||||||
int gxio_mpipe_info_enumerate_aux(gxio_mpipe_info_context_t * context,
|
int gxio_mpipe_info_enumerate_aux(gxio_mpipe_info_context_t *context,
|
||||||
unsigned int idx,
|
unsigned int idx,
|
||||||
_gxio_mpipe_link_name_t * name,
|
_gxio_mpipe_link_name_t *name,
|
||||||
_gxio_mpipe_link_mac_t * mac);
|
_gxio_mpipe_link_mac_t *mac);
|
||||||
|
|
||||||
int gxio_mpipe_info_get_mmio_base(gxio_mpipe_info_context_t * context,
|
int gxio_mpipe_info_get_mmio_base(gxio_mpipe_info_context_t *context,
|
||||||
HV_PTE *base);
|
HV_PTE *base);
|
||||||
|
|
||||||
int gxio_mpipe_info_check_mmio_offset(gxio_mpipe_info_context_t * context,
|
int gxio_mpipe_info_check_mmio_offset(gxio_mpipe_info_context_t *context,
|
||||||
unsigned long offset, unsigned long size);
|
unsigned long offset, unsigned long size);
|
||||||
|
|
||||||
#endif /* !__GXIO_MPIPE_INFO_LINUX_RPC_H__ */
|
#endif /* !__GXIO_MPIPE_INFO_LINUX_RPC_H__ */
|
||||||
|
|
|
@ -46,59 +46,59 @@
|
||||||
#define GXIO_TRIO_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000)
|
#define GXIO_TRIO_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000)
|
||||||
#define GXIO_TRIO_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001)
|
#define GXIO_TRIO_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001)
|
||||||
|
|
||||||
int gxio_trio_alloc_asids(gxio_trio_context_t * context, unsigned int count,
|
int gxio_trio_alloc_asids(gxio_trio_context_t *context, unsigned int count,
|
||||||
unsigned int first, unsigned int flags);
|
unsigned int first, unsigned int flags);
|
||||||
|
|
||||||
|
|
||||||
int gxio_trio_alloc_memory_maps(gxio_trio_context_t * context,
|
int gxio_trio_alloc_memory_maps(gxio_trio_context_t *context,
|
||||||
unsigned int count, unsigned int first,
|
unsigned int count, unsigned int first,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
|
|
||||||
|
|
||||||
int gxio_trio_alloc_scatter_queues(gxio_trio_context_t * context,
|
int gxio_trio_alloc_scatter_queues(gxio_trio_context_t *context,
|
||||||
unsigned int count, unsigned int first,
|
unsigned int count, unsigned int first,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
|
|
||||||
int gxio_trio_alloc_pio_regions(gxio_trio_context_t * context,
|
int gxio_trio_alloc_pio_regions(gxio_trio_context_t *context,
|
||||||
unsigned int count, unsigned int first,
|
unsigned int count, unsigned int first,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
|
|
||||||
int gxio_trio_init_pio_region_aux(gxio_trio_context_t * context,
|
int gxio_trio_init_pio_region_aux(gxio_trio_context_t *context,
|
||||||
unsigned int pio_region, unsigned int mac,
|
unsigned int pio_region, unsigned int mac,
|
||||||
uint32_t bus_address_hi, unsigned int flags);
|
uint32_t bus_address_hi, unsigned int flags);
|
||||||
|
|
||||||
|
|
||||||
int gxio_trio_init_memory_map_mmu_aux(gxio_trio_context_t * context,
|
int gxio_trio_init_memory_map_mmu_aux(gxio_trio_context_t *context,
|
||||||
unsigned int map, unsigned long va,
|
unsigned int map, unsigned long va,
|
||||||
uint64_t size, unsigned int asid,
|
uint64_t size, unsigned int asid,
|
||||||
unsigned int mac, uint64_t bus_address,
|
unsigned int mac, uint64_t bus_address,
|
||||||
unsigned int node,
|
unsigned int node,
|
||||||
unsigned int order_mode);
|
unsigned int order_mode);
|
||||||
|
|
||||||
int gxio_trio_get_port_property(gxio_trio_context_t * context,
|
int gxio_trio_get_port_property(gxio_trio_context_t *context,
|
||||||
struct pcie_trio_ports_property *trio_ports);
|
struct pcie_trio_ports_property *trio_ports);
|
||||||
|
|
||||||
int gxio_trio_config_legacy_intr(gxio_trio_context_t * context, int inter_x,
|
int gxio_trio_config_legacy_intr(gxio_trio_context_t *context, int inter_x,
|
||||||
int inter_y, int inter_ipi, int inter_event,
|
int inter_y, int inter_ipi, int inter_event,
|
||||||
unsigned int mac, unsigned int intx);
|
unsigned int mac, unsigned int intx);
|
||||||
|
|
||||||
int gxio_trio_config_msi_intr(gxio_trio_context_t * context, int inter_x,
|
int gxio_trio_config_msi_intr(gxio_trio_context_t *context, int inter_x,
|
||||||
int inter_y, int inter_ipi, int inter_event,
|
int inter_y, int inter_ipi, int inter_event,
|
||||||
unsigned int mac, unsigned int mem_map,
|
unsigned int mac, unsigned int mem_map,
|
||||||
uint64_t mem_map_base, uint64_t mem_map_limit,
|
uint64_t mem_map_base, uint64_t mem_map_limit,
|
||||||
unsigned int asid);
|
unsigned int asid);
|
||||||
|
|
||||||
|
|
||||||
int gxio_trio_set_mps_mrs(gxio_trio_context_t * context, uint16_t mps,
|
int gxio_trio_set_mps_mrs(gxio_trio_context_t *context, uint16_t mps,
|
||||||
uint16_t mrs, unsigned int mac);
|
uint16_t mrs, unsigned int mac);
|
||||||
|
|
||||||
int gxio_trio_force_rc_link_up(gxio_trio_context_t * context, unsigned int mac);
|
int gxio_trio_force_rc_link_up(gxio_trio_context_t *context, unsigned int mac);
|
||||||
|
|
||||||
int gxio_trio_force_ep_link_up(gxio_trio_context_t * context, unsigned int mac);
|
int gxio_trio_force_ep_link_up(gxio_trio_context_t *context, unsigned int mac);
|
||||||
|
|
||||||
int gxio_trio_get_mmio_base(gxio_trio_context_t * context, HV_PTE *base);
|
int gxio_trio_get_mmio_base(gxio_trio_context_t *context, HV_PTE *base);
|
||||||
|
|
||||||
int gxio_trio_check_mmio_offset(gxio_trio_context_t * context,
|
int gxio_trio_check_mmio_offset(gxio_trio_context_t *context,
|
||||||
unsigned long offset, unsigned long size);
|
unsigned long offset, unsigned long size);
|
||||||
|
|
||||||
#endif /* !__GXIO_TRIO_LINUX_RPC_H__ */
|
#endif /* !__GXIO_TRIO_LINUX_RPC_H__ */
|
||||||
|
|
|
@ -31,16 +31,16 @@
|
||||||
#define GXIO_USB_HOST_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000)
|
#define GXIO_USB_HOST_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000)
|
||||||
#define GXIO_USB_HOST_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001)
|
#define GXIO_USB_HOST_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001)
|
||||||
|
|
||||||
int gxio_usb_host_cfg_interrupt(gxio_usb_host_context_t * context, int inter_x,
|
int gxio_usb_host_cfg_interrupt(gxio_usb_host_context_t *context, int inter_x,
|
||||||
int inter_y, int inter_ipi, int inter_event);
|
int inter_y, int inter_ipi, int inter_event);
|
||||||
|
|
||||||
int gxio_usb_host_register_client_memory(gxio_usb_host_context_t * context,
|
int gxio_usb_host_register_client_memory(gxio_usb_host_context_t *context,
|
||||||
HV_PTE pte, unsigned int flags);
|
HV_PTE pte, unsigned int flags);
|
||||||
|
|
||||||
int gxio_usb_host_get_mmio_base(gxio_usb_host_context_t * context,
|
int gxio_usb_host_get_mmio_base(gxio_usb_host_context_t *context,
|
||||||
HV_PTE *base);
|
HV_PTE *base);
|
||||||
|
|
||||||
int gxio_usb_host_check_mmio_offset(gxio_usb_host_context_t * context,
|
int gxio_usb_host_check_mmio_offset(gxio_usb_host_context_t *context,
|
||||||
unsigned long offset, unsigned long size);
|
unsigned long offset, unsigned long size);
|
||||||
|
|
||||||
#endif /* !__GXIO_USB_HOST_LINUX_RPC_H__ */
|
#endif /* !__GXIO_USB_HOST_LINUX_RPC_H__ */
|
||||||
|
|
|
@ -53,7 +53,7 @@ typedef struct {
|
||||||
* @return Zero if the context was successfully initialized, else a
|
* @return Zero if the context was successfully initialized, else a
|
||||||
* GXIO_ERR_xxx error code.
|
* GXIO_ERR_xxx error code.
|
||||||
*/
|
*/
|
||||||
extern int gxio_usb_host_init(gxio_usb_host_context_t * context, int usb_index,
|
extern int gxio_usb_host_init(gxio_usb_host_context_t *context, int usb_index,
|
||||||
int is_ehci);
|
int is_ehci);
|
||||||
|
|
||||||
/* Destroy a USB context.
|
/* Destroy a USB context.
|
||||||
|
@ -68,20 +68,20 @@ extern int gxio_usb_host_init(gxio_usb_host_context_t * context, int usb_index,
|
||||||
* @return Zero if the context was successfully destroyed, else a
|
* @return Zero if the context was successfully destroyed, else a
|
||||||
* GXIO_ERR_xxx error code.
|
* GXIO_ERR_xxx error code.
|
||||||
*/
|
*/
|
||||||
extern int gxio_usb_host_destroy(gxio_usb_host_context_t * context);
|
extern int gxio_usb_host_destroy(gxio_usb_host_context_t *context);
|
||||||
|
|
||||||
/* Retrieve the address of the shim's MMIO registers.
|
/* Retrieve the address of the shim's MMIO registers.
|
||||||
*
|
*
|
||||||
* @param context Pointer to a properly initialized gxio_usb_host_context_t.
|
* @param context Pointer to a properly initialized gxio_usb_host_context_t.
|
||||||
* @return The address of the shim's MMIO registers.
|
* @return The address of the shim's MMIO registers.
|
||||||
*/
|
*/
|
||||||
extern void *gxio_usb_host_get_reg_start(gxio_usb_host_context_t * context);
|
extern void *gxio_usb_host_get_reg_start(gxio_usb_host_context_t *context);
|
||||||
|
|
||||||
/* Retrieve the length of the shim's MMIO registers.
|
/* Retrieve the length of the shim's MMIO registers.
|
||||||
*
|
*
|
||||||
* @param context Pointer to a properly initialized gxio_usb_host_context_t.
|
* @param context Pointer to a properly initialized gxio_usb_host_context_t.
|
||||||
* @return The length of the shim's MMIO registers.
|
* @return The length of the shim's MMIO registers.
|
||||||
*/
|
*/
|
||||||
extern size_t gxio_usb_host_get_reg_len(gxio_usb_host_context_t * context);
|
extern size_t gxio_usb_host_get_reg_len(gxio_usb_host_context_t *context);
|
||||||
|
|
||||||
#endif /* _GXIO_USB_H_ */
|
#endif /* _GXIO_USB_H_ */
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2011 Tilera Corporation. All Rights Reserved.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation, version 2.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
|
|
||||||
* NON INFRINGEMENT. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* Atomically access user memory, but use MMU to avoid propagating
|
|
||||||
* kernel exceptions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <linux/linkage.h>
|
|
||||||
#include <asm/errno.h>
|
|
||||||
#include <asm/futex.h>
|
|
||||||
#include <asm/page.h>
|
|
||||||
#include <asm/processor.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Provide a set of atomic memory operations supporting <asm/futex.h>.
|
|
||||||
*
|
|
||||||
* r0: user address to manipulate
|
|
||||||
* r1: new value to write, or for cmpxchg, old value to compare against
|
|
||||||
* r2: (cmpxchg only) new value to write
|
|
||||||
*
|
|
||||||
* Return __get_user struct, r0 with value, r1 with error.
|
|
||||||
*/
|
|
||||||
#define FUTEX_OP(name, ...) \
|
|
||||||
STD_ENTRY(futex_##name) \
|
|
||||||
__VA_ARGS__; \
|
|
||||||
{ \
|
|
||||||
move r1, zero; \
|
|
||||||
jrp lr \
|
|
||||||
}; \
|
|
||||||
STD_ENDPROC(futex_##name); \
|
|
||||||
.pushsection __ex_table,"a"; \
|
|
||||||
.quad 1b, get_user_fault; \
|
|
||||||
.popsection
|
|
||||||
|
|
||||||
.pushsection .fixup,"ax"
|
|
||||||
get_user_fault:
|
|
||||||
{ movei r1, -EFAULT; jrp lr }
|
|
||||||
ENDPROC(get_user_fault)
|
|
||||||
.popsection
|
|
||||||
|
|
||||||
FUTEX_OP(cmpxchg, mtspr CMPEXCH_VALUE, r1; 1: cmpexch4 r0, r0, r2)
|
|
||||||
FUTEX_OP(set, 1: exch4 r0, r0, r1)
|
|
||||||
FUTEX_OP(add, 1: fetchadd4 r0, r0, r1)
|
|
||||||
FUTEX_OP(or, 1: fetchor4 r0, r0, r1)
|
|
||||||
FUTEX_OP(andn, nor r1, r1, zero; 1: fetchand4 r0, r0, r1)
|
|
|
@ -1268,8 +1268,7 @@ static void __init validate_va(void)
|
||||||
if ((long)VMALLOC_START >= 0)
|
if ((long)VMALLOC_START >= 0)
|
||||||
early_panic(
|
early_panic(
|
||||||
"Linux VMALLOC region below the 2GB line (%#lx)!\n"
|
"Linux VMALLOC region below the 2GB line (%#lx)!\n"
|
||||||
"Reconfigure the kernel with fewer NR_HUGE_VMAPS\n"
|
"Reconfigure the kernel with smaller VMALLOC_RESERVE.\n",
|
||||||
"or smaller VMALLOC_RESERVE.\n",
|
|
||||||
VMALLOC_START);
|
VMALLOC_START);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -551,8 +551,8 @@ static tilegx_bundle_bits jit_x1_bnezt(int ra, int broff)
|
||||||
/*
|
/*
|
||||||
* This function generates unalign fixup JIT.
|
* This function generates unalign fixup JIT.
|
||||||
*
|
*
|
||||||
* We fist find unalign load/store instruction's destination, source
|
* We first find unalign load/store instruction's destination, source
|
||||||
* reguisters: ra, rb and rd. and 3 scratch registers by calling
|
* registers: ra, rb and rd. and 3 scratch registers by calling
|
||||||
* find_regs(...). 3 scratch clobbers should not alias with any register
|
* find_regs(...). 3 scratch clobbers should not alias with any register
|
||||||
* used in the fault bundle. Then analyze the fault bundle to determine
|
* used in the fault bundle. Then analyze the fault bundle to determine
|
||||||
* if it's a load or store, operand width, branch or address increment etc.
|
* if it's a load or store, operand width, branch or address increment etc.
|
||||||
|
|
|
@ -149,8 +149,6 @@ static inline int vmalloc_fault(pgd_t *pgd, unsigned long address)
|
||||||
pmd_k = vmalloc_sync_one(pgd, address);
|
pmd_k = vmalloc_sync_one(pgd, address);
|
||||||
if (!pmd_k)
|
if (!pmd_k)
|
||||||
return -1;
|
return -1;
|
||||||
if (pmd_huge(*pmd_k))
|
|
||||||
return 0; /* support TILE huge_vmap() API */
|
|
||||||
pte_k = pte_offset_kernel(pmd_k, address);
|
pte_k = pte_offset_kernel(pmd_k, address);
|
||||||
if (!pte_present(*pte_k))
|
if (!pte_present(*pte_k))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -827,10 +827,6 @@ void __init mem_init(void)
|
||||||
FIXADDR_START, FIXADDR_TOP + PAGE_SIZE - 1);
|
FIXADDR_START, FIXADDR_TOP + PAGE_SIZE - 1);
|
||||||
printk(KERN_DEBUG " PKMAP %#lx - %#lx\n",
|
printk(KERN_DEBUG " PKMAP %#lx - %#lx\n",
|
||||||
PKMAP_BASE, PKMAP_ADDR(LAST_PKMAP) - 1);
|
PKMAP_BASE, PKMAP_ADDR(LAST_PKMAP) - 1);
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_HUGEVMAP
|
|
||||||
printk(KERN_DEBUG " HUGEMAP %#lx - %#lx\n",
|
|
||||||
HUGE_VMAP_BASE, HUGE_VMAP_END - 1);
|
|
||||||
#endif
|
#endif
|
||||||
printk(KERN_DEBUG " VMALLOC %#lx - %#lx\n",
|
printk(KERN_DEBUG " VMALLOC %#lx - %#lx\n",
|
||||||
_VMALLOC_START, _VMALLOC_END - 1);
|
_VMALLOC_START, _VMALLOC_END - 1);
|
||||||
|
|
|
@ -127,8 +127,7 @@ void shatter_huge_page(unsigned long addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Shatter the huge page into the preallocated L2 page table. */
|
/* Shatter the huge page into the preallocated L2 page table. */
|
||||||
pmd_populate_kernel(&init_mm, pmd,
|
pmd_populate_kernel(&init_mm, pmd, get_prealloc_pte(pmd_pfn(*pmd)));
|
||||||
get_prealloc_pte(pte_pfn(*(pte_t *)pmd)));
|
|
||||||
|
|
||||||
#ifdef __PAGETABLE_PMD_FOLDED
|
#ifdef __PAGETABLE_PMD_FOLDED
|
||||||
/* Walk every pgd on the system and update the pmd there. */
|
/* Walk every pgd on the system and update the pmd there. */
|
||||||
|
|
|
@ -481,11 +481,12 @@ config X86_INTEL_LPSS
|
||||||
bool "Intel Low Power Subsystem Support"
|
bool "Intel Low Power Subsystem Support"
|
||||||
depends on ACPI
|
depends on ACPI
|
||||||
select COMMON_CLK
|
select COMMON_CLK
|
||||||
|
select PINCTRL
|
||||||
---help---
|
---help---
|
||||||
Select to build support for Intel Low Power Subsystem such as
|
Select to build support for Intel Low Power Subsystem such as
|
||||||
found on Intel Lynxpoint PCH. Selecting this option enables
|
found on Intel Lynxpoint PCH. Selecting this option enables
|
||||||
things like clock tree (common clock framework) which are needed
|
things like clock tree (common clock framework) and pincontrol
|
||||||
by the LPSS peripheral drivers.
|
which are needed by the LPSS peripheral drivers.
|
||||||
|
|
||||||
config X86_RDC321X
|
config X86_RDC321X
|
||||||
bool "RDC R-321x SoC"
|
bool "RDC R-321x SoC"
|
||||||
|
|
|
@ -899,8 +899,8 @@ static __initconst const u64 atom_hw_cache_event_ids
|
||||||
static struct extra_reg intel_slm_extra_regs[] __read_mostly =
|
static struct extra_reg intel_slm_extra_regs[] __read_mostly =
|
||||||
{
|
{
|
||||||
/* must define OFFCORE_RSP_X first, see intel_fixup_er() */
|
/* must define OFFCORE_RSP_X first, see intel_fixup_er() */
|
||||||
INTEL_UEVENT_EXTRA_REG(0x01b7, MSR_OFFCORE_RSP_0, 0x768005ffff, RSP_0),
|
INTEL_UEVENT_EXTRA_REG(0x01b7, MSR_OFFCORE_RSP_0, 0x768005ffffull, RSP_0),
|
||||||
INTEL_UEVENT_EXTRA_REG(0x02b7, MSR_OFFCORE_RSP_1, 0x768005ffff, RSP_1),
|
INTEL_UEVENT_EXTRA_REG(0x02b7, MSR_OFFCORE_RSP_1, 0x768005ffffull, RSP_1),
|
||||||
EVENT_EXTRA_END
|
EVENT_EXTRA_END
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -584,6 +584,7 @@ struct event_constraint intel_snb_pebs_event_constraints[] = {
|
||||||
INTEL_EVENT_CONSTRAINT(0xd0, 0xf), /* MEM_UOP_RETIRED.* */
|
INTEL_EVENT_CONSTRAINT(0xd0, 0xf), /* MEM_UOP_RETIRED.* */
|
||||||
INTEL_EVENT_CONSTRAINT(0xd1, 0xf), /* MEM_LOAD_UOPS_RETIRED.* */
|
INTEL_EVENT_CONSTRAINT(0xd1, 0xf), /* MEM_LOAD_UOPS_RETIRED.* */
|
||||||
INTEL_EVENT_CONSTRAINT(0xd2, 0xf), /* MEM_LOAD_UOPS_LLC_HIT_RETIRED.* */
|
INTEL_EVENT_CONSTRAINT(0xd2, 0xf), /* MEM_LOAD_UOPS_LLC_HIT_RETIRED.* */
|
||||||
|
INTEL_EVENT_CONSTRAINT(0xd3, 0xf), /* MEM_LOAD_UOPS_LLC_MISS_RETIRED.* */
|
||||||
INTEL_UEVENT_CONSTRAINT(0x02d4, 0xf), /* MEM_LOAD_UOPS_MISC_RETIRED.LLC_MISS */
|
INTEL_UEVENT_CONSTRAINT(0x02d4, 0xf), /* MEM_LOAD_UOPS_MISC_RETIRED.LLC_MISS */
|
||||||
EVENT_CONSTRAINT_END
|
EVENT_CONSTRAINT_END
|
||||||
};
|
};
|
||||||
|
|
|
@ -487,21 +487,6 @@ ENDPROC(native_usergs_sysret64)
|
||||||
TRACE_IRQS_OFF
|
TRACE_IRQS_OFF
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
ENTRY(save_rest)
|
|
||||||
PARTIAL_FRAME 1 (REST_SKIP+8)
|
|
||||||
movq 5*8+16(%rsp), %r11 /* save return address */
|
|
||||||
movq_cfi rbx, RBX+16
|
|
||||||
movq_cfi rbp, RBP+16
|
|
||||||
movq_cfi r12, R12+16
|
|
||||||
movq_cfi r13, R13+16
|
|
||||||
movq_cfi r14, R14+16
|
|
||||||
movq_cfi r15, R15+16
|
|
||||||
movq %r11, 8(%rsp) /* return address */
|
|
||||||
FIXUP_TOP_OF_STACK %r11, 16
|
|
||||||
ret
|
|
||||||
CFI_ENDPROC
|
|
||||||
END(save_rest)
|
|
||||||
|
|
||||||
/* save complete stack frame */
|
/* save complete stack frame */
|
||||||
.pushsection .kprobes.text, "ax"
|
.pushsection .kprobes.text, "ax"
|
||||||
ENTRY(save_paranoid)
|
ENTRY(save_paranoid)
|
||||||
|
|
|
@ -653,6 +653,7 @@ static void announce_cpu(int cpu, int apicid)
|
||||||
{
|
{
|
||||||
static int current_node = -1;
|
static int current_node = -1;
|
||||||
int node = early_cpu_to_node(cpu);
|
int node = early_cpu_to_node(cpu);
|
||||||
|
int max_cpu_present = find_last_bit(cpumask_bits(cpu_present_mask), NR_CPUS);
|
||||||
|
|
||||||
if (system_state == SYSTEM_BOOTING) {
|
if (system_state == SYSTEM_BOOTING) {
|
||||||
if (node != current_node) {
|
if (node != current_node) {
|
||||||
|
@ -661,7 +662,7 @@ static void announce_cpu(int cpu, int apicid)
|
||||||
current_node = node;
|
current_node = node;
|
||||||
pr_info("Booting Node %3d, Processors ", node);
|
pr_info("Booting Node %3d, Processors ", node);
|
||||||
}
|
}
|
||||||
pr_cont(" #%d%s", cpu, cpu == (nr_cpu_ids - 1) ? " OK\n" : "");
|
pr_cont(" #%4d%s", cpu, cpu == max_cpu_present ? " OK\n" : "");
|
||||||
return;
|
return;
|
||||||
} else
|
} else
|
||||||
pr_info("Booting Node %d Processor %d APIC 0x%x\n",
|
pr_info("Booting Node %d Processor %d APIC 0x%x\n",
|
||||||
|
|
|
@ -2025,6 +2025,17 @@ static int em_ret_far(struct x86_emulate_ctxt *ctxt)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int em_ret_far_imm(struct x86_emulate_ctxt *ctxt)
|
||||||
|
{
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
rc = em_ret_far(ctxt);
|
||||||
|
if (rc != X86EMUL_CONTINUE)
|
||||||
|
return rc;
|
||||||
|
rsp_increment(ctxt, ctxt->src.val);
|
||||||
|
return X86EMUL_CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
static int em_cmpxchg(struct x86_emulate_ctxt *ctxt)
|
static int em_cmpxchg(struct x86_emulate_ctxt *ctxt)
|
||||||
{
|
{
|
||||||
/* Save real source value, then compare EAX against destination. */
|
/* Save real source value, then compare EAX against destination. */
|
||||||
|
@ -3763,7 +3774,8 @@ static const struct opcode opcode_table[256] = {
|
||||||
G(ByteOp, group11), G(0, group11),
|
G(ByteOp, group11), G(0, group11),
|
||||||
/* 0xC8 - 0xCF */
|
/* 0xC8 - 0xCF */
|
||||||
I(Stack | SrcImmU16 | Src2ImmByte, em_enter), I(Stack, em_leave),
|
I(Stack | SrcImmU16 | Src2ImmByte, em_enter), I(Stack, em_leave),
|
||||||
N, I(ImplicitOps | Stack, em_ret_far),
|
I(ImplicitOps | Stack | SrcImmU16, em_ret_far_imm),
|
||||||
|
I(ImplicitOps | Stack, em_ret_far),
|
||||||
D(ImplicitOps), DI(SrcImmByte, intn),
|
D(ImplicitOps), DI(SrcImmByte, intn),
|
||||||
D(ImplicitOps | No64), II(ImplicitOps, em_iret, iret),
|
D(ImplicitOps | No64), II(ImplicitOps, em_iret, iret),
|
||||||
/* 0xD0 - 0xD7 */
|
/* 0xD0 - 0xD7 */
|
||||||
|
|
|
@ -99,6 +99,7 @@ struct guest_walker {
|
||||||
pt_element_t prefetch_ptes[PTE_PREFETCH_NUM];
|
pt_element_t prefetch_ptes[PTE_PREFETCH_NUM];
|
||||||
gpa_t pte_gpa[PT_MAX_FULL_LEVELS];
|
gpa_t pte_gpa[PT_MAX_FULL_LEVELS];
|
||||||
pt_element_t __user *ptep_user[PT_MAX_FULL_LEVELS];
|
pt_element_t __user *ptep_user[PT_MAX_FULL_LEVELS];
|
||||||
|
bool pte_writable[PT_MAX_FULL_LEVELS];
|
||||||
unsigned pt_access;
|
unsigned pt_access;
|
||||||
unsigned pte_access;
|
unsigned pte_access;
|
||||||
gfn_t gfn;
|
gfn_t gfn;
|
||||||
|
@ -235,6 +236,22 @@ static int FNAME(update_accessed_dirty_bits)(struct kvm_vcpu *vcpu,
|
||||||
if (pte == orig_pte)
|
if (pte == orig_pte)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the slot is read-only, simply do not process the accessed
|
||||||
|
* and dirty bits. This is the correct thing to do if the slot
|
||||||
|
* is ROM, and page tables in read-as-ROM/write-as-MMIO slots
|
||||||
|
* are only supported if the accessed and dirty bits are already
|
||||||
|
* set in the ROM (so that MMIO writes are never needed).
|
||||||
|
*
|
||||||
|
* Note that NPT does not allow this at all and faults, since
|
||||||
|
* it always wants nested page table entries for the guest
|
||||||
|
* page tables to be writable. And EPT works but will simply
|
||||||
|
* overwrite the read-only memory to set the accessed and dirty
|
||||||
|
* bits.
|
||||||
|
*/
|
||||||
|
if (unlikely(!walker->pte_writable[level - 1]))
|
||||||
|
continue;
|
||||||
|
|
||||||
ret = FNAME(cmpxchg_gpte)(vcpu, mmu, ptep_user, index, orig_pte, pte);
|
ret = FNAME(cmpxchg_gpte)(vcpu, mmu, ptep_user, index, orig_pte, pte);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -309,7 +326,8 @@ retry_walk:
|
||||||
goto error;
|
goto error;
|
||||||
real_gfn = gpa_to_gfn(real_gfn);
|
real_gfn = gpa_to_gfn(real_gfn);
|
||||||
|
|
||||||
host_addr = gfn_to_hva(vcpu->kvm, real_gfn);
|
host_addr = gfn_to_hva_prot(vcpu->kvm, real_gfn,
|
||||||
|
&walker->pte_writable[walker->level - 1]);
|
||||||
if (unlikely(kvm_is_error_hva(host_addr)))
|
if (unlikely(kvm_is_error_hva(host_addr)))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
|
|
@ -5339,6 +5339,15 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* EPT violation happened while executing iret from NMI,
|
||||||
|
* "blocked by NMI" bit has to be set before next VM entry.
|
||||||
|
* There are errata that may cause this bit to not be set:
|
||||||
|
* AAK134, BY25.
|
||||||
|
*/
|
||||||
|
if (exit_qualification & INTR_INFO_UNBLOCK_NMI)
|
||||||
|
vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, GUEST_INTR_STATE_NMI);
|
||||||
|
|
||||||
gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS);
|
gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS);
|
||||||
trace_kvm_page_fault(gpa, exit_qualification);
|
trace_kvm_page_fault(gpa, exit_qualification);
|
||||||
|
|
||||||
|
@ -7766,6 +7775,10 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
|
||||||
vmcs_write64(GUEST_PDPTR1, vmcs12->guest_pdptr1);
|
vmcs_write64(GUEST_PDPTR1, vmcs12->guest_pdptr1);
|
||||||
vmcs_write64(GUEST_PDPTR2, vmcs12->guest_pdptr2);
|
vmcs_write64(GUEST_PDPTR2, vmcs12->guest_pdptr2);
|
||||||
vmcs_write64(GUEST_PDPTR3, vmcs12->guest_pdptr3);
|
vmcs_write64(GUEST_PDPTR3, vmcs12->guest_pdptr3);
|
||||||
|
__clear_bit(VCPU_EXREG_PDPTR,
|
||||||
|
(unsigned long *)&vcpu->arch.regs_avail);
|
||||||
|
__clear_bit(VCPU_EXREG_PDPTR,
|
||||||
|
(unsigned long *)&vcpu->arch.regs_dirty);
|
||||||
}
|
}
|
||||||
|
|
||||||
kvm_register_write(vcpu, VCPU_REGS_RSP, vmcs12->guest_rsp);
|
kvm_register_write(vcpu, VCPU_REGS_RSP, vmcs12->guest_rsp);
|
||||||
|
|
|
@ -2865,15 +2865,4 @@ static struct pci_driver he_driver = {
|
||||||
.id_table = he_pci_tbl,
|
.id_table = he_pci_tbl,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init he_init(void)
|
module_pci_driver(he_driver);
|
||||||
{
|
|
||||||
return pci_register_driver(&he_driver);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void __exit he_cleanup(void)
|
|
||||||
{
|
|
||||||
pci_unregister_driver(&he_driver);
|
|
||||||
}
|
|
||||||
|
|
||||||
module_init(he_init);
|
|
||||||
module_exit(he_cleanup);
|
|
||||||
|
|
|
@ -778,7 +778,7 @@ static int ns_init_card(int i, struct pci_dev *pcidev)
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mac[i] == NULL || mac_pton(mac[i], card->atmdev->esi)) {
|
if (mac[i] == NULL || !mac_pton(mac[i], card->atmdev->esi)) {
|
||||||
nicstar_read_eprom(card->membase, NICSTAR_EPROM_MAC_ADDR_OFFSET,
|
nicstar_read_eprom(card->membase, NICSTAR_EPROM_MAC_ADDR_OFFSET,
|
||||||
card->atmdev->esi, 6);
|
card->atmdev->esi, 6);
|
||||||
if (memcmp(card->atmdev->esi, "\x00\x00\x00\x00\x00\x00", 6) ==
|
if (memcmp(card->atmdev->esi, "\x00\x00\x00\x00\x00\x00", 6) ==
|
||||||
|
|
|
@ -188,8 +188,11 @@ static int bcma_host_pci_probe(struct pci_dev *dev,
|
||||||
pci_write_config_dword(dev, 0x40, val & 0xffff00ff);
|
pci_write_config_dword(dev, 0x40, val & 0xffff00ff);
|
||||||
|
|
||||||
/* SSB needed additional powering up, do we have any AMBA PCI cards? */
|
/* SSB needed additional powering up, do we have any AMBA PCI cards? */
|
||||||
if (!pci_is_pcie(dev))
|
if (!pci_is_pcie(dev)) {
|
||||||
bcma_err(bus, "PCI card detected, report problems.\n");
|
bcma_err(bus, "PCI card detected, they are not supported.\n");
|
||||||
|
err = -ENXIO;
|
||||||
|
goto err_pci_release_regions;
|
||||||
|
}
|
||||||
|
|
||||||
/* Map MMIO */
|
/* Map MMIO */
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
|
@ -269,6 +272,7 @@ static SIMPLE_DEV_PM_OPS(bcma_pm_ops, bcma_host_pci_suspend,
|
||||||
|
|
||||||
static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = {
|
static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = {
|
||||||
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x0576) },
|
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x0576) },
|
||||||
|
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4313) },
|
||||||
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43224) },
|
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43224) },
|
||||||
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4331) },
|
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4331) },
|
||||||
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4353) },
|
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4353) },
|
||||||
|
|
|
@ -269,6 +269,8 @@ static struct bcma_device *bcma_find_core_reverse(struct bcma_bus *bus, u16 core
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define IS_ERR_VALUE_U32(x) ((x) >= (u32)-MAX_ERRNO)
|
||||||
|
|
||||||
static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
|
static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
|
||||||
struct bcma_device_id *match, int core_num,
|
struct bcma_device_id *match, int core_num,
|
||||||
struct bcma_device *core)
|
struct bcma_device *core)
|
||||||
|
@ -351,11 +353,11 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
|
||||||
* the main register space for the core
|
* the main register space for the core
|
||||||
*/
|
*/
|
||||||
tmp = bcma_erom_get_addr_desc(bus, eromptr, SCAN_ADDR_TYPE_SLAVE, 0);
|
tmp = bcma_erom_get_addr_desc(bus, eromptr, SCAN_ADDR_TYPE_SLAVE, 0);
|
||||||
if (tmp == 0 || IS_ERR_VALUE(tmp)) {
|
if (tmp == 0 || IS_ERR_VALUE_U32(tmp)) {
|
||||||
/* Try again to see if it is a bridge */
|
/* Try again to see if it is a bridge */
|
||||||
tmp = bcma_erom_get_addr_desc(bus, eromptr,
|
tmp = bcma_erom_get_addr_desc(bus, eromptr,
|
||||||
SCAN_ADDR_TYPE_BRIDGE, 0);
|
SCAN_ADDR_TYPE_BRIDGE, 0);
|
||||||
if (tmp == 0 || IS_ERR_VALUE(tmp)) {
|
if (tmp == 0 || IS_ERR_VALUE_U32(tmp)) {
|
||||||
return -EILSEQ;
|
return -EILSEQ;
|
||||||
} else {
|
} else {
|
||||||
bcma_info(bus, "Bridge found\n");
|
bcma_info(bus, "Bridge found\n");
|
||||||
|
@ -369,7 +371,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
|
||||||
for (j = 0; ; j++) {
|
for (j = 0; ; j++) {
|
||||||
tmp = bcma_erom_get_addr_desc(bus, eromptr,
|
tmp = bcma_erom_get_addr_desc(bus, eromptr,
|
||||||
SCAN_ADDR_TYPE_SLAVE, i);
|
SCAN_ADDR_TYPE_SLAVE, i);
|
||||||
if (IS_ERR_VALUE(tmp)) {
|
if (IS_ERR_VALUE_U32(tmp)) {
|
||||||
/* no more entries for port _i_ */
|
/* no more entries for port _i_ */
|
||||||
/* pr_debug("erom: slave port %d "
|
/* pr_debug("erom: slave port %d "
|
||||||
* "has %d descriptors\n", i, j); */
|
* "has %d descriptors\n", i, j); */
|
||||||
|
@ -386,7 +388,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
|
||||||
for (j = 0; ; j++) {
|
for (j = 0; ; j++) {
|
||||||
tmp = bcma_erom_get_addr_desc(bus, eromptr,
|
tmp = bcma_erom_get_addr_desc(bus, eromptr,
|
||||||
SCAN_ADDR_TYPE_MWRAP, i);
|
SCAN_ADDR_TYPE_MWRAP, i);
|
||||||
if (IS_ERR_VALUE(tmp)) {
|
if (IS_ERR_VALUE_U32(tmp)) {
|
||||||
/* no more entries for port _i_ */
|
/* no more entries for port _i_ */
|
||||||
/* pr_debug("erom: master wrapper %d "
|
/* pr_debug("erom: master wrapper %d "
|
||||||
* "has %d descriptors\n", i, j); */
|
* "has %d descriptors\n", i, j); */
|
||||||
|
@ -404,7 +406,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
|
||||||
for (j = 0; ; j++) {
|
for (j = 0; ; j++) {
|
||||||
tmp = bcma_erom_get_addr_desc(bus, eromptr,
|
tmp = bcma_erom_get_addr_desc(bus, eromptr,
|
||||||
SCAN_ADDR_TYPE_SWRAP, i + hack);
|
SCAN_ADDR_TYPE_SWRAP, i + hack);
|
||||||
if (IS_ERR_VALUE(tmp)) {
|
if (IS_ERR_VALUE_U32(tmp)) {
|
||||||
/* no more entries for port _i_ */
|
/* no more entries for port _i_ */
|
||||||
/* pr_debug("erom: master wrapper %d "
|
/* pr_debug("erom: master wrapper %d "
|
||||||
* has %d descriptors\n", i, j); */
|
* has %d descriptors\n", i, j); */
|
||||||
|
|
|
@ -931,12 +931,14 @@ static const char *rbd_dev_v1_snap_name(struct rbd_device *rbd_dev,
|
||||||
u64 snap_id)
|
u64 snap_id)
|
||||||
{
|
{
|
||||||
u32 which;
|
u32 which;
|
||||||
|
const char *snap_name;
|
||||||
|
|
||||||
which = rbd_dev_snap_index(rbd_dev, snap_id);
|
which = rbd_dev_snap_index(rbd_dev, snap_id);
|
||||||
if (which == BAD_SNAP_INDEX)
|
if (which == BAD_SNAP_INDEX)
|
||||||
return NULL;
|
return ERR_PTR(-ENOENT);
|
||||||
|
|
||||||
return _rbd_dev_v1_snap_name(rbd_dev, which);
|
snap_name = _rbd_dev_v1_snap_name(rbd_dev, which);
|
||||||
|
return snap_name ? snap_name : ERR_PTR(-ENOMEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *rbd_snap_name(struct rbd_device *rbd_dev, u64 snap_id)
|
static const char *rbd_snap_name(struct rbd_device *rbd_dev, u64 snap_id)
|
||||||
|
@ -2812,7 +2814,7 @@ out_err:
|
||||||
obj_request_done_set(obj_request);
|
obj_request_done_set(obj_request);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rbd_obj_notify_ack(struct rbd_device *rbd_dev, u64 notify_id)
|
static int rbd_obj_notify_ack_sync(struct rbd_device *rbd_dev, u64 notify_id)
|
||||||
{
|
{
|
||||||
struct rbd_obj_request *obj_request;
|
struct rbd_obj_request *obj_request;
|
||||||
struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc;
|
struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc;
|
||||||
|
@ -2827,16 +2829,17 @@ static int rbd_obj_notify_ack(struct rbd_device *rbd_dev, u64 notify_id)
|
||||||
obj_request->osd_req = rbd_osd_req_create(rbd_dev, false, obj_request);
|
obj_request->osd_req = rbd_osd_req_create(rbd_dev, false, obj_request);
|
||||||
if (!obj_request->osd_req)
|
if (!obj_request->osd_req)
|
||||||
goto out;
|
goto out;
|
||||||
obj_request->callback = rbd_obj_request_put;
|
|
||||||
|
|
||||||
osd_req_op_watch_init(obj_request->osd_req, 0, CEPH_OSD_OP_NOTIFY_ACK,
|
osd_req_op_watch_init(obj_request->osd_req, 0, CEPH_OSD_OP_NOTIFY_ACK,
|
||||||
notify_id, 0, 0);
|
notify_id, 0, 0);
|
||||||
rbd_osd_req_format_read(obj_request);
|
rbd_osd_req_format_read(obj_request);
|
||||||
|
|
||||||
ret = rbd_obj_request_submit(osdc, obj_request);
|
ret = rbd_obj_request_submit(osdc, obj_request);
|
||||||
out:
|
|
||||||
if (ret)
|
if (ret)
|
||||||
rbd_obj_request_put(obj_request);
|
goto out;
|
||||||
|
ret = rbd_obj_request_wait(obj_request);
|
||||||
|
out:
|
||||||
|
rbd_obj_request_put(obj_request);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -2856,7 +2859,7 @@ static void rbd_watch_cb(u64 ver, u64 notify_id, u8 opcode, void *data)
|
||||||
if (ret)
|
if (ret)
|
||||||
rbd_warn(rbd_dev, "header refresh error (%d)\n", ret);
|
rbd_warn(rbd_dev, "header refresh error (%d)\n", ret);
|
||||||
|
|
||||||
rbd_obj_notify_ack(rbd_dev, notify_id);
|
rbd_obj_notify_ack_sync(rbd_dev, notify_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3328,6 +3331,31 @@ static void rbd_exists_validate(struct rbd_device *rbd_dev)
|
||||||
clear_bit(RBD_DEV_FLAG_EXISTS, &rbd_dev->flags);
|
clear_bit(RBD_DEV_FLAG_EXISTS, &rbd_dev->flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rbd_dev_update_size(struct rbd_device *rbd_dev)
|
||||||
|
{
|
||||||
|
sector_t size;
|
||||||
|
bool removing;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Don't hold the lock while doing disk operations,
|
||||||
|
* or lock ordering will conflict with the bdev mutex via:
|
||||||
|
* rbd_add() -> blkdev_get() -> rbd_open()
|
||||||
|
*/
|
||||||
|
spin_lock_irq(&rbd_dev->lock);
|
||||||
|
removing = test_bit(RBD_DEV_FLAG_REMOVING, &rbd_dev->flags);
|
||||||
|
spin_unlock_irq(&rbd_dev->lock);
|
||||||
|
/*
|
||||||
|
* If the device is being removed, rbd_dev->disk has
|
||||||
|
* been destroyed, so don't try to update its size
|
||||||
|
*/
|
||||||
|
if (!removing) {
|
||||||
|
size = (sector_t)rbd_dev->mapping.size / SECTOR_SIZE;
|
||||||
|
dout("setting size to %llu sectors", (unsigned long long)size);
|
||||||
|
set_capacity(rbd_dev->disk, size);
|
||||||
|
revalidate_disk(rbd_dev->disk);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int rbd_dev_refresh(struct rbd_device *rbd_dev)
|
static int rbd_dev_refresh(struct rbd_device *rbd_dev)
|
||||||
{
|
{
|
||||||
u64 mapping_size;
|
u64 mapping_size;
|
||||||
|
@ -3347,12 +3375,7 @@ static int rbd_dev_refresh(struct rbd_device *rbd_dev)
|
||||||
up_write(&rbd_dev->header_rwsem);
|
up_write(&rbd_dev->header_rwsem);
|
||||||
|
|
||||||
if (mapping_size != rbd_dev->mapping.size) {
|
if (mapping_size != rbd_dev->mapping.size) {
|
||||||
sector_t size;
|
rbd_dev_update_size(rbd_dev);
|
||||||
|
|
||||||
size = (sector_t)rbd_dev->mapping.size / SECTOR_SIZE;
|
|
||||||
dout("setting size to %llu sectors", (unsigned long long)size);
|
|
||||||
set_capacity(rbd_dev->disk, size);
|
|
||||||
revalidate_disk(rbd_dev->disk);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -4061,8 +4084,13 @@ static u64 rbd_v2_snap_id_by_name(struct rbd_device *rbd_dev, const char *name)
|
||||||
|
|
||||||
snap_id = snapc->snaps[which];
|
snap_id = snapc->snaps[which];
|
||||||
snap_name = rbd_dev_v2_snap_name(rbd_dev, snap_id);
|
snap_name = rbd_dev_v2_snap_name(rbd_dev, snap_id);
|
||||||
if (IS_ERR(snap_name))
|
if (IS_ERR(snap_name)) {
|
||||||
break;
|
/* ignore no-longer existing snapshots */
|
||||||
|
if (PTR_ERR(snap_name) == -ENOENT)
|
||||||
|
continue;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
found = !strcmp(name, snap_name);
|
found = !strcmp(name, snap_name);
|
||||||
kfree(snap_name);
|
kfree(snap_name);
|
||||||
}
|
}
|
||||||
|
@ -4141,8 +4169,8 @@ static int rbd_dev_spec_update(struct rbd_device *rbd_dev)
|
||||||
/* Look up the snapshot name, and make a copy */
|
/* Look up the snapshot name, and make a copy */
|
||||||
|
|
||||||
snap_name = rbd_snap_name(rbd_dev, spec->snap_id);
|
snap_name = rbd_snap_name(rbd_dev, spec->snap_id);
|
||||||
if (!snap_name) {
|
if (IS_ERR(snap_name)) {
|
||||||
ret = -ENOMEM;
|
ret = PTR_ERR(snap_name);
|
||||||
goto out_err;
|
goto out_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5163,10 +5191,23 @@ static ssize_t rbd_remove(struct bus_type *bus,
|
||||||
if (ret < 0 || already)
|
if (ret < 0 || already)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
rbd_bus_del_dev(rbd_dev);
|
|
||||||
ret = rbd_dev_header_watch_sync(rbd_dev, false);
|
ret = rbd_dev_header_watch_sync(rbd_dev, false);
|
||||||
if (ret)
|
if (ret)
|
||||||
rbd_warn(rbd_dev, "failed to cancel watch event (%d)\n", ret);
|
rbd_warn(rbd_dev, "failed to cancel watch event (%d)\n", ret);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* flush remaining watch callbacks - these must be complete
|
||||||
|
* before the osd_client is shutdown
|
||||||
|
*/
|
||||||
|
dout("%s: flushing notifies", __func__);
|
||||||
|
ceph_osdc_flush_notifies(&rbd_dev->rbd_client->client->osdc);
|
||||||
|
/*
|
||||||
|
* Don't free anything from rbd_dev->disk until after all
|
||||||
|
* notifies are completely processed. Otherwise
|
||||||
|
* rbd_bus_del_dev() will race with rbd_watch_cb(), resulting
|
||||||
|
* in a potential use after free of rbd_dev->disk or rbd_dev.
|
||||||
|
*/
|
||||||
|
rbd_bus_del_dev(rbd_dev);
|
||||||
rbd_dev_image_release(rbd_dev);
|
rbd_dev_image_release(rbd_dev);
|
||||||
module_put(THIS_MODULE);
|
module_put(THIS_MODULE);
|
||||||
|
|
||||||
|
|
|
@ -30,3 +30,5 @@ hci_uart-$(CONFIG_BT_HCIUART_LL) += hci_ll.o
|
||||||
hci_uart-$(CONFIG_BT_HCIUART_ATH3K) += hci_ath.o
|
hci_uart-$(CONFIG_BT_HCIUART_ATH3K) += hci_ath.o
|
||||||
hci_uart-$(CONFIG_BT_HCIUART_3WIRE) += hci_h5.o
|
hci_uart-$(CONFIG_BT_HCIUART_3WIRE) += hci_h5.o
|
||||||
hci_uart-objs := $(hci_uart-y)
|
hci_uart-objs := $(hci_uart-y)
|
||||||
|
|
||||||
|
ccflags-y += -D__CHECK_ENDIAN__
|
||||||
|
|
|
@ -85,6 +85,7 @@ static struct usb_device_id ath3k_table[] = {
|
||||||
{ USB_DEVICE(0x04CA, 0x3008) },
|
{ USB_DEVICE(0x04CA, 0x3008) },
|
||||||
{ USB_DEVICE(0x13d3, 0x3362) },
|
{ USB_DEVICE(0x13d3, 0x3362) },
|
||||||
{ USB_DEVICE(0x0CF3, 0xE004) },
|
{ USB_DEVICE(0x0CF3, 0xE004) },
|
||||||
|
{ USB_DEVICE(0x0CF3, 0xE005) },
|
||||||
{ USB_DEVICE(0x0930, 0x0219) },
|
{ USB_DEVICE(0x0930, 0x0219) },
|
||||||
{ USB_DEVICE(0x0489, 0xe057) },
|
{ USB_DEVICE(0x0489, 0xe057) },
|
||||||
{ USB_DEVICE(0x13d3, 0x3393) },
|
{ USB_DEVICE(0x13d3, 0x3393) },
|
||||||
|
@ -126,6 +127,7 @@ static struct usb_device_id ath3k_blist_tbl[] = {
|
||||||
{ USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
|
{ USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
|
||||||
{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
|
{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
|
||||||
{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
|
{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
|
||||||
|
{ USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 },
|
||||||
{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
|
{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
|
||||||
{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
|
{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
|
||||||
{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
|
{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
#include <linux/bitops.h>
|
#include <linux/bitops.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <net/bluetooth/bluetooth.h>
|
#include <net/bluetooth/bluetooth.h>
|
||||||
|
#include <linux/ctype.h>
|
||||||
|
#include <linux/firmware.h>
|
||||||
|
|
||||||
#define BTM_HEADER_LEN 4
|
#define BTM_HEADER_LEN 4
|
||||||
#define BTM_UPLD_SIZE 2312
|
#define BTM_UPLD_SIZE 2312
|
||||||
|
@ -41,6 +43,8 @@ struct btmrvl_thread {
|
||||||
struct btmrvl_device {
|
struct btmrvl_device {
|
||||||
void *card;
|
void *card;
|
||||||
struct hci_dev *hcidev;
|
struct hci_dev *hcidev;
|
||||||
|
struct device *dev;
|
||||||
|
const char *cal_data;
|
||||||
|
|
||||||
u8 dev_type;
|
u8 dev_type;
|
||||||
|
|
||||||
|
@ -91,6 +95,7 @@ struct btmrvl_private {
|
||||||
#define BT_CMD_HOST_SLEEP_CONFIG 0x59
|
#define BT_CMD_HOST_SLEEP_CONFIG 0x59
|
||||||
#define BT_CMD_HOST_SLEEP_ENABLE 0x5A
|
#define BT_CMD_HOST_SLEEP_ENABLE 0x5A
|
||||||
#define BT_CMD_MODULE_CFG_REQ 0x5B
|
#define BT_CMD_MODULE_CFG_REQ 0x5B
|
||||||
|
#define BT_CMD_LOAD_CONFIG_DATA 0x61
|
||||||
|
|
||||||
/* Sub-commands: Module Bringup/Shutdown Request/Response */
|
/* Sub-commands: Module Bringup/Shutdown Request/Response */
|
||||||
#define MODULE_BRINGUP_REQ 0xF1
|
#define MODULE_BRINGUP_REQ 0xF1
|
||||||
|
@ -116,11 +121,8 @@ struct btmrvl_private {
|
||||||
#define PS_SLEEP 0x01
|
#define PS_SLEEP 0x01
|
||||||
#define PS_AWAKE 0x00
|
#define PS_AWAKE 0x00
|
||||||
|
|
||||||
struct btmrvl_cmd {
|
#define BT_CMD_DATA_SIZE 32
|
||||||
__le16 ocf_ogf;
|
#define BT_CAL_DATA_SIZE 28
|
||||||
u8 length;
|
|
||||||
u8 data[4];
|
|
||||||
} __packed;
|
|
||||||
|
|
||||||
struct btmrvl_event {
|
struct btmrvl_event {
|
||||||
u8 ec; /* event counter */
|
u8 ec; /* event counter */
|
||||||
|
|
|
@ -57,8 +57,7 @@ bool btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb)
|
||||||
ocf = hci_opcode_ocf(opcode);
|
ocf = hci_opcode_ocf(opcode);
|
||||||
ogf = hci_opcode_ogf(opcode);
|
ogf = hci_opcode_ogf(opcode);
|
||||||
|
|
||||||
if (ocf == BT_CMD_MODULE_CFG_REQ &&
|
if (priv->btmrvl_dev.sendcmdflag) {
|
||||||
priv->btmrvl_dev.sendcmdflag) {
|
|
||||||
priv->btmrvl_dev.sendcmdflag = false;
|
priv->btmrvl_dev.sendcmdflag = false;
|
||||||
priv->adapter->cmd_complete = true;
|
priv->adapter->cmd_complete = true;
|
||||||
wake_up_interruptible(&priv->adapter->cmd_wait_q);
|
wake_up_interruptible(&priv->adapter->cmd_wait_q);
|
||||||
|
@ -116,7 +115,6 @@ int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb)
|
||||||
adapter->hs_state = HS_ACTIVATED;
|
adapter->hs_state = HS_ACTIVATED;
|
||||||
if (adapter->psmode)
|
if (adapter->psmode)
|
||||||
adapter->ps_state = PS_SLEEP;
|
adapter->ps_state = PS_SLEEP;
|
||||||
wake_up_interruptible(&adapter->cmd_wait_q);
|
|
||||||
BT_DBG("HS ACTIVATED!");
|
BT_DBG("HS ACTIVATED!");
|
||||||
} else {
|
} else {
|
||||||
BT_DBG("HS Enable failed");
|
BT_DBG("HS Enable failed");
|
||||||
|
@ -168,22 +166,24 @@ exit:
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(btmrvl_process_event);
|
EXPORT_SYMBOL_GPL(btmrvl_process_event);
|
||||||
|
|
||||||
int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd)
|
static int btmrvl_send_sync_cmd(struct btmrvl_private *priv, u16 cmd_no,
|
||||||
|
const void *param, u8 len)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
struct btmrvl_cmd *cmd;
|
struct hci_command_hdr *hdr;
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
skb = bt_skb_alloc(sizeof(*cmd), GFP_ATOMIC);
|
skb = bt_skb_alloc(HCI_COMMAND_HDR_SIZE + len, GFP_ATOMIC);
|
||||||
if (skb == NULL) {
|
if (skb == NULL) {
|
||||||
BT_ERR("No free skb");
|
BT_ERR("No free skb");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd = (struct btmrvl_cmd *) skb_put(skb, sizeof(*cmd));
|
hdr = (struct hci_command_hdr *)skb_put(skb, HCI_COMMAND_HDR_SIZE);
|
||||||
cmd->ocf_ogf = cpu_to_le16(hci_opcode_pack(OGF, BT_CMD_MODULE_CFG_REQ));
|
hdr->opcode = cpu_to_le16(hci_opcode_pack(OGF, cmd_no));
|
||||||
cmd->length = 1;
|
hdr->plen = len;
|
||||||
cmd->data[0] = subcmd;
|
|
||||||
|
if (len)
|
||||||
|
memcpy(skb_put(skb, len), param, len);
|
||||||
|
|
||||||
bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
|
bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
|
||||||
|
|
||||||
|
@ -194,19 +194,23 @@ int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd)
|
||||||
|
|
||||||
priv->adapter->cmd_complete = false;
|
priv->adapter->cmd_complete = false;
|
||||||
|
|
||||||
BT_DBG("Queue module cfg Command");
|
|
||||||
|
|
||||||
wake_up_interruptible(&priv->main_thread.wait_q);
|
wake_up_interruptible(&priv->main_thread.wait_q);
|
||||||
|
|
||||||
if (!wait_event_interruptible_timeout(priv->adapter->cmd_wait_q,
|
if (!wait_event_interruptible_timeout(priv->adapter->cmd_wait_q,
|
||||||
priv->adapter->cmd_complete,
|
priv->adapter->cmd_complete,
|
||||||
msecs_to_jiffies(WAIT_UNTIL_CMD_RESP))) {
|
msecs_to_jiffies(WAIT_UNTIL_CMD_RESP)))
|
||||||
ret = -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
BT_ERR("module_cfg_cmd(%x): timeout: %d",
|
|
||||||
subcmd, priv->btmrvl_dev.sendcmdflag);
|
|
||||||
}
|
|
||||||
|
|
||||||
BT_DBG("module cfg Command done");
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = btmrvl_send_sync_cmd(priv, BT_CMD_MODULE_CFG_REQ, &subcmd, 1);
|
||||||
|
if (ret)
|
||||||
|
BT_ERR("module_cfg_cmd(%x) failed\n", subcmd);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -214,61 +218,36 @@ EXPORT_SYMBOL_GPL(btmrvl_send_module_cfg_cmd);
|
||||||
|
|
||||||
int btmrvl_send_hscfg_cmd(struct btmrvl_private *priv)
|
int btmrvl_send_hscfg_cmd(struct btmrvl_private *priv)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb;
|
int ret;
|
||||||
struct btmrvl_cmd *cmd;
|
u8 param[2];
|
||||||
|
|
||||||
skb = bt_skb_alloc(sizeof(*cmd), GFP_ATOMIC);
|
param[0] = (priv->btmrvl_dev.gpio_gap & 0xff00) >> 8;
|
||||||
if (!skb) {
|
param[1] = (u8) (priv->btmrvl_dev.gpio_gap & 0x00ff);
|
||||||
BT_ERR("No free skb");
|
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd = (struct btmrvl_cmd *) skb_put(skb, sizeof(*cmd));
|
BT_DBG("Sending HSCFG Command, gpio=0x%x, gap=0x%x",
|
||||||
cmd->ocf_ogf = cpu_to_le16(hci_opcode_pack(OGF,
|
param[0], param[1]);
|
||||||
BT_CMD_HOST_SLEEP_CONFIG));
|
|
||||||
cmd->length = 2;
|
|
||||||
cmd->data[0] = (priv->btmrvl_dev.gpio_gap & 0xff00) >> 8;
|
|
||||||
cmd->data[1] = (u8) (priv->btmrvl_dev.gpio_gap & 0x00ff);
|
|
||||||
|
|
||||||
bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
|
ret = btmrvl_send_sync_cmd(priv, BT_CMD_HOST_SLEEP_CONFIG, param, 2);
|
||||||
|
if (ret)
|
||||||
|
BT_ERR("HSCFG command failed\n");
|
||||||
|
|
||||||
skb->dev = (void *) priv->btmrvl_dev.hcidev;
|
return ret;
|
||||||
skb_queue_head(&priv->adapter->tx_queue, skb);
|
|
||||||
|
|
||||||
BT_DBG("Queue HSCFG Command, gpio=0x%x, gap=0x%x", cmd->data[0],
|
|
||||||
cmd->data[1]);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(btmrvl_send_hscfg_cmd);
|
EXPORT_SYMBOL_GPL(btmrvl_send_hscfg_cmd);
|
||||||
|
|
||||||
int btmrvl_enable_ps(struct btmrvl_private *priv)
|
int btmrvl_enable_ps(struct btmrvl_private *priv)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb;
|
int ret;
|
||||||
struct btmrvl_cmd *cmd;
|
u8 param;
|
||||||
|
|
||||||
skb = bt_skb_alloc(sizeof(*cmd), GFP_ATOMIC);
|
|
||||||
if (skb == NULL) {
|
|
||||||
BT_ERR("No free skb");
|
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd = (struct btmrvl_cmd *) skb_put(skb, sizeof(*cmd));
|
|
||||||
cmd->ocf_ogf = cpu_to_le16(hci_opcode_pack(OGF,
|
|
||||||
BT_CMD_AUTO_SLEEP_MODE));
|
|
||||||
cmd->length = 1;
|
|
||||||
|
|
||||||
if (priv->btmrvl_dev.psmode)
|
if (priv->btmrvl_dev.psmode)
|
||||||
cmd->data[0] = BT_PS_ENABLE;
|
param = BT_PS_ENABLE;
|
||||||
else
|
else
|
||||||
cmd->data[0] = BT_PS_DISABLE;
|
param = BT_PS_DISABLE;
|
||||||
|
|
||||||
bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
|
ret = btmrvl_send_sync_cmd(priv, BT_CMD_AUTO_SLEEP_MODE, ¶m, 1);
|
||||||
|
if (ret)
|
||||||
skb->dev = (void *) priv->btmrvl_dev.hcidev;
|
BT_ERR("PSMODE command failed\n");
|
||||||
skb_queue_head(&priv->adapter->tx_queue, skb);
|
|
||||||
|
|
||||||
BT_DBG("Queue PSMODE Command:%d", cmd->data[0]);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -276,37 +255,11 @@ EXPORT_SYMBOL_GPL(btmrvl_enable_ps);
|
||||||
|
|
||||||
int btmrvl_enable_hs(struct btmrvl_private *priv)
|
int btmrvl_enable_hs(struct btmrvl_private *priv)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb;
|
int ret;
|
||||||
struct btmrvl_cmd *cmd;
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
skb = bt_skb_alloc(sizeof(*cmd), GFP_ATOMIC);
|
ret = btmrvl_send_sync_cmd(priv, BT_CMD_HOST_SLEEP_ENABLE, NULL, 0);
|
||||||
if (skb == NULL) {
|
if (ret)
|
||||||
BT_ERR("No free skb");
|
BT_ERR("Host sleep enable command failed\n");
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd = (struct btmrvl_cmd *) skb_put(skb, sizeof(*cmd));
|
|
||||||
cmd->ocf_ogf = cpu_to_le16(hci_opcode_pack(OGF, BT_CMD_HOST_SLEEP_ENABLE));
|
|
||||||
cmd->length = 0;
|
|
||||||
|
|
||||||
bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
|
|
||||||
|
|
||||||
skb->dev = (void *) priv->btmrvl_dev.hcidev;
|
|
||||||
skb_queue_head(&priv->adapter->tx_queue, skb);
|
|
||||||
|
|
||||||
BT_DBG("Queue hs enable Command");
|
|
||||||
|
|
||||||
wake_up_interruptible(&priv->main_thread.wait_q);
|
|
||||||
|
|
||||||
if (!wait_event_interruptible_timeout(priv->adapter->cmd_wait_q,
|
|
||||||
priv->adapter->hs_state,
|
|
||||||
msecs_to_jiffies(WAIT_UNTIL_HS_STATE_CHANGED))) {
|
|
||||||
ret = -ETIMEDOUT;
|
|
||||||
BT_ERR("timeout: %d, %d,%d", priv->adapter->hs_state,
|
|
||||||
priv->adapter->ps_state,
|
|
||||||
priv->adapter->wakeup_tries);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -479,6 +432,137 @@ static int btmrvl_open(struct hci_dev *hdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This function parses provided calibration data input. It should contain
|
||||||
|
* hex bytes separated by space or new line character. Here is an example.
|
||||||
|
* 00 1C 01 37 FF FF FF FF 02 04 7F 01
|
||||||
|
* CE BA 00 00 00 2D C6 C0 00 00 00 00
|
||||||
|
* 00 F0 00 00
|
||||||
|
*/
|
||||||
|
static int btmrvl_parse_cal_cfg(const u8 *src, u32 len, u8 *dst, u32 dst_size)
|
||||||
|
{
|
||||||
|
const u8 *s = src;
|
||||||
|
u8 *d = dst;
|
||||||
|
int ret;
|
||||||
|
u8 tmp[3];
|
||||||
|
|
||||||
|
tmp[2] = '\0';
|
||||||
|
while ((s - src) <= len - 2) {
|
||||||
|
if (isspace(*s)) {
|
||||||
|
s++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isxdigit(*s)) {
|
||||||
|
if ((d - dst) >= dst_size) {
|
||||||
|
BT_ERR("calibration data file too big!!!");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(tmp, s, 2);
|
||||||
|
|
||||||
|
ret = kstrtou8(tmp, 16, d++);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
s += 2;
|
||||||
|
} else {
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (d == dst)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int btmrvl_load_cal_data(struct btmrvl_private *priv,
|
||||||
|
u8 *config_data)
|
||||||
|
{
|
||||||
|
int i, ret;
|
||||||
|
u8 data[BT_CMD_DATA_SIZE];
|
||||||
|
|
||||||
|
data[0] = 0x00;
|
||||||
|
data[1] = 0x00;
|
||||||
|
data[2] = 0x00;
|
||||||
|
data[3] = BT_CMD_DATA_SIZE - 4;
|
||||||
|
|
||||||
|
/* Swap cal-data bytes. Each four bytes are swapped. Considering 4
|
||||||
|
* byte SDIO header offset, mapping of input and output bytes will be
|
||||||
|
* {3, 2, 1, 0} -> {0+4, 1+4, 2+4, 3+4},
|
||||||
|
* {7, 6, 5, 4} -> {4+4, 5+4, 6+4, 7+4} */
|
||||||
|
for (i = 4; i < BT_CMD_DATA_SIZE; i++)
|
||||||
|
data[i] = config_data[(i / 4) * 8 - 1 - i];
|
||||||
|
|
||||||
|
print_hex_dump_bytes("Calibration data: ",
|
||||||
|
DUMP_PREFIX_OFFSET, data, BT_CMD_DATA_SIZE);
|
||||||
|
|
||||||
|
ret = btmrvl_send_sync_cmd(priv, BT_CMD_LOAD_CONFIG_DATA, data,
|
||||||
|
BT_CMD_DATA_SIZE);
|
||||||
|
if (ret)
|
||||||
|
BT_ERR("Failed to download caibration data\n");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
btmrvl_process_cal_cfg(struct btmrvl_private *priv, u8 *data, u32 size)
|
||||||
|
{
|
||||||
|
u8 cal_data[BT_CAL_DATA_SIZE];
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = btmrvl_parse_cal_cfg(data, size, cal_data, sizeof(cal_data));
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
ret = btmrvl_load_cal_data(priv, cal_data);
|
||||||
|
if (ret) {
|
||||||
|
BT_ERR("Fail to load calibrate data");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int btmrvl_cal_data_config(struct btmrvl_private *priv)
|
||||||
|
{
|
||||||
|
const struct firmware *cfg;
|
||||||
|
int ret;
|
||||||
|
const char *cal_data = priv->btmrvl_dev.cal_data;
|
||||||
|
|
||||||
|
if (!cal_data)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
ret = request_firmware(&cfg, cal_data, priv->btmrvl_dev.dev);
|
||||||
|
if (ret < 0) {
|
||||||
|
BT_DBG("Failed to get %s file, skipping cal data download",
|
||||||
|
cal_data);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = btmrvl_process_cal_cfg(priv, (u8 *)cfg->data, cfg->size);
|
||||||
|
release_firmware(cfg);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int btmrvl_setup(struct hci_dev *hdev)
|
||||||
|
{
|
||||||
|
struct btmrvl_private *priv = hci_get_drvdata(hdev);
|
||||||
|
|
||||||
|
btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ);
|
||||||
|
|
||||||
|
if (btmrvl_cal_data_config(priv))
|
||||||
|
BT_ERR("Set cal data failed");
|
||||||
|
|
||||||
|
priv->btmrvl_dev.psmode = 1;
|
||||||
|
btmrvl_enable_ps(priv);
|
||||||
|
|
||||||
|
priv->btmrvl_dev.gpio_gap = 0xffff;
|
||||||
|
btmrvl_send_hscfg_cmd(priv);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function handles the event generated by firmware, rx data
|
* This function handles the event generated by firmware, rx data
|
||||||
* received from firmware, and tx data sent from kernel.
|
* received from firmware, and tx data sent from kernel.
|
||||||
|
@ -572,8 +656,7 @@ int btmrvl_register_hdev(struct btmrvl_private *priv)
|
||||||
hdev->flush = btmrvl_flush;
|
hdev->flush = btmrvl_flush;
|
||||||
hdev->send = btmrvl_send_frame;
|
hdev->send = btmrvl_send_frame;
|
||||||
hdev->ioctl = btmrvl_ioctl;
|
hdev->ioctl = btmrvl_ioctl;
|
||||||
|
hdev->setup = btmrvl_setup;
|
||||||
btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ);
|
|
||||||
|
|
||||||
hdev->dev_type = priv->btmrvl_dev.dev_type;
|
hdev->dev_type = priv->btmrvl_dev.dev_type;
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
* this warranty disclaimer.
|
* this warranty disclaimer.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include <linux/firmware.h>
|
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
|
||||||
#include <linux/mmc/sdio_ids.h>
|
#include <linux/mmc/sdio_ids.h>
|
||||||
|
@ -102,6 +101,7 @@ static const struct btmrvl_sdio_card_reg btmrvl_reg_88xx = {
|
||||||
static const struct btmrvl_sdio_device btmrvl_sdio_sd8688 = {
|
static const struct btmrvl_sdio_device btmrvl_sdio_sd8688 = {
|
||||||
.helper = "mrvl/sd8688_helper.bin",
|
.helper = "mrvl/sd8688_helper.bin",
|
||||||
.firmware = "mrvl/sd8688.bin",
|
.firmware = "mrvl/sd8688.bin",
|
||||||
|
.cal_data = NULL,
|
||||||
.reg = &btmrvl_reg_8688,
|
.reg = &btmrvl_reg_8688,
|
||||||
.sd_blksz_fw_dl = 64,
|
.sd_blksz_fw_dl = 64,
|
||||||
};
|
};
|
||||||
|
@ -109,6 +109,7 @@ static const struct btmrvl_sdio_device btmrvl_sdio_sd8688 = {
|
||||||
static const struct btmrvl_sdio_device btmrvl_sdio_sd8787 = {
|
static const struct btmrvl_sdio_device btmrvl_sdio_sd8787 = {
|
||||||
.helper = NULL,
|
.helper = NULL,
|
||||||
.firmware = "mrvl/sd8787_uapsta.bin",
|
.firmware = "mrvl/sd8787_uapsta.bin",
|
||||||
|
.cal_data = NULL,
|
||||||
.reg = &btmrvl_reg_87xx,
|
.reg = &btmrvl_reg_87xx,
|
||||||
.sd_blksz_fw_dl = 256,
|
.sd_blksz_fw_dl = 256,
|
||||||
};
|
};
|
||||||
|
@ -116,6 +117,7 @@ static const struct btmrvl_sdio_device btmrvl_sdio_sd8787 = {
|
||||||
static const struct btmrvl_sdio_device btmrvl_sdio_sd8797 = {
|
static const struct btmrvl_sdio_device btmrvl_sdio_sd8797 = {
|
||||||
.helper = NULL,
|
.helper = NULL,
|
||||||
.firmware = "mrvl/sd8797_uapsta.bin",
|
.firmware = "mrvl/sd8797_uapsta.bin",
|
||||||
|
.cal_data = "mrvl/sd8797_caldata.conf",
|
||||||
.reg = &btmrvl_reg_87xx,
|
.reg = &btmrvl_reg_87xx,
|
||||||
.sd_blksz_fw_dl = 256,
|
.sd_blksz_fw_dl = 256,
|
||||||
};
|
};
|
||||||
|
@ -123,6 +125,7 @@ static const struct btmrvl_sdio_device btmrvl_sdio_sd8797 = {
|
||||||
static const struct btmrvl_sdio_device btmrvl_sdio_sd8897 = {
|
static const struct btmrvl_sdio_device btmrvl_sdio_sd8897 = {
|
||||||
.helper = NULL,
|
.helper = NULL,
|
||||||
.firmware = "mrvl/sd8897_uapsta.bin",
|
.firmware = "mrvl/sd8897_uapsta.bin",
|
||||||
|
.cal_data = NULL,
|
||||||
.reg = &btmrvl_reg_88xx,
|
.reg = &btmrvl_reg_88xx,
|
||||||
.sd_blksz_fw_dl = 256,
|
.sd_blksz_fw_dl = 256,
|
||||||
};
|
};
|
||||||
|
@ -1006,6 +1009,7 @@ static int btmrvl_sdio_probe(struct sdio_func *func,
|
||||||
struct btmrvl_sdio_device *data = (void *) id->driver_data;
|
struct btmrvl_sdio_device *data = (void *) id->driver_data;
|
||||||
card->helper = data->helper;
|
card->helper = data->helper;
|
||||||
card->firmware = data->firmware;
|
card->firmware = data->firmware;
|
||||||
|
card->cal_data = data->cal_data;
|
||||||
card->reg = data->reg;
|
card->reg = data->reg;
|
||||||
card->sd_blksz_fw_dl = data->sd_blksz_fw_dl;
|
card->sd_blksz_fw_dl = data->sd_blksz_fw_dl;
|
||||||
}
|
}
|
||||||
|
@ -1034,6 +1038,8 @@ static int btmrvl_sdio_probe(struct sdio_func *func,
|
||||||
}
|
}
|
||||||
|
|
||||||
card->priv = priv;
|
card->priv = priv;
|
||||||
|
priv->btmrvl_dev.dev = &card->func->dev;
|
||||||
|
priv->btmrvl_dev.cal_data = card->cal_data;
|
||||||
|
|
||||||
/* Initialize the interface specific function pointers */
|
/* Initialize the interface specific function pointers */
|
||||||
priv->hw_host_to_card = btmrvl_sdio_host_to_card;
|
priv->hw_host_to_card = btmrvl_sdio_host_to_card;
|
||||||
|
@ -1046,12 +1052,6 @@ static int btmrvl_sdio_probe(struct sdio_func *func,
|
||||||
goto disable_host_int;
|
goto disable_host_int;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->btmrvl_dev.psmode = 1;
|
|
||||||
btmrvl_enable_ps(priv);
|
|
||||||
|
|
||||||
priv->btmrvl_dev.gpio_gap = 0xffff;
|
|
||||||
btmrvl_send_hscfg_cmd(priv);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
disable_host_int:
|
disable_host_int:
|
||||||
|
@ -1222,4 +1222,5 @@ MODULE_FIRMWARE("mrvl/sd8688_helper.bin");
|
||||||
MODULE_FIRMWARE("mrvl/sd8688.bin");
|
MODULE_FIRMWARE("mrvl/sd8688.bin");
|
||||||
MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin");
|
MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin");
|
||||||
MODULE_FIRMWARE("mrvl/sd8797_uapsta.bin");
|
MODULE_FIRMWARE("mrvl/sd8797_uapsta.bin");
|
||||||
|
MODULE_FIRMWARE("mrvl/sd8797_caldata.conf");
|
||||||
MODULE_FIRMWARE("mrvl/sd8897_uapsta.bin");
|
MODULE_FIRMWARE("mrvl/sd8897_uapsta.bin");
|
||||||
|
|
|
@ -85,6 +85,7 @@ struct btmrvl_sdio_card {
|
||||||
u32 ioport;
|
u32 ioport;
|
||||||
const char *helper;
|
const char *helper;
|
||||||
const char *firmware;
|
const char *firmware;
|
||||||
|
const char *cal_data;
|
||||||
const struct btmrvl_sdio_card_reg *reg;
|
const struct btmrvl_sdio_card_reg *reg;
|
||||||
u16 sd_blksz_fw_dl;
|
u16 sd_blksz_fw_dl;
|
||||||
u8 rx_unit;
|
u8 rx_unit;
|
||||||
|
@ -94,6 +95,7 @@ struct btmrvl_sdio_card {
|
||||||
struct btmrvl_sdio_device {
|
struct btmrvl_sdio_device {
|
||||||
const char *helper;
|
const char *helper;
|
||||||
const char *firmware;
|
const char *firmware;
|
||||||
|
const char *cal_data;
|
||||||
const struct btmrvl_sdio_card_reg *reg;
|
const struct btmrvl_sdio_card_reg *reg;
|
||||||
u16 sd_blksz_fw_dl;
|
u16 sd_blksz_fw_dl;
|
||||||
};
|
};
|
||||||
|
|
|
@ -102,6 +102,7 @@ static struct usb_device_id btusb_table[] = {
|
||||||
|
|
||||||
/* Broadcom BCM20702A0 */
|
/* Broadcom BCM20702A0 */
|
||||||
{ USB_DEVICE(0x0b05, 0x17b5) },
|
{ USB_DEVICE(0x0b05, 0x17b5) },
|
||||||
|
{ USB_DEVICE(0x0b05, 0x17cb) },
|
||||||
{ USB_DEVICE(0x04ca, 0x2003) },
|
{ USB_DEVICE(0x04ca, 0x2003) },
|
||||||
{ USB_DEVICE(0x0489, 0xe042) },
|
{ USB_DEVICE(0x0489, 0xe042) },
|
||||||
{ USB_DEVICE(0x413c, 0x8197) },
|
{ USB_DEVICE(0x413c, 0x8197) },
|
||||||
|
@ -112,6 +113,9 @@ static struct usb_device_id btusb_table[] = {
|
||||||
/*Broadcom devices with vendor specific id */
|
/*Broadcom devices with vendor specific id */
|
||||||
{ USB_VENDOR_AND_INTERFACE_INFO(0x0a5c, 0xff, 0x01, 0x01) },
|
{ USB_VENDOR_AND_INTERFACE_INFO(0x0a5c, 0xff, 0x01, 0x01) },
|
||||||
|
|
||||||
|
/* Belkin F8065bf - Broadcom based */
|
||||||
|
{ USB_VENDOR_AND_INTERFACE_INFO(0x050d, 0xff, 0x01, 0x01) },
|
||||||
|
|
||||||
{ } /* Terminating entry */
|
{ } /* Terminating entry */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -148,6 +152,7 @@ static struct usb_device_id blacklist_table[] = {
|
||||||
{ USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
|
{ USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
|
||||||
{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
|
{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
|
||||||
{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
|
{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
|
||||||
|
{ USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 },
|
||||||
{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
|
{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
|
||||||
{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
|
{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
|
||||||
{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
|
{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
|
#include <asm/unaligned.h>
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
|
@ -39,17 +40,17 @@
|
||||||
#include <net/bluetooth/bluetooth.h>
|
#include <net/bluetooth/bluetooth.h>
|
||||||
#include <net/bluetooth/hci_core.h>
|
#include <net/bluetooth/hci_core.h>
|
||||||
|
|
||||||
#define VERSION "1.3"
|
#define VERSION "1.4"
|
||||||
|
|
||||||
static bool amp;
|
static bool amp;
|
||||||
|
|
||||||
struct vhci_data {
|
struct vhci_data {
|
||||||
struct hci_dev *hdev;
|
struct hci_dev *hdev;
|
||||||
|
|
||||||
unsigned long flags;
|
|
||||||
|
|
||||||
wait_queue_head_t read_wait;
|
wait_queue_head_t read_wait;
|
||||||
struct sk_buff_head readq;
|
struct sk_buff_head readq;
|
||||||
|
|
||||||
|
struct delayed_work open_timeout;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int vhci_open_dev(struct hci_dev *hdev)
|
static int vhci_open_dev(struct hci_dev *hdev)
|
||||||
|
@ -99,16 +100,62 @@ static int vhci_send_frame(struct sk_buff *skb)
|
||||||
skb_queue_tail(&data->readq, skb);
|
skb_queue_tail(&data->readq, skb);
|
||||||
|
|
||||||
wake_up_interruptible(&data->read_wait);
|
wake_up_interruptible(&data->read_wait);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int vhci_create_device(struct vhci_data *data, __u8 dev_type)
|
||||||
|
{
|
||||||
|
struct hci_dev *hdev;
|
||||||
|
struct sk_buff *skb;
|
||||||
|
|
||||||
|
skb = bt_skb_alloc(4, GFP_KERNEL);
|
||||||
|
if (!skb)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
hdev = hci_alloc_dev();
|
||||||
|
if (!hdev) {
|
||||||
|
kfree_skb(skb);
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
data->hdev = hdev;
|
||||||
|
|
||||||
|
hdev->bus = HCI_VIRTUAL;
|
||||||
|
hdev->dev_type = dev_type;
|
||||||
|
hci_set_drvdata(hdev, data);
|
||||||
|
|
||||||
|
hdev->open = vhci_open_dev;
|
||||||
|
hdev->close = vhci_close_dev;
|
||||||
|
hdev->flush = vhci_flush;
|
||||||
|
hdev->send = vhci_send_frame;
|
||||||
|
|
||||||
|
if (hci_register_dev(hdev) < 0) {
|
||||||
|
BT_ERR("Can't register HCI device");
|
||||||
|
hci_free_dev(hdev);
|
||||||
|
data->hdev = NULL;
|
||||||
|
kfree_skb(skb);
|
||||||
|
return -EBUSY;
|
||||||
|
}
|
||||||
|
|
||||||
|
bt_cb(skb)->pkt_type = HCI_VENDOR_PKT;
|
||||||
|
|
||||||
|
*skb_put(skb, 1) = 0xff;
|
||||||
|
*skb_put(skb, 1) = dev_type;
|
||||||
|
put_unaligned_le16(hdev->id, skb_put(skb, 2));
|
||||||
|
skb_queue_tail(&data->readq, skb);
|
||||||
|
|
||||||
|
wake_up_interruptible(&data->read_wait);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ssize_t vhci_get_user(struct vhci_data *data,
|
static inline ssize_t vhci_get_user(struct vhci_data *data,
|
||||||
const char __user *buf, size_t count)
|
const char __user *buf, size_t count)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
|
__u8 pkt_type, dev_type;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (count > HCI_MAX_FRAME_SIZE)
|
if (count < 2 || count > HCI_MAX_FRAME_SIZE)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
skb = bt_skb_alloc(count, GFP_KERNEL);
|
skb = bt_skb_alloc(count, GFP_KERNEL);
|
||||||
|
@ -120,27 +167,70 @@ static inline ssize_t vhci_get_user(struct vhci_data *data,
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
skb->dev = (void *) data->hdev;
|
pkt_type = *((__u8 *) skb->data);
|
||||||
bt_cb(skb)->pkt_type = *((__u8 *) skb->data);
|
|
||||||
skb_pull(skb, 1);
|
skb_pull(skb, 1);
|
||||||
|
|
||||||
hci_recv_frame(skb);
|
switch (pkt_type) {
|
||||||
|
case HCI_EVENT_PKT:
|
||||||
|
case HCI_ACLDATA_PKT:
|
||||||
|
case HCI_SCODATA_PKT:
|
||||||
|
if (!data->hdev) {
|
||||||
|
kfree_skb(skb);
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
return count;
|
skb->dev = (void *) data->hdev;
|
||||||
|
bt_cb(skb)->pkt_type = pkt_type;
|
||||||
|
|
||||||
|
ret = hci_recv_frame(skb);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case HCI_VENDOR_PKT:
|
||||||
|
if (data->hdev) {
|
||||||
|
kfree_skb(skb);
|
||||||
|
return -EBADFD;
|
||||||
|
}
|
||||||
|
|
||||||
|
cancel_delayed_work_sync(&data->open_timeout);
|
||||||
|
|
||||||
|
dev_type = *((__u8 *) skb->data);
|
||||||
|
skb_pull(skb, 1);
|
||||||
|
|
||||||
|
if (skb->len > 0) {
|
||||||
|
kfree_skb(skb);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
kfree_skb(skb);
|
||||||
|
|
||||||
|
if (dev_type != HCI_BREDR && dev_type != HCI_AMP)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
ret = vhci_create_device(data, dev_type);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
kfree_skb(skb);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (ret < 0) ? ret : count;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline ssize_t vhci_put_user(struct vhci_data *data,
|
static inline ssize_t vhci_put_user(struct vhci_data *data,
|
||||||
struct sk_buff *skb, char __user *buf, int count)
|
struct sk_buff *skb,
|
||||||
|
char __user *buf, int count)
|
||||||
{
|
{
|
||||||
char __user *ptr = buf;
|
char __user *ptr = buf;
|
||||||
int len, total = 0;
|
int len;
|
||||||
|
|
||||||
len = min_t(unsigned int, skb->len, count);
|
len = min_t(unsigned int, skb->len, count);
|
||||||
|
|
||||||
if (copy_to_user(ptr, skb->data, len))
|
if (copy_to_user(ptr, skb->data, len))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
total += len;
|
if (!data->hdev)
|
||||||
|
return len;
|
||||||
|
|
||||||
data->hdev->stat.byte_tx += len;
|
data->hdev->stat.byte_tx += len;
|
||||||
|
|
||||||
|
@ -148,21 +238,19 @@ static inline ssize_t vhci_put_user(struct vhci_data *data,
|
||||||
case HCI_COMMAND_PKT:
|
case HCI_COMMAND_PKT:
|
||||||
data->hdev->stat.cmd_tx++;
|
data->hdev->stat.cmd_tx++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HCI_ACLDATA_PKT:
|
case HCI_ACLDATA_PKT:
|
||||||
data->hdev->stat.acl_tx++;
|
data->hdev->stat.acl_tx++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HCI_SCODATA_PKT:
|
case HCI_SCODATA_PKT:
|
||||||
data->hdev->stat.sco_tx++;
|
data->hdev->stat.sco_tx++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return total;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t vhci_read(struct file *file,
|
static ssize_t vhci_read(struct file *file,
|
||||||
char __user *buf, size_t count, loff_t *pos)
|
char __user *buf, size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
struct vhci_data *data = file->private_data;
|
struct vhci_data *data = file->private_data;
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
|
@ -185,7 +273,7 @@ static ssize_t vhci_read(struct file *file,
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = wait_event_interruptible(data->read_wait,
|
ret = wait_event_interruptible(data->read_wait,
|
||||||
!skb_queue_empty(&data->readq));
|
!skb_queue_empty(&data->readq));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -194,7 +282,7 @@ static ssize_t vhci_read(struct file *file,
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t vhci_write(struct file *file,
|
static ssize_t vhci_write(struct file *file,
|
||||||
const char __user *buf, size_t count, loff_t *pos)
|
const char __user *buf, size_t count, loff_t *pos)
|
||||||
{
|
{
|
||||||
struct vhci_data *data = file->private_data;
|
struct vhci_data *data = file->private_data;
|
||||||
|
|
||||||
|
@ -213,10 +301,17 @@ static unsigned int vhci_poll(struct file *file, poll_table *wait)
|
||||||
return POLLOUT | POLLWRNORM;
|
return POLLOUT | POLLWRNORM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void vhci_open_timeout(struct work_struct *work)
|
||||||
|
{
|
||||||
|
struct vhci_data *data = container_of(work, struct vhci_data,
|
||||||
|
open_timeout.work);
|
||||||
|
|
||||||
|
vhci_create_device(data, amp ? HCI_AMP : HCI_BREDR);
|
||||||
|
}
|
||||||
|
|
||||||
static int vhci_open(struct inode *inode, struct file *file)
|
static int vhci_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
struct vhci_data *data;
|
struct vhci_data *data;
|
||||||
struct hci_dev *hdev;
|
|
||||||
|
|
||||||
data = kzalloc(sizeof(struct vhci_data), GFP_KERNEL);
|
data = kzalloc(sizeof(struct vhci_data), GFP_KERNEL);
|
||||||
if (!data)
|
if (!data)
|
||||||
|
@ -225,35 +320,13 @@ static int vhci_open(struct inode *inode, struct file *file)
|
||||||
skb_queue_head_init(&data->readq);
|
skb_queue_head_init(&data->readq);
|
||||||
init_waitqueue_head(&data->read_wait);
|
init_waitqueue_head(&data->read_wait);
|
||||||
|
|
||||||
hdev = hci_alloc_dev();
|
INIT_DELAYED_WORK(&data->open_timeout, vhci_open_timeout);
|
||||||
if (!hdev) {
|
|
||||||
kfree(data);
|
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
data->hdev = hdev;
|
|
||||||
|
|
||||||
hdev->bus = HCI_VIRTUAL;
|
|
||||||
hci_set_drvdata(hdev, data);
|
|
||||||
|
|
||||||
if (amp)
|
|
||||||
hdev->dev_type = HCI_AMP;
|
|
||||||
|
|
||||||
hdev->open = vhci_open_dev;
|
|
||||||
hdev->close = vhci_close_dev;
|
|
||||||
hdev->flush = vhci_flush;
|
|
||||||
hdev->send = vhci_send_frame;
|
|
||||||
|
|
||||||
if (hci_register_dev(hdev) < 0) {
|
|
||||||
BT_ERR("Can't register HCI device");
|
|
||||||
kfree(data);
|
|
||||||
hci_free_dev(hdev);
|
|
||||||
return -EBUSY;
|
|
||||||
}
|
|
||||||
|
|
||||||
file->private_data = data;
|
file->private_data = data;
|
||||||
nonseekable_open(inode, file);
|
nonseekable_open(inode, file);
|
||||||
|
|
||||||
|
schedule_delayed_work(&data->open_timeout, msecs_to_jiffies(1000));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,8 +335,12 @@ static int vhci_release(struct inode *inode, struct file *file)
|
||||||
struct vhci_data *data = file->private_data;
|
struct vhci_data *data = file->private_data;
|
||||||
struct hci_dev *hdev = data->hdev;
|
struct hci_dev *hdev = data->hdev;
|
||||||
|
|
||||||
hci_unregister_dev(hdev);
|
cancel_delayed_work_sync(&data->open_timeout);
|
||||||
hci_free_dev(hdev);
|
|
||||||
|
if (hdev) {
|
||||||
|
hci_unregister_dev(hdev);
|
||||||
|
hci_free_dev(hdev);
|
||||||
|
}
|
||||||
|
|
||||||
file->private_data = NULL;
|
file->private_data = NULL;
|
||||||
kfree(data);
|
kfree(data);
|
||||||
|
@ -309,3 +386,4 @@ MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
|
||||||
MODULE_DESCRIPTION("Bluetooth virtual HCI driver ver " VERSION);
|
MODULE_DESCRIPTION("Bluetooth virtual HCI driver ver " VERSION);
|
||||||
MODULE_VERSION(VERSION);
|
MODULE_VERSION(VERSION);
|
||||||
MODULE_LICENSE("GPL");
|
MODULE_LICENSE("GPL");
|
||||||
|
MODULE_ALIAS("devname:vhci");
|
||||||
|
|
|
@ -177,7 +177,7 @@ uint8_t ast_get_index_reg_mask(struct ast_private *ast,
|
||||||
|
|
||||||
static inline void ast_open_key(struct ast_private *ast)
|
static inline void ast_open_key(struct ast_private *ast)
|
||||||
{
|
{
|
||||||
ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xA1, 0xFF, 0x04);
|
ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x80, 0xA8);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define AST_VIDMEM_SIZE_8M 0x00800000
|
#define AST_VIDMEM_SIZE_8M 0x00800000
|
||||||
|
|
|
@ -407,6 +407,14 @@ static void drm_fb_helper_dpms(struct fb_info *info, int dpms_mode)
|
||||||
struct drm_connector *connector;
|
struct drm_connector *connector;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* fbdev->blank can be called from irq context in case of a panic.
|
||||||
|
* Since we already have our own special panic handler which will
|
||||||
|
* restore the fbdev console mode completely, just bail out early.
|
||||||
|
*/
|
||||||
|
if (oops_in_progress)
|
||||||
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* fbdev->blank can be called from irq context in case of a panic.
|
* fbdev->blank can be called from irq context in case of a panic.
|
||||||
* Since we already have our own special panic handler which will
|
* Since we already have our own special panic handler which will
|
||||||
|
|
|
@ -579,8 +579,22 @@ static void
|
||||||
init_reserved(struct nvbios_init *init)
|
init_reserved(struct nvbios_init *init)
|
||||||
{
|
{
|
||||||
u8 opcode = nv_ro08(init->bios, init->offset);
|
u8 opcode = nv_ro08(init->bios, init->offset);
|
||||||
trace("RESERVED\t0x%02x\n", opcode);
|
u8 length, i;
|
||||||
init->offset += 1;
|
|
||||||
|
switch (opcode) {
|
||||||
|
case 0xaa:
|
||||||
|
length = 4;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
length = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
trace("RESERVED 0x%02x\t", opcode);
|
||||||
|
for (i = 1; i < length; i++)
|
||||||
|
cont(" 0x%02x", nv_ro08(init->bios, init->offset + i));
|
||||||
|
cont("\n");
|
||||||
|
init->offset += length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1437,7 +1451,7 @@ init_configure_mem(struct nvbios_init *init)
|
||||||
data = init_rdvgai(init, 0x03c4, 0x01);
|
data = init_rdvgai(init, 0x03c4, 0x01);
|
||||||
init_wrvgai(init, 0x03c4, 0x01, data | 0x20);
|
init_wrvgai(init, 0x03c4, 0x01, data | 0x20);
|
||||||
|
|
||||||
while ((addr = nv_ro32(bios, sdata)) != 0xffffffff) {
|
for (; (addr = nv_ro32(bios, sdata)) != 0xffffffff; sdata += 4) {
|
||||||
switch (addr) {
|
switch (addr) {
|
||||||
case 0x10021c: /* CKE_NORMAL */
|
case 0x10021c: /* CKE_NORMAL */
|
||||||
case 0x1002d0: /* CMD_REFRESH */
|
case 0x1002d0: /* CMD_REFRESH */
|
||||||
|
@ -2135,6 +2149,7 @@ static struct nvbios_init_opcode {
|
||||||
[0x99] = { init_zm_auxch },
|
[0x99] = { init_zm_auxch },
|
||||||
[0x9a] = { init_i2c_long_if },
|
[0x9a] = { init_i2c_long_if },
|
||||||
[0xa9] = { init_gpio_ne },
|
[0xa9] = { init_gpio_ne },
|
||||||
|
[0xaa] = { init_reserved },
|
||||||
};
|
};
|
||||||
|
|
||||||
#define init_opcode_nr (sizeof(init_opcode) / sizeof(init_opcode[0]))
|
#define init_opcode_nr (sizeof(init_opcode) / sizeof(init_opcode[0]))
|
||||||
|
|
|
@ -278,7 +278,6 @@ nouveau_display_create(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
struct nouveau_drm *drm = nouveau_drm(dev);
|
struct nouveau_drm *drm = nouveau_drm(dev);
|
||||||
struct nouveau_display *disp;
|
struct nouveau_display *disp;
|
||||||
u32 pclass = dev->pdev->class >> 8;
|
|
||||||
int ret, gen;
|
int ret, gen;
|
||||||
|
|
||||||
disp = drm->display = kzalloc(sizeof(*disp), GFP_KERNEL);
|
disp = drm->display = kzalloc(sizeof(*disp), GFP_KERNEL);
|
||||||
|
@ -340,29 +339,25 @@ nouveau_display_create(struct drm_device *dev)
|
||||||
drm_kms_helper_poll_init(dev);
|
drm_kms_helper_poll_init(dev);
|
||||||
drm_kms_helper_poll_disable(dev);
|
drm_kms_helper_poll_disable(dev);
|
||||||
|
|
||||||
if (nouveau_modeset == 1 ||
|
if (drm->vbios.dcb.entries) {
|
||||||
(nouveau_modeset < 0 && pclass == PCI_CLASS_DISPLAY_VGA)) {
|
if (nv_device(drm->device)->card_type < NV_50)
|
||||||
if (drm->vbios.dcb.entries) {
|
ret = nv04_display_create(dev);
|
||||||
if (nv_device(drm->device)->card_type < NV_50)
|
else
|
||||||
ret = nv04_display_create(dev);
|
ret = nv50_display_create(dev);
|
||||||
else
|
} else {
|
||||||
ret = nv50_display_create(dev);
|
ret = 0;
|
||||||
} else {
|
|
||||||
ret = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ret)
|
|
||||||
goto disp_create_err;
|
|
||||||
|
|
||||||
if (dev->mode_config.num_crtc) {
|
|
||||||
ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
|
|
||||||
if (ret)
|
|
||||||
goto vblank_err;
|
|
||||||
}
|
|
||||||
|
|
||||||
nouveau_backlight_init(dev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
goto disp_create_err;
|
||||||
|
|
||||||
|
if (dev->mode_config.num_crtc) {
|
||||||
|
ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
|
||||||
|
if (ret)
|
||||||
|
goto vblank_err;
|
||||||
|
}
|
||||||
|
|
||||||
|
nouveau_backlight_init(dev);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
vblank_err:
|
vblank_err:
|
||||||
|
|
|
@ -454,7 +454,8 @@ nouveau_fbcon_init(struct drm_device *dev)
|
||||||
int preferred_bpp;
|
int preferred_bpp;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!dev->mode_config.num_crtc)
|
if (!dev->mode_config.num_crtc ||
|
||||||
|
(dev->pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fbcon = kzalloc(sizeof(struct nouveau_fbdev), GFP_KERNEL);
|
fbcon = kzalloc(sizeof(struct nouveau_fbdev), GFP_KERNEL);
|
||||||
|
|
|
@ -104,9 +104,7 @@ nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev,
|
||||||
else
|
else
|
||||||
nvbe->ttm.ttm.func = &nv50_sgdma_backend;
|
nvbe->ttm.ttm.func = &nv50_sgdma_backend;
|
||||||
|
|
||||||
if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page)) {
|
if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page))
|
||||||
kfree(nvbe);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
return &nvbe->ttm.ttm;
|
return &nvbe->ttm.ttm;
|
||||||
}
|
}
|
||||||
|
|
|
@ -707,8 +707,9 @@ atombios_get_encoder_mode(struct drm_encoder *encoder)
|
||||||
switch (connector->connector_type) {
|
switch (connector->connector_type) {
|
||||||
case DRM_MODE_CONNECTOR_DVII:
|
case DRM_MODE_CONNECTOR_DVII:
|
||||||
case DRM_MODE_CONNECTOR_HDMIB: /* HDMI-B is basically DL-DVI; analog works fine */
|
case DRM_MODE_CONNECTOR_HDMIB: /* HDMI-B is basically DL-DVI; analog works fine */
|
||||||
if (drm_detect_hdmi_monitor(radeon_connector->edid) &&
|
if ((radeon_connector->audio == RADEON_AUDIO_ENABLE) ||
|
||||||
radeon_audio)
|
(drm_detect_hdmi_monitor(radeon_connector->edid) &&
|
||||||
|
(radeon_connector->audio == RADEON_AUDIO_AUTO)))
|
||||||
return ATOM_ENCODER_MODE_HDMI;
|
return ATOM_ENCODER_MODE_HDMI;
|
||||||
else if (radeon_connector->use_digital)
|
else if (radeon_connector->use_digital)
|
||||||
return ATOM_ENCODER_MODE_DVI;
|
return ATOM_ENCODER_MODE_DVI;
|
||||||
|
@ -718,8 +719,9 @@ atombios_get_encoder_mode(struct drm_encoder *encoder)
|
||||||
case DRM_MODE_CONNECTOR_DVID:
|
case DRM_MODE_CONNECTOR_DVID:
|
||||||
case DRM_MODE_CONNECTOR_HDMIA:
|
case DRM_MODE_CONNECTOR_HDMIA:
|
||||||
default:
|
default:
|
||||||
if (drm_detect_hdmi_monitor(radeon_connector->edid) &&
|
if ((radeon_connector->audio == RADEON_AUDIO_ENABLE) ||
|
||||||
radeon_audio)
|
(drm_detect_hdmi_monitor(radeon_connector->edid) &&
|
||||||
|
(radeon_connector->audio == RADEON_AUDIO_AUTO)))
|
||||||
return ATOM_ENCODER_MODE_HDMI;
|
return ATOM_ENCODER_MODE_HDMI;
|
||||||
else
|
else
|
||||||
return ATOM_ENCODER_MODE_DVI;
|
return ATOM_ENCODER_MODE_DVI;
|
||||||
|
@ -732,8 +734,9 @@ atombios_get_encoder_mode(struct drm_encoder *encoder)
|
||||||
if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
|
if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
|
||||||
(dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP))
|
(dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP))
|
||||||
return ATOM_ENCODER_MODE_DP;
|
return ATOM_ENCODER_MODE_DP;
|
||||||
else if (drm_detect_hdmi_monitor(radeon_connector->edid) &&
|
else if ((radeon_connector->audio == RADEON_AUDIO_ENABLE) ||
|
||||||
radeon_audio)
|
(drm_detect_hdmi_monitor(radeon_connector->edid) &&
|
||||||
|
(radeon_connector->audio == RADEON_AUDIO_AUTO)))
|
||||||
return ATOM_ENCODER_MODE_HDMI;
|
return ATOM_ENCODER_MODE_HDMI;
|
||||||
else
|
else
|
||||||
return ATOM_ENCODER_MODE_DVI;
|
return ATOM_ENCODER_MODE_DVI;
|
||||||
|
@ -1647,8 +1650,12 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode)
|
||||||
atombios_dig_encoder_setup(encoder, ATOM_ENABLE, 0);
|
atombios_dig_encoder_setup(encoder, ATOM_ENABLE, 0);
|
||||||
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP, 0, 0);
|
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP, 0, 0);
|
||||||
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);
|
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);
|
||||||
/* some early dce3.2 boards have a bug in their transmitter control table */
|
/* some dce3.x boards have a bug in their transmitter control table.
|
||||||
if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730))
|
* ACTION_ENABLE_OUTPUT can probably be dropped since ACTION_ENABLE
|
||||||
|
* does the same thing and more.
|
||||||
|
*/
|
||||||
|
if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730) &&
|
||||||
|
(rdev->family != CHIP_RS880))
|
||||||
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0);
|
atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0);
|
||||||
}
|
}
|
||||||
if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) {
|
if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) {
|
||||||
|
|
|
@ -2340,12 +2340,6 @@ int btc_dpm_set_power_state(struct radeon_device *rdev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = rv770_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO);
|
|
||||||
if (ret) {
|
|
||||||
DRM_ERROR("rv770_dpm_force_performance_level failed\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4748,12 +4748,6 @@ int ci_dpm_set_power_state(struct radeon_device *rdev)
|
||||||
if (pi->pcie_performance_request)
|
if (pi->pcie_performance_request)
|
||||||
ci_notify_link_speed_change_after_state_change(rdev, new_ps, old_ps);
|
ci_notify_link_speed_change_after_state_change(rdev, new_ps, old_ps);
|
||||||
|
|
||||||
ret = ci_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO);
|
|
||||||
if (ret) {
|
|
||||||
DRM_ERROR("ci_dpm_force_performance_level failed\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
cik_update_cg(rdev, (RADEON_CG_BLOCK_GFX |
|
cik_update_cg(rdev, (RADEON_CG_BLOCK_GFX |
|
||||||
RADEON_CG_BLOCK_MC |
|
RADEON_CG_BLOCK_MC |
|
||||||
RADEON_CG_BLOCK_SDMA |
|
RADEON_CG_BLOCK_SDMA |
|
||||||
|
|
|
@ -47,10 +47,11 @@ int ci_copy_bytes_to_smc(struct radeon_device *rdev,
|
||||||
u32 smc_start_address,
|
u32 smc_start_address,
|
||||||
const u8 *src, u32 byte_count, u32 limit)
|
const u8 *src, u32 byte_count, u32 limit)
|
||||||
{
|
{
|
||||||
|
unsigned long flags;
|
||||||
u32 data, original_data;
|
u32 data, original_data;
|
||||||
u32 addr;
|
u32 addr;
|
||||||
u32 extra_shift;
|
u32 extra_shift;
|
||||||
int ret;
|
int ret = 0;
|
||||||
|
|
||||||
if (smc_start_address & 3)
|
if (smc_start_address & 3)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -59,13 +60,14 @@ int ci_copy_bytes_to_smc(struct radeon_device *rdev,
|
||||||
|
|
||||||
addr = smc_start_address;
|
addr = smc_start_address;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&rdev->smc_idx_lock, flags);
|
||||||
while (byte_count >= 4) {
|
while (byte_count >= 4) {
|
||||||
/* SMC address space is BE */
|
/* SMC address space is BE */
|
||||||
data = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3];
|
data = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3];
|
||||||
|
|
||||||
ret = ci_set_smc_sram_address(rdev, addr, limit);
|
ret = ci_set_smc_sram_address(rdev, addr, limit);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto done;
|
||||||
|
|
||||||
WREG32(SMC_IND_DATA_0, data);
|
WREG32(SMC_IND_DATA_0, data);
|
||||||
|
|
||||||
|
@ -80,7 +82,7 @@ int ci_copy_bytes_to_smc(struct radeon_device *rdev,
|
||||||
|
|
||||||
ret = ci_set_smc_sram_address(rdev, addr, limit);
|
ret = ci_set_smc_sram_address(rdev, addr, limit);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto done;
|
||||||
|
|
||||||
original_data = RREG32(SMC_IND_DATA_0);
|
original_data = RREG32(SMC_IND_DATA_0);
|
||||||
|
|
||||||
|
@ -97,11 +99,15 @@ int ci_copy_bytes_to_smc(struct radeon_device *rdev,
|
||||||
|
|
||||||
ret = ci_set_smc_sram_address(rdev, addr, limit);
|
ret = ci_set_smc_sram_address(rdev, addr, limit);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto done;
|
||||||
|
|
||||||
WREG32(SMC_IND_DATA_0, data);
|
WREG32(SMC_IND_DATA_0, data);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
|
done:
|
||||||
|
spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ci_start_smc(struct radeon_device *rdev)
|
void ci_start_smc(struct radeon_device *rdev)
|
||||||
|
@ -197,6 +203,7 @@ PPSMC_Result ci_wait_for_smc_inactive(struct radeon_device *rdev)
|
||||||
|
|
||||||
int ci_load_smc_ucode(struct radeon_device *rdev, u32 limit)
|
int ci_load_smc_ucode(struct radeon_device *rdev, u32 limit)
|
||||||
{
|
{
|
||||||
|
unsigned long flags;
|
||||||
u32 ucode_start_address;
|
u32 ucode_start_address;
|
||||||
u32 ucode_size;
|
u32 ucode_size;
|
||||||
const u8 *src;
|
const u8 *src;
|
||||||
|
@ -219,6 +226,7 @@ int ci_load_smc_ucode(struct radeon_device *rdev, u32 limit)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
src = (const u8 *)rdev->smc_fw->data;
|
src = (const u8 *)rdev->smc_fw->data;
|
||||||
|
spin_lock_irqsave(&rdev->smc_idx_lock, flags);
|
||||||
WREG32(SMC_IND_INDEX_0, ucode_start_address);
|
WREG32(SMC_IND_INDEX_0, ucode_start_address);
|
||||||
WREG32_P(SMC_IND_ACCESS_CNTL, AUTO_INCREMENT_IND_0, ~AUTO_INCREMENT_IND_0);
|
WREG32_P(SMC_IND_ACCESS_CNTL, AUTO_INCREMENT_IND_0, ~AUTO_INCREMENT_IND_0);
|
||||||
while (ucode_size >= 4) {
|
while (ucode_size >= 4) {
|
||||||
|
@ -231,6 +239,7 @@ int ci_load_smc_ucode(struct radeon_device *rdev, u32 limit)
|
||||||
ucode_size -= 4;
|
ucode_size -= 4;
|
||||||
}
|
}
|
||||||
WREG32_P(SMC_IND_ACCESS_CNTL, 0, ~AUTO_INCREMENT_IND_0);
|
WREG32_P(SMC_IND_ACCESS_CNTL, 0, ~AUTO_INCREMENT_IND_0);
|
||||||
|
spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -238,25 +247,29 @@ int ci_load_smc_ucode(struct radeon_device *rdev, u32 limit)
|
||||||
int ci_read_smc_sram_dword(struct radeon_device *rdev,
|
int ci_read_smc_sram_dword(struct radeon_device *rdev,
|
||||||
u32 smc_address, u32 *value, u32 limit)
|
u32 smc_address, u32 *value, u32 limit)
|
||||||
{
|
{
|
||||||
|
unsigned long flags;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&rdev->smc_idx_lock, flags);
|
||||||
ret = ci_set_smc_sram_address(rdev, smc_address, limit);
|
ret = ci_set_smc_sram_address(rdev, smc_address, limit);
|
||||||
if (ret)
|
if (ret == 0)
|
||||||
return ret;
|
*value = RREG32(SMC_IND_DATA_0);
|
||||||
|
spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
|
||||||
|
|
||||||
*value = RREG32(SMC_IND_DATA_0);
|
return ret;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ci_write_smc_sram_dword(struct radeon_device *rdev,
|
int ci_write_smc_sram_dword(struct radeon_device *rdev,
|
||||||
u32 smc_address, u32 value, u32 limit)
|
u32 smc_address, u32 value, u32 limit)
|
||||||
{
|
{
|
||||||
|
unsigned long flags;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&rdev->smc_idx_lock, flags);
|
||||||
ret = ci_set_smc_sram_address(rdev, smc_address, limit);
|
ret = ci_set_smc_sram_address(rdev, smc_address, limit);
|
||||||
if (ret)
|
if (ret == 0)
|
||||||
return ret;
|
WREG32(SMC_IND_DATA_0, value);
|
||||||
|
spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
|
||||||
|
|
||||||
WREG32(SMC_IND_DATA_0, value);
|
return ret;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,6 +77,8 @@ static void cik_pcie_gen3_enable(struct radeon_device *rdev);
|
||||||
static void cik_program_aspm(struct radeon_device *rdev);
|
static void cik_program_aspm(struct radeon_device *rdev);
|
||||||
static void cik_init_pg(struct radeon_device *rdev);
|
static void cik_init_pg(struct radeon_device *rdev);
|
||||||
static void cik_init_cg(struct radeon_device *rdev);
|
static void cik_init_cg(struct radeon_device *rdev);
|
||||||
|
static void cik_enable_gui_idle_interrupt(struct radeon_device *rdev,
|
||||||
|
bool enable);
|
||||||
|
|
||||||
/* get temperature in millidegrees */
|
/* get temperature in millidegrees */
|
||||||
int ci_get_temp(struct radeon_device *rdev)
|
int ci_get_temp(struct radeon_device *rdev)
|
||||||
|
@ -120,20 +122,27 @@ int kv_get_temp(struct radeon_device *rdev)
|
||||||
*/
|
*/
|
||||||
u32 cik_pciep_rreg(struct radeon_device *rdev, u32 reg)
|
u32 cik_pciep_rreg(struct radeon_device *rdev, u32 reg)
|
||||||
{
|
{
|
||||||
|
unsigned long flags;
|
||||||
u32 r;
|
u32 r;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&rdev->pciep_idx_lock, flags);
|
||||||
WREG32(PCIE_INDEX, reg);
|
WREG32(PCIE_INDEX, reg);
|
||||||
(void)RREG32(PCIE_INDEX);
|
(void)RREG32(PCIE_INDEX);
|
||||||
r = RREG32(PCIE_DATA);
|
r = RREG32(PCIE_DATA);
|
||||||
|
spin_unlock_irqrestore(&rdev->pciep_idx_lock, flags);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cik_pciep_wreg(struct radeon_device *rdev, u32 reg, u32 v)
|
void cik_pciep_wreg(struct radeon_device *rdev, u32 reg, u32 v)
|
||||||
{
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&rdev->pciep_idx_lock, flags);
|
||||||
WREG32(PCIE_INDEX, reg);
|
WREG32(PCIE_INDEX, reg);
|
||||||
(void)RREG32(PCIE_INDEX);
|
(void)RREG32(PCIE_INDEX);
|
||||||
WREG32(PCIE_DATA, v);
|
WREG32(PCIE_DATA, v);
|
||||||
(void)RREG32(PCIE_DATA);
|
(void)RREG32(PCIE_DATA);
|
||||||
|
spin_unlock_irqrestore(&rdev->pciep_idx_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const u32 spectre_rlc_save_restore_register_list[] =
|
static const u32 spectre_rlc_save_restore_register_list[] =
|
||||||
|
@ -2722,7 +2731,8 @@ static void cik_gpu_init(struct radeon_device *rdev)
|
||||||
} else if ((rdev->pdev->device == 0x1309) ||
|
} else if ((rdev->pdev->device == 0x1309) ||
|
||||||
(rdev->pdev->device == 0x130A) ||
|
(rdev->pdev->device == 0x130A) ||
|
||||||
(rdev->pdev->device == 0x130D) ||
|
(rdev->pdev->device == 0x130D) ||
|
||||||
(rdev->pdev->device == 0x1313)) {
|
(rdev->pdev->device == 0x1313) ||
|
||||||
|
(rdev->pdev->device == 0x131D)) {
|
||||||
rdev->config.cik.max_cu_per_sh = 6;
|
rdev->config.cik.max_cu_per_sh = 6;
|
||||||
rdev->config.cik.max_backends_per_se = 2;
|
rdev->config.cik.max_backends_per_se = 2;
|
||||||
} else if ((rdev->pdev->device == 0x1306) ||
|
} else if ((rdev->pdev->device == 0x1306) ||
|
||||||
|
@ -4013,6 +4023,8 @@ static int cik_cp_resume(struct radeon_device *rdev)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
cik_enable_gui_idle_interrupt(rdev, false);
|
||||||
|
|
||||||
r = cik_cp_load_microcode(rdev);
|
r = cik_cp_load_microcode(rdev);
|
||||||
if (r)
|
if (r)
|
||||||
return r;
|
return r;
|
||||||
|
@ -4024,6 +4036,8 @@ static int cik_cp_resume(struct radeon_device *rdev)
|
||||||
if (r)
|
if (r)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
cik_enable_gui_idle_interrupt(rdev, true);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5376,7 +5390,9 @@ static void cik_enable_hdp_ls(struct radeon_device *rdev,
|
||||||
void cik_update_cg(struct radeon_device *rdev,
|
void cik_update_cg(struct radeon_device *rdev,
|
||||||
u32 block, bool enable)
|
u32 block, bool enable)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (block & RADEON_CG_BLOCK_GFX) {
|
if (block & RADEON_CG_BLOCK_GFX) {
|
||||||
|
cik_enable_gui_idle_interrupt(rdev, false);
|
||||||
/* order matters! */
|
/* order matters! */
|
||||||
if (enable) {
|
if (enable) {
|
||||||
cik_enable_mgcg(rdev, true);
|
cik_enable_mgcg(rdev, true);
|
||||||
|
@ -5385,6 +5401,7 @@ void cik_update_cg(struct radeon_device *rdev,
|
||||||
cik_enable_cgcg(rdev, false);
|
cik_enable_cgcg(rdev, false);
|
||||||
cik_enable_mgcg(rdev, false);
|
cik_enable_mgcg(rdev, false);
|
||||||
}
|
}
|
||||||
|
cik_enable_gui_idle_interrupt(rdev, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (block & RADEON_CG_BLOCK_MC) {
|
if (block & RADEON_CG_BLOCK_MC) {
|
||||||
|
@ -5541,7 +5558,7 @@ static void cik_enable_gfx_cgpg(struct radeon_device *rdev,
|
||||||
{
|
{
|
||||||
u32 data, orig;
|
u32 data, orig;
|
||||||
|
|
||||||
if (enable && (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_CG)) {
|
if (enable && (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_PG)) {
|
||||||
orig = data = RREG32(RLC_PG_CNTL);
|
orig = data = RREG32(RLC_PG_CNTL);
|
||||||
data |= GFX_PG_ENABLE;
|
data |= GFX_PG_ENABLE;
|
||||||
if (orig != data)
|
if (orig != data)
|
||||||
|
@ -5805,7 +5822,7 @@ static void cik_init_pg(struct radeon_device *rdev)
|
||||||
if (rdev->pg_flags) {
|
if (rdev->pg_flags) {
|
||||||
cik_enable_sck_slowdown_on_pu(rdev, true);
|
cik_enable_sck_slowdown_on_pu(rdev, true);
|
||||||
cik_enable_sck_slowdown_on_pd(rdev, true);
|
cik_enable_sck_slowdown_on_pd(rdev, true);
|
||||||
if (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_CG) {
|
if (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_PG) {
|
||||||
cik_init_gfx_cgpg(rdev);
|
cik_init_gfx_cgpg(rdev);
|
||||||
cik_enable_cp_pg(rdev, true);
|
cik_enable_cp_pg(rdev, true);
|
||||||
cik_enable_gds_pg(rdev, true);
|
cik_enable_gds_pg(rdev, true);
|
||||||
|
@ -5819,7 +5836,7 @@ static void cik_fini_pg(struct radeon_device *rdev)
|
||||||
{
|
{
|
||||||
if (rdev->pg_flags) {
|
if (rdev->pg_flags) {
|
||||||
cik_update_gfx_pg(rdev, false);
|
cik_update_gfx_pg(rdev, false);
|
||||||
if (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_CG) {
|
if (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_PG) {
|
||||||
cik_enable_cp_pg(rdev, false);
|
cik_enable_cp_pg(rdev, false);
|
||||||
cik_enable_gds_pg(rdev, false);
|
cik_enable_gds_pg(rdev, false);
|
||||||
}
|
}
|
||||||
|
@ -5895,7 +5912,9 @@ static void cik_disable_interrupt_state(struct radeon_device *rdev)
|
||||||
u32 tmp;
|
u32 tmp;
|
||||||
|
|
||||||
/* gfx ring */
|
/* gfx ring */
|
||||||
WREG32(CP_INT_CNTL_RING0, CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE);
|
tmp = RREG32(CP_INT_CNTL_RING0) &
|
||||||
|
(CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE);
|
||||||
|
WREG32(CP_INT_CNTL_RING0, tmp);
|
||||||
/* sdma */
|
/* sdma */
|
||||||
tmp = RREG32(SDMA0_CNTL + SDMA0_REGISTER_OFFSET) & ~TRAP_ENABLE;
|
tmp = RREG32(SDMA0_CNTL + SDMA0_REGISTER_OFFSET) & ~TRAP_ENABLE;
|
||||||
WREG32(SDMA0_CNTL + SDMA0_REGISTER_OFFSET, tmp);
|
WREG32(SDMA0_CNTL + SDMA0_REGISTER_OFFSET, tmp);
|
||||||
|
@ -6036,8 +6055,7 @@ static int cik_irq_init(struct radeon_device *rdev)
|
||||||
*/
|
*/
|
||||||
int cik_irq_set(struct radeon_device *rdev)
|
int cik_irq_set(struct radeon_device *rdev)
|
||||||
{
|
{
|
||||||
u32 cp_int_cntl = CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE |
|
u32 cp_int_cntl;
|
||||||
PRIV_INSTR_INT_ENABLE | PRIV_REG_INT_ENABLE;
|
|
||||||
u32 cp_m1p0, cp_m1p1, cp_m1p2, cp_m1p3;
|
u32 cp_m1p0, cp_m1p1, cp_m1p2, cp_m1p3;
|
||||||
u32 cp_m2p0, cp_m2p1, cp_m2p2, cp_m2p3;
|
u32 cp_m2p0, cp_m2p1, cp_m2p2, cp_m2p3;
|
||||||
u32 crtc1 = 0, crtc2 = 0, crtc3 = 0, crtc4 = 0, crtc5 = 0, crtc6 = 0;
|
u32 crtc1 = 0, crtc2 = 0, crtc3 = 0, crtc4 = 0, crtc5 = 0, crtc6 = 0;
|
||||||
|
@ -6058,6 +6076,10 @@ int cik_irq_set(struct radeon_device *rdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cp_int_cntl = RREG32(CP_INT_CNTL_RING0) &
|
||||||
|
(CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE);
|
||||||
|
cp_int_cntl |= PRIV_INSTR_INT_ENABLE | PRIV_REG_INT_ENABLE;
|
||||||
|
|
||||||
hpd1 = RREG32(DC_HPD1_INT_CONTROL) & ~DC_HPDx_INT_EN;
|
hpd1 = RREG32(DC_HPD1_INT_CONTROL) & ~DC_HPDx_INT_EN;
|
||||||
hpd2 = RREG32(DC_HPD2_INT_CONTROL) & ~DC_HPDx_INT_EN;
|
hpd2 = RREG32(DC_HPD2_INT_CONTROL) & ~DC_HPDx_INT_EN;
|
||||||
hpd3 = RREG32(DC_HPD3_INT_CONTROL) & ~DC_HPDx_INT_EN;
|
hpd3 = RREG32(DC_HPD3_INT_CONTROL) & ~DC_HPDx_INT_EN;
|
||||||
|
|
|
@ -2014,12 +2014,6 @@ int cypress_dpm_set_power_state(struct radeon_device *rdev)
|
||||||
if (eg_pi->pcie_performance_request)
|
if (eg_pi->pcie_performance_request)
|
||||||
cypress_notify_link_speed_change_after_state_change(rdev, new_ps, old_ps);
|
cypress_notify_link_speed_change_after_state_change(rdev, new_ps, old_ps);
|
||||||
|
|
||||||
ret = rv770_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO);
|
|
||||||
if (ret) {
|
|
||||||
DRM_ERROR("rv770_dpm_force_performance_level failed\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,22 +28,30 @@
|
||||||
static u32 dce6_endpoint_rreg(struct radeon_device *rdev,
|
static u32 dce6_endpoint_rreg(struct radeon_device *rdev,
|
||||||
u32 block_offset, u32 reg)
|
u32 block_offset, u32 reg)
|
||||||
{
|
{
|
||||||
|
unsigned long flags;
|
||||||
u32 r;
|
u32 r;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&rdev->end_idx_lock, flags);
|
||||||
WREG32(AZ_F0_CODEC_ENDPOINT_INDEX + block_offset, reg);
|
WREG32(AZ_F0_CODEC_ENDPOINT_INDEX + block_offset, reg);
|
||||||
r = RREG32(AZ_F0_CODEC_ENDPOINT_DATA + block_offset);
|
r = RREG32(AZ_F0_CODEC_ENDPOINT_DATA + block_offset);
|
||||||
|
spin_unlock_irqrestore(&rdev->end_idx_lock, flags);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dce6_endpoint_wreg(struct radeon_device *rdev,
|
static void dce6_endpoint_wreg(struct radeon_device *rdev,
|
||||||
u32 block_offset, u32 reg, u32 v)
|
u32 block_offset, u32 reg, u32 v)
|
||||||
{
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&rdev->end_idx_lock, flags);
|
||||||
if (ASIC_IS_DCE8(rdev))
|
if (ASIC_IS_DCE8(rdev))
|
||||||
WREG32(AZ_F0_CODEC_ENDPOINT_INDEX + block_offset, reg);
|
WREG32(AZ_F0_CODEC_ENDPOINT_INDEX + block_offset, reg);
|
||||||
else
|
else
|
||||||
WREG32(AZ_F0_CODEC_ENDPOINT_INDEX + block_offset,
|
WREG32(AZ_F0_CODEC_ENDPOINT_INDEX + block_offset,
|
||||||
AZ_ENDPOINT_REG_WRITE_EN | AZ_ENDPOINT_REG_INDEX(reg));
|
AZ_ENDPOINT_REG_WRITE_EN | AZ_ENDPOINT_REG_INDEX(reg));
|
||||||
WREG32(AZ_F0_CODEC_ENDPOINT_DATA + block_offset, v);
|
WREG32(AZ_F0_CODEC_ENDPOINT_DATA + block_offset, v);
|
||||||
|
spin_unlock_irqrestore(&rdev->end_idx_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define RREG32_ENDPOINT(block, reg) dce6_endpoint_rreg(rdev, (block), (reg))
|
#define RREG32_ENDPOINT(block, reg) dce6_endpoint_rreg(rdev, (block), (reg))
|
||||||
|
@ -86,12 +94,12 @@ void dce6_afmt_select_pin(struct drm_encoder *encoder)
|
||||||
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
|
struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
|
||||||
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
|
struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
|
||||||
u32 offset = dig->afmt->offset;
|
u32 offset = dig->afmt->offset;
|
||||||
u32 id = dig->afmt->pin->id;
|
|
||||||
|
|
||||||
if (!dig->afmt->pin)
|
if (!dig->afmt->pin)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
WREG32(AFMT_AUDIO_SRC_CONTROL + offset, AFMT_AUDIO_SRC_SELECT(id));
|
WREG32(AFMT_AUDIO_SRC_CONTROL + offset,
|
||||||
|
AFMT_AUDIO_SRC_SELECT(dig->afmt->pin->id));
|
||||||
}
|
}
|
||||||
|
|
||||||
void dce6_afmt_write_speaker_allocation(struct drm_encoder *encoder)
|
void dce6_afmt_write_speaker_allocation(struct drm_encoder *encoder)
|
||||||
|
|
|
@ -40,6 +40,7 @@ static int kv_calculate_dpm_settings(struct radeon_device *rdev);
|
||||||
static void kv_enable_new_levels(struct radeon_device *rdev);
|
static void kv_enable_new_levels(struct radeon_device *rdev);
|
||||||
static void kv_program_nbps_index_settings(struct radeon_device *rdev,
|
static void kv_program_nbps_index_settings(struct radeon_device *rdev,
|
||||||
struct radeon_ps *new_rps);
|
struct radeon_ps *new_rps);
|
||||||
|
static int kv_set_enabled_level(struct radeon_device *rdev, u32 level);
|
||||||
static int kv_set_enabled_levels(struct radeon_device *rdev);
|
static int kv_set_enabled_levels(struct radeon_device *rdev);
|
||||||
static int kv_force_dpm_highest(struct radeon_device *rdev);
|
static int kv_force_dpm_highest(struct radeon_device *rdev);
|
||||||
static int kv_force_dpm_lowest(struct radeon_device *rdev);
|
static int kv_force_dpm_lowest(struct radeon_device *rdev);
|
||||||
|
@ -519,7 +520,7 @@ static int kv_set_dpm_boot_state(struct radeon_device *rdev)
|
||||||
|
|
||||||
static void kv_program_vc(struct radeon_device *rdev)
|
static void kv_program_vc(struct radeon_device *rdev)
|
||||||
{
|
{
|
||||||
WREG32_SMC(CG_FTV_0, 0x3FFFC000);
|
WREG32_SMC(CG_FTV_0, 0x3FFFC100);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void kv_clear_vc(struct radeon_device *rdev)
|
static void kv_clear_vc(struct radeon_device *rdev)
|
||||||
|
@ -638,7 +639,10 @@ static int kv_force_lowest_valid(struct radeon_device *rdev)
|
||||||
|
|
||||||
static int kv_unforce_levels(struct radeon_device *rdev)
|
static int kv_unforce_levels(struct radeon_device *rdev)
|
||||||
{
|
{
|
||||||
return kv_notify_message_to_smu(rdev, PPSMC_MSG_NoForcedLevel);
|
if (rdev->family == CHIP_KABINI)
|
||||||
|
return kv_notify_message_to_smu(rdev, PPSMC_MSG_NoForcedLevel);
|
||||||
|
else
|
||||||
|
return kv_set_enabled_levels(rdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int kv_update_sclk_t(struct radeon_device *rdev)
|
static int kv_update_sclk_t(struct radeon_device *rdev)
|
||||||
|
@ -667,9 +671,8 @@ static int kv_program_bootup_state(struct radeon_device *rdev)
|
||||||
&rdev->pm.dpm.dyn_state.vddc_dependency_on_sclk;
|
&rdev->pm.dpm.dyn_state.vddc_dependency_on_sclk;
|
||||||
|
|
||||||
if (table && table->count) {
|
if (table && table->count) {
|
||||||
for (i = pi->graphics_dpm_level_count - 1; i >= 0; i--) {
|
for (i = pi->graphics_dpm_level_count - 1; i > 0; i--) {
|
||||||
if ((table->entries[i].clk == pi->boot_pl.sclk) ||
|
if (table->entries[i].clk == pi->boot_pl.sclk)
|
||||||
(i == 0))
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -682,9 +685,8 @@ static int kv_program_bootup_state(struct radeon_device *rdev)
|
||||||
if (table->num_max_dpm_entries == 0)
|
if (table->num_max_dpm_entries == 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
for (i = pi->graphics_dpm_level_count - 1; i >= 0; i--) {
|
for (i = pi->graphics_dpm_level_count - 1; i > 0; i--) {
|
||||||
if ((table->entries[i].sclk_frequency == pi->boot_pl.sclk) ||
|
if (table->entries[i].sclk_frequency == pi->boot_pl.sclk)
|
||||||
(i == 0))
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1078,6 +1080,13 @@ static int kv_enable_ulv(struct radeon_device *rdev, bool enable)
|
||||||
PPSMC_MSG_EnableULV : PPSMC_MSG_DisableULV);
|
PPSMC_MSG_EnableULV : PPSMC_MSG_DisableULV);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void kv_reset_acp_boot_level(struct radeon_device *rdev)
|
||||||
|
{
|
||||||
|
struct kv_power_info *pi = kv_get_pi(rdev);
|
||||||
|
|
||||||
|
pi->acp_boot_level = 0xff;
|
||||||
|
}
|
||||||
|
|
||||||
static void kv_update_current_ps(struct radeon_device *rdev,
|
static void kv_update_current_ps(struct radeon_device *rdev,
|
||||||
struct radeon_ps *rps)
|
struct radeon_ps *rps)
|
||||||
{
|
{
|
||||||
|
@ -1100,6 +1109,18 @@ static void kv_update_requested_ps(struct radeon_device *rdev,
|
||||||
pi->requested_rps.ps_priv = &pi->requested_ps;
|
pi->requested_rps.ps_priv = &pi->requested_ps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void kv_dpm_enable_bapm(struct radeon_device *rdev, bool enable)
|
||||||
|
{
|
||||||
|
struct kv_power_info *pi = kv_get_pi(rdev);
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (pi->bapm_enable) {
|
||||||
|
ret = kv_smc_bapm_enable(rdev, enable);
|
||||||
|
if (ret)
|
||||||
|
DRM_ERROR("kv_smc_bapm_enable failed\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int kv_dpm_enable(struct radeon_device *rdev)
|
int kv_dpm_enable(struct radeon_device *rdev)
|
||||||
{
|
{
|
||||||
struct kv_power_info *pi = kv_get_pi(rdev);
|
struct kv_power_info *pi = kv_get_pi(rdev);
|
||||||
|
@ -1192,6 +1213,8 @@ int kv_dpm_enable(struct radeon_device *rdev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
kv_reset_acp_boot_level(rdev);
|
||||||
|
|
||||||
if (rdev->irq.installed &&
|
if (rdev->irq.installed &&
|
||||||
r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
|
r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
|
||||||
ret = kv_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
|
ret = kv_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
|
||||||
|
@ -1203,6 +1226,12 @@ int kv_dpm_enable(struct radeon_device *rdev)
|
||||||
radeon_irq_set(rdev);
|
radeon_irq_set(rdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = kv_smc_bapm_enable(rdev, false);
|
||||||
|
if (ret) {
|
||||||
|
DRM_ERROR("kv_smc_bapm_enable failed\n");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* powerdown unused blocks for now */
|
/* powerdown unused blocks for now */
|
||||||
kv_dpm_powergate_acp(rdev, true);
|
kv_dpm_powergate_acp(rdev, true);
|
||||||
kv_dpm_powergate_samu(rdev, true);
|
kv_dpm_powergate_samu(rdev, true);
|
||||||
|
@ -1226,6 +1255,8 @@ void kv_dpm_disable(struct radeon_device *rdev)
|
||||||
RADEON_CG_BLOCK_BIF |
|
RADEON_CG_BLOCK_BIF |
|
||||||
RADEON_CG_BLOCK_HDP), false);
|
RADEON_CG_BLOCK_HDP), false);
|
||||||
|
|
||||||
|
kv_smc_bapm_enable(rdev, false);
|
||||||
|
|
||||||
/* powerup blocks */
|
/* powerup blocks */
|
||||||
kv_dpm_powergate_acp(rdev, false);
|
kv_dpm_powergate_acp(rdev, false);
|
||||||
kv_dpm_powergate_samu(rdev, false);
|
kv_dpm_powergate_samu(rdev, false);
|
||||||
|
@ -1450,6 +1481,39 @@ static int kv_update_samu_dpm(struct radeon_device *rdev, bool gate)
|
||||||
return kv_enable_samu_dpm(rdev, !gate);
|
return kv_enable_samu_dpm(rdev, !gate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static u8 kv_get_acp_boot_level(struct radeon_device *rdev)
|
||||||
|
{
|
||||||
|
u8 i;
|
||||||
|
struct radeon_clock_voltage_dependency_table *table =
|
||||||
|
&rdev->pm.dpm.dyn_state.acp_clock_voltage_dependency_table;
|
||||||
|
|
||||||
|
for (i = 0; i < table->count; i++) {
|
||||||
|
if (table->entries[i].clk >= 0) /* XXX */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i >= table->count)
|
||||||
|
i = table->count - 1;
|
||||||
|
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void kv_update_acp_boot_level(struct radeon_device *rdev)
|
||||||
|
{
|
||||||
|
struct kv_power_info *pi = kv_get_pi(rdev);
|
||||||
|
u8 acp_boot_level;
|
||||||
|
|
||||||
|
if (!pi->caps_stable_p_state) {
|
||||||
|
acp_boot_level = kv_get_acp_boot_level(rdev);
|
||||||
|
if (acp_boot_level != pi->acp_boot_level) {
|
||||||
|
pi->acp_boot_level = acp_boot_level;
|
||||||
|
kv_send_msg_to_smc_with_parameter(rdev,
|
||||||
|
PPSMC_MSG_ACPDPM_SetEnabledMask,
|
||||||
|
(1 << pi->acp_boot_level));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int kv_update_acp_dpm(struct radeon_device *rdev, bool gate)
|
static int kv_update_acp_dpm(struct radeon_device *rdev, bool gate)
|
||||||
{
|
{
|
||||||
struct kv_power_info *pi = kv_get_pi(rdev);
|
struct kv_power_info *pi = kv_get_pi(rdev);
|
||||||
|
@ -1461,7 +1525,7 @@ static int kv_update_acp_dpm(struct radeon_device *rdev, bool gate)
|
||||||
if (pi->caps_stable_p_state)
|
if (pi->caps_stable_p_state)
|
||||||
pi->acp_boot_level = table->count - 1;
|
pi->acp_boot_level = table->count - 1;
|
||||||
else
|
else
|
||||||
pi->acp_boot_level = 0;
|
pi->acp_boot_level = kv_get_acp_boot_level(rdev);
|
||||||
|
|
||||||
ret = kv_copy_bytes_to_smc(rdev,
|
ret = kv_copy_bytes_to_smc(rdev,
|
||||||
pi->dpm_table_start +
|
pi->dpm_table_start +
|
||||||
|
@ -1588,13 +1652,11 @@ static void kv_set_valid_clock_range(struct radeon_device *rdev,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = pi->graphics_dpm_level_count - 1; i >= 0; i--) {
|
for (i = pi->graphics_dpm_level_count - 1; i > 0; i--) {
|
||||||
if ((table->entries[i].clk <= new_ps->levels[new_ps->num_levels -1].sclk) ||
|
if (table->entries[i].clk <= new_ps->levels[new_ps->num_levels - 1].sclk)
|
||||||
(i == 0)) {
|
|
||||||
pi->highest_valid = i;
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
pi->highest_valid = i;
|
||||||
|
|
||||||
if (pi->lowest_valid > pi->highest_valid) {
|
if (pi->lowest_valid > pi->highest_valid) {
|
||||||
if ((new_ps->levels[0].sclk - table->entries[pi->highest_valid].clk) >
|
if ((new_ps->levels[0].sclk - table->entries[pi->highest_valid].clk) >
|
||||||
|
@ -1615,14 +1677,12 @@ static void kv_set_valid_clock_range(struct radeon_device *rdev,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = pi->graphics_dpm_level_count - 1; i >= 0; i--) {
|
for (i = pi->graphics_dpm_level_count - 1; i > 0; i--) {
|
||||||
if (table->entries[i].sclk_frequency <=
|
if (table->entries[i].sclk_frequency <=
|
||||||
new_ps->levels[new_ps->num_levels - 1].sclk ||
|
new_ps->levels[new_ps->num_levels - 1].sclk)
|
||||||
i == 0) {
|
|
||||||
pi->highest_valid = i;
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
pi->highest_valid = i;
|
||||||
|
|
||||||
if (pi->lowest_valid > pi->highest_valid) {
|
if (pi->lowest_valid > pi->highest_valid) {
|
||||||
if ((new_ps->levels[0].sclk -
|
if ((new_ps->levels[0].sclk -
|
||||||
|
@ -1724,6 +1784,14 @@ int kv_dpm_set_power_state(struct radeon_device *rdev)
|
||||||
RADEON_CG_BLOCK_BIF |
|
RADEON_CG_BLOCK_BIF |
|
||||||
RADEON_CG_BLOCK_HDP), false);
|
RADEON_CG_BLOCK_HDP), false);
|
||||||
|
|
||||||
|
if (pi->bapm_enable) {
|
||||||
|
ret = kv_smc_bapm_enable(rdev, rdev->pm.dpm.ac_power);
|
||||||
|
if (ret) {
|
||||||
|
DRM_ERROR("kv_smc_bapm_enable failed\n");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (rdev->family == CHIP_KABINI) {
|
if (rdev->family == CHIP_KABINI) {
|
||||||
if (pi->enable_dpm) {
|
if (pi->enable_dpm) {
|
||||||
kv_set_valid_clock_range(rdev, new_ps);
|
kv_set_valid_clock_range(rdev, new_ps);
|
||||||
|
@ -1775,6 +1843,7 @@ int kv_dpm_set_power_state(struct radeon_device *rdev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
kv_update_acp_boot_level(rdev);
|
||||||
kv_update_sclk_t(rdev);
|
kv_update_sclk_t(rdev);
|
||||||
kv_enable_nb_dpm(rdev);
|
kv_enable_nb_dpm(rdev);
|
||||||
}
|
}
|
||||||
|
@ -1785,7 +1854,6 @@ int kv_dpm_set_power_state(struct radeon_device *rdev)
|
||||||
RADEON_CG_BLOCK_BIF |
|
RADEON_CG_BLOCK_BIF |
|
||||||
RADEON_CG_BLOCK_HDP), true);
|
RADEON_CG_BLOCK_HDP), true);
|
||||||
|
|
||||||
rdev->pm.dpm.forced_level = RADEON_DPM_FORCED_LEVEL_AUTO;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1806,12 +1874,23 @@ void kv_dpm_setup_asic(struct radeon_device *rdev)
|
||||||
|
|
||||||
void kv_dpm_reset_asic(struct radeon_device *rdev)
|
void kv_dpm_reset_asic(struct radeon_device *rdev)
|
||||||
{
|
{
|
||||||
kv_force_lowest_valid(rdev);
|
struct kv_power_info *pi = kv_get_pi(rdev);
|
||||||
kv_init_graphics_levels(rdev);
|
|
||||||
kv_program_bootup_state(rdev);
|
if (rdev->family == CHIP_KABINI) {
|
||||||
kv_upload_dpm_settings(rdev);
|
kv_force_lowest_valid(rdev);
|
||||||
kv_force_lowest_valid(rdev);
|
kv_init_graphics_levels(rdev);
|
||||||
kv_unforce_levels(rdev);
|
kv_program_bootup_state(rdev);
|
||||||
|
kv_upload_dpm_settings(rdev);
|
||||||
|
kv_force_lowest_valid(rdev);
|
||||||
|
kv_unforce_levels(rdev);
|
||||||
|
} else {
|
||||||
|
kv_init_graphics_levels(rdev);
|
||||||
|
kv_program_bootup_state(rdev);
|
||||||
|
kv_freeze_sclk_dpm(rdev, true);
|
||||||
|
kv_upload_dpm_settings(rdev);
|
||||||
|
kv_freeze_sclk_dpm(rdev, false);
|
||||||
|
kv_set_enabled_level(rdev, pi->graphics_boot_level);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//XXX use sumo_dpm_display_configuration_changed
|
//XXX use sumo_dpm_display_configuration_changed
|
||||||
|
@ -1871,12 +1950,15 @@ static int kv_force_dpm_highest(struct radeon_device *rdev)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
for (i = SMU7_MAX_LEVELS_GRAPHICS - 1; i >= 0; i--) {
|
for (i = SMU7_MAX_LEVELS_GRAPHICS - 1; i > 0; i--) {
|
||||||
if (enable_mask & (1 << i))
|
if (enable_mask & (1 << i))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return kv_send_msg_to_smc_with_parameter(rdev, PPSMC_MSG_DPM_ForceState, i);
|
if (rdev->family == CHIP_KABINI)
|
||||||
|
return kv_send_msg_to_smc_with_parameter(rdev, PPSMC_MSG_DPM_ForceState, i);
|
||||||
|
else
|
||||||
|
return kv_set_enabled_level(rdev, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int kv_force_dpm_lowest(struct radeon_device *rdev)
|
static int kv_force_dpm_lowest(struct radeon_device *rdev)
|
||||||
|
@ -1893,7 +1975,10 @@ static int kv_force_dpm_lowest(struct radeon_device *rdev)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return kv_send_msg_to_smc_with_parameter(rdev, PPSMC_MSG_DPM_ForceState, i);
|
if (rdev->family == CHIP_KABINI)
|
||||||
|
return kv_send_msg_to_smc_with_parameter(rdev, PPSMC_MSG_DPM_ForceState, i);
|
||||||
|
else
|
||||||
|
return kv_set_enabled_level(rdev, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
static u8 kv_get_sleep_divider_id_from_clock(struct radeon_device *rdev,
|
static u8 kv_get_sleep_divider_id_from_clock(struct radeon_device *rdev,
|
||||||
|
@ -1911,9 +1996,9 @@ static u8 kv_get_sleep_divider_id_from_clock(struct radeon_device *rdev,
|
||||||
if (!pi->caps_sclk_ds)
|
if (!pi->caps_sclk_ds)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (i = KV_MAX_DEEPSLEEP_DIVIDER_ID; i <= 0; i--) {
|
for (i = KV_MAX_DEEPSLEEP_DIVIDER_ID; i > 0; i--) {
|
||||||
temp = sclk / sumo_get_sleep_divider_from_id(i);
|
temp = sclk / sumo_get_sleep_divider_from_id(i);
|
||||||
if ((temp >= min) || (i == 0))
|
if (temp >= min)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2039,12 +2124,12 @@ static void kv_apply_state_adjust_rules(struct radeon_device *rdev,
|
||||||
ps->dpmx_nb_ps_lo = 0x1;
|
ps->dpmx_nb_ps_lo = 0x1;
|
||||||
ps->dpmx_nb_ps_hi = 0x0;
|
ps->dpmx_nb_ps_hi = 0x0;
|
||||||
} else {
|
} else {
|
||||||
ps->dpm0_pg_nb_ps_lo = 0x1;
|
ps->dpm0_pg_nb_ps_lo = 0x3;
|
||||||
ps->dpm0_pg_nb_ps_hi = 0x0;
|
ps->dpm0_pg_nb_ps_hi = 0x0;
|
||||||
ps->dpmx_nb_ps_lo = 0x2;
|
ps->dpmx_nb_ps_lo = 0x3;
|
||||||
ps->dpmx_nb_ps_hi = 0x1;
|
ps->dpmx_nb_ps_hi = 0x0;
|
||||||
|
|
||||||
if (pi->sys_info.nb_dpm_enable && pi->battery_state) {
|
if (pi->sys_info.nb_dpm_enable) {
|
||||||
force_high = (mclk >= pi->sys_info.nbp_memory_clock[3]) ||
|
force_high = (mclk >= pi->sys_info.nbp_memory_clock[3]) ||
|
||||||
pi->video_start || (rdev->pm.dpm.new_active_crtc_count >= 3) ||
|
pi->video_start || (rdev->pm.dpm.new_active_crtc_count >= 3) ||
|
||||||
pi->disable_nb_ps3_in_battery;
|
pi->disable_nb_ps3_in_battery;
|
||||||
|
@ -2210,6 +2295,15 @@ static void kv_enable_new_levels(struct radeon_device *rdev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int kv_set_enabled_level(struct radeon_device *rdev, u32 level)
|
||||||
|
{
|
||||||
|
u32 new_mask = (1 << level);
|
||||||
|
|
||||||
|
return kv_send_msg_to_smc_with_parameter(rdev,
|
||||||
|
PPSMC_MSG_SCLKDPM_SetEnabledMask,
|
||||||
|
new_mask);
|
||||||
|
}
|
||||||
|
|
||||||
static int kv_set_enabled_levels(struct radeon_device *rdev)
|
static int kv_set_enabled_levels(struct radeon_device *rdev)
|
||||||
{
|
{
|
||||||
struct kv_power_info *pi = kv_get_pi(rdev);
|
struct kv_power_info *pi = kv_get_pi(rdev);
|
||||||
|
|
|
@ -192,6 +192,7 @@ int kv_send_msg_to_smc_with_parameter(struct radeon_device *rdev,
|
||||||
int kv_read_smc_sram_dword(struct radeon_device *rdev, u32 smc_address,
|
int kv_read_smc_sram_dword(struct radeon_device *rdev, u32 smc_address,
|
||||||
u32 *value, u32 limit);
|
u32 *value, u32 limit);
|
||||||
int kv_smc_dpm_enable(struct radeon_device *rdev, bool enable);
|
int kv_smc_dpm_enable(struct radeon_device *rdev, bool enable);
|
||||||
|
int kv_smc_bapm_enable(struct radeon_device *rdev, bool enable);
|
||||||
int kv_copy_bytes_to_smc(struct radeon_device *rdev,
|
int kv_copy_bytes_to_smc(struct radeon_device *rdev,
|
||||||
u32 smc_start_address,
|
u32 smc_start_address,
|
||||||
const u8 *src, u32 byte_count, u32 limit);
|
const u8 *src, u32 byte_count, u32 limit);
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue