aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb3/cxgb3_main.c
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2007-05-31 00:10:58 -0400
committerJeff Garzik <jeff@garzik.org>2007-07-08 22:16:39 -0400
commit480fe1a31c662ef4ff0598a7cacefa21f98335f1 (patch)
tree66da8f259d7093d7f9290054f4fbda1f68ff9e0a /drivers/net/cxgb3/cxgb3_main.c
parent8a9fab22cf6a3abde7731f4425d4ff87509bc15a (diff)
cxgb3 - TP SRAM update
The chip executes microcode present in internal RAM, whose content is loaded from EEPROM on power cycle. This patch allows an update of the microcode through PIO without forcing a power cycle. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/cxgb3/cxgb3_main.c')
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index d8a1f5452c51..15defe4c4f05 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -2088,6 +2088,42 @@ static void cxgb_netpoll(struct net_device *dev)
2088} 2088}
2089#endif 2089#endif
2090 2090
2091#define TPSRAM_NAME "t3%c_protocol_sram-%d.%d.%d.bin"
2092int update_tpsram(struct adapter *adap)
2093{
2094 const struct firmware *tpsram;
2095 char buf[64];
2096 struct device *dev = &adap->pdev->dev;
2097 int ret;
2098 char rev;
2099
2100 rev = adap->params.rev == T3_REV_B2 ? 'b' : 'a';
2101
2102 snprintf(buf, sizeof(buf), TPSRAM_NAME, rev,
2103 TP_VERSION_MAJOR, TP_VERSION_MINOR, TP_VERSION_MICRO);
2104
2105 ret = request_firmware(&tpsram, buf, dev);
2106 if (ret < 0) {
2107 dev_err(dev, "could not load TP SRAM: unable to load %s\n",
2108 buf);
2109 return ret;
2110 }
2111
2112 ret = t3_check_tpsram(adap, tpsram->data, tpsram->size);
2113 if (ret)
2114 goto release_tpsram;
2115
2116 ret = t3_set_proto_sram(adap, tpsram->data);
2117 if (ret)
2118 dev_err(dev, "loading protocol SRAM failed\n");
2119
2120release_tpsram:
2121 release_firmware(tpsram);
2122
2123 return ret;
2124}
2125
2126
2091/* 2127/*
2092 * Periodic accumulation of MAC statistics. 2128 * Periodic accumulation of MAC statistics.
2093 */ 2129 */
@@ -2437,6 +2473,13 @@ static int __devinit init_one(struct pci_dev *pdev,
2437 goto out_free_dev; 2473 goto out_free_dev;
2438 } 2474 }
2439 2475
2476 err = t3_check_tpsram_version(adapter);
2477 if (err == -EINVAL)
2478 err = update_tpsram(adapter);
2479
2480 if (err)
2481 goto out_free_dev;
2482
2440 /* 2483 /*
2441 * The card is now ready to go. If any errors occur during device 2484 * The card is now ready to go. If any errors occur during device
2442 * registration we do not fail the whole card but rather proceed only 2485 * registration we do not fail the whole card but rather proceed only