#define OCM_INIT_DIR_ENTRIES 5
/***************************************************************************
-* OCM dircetory default
+* OCM directory default
***************************************************************************/
static struct asd_ocm_dir OCMDirInit =
{
};
/***************************************************************************
-* OCM dircetory Entries default
+* OCM directory Entries default
***************************************************************************/
static struct asd_ocm_dir_ent OCMDirEntriesInit[OCM_INIT_DIR_ENTRIES] =
{
/* ---------- FLASH stuff ---------- */
#define FLASH_RESET 0xF0
-#define FLASH_MANUF_AMD 1
#define FLASH_SIZE 0x200000
#define FLASH_DIR_COOKIE "*** ADAPTEC FLASH DIRECTORY *** "
struct asd_manuf_phy_desc {
u8 state; /* low 4 bits */
-#define MS_PHY_STATE_ENABLEABLE 0
+#define MS_PHY_STATE_ENABLED 0
#define MS_PHY_STATE_REPORTED 1
#define MS_PHY_STATE_HIDDEN 2
u8 phy_id;
static int asd_flash_getid(struct asd_ha_struct *asd_ha)
{
int err = 0;
- u32 reg, inc;
+ u32 reg;
reg = asd_read_reg_dword(asd_ha, EXSICNFGR);
- if (!(reg & FLASHEX)) {
- ASD_DPRINTK("flash doesn't exist\n");
- return -ENOENT;
- }
if (pci_read_config_dword(asd_ha->pcidev, PCI_CONF_FLSH_BAR,
&asd_ha->hw_prof.flash.bar)) {
asd_printk("couldn't read PCI_CONF_FLSH_BAR of %s\n",
ASD_DPRINTK("couldn't reset flash(%d)\n", err);
return err;
}
- /* Get flash info. This would most likely be AMD Am29LV family flash.
- * First try the sequence for word mode. It is the same as for
- * 008B (byte mode only), 160B (word mode) and 800D (word mode).
- */
- reg = asd_ha->hw_prof.flash.bar;
- inc = asd_ha->hw_prof.flash.wide ? 2 : 1;
- asd_write_reg_byte(asd_ha, reg + 0x555, 0xAA);
- asd_write_reg_byte(asd_ha, reg + 0x2AA, 0x55);
- asd_write_reg_byte(asd_ha, reg + 0x555, 0x90);
- asd_ha->hw_prof.flash.manuf = asd_read_reg_byte(asd_ha, reg);
- asd_ha->hw_prof.flash.dev_id= asd_read_reg_byte(asd_ha,reg+inc);
- asd_ha->hw_prof.flash.sec_prot = asd_read_reg_byte(asd_ha,reg+inc+inc);
- /* Get out of autoselect mode. */
- err = asd_reset_flash(asd_ha);
-
- if (asd_ha->hw_prof.flash.manuf == FLASH_MANUF_AMD) {
- ASD_DPRINTK("0Found FLASH(%d) manuf:%d, dev_id:0x%x, "
- "sec_prot:%d\n",
- asd_ha->hw_prof.flash.wide ? 16 : 8,
- asd_ha->hw_prof.flash.manuf,
- asd_ha->hw_prof.flash.dev_id,
- asd_ha->hw_prof.flash.sec_prot);
- return 0;
- }
-
- /* Ok, try the sequence for byte mode of 160B and 800D.
- * We may actually never need this.
- */
- asd_write_reg_byte(asd_ha, reg + 0xAAA, 0xAA);
- asd_write_reg_byte(asd_ha, reg + 0x555, 0x55);
- asd_write_reg_byte(asd_ha, reg + 0xAAA, 0x90);
- asd_ha->hw_prof.flash.manuf = asd_read_reg_byte(asd_ha, reg);
- asd_ha->hw_prof.flash.dev_id = asd_read_reg_byte(asd_ha, reg + 2);
- asd_ha->hw_prof.flash.sec_prot = asd_read_reg_byte(asd_ha, reg + 4);
- err = asd_reset_flash(asd_ha);
-
- if (asd_ha->hw_prof.flash.manuf == FLASH_MANUF_AMD) {
- ASD_DPRINTK("1Found FLASH(%d) manuf:%d, dev_id:0x%x, "
- "sec_prot:%d\n",
- asd_ha->hw_prof.flash.wide ? 16 : 8,
- asd_ha->hw_prof.flash.manuf,
- asd_ha->hw_prof.flash.dev_id,
- asd_ha->hw_prof.flash.sec_prot);
- return 0;
- }
-
- return -ENOENT;
+ return 0;
}
static u16 asd_calc_flash_chksum(u16 *p, int size)
*
* HIDDEN phys do not count in the total count. REPORTED phys cannot
* be enabled but are reported and counted towards the total.
- * ENEBLEABLE phys are enabled by default and count towards the total.
+ * ENABLED phys are enabled by default and count towards the total.
* The absolute total phy number is ASD_MAX_PHYS. hw_prof->num_phys
* merely specifies the number of phys the host adapter decided to
* report. E.g., it is possible for phys 0, 1 and 2 to be HIDDEN,
- * phys 3, 4 and 5 to be REPORTED and phys 6 and 7 to be ENEBLEABLE.
+ * phys 3, 4 and 5 to be REPORTED and phys 6 and 7 to be ENABLED.
* In this case ASD_MAX_PHYS is 8, hw_prof->num_phys is 5, and only 2
* are actually enabled (enabled by default, max number of phys
* enableable in this case).
asd_ha->hw_prof.enabled_phys &= ~(1 << i);
rep_phys++;
continue;
- case MS_PHY_STATE_ENABLEABLE:
- ASD_DPRINTK("ms: phy%d: ENEBLEABLE\n", i);
+ case MS_PHY_STATE_ENABLED:
+ ASD_DPRINTK("ms: phy%d: ENABLED\n", i);
asd_ha->hw_prof.enabled_phys |= (1 << i);
en_phys++;
break;