diff options
author | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-02-10 13:45:43 -0600 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-02-10 13:45:43 -0600 |
commit | 81b7bbd1932a04869d4c8635a75222dfc6089f96 (patch) | |
tree | 285ae868a1e3a41fb0dbfe346c28e380949bcb55 /include/asm-powerpc | |
parent | 98051995ab44b993f992946055edc6115351f725 (diff) | |
parent | 66efc5a7e3061c3597ac43a8bb1026488d57e66b (diff) |
Merge branch 'linus'
Conflicts:
drivers/scsi/ipr.c
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'include/asm-powerpc')
26 files changed, 257 insertions, 268 deletions
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h index 7384b8086b75..e870b5393175 100644 --- a/include/asm-powerpc/cputable.h +++ b/include/asm-powerpc/cputable.h @@ -50,6 +50,12 @@ enum powerpc_oprofile_type { PPC_OPROFILE_CELL = 5, }; +enum powerpc_pmc_type { + PPC_PMC_DEFAULT = 0, + PPC_PMC_IBM = 1, + PPC_PMC_PA6T = 2, +}; + struct cpu_spec { /* CPU is matched via (PVR & pvr_mask) == pvr_value */ unsigned int pvr_mask; @@ -65,6 +71,7 @@ struct cpu_spec { /* number of performance monitor counters */ unsigned int num_pmcs; + enum powerpc_pmc_type pmc_type; /* this is called to initialize various CPU bits like L1 cache, * BHT, SPD, etc... from head.S before branching to identify_machine @@ -337,12 +344,6 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start, CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ CPU_FTR_DSCR) -#define CPU_FTRS_POWER6X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ - CPU_FTR_HPTE_TABLE | 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_CI_LARGE_PAGE | \ - CPU_FTR_SPURR | CPU_FTR_REAL_LE | CPU_FTR_DSCR) #define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ diff --git a/include/asm-powerpc/dcr.h b/include/asm-powerpc/dcr.h index b66c5e6941f0..9338d50538f1 100644 --- a/include/asm-powerpc/dcr.h +++ b/include/asm-powerpc/dcr.h @@ -33,6 +33,7 @@ * base from the device-tree */ #ifdef CONFIG_PPC_MERGE +struct device_node; extern unsigned int dcr_resource_start(struct device_node *np, unsigned int index); extern unsigned int dcr_resource_len(struct device_node *np, diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h index d36426c01b6b..de507995c7b1 100644 --- a/include/asm-powerpc/elf.h +++ b/include/asm-powerpc/elf.h @@ -173,7 +173,7 @@ typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32]; the loader. We need to make sure that it is out of the way of the program that it will "exec", and that there is sufficient room for the brk. */ -#define ELF_ET_DYN_BASE (0x08000000) +#define ELF_ET_DYN_BASE (0x20000000) /* Common routine for both 32-bit and 64-bit processes */ static inline void ppc_elf_core_copy_regs(elf_gregset_t elf_regs, diff --git a/include/asm-powerpc/firmware.h b/include/asm-powerpc/firmware.h index 98f7b62422c9..3671c128f271 100644 --- a/include/asm-powerpc/firmware.h +++ b/include/asm-powerpc/firmware.h @@ -43,6 +43,8 @@ #define FW_FEATURE_ISERIES ASM_CONST(0x0000000000200000) #define FW_FEATURE_LPAR ASM_CONST(0x0000000000400000) #define FW_FEATURE_PS3_LV1 ASM_CONST(0x0000000000800000) +#define FW_FEATURE_BEAT ASM_CONST(0x0000000001000000) +#define FW_FEATURE_BULK_REMOVE ASM_CONST(0x0000000002000000) #ifndef __ASSEMBLY__ @@ -61,6 +63,8 @@ enum { FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES | FW_FEATURE_LPAR, FW_FEATURE_PS3_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1, FW_FEATURE_PS3_ALWAYS = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1, + FW_FEATURE_CELLEB_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_BEAT, + FW_FEATURE_CELLEB_ALWAYS = FW_FEATURE_LPAR | FW_FEATURE_BEAT, FW_FEATURE_NATIVE_POSSIBLE = 0, FW_FEATURE_NATIVE_ALWAYS = 0, FW_FEATURE_POSSIBLE = @@ -73,6 +77,9 @@ enum { #ifdef CONFIG_PPC_PS3 FW_FEATURE_PS3_POSSIBLE | #endif +#ifdef CONFIG_PPC_CELLEB + FW_FEATURE_CELLEB_POSSIBLE | +#endif #ifdef CONFIG_PPC_NATIVE FW_FEATURE_NATIVE_ALWAYS | #endif @@ -87,6 +94,9 @@ enum { #ifdef CONFIG_PPC_PS3 FW_FEATURE_PS3_ALWAYS & #endif +#ifdef CONFIG_PPC_CELLEB + FW_FEATURE_CELLEB_ALWAYS & +#endif #ifdef CONFIG_PPC_NATIVE FW_FEATURE_NATIVE_ALWAYS & #endif diff --git a/include/asm-powerpc/fs_pd.h b/include/asm-powerpc/fs_pd.h index 3d0e819d37f1..c624915b757e 100644 --- a/include/asm-powerpc/fs_pd.h +++ b/include/asm-powerpc/fs_pd.h @@ -11,19 +11,17 @@ #ifndef FS_PD_H #define FS_PD_H -#include <asm/cpm2.h> #include <sysdev/fsl_soc.h> #include <asm/time.h> -static inline int uart_baudrate(void) -{ - return get_baudrate(); -} +#ifdef CONFIG_CPM2 +#include <asm/cpm2.h> -static inline int uart_clock(void) -{ - return ppc_proc_freq; -} +#if defined(CONFIG_8260) +#include <asm/mpc8260.h> +#elif defined(CONFIG_85xx) +#include <asm/mpc85xx.h> +#endif #define cpm2_map(member) \ ({ \ @@ -41,5 +39,38 @@ static inline int uart_clock(void) }) #define cpm2_unmap(addr) iounmap(addr) +#endif + +#ifdef CONFIG_8xx +#include <asm/8xx_immap.h> +#include <asm/mpc8xx.h> + +#define immr_map(member) \ +({ \ + u32 offset = offsetof(immap_t, member); \ + void *addr = ioremap (IMAP_ADDR + offset, \ + sizeof( ((immap_t*)0)->member)); \ + addr; \ +}) + +#define immr_map_size(member, size) \ +({ \ + u32 offset = offsetof(immap_t, member); \ + void *addr = ioremap (IMAP_ADDR + offset, size); \ + addr; \ +}) + +#define immr_unmap(addr) iounmap(addr) +#endif + +static inline int uart_baudrate(void) +{ + return get_baudrate(); +} + +static inline int uart_clock(void) +{ + return ppc_proc_freq; +} #endif diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h index 7a500732b671..60977806d2f4 100644 --- a/include/asm-powerpc/hvcall.h +++ b/include/asm-powerpc/hvcall.h @@ -168,6 +168,7 @@ #define H_FREE_LOGICAL_LAN 0x118 #define H_ADD_LOGICAL_LAN_BUFFER 0x11C #define H_SEND_LOGICAL_LAN 0x120 +#define H_BULK_REMOVE 0x124 #define H_MULTICAST_CTRL 0x130 #define H_SET_XDABR 0x134 #define H_STUFF_TCE 0x138 diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h index 1cd532379c30..301c9bb308b1 100644 --- a/include/asm-powerpc/io.h +++ b/include/asm-powerpc/io.h @@ -732,6 +732,12 @@ static inline void * bus_to_virt(unsigned long address) #endif /* CONFIG_PPC32 */ +/* access ports */ +#define setbits32(_addr, _v) out_be32((_addr), in_be32(_addr) | (_v)) +#define clrbits32(_addr, _v) out_be32((_addr), in_be32(_addr) & ~(_v)) + +#define setbits16(_addr, _v) out_be16((_addr), in_be16(_addr) | (_v)) +#define clrbits16(_addr, _v) out_be16((_addr), in_be16(_addr) & ~(_v)) #endif /* __KERNEL__ */ diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h index f85dbd305558..b2e56b30306a 100644 --- a/include/asm-powerpc/iommu.h +++ b/include/asm-powerpc/iommu.h @@ -99,6 +99,7 @@ extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle, extern void iommu_init_early_pSeries(void); extern void iommu_init_early_iSeries(void); extern void iommu_init_early_dart(void); +extern void iommu_init_early_pasemi(void); #ifdef CONFIG_PCI extern void pci_iommu_init(void); diff --git a/include/asm-powerpc/ipic.h b/include/asm-powerpc/ipic.h index 9fbb03415860..edec79dcb7c1 100644 --- a/include/asm-powerpc/ipic.h +++ b/include/asm-powerpc/ipic.h @@ -78,7 +78,7 @@ extern u32 ipic_get_mcp_status(void); extern void ipic_clear_mcp_status(u32 mask); #ifdef CONFIG_PPC_MERGE -extern void ipic_init(struct device_node *node, unsigned int flags); +extern struct ipic * ipic_init(struct device_node *node, unsigned int flags); extern unsigned int ipic_get_irq(void); #else extern void ipic_init(phys_addr_t phys_addr, unsigned int flags, diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h index 46476e9a494a..4734cc178db5 100644 --- a/include/asm-powerpc/irq.h +++ b/include/asm-powerpc/irq.h @@ -89,6 +89,9 @@ struct irq_host_ops { /* Dispose of such a mapping */ void (*unmap)(struct irq_host *h, unsigned int virq); + /* Update of such a mapping */ + void (*remap)(struct irq_host *h, unsigned int virq, irq_hw_number_t hw); + /* Translate device-tree interrupt specifier from raw format coming * from the firmware to a irq_hw_number_t (interrupt line number) and * type (sense) that can be passed to set_irq_type(). In the absence diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h index 2dafa376a63f..3a5dd492588f 100644 --- a/include/asm-powerpc/kprobes.h +++ b/include/asm-powerpc/kprobes.h @@ -44,6 +44,7 @@ typedef unsigned int kprobe_opcode_t; #define IS_TDI(instr) (((instr) & 0xfc000000) == 0x08000000) #define IS_TWI(instr) (((instr) & 0xfc000000) == 0x0c000000) +#ifdef CONFIG_PPC64 /* * 64bit powerpc uses function descriptors. * Handle cases where: @@ -67,9 +68,13 @@ typedef unsigned int kprobe_opcode_t; } #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry) - #define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \ IS_TWI(instr) || IS_TDI(instr)) +#else +/* Use stock kprobe_lookup_name since ppc32 doesn't use function descriptors */ +#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)(pentry) +#define is_trap(instr) (IS_TW(instr) || IS_TWI(instr)) +#endif #define ARCH_SUPPORTS_KRETPROBES #define ARCH_INACTIVE_KPROBE_COUNT 1 diff --git a/include/asm-powerpc/mmu.h b/include/asm-powerpc/mmu.h index 41c8c9c5a254..200055a4b82b 100644 --- a/include/asm-powerpc/mmu.h +++ b/include/asm-powerpc/mmu.h @@ -247,6 +247,7 @@ extern void htab_initialize_secondary(void); extern void hpte_init_native(void); extern void hpte_init_lpar(void); extern void hpte_init_iSeries(void); +extern void hpte_init_beat(void); extern void stabs_alloc(void); extern void slb_initialize(void); diff --git a/include/asm-powerpc/mpc52xx.h b/include/asm-powerpc/mpc52xx.h index 4560d72fc758..7afd5bf94528 100644 --- a/include/asm-powerpc/mpc52xx.h +++ b/include/asm-powerpc/mpc52xx.h @@ -249,6 +249,8 @@ extern void mpc52xx_declare_of_platform_devices(void); extern void mpc52xx_init_irq(void); extern unsigned int mpc52xx_get_irq(void); +extern int __init mpc52xx_add_bridge(struct device_node *node); + #endif /* __ASSEMBLY__ */ #endif /* __ASM_POWERPC_MPC52xx_H__ */ diff --git a/include/asm-powerpc/mpc8260.h b/include/asm-powerpc/mpc8260.h new file mode 100644 index 000000000000..f1b83b09ab2e --- /dev/null +++ b/include/asm-powerpc/mpc8260.h @@ -0,0 +1,24 @@ +/* + * Since there are many different boards and no standard configuration, + * we have a unique include file for each. Rather than change every + * file that has to include MPC8260 configuration, they all include + * this one and the configuration switching is done here. + */ +#ifdef __KERNEL__ +#ifndef __ASM_PPC_MPC8260_H__ +#define __ASM_PPC_MPC8260_H__ + + +#ifdef CONFIG_8260 + +#if defined(CONFIG_PQ2ADS) || defined (CONFIG_PQ2FADS) +#include <platforms/82xx/pq2ads.h> +#endif + +#ifdef CONFIG_PCI_8260 +#include <platforms/82xx/m82xx_pci.h> +#endif + +#endif /* CONFIG_8260 */ +#endif /* !__ASM_PPC_MPC8260_H__ */ +#endif /* __KERNEL__ */ diff --git a/include/asm-powerpc/mpc8xx.h b/include/asm-powerpc/mpc8xx.h new file mode 100644 index 000000000000..580371120e1a --- /dev/null +++ b/include/asm-powerpc/mpc8xx.h @@ -0,0 +1,28 @@ +/* This is the single file included by all MPC8xx build options. + * Since there are many different boards and no standard configuration, + * we have a unique include file for each. Rather than change every + * file that has to include MPC8xx configuration, they all include + * this one and the configuration switching is done here. + */ +#ifdef __KERNEL__ +#ifndef __CONFIG_8xx_DEFS +#define __CONFIG_8xx_DEFS + + +#ifdef CONFIG_8xx + +#ifdef CONFIG_FADS +#include <platforms/fads.h> +#endif + +#if defined(CONFIG_MPC86XADS) +#include <platforms/8xx/mpc86xads.h> +#endif + +#if defined(CONFIG_MPC885ADS) +#include <platforms/8xx/mpc885ads.h> +#endif + +#endif /* CONFIG_8xx */ +#endif /* __CONFIG_8xx_DEFS */ +#endif /* __KERNEL__ */ diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h index b71e7b32a555..cb204a71e912 100644 --- a/include/asm-powerpc/mpic.h +++ b/include/asm-powerpc/mpic.h @@ -103,21 +103,6 @@ #define MPIC_MAX_ISU 32 /* - * Special vector numbers (internal use only) - */ -#define MPIC_VEC_SPURRIOUS 255 -#define MPIC_VEC_IPI_3 254 -#define MPIC_VEC_IPI_2 253 -#define MPIC_VEC_IPI_1 252 -#define MPIC_VEC_IPI_0 251 - -/* unused */ -#define MPIC_VEC_TIMER_3 250 -#define MPIC_VEC_TIMER_2 249 -#define MPIC_VEC_TIMER_1 248 -#define MPIC_VEC_TIMER_0 247 - -/* * Tsi108 implementation of MPIC has many differences from the original one */ @@ -276,6 +261,13 @@ struct mpic unsigned char *senses; unsigned int senses_count; + /* vector numbers used for internal sources (ipi/timers) */ + unsigned int ipi_vecs[4]; + unsigned int timer_vecs[4]; + + /* Spurious vector to program into unused sources */ + unsigned int spurious_vec; + #ifdef CONFIG_MPIC_BROKEN_U3 /* The fixup table */ struct mpic_irq_fixup *fixups; @@ -332,6 +324,8 @@ struct mpic #define MPIC_NO_PTHROU_DIS 0x00000040 /* DCR based MPIC */ #define MPIC_USES_DCR 0x00000080 +/* MPIC has 11-bit vector fields (or larger) */ +#define MPIC_LARGE_VECTORS 0x00000100 /* MPIC HW modification ID */ #define MPIC_REGSET_MASK 0xf0000000 diff --git a/include/asm-powerpc/oprofile_impl.h b/include/asm-powerpc/oprofile_impl.h index 71043bf3641f..94c0ad2bff96 100644 --- a/include/asm-powerpc/oprofile_impl.h +++ b/include/asm-powerpc/oprofile_impl.h @@ -58,10 +58,8 @@ extern struct op_powerpc_model op_model_power4; extern struct op_powerpc_model op_model_7450; extern struct op_powerpc_model op_model_cell; -#ifndef CONFIG_FSL_BOOKE - /* All the classic PPC parts use these */ -static inline unsigned int ctr_read(unsigned int i) +static inline unsigned int classic_ctr_read(unsigned int i) { switch(i) { case 0: @@ -89,7 +87,7 @@ static inline unsigned int ctr_read(unsigned int i) } } -static inline void ctr_write(unsigned int i, unsigned int val) +static inline void classic_ctr_write(unsigned int i, unsigned int val) { switch(i) { case 0: @@ -124,89 +122,6 @@ static inline void ctr_write(unsigned int i, unsigned int val) break; } } -#else /* CONFIG_FSL_BOOKE */ -static inline u32 get_pmlca(int ctr) -{ - u32 pmlca; - - switch (ctr) { - case 0: - pmlca = mfpmr(PMRN_PMLCA0); - break; - case 1: - pmlca = mfpmr(PMRN_PMLCA1); - break; - case 2: - pmlca = mfpmr(PMRN_PMLCA2); - break; - case 3: - pmlca = mfpmr(PMRN_PMLCA3); - break; - default: - panic("Bad ctr number\n"); - } - - return pmlca; -} - -static inline void set_pmlca(int ctr, u32 pmlca) -{ - switch (ctr) { - case 0: - mtpmr(PMRN_PMLCA0, pmlca); - break; - case 1: - mtpmr(PMRN_PMLCA1, pmlca); - break; - case 2: - mtpmr(PMRN_PMLCA2, pmlca); - break; - case 3: - mtpmr(PMRN_PMLCA3, pmlca); - break; - default: - panic("Bad ctr number\n"); - } -} - -static inline unsigned int ctr_read(unsigned int i) -{ - switch(i) { - case 0: - return mfpmr(PMRN_PMC0); - case 1: - return mfpmr(PMRN_PMC1); - case 2: - return mfpmr(PMRN_PMC2); - case 3: - return mfpmr(PMRN_PMC3); - default: - return 0; - } -} - -static inline void ctr_write(unsigned int i, unsigned int val) -{ - switch(i) { - case 0: - mtpmr(PMRN_PMC0, val); - break; - case 1: - mtpmr(PMRN_PMC1, val); - break; - case 2: - mtpmr(PMRN_PMC2, val); - break; - case 3: - mtpmr(PMRN_PMC3, val); - break; - default: - break; - } -} - - -#endif /* CONFIG_FSL_BOOKE */ extern void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth); diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h index cb02c9d1ef93..d9bf5aba96cb 100644 --- a/include/asm-powerpc/pci-bridge.h +++ b/include/asm-powerpc/pci-bridge.h @@ -53,6 +53,8 @@ struct pci_controller { unsigned long buid; unsigned long dma_window_base_cur; unsigned long dma_window_size; + + void *private_data; }; /* diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h index 52a69ed0d90a..4f5a1e01fdac 100644 --- a/include/asm-powerpc/ps3.h +++ b/include/asm-powerpc/ps3.h @@ -21,11 +21,33 @@ #if !defined(_ASM_POWERPC_PS3_H) #define _ASM_POWERPC_PS3_H -#include <linux/compiler.h> /* for __deprecated */ #include <linux/init.h> #include <linux/types.h> #include <linux/device.h> +union ps3_firmware_version { + u64 raw; + struct { + u16 pad; + u16 major; + u16 minor; + u16 rev; + }; +}; + +int ps3_get_firmware_version(union ps3_firmware_version *v); + +/* 'Other OS' area */ + +enum ps3_param_av_multi_out { + PS3_PARAM_AV_MULTI_OUT_NTSC = 0, + PS3_PARAM_AV_MULTI_OUT_PAL_RGB = 1, + PS3_PARAM_AV_MULTI_OUT_PAL_YCBCR = 2, + PS3_PARAM_AV_MULTI_OUT_SECAM = 3, +}; + +enum ps3_param_av_multi_out ps3_os_area_get_av_multi_out(void); + /** * struct ps3_device_id - HV bus device identifier from the system repository * @bus_id: HV bus id, {1..} (zero invalid) @@ -139,20 +161,32 @@ unsigned long ps3_mm_phys_to_lpar(unsigned long phys_addr); /* inrerrupt routines */ -int ps3_alloc_io_irq(unsigned int interrupt_id, unsigned int *virq); +enum ps3_cpu_binding { + PS3_BINDING_CPU_ANY = -1, + PS3_BINDING_CPU_0 = 0, + PS3_BINDING_CPU_1 = 1, +}; + +int ps3_alloc_io_irq(enum ps3_cpu_binding cpu, unsigned int interrupt_id, + unsigned int *virq); int ps3_free_io_irq(unsigned int virq); -int ps3_alloc_event_irq(unsigned int *virq); +int ps3_alloc_event_irq(enum ps3_cpu_binding cpu, unsigned int *virq); int ps3_free_event_irq(unsigned int virq); int ps3_send_event_locally(unsigned int virq); -int ps3_connect_event_irq(const struct ps3_device_id *did, - unsigned int interrupt_id, unsigned int *virq); +int ps3_connect_event_irq(enum ps3_cpu_binding cpu, + const struct ps3_device_id *did, unsigned int interrupt_id, + unsigned int *virq); int ps3_disconnect_event_irq(const struct ps3_device_id *did, unsigned int interrupt_id, unsigned int virq); -int ps3_alloc_vuart_irq(void* virt_addr_bmp, unsigned int *virq); -int ps3_free_vuart_irq(unsigned int virq); -int ps3_alloc_spe_irq(unsigned long spe_id, unsigned int class, +int ps3_alloc_vuart_irq(enum ps3_cpu_binding cpu, void* virt_addr_bmp, unsigned int *virq); +int ps3_free_vuart_irq(unsigned int virq); +int ps3_alloc_spe_irq(enum ps3_cpu_binding cpu, unsigned long spe_id, + unsigned int class, unsigned int *virq); int ps3_free_spe_irq(unsigned int virq); +int ps3_alloc_irq(enum ps3_cpu_binding cpu, unsigned long outlet, + unsigned int *virq); +int ps3_free_irq(unsigned int virq); /* lv1 result codes */ @@ -247,146 +281,6 @@ static inline const char* ps3_result(int result) #endif } -/* repository bus info */ - -enum ps3_bus_type { - PS3_BUS_TYPE_SB = 4, - PS3_BUS_TYPE_STORAGE = 5, -}; - -enum ps3_dev_type { - PS3_DEV_TYPE_SB_GELIC = 3, - PS3_DEV_TYPE_SB_USB = 4, - PS3_DEV_TYPE_SB_GPIO = 6, -}; - -int ps3_repository_read_bus_str(unsigned int bus_index, const char *bus_str, - u64 *value); -int ps3_repository_read_bus_id(unsigned int bus_index, unsigned int *bus_id); -int ps3_repository_read_bus_type(unsigned int bus_index, - enum ps3_bus_type *bus_type); -int ps3_repository_read_bus_num_dev(unsigned int bus_index, - unsigned int *num_dev); - -/* repository bus device info */ - -enum ps3_interrupt_type { - PS3_INTERRUPT_TYPE_EVENT_PORT = 2, - PS3_INTERRUPT_TYPE_SB_OHCI = 3, - PS3_INTERRUPT_TYPE_SB_EHCI = 4, - PS3_INTERRUPT_TYPE_OTHER = 5, -}; - -enum ps3_region_type { - PS3_REGION_TYPE_SB_OHCI = 3, - PS3_REGION_TYPE_SB_EHCI = 4, - PS3_REGION_TYPE_SB_GPIO = 5, -}; - -int ps3_repository_read_dev_str(unsigned int bus_index, - unsigned int dev_index, const char *dev_str, u64 *value); -int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index, - unsigned int *dev_id); -int ps3_repository_read_dev_type(unsigned int bus_index, - unsigned int dev_index, enum ps3_dev_type *dev_type); -int ps3_repository_read_dev_intr(unsigned int bus_index, - unsigned int dev_index, unsigned int intr_index, - enum ps3_interrupt_type *intr_type, unsigned int *interrupt_id); -int ps3_repository_read_dev_reg_type(unsigned int bus_index, - unsigned int dev_index, unsigned int reg_index, - enum ps3_region_type *reg_type); -int ps3_repository_read_dev_reg_addr(unsigned int bus_index, - unsigned int dev_index, unsigned int reg_index, u64 *bus_addr, - u64 *len); -int ps3_repository_read_dev_reg(unsigned int bus_index, - unsigned int dev_index, unsigned int reg_index, - enum ps3_region_type *reg_type, u64 *bus_addr, u64 *len); - -/* repository bus enumerators */ - -struct ps3_repository_device { - unsigned int bus_index; - unsigned int dev_index; - struct ps3_device_id did; -}; - -int ps3_repository_find_device(enum ps3_bus_type bus_type, - enum ps3_dev_type dev_type, - const struct ps3_repository_device *start_dev, - struct ps3_repository_device *dev); -static inline int ps3_repository_find_first_device( - enum ps3_bus_type bus_type, enum ps3_dev_type dev_type, - struct ps3_repository_device *dev) -{ - return ps3_repository_find_device(bus_type, dev_type, NULL, dev); -} -int ps3_repository_find_interrupt(const struct ps3_repository_device *dev, - enum ps3_interrupt_type intr_type, unsigned int *interrupt_id); -int ps3_repository_find_region(const struct ps3_repository_device *dev, - enum ps3_region_type reg_type, u64 *bus_addr, u64 *len); - -/* repository block device info */ - -int ps3_repository_read_dev_port(unsigned int bus_index, - unsigned int dev_index, u64 *port); -int ps3_repository_read_dev_blk_size(unsigned int bus_index, - unsigned int dev_index, u64 *blk_size); -int ps3_repository_read_dev_num_blocks(unsigned int bus_index, - unsigned int dev_index, u64 *num_blocks); -int ps3_repository_read_dev_num_regions(unsigned int bus_index, - unsigned int dev_index, unsigned int *num_regions); -int ps3_repository_read_dev_region_id(unsigned int bus_index, - unsigned int dev_index, unsigned int region_index, - unsigned int *region_id); -int ps3_repository_read_dev_region_size(unsigned int bus_index, - unsigned int dev_index, unsigned int region_index, u64 *region_size); -int ps3_repository_read_dev_region_start(unsigned int bus_index, - unsigned int dev_index, unsigned int region_index, u64 *region_start); - -/* repository pu and memory info */ - -int ps3_repository_read_num_pu(unsigned int *num_pu); -int ps3_repository_read_ppe_id(unsigned int *pu_index, unsigned int *ppe_id); -int ps3_repository_read_rm_base(unsigned int ppe_id, u64 *rm_base); -int ps3_repository_read_rm_size(unsigned int ppe_id, u64 *rm_size); -int ps3_repository_read_region_total(u64 *region_total); -int ps3_repository_read_mm_info(u64 *rm_base, u64 *rm_size, - u64 *region_total); - -/* repository pme info */ - -int ps3_repository_read_num_be(unsigned int *num_be); -int ps3_repository_read_be_node_id(unsigned int be_index, u64 *node_id); -int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq); -int ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq); - -/* repository 'Other OS' area */ - -int ps3_repository_read_boot_dat_addr(u64 *lpar_addr); -int ps3_repository_read_boot_dat_size(unsigned int *size); -int ps3_repository_read_boot_dat_info(u64 *lpar_addr, unsigned int *size); - -/* repository spu info */ - -/** - * enum spu_resource_type - Type of spu resource. - * @spu_resource_type_shared: Logical spu is shared with other partions. - * @spu_resource_type_exclusive: Logical spu is not shared with other partions. - * - * Returned by ps3_repository_read_spu_resource_id(). - */ - -enum ps3_spu_resource_type { - PS3_SPU_RESOURCE_TYPE_SHARED = 0, - PS3_SPU_RESOURCE_TYPE_EXCLUSIVE = 0x8000000000000000UL, -}; - -int ps3_repository_read_num_spu_reserved(unsigned int *num_spu_reserved); -int ps3_repository_read_num_spu_resource_id(unsigned int *num_resource_id); -int ps3_repository_read_spu_resource_id(unsigned int res_index, - enum ps3_spu_resource_type* resource_type, unsigned int *resource_id); - - /* system bus routines */ enum ps3_match_id { @@ -459,4 +353,39 @@ static inline void *ps3_system_bus_get_driver_data( extern struct bus_type ps3_system_bus_type; +/* vuart routines */ + +struct ps3_vuart_stats { + unsigned long bytes_written; + unsigned long bytes_read; + unsigned long tx_interrupts; + unsigned long rx_interrupts; + unsigned long disconnect_interrupts; +}; + +/** + * struct ps3_vuart_port_device - a device on a vuart port + */ + +struct ps3_vuart_port_device { + enum ps3_match_id match_id; + struct device core; + + /* private driver variables */ + unsigned int port_number; + u64 interrupt_mask; + struct { + spinlock_t lock; + struct list_head head; + } tx_list; + struct { + unsigned long bytes_held; + spinlock_t lock; + struct list_head head; + } rx_list; + struct ps3_vuart_stats stats; +}; + +int ps3_vuart_port_device_register(struct ps3_vuart_port_device *dev); + #endif diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h index a3631b15754c..0d7f0164ed81 100644 --- a/include/asm-powerpc/reg.h +++ b/include/asm-powerpc/reg.h @@ -166,6 +166,7 @@ #define SPRN_TBWU 0x11D /* Time Base Upper Register (super, R/W) */ #define SPRN_SPURR 0x134 /* Scaled PURR */ #define SPRN_HIOR 0x137 /* 970 Hypervisor interrupt offset */ +#define SPRN_LPCR 0x13E /* LPAR Control Register */ #define SPRN_DBAT0L 0x219 /* Data BAT 0 Lower Register */ #define SPRN_DBAT0U 0x218 /* Data BAT 0 Upper Register */ #define SPRN_DBAT1L 0x21B /* Data BAT 1 Lower Register */ @@ -391,6 +392,12 @@ #define SPRN_HSRR0 0x13A /* Save/Restore Register 0 */ #define SPRN_HSRR1 0x13B /* Save/Restore Register 1 */ +#define SPRN_TBCTL 0x35f /* PA6T Timebase control register */ +#define TBCTL_FREEZE 0x0000000000000000ull /* Freeze all tbs */ +#define TBCTL_RESTART 0x0000000100000000ull /* Restart all tbs */ +#define TBCTL_UPDATE_UPPER 0x0000000200000000ull /* Set upper 32 bits */ +#define TBCTL_UPDATE_LOWER 0x0000000300000000ull /* Set lower 32 bits */ + #ifndef SPRN_SVR #define SPRN_SVR 0x11E /* System Version Register */ #endif @@ -462,6 +469,13 @@ #define SPRN_SIAR 780 #define SPRN_SDAR 781 +#define PA6T_SPRN_PMC0 787 +#define PA6T_SPRN_PMC1 788 +#define PA6T_SPRN_PMC2 789 +#define PA6T_SPRN_PMC3 790 +#define PA6T_SPRN_PMC4 791 +#define PA6T_SPRN_PMC5 792 + #else /* 32-bit */ #define SPRN_MMCR0 952 /* Monitor Mode Control Register 0 */ #define MMCR0_FC 0x80000000UL /* freeze counters */ diff --git a/include/asm-powerpc/smp.h b/include/asm-powerpc/smp.h index 20ea7c70bc38..01717f266dc9 100644 --- a/include/asm-powerpc/smp.h +++ b/include/asm-powerpc/smp.h @@ -75,6 +75,7 @@ extern cpumask_t cpu_sibling_map[NR_CPUS]; void smp_init_iSeries(void); void smp_init_pSeries(void); void smp_init_cell(void); +void smp_init_celleb(void); void smp_setup_cpu_maps(void); extern int __cpu_disable(void); diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h index 3d90264e9d36..b634e16575f2 100644 --- a/include/asm-powerpc/spu.h +++ b/include/asm-powerpc/spu.h @@ -104,6 +104,7 @@ struct spu_context; struct spu_runqueue; +struct device_node; struct spu { const char *name; @@ -142,7 +143,19 @@ struct spu { char irq_c1[8]; char irq_c2[8]; + u64 spe_id; + void* pdata; /* platform private data */ + + /* of based platforms only */ + struct device_node *devnode; + + /* native only */ + struct spu_priv1 __iomem *priv1; + + /* beat only */ + u64 shadow_int_mask_RW[3]; + struct sys_device sysdev; }; diff --git a/include/asm-powerpc/spu_priv1.h b/include/asm-powerpc/spu_priv1.h index 69dcb0c53884..7e78f6a1ab8b 100644 --- a/include/asm-powerpc/spu_priv1.h +++ b/include/asm-powerpc/spu_priv1.h @@ -206,6 +206,8 @@ spu_destroy_spu (struct spu *spu) */ extern const struct spu_priv1_ops spu_priv1_mmio_ops; +extern const struct spu_priv1_ops spu_priv1_beat_ops; + extern const struct spu_management_ops spu_management_of_ops; #endif /* __KERNEL__ */ diff --git a/include/asm-powerpc/sstep.h b/include/asm-powerpc/sstep.h index 630a9889c07c..f593b0f9b627 100644 --- a/include/asm-powerpc/sstep.h +++ b/include/asm-powerpc/sstep.h @@ -21,6 +21,7 @@ struct pt_regs; */ #define IS_MTMSRD(instr) (((instr) & 0xfc0007be) == 0x7c000124) #define IS_RFID(instr) (((instr) & 0xfc0007fe) == 0x4c000024) +#define IS_RFI(instr) (((instr) & 0xfc0007fe) == 0x4c000064) /* Emulate instructions that cause a transfer of control. */ extern int emulate_step(struct pt_regs *regs, unsigned int instr); diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h index 4cff977ad526..3fd57c048f59 100644 --- a/include/asm-powerpc/time.h +++ b/include/asm-powerpc/time.h @@ -39,6 +39,8 @@ extern void generic_calibrate_decr(void); extern void wakeup_decrementer(void); extern void snapshot_timebase(void); +extern void set_dec_cpu6(unsigned int val); + /* Some sane defaults: 125 MHz timebase, 1GHz processor */ extern unsigned long ppc_proc_freq; #define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) diff --git a/include/asm-powerpc/udbg.h b/include/asm-powerpc/udbg.h index 55e57844fa78..4cbc313aa02a 100644 --- a/include/asm-powerpc/udbg.h +++ b/include/asm-powerpc/udbg.h @@ -41,9 +41,11 @@ extern void __init udbg_early_init(void); extern void __init udbg_init_debug_lpar(void); extern void __init udbg_init_pmac_realmode(void); extern void __init udbg_init_maple_realmode(void); +extern void __init udbg_init_pas_realmode(void); extern void __init udbg_init_iseries(void); extern void __init udbg_init_rtas_panel(void); extern void __init udbg_init_rtas_console(void); +extern void __init udbg_init_debug_beat(void); #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_UDBG_H */ |