diff options
author | Mike Marciniszyn <mike.marciniszyn@qlogic.com> | 2011-01-10 20:42:21 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2011-01-10 20:42:21 -0500 |
commit | e706203c7c1cff8c27f9ce6d58911014a6bd826c (patch) | |
tree | d6dbf93ed8cc4f777b1857b3de8495bad922569d /drivers/infiniband | |
parent | f73df408b299e4bc5ed66cc50058585af64a8f9e (diff) |
IB/qib: Add a few new SERDES tunings
Add new SERDES tuning to aid manufacturing.
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/qib/qib_iba7322.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c index d23297a307aa..a9c8c7235fcd 100644 --- a/drivers/infiniband/hw/qib/qib_iba7322.c +++ b/drivers/infiniband/hw/qib/qib_iba7322.c | |||
@@ -562,6 +562,7 @@ static void write_tx_serdes_param(struct qib_pportdata *, struct txdds_ent *); | |||
562 | 562 | ||
563 | #define TXDDS_TABLE_SZ 16 /* number of entries per speed in onchip table */ | 563 | #define TXDDS_TABLE_SZ 16 /* number of entries per speed in onchip table */ |
564 | #define TXDDS_EXTRA_SZ 13 /* number of extra tx settings entries */ | 564 | #define TXDDS_EXTRA_SZ 13 /* number of extra tx settings entries */ |
565 | #define TXDDS_MFG_SZ 2 /* number of mfg tx settings entries */ | ||
565 | #define SERDES_CHANS 4 /* yes, it's obvious, but one less magic number */ | 566 | #define SERDES_CHANS 4 /* yes, it's obvious, but one less magic number */ |
566 | 567 | ||
567 | #define H1_FORCE_VAL 8 | 568 | #define H1_FORCE_VAL 8 |
@@ -5623,6 +5624,7 @@ static void set_no_qsfp_atten(struct qib_devdata *dd, int change) | |||
5623 | u32 pidx, unit, port, deflt, h1; | 5624 | u32 pidx, unit, port, deflt, h1; |
5624 | unsigned long val; | 5625 | unsigned long val; |
5625 | int any = 0, seth1; | 5626 | int any = 0, seth1; |
5627 | int txdds_size; | ||
5626 | 5628 | ||
5627 | str = txselect_list; | 5629 | str = txselect_list; |
5628 | 5630 | ||
@@ -5631,6 +5633,10 @@ static void set_no_qsfp_atten(struct qib_devdata *dd, int change) | |||
5631 | for (pidx = 0; pidx < dd->num_pports; ++pidx) | 5633 | for (pidx = 0; pidx < dd->num_pports; ++pidx) |
5632 | dd->pport[pidx].cpspec->no_eep = deflt; | 5634 | dd->pport[pidx].cpspec->no_eep = deflt; |
5633 | 5635 | ||
5636 | txdds_size = TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ; | ||
5637 | if (IS_QME(dd) || IS_QMH(dd)) | ||
5638 | txdds_size += TXDDS_MFG_SZ; | ||
5639 | |||
5634 | while (*nxt && nxt[1]) { | 5640 | while (*nxt && nxt[1]) { |
5635 | str = ++nxt; | 5641 | str = ++nxt; |
5636 | unit = simple_strtoul(str, &nxt, 0); | 5642 | unit = simple_strtoul(str, &nxt, 0); |
@@ -5653,7 +5659,7 @@ static void set_no_qsfp_atten(struct qib_devdata *dd, int change) | |||
5653 | ; | 5659 | ; |
5654 | continue; | 5660 | continue; |
5655 | } | 5661 | } |
5656 | if (val >= TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ) | 5662 | if (val >= txdds_size) |
5657 | continue; | 5663 | continue; |
5658 | seth1 = 0; | 5664 | seth1 = 0; |
5659 | h1 = 0; /* gcc thinks it might be used uninitted */ | 5665 | h1 = 0; /* gcc thinks it might be used uninitted */ |
@@ -5705,10 +5711,11 @@ static int setup_txselect(const char *str, struct kernel_param *kp) | |||
5705 | return -ENOSPC; | 5711 | return -ENOSPC; |
5706 | } | 5712 | } |
5707 | val = simple_strtoul(str, &n, 0); | 5713 | val = simple_strtoul(str, &n, 0); |
5708 | if (n == str || val >= (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ)) { | 5714 | if (n == str || val >= (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + |
5715 | TXDDS_MFG_SZ)) { | ||
5709 | printk(KERN_INFO QIB_DRV_NAME | 5716 | printk(KERN_INFO QIB_DRV_NAME |
5710 | "txselect_values must start with a number < %d\n", | 5717 | "txselect_values must start with a number < %d\n", |
5711 | TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ); | 5718 | TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + TXDDS_MFG_SZ); |
5712 | return -EINVAL; | 5719 | return -EINVAL; |
5713 | } | 5720 | } |
5714 | strcpy(txselect_list, str); | 5721 | strcpy(txselect_list, str); |
@@ -7039,6 +7046,12 @@ static const struct txdds_ent txdds_extra_qdr[TXDDS_EXTRA_SZ] = { | |||
7039 | { 0, 1, 0, 12 }, /* QMH7342 backplane settings */ | 7046 | { 0, 1, 0, 12 }, /* QMH7342 backplane settings */ |
7040 | }; | 7047 | }; |
7041 | 7048 | ||
7049 | static const struct txdds_ent txdds_extra_mfg[TXDDS_MFG_SZ] = { | ||
7050 | /* amp, pre, main, post */ | ||
7051 | { 0, 0, 0, 0 }, /* QME7342 mfg settings */ | ||
7052 | { 0, 0, 0, 6 }, /* QME7342 P2 mfg settings */ | ||
7053 | }; | ||
7054 | |||
7042 | static const struct txdds_ent *get_atten_table(const struct txdds_ent *txdds, | 7055 | static const struct txdds_ent *get_atten_table(const struct txdds_ent *txdds, |
7043 | unsigned atten) | 7056 | unsigned atten) |
7044 | { | 7057 | { |
@@ -7112,6 +7125,16 @@ static void find_best_ent(struct qib_pportdata *ppd, | |||
7112 | *sdr_dds = &txdds_extra_sdr[idx]; | 7125 | *sdr_dds = &txdds_extra_sdr[idx]; |
7113 | *ddr_dds = &txdds_extra_ddr[idx]; | 7126 | *ddr_dds = &txdds_extra_ddr[idx]; |
7114 | *qdr_dds = &txdds_extra_qdr[idx]; | 7127 | *qdr_dds = &txdds_extra_qdr[idx]; |
7128 | } else if ((IS_QME(ppd->dd) || IS_QMH(ppd->dd)) && | ||
7129 | ppd->cpspec->no_eep < (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ + | ||
7130 | TXDDS_MFG_SZ)) { | ||
7131 | idx = ppd->cpspec->no_eep - (TXDDS_TABLE_SZ + TXDDS_EXTRA_SZ); | ||
7132 | printk(KERN_INFO QIB_DRV_NAME | ||
7133 | " IB%u:%u use idx %u into txdds_mfg\n", | ||
7134 | ppd->dd->unit, ppd->port, idx); | ||
7135 | *sdr_dds = &txdds_extra_mfg[idx]; | ||
7136 | *ddr_dds = &txdds_extra_mfg[idx]; | ||
7137 | *qdr_dds = &txdds_extra_mfg[idx]; | ||
7115 | } else { | 7138 | } else { |
7116 | /* this shouldn't happen, it's range checked */ | 7139 | /* this shouldn't happen, it's range checked */ |
7117 | *sdr_dds = txdds_sdr + qib_long_atten; | 7140 | *sdr_dds = txdds_sdr + qib_long_atten; |