add support for the intel i210, i211, and i217 gbe chipsets to the 82563 driver. these chipsets appear on new haswell- based motherboards. the code was developed from the datasheet, so there may be additional fixes necessary once hardware is available. Reference: /n/atom/patch/applied2013/i82563-i210 Date: Thu Jun 20 16:24:39 CES 2013 Signed-off-by: quanstro@quanstro.net --- /sys/src/9/pc/ether82563.c Thu Jun 20 16:20:53 2013 +++ /sys/src/9/pc/ether82563.c Thu Jun 20 16:20:55 2013 @@ -1,5 +1,5 @@ /* - * Intel 8256[367], 8257[1-9], 8258[03], i350 + * Intel 8256[367], 8257[1-9], 8258[03], i21[01], i350 * Gigabit Ethernet PCI-Express Controllers * Coraid EtherDrive® hba */ @@ -416,7 +416,7 @@ Nrd = 256, /* power of two */ Ntd = 256, /* power of two */ Nrb = 3*512, /* private receive buffers per Ctlr */ - Rbalign = 4096, /* rx buffer alignment */ + Rbalign = 16, /* rx buffer alignment */ Npool = 10, }; @@ -442,6 +442,7 @@ i82579, i82580, i82583, + i210, i350, Nctlrtype, }; @@ -481,6 +482,7 @@ i82579, 9018, Fload|Fert|F79phy, "i82579", i82580, 9728, F75|F79phy, "i82580", i82583, 1514, 0, "i82583", + i210, 9728, F75|F79phy, "i210", i350, 9728, F75|F79phy, "i350", }; @@ -659,7 +661,7 @@ } static long -i82563ifstat(Ether *edev, void *a, long n, ulong offset) +i82563ifstat(Ether *edev, void *a, long n, usize offset) { char *s, *p, *e, *stat; int i, r; @@ -764,6 +766,8 @@ x = addr[5]>>1; if(ctlr->type == i82566) x &= 31; + if(ctlr->type == i210) + x &= 15; bit = ((addr[5] & 1)<<4)|(addr[4]>>4); /* * multiple ether addresses can hash to the same filter bit, @@ -1805,7 +1809,7 @@ csr32w(ctlr, Mta + i*4, 0); csr32w(ctlr, Fcal, 0x00C28001); csr32w(ctlr, Fcah, 0x0100); - if(ctlr->type != i82579 && ctlr->type != i350) + if(ctlr->type != i82579 && ctlr->type != i210 && ctlr->type != i350) csr32w(ctlr, Fct, 0x8808); csr32w(ctlr, Fcttv, 0x0100); csr32w(ctlr, Fcrtl, ctlr->fcrtl); @@ -1950,6 +1954,14 @@ return i82580; case 0x1506: /* v */ return i82583; + case 0x1533: /* i210-t1 */ + case 0x1534: + case 0x1536: /* fiber */ + case 0x1538: + case 0x1539: /* i211 */ + case 0x153a: /* i217-lm */ + case 0x153b: /* i217-v */ + return i210; case 0x151f: /* “powerville” eeprom-less */ case 0x1521: /* copper */ case 0x1522: /* fiber */ @@ -2162,6 +2174,12 @@ } static int +i210pnp(Ether *e) +{ + return pnp(e, i210); +} + +static int i350pnp(Ether *e) { return pnp(e, i350); @@ -2190,6 +2208,7 @@ addethercard("i82579", i82579pnp); addethercard("i82580", i82580pnp); addethercard("i82583", i82583pnp); + addethercard("i210", i210pnp); addethercard("i350", i350pnp); addethercard("igbepcie", anypnp); } --- /sys/src/9/pcpae/ether82563.c Thu Jun 20 16:20:57 2013 +++ /sys/src/9/pcpae/ether82563.c Thu Jun 20 16:20:59 2013 @@ -1,5 +1,5 @@ /* - * Intel 8256[367], 8257[1-9], 8258[03], i350 + * Intel 8256[367], 8257[1-9], 8258[03], i21[01], i350 * Gigabit Ethernet PCI-Express Controllers * Coraid EtherDrive® hba */ @@ -416,7 +416,7 @@ Nrd = 256, /* power of two */ Ntd = 256, /* power of two */ Nrb = 3*512, /* private receive buffers per Ctlr */ - Rbalign = 4096, /* rx buffer alignment */ + Rbalign = 16, /* rx buffer alignment */ Npool = 10, }; @@ -442,6 +442,7 @@ i82579, i82580, i82583, + i210, i350, Nctlrtype, }; @@ -481,6 +482,7 @@ i82579, 9018, Fload|Fert|F79phy, "i82579", i82580, 9728, F75|F79phy, "i82580", i82583, 1514, 0, "i82583", + i210, 9728, F75|F79phy, "i210", i350, 9728, F75|F79phy, "i350", }; @@ -659,7 +661,7 @@ } static long -i82563ifstat(Ether *edev, void *a, long n, ulong offset) +i82563ifstat(Ether *edev, void *a, long n, usize offset) { char *s, *p, *e, *stat; int i, r; @@ -764,6 +766,8 @@ x = addr[5]>>1; if(ctlr->type == i82566) x &= 31; + if(ctlr->type == i210) + x &= 15; bit = ((addr[5] & 1)<<4)|(addr[4]>>4); /* * multiple ether addresses can hash to the same filter bit, @@ -1805,7 +1809,7 @@ csr32w(ctlr, Mta + i*4, 0); csr32w(ctlr, Fcal, 0x00C28001); csr32w(ctlr, Fcah, 0x0100); - if(ctlr->type != i82579 && ctlr->type != i350) + if(ctlr->type != i82579 && ctlr->type != i210 && ctlr->type != i350) csr32w(ctlr, Fct, 0x8808); csr32w(ctlr, Fcttv, 0x0100); csr32w(ctlr, Fcrtl, ctlr->fcrtl); @@ -1950,6 +1954,14 @@ return i82580; case 0x1506: /* v */ return i82583; + case 0x1533: /* i210-t1 */ + case 0x1534: + case 0x1536: /* fiber */ + case 0x1538: + case 0x1539: /* i211 */ + case 0x153a: /* i217-lm */ + case 0x153b: /* i217-v */ + return i210; case 0x151f: /* “powerville” eeprom-less */ case 0x1521: /* copper */ case 0x1522: /* fiber */ @@ -2162,6 +2174,12 @@ } static int +i210pnp(Ether *e) +{ + return pnp(e, i210); +} + +static int i350pnp(Ether *e) { return pnp(e, i350); @@ -2190,6 +2208,7 @@ addethercard("i82579", i82579pnp); addethercard("i82580", i82580pnp); addethercard("i82583", i82583pnp); + addethercard("i210", i210pnp); addethercard("i350", i350pnp); addethercard("igbepcie", anypnp); } --- /sys/src/nix/k10/ether82563.c Thu Jun 20 16:21:01 2013 +++ /sys/src/nix/k10/ether82563.c Thu Jun 20 16:21:03 2013 @@ -1,5 +1,5 @@ /* - * Intel 8256[367], 8257[1-9], 8258[03], i350 + * Intel 8256[367], 8257[1-9], 8258[03], i21[01], i350 * Gigabit Ethernet PCI-Express Controllers * Coraid EtherDrive® hba */ @@ -442,6 +442,7 @@ i82579, i82580, i82583, + i210, i350, Nctlrtype, }; @@ -481,6 +482,7 @@ i82579, 9018, Fload|Fert|F79phy, "i82579", i82580, 9728, F75|F79phy, "i82580", i82583, 1514, 0, "i82583", + i210, 9728, F75|F79phy, "i210", i350, 9728, F75|F79phy, "i350", }; @@ -764,6 +766,8 @@ x = addr[5]>>1; if(ctlr->type == i82566) x &= 31; + if(ctlr->type == i210) + x &= 15; bit = ((addr[5] & 1)<<4)|(addr[4]>>4); /* * multiple ether addresses can hash to the same filter bit, @@ -1805,7 +1809,7 @@ csr32w(ctlr, Mta + i*4, 0); csr32w(ctlr, Fcal, 0x00C28001); csr32w(ctlr, Fcah, 0x0100); - if(ctlr->type != i82579 && ctlr->type != i350) + if(ctlr->type != i82579 && ctlr->type != i210 && ctlr->type != i350) csr32w(ctlr, Fct, 0x8808); csr32w(ctlr, Fcttv, 0x0100); csr32w(ctlr, Fcrtl, ctlr->fcrtl); @@ -1950,6 +1954,14 @@ return i82580; case 0x1506: /* v */ return i82583; + case 0x1533: /* i210-t1 */ + case 0x1534: + case 0x1536: /* fiber */ + case 0x1538: + case 0x1539: /* i211 */ + case 0x153a: /* i217-lm */ + case 0x153b: /* i217-v */ + return i210; case 0x151f: /* “powerville” eeprom-less */ case 0x1521: /* copper */ case 0x1522: /* fiber */ @@ -2162,6 +2174,12 @@ } static int +i210pnp(Ether *e) +{ + return pnp(e, i210); +} + +static int i350pnp(Ether *e) { return pnp(e, i350); @@ -2190,6 +2208,7 @@ addethercard("i82579", i82579pnp); addethercard("i82580", i82580pnp); addethercard("i82583", i82583pnp); + addethercard("i210", i210pnp); addethercard("i350", i350pnp); addethercard("igbepcie", anypnp); }