Commit 589467d9 authored by Anton Blanchard's avatar Anton Blanchard

Merge samba.org:/scratch/anton/linux-2.5

into samba.org:/scratch/anton/linux-2.5_ppc64_Makefilecleanup
parents 18cddbe6 c073cb6c
...@@ -62,7 +62,22 @@ endif ...@@ -62,7 +62,22 @@ endif
cp -f arch/ppc64/configs/$(@:config=defconfig) arch/ppc64/defconfig cp -f arch/ppc64/configs/$(@:config=defconfig) arch/ppc64/defconfig
archclean: archclean:
rm -f arch/ppc64/kernel/{ppc_defs.h,mk_defs.s,mk_defs_out.c,mk_defs_tpl}
@$(MAKEBOOT) clean @$(MAKEBOOT) clean
archmrproper: archmrproper:
prepare: include/asm-$(ARCH)/offsets.h
arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER
include/asm-$(ARCH)/offsets.h.tmp: arch/$(ARCH)/kernel/asm-offsets.s
@$(generate-asm-offsets.h) < $< > $@
include/asm-$(ARCH)/offsets.h: include/asm-$(ARCH)/offsets.h.tmp
@echo -n ' Generating $@'
@$(update-if-changed)
CLEAN_FILES += include/asm-$(ARCH)/offsets.h.tmp \
include/asm-$(ARCH)/offsets.h
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
* as published by the Free Software Foundation; either version * as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#define __KERNEL__ 1
#include <asm/types.h> #include <asm/types.h>
#include <asm/page.h> #include <asm/page.h>
#include <stddef.h> #include <stddef.h>
...@@ -248,8 +247,3 @@ msChunks_alloc(unsigned long mem, unsigned long num_chunks, unsigned long chunk_ ...@@ -248,8 +247,3 @@ msChunks_alloc(unsigned long mem, unsigned long num_chunks, unsigned long chunk_
return mem; return mem;
} }
...@@ -40,25 +40,3 @@ obj-y += prom.o lmb.o rtas.o rtas-proc.o chrp_setup.o i8259.o ...@@ -40,25 +40,3 @@ obj-y += prom.o lmb.o rtas.o rtas-proc.o chrp_setup.o i8259.o
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
#
# This is just to get the dependencies...
#
head.o: head.S ppc_defs.h
misc.o: misc.S ppc_defs.h
entry.o: entry.S ppc_defs.h
hvCall.o: hvCall.S ppc_defs.h
pSeries_hvCall.o: pSeries_hvCall.S ppc_defs.h
sys32.o: sys32.S ppc_defs.h
ppc_defs.h: mk_defs.c ppc_defs.head \
$(TOPDIR)/include/asm/mmu.h \
$(TOPDIR)/include/asm/processor.h \
$(TOPDIR)/include/asm/pgtable.h \
$(TOPDIR)/include/asm/ptrace.h
$(CC) $(CFLAGS) -S mk_defs.c
cp ppc_defs.head ppc_defs.h
# for bk, this way we can write to the file even if it's not checked out
chmod u+w ppc_defs.h
grep '^#define' mk_defs.s >> ppc_defs.h
rm mk_defs.s
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include <stddef.h>
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -37,10 +36,11 @@ ...@@ -37,10 +36,11 @@
#include <asm/rtas.h> #include <asm/rtas.h>
#define DEFINE(sym, val) \ #define DEFINE(sym, val) \
asm volatile("\n#define\t" #sym "\t%0" : : "i" (val)) asm volatile("\n->" #sym " %0 " #val : : "i" (val))
int #define BLANK() asm volatile("\n->" : : )
main(void)
int main(void)
{ {
/* thread struct on stack */ /* thread struct on stack */
DEFINE(THREAD_SHIFT, THREAD_SHIFT); DEFINE(THREAD_SHIFT, THREAD_SHIFT);
......
...@@ -58,7 +58,6 @@ ...@@ -58,7 +58,6 @@
#include <asm/naca.h> #include <asm/naca.h>
#include <asm/time.h> #include <asm/time.h>
#include "local_irq.h"
#include "i8259.h" #include "i8259.h"
#include "open_pic.h" #include "open_pic.h"
#include "xics.h" #include "xics.h"
...@@ -66,7 +65,6 @@ ...@@ -66,7 +65,6 @@
extern volatile unsigned char *chrp_int_ack_special; extern volatile unsigned char *chrp_int_ack_special;
void chrp_setup_pci_ptrs(void);
void chrp_progress(char *, unsigned short); void chrp_progress(char *, unsigned short);
void chrp_request_regions(void); void chrp_request_regions(void);
...@@ -237,8 +235,6 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -237,8 +235,6 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
#endif /* CONFIG_BLK_DEV_INITRD */ #endif /* CONFIG_BLK_DEV_INITRD */
#endif #endif
ppc_md.ppc_machine = naca->platform;
ppc_md.setup_arch = chrp_setup_arch; ppc_md.setup_arch = chrp_setup_arch;
ppc_md.setup_residual = NULL; ppc_md.setup_residual = NULL;
ppc_md.get_cpuinfo = chrp_get_cpuinfo; ppc_md.get_cpuinfo = chrp_get_cpuinfo;
...@@ -265,7 +261,6 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -265,7 +261,6 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.power_off = rtas_power_off; ppc_md.power_off = rtas_power_off;
ppc_md.halt = rtas_halt; ppc_md.halt = rtas_halt;
ppc_md.time_init = NULL;
ppc_md.get_boot_time = pSeries_get_rtc_time; ppc_md.get_boot_time = pSeries_get_rtc_time;
ppc_md.get_rtc_time = pSeries_get_rtc_time; ppc_md.get_rtc_time = pSeries_get_rtc_time;
ppc_md.set_rtc_time = pSeries_set_rtc_time; ppc_md.set_rtc_time = pSeries_set_rtc_time;
......
...@@ -20,14 +20,15 @@ ...@@ -20,14 +20,15 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include "ppc_asm.h" #include <linux/config.h>
#include <linux/errno.h>
#include <linux/sys.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/mmu.h> #include <asm/mmu.h>
#include <asm/thread_info.h> #include <asm/thread_info.h>
#include <linux/errno.h> #include <asm/ppc_asm.h>
#include <linux/sys.h> #include <asm/offsets.h>
#include <linux/config.h>
#ifdef CONFIG_PPC_ISERIES #ifdef CONFIG_PPC_ISERIES
#define DO_SOFT_DISABLE #define DO_SOFT_DISABLE
......
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
#define SECONDARY_PROCESSORS #define SECONDARY_PROCESSORS
#include "ppc_asm.h" #include <linux/config.h>
#include "ppc_defs.h"
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/page.h> #include <asm/page.h>
#include <linux/config.h>
#include <asm/mmu.h> #include <asm/mmu.h>
#include <asm/ppc_asm.h>
#include <asm/offsets.h>
#ifdef CONFIG_PPC_ISERIES #ifdef CONFIG_PPC_ISERIES
#define DO_SOFT_DISABLE #define DO_SOFT_DISABLE
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <asm/lmb.h> #include <asm/lmb.h>
#include <asm/abs_addr.h> #include <asm/abs_addr.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include <asm/io.h>
#include <asm/eeh.h> #include <asm/eeh.h>
#include <asm/tlb.h> #include <asm/tlb.h>
......
...@@ -11,9 +11,8 @@ ...@@ -11,9 +11,8 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include "ppc_asm.h" #include <asm/ppc_asm.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <linux/config.h>
.text .text
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
#ifndef _PPC_KERNEL_i8259_H #ifndef _PPC_KERNEL_i8259_H
#define _PPC_KERNEL_i8259_H #define _PPC_KERNEL_i8259_H
#include "local_irq.h"
extern struct hw_interrupt_type i8259_pic; extern struct hw_interrupt_type i8259_pic;
void i8259_init(void); void i8259_init(void);
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include <asm/iSeries/HvTypes.h> #include <asm/iSeries/HvTypes.h>
#include <asm/iSeries/mf.h> #include <asm/iSeries/mf.h>
#include <asm/iSeries/LparData.h> #include <asm/iSeries/LparData.h>
#include <asm/iSeries/HvCallPci.h>
//#include <asm/iSeries/iSeries_VpdInfo.h> //#include <asm/iSeries/iSeries_VpdInfo.h>
#include <asm/iSeries/iSeries_pci.h> #include <asm/iSeries/iSeries_pci.h>
#include "pci.h" #include "pci.h"
......
...@@ -55,7 +55,6 @@ extern int global_phb_number; ...@@ -55,7 +55,6 @@ extern int global_phb_number;
extern int panic_timeout; extern int panic_timeout;
extern struct device_node *allnodes; extern struct device_node *allnodes;
extern unsigned long phb_tce_table_init(struct pci_controller *phb);
extern unsigned long iSeries_Base_Io_Memory; extern unsigned long iSeries_Base_Io_Memory;
extern struct pci_ops iSeries_pci_ops; extern struct pci_ops iSeries_pci_ops;
......
...@@ -312,7 +312,6 @@ iSeries_init_early(void) ...@@ -312,7 +312,6 @@ iSeries_init_early(void)
ppc_md.setup_arch = iSeries_setup_arch; ppc_md.setup_arch = iSeries_setup_arch;
ppc_md.setup_residual = iSeries_setup_residual; ppc_md.setup_residual = iSeries_setup_residual;
ppc_md.get_cpuinfo = iSeries_get_cpuinfo; ppc_md.get_cpuinfo = iSeries_get_cpuinfo;
ppc_md.irq_cannonicalize = NULL;
ppc_md.init_IRQ = iSeries_init_IRQ; ppc_md.init_IRQ = iSeries_init_IRQ;
ppc_md.init_ras_IRQ = NULL; ppc_md.init_ras_IRQ = NULL;
ppc_md.get_irq = iSeries_get_irq; ppc_md.get_irq = iSeries_get_irq;
...@@ -325,7 +324,6 @@ iSeries_init_early(void) ...@@ -325,7 +324,6 @@ iSeries_init_early(void)
ppc_md.power_off = iSeries_power_off; ppc_md.power_off = iSeries_power_off;
ppc_md.halt = iSeries_halt; ppc_md.halt = iSeries_halt;
ppc_md.time_init = NULL;
ppc_md.get_boot_time = iSeries_get_boot_time; ppc_md.get_boot_time = iSeries_get_boot_time;
ppc_md.set_rtc_time = iSeries_set_rtc_time; ppc_md.set_rtc_time = iSeries_set_rtc_time;
ppc_md.get_rtc_time = iSeries_get_rtc_time; ppc_md.get_rtc_time = iSeries_get_rtc_time;
...@@ -784,15 +782,6 @@ iSeries_halt(void) ...@@ -784,15 +782,6 @@ iSeries_halt(void)
mf_powerOff(); mf_powerOff();
} }
/*
* Nothing to do here.
*/
void __init
iSeries_time_init(void)
{
/* Nothing to do */
}
/* JDH Hack */ /* JDH Hack */
unsigned long jdh_time = 0; unsigned long jdh_time = 0;
......
...@@ -53,8 +53,6 @@ ...@@ -53,8 +53,6 @@
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/paca.h> #include <asm/paca.h>
#include "local_irq.h"
void enable_irq(unsigned int irq_nr); void enable_irq(unsigned int irq_nr);
void disable_irq(unsigned int irq_nr); void disable_irq(unsigned int irq_nr);
...@@ -69,7 +67,6 @@ irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = ...@@ -69,7 +67,6 @@ irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned =
{ [0 ... NR_IRQS-1] = { 0, NULL, NULL, 0, SPIN_LOCK_UNLOCKED}}; { [0 ... NR_IRQS-1] = { 0, NULL, NULL, 0, SPIN_LOCK_UNLOCKED}};
int ppc_spurious_interrupts = 0; int ppc_spurious_interrupts = 0;
struct irqaction *ppc_irq_action[NR_IRQS];
unsigned long lpEvent_count = 0; unsigned long lpEvent_count = 0;
/* nasty hack for shared irq's since we need to do kmalloc calls but /* nasty hack for shared irq's since we need to do kmalloc calls but
......
/*
* c 2001 PowerPC 64 Team, IBM Corp
*
* 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; either version
* 2 of the License, or (at your option) any later version.
*/
#ifndef _PPC_KERNEL_LOCAL_IRQ_H
#define _PPC_KERNEL_LOCAL_IRQ_H
#include <linux/kernel_stat.h>
#include <linux/interrupt.h>
#include <linux/cache.h>
#include <linux/spinlock.h>
#include <linux/irq.h>
void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq);
#define NR_MASK_WORDS ((NR_IRQS + 63) / 64)
extern int ppc_spurious_interrupts;
extern int ppc_second_irq;
extern struct irqaction *ppc_irq_action[NR_IRQS];
#endif /* _PPC_KERNEL_LOCAL_IRQ_H */
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/cache.h> #include <asm/cache.h>
#include "ppc_asm.h" #include <asm/ppc_asm.h>
#include <asm/offsets.h>
.text .text
...@@ -736,8 +737,11 @@ _GLOBAL(sys_call_table32) ...@@ -736,8 +737,11 @@ _GLOBAL(sys_call_table32)
.llong .sys_ni_syscall /* reserved for sys_io_getevents */ .llong .sys_ni_syscall /* reserved for sys_io_getevents */
.llong .sys_ni_syscall /* 230 - reserved for sys_io_submit */ .llong .sys_ni_syscall /* 230 - reserved for sys_io_submit */
.llong .sys_ni_syscall /* reserved for sys_io_cancel */ .llong .sys_ni_syscall /* reserved for sys_io_cancel */
.llong .sys_ni_syscall /* reserved for alloc_hugepages */
.llong .sys_ni_syscall /* reserved for free_hugepages */
.llong .sys_exit_group
.rept NR_syscalls-231 .rept NR_syscalls-234
.llong .sys_ni_syscall .llong .sys_ni_syscall
.endr .endr
#endif #endif
...@@ -976,7 +980,10 @@ _GLOBAL(sys_call_table) ...@@ -976,7 +980,10 @@ _GLOBAL(sys_call_table)
.llong .sys_io_getevents .llong .sys_io_getevents
.llong .sys_io_submit /* 230 */ .llong .sys_io_submit /* 230 */
.llong .sys_io_cancel .llong .sys_io_cancel
.llong .sys_ni_syscall /* reserved for alloc_hugepages */
.llong .sys_ni_syscall /* reserved for free_hugepages */
.llong .sys_exit_group
.rept NR_syscalls-231 .rept NR_syscalls-234
.llong .sys_ni_syscall .llong .sys_ni_syscall
.endr .endr
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <asm/machdep.h> #include <asm/machdep.h>
#include "local_irq.h"
#include "open_pic.h" #include "open_pic.h"
#include "open_pic_defs.h" #include "open_pic_defs.h"
#include "i8259.h" #include "i8259.h"
......
...@@ -11,14 +11,13 @@ ...@@ -11,14 +11,13 @@
* as published by the Free Software Foundation; either version * as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include <linux/config.h>
#include <linux/sys.h> #include <linux/sys.h>
#include <asm/unistd.h> #include <asm/unistd.h>
#include <asm/errno.h> #include <asm/errno.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/cache.h> #include <asm/cache.h>
#include "ppc_asm.h" #include <asm/ppc_asm.h>
/* /*
* hcall interface to pSeries LPAR * hcall interface to pSeries LPAR
......
...@@ -45,15 +45,13 @@ ...@@ -45,15 +45,13 @@
#include "open_pic.h" #include "open_pic.h"
#include "pci.h" #include "pci.h"
extern struct device_node *allnodes;
/******************************************************************* /*******************************************************************
* Forward declares of prototypes. * Forward declares of prototypes.
*******************************************************************/ *******************************************************************/
unsigned long find_and_init_phbs(void); struct pci_controller *alloc_phb(struct device_node *dev, char *model,
struct pci_controller* alloc_phb(struct device_node *dev, char *model, unsigned int addr_size_words) ; unsigned int addr_size_words) ;
void pSeries_pcibios_fixup(void); static int rtas_fake_read(struct device_node *dn, int offset, int nbytes,
static int rtas_fake_read(struct device_node *dn, int offset, int nbytes, unsigned long *returnval); unsigned long *returnval);
/* RTAS tokens */ /* RTAS tokens */
static int read_pci_config; static int read_pci_config;
...@@ -467,33 +465,27 @@ alloc_phb(struct device_node *dev, char *model, unsigned int addr_size_words) ...@@ -467,33 +465,27 @@ alloc_phb(struct device_node *dev, char *model, unsigned int addr_size_words)
* Python * Python
***************************************************************/ ***************************************************************/
if (strstr(model, "Python")) { if (strstr(model, "Python")) {
unsigned long chip_regs;
volatile u32 *tmp, i;
PPCDBG(PPCDBG_PHBINIT, "\tCreate python\n"); PPCDBG(PPCDBG_PHBINIT, "\tCreate python\n");
phb = pci_alloc_pci_controller("PHB PY",phb_type_python);
if (phb == NULL) return NULL; phb = pci_alloc_pci_controller("PHB PY", phb_type_python);
if (phb == NULL)
phb->cfg_addr = (volatile unsigned long *) return NULL;
ioremap(reg_struct.address + 0xf8000, PAGE_SIZE);
PPCDBG(PPCDBG_PHBINIT, "\tcfg_addr_r = 0x%lx\n",
reg_struct.address + 0xf8000);
PPCDBG(PPCDBG_PHBINIT, "\tcfg_addr_v = 0x%lx\n",
phb->cfg_addr);
phb->cfg_data = (char*)(phb->cfg_addr + 0x02);
phb->phb_regs = (volatile unsigned long *)
ioremap(reg_struct.address + 0xf7000, PAGE_SIZE);
/* Python's register file is 1 MB in size. */ /* Python's register file is 1 MB in size. */
phb->chip_regs = ioremap(reg_struct.address & ~(0xfffffUL), chip_regs = ioremap(reg_struct.address & ~(0xfffffUL),
0x100000); 0x100000);
/* /*
* Firmware doesn't always clear this bit which is critical * Firmware doesn't always clear this bit which is critical
* for good performance - Anton * for good performance - Anton
*/ */
{
volatile u32 *tmp, i;
#define PRG_CL_RESET_VALID 0x00010000 #define PRG_CL_RESET_VALID 0x00010000
tmp = (u32 *)((unsigned long)phb->chip_regs + 0xf6030); tmp = (u32 *)((unsigned long)chip_regs + 0xf6030);
if (*tmp & PRG_CL_RESET_VALID) { if (*tmp & PRG_CL_RESET_VALID) {
printk("Python workaround: "); printk("Python workaround: ");
...@@ -505,7 +497,6 @@ alloc_phb(struct device_node *dev, char *model, unsigned int addr_size_words) ...@@ -505,7 +497,6 @@ alloc_phb(struct device_node *dev, char *model, unsigned int addr_size_words)
i = *tmp; i = *tmp;
printk("reg0: %x\n", i); printk("reg0: %x\n", i);
} }
}
/*************************************************************** /***************************************************************
* Speedwagon * Speedwagon
...@@ -514,28 +505,12 @@ alloc_phb(struct device_node *dev, char *model, unsigned int addr_size_words) ...@@ -514,28 +505,12 @@ alloc_phb(struct device_node *dev, char *model, unsigned int addr_size_words)
} else if ((strstr(model, "Speedwagon")) || } else if ((strstr(model, "Speedwagon")) ||
(strstr(model, "Winnipeg"))) { (strstr(model, "Winnipeg"))) {
PPCDBG(PPCDBG_PHBINIT, "\tCreate speedwagon\n"); PPCDBG(PPCDBG_PHBINIT, "\tCreate speedwagon\n");
phb = pci_alloc_pci_controller("PHB SW",phb_type_speedwagon); phb = pci_alloc_pci_controller("PHB SW", phb_type_speedwagon);
if (phb == NULL) return NULL; if (phb == NULL)
return NULL;
if (naca->platform == PLATFORM_PSERIES) {
phb->cfg_addr = (volatile unsigned long *)
ioremap(reg_struct.address + 0x140, PAGE_SIZE);
phb->cfg_data = (char*)(phb->cfg_addr - 0x02); /* minus is correct */
phb->phb_regs = (volatile unsigned long *)
ioremap(reg_struct.address, PAGE_SIZE);
/* Speedwagon's register file is 1 MB in size. */
phb->chip_regs = ioremap(reg_struct.address & ~(0xfffffUL),
0x100000);
PPCDBG(PPCDBG_PHBINIT, "\tmapping chip_regs from 0x%lx -> 0x%lx\n",
reg_struct.address & 0xfffff, phb->chip_regs);
} else {
phb->cfg_addr = NULL;
phb->cfg_data = NULL;
phb->phb_regs = NULL;
phb->chip_regs = NULL;
}
phb->local_number = ((reg_struct.address >> 12) & 0xf) - 0x8; phb->local_number = ((reg_struct.address >> 12) & 0xf) - 0x8;
/*************************************************************** /***************************************************************
* Trying to build a known just gets the code in trouble. * Trying to build a known just gets the code in trouble.
***************************************************************/ ***************************************************************/
......
/* /*
*
*
* Port for PPC64 David Engebretsen, IBM Corp. * Port for PPC64 David Engebretsen, IBM Corp.
* Contains common pci routines for ppc64 platform, pSeries and iSeries brands. * Contains common pci routines for ppc64 platform, pSeries and iSeries brands.
* *
...@@ -128,7 +126,6 @@ void pcibios_fixup_pbus_ranges(struct pci_bus *pbus, ...@@ -128,7 +126,6 @@ void pcibios_fixup_pbus_ranges(struct pci_bus *pbus,
{ {
} }
void void
pcibios_update_resource(struct pci_dev *dev, struct resource *root, pcibios_update_resource(struct pci_dev *dev, struct resource *root,
struct resource *res, int resource) struct resource *res, int resource)
...@@ -200,7 +197,6 @@ pcibios_align_resource(void *data, struct resource *res, ...@@ -200,7 +197,6 @@ pcibios_align_resource(void *data, struct resource *res,
} }
} }
/* /*
* Handle resources of PCI devices. If the world were perfect, we could * Handle resources of PCI devices. If the world were perfect, we could
* just allocate all the resource regions and do nothing more. It isn't. * just allocate all the resource regions and do nothing more. It isn't.
...@@ -333,64 +329,27 @@ pcibios_assign_resources(void) ...@@ -333,64 +329,27 @@ pcibios_assign_resources(void)
if (!class || class == PCI_CLASS_BRIDGE_HOST) if (!class || class == PCI_CLASS_BRIDGE_HOST)
continue; continue;
for(idx=0; idx<6; idx++) { for (idx = 0; idx < 6; idx++) {
r = &dev->resource[idx]; r = &dev->resource[idx];
/* /*
* Don't touch IDE controllers and I/O ports of video cards! * We shall assign a new address to this resource,
*/ * either because the BIOS (sic) forgot to do so
if ((class == PCI_CLASS_STORAGE_IDE && idx < 4) || * or because we have decided the old address was
(class == PCI_CLASS_DISPLAY_VGA && (r->flags & IORESOURCE_IO))) * unusable for some reason.
continue;
/*
* We shall assign a new address to this resource, either because
* the BIOS forgot to do so or because we have decided the old
* address was unusable for some reason.
*/ */
if (!r->start && r->end && ppc_md.pcibios_enable_device_hook && if (!r->start && r->end)
!ppc_md.pcibios_enable_device_hook(dev, 1))
pci_assign_resource(dev, idx); pci_assign_resource(dev, idx);
} }
if (0) { /* don't assign ROMs */ #if 0 /* don't assign ROMs */
r = &dev->resource[PCI_ROM_RESOURCE]; r = &dev->resource[PCI_ROM_RESOURCE];
r->end -= r->start; r->end -= r->start;
r->start = 0; r->start = 0;
if (r->end) if (r->end)
pci_assign_resource(dev, PCI_ROM_RESOURCE); pci_assign_resource(dev, PCI_ROM_RESOURCE);
#endif
} }
}
}
int
pcibios_enable_resources(struct pci_dev *dev)
{
u16 cmd, old_cmd;
int idx;
struct resource *r;
pci_read_config_word(dev, PCI_COMMAND, &cmd);
old_cmd = cmd;
for(idx=0; idx<6; idx++) {
r = &dev->resource[idx];
if (!r->start && r->end) {
printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", dev->slot_name);
return -EINVAL;
}
if (r->flags & IORESOURCE_IO)
cmd |= PCI_COMMAND_IO;
if (r->flags & IORESOURCE_MEM)
cmd |= PCI_COMMAND_MEMORY;
}
if (dev->resource[PCI_ROM_RESOURCE].start)
cmd |= PCI_COMMAND_MEMORY;
if (cmd != old_cmd) {
printk("PCI: Enabling device %s (%04x -> %04x)\n", dev->slot_name, old_cmd, cmd);
pci_write_config_word(dev, PCI_COMMAND, cmd);
}
return 0;
} }
/* /*
...@@ -407,8 +366,10 @@ pci_alloc_pci_controller(char *model, enum phb_types controller_type) ...@@ -407,8 +366,10 @@ pci_alloc_pci_controller(char *model, enum phb_types controller_type)
return NULL; return NULL;
} }
memset(hose, 0, sizeof(struct pci_controller)); memset(hose, 0, sizeof(struct pci_controller));
if(strlen(model) < 8) strcpy(hose->what,model); if(strlen(model) < 8)
else memcpy(hose->what,model,7); strcpy(hose->what,model);
else
memcpy(hose->what,model,7);
hose->type = controller_type; hose->type = controller_type;
hose->global_number = global_phb_number; hose->global_number = global_phb_number;
phbtab[global_phb_number++] = hose; phbtab[global_phb_number++] = hose;
...@@ -418,29 +379,7 @@ pci_alloc_pci_controller(char *model, enum phb_types controller_type) ...@@ -418,29 +379,7 @@ pci_alloc_pci_controller(char *model, enum phb_types controller_type)
return hose; return hose;
} }
/* static int __init
* This fixup is arch independent and probably should go somewhere else.
*/
void __init
pcibios_generic_fixup(void)
{
struct pci_dev *dev;
/* Fix miss-identified vendor AMD pcnet32 adapters. */
dev = NULL;
while ((dev = pci_find_device(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_AMD_LANCE, dev)) != NULL &&
dev->class == (PCI_CLASS_NETWORK_ETHERNET << 8))
dev->vendor = PCI_VENDOR_ID_AMD;
}
/***********************************************************************
*
*
*
***********************************************************************/
void __init
pcibios_init(void) pcibios_init(void)
{ {
struct pci_controller *hose; struct pci_controller *hose;
...@@ -456,7 +395,6 @@ pcibios_init(void) ...@@ -456,7 +395,6 @@ pcibios_init(void)
printk("PCI: Probing PCI hardware\n"); printk("PCI: Probing PCI hardware\n");
PPCDBG(PPCDBG_BUSWALK,"PCI: Probing PCI hardware\n"); PPCDBG(PPCDBG_BUSWALK,"PCI: Probing PCI hardware\n");
/* Scan all of the recorded PCI controllers. */ /* Scan all of the recorded PCI controllers. */
for (next_busno = 0, hose = hose_head; hose; hose = hose->next) { for (next_busno = 0, hose = hose_head; hose; hose = hose->next) {
hose->last_busno = 0xff; hose->last_busno = 0xff;
...@@ -473,9 +411,6 @@ pcibios_init(void) ...@@ -473,9 +411,6 @@ pcibios_init(void)
ppc_md.pcibios_fixup(); ppc_md.pcibios_fixup();
} }
/* Generic fixups */
pcibios_generic_fixup();
/* Allocate and assign resources */ /* Allocate and assign resources */
pcibios_allocate_bus_resources(&pci_root_buses); pcibios_allocate_bus_resources(&pci_root_buses);
pcibios_allocate_resources(0); pcibios_allocate_resources(0);
...@@ -577,20 +512,22 @@ char __init *pcibios_setup(char *str) ...@@ -577,20 +512,22 @@ char __init *pcibios_setup(char *str)
return str; return str;
} }
int pcibios_enable_device(struct pci_dev *dev) int pcibios_enable_device(struct pci_dev *dev, int mask)
{ {
u16 cmd, old_cmd; u16 cmd, old_cmd;
int idx; int idx;
struct resource *r; struct resource *r;
PPCDBG(PPCDBG_BUSWALK,"PCI: %s for device %s \n",__FUNCTION__,dev->slot_name); PPCDBG(PPCDBG_BUSWALK,"PCI: %s for device %s \n", __FUNCTION__,
if (ppc_md.pcibios_enable_device_hook) dev->slot_name);
if (ppc_md.pcibios_enable_device_hook(dev, 0))
return -EINVAL;
pci_read_config_word(dev, PCI_COMMAND, &cmd); pci_read_config_word(dev, PCI_COMMAND, &cmd);
old_cmd = cmd; old_cmd = cmd;
for (idx=0; idx<6; idx++) { for (idx = 0; idx < 6; idx++) {
/* Only set up the requested stuff */
if (!(mask & (1<<idx)))
continue;
r = &dev->resource[idx]; r = &dev->resource[idx];
if (!r->start && r->end) { if (!r->start && r->end) {
printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", dev->slot_name); printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", dev->slot_name);
...@@ -604,7 +541,8 @@ int pcibios_enable_device(struct pci_dev *dev) ...@@ -604,7 +541,8 @@ int pcibios_enable_device(struct pci_dev *dev)
if (cmd != old_cmd) { if (cmd != old_cmd) {
printk("PCI: Enabling device %s (%04x -> %04x)\n", printk("PCI: Enabling device %s (%04x -> %04x)\n",
dev->slot_name, old_cmd, cmd); dev->slot_name, old_cmd, cmd);
PPCDBG(PPCDBG_BUSWALK,"PCI: Enabling device %s \n",dev->slot_name); PPCDBG(PPCDBG_BUSWALK,"PCI: Enabling device %s \n",
dev->slot_name);
pci_write_config_word(dev, PCI_COMMAND, cmd); pci_write_config_word(dev, PCI_COMMAND, cmd);
} }
return 0; return 0;
...@@ -986,12 +924,6 @@ void dumpPci_Controller(struct pci_controller* phb) ...@@ -986,12 +924,6 @@ void dumpPci_Controller(struct pci_controller* phb)
udbg_printf("\tpci_mem_offset= 0x%016LX\n", phb->pci_mem_offset); udbg_printf("\tpci_mem_offset= 0x%016LX\n", phb->pci_mem_offset);
udbg_printf("\tpci_io_offset = 0x%016LX\n", phb->pci_io_offset); udbg_printf("\tpci_io_offset = 0x%016LX\n", phb->pci_io_offset);
udbg_printf("\tcfg_addr = 0x%016LX\n", phb->cfg_addr);
udbg_printf("\tcfg_data = 0x%016LX\n", phb->cfg_data);
udbg_printf("\tphb_regs = 0x%016LX\n", phb->phb_regs);
udbg_printf("\tchip_regs = 0x%016LX\n", phb->chip_regs);
udbg_printf("\tResources\n"); udbg_printf("\tResources\n");
dumpResources(&phb->io_resource); dumpResources(&phb->io_resource);
if (phb->mem_resource_count > 0) dumpResources(&phb->mem_resources[0]); if (phb->mem_resource_count > 0) dumpResources(&phb->mem_resources[0]);
......
...@@ -1438,69 +1438,6 @@ void pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems, ...@@ -1438,69 +1438,6 @@ void pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sglist, int nelems,
} }
#endif #endif
/*
* phb_tce_table_init
*
* Function: Display TCE config registers. Could be easily changed
* to initialize the hardware to use TCEs.
*/
unsigned long phb_tce_table_init(struct pci_controller *phb) {
unsigned int r, cfg_rw, i;
unsigned long r64;
phandle node;
PPCDBG(PPCDBG_TCE, "phb_tce_table_init: start.\n");
node = ((struct device_node *)(phb->arch_data))->node;
PPCDBG(PPCDBG_TCEINIT, "\tphb = 0x%lx\n", phb);
PPCDBG(PPCDBG_TCEINIT, "\tphb->type = 0x%lx\n", phb->type);
PPCDBG(PPCDBG_TCEINIT, "\tphb->phb_regs = 0x%lx\n", phb->phb_regs);
PPCDBG(PPCDBG_TCEINIT, "\tphb->chip_regs = 0x%lx\n", phb->chip_regs);
PPCDBG(PPCDBG_TCEINIT, "\tphb: node = 0x%lx\n", node);
PPCDBG(PPCDBG_TCEINIT, "\tphb->arch_data = 0x%lx\n", phb->arch_data);
i = 0;
while(of_tce_table[i].node) {
if(of_tce_table[i].node == node) {
if(phb->type == phb_type_python) {
r = *(((unsigned int *)phb->phb_regs) + (0xf10>>2));
PPCDBG(PPCDBG_TCEINIT, "\tTAR(low) = 0x%x\n", r);
r = *(((unsigned int *)phb->phb_regs) + (0xf00>>2));
PPCDBG(PPCDBG_TCEINIT, "\tTAR(high) = 0x%x\n", r);
r = *(((unsigned int *)phb->phb_regs) + (0xfd0>>2));
PPCDBG(PPCDBG_TCEINIT, "\tPHB cfg(rw) = 0x%x\n", r);
break;
} else if(phb->type == phb_type_speedwagon) {
r64 = *(((unsigned long *)phb->chip_regs) +
(0x800>>3));
PPCDBG(PPCDBG_TCEINIT, "\tNCFG = 0x%lx\n", r64);
r64 = *(((unsigned long *)phb->chip_regs) +
(0x580>>3));
PPCDBG(PPCDBG_TCEINIT, "\tTAR0 = 0x%lx\n", r64);
r64 = *(((unsigned long *)phb->chip_regs) +
(0x588>>3));
PPCDBG(PPCDBG_TCEINIT, "\tTAR1 = 0x%lx\n", r64);
r64 = *(((unsigned long *)phb->chip_regs) +
(0x590>>3));
PPCDBG(PPCDBG_TCEINIT, "\tTAR2 = 0x%lx\n", r64);
r64 = *(((unsigned long *)phb->chip_regs) +
(0x598>>3));
PPCDBG(PPCDBG_TCEINIT, "\tTAR3 = 0x%lx\n", r64);
cfg_rw = *(((unsigned int *)phb->chip_regs) +
((0x160 +
(((phb->local_number)+8)<<12))>>2));
PPCDBG(PPCDBG_TCEINIT, "\tcfg_rw = 0x%x\n", cfg_rw);
}
}
i++;
}
PPCDBG(PPCDBG_TCEINIT, "phb_tce_table_init: done\n");
return(0);
}
/* These are called very early. */ /* These are called very early. */
void tce_init_pSeries(void) void tce_init_pSeries(void)
{ {
......
...@@ -215,6 +215,7 @@ void *traverse_all_pci_devices(traverse_func pre) ...@@ -215,6 +215,7 @@ void *traverse_all_pci_devices(traverse_func pre)
return NULL; return NULL;
} }
/* Traversal func that looks for a <busno,devfcn> value. /* Traversal func that looks for a <busno,devfcn> value.
* If found, the device_node is returned (thus terminating the traversal). * If found, the device_node is returned (thus terminating the traversal).
*/ */
...@@ -223,7 +224,6 @@ is_devfn_node(struct device_node *dn, void *data) ...@@ -223,7 +224,6 @@ is_devfn_node(struct device_node *dn, void *data)
{ {
int busno = ((unsigned long)data >> 8) & 0xff; int busno = ((unsigned long)data >> 8) & 0xff;
int devfn = ((unsigned long)data) & 0xff; int devfn = ((unsigned long)data) & 0xff;
return (devfn == dn->devfn && busno == dn->busno) ? dn : NULL; return (devfn == dn->devfn && busno == dn->busno) ? dn : NULL;
} }
...@@ -249,8 +249,9 @@ create_eads_node(struct device_node *other_eads) ...@@ -249,8 +249,9 @@ create_eads_node(struct device_node *other_eads)
*eads = *other_eads; *eads = *other_eads;
eads->devfn &= ~7; /* make it function zero */ eads->devfn &= ~7; /* make it function zero */
eads->tce_table = NULL; eads->tce_table = NULL;
/* NOTE: share properties. We could copy but for now this should suffice. /*
* The full_name is also incorrect...but seems harmless. * NOTE: share properties. We could copy but for now this should
* suffice. The full_name is also incorrect...but seems harmless.
*/ */
eads->child = NULL; eads->child = NULL;
eads->next = NULL; eads->next = NULL;
...@@ -285,21 +286,25 @@ struct device_node *fetch_dev_dn(struct pci_dev *dev) ...@@ -285,21 +286,25 @@ struct device_node *fetch_dev_dn(struct pci_dev *dev)
dev->sysdata = dn; dev->sysdata = dn;
/* ToDo: call some device init hook here */ /* ToDo: call some device init hook here */
} else { } else {
/* Now it is very possible that we can't find the device because it is /* Now it is very possible that we can't find the device
* not the zero'th device of a mutifunction device and we don't have * because it is not the zero'th device of a mutifunction
* permission to read the zero'th device. If this is the case, Linux * device and we don't have permission to read the zero'th
* would ordinarily skip all the other functions. * device. If this is the case, Linux would ordinarily skip
* all the other functions.
*/ */
if ((searchval & 0x7) == 0) { if ((searchval & 0x7) == 0) {
struct device_node *thisdevdn; struct device_node *thisdevdn;
/* Ok, we are looking for fn == 0. Let's check for other functions. */ /* Ok, we are looking for fn == 0. Let's check for other functions. */
thisdevdn = (struct device_node *)traverse_pci_devices(phb_dn, is_devfn_sub_node, NULL, (void *)searchval); thisdevdn = (struct device_node *)traverse_pci_devices(phb_dn, is_devfn_sub_node, NULL, (void *)searchval);
if (thisdevdn) { if (thisdevdn) {
/* Ah ha! There does exist a sub function. Now this isn't an exact /* Ah ha! There does exist a sub function.
* match for searchval, but in order to get Linux to believe the sub * Now this isn't an exact match for
* functions exist we will need to manufacture a fake device_node * searchval, but in order to get Linux to
* for this zero'th function. To keept this simple for now we only * believe the sub functions exist we will
* handle pci bridges and we just hand back the found node which * need to manufacture a fake device_node for
* this zero'th function. To keept this
* simple for now we only handle pci bridges
* and we just hand back the found node which
* isn't correct, but Linux won't care. * isn't correct, but Linux won't care.
*/ */
char *device_type = (char *)get_property(thisdevdn, "device_type", 0); char *device_type = (char *)get_property(thisdevdn, "device_type", 0);
...@@ -368,7 +373,6 @@ pci_fixup_bus_sysdata_list(struct list_head *bus_list) ...@@ -368,7 +373,6 @@ pci_fixup_bus_sysdata_list(struct list_head *bus_list)
} }
} }
/****************************************************************** /******************************************************************
* Fixup the bus->sysdata ptrs to point to the bus' device_node. * Fixup the bus->sysdata ptrs to point to the bus' device_node.
* This is done late in pcibios_init(). We do this mostly for * This is done late in pcibios_init(). We do this mostly for
......
/*
* WARNING! This file is automatically generated - DO NOT EDIT!
*/
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
* End Change Activity * End Change Activity
*/ */
#include <linux/config.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/config.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
......
...@@ -159,11 +159,10 @@ long sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, int p3, int p4, int ...@@ -159,11 +159,10 @@ long sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, int p3, int p4, int
} }
} }
long sys_sigaltstack(const stack_t *uss, stack_t *uoss, unsigned long r5,
unsigned long r6, unsigned long r7, unsigned long r8,
long sys_sigaltstack(const stack_t *uss, stack_t *uoss) struct pt_regs *regs)
{ {
struct pt_regs *regs = (struct pt_regs *)&uss;
return do_sigaltstack(uss, uoss, regs->gpr[1]); return do_sigaltstack(uss, uoss, regs->gpr[1]);
} }
...@@ -250,7 +249,7 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -250,7 +249,7 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
goto badframe; goto badframe;
/* This function sets back the stack flags into /* This function sets back the stack flags into
the current task structure. */ the current task structure. */
sys_sigaltstack(&st, NULL); sys_sigaltstack(&st, NULL, 0, 0, 0, 0, regs);
return regs->result; return regs->result;
......
...@@ -298,7 +298,8 @@ long sys32_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -298,7 +298,8 @@ long sys32_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
regs->dsisr = 0; regs->dsisr = 0;
regs->result = (u64)(saved_regs[PT_RESULT]) & 0xFFFFFFFF; regs->result = (u64)(saved_regs[PT_RESULT]) & 0xFFFFFFFF;
if (copy_from_user(current->thread.fpr, &sr->fp_regs, sizeof(sr->fp_regs))) if (copy_from_user(current->thread.fpr, &sr->fp_regs,
sizeof(sr->fp_regs)))
goto badframe; goto badframe;
ret = regs->result; ret = regs->result;
...@@ -392,7 +393,6 @@ static void setup_frame32(struct pt_regs *regs, struct sigregs32 *frame, ...@@ -392,7 +393,6 @@ static void setup_frame32(struct pt_regs *regs, struct sigregs32 *frame,
return; return;
badframe: badframe:
udbg_printf("setup_frame32 - badframe in setup_frame, regs=%p frame=%p newsp=%lx\n", regs, frame, newsp); PPCDBG_ENTER_DEBUGGER();
#if DEBUG_SIG #if DEBUG_SIG
printk("badframe in setup_frame32, regs=%p frame=%p newsp=%lx\n", printk("badframe in setup_frame32, regs=%p frame=%p newsp=%lx\n",
regs, frame, newsp); regs, frame, newsp);
...@@ -421,7 +421,6 @@ static void setup_frame32(struct pt_regs *regs, struct sigregs32 *frame, ...@@ -421,7 +421,6 @@ static void setup_frame32(struct pt_regs *regs, struct sigregs32 *frame,
* siginfo32to64 * siginfo32to64
*/ */
/* /*
* This code executes after the rt signal handler in 32 bit mode has * This code executes after the rt signal handler in 32 bit mode has
* completed and returned * completed and returned
...@@ -438,6 +437,7 @@ long sys32_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -438,6 +437,7 @@ long sys32_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
sigset_t set; sigset_t set;
stack_t st; stack_t st;
int i; int i;
mm_segment_t old_fs;
/* Adjust the inputted reg1 to point to the first rt signal frame */ /* Adjust the inputted reg1 to point to the first rt signal frame */
rt_sf = (struct rt_sigframe_32 *)(regs->gpr[1] + __SIGNAL_FRAMESIZE32); rt_sf = (struct rt_sigframe_32 *)(regs->gpr[1] + __SIGNAL_FRAMESIZE32);
...@@ -509,6 +509,16 @@ long sys32_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -509,6 +509,16 @@ long sys32_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
regs->dar = 0; regs->dar = 0;
regs->dsisr = 0; regs->dsisr = 0;
regs->result = (u64)(saved_regs[PT_RESULT]) & 0xFFFFFFFF; regs->result = (u64)(saved_regs[PT_RESULT]) & 0xFFFFFFFF;
if (copy_from_user(current->thread.fpr, &sr->fp_regs,
sizeof(sr->fp_regs)))
goto badframe;
/* This function sets back the stack flags into
the current task structure. */
old_fs = get_fs();
set_fs(KERNEL_DS);
do_sigaltstack(&st, NULL, regs->gpr[1]);
set_fs(old_fs);
ret = regs->result; ret = regs->result;
return ret; return ret;
...@@ -933,7 +943,6 @@ static void setup_rt_frame32(struct pt_regs *regs, struct sigregs32 *frame, ...@@ -933,7 +943,6 @@ static void setup_rt_frame32(struct pt_regs *regs, struct sigregs32 *frame,
return; return;
badframe: badframe:
udbg_printf("setup_frame32 - badframe in setup_frame, regs=%p frame=%p newsp=%lx\n", regs, frame, newsp); PPCDBG_ENTER_DEBUGGER();
#if DEBUG_SIG #if DEBUG_SIG
printk("badframe in setup_frame32, regs=%p frame=%p newsp=%lx\n", printk("badframe in setup_frame32, regs=%p frame=%p newsp=%lx\n",
regs, frame, newsp); regs, frame, newsp);
......
...@@ -303,11 +303,13 @@ unsigned long ppc64_stab_preload = 1; ...@@ -303,11 +303,13 @@ unsigned long ppc64_stab_preload = 1;
*/ */
static void preload_stab(struct task_struct *tsk, struct mm_struct *mm) static void preload_stab(struct task_struct *tsk, struct mm_struct *mm)
{ {
if (ppc64_preload_all_segments && test_tsk_thread_flag(tsk, TIF_32BIT)) { if (ppc64_preload_all_segments &&
test_tsk_thread_flag(tsk, TIF_32BIT)) {
unsigned long esid, vsid; unsigned long esid, vsid;
for (esid = 0; esid < 16; esid++) { for (esid = 0; esid < 16; esid++) {
vsid = get_vsid(mm->context, esid << SID_SHIFT); unsigned long ea = esid << SID_SHIFT;
vsid = get_vsid(mm->context, ea);
__ste_allocate(esid, vsid, 0); __ste_allocate(esid, vsid, 0);
} }
} else { } else {
...@@ -318,15 +320,17 @@ static void preload_stab(struct task_struct *tsk, struct mm_struct *mm) ...@@ -318,15 +320,17 @@ static void preload_stab(struct task_struct *tsk, struct mm_struct *mm)
unsigned long vsid; unsigned long vsid;
if (pc) { if (pc) {
if (REGION_ID(pc) >= KERNEL_REGION_ID) if (!IS_VALID_EA(pc) ||
BUG(); (REGION_ID(pc) >= KERNEL_REGION_ID))
return;
vsid = get_vsid(mm->context, pc); vsid = get_vsid(mm->context, pc);
__ste_allocate(GET_ESID(pc), vsid, 0); __ste_allocate(GET_ESID(pc), vsid, 0);
} }
if (stack && (pc_segment != stack_segment)) { if (stack && (pc_segment != stack_segment)) {
if (REGION_ID(stack) >= KERNEL_REGION_ID) if (!IS_VALID_EA(stack) ||
BUG(); (REGION_ID(stack) >= KERNEL_REGION_ID))
return;
vsid = get_vsid(mm->context, stack); vsid = get_vsid(mm->context, stack);
__ste_allocate(GET_ESID(stack), vsid, 0); __ste_allocate(GET_ESID(stack), vsid, 0);
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include "ppc_asm.h" #include <asm/ppc_asm.h>
#include <asm/errno.h> #include <asm/errno.h>
#include <asm/processor.h> #include <asm/processor.h>
......
/* /*
* linux/arch/ppc/kernel/traps.c * linux/arch/ppc64/kernel/traps.c
* *
* Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
* *
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/threads.h> #include <linux/threads.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/irq.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
......
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
#ifndef _PPC_KERNEL_XICS_H #ifndef _PPC_KERNEL_XICS_H
#define _PPC_KERNEL_XICS_H #define _PPC_KERNEL_XICS_H
#include "local_irq.h"
extern struct hw_interrupt_type xics_pic; extern struct hw_interrupt_type xics_pic;
extern struct hw_interrupt_type xics_8259_pic; extern struct hw_interrupt_type xics_8259_pic;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include <linux/sys.h> #include <linux/sys.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/errno.h> #include <asm/errno.h>
#include <asm/ppc_asm.tmpl> #include <asm/ppc_asm.h>
/* /*
* ip_fast_csum(r3=buf, r4=len) -- Optimized for IP header * ip_fast_csum(r3=buf, r4=len) -- Optimized for IP header
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include <asm/processor.h> #include <asm/processor.h>
#include "../kernel/ppc_asm.h" #include <asm/ppc_asm.h>
_GLOBAL(copy_page) _GLOBAL(copy_page)
std r31,-8(1) std r31,-8(1)
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include <asm/processor.h> #include <asm/processor.h>
#include "../kernel/ppc_asm.h" #include <asm/ppc_asm.h>
.align 7 .align 7
_GLOBAL(__copy_tofrom_user) _GLOBAL(__copy_tofrom_user)
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include <asm/processor.h> #include <asm/processor.h>
#include "../kernel/ppc_asm.h" #include <asm/ppc_asm.h>
.align 7 .align 7
_GLOBAL(memcpy) _GLOBAL(memcpy)
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
* as published by the Free Software Foundation; either version * as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include <asm/ppc_asm.tmpl>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/errno.h> #include <asm/errno.h>
#include <asm/ppc_asm.h>
_GLOBAL(strcpy) _GLOBAL(strcpy)
addi r5,r3,-1 addi r5,r3,-1
......
...@@ -12,5 +12,6 @@ EXTRA_CFLAGS = -mno-minimal-toc ...@@ -12,5 +12,6 @@ EXTRA_CFLAGS = -mno-minimal-toc
O_TARGET := mm.o O_TARGET := mm.o
obj-y := fault.o init.o extable.o imalloc.o obj-y := fault.o init.o extable.o imalloc.o
obj-$(CONFIG_DISCONTIGMEM) += numa.o
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -382,7 +382,7 @@ void free_initmem(void) ...@@ -382,7 +382,7 @@ void free_initmem(void)
free_page(addr); free_page(addr);
totalram_pages++; totalram_pages++;
} }
printk ("Freeing unused kernel memory: %dk freed\n", printk ("Freeing unused kernel memory: %luk freed\n",
(&__init_end - &__init_begin) >> 10); (&__init_end - &__init_begin) >> 10);
} }
......
/*
* NUMA support
*
* Copyright (C) 2002 Anton Blanchard <anton@au.ibm.com>, IBM
*
* 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; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/threads.h>
#include <linux/bootmem.h>
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/mmzone.h>
#include <asm/lmb.h>
#if 0
#define dbg(format, arg...) udbg_printf(format, arg)
#else
#define dbg(format, arg...)
#endif
int numa_cpu_lookup_table[NR_CPUS] = { [ 0 ... (NR_CPUS - 1)] = -1};
int numa_memory_lookup_table[MAX_MEMORY >> MEMORY_INCREMENT_SHIFT] =
{ [ 0 ... ((MAX_MEMORY >> MEMORY_INCREMENT_SHIFT) - 1)] = -1};
int numa_node_exists[MAX_NUMNODES];
struct pglist_data node_data[MAX_NUMNODES];
bootmem_data_t plat_node_bdata[MAX_NUMNODES];
static int __init parse_numa_properties(void)
{
/* XXX implement */
return -1;
}
void __init do_init_bootmem(void)
{
int nid;
min_low_pfn = 0;
max_low_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT;
if (parse_numa_properties())
BUG();
for (nid = 0; nid < MAX_NUMNODES; nid++) {
unsigned long start, end;
unsigned long start_paddr, end_paddr;
int i;
unsigned long bootmem_paddr;
unsigned long bootmap_size;
if (!numa_node_exists[nid])
continue;
/* Find start and end of this zone */
start = 0;
while (numa_memory_lookup_table[start] != nid)
start++;
end = (MAX_MEMORY >> MEMORY_INCREMENT_SHIFT) - 1;
while (numa_memory_lookup_table[end] != nid)
end--;
end++;
start_paddr = start << MEMORY_INCREMENT_SHIFT;
end_paddr = end << MEMORY_INCREMENT_SHIFT;
dbg("node %d\n", nid);
dbg("start_paddr = %lx\n", start_paddr);
dbg("end_paddr = %lx\n", end_paddr);
NODE_DATA(nid)->bdata = &plat_node_bdata[nid];
/* XXX FIXME: first bitmap hardwired to 1G */
if (start_paddr == 0)
bootmem_paddr = (1 << 30);
else
bootmem_paddr = start_paddr;
dbg("bootmap_paddr = %lx\n", bootmem_paddr);
bootmap_size = init_bootmem_node(NODE_DATA(nid),
bootmem_paddr >> PAGE_SHIFT,
start_paddr >> PAGE_SHIFT,
end_paddr >> PAGE_SHIFT);
dbg("bootmap_size = %lx\n", bootmap_size);
for (i = 0; i < lmb.memory.cnt; i++) {
unsigned long physbase, size;
unsigned long type = lmb.memory.region[i].type;
if (type != LMB_MEMORY_AREA)
continue;
physbase = lmb.memory.region[i].physbase;
size = lmb.memory.region[i].size;
if (physbase < end_paddr &&
(physbase+size) > start_paddr) {
/* overlaps */
if (physbase < start_paddr) {
size -= start_paddr - physbase;
physbase = start_paddr;
}
if (size > end_paddr - start_paddr)
size = end_paddr - start_paddr;
dbg("free_bootmem %lx %lx\n", physbase, size);
free_bootmem_node(NODE_DATA(nid), physbase,
size);
}
}
for (i = 0; i < lmb.reserved.cnt; i++) {
unsigned long physbase = lmb.reserved.region[i].physbase;
unsigned long size = lmb.reserved.region[i].size;
if (physbase < end_paddr &&
(physbase+size) > start_paddr) {
/* overlaps */
if (physbase < start_paddr) {
size -= start_paddr - physbase;
physbase = start_paddr;
}
if (size > end_paddr - start_paddr)
size = end_paddr - start_paddr;
dbg("reserve_bootmem %lx %lx\n", physbase,
size);
reserve_bootmem_node(NODE_DATA(nid), physbase,
size);
}
}
dbg("reserve_bootmem %lx %lx\n", bootmem_paddr, bootmap_size);
reserve_bootmem_node(NODE_DATA(nid), bootmem_paddr,
bootmap_size);
}
}
void __init paging_init(void)
{
unsigned long zones_size[MAX_NR_ZONES];
int i, nid;
for (i = 1; i < MAX_NR_ZONES; i++)
zones_size[i] = 0;
for (nid = 0; nid < MAX_NUMNODES; nid++) {
unsigned long start_pfn;
unsigned long end_pfn;
if (!numa_node_exists[nid])
continue;
start_pfn = plat_node_bdata[nid].node_boot_start >> PAGE_SHIFT;
end_pfn = plat_node_bdata[nid].node_low_pfn;
zones_size[ZONE_DMA] = end_pfn - start_pfn;
dbg("free_area_init node %d %lx %lx\n", nid, zones_size,
start_pfn);
free_area_init_node(nid, NODE_DATA(nid), NULL, zones_size,
start_pfn, NULL);
}
}
...@@ -332,10 +332,10 @@ xmon(struct pt_regs *excp) ...@@ -332,10 +332,10 @@ xmon(struct pt_regs *excp)
cmd = cmds(excp); cmd = cmds(excp);
if (cmd == 's') { if (cmd == 's') {
xmon_trace[smp_processor_id()] = SSTEP; xmon_trace[smp_processor_id()] = SSTEP;
excp->msr |= 0x400; excp->msr |= MSR_SE;
} else if (at_breakpoint(excp->nip)) { } else if (at_breakpoint(excp->nip)) {
xmon_trace[smp_processor_id()] = BRSTEP; xmon_trace[smp_processor_id()] = BRSTEP;
excp->msr |= 0x400; excp->msr |= MSR_SE;
} else { } else {
xmon_trace[smp_processor_id()] = 0; xmon_trace[smp_processor_id()] = 0;
insert_bpts(); insert_bpts();
...@@ -450,7 +450,7 @@ xmon_bpt(struct pt_regs *regs) ...@@ -450,7 +450,7 @@ xmon_bpt(struct pt_regs *regs)
remove_bpts(); remove_bpts();
excprint(regs); excprint(regs);
xmon_trace[smp_processor_id()] = BRSTEP; xmon_trace[smp_processor_id()] = BRSTEP;
regs->msr |= 0x400; regs->msr |= MSR_SE;
} else { } else {
printf("Stopped at breakpoint %x (%lx %s)\n", (bp - bpts)+1, bp->address, bp->funcname); printf("Stopped at breakpoint %x (%lx %s)\n", (bp - bpts)+1, bp->address, bp->funcname);
xmon(regs); xmon(regs);
...@@ -480,7 +480,7 @@ xmon_dabr_match(struct pt_regs *regs) ...@@ -480,7 +480,7 @@ xmon_dabr_match(struct pt_regs *regs)
remove_bpts(); remove_bpts();
excprint(regs); excprint(regs);
xmon_trace[smp_processor_id()] = BRSTEP; xmon_trace[smp_processor_id()] = BRSTEP;
regs->msr |= 0x400; regs->msr |= MSR_SE;
} else { } else {
dabr.instr = regs->nip; dabr.instr = regs->nip;
xmon(regs); xmon(regs);
...@@ -496,7 +496,7 @@ xmon_iabr_match(struct pt_regs *regs) ...@@ -496,7 +496,7 @@ xmon_iabr_match(struct pt_regs *regs)
remove_bpts(); remove_bpts();
excprint(regs); excprint(regs);
xmon_trace[smp_processor_id()] = BRSTEP; xmon_trace[smp_processor_id()] = BRSTEP;
regs->msr |= 0x400; regs->msr |= MSR_SE;
} else { } else {
xmon(regs); xmon(regs);
} }
...@@ -734,7 +734,7 @@ static void cpu_cmd(void) ...@@ -734,7 +734,7 @@ static void cpu_cmd(void)
printf("cpus stopped:"); printf("cpus stopped:");
for (cpu = 0; cpu < NR_CPUS; ++cpu) { for (cpu = 0; cpu < NR_CPUS; ++cpu) {
if (test_bit(cpu, &cpus_in_xmon)) { if (test_bit(cpu, &cpus_in_xmon)) {
printf(" %d", cpu); printf(" %x", cpu);
if (cpu == smp_processor_id()) if (cpu == smp_processor_id())
printf("*", cpu); printf("*", cpu);
} }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <asm/irq.h> #include <asm/irq.h>
int timer_interrupt(struct pt_regs *); int timer_interrupt(struct pt_regs *);
extern void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq);
#ifdef CONFIG_PPC_ISERIES #ifdef CONFIG_PPC_ISERIES
......
...@@ -17,10 +17,6 @@ ...@@ -17,10 +17,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef _PPC_TYPES_H
#include <asm/types.h>
#endif
#ifndef _LPARDATA_H #ifndef _LPARDATA_H
#define _LPARDATA_H #define _LPARDATA_H
...@@ -40,7 +36,6 @@ ...@@ -40,7 +36,6 @@
#include <asm/iSeries/ItExtVpdPanel.h> #include <asm/iSeries/ItExtVpdPanel.h>
#include <asm/iSeries/ItLpQueue.h> #include <asm/iSeries/ItLpQueue.h>
#include <asm/iSeries/IoHriProcessorVpd.h> #include <asm/iSeries/IoHriProcessorVpd.h>
#include <asm/page.h>
extern struct LparMap xLparMap; extern struct LparMap xLparMap;
extern struct HvReleaseData hvReleaseData; extern struct HvReleaseData hvReleaseData;
......
...@@ -51,5 +51,7 @@ static __inline__ int irq_cannonicalize(int irq) ...@@ -51,5 +51,7 @@ static __inline__ int irq_cannonicalize(int irq)
return irq; return irq;
} }
#define NR_MASK_WORDS ((NR_IRQS + 63) / 64)
#endif /* _ASM_IRQ_H */ #endif /* _ASM_IRQ_H */
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef _PPC_MACHDEP_H #ifndef _PPC64_MACHDEP_H
#define _PPC_MACHDEP_H #define _PPC64_MACHDEP_H
/* /*
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
struct pt_regs; struct pt_regs;
struct pci_bus; struct pci_bus;
struct pci_dev;
struct device_node; struct device_node;
struct TceTable; struct TceTable;
struct rtc_time; struct rtc_time;
...@@ -70,39 +69,36 @@ struct machdep_calls { ...@@ -70,39 +69,36 @@ struct machdep_calls {
void (*setup_residual)(struct seq_file *m, int cpu_id); void (*setup_residual)(struct seq_file *m, int cpu_id);
/* Optional, may be NULL. */ /* Optional, may be NULL. */
void (*get_cpuinfo)(struct seq_file *m); void (*get_cpuinfo)(struct seq_file *m);
/* Optional, may be NULL. */
unsigned int (*irq_cannonicalize)(unsigned int irq);
void (*init_IRQ)(void); void (*init_IRQ)(void);
void (*init_ras_IRQ)(void); void (*init_ras_IRQ)(void);
int (*get_irq)(struct pt_regs *); int (*get_irq)(struct pt_regs *);
/* A general init function, called by ppc_init in init/main.c. /* Optional, may be NULL. */
May be NULL. */
void (*init)(void); void (*init)(void);
void (*restart)(char *cmd); void (*restart)(char *cmd);
void (*power_off)(void); void (*power_off)(void);
void (*halt)(void); void (*halt)(void);
long (*time_init)(void); /* Optional, may be NULL */
int (*set_rtc_time)(struct rtc_time *); int (*set_rtc_time)(struct rtc_time *);
void (*get_rtc_time)(struct rtc_time *); void (*get_rtc_time)(struct rtc_time *);
void (*get_boot_time)(struct rtc_time *); void (*get_boot_time)(struct rtc_time *);
void (*calibrate_decr)(void); void (*calibrate_decr)(void);
void (*progress)(char *, unsigned short); void (*progress)(char *, unsigned short);
unsigned char (*nvram_read_val)(int addr);
void (*nvram_write_val)(int addr, unsigned char val);
/* Debug interface. Low level I/O to some terminal device */ /* Debug interface. Low level I/O to some terminal device */
void (*udbg_putc)(unsigned char c); void (*udbg_putc)(unsigned char c);
unsigned char (*udbg_getc)(void); unsigned char (*udbg_getc)(void);
int (*udbg_getc_poll)(void); int (*udbg_getc_poll)(void);
/* PCI interfaces */ /* PCI interfaces */
int (*pcibios_read_config)(struct device_node *dn, int where, int size, u32 *val); int (*pcibios_read_config)(struct device_node *dn, int where, int size,
int (*pcibios_write_config)(struct device_node *dn, int where, int size, u32 val); u32 *val);
int (*pcibios_write_config)(struct device_node *dn, int where,
int size, u32 val);
/* Called after scanning the bus, before allocating /* Called after scanning the bus, before allocating
* resources * resources
...@@ -114,19 +110,6 @@ struct machdep_calls { ...@@ -114,19 +110,6 @@ struct machdep_calls {
*/ */
void (*pcibios_fixup_bus)(struct pci_bus *); void (*pcibios_fixup_bus)(struct pci_bus *);
/* Called when pci_enable_device() is called (initial=0) or
* when a device with no assigned resource is found (initial=1).
* Returns 0 to allow assignement/enabling of the device
*/
int (*pcibios_enable_device_hook)(struct pci_dev *, int initial);
void* (*pci_dev_io_base)(unsigned char bus, unsigned char devfn, int physical);
void* (*pci_dev_mem_base)(unsigned char bus, unsigned char devfn);
int (*pci_dev_root_bridge)(unsigned char bus, unsigned char devfn);
/* this is for modules, since _machine can be a define -- Cort */
int ppc_machine;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* functions for dealing with other cpus */ /* functions for dealing with other cpus */
struct smp_ops_t smp_ops; struct smp_ops_t smp_ops;
...@@ -136,7 +119,5 @@ struct machdep_calls { ...@@ -136,7 +119,5 @@ struct machdep_calls {
extern struct machdep_calls ppc_md; extern struct machdep_calls ppc_md;
extern char cmd_line[512]; extern char cmd_line[512];
extern void setup_pci_ptrs(void); #endif /* _PPC64_MACHDEP_H */
#endif /* _PPC_MACHDEP_H */
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#ifdef CONFIG_DISCONTIGMEM #ifdef CONFIG_DISCONTIGMEM
extern struct pglist_data *node_data[]; extern struct pglist_data node_data[];
/* /*
* Following are specific to this numa platform. * Following are specific to this numa platform.
...@@ -27,7 +27,7 @@ extern int numa_memory_lookup_table[]; ...@@ -27,7 +27,7 @@ extern int numa_memory_lookup_table[];
#define MEMORY_INCREMENT_SHIFT 28 #define MEMORY_INCREMENT_SHIFT 28
#define MEMORY_INCREMENT (1UL << MEMORY_INCREMENT_SHIFT) #define MEMORY_INCREMENT (1UL << MEMORY_INCREMENT_SHIFT)
#undef DEBUG_NUMA #define DEBUG_NUMA
static inline int pa_to_nid(unsigned long pa) static inline int pa_to_nid(unsigned long pa)
{ {
...@@ -48,9 +48,14 @@ static inline int pa_to_nid(unsigned long pa) ...@@ -48,9 +48,14 @@ static inline int pa_to_nid(unsigned long pa)
#define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT) #define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT)
#define node_startnr(nid) (node_data[nid]->node_start_mapnr) /*
#define node_size(nid) (node_data[nid]->node_size) * Return a pointer to the node data for node n.
#define node_localnr(pfn, nid) ((pfn) - node_data[nid]->node_start_pfn) */
#define NODE_DATA(nid) (&node_data[nid])
#define node_startnr(nid) (NODE_DATA(nid)->node_start_mapnr)
#define node_size(nid) (NODE_DATA(nid)->node_size)
#define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn)
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
...@@ -80,11 +85,6 @@ static inline int __cpu_to_node(int cpu) ...@@ -80,11 +85,6 @@ static inline int __cpu_to_node(int cpu)
*/ */
#define kvaddr_to_nid(kaddr) pa_to_nid(__pa(kaddr)) #define kvaddr_to_nid(kaddr) pa_to_nid(__pa(kaddr))
/*
* Return a pointer to the node data for node n.
*/
#define NODE_DATA(nid) (node_data[nid])
#define node_mem_map(nid) (NODE_DATA(nid)->node_mem_map) #define node_mem_map(nid) (NODE_DATA(nid)->node_mem_map)
#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
......
...@@ -57,10 +57,6 @@ struct pci_controller { ...@@ -57,10 +57,6 @@ struct pci_controller {
unsigned long pci_io_offset; unsigned long pci_io_offset;
struct pci_ops *ops; struct pci_ops *ops;
volatile unsigned long *cfg_addr;
volatile unsigned char *cfg_data;
volatile unsigned long *phb_regs;
volatile unsigned long *chip_regs;
/* Currently, we limit ourselves to 1 IO range and 3 mem /* Currently, we limit ourselves to 1 IO range and 3 mem
* ranges since the common pci_bus structure can't handle more * ranges since the common pci_bus structure can't handle more
...@@ -70,27 +66,11 @@ struct pci_controller { ...@@ -70,27 +66,11 @@ struct pci_controller {
int mem_resource_count; int mem_resource_count;
int global_number; int global_number;
int local_number; int local_number;
int system_bus_number;
unsigned long buid; unsigned long buid;
unsigned long dma_window_base_cur; unsigned long dma_window_base_cur;
unsigned long dma_window_size; unsigned long dma_window_size;
}; };
/* This version handles the new Uni-N host bridge, the iobase is now
* a per-device thing. I also added the memory base so PReP can
* be fixed to return 0xc0000000 (I didn't actually implement it)
*
* pci_dev_io_base() returns either a virtual (ioremap'ed) address or
* a physical address. In-kernel clients will use logical while the
* sys_pciconfig_iobase syscall returns a physical one to userland.
*/
void *pci_dev_io_base(unsigned char bus, unsigned char devfn, int physical);
void *pci_dev_mem_base(unsigned char bus, unsigned char devfn);
/* Returns the root-bridge number (Uni-N number) of a device */
int pci_dev_root_bridge(unsigned char bus, unsigned char devfn);
/* /*
* pci_device_loc returns the bus number and device/function number * pci_device_loc returns the bus number and device/function number
* for a device on a PCI bus, given its device_node struct. * for a device on a PCI bus, given its device_node struct.
...@@ -99,16 +79,5 @@ int pci_dev_root_bridge(unsigned char bus, unsigned char devfn); ...@@ -99,16 +79,5 @@ int pci_dev_root_bridge(unsigned char bus, unsigned char devfn);
int pci_device_loc(struct device_node *dev, unsigned char *bus_ptr, int pci_device_loc(struct device_node *dev, unsigned char *bus_ptr,
unsigned char *devfn_ptr); unsigned char *devfn_ptr);
struct bridge_data {
volatile unsigned int *cfg_addr;
volatile unsigned char *cfg_data;
void *io_base; /* virtual */
unsigned long io_base_phys;
int bus_number;
int max_bus;
struct bridge_data *next;
struct device_node *node;
};
#endif #endif
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
...@@ -11,9 +11,6 @@ ...@@ -11,9 +11,6 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include <asm/ppc_asm.tmpl>
#include "ppc_defs.h"
/* /*
* Macros for storing registers into and loading registers from * Macros for storing registers into and loading registers from
* exception frames. * exception frames.
...@@ -113,3 +110,118 @@ ...@@ -113,3 +110,118 @@
rldicr rd,rd,32,31; \ rldicr rd,rd,32,31; \
add rd,rs,rd add rd,rs,rd
/* Condition Register Bit Fields */
#define cr0 0
#define cr1 1
#define cr2 2
#define cr3 3
#define cr4 4
#define cr5 5
#define cr6 6
#define cr7 7
/* General Purpose Registers (GPRs) */
#define r0 0
#define r1 1
#define r2 2
#define r3 3
#define r4 4
#define r5 5
#define r6 6
#define r7 7
#define r8 8
#define r9 9
#define r10 10
#define r11 11
#define r12 12
#define r13 13
#define r14 14
#define r15 15
#define r16 16
#define r17 17
#define r18 18
#define r19 19
#define r20 20
#define r21 21
#define r22 22
#define r23 23
#define r24 24
#define r25 25
#define r26 26
#define r27 27
#define r28 28
#define r29 29
#define r30 30
#define r31 31
/* Floating Point Registers (FPRs) */
#define fr0 0
#define fr1 1
#define fr2 2
#define fr3 3
#define fr4 4
#define fr5 5
#define fr6 6
#define fr7 7
#define fr8 8
#define fr9 9
#define fr10 10
#define fr11 11
#define fr12 12
#define fr13 13
#define fr14 14
#define fr15 15
#define fr16 16
#define fr17 17
#define fr18 18
#define fr19 19
#define fr20 20
#define fr21 21
#define fr22 22
#define fr23 23
#define fr24 24
#define fr25 25
#define fr26 26
#define fr27 27
#define fr28 28
#define fr29 29
#define fr30 30
#define fr31 31
#define vr0 0
#define vr1 1
#define vr2 2
#define vr3 3
#define vr4 4
#define vr5 5
#define vr6 6
#define vr7 7
#define vr8 8
#define vr9 9
#define vr10 10
#define vr11 11
#define vr12 12
#define vr13 13
#define vr14 14
#define vr15 15
#define vr16 16
#define vr17 17
#define vr18 18
#define vr19 19
#define vr20 20
#define vr21 21
#define vr22 22
#define vr23 23
#define vr24 24
#define vr25 25
#define vr26 26
#define vr27 27
#define vr28 28
#define vr29 29
#define vr30 30
#define vr31 31
/* Condition Register Bit Fields */
#define cr0 0
#define cr1 1
#define cr2 2
#define cr3 3
#define cr4 4
#define cr5 5
#define cr6 6
#define cr7 7
/* General Purpose Registers (GPRs) */
#define r0 0
#define r1 1
#define r2 2
#define r3 3
#define r4 4
#define r5 5
#define r6 6
#define r7 7
#define r8 8
#define r9 9
#define r10 10
#define r11 11
#define r12 12
#define r13 13
#define r14 14
#define r15 15
#define r16 16
#define r17 17
#define r18 18
#define r19 19
#define r20 20
#define r21 21
#define r22 22
#define r23 23
#define r24 24
#define r25 25
#define r26 26
#define r27 27
#define r28 28
#define r29 29
#define r30 30
#define r31 31
/* Floating Point Registers (FPRs) */
#define fr0 0
#define fr1 1
#define fr2 2
#define fr3 3
#define fr4 4
#define fr5 5
#define fr6 6
#define fr7 7
#define fr8 8
#define fr9 9
#define fr10 10
#define fr11 11
#define fr12 12
#define fr13 13
#define fr14 14
#define fr15 15
#define fr16 16
#define fr17 17
#define fr18 18
#define fr19 19
#define fr20 20
#define fr21 21
#define fr22 22
#define fr23 23
#define fr24 24
#define fr25 25
#define fr26 26
#define fr27 27
#define fr28 28
#define fr29 29
#define fr30 30
#define fr31 31
#define vr0 0
#define vr1 1
#define vr2 2
#define vr3 3
#define vr4 4
#define vr5 5
#define vr6 6
#define vr7 7
#define vr8 8
#define vr9 9
#define vr10 10
#define vr11 11
#define vr12 12
#define vr13 13
#define vr14 14
#define vr15 15
#define vr16 16
#define vr17 17
#define vr18 18
#define vr19 19
#define vr20 20
#define vr21 21
#define vr22 22
#define vr23 23
#define vr24 24
#define vr25 25
#define vr26 26
#define vr27 27
#define vr28 28
#define vr29 29
#define vr30 30
#define vr31 31
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
/* /*
* Remove spinlock-based RW semaphores; RW semaphore definitions are * Remove spinlock-based RW semaphores; RW semaphore definitions are
* now in rwsem.h and we use the the generic lib/rwsem.c implementation. * now in rwsem.h and we use the generic lib/rwsem.c implementation.
* Rework semaphores to use atomic_dec_if_positive. * Rework semaphores to use atomic_dec_if_positive.
* -- Paul Mackerras (paulus@samba.org) * -- Paul Mackerras (paulus@samba.org)
*/ */
......
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
struct free_pte_ctx; struct free_pte_ctx;
static inline void tlb_flush(struct free_pte_ctx *tlb); static inline void tlb_flush(struct free_pte_ctx *tlb);
/* Avoid pulling in another include just for this */
#define check_pgt_cache() do { } while (0)
/* Get the generic bits... */ /* Get the generic bits... */
#include <asm-generic/tlb.h> #include <asm-generic/tlb.h>
......
...@@ -241,6 +241,9 @@ ...@@ -241,6 +241,9 @@
#define __NR_io_getevents 229 #define __NR_io_getevents 229
#define __NR_io_submit 230 #define __NR_io_submit 230
#define __NR_io_cancel 231 #define __NR_io_cancel 231
#define __NR_alloc_hugepages 232
#define __NR_free_hugepages 233
#define __NR_exit_group 234
#define __NR(n) #n #define __NR(n) #n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment