Skip to content

Commit

Permalink
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/paulus/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
  [POWERPC] Fix SLB initialization at boot time
  [POWERPC] Fix undefined reference to device_power_up/resume
  [POWERPC] cell: Update cell_defconfig for 2.6.23
  [POWERPC] axonram: Do not delete gendisks queue in error path
  [POWERPC] axonram: Module modification for latest firmware API changes
  [POWERPC] cell: Support pinhole-reset on IBM cell blades
  [POWERPC] spu_manage: Use newer physical-id attribute
  [POWERPC] pasemi: Another IOMMU bugfix for 64K PAGE_SIZE
  • Loading branch information
Linus Torvalds committed Aug 27, 2007
2 parents d96a2a5 + 175587c commit 9666582
Show file tree
Hide file tree
Showing 11 changed files with 172 additions and 218 deletions.
220 changes: 76 additions & 144 deletions arch/powerpc/configs/cell_defconfig

Large diffs are not rendered by default.

36 changes: 28 additions & 8 deletions arch/powerpc/mm/slb.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,22 @@ static inline void slb_shadow_clear(unsigned long entry)
get_slb_shadow()->save_area[entry].esid = 0;
}

static inline void create_shadowed_slbe(unsigned long ea, unsigned long flags,
unsigned long entry)
{
/*
* Updating the shadow buffer before writing the SLB ensures
* we don't get a stale entry here if we get preempted by PHYP
* between these two statements.
*/
slb_shadow_update(ea, flags, entry);

asm volatile("slbmte %0,%1" :
: "r" (mk_vsid_data(ea, flags)),
"r" (mk_esid_data(ea, entry))
: "memory" );
}

void slb_flush_and_rebolt(void)
{
/* If you change this make sure you change SLB_NUM_BOLTED
Expand Down Expand Up @@ -226,12 +242,16 @@ void slb_initialize(void)
vflags = SLB_VSID_KERNEL | vmalloc_llp;

/* Invalidate the entire SLB (even slot 0) & all the ERATS */
slb_shadow_update(PAGE_OFFSET, lflags, 0);
asm volatile("isync; slbia; sync; slbmte %0,%1; isync" ::
"r" (get_slb_shadow()->save_area[0].vsid),
"r" (get_slb_shadow()->save_area[0].esid) : "memory");

slb_shadow_update(VMALLOC_START, vflags, 1);

slb_flush_and_rebolt();
asm volatile("isync":::"memory");
asm volatile("slbmte %0,%0"::"r" (0) : "memory");
asm volatile("isync; slbia; isync":::"memory");
create_shadowed_slbe(PAGE_OFFSET, lflags, 0);

create_shadowed_slbe(VMALLOC_START, vflags, 1);

/* We don't bolt the stack for the time being - we're in boot,
* so the stack is in the bolted segment. By the time it goes
* elsewhere, we'll call _switch() which will bolt in the new
* one. */
asm volatile("isync":::"memory");
}
8 changes: 6 additions & 2 deletions arch/powerpc/platforms/cell/cbe_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,14 @@ struct cbe_pmd_regs {
u64 checkstop_fir; /* 0x0c00 */
u64 recoverable_fir; /* 0x0c08 */
u64 spec_att_mchk_fir; /* 0x0c10 */
u64 fir_mode_reg; /* 0x0c18 */
u32 fir_mode_reg; /* 0x0c18 */
u8 pad_0x0c1c_0x0c20 [4]; /* 0x0c1c */
#define CBE_PMD_FIR_MODE_M8 0x00800
u64 fir_enable_mask; /* 0x0c20 */

u8 pad_0x0c28_0x1000 [0x1000 - 0x0c28]; /* 0x0c28 */
u8 pad_0x0c28_0x0ca8 [0x0ca8 - 0x0c28]; /* 0x0c28 */
u64 ras_esc_0; /* 0x0ca8 */
u8 pad_0x0cb0_0x1000 [0x1000 - 0x0cb0]; /* 0x0cb0 */
};

extern struct cbe_pmd_regs __iomem *cbe_get_pmd_regs(struct device_node *np);
Expand Down
6 changes: 1 addition & 5 deletions arch/powerpc/platforms/cell/cbe_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,13 @@ static struct cbe_pmd_regs __iomem *get_pmd_regs(struct sys_device *sysdev)
/* returns the value for a given spu in a given register */
static u8 spu_read_register_value(struct sys_device *sysdev, union spe_reg __iomem *reg)
{
const unsigned int *id;
union spe_reg value;
struct spu *spu;

/* getting the id from the reg attribute will not work on future device-tree layouts
* in future we should store the id to the spu struct and use it here */
spu = container_of(sysdev, struct spu, sysdev);
id = of_get_property(spu_devnode(spu), "reg", NULL);
value.val = in_be64(&reg->val);

return value.spe[*id];
return value.spe[spu->spe_id];
}

static ssize_t spu_show_temp(struct sys_device *sysdev, char *buf)
Expand Down
26 changes: 26 additions & 0 deletions arch/powerpc/platforms/cell/pervasive.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include "pervasive.h"
#include "cbe_regs.h"

static int sysreset_hack;

static void cbe_power_save(void)
{
unsigned long ctrl, thread_switch_control;
Expand Down Expand Up @@ -85,6 +87,9 @@ static void cbe_power_save(void)

static int cbe_system_reset_exception(struct pt_regs *regs)
{
int cpu;
struct cbe_pmd_regs __iomem *pmd;

switch (regs->msr & SRR1_WAKEMASK) {
case SRR1_WAKEEE:
do_IRQ(regs);
Expand All @@ -93,6 +98,18 @@ static int cbe_system_reset_exception(struct pt_regs *regs)
timer_interrupt(regs);
break;
case SRR1_WAKEMT:
/*
* The BMC can inject user triggered system reset exceptions,
* but cannot set the system reset reason in srr1,
* so check an extra register here.
*/
if (sysreset_hack && (cpu = smp_processor_id()) == 0) {
pmd = cbe_get_cpu_pmd_regs(cpu);
if (in_be64(&pmd->ras_esc_0) & 0xffff) {
out_be64(&pmd->ras_esc_0, 0);
return 0;
}
}
break;
#ifdef CONFIG_CBE_RAS
case SRR1_WAKESYSERR:
Expand All @@ -113,9 +130,12 @@ static int cbe_system_reset_exception(struct pt_regs *regs)
void __init cbe_pervasive_init(void)
{
int cpu;

if (!cpu_has_feature(CPU_FTR_PAUSE_ZERO))
return;

sysreset_hack = machine_is_compatible("IBM,CBPLUS-1.0");

for_each_possible_cpu(cpu) {
struct cbe_pmd_regs __iomem *regs = cbe_get_cpu_pmd_regs(cpu);
if (!regs)
Expand All @@ -124,6 +144,12 @@ void __init cbe_pervasive_init(void)
/* Enable Pause(0) control bit */
out_be64(&regs->pmcr, in_be64(&regs->pmcr) |
CBE_PMD_PAUSE_ZERO_CONTROL);

/* Enable JTAG system-reset hack */
if (sysreset_hack)
out_be32(&regs->fir_mode_reg,
in_be32(&regs->fir_mode_reg) |
CBE_PMD_FIR_MODE_M8);
}

ppc_md.power_save = cbe_power_save;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/cell/spu_manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static u64 __init find_spu_unit_number(struct device_node *spe)
{
const unsigned int *prop;
int proplen;
prop = of_get_property(spe, "unit-id", &proplen);
prop = of_get_property(spe, "physical-id", &proplen);
if (proplen == 4)
return (u64)*prop;

Expand Down
6 changes: 3 additions & 3 deletions arch/powerpc/platforms/pasemi/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static void iobmap_build(struct iommu_table *tbl, long index,

pr_debug("iobmap: build at: %lx, %lx, addr: %lx\n", index, npages, uaddr);

bus_addr = (tbl->it_offset + index) << PAGE_SHIFT;
bus_addr = (tbl->it_offset + index) << IOBMAP_PAGE_SHIFT;

ip = ((u32 *)tbl->it_base) + index;

Expand All @@ -118,7 +118,7 @@ static void iobmap_free(struct iommu_table *tbl, long index,

pr_debug("iobmap: free at: %lx, %lx\n", index, npages);

bus_addr = (tbl->it_offset + index) << PAGE_SHIFT;
bus_addr = (tbl->it_offset + index) << IOBMAP_PAGE_SHIFT;

ip = ((u32 *)tbl->it_base) + index;

Expand All @@ -137,7 +137,7 @@ static void iommu_table_iobmap_setup(void)
iommu_table_iobmap.it_busno = 0;
iommu_table_iobmap.it_offset = 0;
/* it_size is in number of entries */
iommu_table_iobmap.it_size = 0x80000000 >> PAGE_SHIFT;
iommu_table_iobmap.it_size = 0x80000000 >> IOBMAP_PAGE_SHIFT;

/* Initialize the common IOMMU code */
iommu_table_iobmap.it_base = (unsigned long)iob_l2_base;
Expand Down
46 changes: 11 additions & 35 deletions arch/powerpc/sysdev/axonram.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@
struct axon_ram_bank {
struct of_device *device;
struct gendisk *disk;
unsigned int irq_correctable;
unsigned int irq_uncorrectable;
unsigned int irq_id;
unsigned long ph_addr;
unsigned long io_addr;
unsigned long size;
Expand Down Expand Up @@ -93,16 +92,9 @@ axon_ram_irq_handler(int irq, void *dev)

BUG_ON(!bank);

if (irq == bank->irq_correctable) {
dev_err(&device->dev, "Correctable memory error occured\n");
bank->ecc_counter++;
return IRQ_HANDLED;
} else if (irq == bank->irq_uncorrectable) {
dev_err(&device->dev, "Uncorrectable memory error occured\n");
panic("Critical ECC error on %s", device->node->full_name);
}

return IRQ_NONE;
dev_err(&device->dev, "Correctable memory error occured\n");
bank->ecc_counter++;
return IRQ_HANDLED;
}

/**
Expand Down Expand Up @@ -259,28 +251,18 @@ axon_ram_probe(struct of_device *device, const struct of_device_id *device_id)
blk_queue_hardsect_size(bank->disk->queue, AXON_RAM_SECTOR_SIZE);
add_disk(bank->disk);

bank->irq_correctable = irq_of_parse_and_map(device->node, 0);
bank->irq_uncorrectable = irq_of_parse_and_map(device->node, 1);
if ((bank->irq_correctable <= 0) || (bank->irq_uncorrectable <= 0)) {
bank->irq_id = irq_of_parse_and_map(device->node, 0);
if (bank->irq_id == NO_IRQ) {
dev_err(&device->dev, "Cannot access ECC interrupt ID\n");
rc = -EFAULT;
goto failed;
}

rc = request_irq(bank->irq_correctable, axon_ram_irq_handler,
AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device);
if (rc != 0) {
dev_err(&device->dev, "Cannot register ECC interrupt handler\n");
bank->irq_correctable = bank->irq_uncorrectable = 0;
rc = -EFAULT;
goto failed;
}

rc = request_irq(bank->irq_uncorrectable, axon_ram_irq_handler,
rc = request_irq(bank->irq_id, axon_ram_irq_handler,
AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device);
if (rc != 0) {
dev_err(&device->dev, "Cannot register ECC interrupt handler\n");
bank->irq_uncorrectable = 0;
bank->irq_id = NO_IRQ;
rc = -EFAULT;
goto failed;
}
Expand All @@ -296,13 +278,9 @@ axon_ram_probe(struct of_device *device, const struct of_device_id *device_id)

failed:
if (bank != NULL) {
if (bank->irq_uncorrectable > 0)
free_irq(bank->irq_uncorrectable, device);
if (bank->irq_correctable > 0)
free_irq(bank->irq_correctable, device);
if (bank->irq_id != NO_IRQ)
free_irq(bank->irq_id, device);
if (bank->disk != NULL) {
if (bank->disk->queue != NULL)
blk_cleanup_queue(bank->disk->queue);
if (bank->disk->major > 0)
unregister_blkdev(bank->disk->major,
bank->disk->disk_name);
Expand All @@ -329,9 +307,7 @@ axon_ram_remove(struct of_device *device)
BUG_ON(!bank || !bank->disk);

device_remove_file(&device->dev, &dev_attr_ecc);
free_irq(bank->irq_uncorrectable, device);
free_irq(bank->irq_correctable, device);
blk_cleanup_queue(bank->disk->queue);
free_irq(bank->irq_id, device);
unregister_blkdev(bank->disk->major, bank->disk->disk_name);
del_gendisk(bank->disk);
iounmap((void __iomem *) bank->io_addr);
Expand Down
4 changes: 2 additions & 2 deletions drivers/macintosh/adb.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static int sleepy_trackpad;
static int autopoll_devs;
int __adb_probe_sync;

#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
static void adb_notify_sleep(struct pmu_sleep_notifier *self, int when);
static struct pmu_sleep_notifier adb_sleep_notifier = {
adb_notify_sleep,
Expand Down Expand Up @@ -313,7 +313,7 @@ int __init adb_init(void)
printk(KERN_WARNING "Warning: no ADB interface detected\n");
adb_controller = NULL;
} else {
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
pmu_register_sleep_notifier(&adb_sleep_notifier);
#endif /* CONFIG_PM */
#ifdef CONFIG_PPC
Expand Down
Loading

0 comments on commit 9666582

Please sign in to comment.