Skip to content

Commit dbb0743

Browse files
adamgruchalainteldjbw
authored andcommitted
isci: Added support for C0 to SCU Driver
C0 silicon updates the pci revision id and requires new AFE parameters for phy signal integrity. Support for previous silicon revisions is deprecated (it's also broken for the theoretical case of multiple controllers at different silicon revisions, all the more reason to get it removed as soon as possible) Signed-off-by: Adam Gruchala <[email protected]> [fixed up deprecated silicon support] Signed-off-by: Dan Williams <[email protected]>
1 parent 12ef654 commit dbb0743

File tree

6 files changed

+88
-39
lines changed

6 files changed

+88
-39
lines changed

drivers/scsi/isci/firmware/create_fw.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ static const int max_num_concurrent_dev_spin_up = 1;
6565
static const int enable_ssc;
6666

6767
/* AFE_TX_AMP_CONTROL */
68-
static const unsigned int afe_tx_amp_control0 = 0x000e7c03;
69-
static const unsigned int afe_tx_amp_control1 = 0x000e7c03;
70-
static const unsigned int afe_tx_amp_control2 = 0x000e7c03;
71-
static const unsigned int afe_tx_amp_control3 = 0x000e7c03;
68+
static const unsigned int afe_tx_amp_control0 = 0x000bdd08;
69+
static const unsigned int afe_tx_amp_control1 = 0x000ffc00;
70+
static const unsigned int afe_tx_amp_control2 = 0x000b7c09;
71+
static const unsigned int afe_tx_amp_control3 = 0x000afc6e;
7272

7373
static const char blob_name[] = "isci_firmware.bin";
7474
static const char sig[] = "ISCUOEMB";

drivers/scsi/isci/host.c

+34-6
Original file line numberDiff line numberDiff line change
@@ -2070,13 +2070,13 @@ static void scic_sds_controller_afe_initialization(struct scic_sds_controller *s
20702070
writel(0x00005500, &scic->scu_registers->afe.afe_bias_control);
20712071
else if (is_a2())
20722072
writel(0x00005A00, &scic->scu_registers->afe.afe_bias_control);
2073-
else if (is_b0())
2073+
else if (is_b0() || is_c0())
20742074
writel(0x00005F00, &scic->scu_registers->afe.afe_bias_control);
20752075

20762076
udelay(AFE_REGISTER_WRITE_DELAY);
20772077

20782078
/* Enable PLL */
2079-
if (is_b0())
2079+
if (is_b0() || is_c0())
20802080
writel(0x80040A08, &scic->scu_registers->afe.afe_pll_control0);
20812081
else
20822082
writel(0x80040908, &scic->scu_registers->afe.afe_pll_control0);
@@ -2102,6 +2102,16 @@ static void scic_sds_controller_afe_initialization(struct scic_sds_controller *s
21022102
/* Configure transmitter SSC parameters */
21032103
writel(0x00030000, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_ssc_control);
21042104
udelay(AFE_REGISTER_WRITE_DELAY);
2105+
} else if (is_c0()) {
2106+
/* Configure transmitter SSC parameters */
2107+
writel(0x0003000, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_ssc_control);
2108+
udelay(AFE_REGISTER_WRITE_DELAY);
2109+
2110+
/*
2111+
* All defaults, except the Receive Word Alignament/Comma Detect
2112+
* Enable....(0xe800) */
2113+
writel(0x00004500, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_xcvr_control0);
2114+
udelay(AFE_REGISTER_WRITE_DELAY);
21052115
} else {
21062116
/*
21072117
* All defaults, except the Receive Word Alignament/Comma Detect
@@ -2120,15 +2130,23 @@ static void scic_sds_controller_afe_initialization(struct scic_sds_controller *s
21202130
writel(0x000003D4, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
21212131
else if (is_a2())
21222132
writel(0x000003F0, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
2123-
else {
2133+
else if (is_b0()) {
21242134
/* Power down TX and RX (PWRDNTX and PWRDNRX) */
2125-
writel(0x000003d7, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
2135+
writel(0x000003D7, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
2136+
udelay(AFE_REGISTER_WRITE_DELAY);
2137+
2138+
/*
2139+
* Power up TX and RX out from power down (PWRDNTX and PWRDNRX)
2140+
* & increase TX int & ext bias 20%....(0xe85c) */
2141+
writel(0x000003D4, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
2142+
} else {
2143+
writel(0x000001E7, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
21262144
udelay(AFE_REGISTER_WRITE_DELAY);
21272145

21282146
/*
21292147
* Power up TX and RX out from power down (PWRDNTX and PWRDNRX)
21302148
* & increase TX int & ext bias 20%....(0xe85c) */
2131-
writel(0x000003d4, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
2149+
writel(0x000001E4, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_channel_control);
21322150
}
21332151
udelay(AFE_REGISTER_WRITE_DELAY);
21342152

@@ -2149,12 +2167,22 @@ static void scic_sds_controller_afe_initialization(struct scic_sds_controller *s
21492167
writel(0x3F09983F, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control0);
21502168
else if (is_a2())
21512169
writel(0x3F11103F, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control0);
2152-
else {
2170+
else if (is_b0()) {
21532171
writel(0x3F11103F, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control0);
21542172
udelay(AFE_REGISTER_WRITE_DELAY);
2173+
/* Enable TX equalization (0xe824) */
2174+
writel(0x00040000, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_control);
2175+
} else {
2176+
writel(0x0140DF0F, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control1);
2177+
udelay(AFE_REGISTER_WRITE_DELAY);
2178+
2179+
writel(0x3F6F103F, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_rx_ssc_control0);
2180+
udelay(AFE_REGISTER_WRITE_DELAY);
2181+
21552182
/* Enable TX equalization (0xe824) */
21562183
writel(0x00040000, &scic->scu_registers->afe.scu_afe_xcvr[phy_id].afe_tx_control);
21572184
}
2185+
21582186
udelay(AFE_REGISTER_WRITE_DELAY);
21592187

21602188
writel(oem_phy->afe_tx_amp_control0,

drivers/scsi/isci/host.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,7 @@ enum {
675675
ISCI_SI_REVA0,
676676
ISCI_SI_REVA2,
677677
ISCI_SI_REVB0,
678+
ISCI_SI_REVC0
678679
};
679680

680681
extern int isci_si_rev;
@@ -691,7 +692,12 @@ static inline bool is_a2(void)
691692

692693
static inline bool is_b0(void)
693694
{
694-
return isci_si_rev > ISCI_SI_REVA2;
695+
return isci_si_rev == ISCI_SI_REVB0;
696+
}
697+
698+
static inline bool is_c0(void)
699+
{
700+
return isci_si_rev > ISCI_SI_REVB0;
695701
}
696702

697703
void scic_sds_controller_post_request(struct scic_sds_controller *scic,

drivers/scsi/isci/init.c

+16-16
Original file line numberDiff line numberDiff line change
@@ -437,27 +437,27 @@ static struct isci_host *isci_host_alloc(struct pci_dev *pdev, int id)
437437

438438
static void check_si_rev(struct pci_dev *pdev)
439439
{
440-
if (num_controllers(pdev) > 1)
440+
switch (pdev->revision) {
441+
case 0:
442+
case 1:
443+
/* if the id is ambiguous don't update isci_si_rev */
444+
break;
445+
case 3:
446+
isci_si_rev = ISCI_SI_REVA2;
447+
break;
448+
case 4:
441449
isci_si_rev = ISCI_SI_REVB0;
442-
else {
443-
switch (pdev->revision) {
444-
case 0:
445-
case 1:
446-
/* if the id is ambiguous don't update isci_si_rev */
447-
break;
448-
case 3:
449-
isci_si_rev = ISCI_SI_REVA2;
450-
break;
451-
default:
452-
case 4:
453-
isci_si_rev = ISCI_SI_REVB0;
454-
break;
455-
}
450+
break;
451+
default:
452+
case 5:
453+
isci_si_rev = ISCI_SI_REVC0;
454+
break;
456455
}
457456

458457
dev_info(&pdev->dev, "driver configured for %s silicon (rev: %d)\n",
459458
isci_si_rev == ISCI_SI_REVA0 ? "A0" :
460-
isci_si_rev == ISCI_SI_REVA2 ? "A2" : "B0", pdev->revision);
459+
isci_si_rev == ISCI_SI_REVA2 ? "A2" :
460+
isci_si_rev == ISCI_SI_REVB0 ? "B0" : "C0", pdev->revision);
461461

462462
}
463463

drivers/scsi/isci/probe_roms.c

+15
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ enum sci_status isci_parse_oem_parameters(union scic_oem_parameters *oem_params,
136136
struct isci_orom *isci_request_firmware(struct pci_dev *pdev, const struct firmware *fw)
137137
{
138138
struct isci_orom *orom = NULL, *data;
139+
int i, j;
139140

140141
if (request_firmware(&fw, ISCI_FW_NAME, &pdev->dev) != 0)
141142
return NULL;
@@ -155,6 +156,20 @@ struct isci_orom *isci_request_firmware(struct pci_dev *pdev, const struct firmw
155156

156157
memcpy(orom, fw->data, fw->size);
157158

159+
/*
160+
* deprecated: override default amp_control for pre-preproduction
161+
* silicon revisions
162+
*/
163+
if (isci_si_rev <= ISCI_SI_REVB0)
164+
goto out;
165+
166+
for (i = 0; i < ARRAY_SIZE(orom->ctrl); i++)
167+
for (j = 0; j < ARRAY_SIZE(orom->ctrl[i].phys); j++) {
168+
orom->ctrl[i].phys[j].afe_tx_amp_control0 = 0xe7c03;
169+
orom->ctrl[i].phys[j].afe_tx_amp_control1 = 0xe7c03;
170+
orom->ctrl[i].phys[j].afe_tx_amp_control2 = 0xe7c03;
171+
orom->ctrl[i].phys[j].afe_tx_amp_control3 = 0xe7c03;
172+
}
158173
out:
159174
release_firmware(fw);
160175

firmware/isci/isci_firmware.bin.ihex

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
:10000000495343554F454D42E80018100002000087
22
:1000100000000000000000000101000000000000DE
3-
:10002000FFFFCF5F01000000037C0E00037C0E0089
4-
:10003000037C0E00037C0E00FFFFCF5F0100000079
5-
:10004000037C0E00037C0E00037C0E00037C0E007C
6-
:10005000FFFFCF5F01000000037C0E00037C0E0059
7-
:10006000037C0E00037C0E00FFFFCF5F0100000049
8-
:10007000037C0E00037C0E00037C0E00037C0E004C
3+
:10002000FFFFCF5F0100000008DD0B0000FC0F00A8
4+
:10003000097C0B006EFC0A00FFFFCF5F010000008F
5+
:1000400008DD0B0000FC0F00097C0B006EFC0A00B1
6+
:10005000FFFFCF5F0100000008DD0B0000FC0F0078
7+
:10006000097C0B006EFC0A00FFFFCF5F010000005F
8+
:1000700008DD0B0000FC0F00097C0B006EFC0A0081
99
:100080000101000000000000FFFFCF5F0200000040
10-
:10009000037C0E00037C0E00037C0E00037C0E002C
11-
:1000A000FFFFCF5F02000000037C0E00037C0E0008
12-
:1000B000037C0E00037C0E00FFFFCF5F02000000F8
13-
:1000C000037C0E00037C0E00037C0E00037C0E00FC
14-
:1000D000FFFFCF5F02000000037C0E00037C0E00D8
15-
:0800E000037C0E00037C0E00FE
10+
:1000900008DD0B0000FC0F00097C0B006EFC0A0061
11+
:1000A000FFFFCF5F0200000008DD0B0000FC0F0027
12+
:1000B000097C0B006EFC0A00FFFFCF5F020000000E
13+
:1000C00008DD0B0000FC0F00097C0B006EFC0A0031
14+
:1000D000FFFFCF5F0200000008DD0B0000FC0F00F7
15+
:0800E000097C0B006EFC0A0014
1616
:00000001FF

0 commit comments

Comments
 (0)