Commit 0d90c34c authored by Joe Carnuccio's avatar Joe Carnuccio Committed by Christoph Hellwig

qla2xxx: Correct operations for ISP27xx template types 270 and 271.

Signed-off-by: default avatarJoe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: default avatarSaurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent acd3ce88
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
* | | | 0xb13c-0xb140 | * | | | 0xb13c-0xb140 |
* | | | 0xb149 | * | | | 0xb149 |
* | MultiQ | 0xc00c | | * | MultiQ | 0xc00c | |
* | Misc | 0xd2ff | 0xd017-0xd019 | * | Misc | 0xd300 | 0xd017-0xd019 |
* | | | 0xd020 | * | | | 0xd020 |
* | | | 0xd02e-0xd0ff | * | | | 0xd02e-0xd0ff |
* | | | 0xd101-0xd1fe | * | | | 0xd101-0xd1fe |
......
...@@ -191,6 +191,19 @@ static inline void (*qla27xx_read_vector(uint width))(void *, void *, ulong *) ...@@ -191,6 +191,19 @@ static inline void (*qla27xx_read_vector(uint width))(void *, void *, ulong *)
qla27xx_read32; qla27xx_read32;
} }
static inline void
qla27xx_read_off(__iomem struct device_reg_24xx *reg,
uint offset, void *buf, ulong *len)
{
void *window = (void *)reg + offset;
if (buf) {
ql_dbg(ql_dbg_misc, NULL, 0xd300,
"%s: @%x\n", __func__, offset);
}
qla27xx_read32(window, buf, len);
}
static inline void static inline void
qla27xx_read_reg(__iomem struct device_reg_24xx *reg, qla27xx_read_reg(__iomem struct device_reg_24xx *reg,
uint offset, void *buf, ulong *len) uint offset, void *buf, ulong *len)
...@@ -590,7 +603,6 @@ qla27xx_fwdt_entry_t270(struct scsi_qla_host *vha, ...@@ -590,7 +603,6 @@ qla27xx_fwdt_entry_t270(struct scsi_qla_host *vha,
struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) struct qla27xx_fwdt_entry *ent, void *buf, ulong *len)
{ {
struct device_reg_24xx __iomem *reg = qla27xx_isp_reg(vha); struct device_reg_24xx __iomem *reg = qla27xx_isp_reg(vha);
void *window = (void *)reg + 0xc4;
ulong dwords = ent->t270.count; ulong dwords = ent->t270.count;
ulong addr = ent->t270.addr; ulong addr = ent->t270.addr;
...@@ -599,9 +611,8 @@ qla27xx_fwdt_entry_t270(struct scsi_qla_host *vha, ...@@ -599,9 +611,8 @@ qla27xx_fwdt_entry_t270(struct scsi_qla_host *vha,
qla27xx_write_reg(reg, IOBASE_ADDR, 0x40, buf); qla27xx_write_reg(reg, IOBASE_ADDR, 0x40, buf);
while (dwords--) { while (dwords--) {
qla27xx_write_reg(reg, 0xc0, addr|0x80000000, buf); qla27xx_write_reg(reg, 0xc0, addr|0x80000000, buf);
qla27xx_read_reg(reg, 0xc4, buf, len);
qla27xx_insert32(addr, buf, len); qla27xx_insert32(addr, buf, len);
qla27xx_read32(window, buf, len); qla27xx_read_off(reg, 0xc4, buf, len);
addr++; addr++;
} }
...@@ -614,12 +625,12 @@ qla27xx_fwdt_entry_t271(struct scsi_qla_host *vha, ...@@ -614,12 +625,12 @@ qla27xx_fwdt_entry_t271(struct scsi_qla_host *vha,
{ {
struct device_reg_24xx __iomem *reg = qla27xx_isp_reg(vha); struct device_reg_24xx __iomem *reg = qla27xx_isp_reg(vha);
ulong addr = ent->t271.addr; ulong addr = ent->t271.addr;
ulong data = ent->t271.data;
ql_dbg(ql_dbg_misc, vha, 0xd20f, ql_dbg(ql_dbg_misc, vha, 0xd20f,
"%s: wrremreg [%lx]\n", __func__, *len); "%s: wrremreg [%lx]\n", __func__, *len);
qla27xx_write_reg(reg, IOBASE_ADDR, 0x40, buf); qla27xx_write_reg(reg, IOBASE_ADDR, 0x40, buf);
qla27xx_read_reg(reg, 0xc4, buf, len); qla27xx_write_reg(reg, 0xc4, data, buf);
qla27xx_insert32(addr, buf, len);
qla27xx_write_reg(reg, 0xc0, addr, buf); qla27xx_write_reg(reg, 0xc0, addr, buf);
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment