aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/scsi/esp_scsi.c
diff options
context:
space:
mode:
authorKars de Jong <jongk@linux-m68k.org>2019-11-19 21:20:21 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2019-12-19 22:08:51 -0500
commitbd40726153c646ed28f830e22a27f5e831b77017 (patch)
tree6b9689e3a29d6e8272852d2a98b79a7339f2cde6 /drivers/scsi/esp_scsi.c
parentscsi: esp_scsi: Correct ordering of PCSCSI definition in esp_rev enum (diff)
downloadwireguard-linux-bd40726153c646ed28f830e22a27f5e831b77017.tar.xz
wireguard-linux-bd40726153c646ed28f830e22a27f5e831b77017.zip
scsi: esp_scsi: Add support for FSC chip
The FSC (NCR53CF9x-2 / SYM53CF9x-2) has a different family code than QLogic or Emulex parts. This caused it to be detected as a FAS100A. Unforunately, this meant the configuration of the CONFIG3 register was incorrect. This causes data transfer issues with FAST-SCSI targets. The FSC also has the CONFIG4 register. It can be used to enable a feature called Active Negation which should always be enabled according to the data manual. Link: https://lore.kernel.org/r/20191119202021.28720-3-jongk@linux-m68k.org Reviewed-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Kars de Jong <jongk@linux-m68k.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/esp_scsi.c')
-rw-r--r--drivers/scsi/esp_scsi.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c
index 4fc3eee3138b..89afa31e33cb 100644
--- a/drivers/scsi/esp_scsi.c
+++ b/drivers/scsi/esp_scsi.c
@@ -243,8 +243,6 @@ static void esp_set_all_config3(struct esp *esp, u8 val)
/* Reset the ESP chip, _not_ the SCSI bus. */
static void esp_reset_esp(struct esp *esp)
{
- u8 family_code, version;
-
/* Now reset the ESP chip */
scsi_esp_cmd(esp, ESP_CMD_RC);
scsi_esp_cmd(esp, ESP_CMD_NULL | ESP_CMD_DMA);
@@ -257,14 +255,19 @@ static void esp_reset_esp(struct esp *esp)
*/
esp->max_period = ((35 * esp->ccycle) / 1000);
if (esp->rev == FAST) {
- version = esp_read8(ESP_UID);
- family_code = (version & 0xf8) >> 3;
- if (family_code == 0x02)
+ u8 family_code = ESP_FAMILY(esp_read8(ESP_UID));
+
+ if (family_code == ESP_UID_F236) {
esp->rev = FAS236;
- else if (family_code == 0x0a)
+ } else if (family_code == ESP_UID_HME) {
esp->rev = FASHME; /* Version is usually '5'. */
- else
+ } else if (family_code == ESP_UID_FSC) {
+ esp->rev = FSC;
+ /* Enable Active Negation */
+ esp_write8(ESP_CONFIG4_RADE, ESP_CFG4);
+ } else {
esp->rev = FAS100A;
+ }
esp->min_period = ((4 * esp->ccycle) / 1000);
} else {
esp->min_period = ((5 * esp->ccycle) / 1000);
@@ -308,7 +311,7 @@ static void esp_reset_esp(struct esp *esp)
case FAS236:
case PCSCSI:
- /* Fast 236, AM53c974 or HME */
+ case FSC:
esp_write8(esp->config2, ESP_CFG2);
if (esp->rev == FASHME) {
u8 cfg3 = esp->target[0].esp_config3;
@@ -2374,6 +2377,7 @@ static const char *esp_chip_names[] = {
"ESP236",
"FAS236",
"AM53C974",
+ "53CF9x-2",
"FAS100A",
"FAST",
"FASHME",