Skip to content

Commit

Permalink
spi: bcm63xx-hsspi: Endianness fix for ARM based SoC
Browse files Browse the repository at this point in the history
HSSPI controller uses big endian for the opcode in the message to the
controller ping pong buffer. Use cpu_to_be16 to properly handle the
endianness for both big and little endian host.

Fixes: 142168e ("spi: bcm63xx-hsspi: add bcm63xx HSSPI driver")
Signed-off-by: Kursad Oney <kursad.oney@broadcom.com>
Signed-off-by: William Zhang <william.zhang@broadcom.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>

Link: https://lore.kernel.org/r/20230207065826.285013-7-william.zhang@broadcom.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
William Zhang authored and Mark Brown committed Feb 9, 2023
1 parent 99d7428 commit 85a84a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi-bcm63xx-hsspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static int bcm63xx_hsspi_do_txrx(struct spi_device *spi, struct spi_transfer *t)
tx += curr_step;
}

__raw_writew(opcode | curr_step, bs->fifo);
__raw_writew((u16)cpu_to_be16(opcode | curr_step), bs->fifo);

/* enable interrupt */
__raw_writel(HSSPI_PINGx_CMD_DONE(0),
Expand Down

0 comments on commit 85a84a6

Please sign in to comment.