In the spirit of helping a brother out, here is the snippets from UBOOT:
------- Corrected LUT setup
/* Write Register 0x01 */
lut_base = SEQID_WRR * 4;
qspi_write32(priv->flags, ®s->lut[lut_base],
OPRND0(QSPI_CMD_WRR) | PAD0(LUT_PAD1) | INSTR0(LUT_CMD) |
OPRND1(0x1) | PAD1(LUT_PAD1) | INSTR1(LUT_WRITE)); <<<< as Denis pointed out
qspi_write32(priv->flags, ®s->lut[lut_base + 1], 0); //end of sequence
qspi_write32(priv->flags, ®s->lut[lut_base + 2], 0);
qspi_write32(priv->flags, ®s->lut[lut_base + 3], 0);
------ after status register sequence, enabled SRWD
status_reg |= FLASH_STATUS_SRWD;
qspi_write32(priv->flags, ®s->tbdr, qspi_endian_xchg(status_reg));
while (qspi_read32(priv->flags, ®s->sr) & QSPI_SR_BUSY_MASK)
;
qspi_write32(priv->flags, ®s->ipcr,
(SEQID_WRR << QSPI_IPCR_SEQID_SHIFT) | 1);
while (qspi_read32(priv->flags, ®s->sr) & QSPI_SR_BUSY_MASK)
;
-----------------------
Now reading back CYPRESS status register-1 shows SRWD set. Now just have to figure
why the the flash does not follow WP#. With the change above, now write are allowed.