PERFORCE change 136198 for review

Kip Macy kmacy at FreeBSD.org
Tue Feb 26 01:42:42 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=136198

Change 136198 by kmacy at kmacy:entropy:iwarp on 2008/02/26 01:42:24

	compile firmware in directly 

Affected files ...

.. //depot/projects/iwarp/sys/dev/cxgb/bin2h.pl#1 add
.. //depot/projects/iwarp/sys/dev/cxgb/cxgb_main.c#17 edit
.. //depot/projects/iwarp/sys/dev/cxgb/cxgb_t3fw.c#1 add
.. //depot/projects/iwarp/sys/dev/cxgb/cxgb_t3fw.h#1 add
.. //depot/projects/iwarp/sys/dev/cxgb/t3fw-5.0.0.bin.gz.uu#2 delete
.. //depot/projects/iwarp/sys/modules/cxgb/cxgb/Makefile#8 edit

Differences ...

==== //depot/projects/iwarp/sys/dev/cxgb/cxgb_main.c#17 (text+ko) ====

@@ -217,6 +217,14 @@
     "use a single queue-set per port");
 
 
+/*
+ * The driver uses an auto-queue algorithm by default.
+ * To disable it and force a single queue-set per port, use singleq = 1.
+ */
+static int force_fw_update = 0;
+TUNABLE_INT("hw.cxgb.force_fw_update", &force_fw_update);
+SYSCTL_UINT(_hw_cxgb, OID_AUTO, force_fw_update, CTLFLAG_RDTUN, &force_fw_update, 0,
+    "update firmware even if up to date");
 
 int cxgb_use_16k_clusters = 0;
 TUNABLE_INT("hw.cxgb.use_16k_clusters", &cxgb_use_16k_clusters);
@@ -380,14 +388,13 @@
 	return (BUS_PROBE_DEFAULT);
 }
 
-#define FW_FNAME "t3fw%d%d%d"
+#define FW_FNAME "cxgb_t3fw"
 #define TPEEPROM_NAME "t3%ctpe%d%d%d"
 #define TPSRAM_NAME "t3%cps%d%d%d"
 
 static int
 upgrade_fw(adapter_t *sc)
 {
-	char buf[32];
 #ifdef FIRMWARE_LATEST
 	const struct firmware *fw;
 #else
@@ -395,16 +402,11 @@
 #endif	
 	int status;
 	
-	snprintf(&buf[0], sizeof(buf), FW_FNAME,  FW_VERSION_MAJOR,
-	    FW_VERSION_MINOR, FW_VERSION_MICRO);
-	
-	fw = firmware_get(buf);
-	
-	if (fw == NULL) {
-		device_printf(sc->dev, "Could not find firmware image %s\n", buf);
+	if ((fw = firmware_get(FW_FNAME)) == NULL)  {
+		device_printf(sc->dev, "Could not find firmware image %s\n", FW_FNAME);
 		return (ENOENT);
 	} else
-		device_printf(sc->dev, "updating firmware on card with %s\n", buf);
+		device_printf(sc->dev, "updating firmware on card\n");
 	status = t3_load_fw(sc, (const uint8_t *)fw->data, fw->datasize);
 
 	device_printf(sc->dev, "firmware update returned %s %d\n", (status == 0) ? "success" : "fail", status);
@@ -570,7 +572,7 @@
 	/* Create a periodic callout for checking adapter status */
 	callout_init(&sc->cxgb_tick_ch, TRUE);
 	
-	if (t3_check_fw_version(sc, &must_load) != 0 && must_load) {
+	if ((t3_check_fw_version(sc, &must_load) != 0 && must_load) || force_fw_update) {
 		/*
 		 * Warn user that a firmware update will be attempted in init.
 		 */

==== //depot/projects/iwarp/sys/modules/cxgb/cxgb/Makefile#8 (text+ko) ====

@@ -8,7 +8,7 @@
 SRCS+=	cxgb_xgmac.c cxgb_vsc7323.c cxgb_t3_hw.c cxgb_main.c 
 SRCS+=  cxgb_sge.c cxgb_lro.c cxgb_offload.c cxgb_l2t.c
 SRCS+=	device_if.h bus_if.h pci_if.h opt_zero.h opt_sched.h opt_global.h 
-SRCS+=	uipc_mvec.c cxgb_support.c
+SRCS+=	uipc_mvec.c cxgb_support.c cxgb_t3fw.c
 SRCS+=	cxgb_multiq.c 
 
 CFLAGS+= -DCONFIG_CHELSIO_T3_CORE -g -DCONFIG_DEFINED -DDEFAULT_JUMBO -I${CXGB} -DSMP
@@ -24,13 +24,6 @@
 
 
 .if ${MACHINE_ARCH} != "ia64"
-# ld is broken on ia64
-t3fw-5.0.0.bin: ${CXGB}/t3fw-5.0.0.bin.gz.uu
-	uudecode -p < ${CXGB}/t3fw-5.0.0.bin.gz.uu \
-	| gzip -dc > ${.TARGET}
-
-FIRMWS= t3fw-5.0.0.bin:t3fw500
-CLEANFILES+= t3fw-5.0.0.bin
 
 t3b_protocol_sram-1.1.0.bin: ${CXGB}/t3b_protocol_sram-1.1.0.bin.gz.uu
 	uudecode -p < ${CXGB}/t3b_protocol_sram-1.1.0.bin.gz.uu \


More information about the p4-projects mailing list