aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic94xx
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@us.ibm.com>2007-01-11 17:15:29 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-01-13 17:19:24 -0500
commit3b709df5f7c83b6b0907217a248a1414a37ffcb6 (patch)
tree48599caf78a257bd5e89609a4ebe8c3f70f082fd /drivers/scsi/aic94xx
parentbf2a1928f3e5d44934e974940a8260a57fcc8a58 (diff)
[SCSI] aic94xx: Fix DDB and SCB initialization
Ed Chim of Adaptec informs us that the DDB registers need to be zeroed at initialization time and that some SCB initializations need to happen even if we don't use the SCB. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aic94xx')
-rw-r--r--drivers/scsi/aic94xx/aic94xx_init.c2
-rw-r--r--drivers/scsi/aic94xx/aic94xx_sas.h1
-rw-r--r--drivers/scsi/aic94xx/aic94xx_seq.c33
3 files changed, 25 insertions, 11 deletions
diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
index 6faa10f59c18..7344f4d59a7d 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -234,7 +234,7 @@ static int __devinit asd_common_setup(struct asd_ha_struct *asd_ha)
234 } 234 }
235 /* Provide some sane default values. */ 235 /* Provide some sane default values. */
236 asd_ha->hw_prof.max_scbs = 512; 236 asd_ha->hw_prof.max_scbs = 512;
237 asd_ha->hw_prof.max_ddbs = 128; 237 asd_ha->hw_prof.max_ddbs = ASD_MAX_DDBS;
238 asd_ha->hw_prof.num_phys = ASD_MAX_PHYS; 238 asd_ha->hw_prof.num_phys = ASD_MAX_PHYS;
239 /* All phys are enabled, by default. */ 239 /* All phys are enabled, by default. */
240 asd_ha->hw_prof.enabled_phys = 0xFF; 240 asd_ha->hw_prof.enabled_phys = 0xFF;
diff --git a/drivers/scsi/aic94xx/aic94xx_sas.h b/drivers/scsi/aic94xx/aic94xx_sas.h
index 9050e93bfd5e..fa7c5290257d 100644
--- a/drivers/scsi/aic94xx/aic94xx_sas.h
+++ b/drivers/scsi/aic94xx/aic94xx_sas.h
@@ -34,6 +34,7 @@
34 * domain that this sequencer can maintain low-level connections for 34 * domain that this sequencer can maintain low-level connections for
35 * us. They are be 64 bytes. 35 * us. They are be 64 bytes.
36 */ 36 */
37#define ASD_MAX_DDBS 128
37 38
38struct asd_ddb_ssp_smp_target_port { 39struct asd_ddb_ssp_smp_target_port {
39 u8 conn_type; /* byte 0 */ 40 u8 conn_type; /* byte 0 */
diff --git a/drivers/scsi/aic94xx/aic94xx_seq.c b/drivers/scsi/aic94xx/aic94xx_seq.c
index 21569ecd8ec8..0d343cfd4333 100644
--- a/drivers/scsi/aic94xx/aic94xx_seq.c
+++ b/drivers/scsi/aic94xx/aic94xx_seq.c
@@ -907,6 +907,16 @@ static void asd_init_scb_sites(struct asd_ha_struct *asd_ha)
907 for (i = 0; i < ASD_SCB_SIZE; i += 4) 907 for (i = 0; i < ASD_SCB_SIZE; i += 4)
908 asd_scbsite_write_dword(asd_ha, site_no, i, 0); 908 asd_scbsite_write_dword(asd_ha, site_no, i, 0);
909 909
910 /* Initialize SCB Site Opcode field to invalid. */
911 asd_scbsite_write_byte(asd_ha, site_no,
912 offsetof(struct scb_header, opcode),
913 0xFF);
914
915 /* Initialize SCB Site Flags field to mean a response
916 * frame has been received. This means inadvertent
917 * frames received to be dropped. */
918 asd_scbsite_write_byte(asd_ha, site_no, 0x49, 0x01);
919
910 /* Workaround needed by SEQ to fix a SATA issue is to exclude 920 /* Workaround needed by SEQ to fix a SATA issue is to exclude
911 * certain SCB sites from the free list. */ 921 * certain SCB sites from the free list. */
912 if (!SCB_SITE_VALID(site_no)) 922 if (!SCB_SITE_VALID(site_no))
@@ -922,16 +932,6 @@ static void asd_init_scb_sites(struct asd_ha_struct *asd_ha)
922 /* Q_NEXT field of the last SCB is invalidated. */ 932 /* Q_NEXT field of the last SCB is invalidated. */
923 asd_scbsite_write_word(asd_ha, site_no, 0, first_scb_site_no); 933 asd_scbsite_write_word(asd_ha, site_no, 0, first_scb_site_no);
924 934
925 /* Initialize SCB Site Opcode field to invalid. */
926 asd_scbsite_write_byte(asd_ha, site_no,
927 offsetof(struct scb_header, opcode),
928 0xFF);
929
930 /* Initialize SCB Site Flags field to mean a response
931 * frame has been received. This means inadvertent
932 * frames received to be dropped. */
933 asd_scbsite_write_byte(asd_ha, site_no, 0x49, 0x01);
934
935 first_scb_site_no = site_no; 935 first_scb_site_no = site_no;
936 max_scbs++; 936 max_scbs++;
937 } 937 }
@@ -1173,6 +1173,16 @@ static void asd_init_ddb_0(struct asd_ha_struct *asd_ha)
1173 set_bit(0, asd_ha->hw_prof.ddb_bitmap); 1173 set_bit(0, asd_ha->hw_prof.ddb_bitmap);
1174} 1174}
1175 1175
1176static void asd_seq_init_ddb_sites(struct asd_ha_struct *asd_ha)
1177{
1178 unsigned int i;
1179 unsigned int ddb_site;
1180
1181 for (ddb_site = 0 ; ddb_site < ASD_MAX_DDBS; ddb_site++)
1182 for (i = 0; i < sizeof(struct asd_ddb_ssp_smp_target_port); i+= 4)
1183 asd_ddbsite_write_dword(asd_ha, ddb_site, i, 0);
1184}
1185
1176/** 1186/**
1177 * asd_seq_setup_seqs -- setup and initialize central and link sequencers 1187 * asd_seq_setup_seqs -- setup and initialize central and link sequencers
1178 * @asd_ha: pointer to host adapter structure 1188 * @asd_ha: pointer to host adapter structure
@@ -1182,6 +1192,9 @@ static void asd_seq_setup_seqs(struct asd_ha_struct *asd_ha)
1182 int lseq; 1192 int lseq;
1183 u8 lseq_mask; 1193 u8 lseq_mask;
1184 1194
1195 /* Initialize DDB sites */
1196 asd_seq_init_ddb_sites(asd_ha);
1197
1185 /* Initialize SCB sites. Done first to compute some values which 1198 /* Initialize SCB sites. Done first to compute some values which
1186 * the rest of the init code depends on. */ 1199 * the rest of the init code depends on. */
1187 asd_init_scb_sites(asd_ha); 1200 asd_init_scb_sites(asd_ha);