[PATCH] spi: zynqmp_gqspi: Fix unaligned data writes issue
Michal Simek
monstr at monstr.eu
Tue Jan 5 10:37:59 CET 2021
čt 17. 12. 2020 v 15:12 odesílatel Michal Simek
<michal.simek at xilinx.com> napsal:
>
> From: T Karthik Reddy <t.karthik.reddy at xilinx.com>
>
> 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 at xilinx.com>
> Signed-off-by: Michal Simek <michal.simek at xilinx.com>
> ---
>
> drivers/spi/zynqmp_gqspi.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/zynqmp_gqspi.c b/drivers/spi/zynqmp_gqspi.c
> index e0e668703776..a56e8b250961 100644
> --- a/drivers/spi/zynqmp_gqspi.c
> +++ b/drivers/spi/zynqmp_gqspi.c
> @@ -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;
> }
> --
> 2.29.2
>
Applied.
M
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs
More information about the U-Boot
mailing list