aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic94xx/aic94xx_sds.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/aic94xx/aic94xx_sds.c')
-rw-r--r--drivers/scsi/aic94xx/aic94xx_sds.c51
1 files changed, 2 insertions, 49 deletions
diff --git a/drivers/scsi/aic94xx/aic94xx_sds.c b/drivers/scsi/aic94xx/aic94xx_sds.c
index eec1e0db0e0f..83574b5b4e69 100644
--- a/drivers/scsi/aic94xx/aic94xx_sds.c
+++ b/drivers/scsi/aic94xx/aic94xx_sds.c
@@ -376,7 +376,6 @@ out:
376/* ---------- FLASH stuff ---------- */ 376/* ---------- FLASH stuff ---------- */
377 377
378#define FLASH_RESET 0xF0 378#define FLASH_RESET 0xF0
379#define FLASH_MANUF_AMD 1
380 379
381#define FLASH_SIZE 0x200000 380#define FLASH_SIZE 0x200000
382#define FLASH_DIR_COOKIE "*** ADAPTEC FLASH DIRECTORY *** " 381#define FLASH_DIR_COOKIE "*** ADAPTEC FLASH DIRECTORY *** "
@@ -627,7 +626,7 @@ static int asd_find_flash_dir(struct asd_ha_struct *asd_ha,
627static int asd_flash_getid(struct asd_ha_struct *asd_ha) 626static int asd_flash_getid(struct asd_ha_struct *asd_ha)
628{ 627{
629 int err = 0; 628 int err = 0;
630 u32 reg, inc; 629 u32 reg;
631 630
632 reg = asd_read_reg_dword(asd_ha, EXSICNFGR); 631 reg = asd_read_reg_dword(asd_ha, EXSICNFGR);
633 632
@@ -648,53 +647,7 @@ static int asd_flash_getid(struct asd_ha_struct *asd_ha)
648 ASD_DPRINTK("couldn't reset flash(%d)\n", err); 647 ASD_DPRINTK("couldn't reset flash(%d)\n", err);
649 return err; 648 return err;
650 } 649 }
651 /* Get flash info. This would most likely be AMD Am29LV family flash. 650 return 0;
652 * First try the sequence for word mode. It is the same as for
653 * 008B (byte mode only), 160B (word mode) and 800D (word mode).
654 */
655 reg = asd_ha->hw_prof.flash.bar;
656 inc = asd_ha->hw_prof.flash.wide ? 2 : 1;
657 asd_write_reg_byte(asd_ha, reg + 0x555, 0xAA);
658 asd_write_reg_byte(asd_ha, reg + 0x2AA, 0x55);
659 asd_write_reg_byte(asd_ha, reg + 0x555, 0x90);
660 asd_ha->hw_prof.flash.manuf = asd_read_reg_byte(asd_ha, reg);
661 asd_ha->hw_prof.flash.dev_id= asd_read_reg_byte(asd_ha,reg+inc);
662 asd_ha->hw_prof.flash.sec_prot = asd_read_reg_byte(asd_ha,reg+inc+inc);
663 /* Get out of autoselect mode. */
664 err = asd_reset_flash(asd_ha);
665
666 if (asd_ha->hw_prof.flash.manuf == FLASH_MANUF_AMD) {
667 ASD_DPRINTK("0Found FLASH(%d) manuf:%d, dev_id:0x%x, "
668 "sec_prot:%d\n",
669 asd_ha->hw_prof.flash.wide ? 16 : 8,
670 asd_ha->hw_prof.flash.manuf,
671 asd_ha->hw_prof.flash.dev_id,
672 asd_ha->hw_prof.flash.sec_prot);
673 return 0;
674 }
675
676 /* Ok, try the sequence for byte mode of 160B and 800D.
677 * We may actually never need this.
678 */
679 asd_write_reg_byte(asd_ha, reg + 0xAAA, 0xAA);
680 asd_write_reg_byte(asd_ha, reg + 0x555, 0x55);
681 asd_write_reg_byte(asd_ha, reg + 0xAAA, 0x90);
682 asd_ha->hw_prof.flash.manuf = asd_read_reg_byte(asd_ha, reg);
683 asd_ha->hw_prof.flash.dev_id = asd_read_reg_byte(asd_ha, reg + 2);
684 asd_ha->hw_prof.flash.sec_prot = asd_read_reg_byte(asd_ha, reg + 4);
685 err = asd_reset_flash(asd_ha);
686
687 if (asd_ha->hw_prof.flash.manuf == FLASH_MANUF_AMD) {
688 ASD_DPRINTK("1Found FLASH(%d) manuf:%d, dev_id:0x%x, "
689 "sec_prot:%d\n",
690 asd_ha->hw_prof.flash.wide ? 16 : 8,
691 asd_ha->hw_prof.flash.manuf,
692 asd_ha->hw_prof.flash.dev_id,
693 asd_ha->hw_prof.flash.sec_prot);
694 return 0;
695 }
696
697 return -ENOENT;
698} 651}
699 652
700static u16 asd_calc_flash_chksum(u16 *p, int size) 653static u16 asd_calc_flash_chksum(u16 *p, int size)