Commit 5576d187 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'merge' of master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc

* 'merge' of master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc:
  [POWERPC] Fix register save area alignment for swapcontext syscall
  [POWERPC] Fix PCI device channel state initialization
  [POWERPC] Update MTD OF documentation
  [POWERPC] Probe Efika platform before CHRP.
  [POWERPC] Fix build of cell zImage.initrd
  [POWERPC] iSeries: fix CONFIG_VIOPATH dependency
  [POWERPC] iSeries: fix viocons init
  [POWERPC] iSeries: fix viocd init
  [POWERPC] iSeries: fix iseries_veth init
  [POWERPC] iSeries: fix viotape init
  [POWERPC] iSeries: fix viodasd init
  [POWERPC] Workaround oldworld OF bug with IRQs & P2P bridges
  [POWERPC] powerpc: add scanning of ebc bus to of_platform
  [POWERPC] spufs: fix assignment of node numbers
  [POWERPC] cell: Fix spufs with "new style" device-tree
  [POWERPC] cell: Enable spider workarounds on all PCI buses
  [POWERPC] cell: add forward struct declarations to spu.h
  [POWERPC] cell: update cell_defconfig
parents ee2fae03 1c9bb1a0
......@@ -1703,29 +1703,32 @@ platforms are moved over to use the flattened-device-tree model.
Required properties:
- device_type : has to be "rom"
- compatible : Should specify what this ROM device is compatible with
(i.e. "onenand"). Currently, this is most likely to be "direct-mapped"
(which corresponds to the MTD physmap mapping driver).
- regs : Offset and length of the register set (or memory mapping) for
- compatible : Should specify what this flash device is compatible with.
Currently, this is most likely to be "direct-mapped" (which
corresponds to the MTD physmap mapping driver).
- reg : Offset and length of the register set (or memory mapping) for
the device.
- bank-width : Width of the flash data bus in bytes. Required
for the NOR flashes (compatible == "direct-mapped" and others) ONLY.
Recommended properties :
- bank-width : Width of the flash data bus in bytes. Required
for the NOR flashes (compatible == "direct-mapped" and others) ONLY.
- partitions : Several pairs of 32-bit values where the first value is
partition's offset from the start of the device and the second one is
partition size in bytes with LSB used to signify a read only
partititon (so, the parition size should always be an even number).
partition (so, the parition size should always be an even number).
- partition-names : The list of concatenated zero terminated strings
representing the partition names.
- probe-type : The type of probe which should be done for the chip
(JEDEC vs CFI actually). Valid ONLY for NOR flashes.
Example:
flash@ff000000 {
device_type = "rom";
compatible = "direct-mapped";
regs = <ff000000 01000000>;
probe-type = "CFI";
reg = <ff000000 01000000>;
bank-width = <4>;
partitions = <00000000 00f80000
00f80000 00080001>;
......
......@@ -152,6 +152,9 @@ $(obj)/zImage.initrd.miboot: vmlinux $(wrapperbits)
$(obj)/zImage.ps3: vmlinux
$(STRIP) -s -R .comment $< -o $@
$(obj)/zImage.initrd.ps3: vmlinux
@echo " WARNING zImage.initrd.ps3 not supported (yet)"
$(obj)/uImage: vmlinux $(wrapperbits)
$(call cmd,wrap,uboot)
......
This diff is collapsed.
......@@ -50,6 +50,7 @@ static struct of_device_id of_default_bus_ids[] = {
{ .type = "plb5", },
{ .type = "plb4", },
{ .type = "opb", },
{ .type = "ebc", },
{},
};
......
......@@ -360,6 +360,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
DBG(" class: 0x%x\n", dev->class);
dev->current_state = 4; /* unknown power state */
dev->error_state = pci_channel_io_normal;
if (!strcmp(type, "pci") || !strcmp(type, "pciex")) {
/* a PCI-PCI bridge */
......
......@@ -920,9 +920,20 @@ static int of_irq_map_oldworld(struct device_node *device, int index,
/*
* Old machines just have a list of interrupt numbers
* and no interrupt-controller nodes.
* and no interrupt-controller nodes. We also have dodgy
* cases where the APPL,interrupts property is completely
* missing behind pci-pci bridges and we have to get it
* from the parent (the bridge itself, as apple just wired
* everything together on these)
*/
while (device) {
ints = get_property(device, "AAPL,interrupts", &intlen);
if (ints != NULL)
break;
device = device->parent;
if (device && strcmp(device->type, "pci") != 0)
break;
}
if (ints == NULL)
return -EINVAL;
intlen /= sizeof(u32);
......
......@@ -835,11 +835,21 @@ long sys_swapcontext(struct ucontext __user *old_ctx,
return -EINVAL;
if (old_ctx != NULL) {
struct mcontext __user *mctx;
/*
* old_ctx might not be 16-byte aligned, in which
* case old_ctx->uc_mcontext won't be either.
* Because we have the old_ctx->uc_pad2 field
* before old_ctx->uc_mcontext, we need to round down
* from &old_ctx->uc_mcontext to a 16-byte boundary.
*/
mctx = (struct mcontext __user *)
((unsigned long) &old_ctx->uc_mcontext & ~0xfUL);
if (!access_ok(VERIFY_WRITE, old_ctx, sizeof(*old_ctx))
|| save_user_regs(regs, &old_ctx->uc_mcontext, 0)
|| save_user_regs(regs, mctx, 0)
|| put_sigset_t(&old_ctx->uc_sigmask, &current->blocked)
|| __put_user(to_user_ptr(&old_ctx->uc_mcontext),
&old_ctx->uc_regs))
|| __put_user(to_user_ptr(mctx), &old_ctx->uc_regs))
return -EFAULT;
}
if (new_ctx == NULL)
......
......@@ -5,9 +5,9 @@ ifeq ($(CONFIG_PPC64),y)
obj-$(CONFIG_PPC_PMAC) += powermac/
endif
endif
obj-$(CONFIG_PPC_MPC52xx) += 52xx/
obj-$(CONFIG_PPC_CHRP) += chrp/
obj-$(CONFIG_4xx) += 4xx/
obj-$(CONFIG_PPC_MPC52xx) += 52xx/
obj-$(CONFIG_PPC_83xx) += 83xx/
obj-$(CONFIG_PPC_85xx) += 85xx/
obj-$(CONFIG_PPC_86xx) += 86xx/
......
......@@ -37,7 +37,7 @@
*/
#define SPIDER_DISABLE_PREFETCH
#define MAX_SPIDERS 2
#define MAX_SPIDERS 3
static struct spider_pci_bus {
void __iomem *regs;
......
......@@ -37,8 +37,9 @@
#include "interrupt.h"
#include "spu_priv1_mmio.h"
static DEFINE_MUTEX(add_spumem_mutex);
struct spu_pdata {
int nid;
struct device_node *devnode;
struct spu_priv1 __iomem *priv1;
};
......@@ -56,20 +57,9 @@ struct device_node *spu_devnode(struct spu *spu)
EXPORT_SYMBOL_GPL(spu_devnode);
static int __init find_spu_node_id(struct device_node *spe)
{
const unsigned int *id;
struct device_node *cpu;
cpu = spe->parent->parent;
id = get_property(cpu, "node-id", NULL);
return id ? *id : 0;
}
static int __init cell_spuprop_present(struct spu *spu, struct device_node *spe,
const char *prop)
{
static DEFINE_MUTEX(add_spumem_mutex);
const struct address_prop {
unsigned long address;
unsigned int len;
......@@ -87,7 +77,7 @@ static int __init cell_spuprop_present(struct spu *spu, struct device_node *spe,
start_pfn = p->address >> PAGE_SHIFT;
nr_pages = ((unsigned long)p->len + PAGE_SIZE - 1) >> PAGE_SHIFT;
pgdata = NODE_DATA(spu_get_pdata(spu)->nid);
pgdata = NODE_DATA(spu->node);
zone = pgdata->node_zones;
/* XXX rethink locking here */
......@@ -140,6 +130,7 @@ static int __init spu_map_interrupts_old(struct spu *spu,
{
unsigned int isrc;
const u32 *tmp;
int nid;
/* Get the interrupt source unit from the device-tree */
tmp = get_property(np, "isrc", NULL);
......@@ -147,8 +138,15 @@ static int __init spu_map_interrupts_old(struct spu *spu,
return -ENODEV;
isrc = tmp[0];
tmp = get_property(np->parent->parent, "node-id", NULL);
if (!tmp) {
printk(KERN_WARNING "%s: can't find node-id\n", __FUNCTION__);
nid = spu->node;
} else
nid = tmp[0];
/* Add the node number */
isrc |= spu->node << IIC_IRQ_NODE_SHIFT;
isrc |= nid << IIC_IRQ_NODE_SHIFT;
/* Now map interrupts of all 3 classes */
spu->irqs[0] = irq_create_mapping(NULL, IIC_IRQ_CLASS_0 | isrc);
......@@ -237,63 +235,81 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
return ret;
}
static int spu_map_resource(struct device_node *node, int nr,
static int spu_map_resource(struct spu *spu, int nr,
void __iomem** virt, unsigned long *phys)
{
struct device_node *np = spu_get_pdata(spu)->devnode;
unsigned long start_pfn, nr_pages;
struct pglist_data *pgdata;
struct zone *zone;
struct resource resource = { };
unsigned long len;
int ret;
ret = of_address_to_resource(node, nr, &resource);
ret = of_address_to_resource(np, nr, &resource);
if (ret)
goto out;
if (phys)
*phys = resource.start;
*virt = ioremap(resource.start, resource.end - resource.start);
len = resource.end - resource.start + 1;
*virt = ioremap(resource.start, len);
if (!*virt)
ret = -EINVAL;
start_pfn = resource.start >> PAGE_SHIFT;
nr_pages = (len + PAGE_SIZE - 1) >> PAGE_SHIFT;
pgdata = NODE_DATA(spu->node);
zone = pgdata->node_zones;
/* XXX rethink locking here */
mutex_lock(&add_spumem_mutex);
ret = __add_pages(zone, start_pfn, nr_pages);
mutex_unlock(&add_spumem_mutex);
out:
return ret;
}
static int __init spu_map_device(struct spu *spu, struct device_node *node)
static int __init spu_map_device(struct spu *spu)
{
struct device_node *np = spu_get_pdata(spu)->devnode;
int ret = -ENODEV;
spu->name = get_property(node, "name", NULL);
spu->name = get_property(np, "name", NULL);
if (!spu->name)
goto out;
ret = spu_map_resource(node, 0, (void __iomem**)&spu->local_store,
ret = spu_map_resource(spu, 0, (void __iomem**)&spu->local_store,
&spu->local_store_phys);
if (ret) {
pr_debug("spu_new: failed to map %s resource 0\n",
node->full_name);
np->full_name);
goto out;
}
ret = spu_map_resource(node, 1, (void __iomem**)&spu->problem,
ret = spu_map_resource(spu, 1, (void __iomem**)&spu->problem,
&spu->problem_phys);
if (ret) {
pr_debug("spu_new: failed to map %s resource 1\n",
node->full_name);
np->full_name);
goto out_unmap;
}
ret = spu_map_resource(node, 2, (void __iomem**)&spu->priv2,
NULL);
ret = spu_map_resource(spu, 2, (void __iomem**)&spu->priv2, NULL);
if (ret) {
pr_debug("spu_new: failed to map %s resource 2\n",
node->full_name);
np->full_name);
goto out_unmap;
}
if (!firmware_has_feature(FW_FEATURE_LPAR))
ret = spu_map_resource(node, 3,
ret = spu_map_resource(spu, 3,
(void __iomem**)&spu_get_pdata(spu)->priv1, NULL);
if (ret) {
pr_debug("spu_new: failed to map %s resource 3\n",
node->full_name);
np->full_name);
goto out_unmap;
}
pr_debug("spu_new: %s maps:\n", node->full_name);
pr_debug("spu_new: %s maps:\n", np->full_name);
pr_debug(" local store : 0x%016lx -> 0x%p\n",
spu->local_store_phys, spu->local_store);
pr_debug(" problem state : 0x%016lx -> 0x%p\n",
......@@ -340,8 +356,9 @@ static int __init of_create_spu(struct spu *spu, void *data)
ret = -ENOMEM;
goto out;
}
spu_get_pdata(spu)->devnode = of_node_get(spe);
spu->node = find_spu_node_id(spe);
spu->node = of_node_to_nid(spe);
if (spu->node >= MAX_NUMNODES) {
printk(KERN_WARNING "SPE %s on node %d ignored,"
" node number too big\n", spe->full_name, spu->node);
......@@ -350,11 +367,7 @@ static int __init of_create_spu(struct spu *spu, void *data)
goto out_free;
}
spu_get_pdata(spu)->nid = of_node_to_nid(spe);
if (spu_get_pdata(spu)->nid == -1)
spu_get_pdata(spu)->nid = 0;
ret = spu_map_device(spu, spe);
ret = spu_map_device(spu);
/* try old method */
if (ret)
ret = spu_map_device_old(spu, spe);
......@@ -367,8 +380,6 @@ static int __init of_create_spu(struct spu *spu, void *data)
if (ret)
goto out_unmap;
spu_get_pdata(spu)->devnode = of_node_get(spe);
pr_debug(KERN_DEBUG "Using SPE %s %p %p %p %p %d\n", spu->name,
spu->local_store, spu->problem, spu_get_pdata(spu)->priv1,
spu->priv2, spu->number);
......
......@@ -31,5 +31,5 @@ endmenu
config VIOPATH
bool
depends on VIOCONS || VIODASD || VIOCD || VIOTAPE || VETH
depends on VIOCONS || VIODASD || VIOCD || VIOTAPE || ISERIES_VETH
default y
......@@ -49,6 +49,7 @@
#include <asm/iseries/hv_lp_event.h>
#include <asm/iseries/hv_lp_config.h>
#include <asm/iseries/vio.h>
#include <asm/firmware.h>
MODULE_DESCRIPTION("iSeries Virtual DASD");
MODULE_AUTHOR("Dave Boutcher");
......@@ -769,6 +770,11 @@ static int __init viodasd_init(void)
{
int rc;
if (!firmware_has_feature(FW_FEATURE_ISERIES)) {
rc = -ENODEV;
goto early_fail;
}
/* Try to open to our host lp */
if (viopath_hostLp == HvLpIndexInvalid)
vio_set_hostlp();
......
......@@ -47,6 +47,7 @@
#include <asm/iseries/hv_types.h>
#include <asm/iseries/hv_lp_event.h>
#include <asm/iseries/vio.h>
#include <asm/firmware.h>
#define VIOCD_DEVICE "iseries/vcd"
......@@ -748,6 +749,9 @@ static int __init viocd_init(void)
struct proc_dir_entry *e;
int ret = 0;
if (!firmware_has_feature(FW_FEATURE_ISERIES))
return -ENODEV;
if (viopath_hostLp == HvLpIndexInvalid) {
vio_set_hostlp();
/* If we don't have a host, bail out */
......
......@@ -42,6 +42,7 @@
#include <linux/tty_flip.h>
#include <linux/sysrq.h>
#include <asm/firmware.h>
#include <asm/iseries/vio.h>
#include <asm/iseries/hv_lp_event.h>
#include <asm/iseries/hv_call_event.h>
......@@ -1060,6 +1061,9 @@ static int __init viocons_init2(void)
atomic_t wait_flag;
int rc;
if (!firmware_has_feature(FW_FEATURE_ISERIES))
return -ENODEV;
/* +2 for fudge */
rc = viopath_open(HvLpConfig_getPrimaryLpIndex(),
viomajorsubtype_chario, VIOCHAR_WINDOW + 2);
......@@ -1145,6 +1149,9 @@ static int __init viocons_init(void)
{
int i;
if (!firmware_has_feature(FW_FEATURE_ISERIES))
return -ENODEV;
printk(VIOCONS_KERN_INFO "registering console\n");
for (i = 0; i < VTTY_PORTS; i++) {
port_info[i].lp = HvLpIndexInvalid;
......
......@@ -49,7 +49,7 @@
#include <asm/uaccess.h>
#include <asm/ioctls.h>
#include <asm/firmware.h>
#include <asm/vio.h>
#include <asm/iseries/vio.h>
#include <asm/iseries/hv_lp_event.h>
......@@ -997,6 +997,9 @@ int __init viotap_init(void)
int ret;
struct proc_dir_entry *e;
if (!firmware_has_feature(FW_FEATURE_ISERIES))
return -ENODEV;
op_struct_list = NULL;
if ((ret = add_op_structs(VIOTAPE_MAXREQ)) < 0) {
printk(VIOTAPE_KERN_WARN "couldn't allocate op structs\n");
......
......@@ -73,7 +73,7 @@
#include <asm/abs_addr.h>
#include <asm/iseries/mf.h>
#include <asm/uaccess.h>
#include <asm/firmware.h>
#include <asm/iseries/hv_lp_config.h>
#include <asm/iseries/hv_types.h>
#include <asm/iseries/hv_lp_event.h>
......@@ -1668,7 +1668,7 @@ static struct vio_driver veth_driver = {
* Module initialization/cleanup
*/
void __exit veth_module_cleanup(void)
static void __exit veth_module_cleanup(void)
{
int i;
struct veth_lpar_connection *cnx;
......@@ -1697,11 +1697,14 @@ void __exit veth_module_cleanup(void)
}
module_exit(veth_module_cleanup);
int __init veth_module_init(void)
static int __init veth_module_init(void)
{
int i;
int rc;
if (!firmware_has_feature(FW_FEATURE_ISERIES))
return -ENODEV;
this_lp = HvLpConfig_getLpIndex_outline();
for (i = 0; i < HVMAXARCHITECTEDLPS; ++i) {
......
......@@ -161,6 +161,7 @@ struct spu_syscall_block {
extern long spu_sys_callback(struct spu_syscall_block *s);
/* syscalls implemented in spufs */
struct file;
extern struct spufs_calls {
asmlinkage long (*create_thread)(const char __user *name,
unsigned int flags, mode_t mode);
......@@ -232,6 +233,7 @@ void spu_remove_sysdev_attr_group(struct attribute_group *attrs);
* to object-id spufs file from user space and the notifer
* function can assume that spu->ctx is valid.
*/
struct notifier_block;
int spu_switch_event_register(struct notifier_block * n);
int spu_switch_event_unregister(struct notifier_block * 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