]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spi: zynqmp_gqspi: Fix unaligned data writes issue
authorT Karthik Reddy <t.karthik.reddy@xilinx.com>
Thu, 19 Nov 2020 12:00:36 +0000 (05:00 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 4 Jan 2021 09:51:27 +0000 (10:51 +0100)
When unaligned 3 bytes data write operation is performed, 3rd byte
is being over written by 1st byte of 3 bytes data. This patch
fixes it.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/spi/zynqmp_gqspi.c

index e0e668703776ddb8905fd43367a37f5f67aa7b65..a56e8b250961bfbe7cd87cdbafeef8ca35f84d73 100644 (file)
@@ -429,10 +429,8 @@ static int zynqmp_qspi_fill_tx_fifo(struct zynqmp_qspi_priv *priv, u32 size)
                                data |= GENMASK(31, 16);
                                break;
                        case 3:
-                               data = *((u16 *)buf);
-                               buf += 2;
-                               data |= (*((u8 *)buf) << 16);
-                               buf += 1;
+                               data = *buf;
+                               buf += 3;
                                data |= GENMASK(31, 24);
                                break;
                        }