提交 80b02e59 编写于 作者: R Ron Mercer 提交者: Jeff Garzik

qla3xxx: Add delay to NVRAM register access.

When accessing the 93LC86 serial prom the clock high and low times must be at least 250ns each.  We have seen on some systems where the access times were much lower casing bit errors.
Signed-off-by: NRon Mercer <ron.mercer@qlogic.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 ca16497a
...@@ -208,6 +208,15 @@ static void ql_write_common_reg(struct ql3_adapter *qdev, ...@@ -208,6 +208,15 @@ static void ql_write_common_reg(struct ql3_adapter *qdev,
return; return;
} }
static void ql_write_nvram_reg(struct ql3_adapter *qdev,
u32 __iomem *reg, u32 value)
{
writel(value, reg);
readl(reg);
udelay(1);
return;
}
static void ql_write_page0_reg(struct ql3_adapter *qdev, static void ql_write_page0_reg(struct ql3_adapter *qdev,
u32 __iomem *reg, u32 value) u32 __iomem *reg, u32 value)
{ {
...@@ -336,9 +345,9 @@ static void fm93c56a_select(struct ql3_adapter *qdev) ...@@ -336,9 +345,9 @@ static void fm93c56a_select(struct ql3_adapter *qdev)
qdev->mem_map_registers; qdev->mem_map_registers;
qdev->eeprom_cmd_data = AUBURN_EEPROM_CS_1; qdev->eeprom_cmd_data = AUBURN_EEPROM_CS_1;
ql_write_common_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg, ql_write_nvram_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg,
ISP_NVRAM_MASK | qdev->eeprom_cmd_data); ISP_NVRAM_MASK | qdev->eeprom_cmd_data);
ql_write_common_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg, ql_write_nvram_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg,
((ISP_NVRAM_MASK << 16) | qdev->eeprom_cmd_data)); ((ISP_NVRAM_MASK << 16) | qdev->eeprom_cmd_data));
} }
...@@ -355,14 +364,14 @@ static void fm93c56a_cmd(struct ql3_adapter *qdev, u32 cmd, u32 eepromAddr) ...@@ -355,14 +364,14 @@ static void fm93c56a_cmd(struct ql3_adapter *qdev, u32 cmd, u32 eepromAddr)
qdev->mem_map_registers; qdev->mem_map_registers;
/* Clock in a zero, then do the start bit */ /* Clock in a zero, then do the start bit */
ql_write_common_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg, ql_write_nvram_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg,
ISP_NVRAM_MASK | qdev->eeprom_cmd_data | ISP_NVRAM_MASK | qdev->eeprom_cmd_data |
AUBURN_EEPROM_DO_1); AUBURN_EEPROM_DO_1);
ql_write_common_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg, ql_write_nvram_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg,
ISP_NVRAM_MASK | qdev-> ISP_NVRAM_MASK | qdev->
eeprom_cmd_data | AUBURN_EEPROM_DO_1 | eeprom_cmd_data | AUBURN_EEPROM_DO_1 |
AUBURN_EEPROM_CLK_RISE); AUBURN_EEPROM_CLK_RISE);
ql_write_common_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg, ql_write_nvram_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg,
ISP_NVRAM_MASK | qdev-> ISP_NVRAM_MASK | qdev->
eeprom_cmd_data | AUBURN_EEPROM_DO_1 | eeprom_cmd_data | AUBURN_EEPROM_DO_1 |
AUBURN_EEPROM_CLK_FALL); AUBURN_EEPROM_CLK_FALL);
...@@ -378,20 +387,20 @@ static void fm93c56a_cmd(struct ql3_adapter *qdev, u32 cmd, u32 eepromAddr) ...@@ -378,20 +387,20 @@ static void fm93c56a_cmd(struct ql3_adapter *qdev, u32 cmd, u32 eepromAddr)
* If the bit changed, then change the DO state to * If the bit changed, then change the DO state to
* match * match
*/ */
ql_write_common_reg(qdev, ql_write_nvram_reg(qdev,
&port_regs->CommonRegs. &port_regs->CommonRegs.
serialPortInterfaceReg, serialPortInterfaceReg,
ISP_NVRAM_MASK | qdev-> ISP_NVRAM_MASK | qdev->
eeprom_cmd_data | dataBit); eeprom_cmd_data | dataBit);
previousBit = dataBit; previousBit = dataBit;
} }
ql_write_common_reg(qdev, ql_write_nvram_reg(qdev,
&port_regs->CommonRegs. &port_regs->CommonRegs.
serialPortInterfaceReg, serialPortInterfaceReg,
ISP_NVRAM_MASK | qdev-> ISP_NVRAM_MASK | qdev->
eeprom_cmd_data | dataBit | eeprom_cmd_data | dataBit |
AUBURN_EEPROM_CLK_RISE); AUBURN_EEPROM_CLK_RISE);
ql_write_common_reg(qdev, ql_write_nvram_reg(qdev,
&port_regs->CommonRegs. &port_regs->CommonRegs.
serialPortInterfaceReg, serialPortInterfaceReg,
ISP_NVRAM_MASK | qdev-> ISP_NVRAM_MASK | qdev->
...@@ -412,20 +421,20 @@ static void fm93c56a_cmd(struct ql3_adapter *qdev, u32 cmd, u32 eepromAddr) ...@@ -412,20 +421,20 @@ static void fm93c56a_cmd(struct ql3_adapter *qdev, u32 cmd, u32 eepromAddr)
* If the bit changed, then change the DO state to * If the bit changed, then change the DO state to
* match * match
*/ */
ql_write_common_reg(qdev, ql_write_nvram_reg(qdev,
&port_regs->CommonRegs. &port_regs->CommonRegs.
serialPortInterfaceReg, serialPortInterfaceReg,
ISP_NVRAM_MASK | qdev-> ISP_NVRAM_MASK | qdev->
eeprom_cmd_data | dataBit); eeprom_cmd_data | dataBit);
previousBit = dataBit; previousBit = dataBit;
} }
ql_write_common_reg(qdev, ql_write_nvram_reg(qdev,
&port_regs->CommonRegs. &port_regs->CommonRegs.
serialPortInterfaceReg, serialPortInterfaceReg,
ISP_NVRAM_MASK | qdev-> ISP_NVRAM_MASK | qdev->
eeprom_cmd_data | dataBit | eeprom_cmd_data | dataBit |
AUBURN_EEPROM_CLK_RISE); AUBURN_EEPROM_CLK_RISE);
ql_write_common_reg(qdev, ql_write_nvram_reg(qdev,
&port_regs->CommonRegs. &port_regs->CommonRegs.
serialPortInterfaceReg, serialPortInterfaceReg,
ISP_NVRAM_MASK | qdev-> ISP_NVRAM_MASK | qdev->
...@@ -443,7 +452,7 @@ static void fm93c56a_deselect(struct ql3_adapter *qdev) ...@@ -443,7 +452,7 @@ static void fm93c56a_deselect(struct ql3_adapter *qdev)
struct ql3xxx_port_registers __iomem *port_regs = struct ql3xxx_port_registers __iomem *port_regs =
qdev->mem_map_registers; qdev->mem_map_registers;
qdev->eeprom_cmd_data = AUBURN_EEPROM_CS_0; qdev->eeprom_cmd_data = AUBURN_EEPROM_CS_0;
ql_write_common_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg, ql_write_nvram_reg(qdev, &port_regs->CommonRegs.serialPortInterfaceReg,
ISP_NVRAM_MASK | qdev->eeprom_cmd_data); ISP_NVRAM_MASK | qdev->eeprom_cmd_data);
} }
...@@ -461,12 +470,12 @@ static void fm93c56a_datain(struct ql3_adapter *qdev, unsigned short *value) ...@@ -461,12 +470,12 @@ static void fm93c56a_datain(struct ql3_adapter *qdev, unsigned short *value)
/* Read the data bits */ /* Read the data bits */
/* The first bit is a dummy. Clock right over it. */ /* The first bit is a dummy. Clock right over it. */
for (i = 0; i < dataBits; i++) { for (i = 0; i < dataBits; i++) {
ql_write_common_reg(qdev, ql_write_nvram_reg(qdev,
&port_regs->CommonRegs. &port_regs->CommonRegs.
serialPortInterfaceReg, serialPortInterfaceReg,
ISP_NVRAM_MASK | qdev->eeprom_cmd_data | ISP_NVRAM_MASK | qdev->eeprom_cmd_data |
AUBURN_EEPROM_CLK_RISE); AUBURN_EEPROM_CLK_RISE);
ql_write_common_reg(qdev, ql_write_nvram_reg(qdev,
&port_regs->CommonRegs. &port_regs->CommonRegs.
serialPortInterfaceReg, serialPortInterfaceReg,
ISP_NVRAM_MASK | qdev->eeprom_cmd_data | ISP_NVRAM_MASK | qdev->eeprom_cmd_data |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册