diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_sup.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_sup.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index ad2fa01bd233..b68fb73613ed 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c | |||
@@ -22,7 +22,7 @@ static void qla2x00_nv_write(scsi_qla_host_t *, uint16_t); | |||
22 | * qla2x00_lock_nvram_access() - | 22 | * qla2x00_lock_nvram_access() - |
23 | * @ha: HA context | 23 | * @ha: HA context |
24 | */ | 24 | */ |
25 | void | 25 | static void |
26 | qla2x00_lock_nvram_access(scsi_qla_host_t *ha) | 26 | qla2x00_lock_nvram_access(scsi_qla_host_t *ha) |
27 | { | 27 | { |
28 | uint16_t data; | 28 | uint16_t data; |
@@ -55,7 +55,7 @@ qla2x00_lock_nvram_access(scsi_qla_host_t *ha) | |||
55 | * qla2x00_unlock_nvram_access() - | 55 | * qla2x00_unlock_nvram_access() - |
56 | * @ha: HA context | 56 | * @ha: HA context |
57 | */ | 57 | */ |
58 | void | 58 | static void |
59 | qla2x00_unlock_nvram_access(scsi_qla_host_t *ha) | 59 | qla2x00_unlock_nvram_access(scsi_qla_host_t *ha) |
60 | { | 60 | { |
61 | struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; | 61 | struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; |
@@ -74,7 +74,7 @@ qla2x00_unlock_nvram_access(scsi_qla_host_t *ha) | |||
74 | * | 74 | * |
75 | * Returns the word read from nvram @addr. | 75 | * Returns the word read from nvram @addr. |
76 | */ | 76 | */ |
77 | uint16_t | 77 | static uint16_t |
78 | qla2x00_get_nvram_word(scsi_qla_host_t *ha, uint32_t addr) | 78 | qla2x00_get_nvram_word(scsi_qla_host_t *ha, uint32_t addr) |
79 | { | 79 | { |
80 | uint16_t data; | 80 | uint16_t data; |
@@ -93,7 +93,7 @@ qla2x00_get_nvram_word(scsi_qla_host_t *ha, uint32_t addr) | |||
93 | * @addr: Address in NVRAM to write | 93 | * @addr: Address in NVRAM to write |
94 | * @data: word to program | 94 | * @data: word to program |
95 | */ | 95 | */ |
96 | void | 96 | static void |
97 | qla2x00_write_nvram_word(scsi_qla_host_t *ha, uint32_t addr, uint16_t data) | 97 | qla2x00_write_nvram_word(scsi_qla_host_t *ha, uint32_t addr, uint16_t data) |
98 | { | 98 | { |
99 | int count; | 99 | int count; |
@@ -550,7 +550,7 @@ qla24xx_write_flash_data(scsi_qla_host_t *ha, uint32_t *dwptr, uint32_t faddr, | |||
550 | int ret; | 550 | int ret; |
551 | uint32_t liter, miter; | 551 | uint32_t liter, miter; |
552 | uint32_t sec_mask, rest_addr, conf_addr; | 552 | uint32_t sec_mask, rest_addr, conf_addr; |
553 | uint32_t fdata, findex ; | 553 | uint32_t fdata, findex, cnt; |
554 | uint8_t man_id, flash_id; | 554 | uint8_t man_id, flash_id; |
555 | struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; | 555 | struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; |
556 | dma_addr_t optrom_dma; | 556 | dma_addr_t optrom_dma; |
@@ -690,8 +690,14 @@ qla24xx_write_flash_data(scsi_qla_host_t *ha, uint32_t *dwptr, uint32_t faddr, | |||
690 | 0xff0000) | ((fdata >> 16) & 0xff)); | 690 | 0xff0000) | ((fdata >> 16) & 0xff)); |
691 | } | 691 | } |
692 | 692 | ||
693 | /* Enable flash write-protection. */ | 693 | /* Enable flash write-protection and wait for completion. */ |
694 | qla24xx_write_flash_dword(ha, flash_conf_to_access_addr(0x101), 0x9c); | 694 | qla24xx_write_flash_dword(ha, flash_conf_to_access_addr(0x101), 0x9c); |
695 | for (cnt = 300; cnt && | ||
696 | qla24xx_read_flash_dword(ha, | ||
697 | flash_conf_to_access_addr(0x005)) & BIT_0; | ||
698 | cnt--) { | ||
699 | udelay(10); | ||
700 | } | ||
695 | 701 | ||
696 | /* Disable flash write. */ | 702 | /* Disable flash write. */ |
697 | WRT_REG_DWORD(®->ctrl_status, | 703 | WRT_REG_DWORD(®->ctrl_status, |