Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (72 commits) powerpc/pseries: Fix build of topology stuff without CONFIG_NUMA powerpc/pseries: Fix VPHN build errors on non-SMP systems powerpc/83xx: add mpc8308_p1m DMA controller device-tree node powerpc/83xx: add DMA controller to mpc8308 device-tree node powerpc/512x: try to free dma descriptors in case of allocation failure powerpc/512x: add MPC8308 dma support powerpc/512x: fix the hanged dma transfer issue powerpc/512x: scatter/gather dma fix powerpc/powermac: Make auto-loading of therm_pm72 possible of/address: Use propper endianess in get_flags powerpc/pci: Use printf extension %pR for struct resource powerpc: Remove unnecessary casts of void ptr powerpc: Disable VPHN polling during a suspend operation powerpc/pseries: Poll VPA for topology changes and update NUMA maps powerpc: iommu: Add device name to iommu error printks powerpc: Record vma->phys_addr in ioremap() powerpc: Update compat_arch_ptrace powerpc: Fix PPC_PTRACE_SETHWDEBUG on PPC_BOOK3S powerpc/time: printk time stamp init not correct powerpc: Minor cleanups for machdep.h ...
This commit is contained in:
@@ -267,7 +267,16 @@ static __inline__ int fls64(__u64 x)
|
||||
#include <asm-generic/bitops/fls64.h>
|
||||
#endif /* __powerpc64__ */
|
||||
|
||||
#ifdef CONFIG_PPC64
|
||||
unsigned int __arch_hweight8(unsigned int w);
|
||||
unsigned int __arch_hweight16(unsigned int w);
|
||||
unsigned int __arch_hweight32(unsigned int w);
|
||||
unsigned long __arch_hweight64(__u64 w);
|
||||
#include <asm-generic/bitops/const_hweight.h>
|
||||
#else
|
||||
#include <asm-generic/bitops/hweight.h>
|
||||
#endif
|
||||
|
||||
#include <asm-generic/bitops/find.h>
|
||||
|
||||
/* Little-endian versions */
|
||||
|
||||
@@ -199,6 +199,8 @@ extern const char *powerpc_base_platform;
|
||||
#define CPU_FTR_UNALIGNED_LD_STD LONG_ASM_CONST(0x0080000000000000)
|
||||
#define CPU_FTR_ASYM_SMT LONG_ASM_CONST(0x0100000000000000)
|
||||
#define CPU_FTR_STCX_CHECKS_ADDRESS LONG_ASM_CONST(0x0200000000000000)
|
||||
#define CPU_FTR_POPCNTB LONG_ASM_CONST(0x0400000000000000)
|
||||
#define CPU_FTR_POPCNTD LONG_ASM_CONST(0x0800000000000000)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
@@ -403,21 +405,22 @@ extern const char *powerpc_base_platform;
|
||||
CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
|
||||
CPU_FTR_MMCRA | CPU_FTR_SMT | \
|
||||
CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
|
||||
CPU_FTR_PURR | CPU_FTR_STCX_CHECKS_ADDRESS)
|
||||
CPU_FTR_PURR | CPU_FTR_STCX_CHECKS_ADDRESS | \
|
||||
CPU_FTR_POPCNTB)
|
||||
#define CPU_FTRS_POWER6 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
|
||||
CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
|
||||
CPU_FTR_MMCRA | CPU_FTR_SMT | \
|
||||
CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
|
||||
CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
|
||||
CPU_FTR_DSCR | CPU_FTR_UNALIGNED_LD_STD | \
|
||||
CPU_FTR_STCX_CHECKS_ADDRESS)
|
||||
CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB)
|
||||
#define CPU_FTRS_POWER7 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
|
||||
CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
|
||||
CPU_FTR_MMCRA | CPU_FTR_SMT | \
|
||||
CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
|
||||
CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
|
||||
CPU_FTR_DSCR | CPU_FTR_SAO | CPU_FTR_ASYM_SMT | \
|
||||
CPU_FTR_STCX_CHECKS_ADDRESS)
|
||||
CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD)
|
||||
#define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
|
||||
CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
|
||||
CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
|
||||
|
||||
@@ -61,22 +61,25 @@ static inline cpumask_t cpu_online_cores_map(void)
|
||||
return cpu_thread_mask_to_cores(cpu_online_map);
|
||||
}
|
||||
|
||||
static inline int cpu_thread_to_core(int cpu)
|
||||
{
|
||||
return cpu >> threads_shift;
|
||||
}
|
||||
#ifdef CONFIG_SMP
|
||||
int cpu_core_index_of_thread(int cpu);
|
||||
int cpu_first_thread_of_core(int core);
|
||||
#else
|
||||
static inline int cpu_core_index_of_thread(int cpu) { return cpu; }
|
||||
static inline int cpu_first_thread_of_core(int core) { return core; }
|
||||
#endif
|
||||
|
||||
static inline int cpu_thread_in_core(int cpu)
|
||||
{
|
||||
return cpu & (threads_per_core - 1);
|
||||
}
|
||||
|
||||
static inline int cpu_first_thread_in_core(int cpu)
|
||||
static inline int cpu_first_thread_sibling(int cpu)
|
||||
{
|
||||
return cpu & ~(threads_per_core - 1);
|
||||
}
|
||||
|
||||
static inline int cpu_last_thread_in_core(int cpu)
|
||||
static inline int cpu_last_thread_sibling(int cpu)
|
||||
{
|
||||
return cpu | (threads_per_core - 1);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,12 @@
|
||||
struct dma_map_ops;
|
||||
struct device_node;
|
||||
|
||||
/*
|
||||
* Arch extensions to struct device.
|
||||
*
|
||||
* When adding fields, consider macio_add_one_device in
|
||||
* drivers/macintosh/macio_asic.c
|
||||
*/
|
||||
struct dev_archdata {
|
||||
/* DMA operations on that device */
|
||||
struct dma_map_ops *dma_ops;
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#define FW_FEATURE_PS3_LV1 ASM_CONST(0x0000000000800000)
|
||||
#define FW_FEATURE_BEAT ASM_CONST(0x0000000001000000)
|
||||
#define FW_FEATURE_CMO ASM_CONST(0x0000000002000000)
|
||||
#define FW_FEATURE_VPHN ASM_CONST(0x0000000004000000)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
@@ -59,7 +60,7 @@ enum {
|
||||
FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN |
|
||||
FW_FEATURE_BULK_REMOVE | FW_FEATURE_XDABR |
|
||||
FW_FEATURE_MULTITCE | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR |
|
||||
FW_FEATURE_CMO,
|
||||
FW_FEATURE_CMO | FW_FEATURE_VPHN,
|
||||
FW_FEATURE_PSERIES_ALWAYS = 0,
|
||||
FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES | FW_FEATURE_LPAR,
|
||||
FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES | FW_FEATURE_LPAR,
|
||||
|
||||
@@ -232,7 +232,9 @@
|
||||
#define H_GET_EM_PARMS 0x2B8
|
||||
#define H_SET_MPP 0x2D0
|
||||
#define H_GET_MPP 0x2D4
|
||||
#define MAX_HCALL_OPCODE H_GET_MPP
|
||||
#define H_HOME_NODE_ASSOCIATIVITY 0x2EC
|
||||
#define H_BEST_ENERGY 0x2F4
|
||||
#define MAX_HCALL_OPCODE H_BEST_ENERGY
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
|
||||
@@ -62,7 +62,10 @@ struct lppaca {
|
||||
volatile u32 dyn_pir; // Dynamic ProcIdReg value x20-x23
|
||||
u32 dsei_data; // DSEI data x24-x27
|
||||
u64 sprg3; // SPRG3 value x28-x2F
|
||||
u8 reserved3[80]; // Reserved x30-x7F
|
||||
u8 reserved3[40]; // Reserved x30-x57
|
||||
volatile u8 vphn_assoc_counts[8]; // Virtual processor home node
|
||||
// associativity change counters x58-x5F
|
||||
u8 reserved4[32]; // Reserved x60-x7F
|
||||
|
||||
//=============================================================================
|
||||
// CACHE_LINE_2 0x0080 - 0x00FF Contains local read-write data
|
||||
|
||||
@@ -27,9 +27,7 @@ struct iommu_table;
|
||||
struct rtc_time;
|
||||
struct file;
|
||||
struct pci_controller;
|
||||
#ifdef CONFIG_KEXEC
|
||||
struct kimage;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
struct smp_ops_t {
|
||||
@@ -72,7 +70,7 @@ struct machdep_calls {
|
||||
int psize, int ssize);
|
||||
void (*flush_hash_range)(unsigned long number, int local);
|
||||
|
||||
/* special for kexec, to be called in real mode, linar mapping is
|
||||
/* special for kexec, to be called in real mode, linear mapping is
|
||||
* destroyed as well */
|
||||
void (*hpte_clear_all)(void);
|
||||
|
||||
@@ -324,8 +322,6 @@ extern sys_ctrler_t sys_ctrler;
|
||||
|
||||
#endif /* CONFIG_PPC_PMAC */
|
||||
|
||||
extern void setup_pci_ptrs(void);
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
/* Poor default implementations */
|
||||
extern void __devinit smp_generic_give_timebase(void);
|
||||
|
||||
@@ -33,6 +33,9 @@ extern int numa_cpu_lookup_table[];
|
||||
extern cpumask_var_t node_to_cpumask_map[];
|
||||
#ifdef CONFIG_MEMORY_HOTPLUG
|
||||
extern unsigned long max_pfn;
|
||||
u64 memory_hotplug_max(void);
|
||||
#else
|
||||
#define memory_hotplug_max() memblock_end_of_DRAM()
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -42,6 +45,8 @@ extern unsigned long max_pfn;
|
||||
#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
|
||||
#define node_end_pfn(nid) (NODE_DATA(nid)->node_end_pfn)
|
||||
|
||||
#else
|
||||
#define memory_hotplug_max() memblock_end_of_DRAM()
|
||||
#endif /* CONFIG_NEED_MULTIPLE_NODES */
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
@@ -10,31 +10,7 @@
|
||||
#ifndef _ASM_POWERPC_NVRAM_H
|
||||
#define _ASM_POWERPC_NVRAM_H
|
||||
|
||||
#include <linux/errno.h>
|
||||
|
||||
#define NVRW_CNT 0x20
|
||||
#define NVRAM_HEADER_LEN 16 /* sizeof(struct nvram_header) */
|
||||
#define NVRAM_BLOCK_LEN 16
|
||||
#define NVRAM_MAX_REQ (2080/NVRAM_BLOCK_LEN)
|
||||
#define NVRAM_MIN_REQ (1056/NVRAM_BLOCK_LEN)
|
||||
|
||||
#define NVRAM_AS0 0x74
|
||||
#define NVRAM_AS1 0x75
|
||||
#define NVRAM_DATA 0x77
|
||||
|
||||
|
||||
/* RTC Offsets */
|
||||
|
||||
#define MOTO_RTC_SECONDS 0x1FF9
|
||||
#define MOTO_RTC_MINUTES 0x1FFA
|
||||
#define MOTO_RTC_HOURS 0x1FFB
|
||||
#define MOTO_RTC_DAY_OF_WEEK 0x1FFC
|
||||
#define MOTO_RTC_DAY_OF_MONTH 0x1FFD
|
||||
#define MOTO_RTC_MONTH 0x1FFE
|
||||
#define MOTO_RTC_YEAR 0x1FFF
|
||||
#define MOTO_RTC_CONTROLA 0x1FF8
|
||||
#define MOTO_RTC_CONTROLB 0x1FF9
|
||||
|
||||
/* Signatures for nvram partitions */
|
||||
#define NVRAM_SIG_SP 0x02 /* support processor */
|
||||
#define NVRAM_SIG_OF 0x50 /* open firmware config */
|
||||
#define NVRAM_SIG_FW 0x51 /* general firmware */
|
||||
@@ -49,32 +25,19 @@
|
||||
#define NVRAM_SIG_OS 0xa0 /* OS defined */
|
||||
#define NVRAM_SIG_PANIC 0xa1 /* Apple OSX "panic" */
|
||||
|
||||
/* If change this size, then change the size of NVNAME_LEN */
|
||||
struct nvram_header {
|
||||
unsigned char signature;
|
||||
unsigned char checksum;
|
||||
unsigned short length;
|
||||
char name[12];
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/errno.h>
|
||||
#include <linux/list.h>
|
||||
|
||||
struct nvram_partition {
|
||||
struct list_head partition;
|
||||
struct nvram_header header;
|
||||
unsigned int index;
|
||||
};
|
||||
|
||||
|
||||
#ifdef CONFIG_PPC_PSERIES
|
||||
extern int nvram_write_error_log(char * buff, int length,
|
||||
unsigned int err_type, unsigned int err_seq);
|
||||
extern int nvram_read_error_log(char * buff, int length,
|
||||
unsigned int * err_type, unsigned int *err_seq);
|
||||
extern int nvram_clear_error_log(void);
|
||||
|
||||
extern int pSeries_nvram_init(void);
|
||||
#endif /* CONFIG_PPC_PSERIES */
|
||||
|
||||
#ifdef CONFIG_MMIO_NVRAM
|
||||
extern int mmio_nvram_init(void);
|
||||
@@ -85,6 +48,13 @@ static inline int mmio_nvram_init(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
extern int __init nvram_scan_partitions(void);
|
||||
extern loff_t nvram_create_partition(const char *name, int sig,
|
||||
int req_size, int min_size);
|
||||
extern int nvram_remove_partition(const char *name, int sig);
|
||||
extern int nvram_get_partition_size(loff_t data_index);
|
||||
extern loff_t nvram_find_partition(const char *name, int sig, int *out_size);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
/* PowerMac specific nvram stuffs */
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
#define PPC_INST_NOP 0x60000000
|
||||
#define PPC_INST_POPCNTB 0x7c0000f4
|
||||
#define PPC_INST_POPCNTB_MASK 0xfc0007fe
|
||||
#define PPC_INST_POPCNTD 0x7c0003f4
|
||||
#define PPC_INST_POPCNTW 0x7c0002f4
|
||||
#define PPC_INST_RFCI 0x4c000066
|
||||
#define PPC_INST_RFDI 0x4c00004e
|
||||
#define PPC_INST_RFMCI 0x4c00004c
|
||||
@@ -88,6 +90,12 @@
|
||||
__PPC_RB(b) | __PPC_EH(eh))
|
||||
#define PPC_MSGSND(b) stringify_in_c(.long PPC_INST_MSGSND | \
|
||||
__PPC_RB(b))
|
||||
#define PPC_POPCNTB(a, s) stringify_in_c(.long PPC_INST_POPCNTB | \
|
||||
__PPC_RA(a) | __PPC_RS(s))
|
||||
#define PPC_POPCNTD(a, s) stringify_in_c(.long PPC_INST_POPCNTD | \
|
||||
__PPC_RA(a) | __PPC_RS(s))
|
||||
#define PPC_POPCNTW(a, s) stringify_in_c(.long PPC_INST_POPCNTW | \
|
||||
__PPC_RA(a) | __PPC_RS(s))
|
||||
#define PPC_RFCI stringify_in_c(.long PPC_INST_RFCI)
|
||||
#define PPC_RFDI stringify_in_c(.long PPC_INST_RFDI)
|
||||
#define PPC_RFMCI stringify_in_c(.long PPC_INST_RFMCI)
|
||||
|
||||
@@ -122,7 +122,6 @@ extern struct task_struct *last_task_used_spe;
|
||||
TASK_UNMAPPED_BASE_USER32 : TASK_UNMAPPED_BASE_USER64 )
|
||||
#endif
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#ifdef __powerpc64__
|
||||
|
||||
#define STACK_TOP_USER64 TASK_SIZE_USER64
|
||||
@@ -139,7 +138,6 @@ extern struct task_struct *last_task_used_spe;
|
||||
#define STACK_TOP_MAX STACK_TOP
|
||||
|
||||
#endif /* __powerpc64__ */
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
typedef struct {
|
||||
unsigned long seg;
|
||||
|
||||
@@ -106,9 +106,22 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev,
|
||||
int nid)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* CONFIG_NUMA */
|
||||
|
||||
#if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR)
|
||||
extern int start_topology_update(void);
|
||||
extern int stop_topology_update(void);
|
||||
#else
|
||||
static inline int start_topology_update(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int stop_topology_update(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */
|
||||
|
||||
#include <asm-generic/topology.h>
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
|
||||
@@ -116,9 +116,7 @@ struct vdso_data {
|
||||
|
||||
#endif /* CONFIG_PPC64 */
|
||||
|
||||
#ifdef __KERNEL__
|
||||
extern struct vdso_data *vdso_data;
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user