Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67566
b: refs/heads/master
c: 0a2cdd8
h: refs/heads/master
v: v3
  • Loading branch information
Josh Boyer committed Oct 11, 2007
1 parent 1663235 commit d776eb2
Show file tree
Hide file tree
Showing 60 changed files with 1,607 additions and 637 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 17c5c2093624e81acda16fb737e4679750addd7a
refs/heads/master: 0a2cdd88f0b8ea98bcaf9712446cc46a240313f5
4 changes: 4 additions & 0 deletions trunk/arch/powerpc/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-isystem $(shell $(CROSS32CC) -print-file-name=include)
BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc

ifdef CONFIG_DEBUG_INFO
BOOTCFLAGS += -g
endif

ifeq ($(call cc-option-yn, -fstack-protector),y)
BOOTCFLAGS += -fno-stack-protector
endif
Expand Down
45 changes: 24 additions & 21 deletions trunk/arch/powerpc/kernel/cputable.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ extern void __restore_cpu_ppc970(void);
#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
PPC_FEATURE_BOOKE)

static struct cpu_spec cpu_specs[] = {
static struct cpu_spec __initdata cpu_specs[] = {
#ifdef CONFIG_PPC64
{ /* Power3 */
.pvr_mask = 0xffff0000,
Expand Down Expand Up @@ -327,14 +327,6 @@ static struct cpu_spec cpu_specs[] = {
.cpu_user_features = COMMON_USER_POWER5_PLUS,
.icache_bsize = 128,
.dcache_bsize = 128,
.num_pmcs = 6,
.pmc_type = PPC_PMC_IBM,
.oprofile_cpu_type = "ppc64/power6",
.oprofile_type = PPC_OPROFILE_POWER4,
.oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
.oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
.oprofile_mmcra_clear = POWER6_MMCRA_THRM |
POWER6_MMCRA_OTHER,
.platform = "power5+",
},
{ /* Power6 */
Expand Down Expand Up @@ -364,14 +356,6 @@ static struct cpu_spec cpu_specs[] = {
.cpu_user_features = COMMON_USER_POWER6,
.icache_bsize = 128,
.dcache_bsize = 128,
.num_pmcs = 6,
.pmc_type = PPC_PMC_IBM,
.oprofile_cpu_type = "ppc64/power6",
.oprofile_type = PPC_OPROFILE_POWER4,
.oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
.oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
.oprofile_mmcra_clear = POWER6_MMCRA_THRM |
POWER6_MMCRA_OTHER,
.platform = "power6",
},
{ /* Cell Broadband Engine */
Expand Down Expand Up @@ -1316,18 +1300,37 @@ static struct cpu_spec cpu_specs[] = {
#endif /* CONFIG_PPC32 */
};

struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr)
static struct cpu_spec the_cpu_spec;

struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr)
{
struct cpu_spec *s = cpu_specs;
struct cpu_spec **cur = &cur_cpu_spec;
struct cpu_spec *t = &the_cpu_spec;
int i;

s = PTRRELOC(s);
cur = PTRRELOC(cur);
t = PTRRELOC(t);

for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
if ((pvr & s->pvr_mask) == s->pvr_value) {
*cur = cpu_specs + i;
/*
* If we are overriding a previous value derived
* from the real PVR with a new value obtained
* using a logical PVR value, don't modify the
* performance monitor fields.
*/
if (t->num_pmcs && !s->num_pmcs) {
t->cpu_name = s->cpu_name;
t->cpu_features = s->cpu_features;
t->cpu_user_features = s->cpu_user_features;
t->icache_bsize = s->icache_bsize;
t->dcache_bsize = s->dcache_bsize;
t->cpu_setup = s->cpu_setup;
t->cpu_restore = s->cpu_restore;
t->platform = s->platform;
} else
*t = *s;
*PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;
#if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE)
/* ppc64 and booke expect identify_cpu to also call
* setup_cpu for that processor. I will consolidate
Expand Down
17 changes: 11 additions & 6 deletions trunk/arch/powerpc/kernel/of_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
#include <linux/mod_devicetable.h>
#include <linux/slab.h>
#include <linux/pci.h>
#include <linux/of_device.h>
#include <linux/of_platform.h>

#include <asm/errno.h>
#include <asm/dcr.h>
#include <asm/of_device.h>
#include <asm/of_platform.h>
#include <asm/topology.h>
#include <asm/pci-bridge.h>
#include <asm/ppc-pci.h>
Expand Down Expand Up @@ -70,7 +70,10 @@ postcore_initcall(of_bus_driver_init);
int of_register_platform_driver(struct of_platform_driver *drv)
{
/* initialize common driver fields */
drv->driver.name = drv->name;
if (!drv->driver.name)
drv->driver.name = drv->name;
if (!drv->driver.owner)
drv->driver.owner = drv->owner;
drv->driver.bus = &of_platform_bus_type;

/* register with core */
Expand Down Expand Up @@ -385,9 +388,11 @@ static struct of_device_id of_pci_phb_ids[] = {
};

static struct of_platform_driver of_pci_phb_driver = {
.name = "of-pci",
.match_table = of_pci_phb_ids,
.probe = of_pci_phb_probe,
.match_table = of_pci_phb_ids,
.probe = of_pci_phb_probe,
.driver = {
.name = "of-pci",
},
};

static __init int of_pci_phb_init(void)
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/powerpc/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,7 @@ static struct ibm_pa_feature {
{CPU_FTR_CTRL, 0, 0, 3, 0},
{CPU_FTR_NOEXECUTE, 0, 0, 6, 0},
{CPU_FTR_NODSISRALIGN, 0, 1, 1, 1},
#if 0
/* put this back once we know how to test if firmware does 64k IO */
{CPU_FTR_CI_LARGE_PAGE, 0, 1, 2, 0},
#endif
{CPU_FTR_REAL_LE, PPC_FEATURE_TRUE_LE, 5, 0, 0},
};

Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/powerpc/kernel/setup_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ void __init setup_arch(char **cmdline_p)
conswitchp = &dummy_con;
#endif

ppc_md.setup_arch();
if (ppc_md.setup_arch)
ppc_md.setup_arch();
if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab);

paging_init();
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/powerpc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,8 @@ void __init setup_arch(char **cmdline_p)
conswitchp = &dummy_con;
#endif

ppc_md.setup_arch();
if (ppc_md.setup_arch)
ppc_md.setup_arch();

paging_init();
ppc64_boot_msg(0x15, "Setup Done");
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/powerpc/kernel/systbl.S
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#ifdef CONFIG_PPC64
#define sys_sigpending sys_ni_syscall
#define sys_old_getrlimit sys_ni_syscall

.p2align 3
#endif

_GLOBAL(sys_call_table)
Expand Down
16 changes: 15 additions & 1 deletion trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static void decrementer_set_mode(enum clock_event_mode mode,
static struct clock_event_device decrementer_clockevent = {
.name = "decrementer",
.rating = 200,
.shift = 32,
.shift = 16,
.mult = 0, /* To be filled in */
.irq = 0,
.set_next_event = decrementer_set_next_event,
Expand All @@ -118,6 +118,7 @@ static struct clock_event_device decrementer_clockevent = {

static DEFINE_PER_CPU(struct clock_event_device, decrementers);
void init_decrementer_clockevent(void);
static DEFINE_PER_CPU(u64, decrementer_next_tb);

#ifdef CONFIG_PPC_ISERIES
static unsigned long __initdata iSeries_recal_titan;
Expand Down Expand Up @@ -541,6 +542,7 @@ void timer_interrupt(struct pt_regs * regs)
struct pt_regs *old_regs;
int cpu = smp_processor_id();
struct clock_event_device *evt = &per_cpu(decrementers, cpu);
u64 now;

/* Ensure a positive value is written to the decrementer, or else
* some CPUs will continuue to take decrementer exceptions */
Expand All @@ -551,6 +553,14 @@ void timer_interrupt(struct pt_regs * regs)
do_IRQ(regs);
#endif

now = get_tb_or_rtc();
if (now < per_cpu(decrementer_next_tb, cpu)) {
/* not time for this event yet */
now = per_cpu(decrementer_next_tb, cpu) - now;
if (now <= DECREMENTER_MAX)
set_dec((unsigned int)now - 1);
return;
}
old_regs = set_irq_regs(regs);
irq_enter();

Expand Down Expand Up @@ -797,6 +807,10 @@ void __init clocksource_init(void)
static int decrementer_set_next_event(unsigned long evt,
struct clock_event_device *dev)
{
__get_cpu_var(decrementer_next_tb) = get_tb_or_rtc() + evt;
/* The decrementer interrupts on the 0 -> -1 transition */
if (evt)
--evt;
set_dec(evt);
return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/powerpc/kernel/vdso.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,9 @@ static int __init vdso_init(void)

return 0;
}
#ifdef CONFIG_PPC_MERGE
arch_initcall(vdso_init);
#endif

int in_gate_area_no_task(unsigned long addr)
{
Expand Down
95 changes: 24 additions & 71 deletions trunk/arch/powerpc/kernel/vio.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,66 +48,33 @@ static struct vio_dev vio_bus_device = { /* fake "parent" device */
.dev.bus = &vio_bus_type,
};

#ifdef CONFIG_PPC_ISERIES
struct device *iSeries_vio_dev = &vio_bus_device.dev;
EXPORT_SYMBOL(iSeries_vio_dev);
static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
{
const unsigned char *dma_window;
struct iommu_table *tbl;
unsigned long offset, size;

static struct iommu_table veth_iommu_table;
static struct iommu_table vio_iommu_table;
if (firmware_has_feature(FW_FEATURE_ISERIES))
return vio_build_iommu_table_iseries(dev);

static void __init iommu_vio_init(void)
{
iommu_table_getparms_iSeries(255, 0, 0xff, &veth_iommu_table);
veth_iommu_table.it_size /= 2;
vio_iommu_table = veth_iommu_table;
vio_iommu_table.it_offset += veth_iommu_table.it_size;

if (!iommu_init_table(&veth_iommu_table, -1))
printk("Virtual Bus VETH TCE table failed.\n");
if (!iommu_init_table(&vio_iommu_table, -1))
printk("Virtual Bus VIO TCE table failed.\n");
vio_bus_device.dev.archdata.dma_ops = &dma_iommu_ops;
vio_bus_device.dev.archdata.dma_data = &vio_iommu_table;
}
#else
static void __init iommu_vio_init(void)
{
}
#endif
dma_window = of_get_property(dev->dev.archdata.of_node,
"ibm,my-dma-window", NULL);
if (!dma_window)
return NULL;

static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
{
#ifdef CONFIG_PPC_ISERIES
if (firmware_has_feature(FW_FEATURE_ISERIES)) {
if (strcmp(dev->type, "network") == 0)
return &veth_iommu_table;
return &vio_iommu_table;
} else
#endif
{
const unsigned char *dma_window;
struct iommu_table *tbl;
unsigned long offset, size;

dma_window = of_get_property(dev->dev.archdata.of_node,
"ibm,my-dma-window", NULL);
if (!dma_window)
return NULL;

tbl = kmalloc(sizeof(*tbl), GFP_KERNEL);

of_parse_dma_window(dev->dev.archdata.of_node, dma_window,
&tbl->it_index, &offset, &size);

/* TCE table size - measured in tce entries */
tbl->it_size = size >> IOMMU_PAGE_SHIFT;
/* offset for VIO should always be 0 */
tbl->it_offset = offset >> IOMMU_PAGE_SHIFT;
tbl->it_busno = 0;
tbl->it_type = TCE_VB;

return iommu_init_table(tbl, -1);
}
tbl = kmalloc(sizeof(*tbl), GFP_KERNEL);

of_parse_dma_window(dev->dev.archdata.of_node, dma_window,
&tbl->it_index, &offset, &size);

/* TCE table size - measured in tce entries */
tbl->it_size = size >> IOMMU_PAGE_SHIFT;
/* offset for VIO should always be 0 */
tbl->it_offset = offset >> IOMMU_PAGE_SHIFT;
tbl->it_busno = 0;
tbl->it_type = TCE_VB;

return iommu_init_table(tbl, -1);
}

/**
Expand Down Expand Up @@ -168,16 +135,6 @@ static int vio_bus_remove(struct device *dev)
return 1;
}

/* convert from struct device to struct vio_dev and pass to driver. */
static void vio_bus_shutdown(struct device *dev)
{
struct vio_dev *viodev = to_vio_dev(dev);
struct vio_driver *viodrv = to_vio_driver(dev->driver);

if (dev->driver && viodrv->shutdown)
viodrv->shutdown(viodev);
}

/**
* vio_register_driver: - Register a new vio driver
* @drv: The vio_driver structure to be registered.
Expand Down Expand Up @@ -290,9 +247,6 @@ static int __init vio_bus_init(void)
int err;
struct device_node *node_vroot;

if (firmware_has_feature(FW_FEATURE_ISERIES))
iommu_vio_init();

err = bus_register(&vio_bus_type);
if (err) {
printk(KERN_ERR "failed to register VIO bus\n");
Expand Down Expand Up @@ -397,7 +351,6 @@ static struct bus_type vio_bus_type = {
.match = vio_bus_match,
.probe = vio_bus_probe,
.remove = vio_bus_remove,
.shutdown = vio_bus_shutdown,
};

/**
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/powerpc/oprofile/cell/pr_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
#include <linux/cpumask.h>
#include <linux/oprofile.h>
#include <asm/cell-pmu.h>
#include <asm/cell-regs.h>
#include <asm/spu.h>

#include "../../platforms/cell/cbe_regs.h"

/* Defines used for sync_start */
#define SKIP_GENERIC_SYNC 0
#define SYNC_START_ERROR -1
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/oprofile/op_model_cell.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
#include <asm/reg.h>
#include <asm/rtas.h>
#include <asm/system.h>
#include <asm/cell-regs.h>

#include "../platforms/cell/interrupt.h"
#include "../platforms/cell/cbe_regs.h"
#include "cell/pr_util.h"

static void cell_global_stop_spu(void);
Expand Down
Loading

0 comments on commit d776eb2

Please sign in to comment.