* [PATCH 1/4] powerpc: update iseries_veth device-tree information
@ 2006-05-04 3:45 Stephen Rothwell
2006-05-04 3:46 ` [PATCH 2/4] powerpc: update iSeries viodasd device-tree entries Stephen Rothwell
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2006-05-04 3:45 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
Make the device-tree information more generic and more
like the pSeries virtual lan device. Also use the MAC
address from the device tree.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/iseries/setup.c | 8 +++++---
drivers/net/iseries_veth.c | 27 +++++++++++++++++----------
2 files changed, 22 insertions(+), 13 deletions(-)
These patches are relative to the powerpc tree and built and booted for iSeries.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
9b4a8b9458558616e0b49e4beb1e27f087835d4c
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index befd36a..0a08257 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -946,10 +946,10 @@ void dt_vdevices(struct iseries_flat_dt
if ((vlan_map & (0x8000 >> i)) == 0)
continue;
- snprintf(buf, 32, "vlan@%08x", reg + i);
+ snprintf(buf, 32, "l-lan@%08x", reg + i);
dt_start_node(dt, buf);
- dt_prop_str(dt, "device_type", "vlan");
- dt_prop_str(dt, "compatible", "");
+ dt_prop_str(dt, "device_type", "network");
+ dt_prop_str(dt, "compatible", "IBM,iSeries-l-lan");
dt_prop_u32(dt, "reg", reg + i);
dt_prop_u32(dt, "linux,unit_address", i);
@@ -961,6 +961,8 @@ void dt_vdevices(struct iseries_flat_dt
mac_addr[5] = HvLpConfig_getLpIndex_outline();
dt_prop(dt, "local-mac-address", (char *)mac_addr, ETH_ALEN);
dt_prop(dt, "mac-address", (char *)mac_addr, ETH_ALEN);
+ dt_prop_u32(dt, "max-frame-size", 9000);
+ dt_prop_u32(dt, "address-bits", 48);
dt_end_node(dt);
}
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index f0f04be..93394d7 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -69,6 +69,7 @@ #include <linux/init.h>
#include <linux/delay.h>
#include <linux/mm.h>
#include <linux/ethtool.h>
+#include <linux/if_ether.h>
#include <asm/abs_addr.h>
#include <asm/iseries/mf.h>
@@ -1035,11 +1036,22 @@ static struct ethtool_ops ops = {
.get_link = veth_get_link,
};
-static struct net_device * __init veth_probe_one(int vlan, struct device *vdev)
+static struct net_device * __init veth_probe_one(int vlan,
+ struct vio_dev *vio_dev)
{
struct net_device *dev;
struct veth_port *port;
+ struct device *vdev = &vio_dev->dev;
int i, rc;
+ const unsigned char *mac_addr;
+
+ mac_addr = vio_get_attribute(vio_dev, "local-mac-address", NULL);
+ if (mac_addr == NULL)
+ mac_addr = vio_get_attribute(vio_dev, "mac-address", NULL);
+ if (mac_addr == NULL) {
+ veth_error("Unable to fetch MAC address from device tree.\n");
+ return NULL;
+ }
dev = alloc_etherdev(sizeof (struct veth_port));
if (! dev) {
@@ -1064,16 +1076,11 @@ static struct net_device * __init veth_p
}
port->dev = vdev;
- dev->dev_addr[0] = 0x02;
- dev->dev_addr[1] = 0x01;
- dev->dev_addr[2] = 0xff;
- dev->dev_addr[3] = vlan;
- dev->dev_addr[4] = 0xff;
- dev->dev_addr[5] = this_lp;
+ memcpy(dev->dev_addr, mac_addr, ETH_ALEN);
dev->mtu = VETH_MAX_MTU;
- memcpy(&port->mac_addr, dev->dev_addr, 6);
+ memcpy(&port->mac_addr, mac_addr, ETH_ALEN);
dev->open = veth_open;
dev->hard_start_xmit = veth_start_xmit;
@@ -1608,7 +1615,7 @@ static int veth_probe(struct vio_dev *vd
struct net_device *dev;
struct veth_port *port;
- dev = veth_probe_one(i, &vdev->dev);
+ dev = veth_probe_one(i, vdev);
if (dev == NULL) {
veth_remove(vdev);
return 1;
@@ -1641,7 +1648,7 @@ static int veth_probe(struct vio_dev *vd
* support.
*/
static struct vio_device_id veth_device_table[] __devinitdata = {
- { "vlan", "" },
+ { "network", "IBM,iSeries-l-lan" },
{ "", "" }
};
MODULE_DEVICE_TABLE(vio, veth_device_table);
--
1.3.1.ge923
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/4] powerpc: update iSeries viodasd device-tree entries
2006-05-04 3:45 [PATCH 1/4] powerpc: update iseries_veth device-tree information Stephen Rothwell
@ 2006-05-04 3:46 ` Stephen Rothwell
2006-05-04 3:47 ` [PATCH 3/4] powerpc: update iSeries vdevice Stephen Rothwell
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2006-05-04 3:46 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
These devices should have device_type block and a unique compatible entry.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/iseries/setup.c | 4 ++--
drivers/block/viodasd.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
1f5b48ad3ece3e3f35ec05cc3ffd028e16c22732
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 0a08257..285f2b2 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -971,8 +971,8 @@ void dt_vdevices(struct iseries_flat_dt
for (i = 0; i < HVMAXARCHITECTEDVIRTUALDISKS; i++) {
snprintf(buf, 32, "viodasd@%08x", reg + i);
dt_start_node(dt, buf);
- dt_prop_str(dt, "device_type", "viodasd");
- dt_prop_str(dt, "compatible", "");
+ dt_prop_str(dt, "device_type", "block");
+ dt_prop_str(dt, "compatible", "IBM,iSeries-viodasd");
dt_prop_u32(dt, "reg", reg + i);
dt_prop_u32(dt, "linux,unit_address", i);
dt_end_node(dt);
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c
index f63e07b..b0df4f5 100644
--- a/drivers/block/viodasd.c
+++ b/drivers/block/viodasd.c
@@ -747,7 +747,7 @@ static int viodasd_remove(struct vio_dev
* support.
*/
static struct vio_device_id viodasd_device_table[] __devinitdata = {
- { "viodasd", "" },
+ { "block", "IBM,iSeries-viodasd" },
{ "", "" }
};
MODULE_DEVICE_TABLE(vio, viodasd_device_table);
--
1.3.1.ge923
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 3/4] powerpc: update iSeries vdevice
2006-05-04 3:46 ` [PATCH 2/4] powerpc: update iSeries viodasd device-tree entries Stephen Rothwell
@ 2006-05-04 3:47 ` Stephen Rothwell
2006-05-04 3:48 ` [PATCH 4/4] powerpc: update iSeries viocd and viotape device-tree Stephen Rothwell
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2006-05-04 3:47 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
Make it look more like the pSeries vdevice tree.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/iseries/setup.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
e013355bd53f3f51101bc2c86fc082f02f2d0141
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 285f2b2..d3f94b4 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -921,13 +921,14 @@ void dt_vdevices(struct iseries_flat_dt
char buf[32];
dt_start_node(dt, "vdevice");
+ dt_prop_str(dt, "device_type", "vdevice");
+ dt_prop_str(dt, "compatible", "IBM,iSeries-vdevice");
dt_prop_u32(dt, "#address-cells", 1);
dt_prop_u32(dt, "#size-cells", 0);
- snprintf(buf, sizeof(buf), "viocons@%08x", reg);
+ snprintf(buf, sizeof(buf), "vty@%08x", reg);
dt_start_node(dt, buf);
dt_prop_str(dt, "device_type", "serial");
- dt_prop_str(dt, "compatible", "");
dt_prop_u32(dt, "reg", reg);
dt_end_node(dt);
reg++;
--
1.3.1.ge923
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 4/4] powerpc: update iSeries viocd and viotape device-tree
2006-05-04 3:47 ` [PATCH 3/4] powerpc: update iSeries vdevice Stephen Rothwell
@ 2006-05-04 3:48 ` Stephen Rothwell
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2006-05-04 3:48 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
Make their device_type entries more generic and their compatible entries
more specific.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/iseries/setup.c | 8 ++++----
drivers/cdrom/viocd.c | 2 +-
drivers/char/viotape.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
8e995399fbca7e9fe918e90653dd78fedd634f69
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index d3f94b4..074d1d9 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -982,8 +982,8 @@ void dt_vdevices(struct iseries_flat_dt
for (i = 0; i < HVMAXARCHITECTEDVIRTUALCDROMS; i++) {
snprintf(buf, 32, "viocd@%08x", reg + i);
dt_start_node(dt, buf);
- dt_prop_str(dt, "device_type", "viocd");
- dt_prop_str(dt, "compatible", "");
+ dt_prop_str(dt, "device_type", "block");
+ dt_prop_str(dt, "compatible", "IBM,iSeries-viocd");
dt_prop_u32(dt, "reg", reg + i);
dt_prop_u32(dt, "linux,unit_address", i);
dt_end_node(dt);
@@ -992,8 +992,8 @@ void dt_vdevices(struct iseries_flat_dt
for (i = 0; i < HVMAXARCHITECTEDVIRTUALTAPES; i++) {
snprintf(buf, 32, "viotape@%08x", reg + i);
dt_start_node(dt, buf);
- dt_prop_str(dt, "device_type", "viotape");
- dt_prop_str(dt, "compatible", "");
+ dt_prop_str(dt, "device_type", "byte");
+ dt_prop_str(dt, "compatible", "IBM,iSeries-viotape");
dt_prop_u32(dt, "reg", reg + i);
dt_prop_u32(dt, "linux,unit_address", i);
dt_end_node(dt);
diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c
index c0f817b..af6b3bf 100644
--- a/drivers/cdrom/viocd.c
+++ b/drivers/cdrom/viocd.c
@@ -731,7 +731,7 @@ static int viocd_remove(struct vio_dev *
* support.
*/
static struct vio_device_id viocd_device_table[] __devinitdata = {
- { "viocd", "" },
+ { "block", "IBM,iSeries-viocd" },
{ "", "" }
};
MODULE_DEVICE_TABLE(vio, viocd_device_table);
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c
index 60aabdb..11c7e9d 100644
--- a/drivers/char/viotape.c
+++ b/drivers/char/viotape.c
@@ -989,7 +989,7 @@ static int viotape_remove(struct vio_dev
* support.
*/
static struct vio_device_id viotape_device_table[] __devinitdata = {
- { "viotape", "" },
+ { "byte", "IBM,iSeries-viotape" },
{ "", "" }
};
MODULE_DEVICE_TABLE(vio, viotape_device_table);
--
1.3.1.ge923
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 1/4] powerpc: update iseries_veth device-tree information
@ 2006-05-15 3:39 Stephen Rothwell
2006-05-15 3:44 ` [PATCH 4/4] powerpc: update iSeries viocd and viotape device-tree Stephen Rothwell
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2006-05-15 3:39 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
Make the device-tree information more generic and more
like the pSeries virtual lan device. Also use the MAC
address from the device tree.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/iseries/setup.c | 8 +++++---
drivers/net/iseries_veth.c | 27 +++++++++++++++++----------
2 files changed, 22 insertions(+), 13 deletions(-)
These patches are relative to the current powerpc kernel tree and have
been built and run on an iSeries 270. They should be suitable for 2.6.18.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
6f393cd3fd10e4ee54a3cc4cf0cfff391d5be555
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index befd36a..0a08257 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -946,10 +946,10 @@ void dt_vdevices(struct iseries_flat_dt
if ((vlan_map & (0x8000 >> i)) == 0)
continue;
- snprintf(buf, 32, "vlan@%08x", reg + i);
+ snprintf(buf, 32, "l-lan@%08x", reg + i);
dt_start_node(dt, buf);
- dt_prop_str(dt, "device_type", "vlan");
- dt_prop_str(dt, "compatible", "");
+ dt_prop_str(dt, "device_type", "network");
+ dt_prop_str(dt, "compatible", "IBM,iSeries-l-lan");
dt_prop_u32(dt, "reg", reg + i);
dt_prop_u32(dt, "linux,unit_address", i);
@@ -961,6 +961,8 @@ void dt_vdevices(struct iseries_flat_dt
mac_addr[5] = HvLpConfig_getLpIndex_outline();
dt_prop(dt, "local-mac-address", (char *)mac_addr, ETH_ALEN);
dt_prop(dt, "mac-address", (char *)mac_addr, ETH_ALEN);
+ dt_prop_u32(dt, "max-frame-size", 9000);
+ dt_prop_u32(dt, "address-bits", 48);
dt_end_node(dt);
}
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index f0f04be..93394d7 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -69,6 +69,7 @@ #include <linux/init.h>
#include <linux/delay.h>
#include <linux/mm.h>
#include <linux/ethtool.h>
+#include <linux/if_ether.h>
#include <asm/abs_addr.h>
#include <asm/iseries/mf.h>
@@ -1035,11 +1036,22 @@ static struct ethtool_ops ops = {
.get_link = veth_get_link,
};
-static struct net_device * __init veth_probe_one(int vlan, struct device *vdev)
+static struct net_device * __init veth_probe_one(int vlan,
+ struct vio_dev *vio_dev)
{
struct net_device *dev;
struct veth_port *port;
+ struct device *vdev = &vio_dev->dev;
int i, rc;
+ const unsigned char *mac_addr;
+
+ mac_addr = vio_get_attribute(vio_dev, "local-mac-address", NULL);
+ if (mac_addr == NULL)
+ mac_addr = vio_get_attribute(vio_dev, "mac-address", NULL);
+ if (mac_addr == NULL) {
+ veth_error("Unable to fetch MAC address from device tree.\n");
+ return NULL;
+ }
dev = alloc_etherdev(sizeof (struct veth_port));
if (! dev) {
@@ -1064,16 +1076,11 @@ static struct net_device * __init veth_p
}
port->dev = vdev;
- dev->dev_addr[0] = 0x02;
- dev->dev_addr[1] = 0x01;
- dev->dev_addr[2] = 0xff;
- dev->dev_addr[3] = vlan;
- dev->dev_addr[4] = 0xff;
- dev->dev_addr[5] = this_lp;
+ memcpy(dev->dev_addr, mac_addr, ETH_ALEN);
dev->mtu = VETH_MAX_MTU;
- memcpy(&port->mac_addr, dev->dev_addr, 6);
+ memcpy(&port->mac_addr, mac_addr, ETH_ALEN);
dev->open = veth_open;
dev->hard_start_xmit = veth_start_xmit;
@@ -1608,7 +1615,7 @@ static int veth_probe(struct vio_dev *vd
struct net_device *dev;
struct veth_port *port;
- dev = veth_probe_one(i, &vdev->dev);
+ dev = veth_probe_one(i, vdev);
if (dev == NULL) {
veth_remove(vdev);
return 1;
@@ -1641,7 +1648,7 @@ static int veth_probe(struct vio_dev *vd
* support.
*/
static struct vio_device_id veth_device_table[] __devinitdata = {
- { "vlan", "" },
+ { "network", "IBM,iSeries-l-lan" },
{ "", "" }
};
MODULE_DEVICE_TABLE(vio, veth_device_table);
--
1.3.1.ge923
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 4/4] powerpc: update iSeries viocd and viotape device-tree
2006-05-15 3:39 [PATCH 1/4] powerpc: update iseries_veth device-tree information Stephen Rothwell
@ 2006-05-15 3:44 ` Stephen Rothwell
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2006-05-15 3:44 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
Make their device_type entries more generic and their compatible entries
more specific.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/platforms/iseries/setup.c | 8 ++++----
drivers/cdrom/viocd.c | 2 +-
drivers/char/viotape.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
c9249bed9c2383b360272b9384e5ca258d523e24
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index d3f94b4..074d1d9 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -982,8 +982,8 @@ void dt_vdevices(struct iseries_flat_dt
for (i = 0; i < HVMAXARCHITECTEDVIRTUALCDROMS; i++) {
snprintf(buf, 32, "viocd@%08x", reg + i);
dt_start_node(dt, buf);
- dt_prop_str(dt, "device_type", "viocd");
- dt_prop_str(dt, "compatible", "");
+ dt_prop_str(dt, "device_type", "block");
+ dt_prop_str(dt, "compatible", "IBM,iSeries-viocd");
dt_prop_u32(dt, "reg", reg + i);
dt_prop_u32(dt, "linux,unit_address", i);
dt_end_node(dt);
@@ -992,8 +992,8 @@ void dt_vdevices(struct iseries_flat_dt
for (i = 0; i < HVMAXARCHITECTEDVIRTUALTAPES; i++) {
snprintf(buf, 32, "viotape@%08x", reg + i);
dt_start_node(dt, buf);
- dt_prop_str(dt, "device_type", "viotape");
- dt_prop_str(dt, "compatible", "");
+ dt_prop_str(dt, "device_type", "byte");
+ dt_prop_str(dt, "compatible", "IBM,iSeries-viotape");
dt_prop_u32(dt, "reg", reg + i);
dt_prop_u32(dt, "linux,unit_address", i);
dt_end_node(dt);
diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c
index c0f817b..af6b3bf 100644
--- a/drivers/cdrom/viocd.c
+++ b/drivers/cdrom/viocd.c
@@ -731,7 +731,7 @@ static int viocd_remove(struct vio_dev *
* support.
*/
static struct vio_device_id viocd_device_table[] __devinitdata = {
- { "viocd", "" },
+ { "block", "IBM,iSeries-viocd" },
{ "", "" }
};
MODULE_DEVICE_TABLE(vio, viocd_device_table);
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c
index 60aabdb..11c7e9d 100644
--- a/drivers/char/viotape.c
+++ b/drivers/char/viotape.c
@@ -989,7 +989,7 @@ static int viotape_remove(struct vio_dev
* support.
*/
static struct vio_device_id viotape_device_table[] __devinitdata = {
- { "viotape", "" },
+ { "byte", "IBM,iSeries-viotape" },
{ "", "" }
};
MODULE_DEVICE_TABLE(vio, viotape_device_table);
--
1.3.1.ge923
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-05-15 3:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-04 3:45 [PATCH 1/4] powerpc: update iseries_veth device-tree information Stephen Rothwell
2006-05-04 3:46 ` [PATCH 2/4] powerpc: update iSeries viodasd device-tree entries Stephen Rothwell
2006-05-04 3:47 ` [PATCH 3/4] powerpc: update iSeries vdevice Stephen Rothwell
2006-05-04 3:48 ` [PATCH 4/4] powerpc: update iSeries viocd and viotape device-tree Stephen Rothwell
-- strict thread matches above, loose matches on Subject: below --
2006-05-15 3:39 [PATCH 1/4] powerpc: update iseries_veth device-tree information Stephen Rothwell
2006-05-15 3:44 ` [PATCH 4/4] powerpc: update iSeries viocd and viotape device-tree Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox