diff options
author | Hannes Reinecke <hare@suse.de> | 2014-11-24 09:37:27 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-24 10:13:16 -0500 |
commit | eeea2f9c2f2ecc5f3217edcacc95817047b143c2 (patch) | |
tree | 30ae59b8af6754aca843d83a334f040459f1a031 /drivers/scsi/esp_scsi.c | |
parent | 6df388f2d549d3a2a7ad58b632d2ecd25fc0ff3f (diff) |
esp_scsi: correctly detect am53c974
The am53c974 returns the same ID as the FAS236, but implements
things slightly differently. So detect the am53c974 by checking
for ESP_CONFIG4 register.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/esp_scsi.c')
-rw-r--r-- | drivers/scsi/esp_scsi.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c index 4366011cd400..3fb6a00934bc 100644 --- a/drivers/scsi/esp_scsi.c +++ b/drivers/scsi/esp_scsi.c | |||
@@ -268,6 +268,19 @@ static void esp_reset_esp(struct esp *esp) | |||
268 | } else { | 268 | } else { |
269 | esp->min_period = ((5 * esp->ccycle) / 1000); | 269 | esp->min_period = ((5 * esp->ccycle) / 1000); |
270 | } | 270 | } |
271 | if (esp->rev == FAS236) { | ||
272 | /* | ||
273 | * The AM53c974 chip returns the same ID as FAS236; | ||
274 | * try to configure glitch eater. | ||
275 | */ | ||
276 | u8 config4 = ESP_CONFIG4_GE1; | ||
277 | esp_write8(config4, ESP_CFG4); | ||
278 | config4 = esp_read8(ESP_CFG4); | ||
279 | if (config4 & ESP_CONFIG4_GE1) { | ||
280 | esp->rev = PCSCSI; | ||
281 | esp_write8(esp->config4, ESP_CFG4); | ||
282 | } | ||
283 | } | ||
271 | esp->max_period = (esp->max_period + 3)>>2; | 284 | esp->max_period = (esp->max_period + 3)>>2; |
272 | esp->min_period = (esp->min_period + 3)>>2; | 285 | esp->min_period = (esp->min_period + 3)>>2; |
273 | 286 | ||
@@ -293,7 +306,8 @@ static void esp_reset_esp(struct esp *esp) | |||
293 | /* fallthrough... */ | 306 | /* fallthrough... */ |
294 | 307 | ||
295 | case FAS236: | 308 | case FAS236: |
296 | /* Fast 236 or HME */ | 309 | case PCSCSI: |
310 | /* Fast 236, AM53c974 or HME */ | ||
297 | esp_write8(esp->config2, ESP_CFG2); | 311 | esp_write8(esp->config2, ESP_CFG2); |
298 | if (esp->rev == FASHME) { | 312 | if (esp->rev == FASHME) { |
299 | u8 cfg3 = esp->target[0].esp_config3; | 313 | u8 cfg3 = esp->target[0].esp_config3; |
@@ -2364,6 +2378,7 @@ static const char *esp_chip_names[] = { | |||
2364 | "FAS100A", | 2378 | "FAS100A", |
2365 | "FAST", | 2379 | "FAST", |
2366 | "FASHME", | 2380 | "FASHME", |
2381 | "AM53C974", | ||
2367 | }; | 2382 | }; |
2368 | 2383 | ||
2369 | static struct scsi_transport_template *esp_transport_template; | 2384 | static struct scsi_transport_template *esp_transport_template; |