Commit 867a89e0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
  [RAPIDIO] Change RapidIO doorbell source and target ID field to 16-bit
  [RAPIDIO] Add RapidIO connection info print out and re-training for broken connections
  [RAPIDIO] Add serial RapidIO controller support, which includes MPC8548, MPC8641
  [RAPIDIO] Add RapidIO node probing into MPC86xx_HPCN board id table
  [RAPIDIO] Add RapidIO node into MPC8641HPCN dts file
  [RAPIDIO] Auto-probe the RapidIO system size
  [RAPIDIO] Add OF-tree support to RapidIO controller driver
  [RAPIDIO] Add RapidIO multi mport support
  [RAPIDIO] Move include/asm-ppc/rio.h to asm-powerpc
  [RAPIDIO] Add RapidIO option to kernel configuration
  [RAPIDIO] Change RIO function mpc85xx_ to fsl_
  [POWERPC] Provide walk_memory_resource() for powerpc
  [POWERPC] Update lmb data structures for hotplug memory add/remove
  [POWERPC] Hotplug memory remove notifications for powerpc
  [POWERPC] windfarm: Add PowerMac 12,1 support
  [POWERPC] Fix building of pmac32 when CONFIG_NVRAM=m
  [POWERPC] Add IRQSTACKS support on ppc32
  [POWERPC] Use __always_inline for xchg* and cmpxchg*
  [POWERPC] Add fast little-endian switch system call
parents 44473d99 6c39103c
This diff is collapsed.
/*
* MPC85xx RapidIO definitions
*
* Copyright 2005 MontaVista Software, Inc.
* Matt Porter <mporter@kernel.crashing.org>
*
* 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_SYSLIB_PPC85XX_RIO_H
#define __PPC_SYSLIB_PPC85XX_RIO_H
#include <linux/init.h>
extern void mpc85xx_rio_setup(int law_start, int law_size);
#endif /* __PPC_SYSLIB_PPC85XX_RIO_H */
...@@ -234,6 +234,14 @@ config WINDFARM_PM112 ...@@ -234,6 +234,14 @@ config WINDFARM_PM112
which are the recent dual and quad G5 machines using the which are the recent dual and quad G5 machines using the
970MP dual-core processor. 970MP dual-core processor.
config WINDFARM_PM121
tristate "Support for thermal management on PowerMac12,1"
depends on WINDFARM && I2C && PMAC_SMU
select I2C_POWERMAC
help
This driver provides thermal control for the PowerMac12,1
which is the iMac G5 (iSight).
config ANSLCD config ANSLCD
tristate "Support for ANS LCD display" tristate "Support for ANS LCD display"
depends on ADB_CUDA && PPC_PMAC depends on ADB_CUDA && PPC_PMAC
......
...@@ -42,4 +42,9 @@ obj-$(CONFIG_WINDFARM_PM112) += windfarm_pm112.o windfarm_smu_sat.o \ ...@@ -42,4 +42,9 @@ obj-$(CONFIG_WINDFARM_PM112) += windfarm_pm112.o windfarm_smu_sat.o \
windfarm_smu_sensors.o \ windfarm_smu_sensors.o \
windfarm_max6690_sensor.o \ windfarm_max6690_sensor.o \
windfarm_lm75_sensor.o windfarm_pid.o windfarm_lm75_sensor.o windfarm_pid.o
obj-$(CONFIG_WINDFARM_PM121) += windfarm_pm121.o windfarm_smu_sat.o \
windfarm_smu_controls.o \
windfarm_smu_sensors.o \
windfarm_max6690_sensor.o \
windfarm_lm75_sensor.o windfarm_pid.o
obj-$(CONFIG_PMAC_RACKMETER) += rack-meter.o obj-$(CONFIG_PMAC_RACKMETER) += rack-meter.o
...@@ -127,6 +127,12 @@ static struct wf_lm75_sensor *wf_lm75_create(struct i2c_adapter *adapter, ...@@ -127,6 +127,12 @@ static struct wf_lm75_sensor *wf_lm75_create(struct i2c_adapter *adapter,
*/ */
if (!strcmp(loc, "Hard drive") || !strcmp(loc, "DRIVE BAY")) if (!strcmp(loc, "Hard drive") || !strcmp(loc, "DRIVE BAY"))
lm->sens.name = "hd-temp"; lm->sens.name = "hd-temp";
else if (!strcmp(loc, "Incoming Air Temp"))
lm->sens.name = "incoming-air-temp";
else if (!strcmp(loc, "ODD Temp"))
lm->sens.name = "optical-drive-temp";
else if (!strcmp(loc, "HD Temp"))
lm->sens.name = "hard-drive-temp";
else else
goto fail; goto fail;
......
...@@ -77,18 +77,28 @@ static struct wf_sensor_ops wf_max6690_ops = { ...@@ -77,18 +77,28 @@ static struct wf_sensor_ops wf_max6690_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
static void wf_max6690_create(struct i2c_adapter *adapter, u8 addr) static void wf_max6690_create(struct i2c_adapter *adapter, u8 addr,
const char *loc)
{ {
struct wf_6690_sensor *max; struct wf_6690_sensor *max;
char *name = "backside-temp"; char *name;
max = kzalloc(sizeof(struct wf_6690_sensor), GFP_KERNEL); max = kzalloc(sizeof(struct wf_6690_sensor), GFP_KERNEL);
if (max == NULL) { if (max == NULL) {
printk(KERN_ERR "windfarm: Couldn't create MAX6690 sensor %s: " printk(KERN_ERR "windfarm: Couldn't create MAX6690 sensor %s: "
"no memory\n", name); "no memory\n", loc);
return; return;
} }
if (!strcmp(loc, "BACKSIDE"))
name = "backside-temp";
else if (!strcmp(loc, "NB Ambient"))
name = "north-bridge-temp";
else if (!strcmp(loc, "GPU Ambient"))
name = "gpu-temp";
else
goto fail;
max->sens.ops = &wf_max6690_ops; max->sens.ops = &wf_max6690_ops;
max->sens.name = name; max->sens.name = name;
max->i2c.addr = addr >> 1; max->i2c.addr = addr >> 1;
...@@ -138,9 +148,7 @@ static int wf_max6690_attach(struct i2c_adapter *adapter) ...@@ -138,9 +148,7 @@ static int wf_max6690_attach(struct i2c_adapter *adapter)
if (loc == NULL || addr == 0) if (loc == NULL || addr == 0)
continue; continue;
printk("found max6690, loc=%s addr=0x%02x\n", loc, addr); printk("found max6690, loc=%s addr=0x%02x\n", loc, addr);
if (strcmp(loc, "BACKSIDE")) wf_max6690_create(adapter, addr, loc);
continue;
wf_max6690_create(adapter, addr);
} }
return 0; return 0;
......
This diff is collapsed.
...@@ -218,6 +218,10 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node, ...@@ -218,6 +218,10 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node,
fct->ctrl.name = "cpu-fan"; fct->ctrl.name = "cpu-fan";
else if (!strcmp(l, "Hard Drive") || !strcmp(l, "Hard drive")) else if (!strcmp(l, "Hard Drive") || !strcmp(l, "Hard drive"))
fct->ctrl.name = "drive-bay-fan"; fct->ctrl.name = "drive-bay-fan";
else if (!strcmp(l, "HDD Fan")) /* seen on iMac G5 iSight */
fct->ctrl.name = "hard-drive-fan";
else if (!strcmp(l, "ODD Fan")) /* same */
fct->ctrl.name = "optical-drive-fan";
/* Unrecognized fan, bail out */ /* Unrecognized fan, bail out */
if (fct->ctrl.name == NULL) if (fct->ctrl.name == NULL)
......
...@@ -77,7 +77,7 @@ static int rionet_capable = 1; ...@@ -77,7 +77,7 @@ static int rionet_capable = 1;
* could be made into a hash table to save memory depending * could be made into a hash table to save memory depending
* on system trade-offs. * on system trade-offs.
*/ */
static struct rio_dev *rionet_active[RIO_MAX_ROUTE_ENTRIES]; static struct rio_dev **rionet_active;
#define is_rionet_capable(pef, src_ops, dst_ops) \ #define is_rionet_capable(pef, src_ops, dst_ops) \
((pef & RIO_PEF_INB_MBOX) && \ ((pef & RIO_PEF_INB_MBOX) && \
...@@ -195,7 +195,8 @@ static int rionet_start_xmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -195,7 +195,8 @@ static int rionet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
} }
if (eth->h_dest[0] & 0x01) { if (eth->h_dest[0] & 0x01) {
for (i = 0; i < RIO_MAX_ROUTE_ENTRIES; i++) for (i = 0; i < RIO_MAX_ROUTE_ENTRIES(rnet->mport->sys_size);
i++)
if (rionet_active[i]) if (rionet_active[i])
rionet_queue_tx_msg(skb, ndev, rionet_queue_tx_msg(skb, ndev,
rionet_active[i]); rionet_active[i]);
...@@ -385,6 +386,8 @@ static void rionet_remove(struct rio_dev *rdev) ...@@ -385,6 +386,8 @@ static void rionet_remove(struct rio_dev *rdev)
struct net_device *ndev = NULL; struct net_device *ndev = NULL;
struct rionet_peer *peer, *tmp; struct rionet_peer *peer, *tmp;
free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ?
__ilog2(sizeof(void *)) + 4 : 0);
unregister_netdev(ndev); unregister_netdev(ndev);
kfree(ndev); kfree(ndev);
...@@ -443,6 +446,15 @@ static int rionet_setup_netdev(struct rio_mport *mport) ...@@ -443,6 +446,15 @@ static int rionet_setup_netdev(struct rio_mport *mport)
goto out; goto out;
} }
rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL,
mport->sys_size ? __ilog2(sizeof(void *)) + 4 : 0);
if (!rionet_active) {
rc = -ENOMEM;
goto out;
}
memset((void *)rionet_active, 0, sizeof(void *) *
RIO_MAX_ROUTE_ENTRIES(mport->sys_size));
/* Set up private area */ /* Set up private area */
rnet = (struct rionet_private *)ndev->priv; rnet = (struct rionet_private *)ndev->priv;
rnet->mport = mport; rnet->mport = mport;
......
# #
# RapidIO configuration # RapidIO configuration
# #
config RAPIDIO_8_BIT_TRANSPORT
bool "8-bit transport addressing"
depends on RAPIDIO
---help---
By default, the kernel assumes a 16-bit addressed RapidIO
network. By selecting this option, the kernel will support
an 8-bit addressed network.
config RAPIDIO_DISC_TIMEOUT config RAPIDIO_DISC_TIMEOUT
int "Discovery timeout duration (seconds)" int "Discovery timeout duration (seconds)"
depends on RAPIDIO depends on RAPIDIO
......
...@@ -48,7 +48,7 @@ int __rio_local_read_config_##size \ ...@@ -48,7 +48,7 @@ int __rio_local_read_config_##size \
u32 data = 0; \ u32 data = 0; \
if (RIO_##size##_BAD) return RIO_BAD_SIZE; \ if (RIO_##size##_BAD) return RIO_BAD_SIZE; \
spin_lock_irqsave(&rio_config_lock, flags); \ spin_lock_irqsave(&rio_config_lock, flags); \
res = mport->ops->lcread(mport->id, offset, len, &data); \ res = mport->ops->lcread(mport, mport->id, offset, len, &data); \
*value = (type)data; \ *value = (type)data; \
spin_unlock_irqrestore(&rio_config_lock, flags); \ spin_unlock_irqrestore(&rio_config_lock, flags); \
return res; \ return res; \
...@@ -71,7 +71,7 @@ int __rio_local_write_config_##size \ ...@@ -71,7 +71,7 @@ int __rio_local_write_config_##size \
unsigned long flags; \ unsigned long flags; \
if (RIO_##size##_BAD) return RIO_BAD_SIZE; \ if (RIO_##size##_BAD) return RIO_BAD_SIZE; \
spin_lock_irqsave(&rio_config_lock, flags); \ spin_lock_irqsave(&rio_config_lock, flags); \
res = mport->ops->lcwrite(mport->id, offset, len, value); \ res = mport->ops->lcwrite(mport, mport->id, offset, len, value);\
spin_unlock_irqrestore(&rio_config_lock, flags); \ spin_unlock_irqrestore(&rio_config_lock, flags); \
return res; \ return res; \
} }
...@@ -108,7 +108,7 @@ int rio_mport_read_config_##size \ ...@@ -108,7 +108,7 @@ int rio_mport_read_config_##size \
u32 data = 0; \ u32 data = 0; \
if (RIO_##size##_BAD) return RIO_BAD_SIZE; \ if (RIO_##size##_BAD) return RIO_BAD_SIZE; \
spin_lock_irqsave(&rio_config_lock, flags); \ spin_lock_irqsave(&rio_config_lock, flags); \
res = mport->ops->cread(mport->id, destid, hopcount, offset, len, &data); \ res = mport->ops->cread(mport, mport->id, destid, hopcount, offset, len, &data); \
*value = (type)data; \ *value = (type)data; \
spin_unlock_irqrestore(&rio_config_lock, flags); \ spin_unlock_irqrestore(&rio_config_lock, flags); \
return res; \ return res; \
...@@ -131,7 +131,7 @@ int rio_mport_write_config_##size \ ...@@ -131,7 +131,7 @@ int rio_mport_write_config_##size \
unsigned long flags; \ unsigned long flags; \
if (RIO_##size##_BAD) return RIO_BAD_SIZE; \ if (RIO_##size##_BAD) return RIO_BAD_SIZE; \
spin_lock_irqsave(&rio_config_lock, flags); \ spin_lock_irqsave(&rio_config_lock, flags); \
res = mport->ops->cwrite(mport->id, destid, hopcount, offset, len, value); \ res = mport->ops->cwrite(mport, mport->id, destid, hopcount, offset, len, value); \
spin_unlock_irqrestore(&rio_config_lock, flags); \ spin_unlock_irqrestore(&rio_config_lock, flags); \
return res; \ return res; \
} }
...@@ -166,7 +166,7 @@ int rio_mport_send_doorbell(struct rio_mport *mport, u16 destid, u16 data) ...@@ -166,7 +166,7 @@ int rio_mport_send_doorbell(struct rio_mport *mport, u16 destid, u16 data)
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&rio_doorbell_lock, flags); spin_lock_irqsave(&rio_doorbell_lock, flags);
res = mport->ops->dsend(mport->id, destid, data); res = mport->ops->dsend(mport, mport->id, destid, data);
spin_unlock_irqrestore(&rio_doorbell_lock, flags); spin_unlock_irqrestore(&rio_doorbell_lock, flags);
return res; return res;
......
...@@ -73,7 +73,7 @@ static u16 rio_get_device_id(struct rio_mport *port, u16 destid, u8 hopcount) ...@@ -73,7 +73,7 @@ static u16 rio_get_device_id(struct rio_mport *port, u16 destid, u8 hopcount)
rio_mport_read_config_32(port, destid, hopcount, RIO_DID_CSR, &result); rio_mport_read_config_32(port, destid, hopcount, RIO_DID_CSR, &result);
return RIO_GET_DID(result); return RIO_GET_DID(port->sys_size, result);
} }
/** /**
...@@ -88,7 +88,7 @@ static u16 rio_get_device_id(struct rio_mport *port, u16 destid, u8 hopcount) ...@@ -88,7 +88,7 @@ static u16 rio_get_device_id(struct rio_mport *port, u16 destid, u8 hopcount)
static void rio_set_device_id(struct rio_mport *port, u16 destid, u8 hopcount, u16 did) static void rio_set_device_id(struct rio_mport *port, u16 destid, u8 hopcount, u16 did)
{ {
rio_mport_write_config_32(port, destid, hopcount, RIO_DID_CSR, rio_mport_write_config_32(port, destid, hopcount, RIO_DID_CSR,
RIO_SET_DID(did)); RIO_SET_DID(port->sys_size, did));
} }
/** /**
...@@ -100,7 +100,8 @@ static void rio_set_device_id(struct rio_mport *port, u16 destid, u8 hopcount, u ...@@ -100,7 +100,8 @@ static void rio_set_device_id(struct rio_mport *port, u16 destid, u8 hopcount, u
*/ */
static void rio_local_set_device_id(struct rio_mport *port, u16 did) static void rio_local_set_device_id(struct rio_mport *port, u16 did)
{ {
rio_local_write_config_32(port, RIO_DID_CSR, RIO_SET_DID(did)); rio_local_write_config_32(port, RIO_DID_CSR, RIO_SET_DID(port->sys_size,
did));
} }
/** /**
...@@ -350,8 +351,18 @@ static struct rio_dev *rio_setup_device(struct rio_net *net, ...@@ -350,8 +351,18 @@ static struct rio_dev *rio_setup_device(struct rio_net *net,
rswitch->switchid = next_switchid; rswitch->switchid = next_switchid;
rswitch->hopcount = hopcount; rswitch->hopcount = hopcount;
rswitch->destid = destid; rswitch->destid = destid;
rswitch->route_table = kzalloc(sizeof(u8)*
RIO_MAX_ROUTE_ENTRIES(port->sys_size),
GFP_KERNEL);
if (!rswitch->route_table) {
kfree(rdev);
rdev = NULL;
kfree(rswitch);
goto out;
}
/* Initialize switch route table */ /* Initialize switch route table */
for (rdid = 0; rdid < RIO_MAX_ROUTE_ENTRIES; rdid++) for (rdid = 0; rdid < RIO_MAX_ROUTE_ENTRIES(port->sys_size);
rdid++)
rswitch->route_table[rdid] = RIO_INVALID_ROUTE; rswitch->route_table[rdid] = RIO_INVALID_ROUTE;
rdev->rswitch = rswitch; rdev->rswitch = rswitch;
sprintf(rio_name(rdev), "%02x:s:%04x", rdev->net->id, sprintf(rio_name(rdev), "%02x:s:%04x", rdev->net->id,
...@@ -480,7 +491,7 @@ static u16 rio_get_host_deviceid_lock(struct rio_mport *port, u8 hopcount) ...@@ -480,7 +491,7 @@ static u16 rio_get_host_deviceid_lock(struct rio_mport *port, u8 hopcount)
{ {
u32 result; u32 result;
rio_mport_read_config_32(port, RIO_ANY_DESTID, hopcount, rio_mport_read_config_32(port, RIO_ANY_DESTID(port->sys_size), hopcount,
RIO_HOST_DID_LOCK_CSR, &result); RIO_HOST_DID_LOCK_CSR, &result);
return (u16) (result & 0xffff); return (u16) (result & 0xffff);
...@@ -571,14 +582,16 @@ static int rio_enum_peer(struct rio_net *net, struct rio_mport *port, ...@@ -571,14 +582,16 @@ static int rio_enum_peer(struct rio_net *net, struct rio_mport *port,
} }
/* Attempt to acquire device lock */ /* Attempt to acquire device lock */
rio_mport_write_config_32(port, RIO_ANY_DESTID, hopcount, rio_mport_write_config_32(port, RIO_ANY_DESTID(port->sys_size),
hopcount,
RIO_HOST_DID_LOCK_CSR, port->host_deviceid); RIO_HOST_DID_LOCK_CSR, port->host_deviceid);
while ((tmp = rio_get_host_deviceid_lock(port, hopcount)) while ((tmp = rio_get_host_deviceid_lock(port, hopcount))
< port->host_deviceid) { < port->host_deviceid) {
/* Delay a bit */ /* Delay a bit */
mdelay(1); mdelay(1);
/* Attempt to acquire device lock again */ /* Attempt to acquire device lock again */
rio_mport_write_config_32(port, RIO_ANY_DESTID, hopcount, rio_mport_write_config_32(port, RIO_ANY_DESTID(port->sys_size),
hopcount,
RIO_HOST_DID_LOCK_CSR, RIO_HOST_DID_LOCK_CSR,
port->host_deviceid); port->host_deviceid);
} }
...@@ -590,7 +603,9 @@ static int rio_enum_peer(struct rio_net *net, struct rio_mport *port, ...@@ -590,7 +603,9 @@ static int rio_enum_peer(struct rio_net *net, struct rio_mport *port,
} }
/* Setup new RIO device */ /* Setup new RIO device */
if ((rdev = rio_setup_device(net, port, RIO_ANY_DESTID, hopcount, 1))) { rdev = rio_setup_device(net, port, RIO_ANY_DESTID(port->sys_size),
hopcount, 1);
if (rdev) {
/* Add device to the global and bus/net specific list. */ /* Add device to the global and bus/net specific list. */
list_add_tail(&rdev->net_list, &net->devices); list_add_tail(&rdev->net_list, &net->devices);
} else } else
...@@ -598,7 +613,8 @@ static int rio_enum_peer(struct rio_net *net, struct rio_mport *port, ...@@ -598,7 +613,8 @@ static int rio_enum_peer(struct rio_net *net, struct rio_mport *port,
if (rio_is_switch(rdev)) { if (rio_is_switch(rdev)) {
next_switchid++; next_switchid++;
sw_inport = rio_get_swpinfo_inport(port, RIO_ANY_DESTID, hopcount); sw_inport = rio_get_swpinfo_inport(port,
RIO_ANY_DESTID(port->sys_size), hopcount);
rio_route_add_entry(port, rdev->rswitch, RIO_GLOBAL_TABLE, rio_route_add_entry(port, rdev->rswitch, RIO_GLOBAL_TABLE,
port->host_deviceid, sw_inport); port->host_deviceid, sw_inport);
rdev->rswitch->route_table[port->host_deviceid] = sw_inport; rdev->rswitch->route_table[port->host_deviceid] = sw_inport;
...@@ -612,7 +628,8 @@ static int rio_enum_peer(struct rio_net *net, struct rio_mport *port, ...@@ -612,7 +628,8 @@ static int rio_enum_peer(struct rio_net *net, struct rio_mport *port,
} }
num_ports = num_ports =
rio_get_swpinfo_tports(port, RIO_ANY_DESTID, hopcount); rio_get_swpinfo_tports(port, RIO_ANY_DESTID(port->sys_size),
hopcount);
pr_debug( pr_debug(
"RIO: found %s (vid %4.4x did %4.4x) with %d ports\n", "RIO: found %s (vid %4.4x did %4.4x) with %d ports\n",
rio_name(rdev), rdev->vid, rdev->did, num_ports); rio_name(rdev), rdev->vid, rdev->did, num_ports);
...@@ -624,13 +641,15 @@ static int rio_enum_peer(struct rio_net *net, struct rio_mport *port, ...@@ -624,13 +641,15 @@ static int rio_enum_peer(struct rio_net *net, struct rio_mport *port,
cur_destid = next_destid; cur_destid = next_destid;
if (rio_sport_is_active if (rio_sport_is_active
(port, RIO_ANY_DESTID, hopcount, port_num)) { (port, RIO_ANY_DESTID(port->sys_size), hopcount,
port_num)) {
pr_debug( pr_debug(
"RIO: scanning device on port %d\n", "RIO: scanning device on port %d\n",
port_num); port_num);
rio_route_add_entry(port, rdev->rswitch, rio_route_add_entry(port, rdev->rswitch,
RIO_GLOBAL_TABLE, RIO_GLOBAL_TABLE,
RIO_ANY_DESTID, port_num); RIO_ANY_DESTID(port->sys_size),
port_num);
if (rio_enum_peer(net, port, hopcount + 1) < 0) if (rio_enum_peer(net, port, hopcount + 1) < 0)
return -1; return -1;
...@@ -735,7 +754,8 @@ rio_disc_peer(struct rio_net *net, struct rio_mport *port, u16 destid, ...@@ -735,7 +754,8 @@ rio_disc_peer(struct rio_net *net, struct rio_mport *port, u16 destid,
pr_debug( pr_debug(
"RIO: scanning device on port %d\n", "RIO: scanning device on port %d\n",
port_num); port_num);
for (ndestid = 0; ndestid < RIO_ANY_DESTID; for (ndestid = 0;
ndestid < RIO_ANY_DESTID(port->sys_size);
ndestid++) { ndestid++) {
rio_route_get_entry(port, rdev->rswitch, rio_route_get_entry(port, rdev->rswitch,
RIO_GLOBAL_TABLE, RIO_GLOBAL_TABLE,
...@@ -917,7 +937,9 @@ static void rio_build_route_tables(void) ...@@ -917,7 +937,9 @@ static void rio_build_route_tables(void)
list_for_each_entry(rdev, &rio_devices, global_list) list_for_each_entry(rdev, &rio_devices, global_list)
if (rio_is_switch(rdev)) if (rio_is_switch(rdev))
for (i = 0; i < RIO_MAX_ROUTE_ENTRIES; i++) { for (i = 0;
i < RIO_MAX_ROUTE_ENTRIES(rdev->net->hport->sys_size);
i++) {
if (rio_route_get_entry if (rio_route_get_entry
(rdev->net->hport, rdev->rswitch, RIO_GLOBAL_TABLE, (rdev->net->hport, rdev->rswitch, RIO_GLOBAL_TABLE,
i, &sport) < 0) i, &sport) < 0)
...@@ -981,7 +1003,8 @@ int rio_disc_mport(struct rio_mport *mport) ...@@ -981,7 +1003,8 @@ int rio_disc_mport(struct rio_mport *mport)
del_timer_sync(&rio_enum_timer); del_timer_sync(&rio_enum_timer);
pr_debug("done\n"); pr_debug("done\n");
if (rio_disc_peer(net, mport, RIO_ANY_DESTID, 0) < 0) { if (rio_disc_peer(net, mport, RIO_ANY_DESTID(mport->sys_size),
0) < 0) {
printk(KERN_INFO printk(KERN_INFO
"RIO: master port %d device has failed discovery\n", "RIO: master port %d device has failed discovery\n",
mport->id); mport->id);
......
...@@ -43,7 +43,8 @@ static ssize_t routes_show(struct device *dev, struct device_attribute *attr, ch ...@@ -43,7 +43,8 @@ static ssize_t routes_show(struct device *dev, struct device_attribute *attr, ch
if (!rdev->rswitch) if (!rdev->rswitch)
goto out; goto out;
for (i = 0; i < RIO_MAX_ROUTE_ENTRIES; i++) { for (i = 0; i < RIO_MAX_ROUTE_ENTRIES(rdev->net->hport->sys_size);
i++) {
if (rdev->rswitch->route_table[i] == RIO_INVALID_ROUTE) if (rdev->rswitch->route_table[i] == RIO_INVALID_ROUTE)
continue; continue;
str += str +=
......
...@@ -43,7 +43,7 @@ u16 rio_local_get_device_id(struct rio_mport *port) ...@@ -43,7 +43,7 @@ u16 rio_local_get_device_id(struct rio_mport *port)
rio_local_read_config_32(port, RIO_DID_CSR, &result); rio_local_read_config_32(port, RIO_DID_CSR, &result);
return (RIO_GET_DID(result)); return (RIO_GET_DID(port->sys_size, result));
} }
/** /**
......
...@@ -51,10 +51,5 @@ extern struct rio_route_ops __end_rio_route_ops[]; ...@@ -51,10 +51,5 @@ extern struct rio_route_ops __end_rio_route_ops[];
DECLARE_RIO_ROUTE_SECTION(.rio_route_ops, \ DECLARE_RIO_ROUTE_SECTION(.rio_route_ops, \
vid, did, add_hook, get_hook) vid, did, add_hook, get_hook)
#ifdef CONFIG_RAPIDIO_8_BIT_TRANSPORT #define RIO_GET_DID(size, x) (size ? (x & 0xffff) : ((x & 0x00ff0000) >> 16))
#define RIO_GET_DID(x) ((x & 0x00ff0000) >> 16) #define RIO_SET_DID(size, x) (size ? (x & 0xffff) : ((x & 0x000000ff) << 16))
#define RIO_SET_DID(x) ((x & 0x000000ff) << 16)
#else
#define RIO_GET_DID(x) (x & 0xffff)
#define RIO_SET_DID(x) (x & 0xffff)
#endif
...@@ -138,6 +138,8 @@ typedef struct { ...@@ -138,6 +138,8 @@ typedef struct {
struct thread_struct { struct thread_struct {
unsigned long ksp; /* Kernel stack pointer */ unsigned long ksp; /* Kernel stack pointer */
unsigned long ksp_limit; /* if ksp <= ksp_limit stack overflow */
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
unsigned long ksp_vsid; unsigned long ksp_vsid;
#endif #endif
...@@ -182,11 +184,14 @@ struct thread_struct { ...@@ -182,11 +184,14 @@ struct thread_struct {
#define ARCH_MIN_TASKALIGN 16 #define ARCH_MIN_TASKALIGN 16
#define INIT_SP (sizeof(init_stack) + (unsigned long) &init_stack) #define INIT_SP (sizeof(init_stack) + (unsigned long) &init_stack)
#define INIT_SP_LIMIT \
(_ALIGN_UP(sizeof(init_thread_info), 16) + (unsigned long) &init_stack)
#ifdef CONFIG_PPC32 #ifdef CONFIG_PPC32
#define INIT_THREAD { \ #define INIT_THREAD { \
.ksp = INIT_SP, \ .ksp = INIT_SP, \
.ksp_limit = INIT_SP_LIMIT, \
.fs = KERNEL_DS, \ .fs = KERNEL_DS, \
.pgdir = swapper_pg_dir, \ .pgdir = swapper_pg_dir, \
.fpexc_mode = MSR_FE0 | MSR_FE1, \ .fpexc_mode = MSR_FE0 | MSR_FE1, \
...@@ -194,6 +199,7 @@ struct thread_struct { ...@@ -194,6 +199,7 @@ struct thread_struct {
#else #else
#define INIT_THREAD { \ #define INIT_THREAD { \
.ksp = INIT_SP, \ .ksp = INIT_SP, \
.ksp_limit = INIT_SP_LIMIT, \
.regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \ .regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \
.fs = KERNEL_DS, \ .fs = KERNEL_DS, \
.fpr = {0}, \ .fpr = {0}, \
......
File moved
...@@ -204,7 +204,7 @@ extern int powersave_nap; /* set if nap mode can be used in idle loop */ ...@@ -204,7 +204,7 @@ extern int powersave_nap; /* set if nap mode can be used in idle loop */
* Changes the memory location '*ptr' to be val and returns * Changes the memory location '*ptr' to be val and returns
* the previous value stored there. * the previous value stored there.
*/ */
static __inline__ unsigned long static __always_inline unsigned long
__xchg_u32(volatile void *p, unsigned long val) __xchg_u32(volatile void *p, unsigned long val)
{ {
unsigned long prev; unsigned long prev;
...@@ -229,7 +229,7 @@ __xchg_u32(volatile void *p, unsigned long val) ...@@ -229,7 +229,7 @@ __xchg_u32(volatile void *p, unsigned long val)
* Changes the memory location '*ptr' to be val and returns * Changes the memory location '*ptr' to be val and returns
* the previous value stored there. * the previous value stored there.
*/ */
static __inline__ unsigned long static __always_inline unsigned long
__xchg_u32_local(volatile void *p, unsigned long val) __xchg_u32_local(volatile void *p, unsigned long val)
{ {
unsigned long prev; unsigned long prev;
...@@ -247,7 +247,7 @@ __xchg_u32_local(volatile void *p, unsigned long val) ...@@ -247,7 +247,7 @@ __xchg_u32_local(volatile void *p, unsigned long val)
} }
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
static __inline__ unsigned long static __always_inline unsigned long
__xchg_u64(volatile void *p, unsigned long val) __xchg_u64(volatile void *p, unsigned long val)
{ {
unsigned long prev; unsigned long prev;
...@@ -266,7 +266,7 @@ __xchg_u64(volatile void *p, unsigned long val) ...@@ -266,7 +266,7 @@ __xchg_u64(volatile void *p, unsigned long val)
return prev; return prev;
} }
static __inline__ unsigned long static __always_inline unsigned long
__xchg_u64_local(volatile void *p, unsigned long val) __xchg_u64_local(volatile void *p, unsigned long val)
{ {
unsigned long prev; unsigned long prev;
...@@ -290,7 +290,7 @@ __xchg_u64_local(volatile void *p, unsigned long val) ...@@ -290,7 +290,7 @@ __xchg_u64_local(volatile void *p, unsigned long val)
*/ */
extern void __xchg_called_with_bad_pointer(void); extern void __xchg_called_with_bad_pointer(void);
static __inline__ unsigned long static __always_inline unsigned long
__xchg(volatile void *ptr, unsigned long x, unsigned int size) __xchg(volatile void *ptr, unsigned long x, unsigned int size)
{ {
switch (size) { switch (size) {
...@@ -305,7 +305,7 @@ __xchg(volatile void *ptr, unsigned long x, unsigned int size) ...@@ -305,7 +305,7 @@ __xchg(volatile void *ptr, unsigned long x, unsigned int size)
return x; return x;
} }
static __inline__ unsigned long static __always_inline unsigned long
__xchg_local(volatile void *ptr, unsigned long x, unsigned int size) __xchg_local(volatile void *ptr, unsigned long x, unsigned int size)
{ {
switch (size) { switch (size) {
...@@ -338,7 +338,7 @@ __xchg_local(volatile void *ptr, unsigned long x, unsigned int size) ...@@ -338,7 +338,7 @@ __xchg_local(volatile void *ptr, unsigned long x, unsigned int size)
*/ */
#define __HAVE_ARCH_CMPXCHG 1 #define __HAVE_ARCH_CMPXCHG 1
static __inline__ unsigned long static __always_inline unsigned long
__cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)
{ {
unsigned int prev; unsigned int prev;
...@@ -361,7 +361,7 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) ...@@ -361,7 +361,7 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)
return prev; return prev;
} }
static __inline__ unsigned long static __always_inline unsigned long
__cmpxchg_u32_local(volatile unsigned int *p, unsigned long old, __cmpxchg_u32_local(volatile unsigned int *p, unsigned long old,
unsigned long new) unsigned long new)
{ {
...@@ -384,7 +384,7 @@ __cmpxchg_u32_local(volatile unsigned int *p, unsigned long old, ...@@ -384,7 +384,7 @@ __cmpxchg_u32_local(volatile unsigned int *p, unsigned long old,
} }
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
static __inline__ unsigned long static __always_inline unsigned long
__cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new) __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new)
{ {
unsigned long prev; unsigned long prev;
...@@ -406,7 +406,7 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new) ...@@ -406,7 +406,7 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new)
return prev; return prev;
} }
static __inline__ unsigned long static __always_inline unsigned long
__cmpxchg_u64_local(volatile unsigned long *p, unsigned long old, __cmpxchg_u64_local(volatile unsigned long *p, unsigned long old,
unsigned long new) unsigned long new)
{ {
...@@ -432,7 +432,7 @@ __cmpxchg_u64_local(volatile unsigned long *p, unsigned long old, ...@@ -432,7 +432,7 @@ __cmpxchg_u64_local(volatile unsigned long *p, unsigned long old,
if something tries to do an invalid cmpxchg(). */ if something tries to do an invalid cmpxchg(). */
extern void __cmpxchg_called_with_bad_pointer(void); extern void __cmpxchg_called_with_bad_pointer(void);
static __inline__ unsigned long static __always_inline unsigned long
__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
unsigned int size) unsigned int size)
{ {
...@@ -448,7 +448,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, ...@@ -448,7 +448,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
return old; return old;
} }
static __inline__ unsigned long static __always_inline unsigned long
__cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new, __cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new,
unsigned int size) unsigned int size)
{ {
......
...@@ -40,7 +40,8 @@ extern struct lmb lmb; ...@@ -40,7 +40,8 @@ extern struct lmb lmb;
extern void __init lmb_init(void); extern void __init lmb_init(void);
extern void __init lmb_analyze(void); extern void __init lmb_analyze(void);
extern long __init lmb_add(u64 base, u64 size); extern long lmb_add(u64 base, u64 size);
extern long lmb_remove(u64 base, u64 size);
extern long __init lmb_reserve(u64 base, u64 size); extern long __init lmb_reserve(u64 base, u64 size);
extern u64 __init lmb_alloc_nid(u64 size, u64 align, int nid, extern u64 __init lmb_alloc_nid(u64 size, u64 align, int nid,
u64 (*nid_range)(u64, u64, int *)); u64 (*nid_range)(u64, u64, int *));
...@@ -53,6 +54,7 @@ extern u64 __init lmb_phys_mem_size(void); ...@@ -53,6 +54,7 @@ extern u64 __init lmb_phys_mem_size(void);
extern u64 __init lmb_end_of_DRAM(void); extern u64 __init lmb_end_of_DRAM(void);
extern void __init lmb_enforce_memory_limit(u64 memory_limit); extern void __init lmb_enforce_memory_limit(u64 memory_limit);
extern int __init lmb_is_reserved(u64 addr); extern int __init lmb_is_reserved(u64 addr);
extern int lmb_find(struct lmb_property *res);
extern void lmb_dump_all(void); extern void lmb_dump_all(void);
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/rio_regs.h> #include <linux/rio_regs.h>
#define RIO_ANY_DESTID 0xff
#define RIO_NO_HOPCOUNT -1 #define RIO_NO_HOPCOUNT -1
#define RIO_INVALID_DESTID 0xffff #define RIO_INVALID_DESTID 0xffff
...@@ -39,11 +38,8 @@ ...@@ -39,11 +38,8 @@
entry is invalid (no route entry is invalid (no route
exists for the device ID) */ exists for the device ID) */
#ifdef CONFIG_RAPIDIO_8_BIT_TRANSPORT #define RIO_MAX_ROUTE_ENTRIES(size) (size ? (1 << 16) : (1 << 8))
#define RIO_MAX_ROUTE_ENTRIES (1 << 8) #define RIO_ANY_DESTID(size) (size ? 0xffff : 0xff)
#else
#define RIO_MAX_ROUTE_ENTRIES (1 << 16)
#endif
#define RIO_MAX_MBOX 4 #define RIO_MAX_MBOX 4
#define RIO_MAX_MSG_SIZE 0x1000 #define RIO_MAX_MSG_SIZE 0x1000
...@@ -149,6 +145,11 @@ struct rio_dbell { ...@@ -149,6 +145,11 @@ struct rio_dbell {
void *dev_id; void *dev_id;
}; };
enum rio_phy_type {
RIO_PHY_PARALLEL,
RIO_PHY_SERIAL,
};
/** /**
* struct rio_mport - RIO master port info * struct rio_mport - RIO master port info
* @dbells: List of doorbell events * @dbells: List of doorbell events
...@@ -163,6 +164,7 @@ struct rio_dbell { ...@@ -163,6 +164,7 @@ struct rio_dbell {
* @id: Port ID, unique among all ports * @id: Port ID, unique among all ports
* @index: Port index, unique among all port interfaces of the same type * @index: Port index, unique among all port interfaces of the same type
* @name: Port name string * @name: Port name string
* @priv: Master port private data
*/ */
struct rio_mport { struct rio_mport {
struct list_head dbells; /* list of doorbell events */ struct list_head dbells; /* list of doorbell events */
...@@ -177,7 +179,13 @@ struct rio_mport { ...@@ -177,7 +179,13 @@ struct rio_mport {
unsigned char id; /* port ID, unique among all ports */ unsigned char id; /* port ID, unique among all ports */
unsigned char index; /* port index, unique among all port unsigned char index; /* port index, unique among all port
interfaces of the same type */ interfaces of the same type */
unsigned int sys_size; /* RapidIO common transport system size.
* 0 - Small size. 256 devices.
* 1 - Large size, 65536 devices.
*/
enum rio_phy_type phy_type; /* RapidIO phy type */
unsigned char name[40]; unsigned char name[40];
void *priv; /* Master port private data */
}; };
/** /**
...@@ -211,7 +219,7 @@ struct rio_switch { ...@@ -211,7 +219,7 @@ struct rio_switch {
u16 switchid; u16 switchid;
u16 hopcount; u16 hopcount;
u16 destid; u16 destid;
u8 route_table[RIO_MAX_ROUTE_ENTRIES]; u8 *route_table;
int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
u16 table, u16 route_destid, u8 route_port); u16 table, u16 route_destid, u8 route_port);
int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
...@@ -229,13 +237,15 @@ struct rio_switch { ...@@ -229,13 +237,15 @@ struct rio_switch {
* @dsend: Callback to send a doorbell message. * @dsend: Callback to send a doorbell message.
*/ */
struct rio_ops { struct rio_ops {
int (*lcread) (int index, u32 offset, int len, u32 * data); int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len,
int (*lcwrite) (int index, u32 offset, int len, u32 data); u32 *data);
int (*cread) (int index, u16 destid, u8 hopcount, u32 offset, int len, int (*lcwrite) (struct rio_mport *mport, int index, u32 offset, int len,
u32 * data); u32 data);
int (*cwrite) (int index, u16 destid, u8 hopcount, u32 offset, int len, int (*cread) (struct rio_mport *mport, int index, u16 destid,
u32 data); u8 hopcount, u32 offset, int len, u32 *data);
int (*dsend) (int index, u16 destid, u16 data); int (*cwrite) (struct rio_mport *mport, int index, u16 destid,
u8 hopcount, u32 offset, int len, u32 data);
int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data);
}; };
#define RIO_RESOURCE_MEM 0x00000100 #define RIO_RESOURCE_MEM 0x00000100
......
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