]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
spi: bcm63xx-hsspi: add support for 1-2-2 read ops
authorJonas Gorski <jonas.gorski@gmail.com>
Wed, 17 Dec 2025 21:10:26 +0000 (22:10 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 23 Dec 2025 10:53:50 +0000 (10:53 +0000)
commit0f698d742f628d02ab2a222f8cf5f793443865d0
treef9f68eb3fae2bf2d2709e6b7824e25384825db65
parent458800ea171b00d9c2af7c8cbf2819fd85af1aff
spi: bcm63xx-hsspi: add support for 1-2-2 read ops

Add support for 1-2-2 read ops by separately calculating the switch from
single-bit to multi-bit, and then switching within the prepend data.

This allows us to support single-bit write followed by multi-bit write
followed by multi-bit read, and we do not need to reject 1-2-2 read
operations anymore.

Tested on BCM963268BU_P300 with custom fixup to allow 1-2-2 on the
non-SDFP capable s25fl129p1 attached (which it actually supports):

root@OpenWrt:~# cat /sys/kernel/debug/spi-nor/spi1.0/params
name            s25fl129p1
id              01 20 18 4d 01 01
size            16.0 MiB
write size      1
page size       256
address nbytes  3
flags           HAS_16BIT_SR | NO_READ_CR

opcodes
 read           0xbb
  dummy cycles  4
 erase          0xd8
 program        0x02
 8D extension   none

protocols
 read           1S-2S-2S
 write          1S-1S-1S
 register       1S-1S-1S

Reading from flash is still working as expected:

[    1.070000] parser_imagetag: rootfs: CFE image tag found at 0x0 with version 6, board type 963168VX
[    1.080000] parser_imagetag: Partition 0 is rootfs offset 100 and length 665000
[    1.090000] parser_imagetag: Partition 1 is kernel offset 665100 and length 136fa1
[    1.100000] parser_imagetag: Spare partition is offset 7b0000 and length 30000

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Acked-by: William Zhang <william.zhang@broadcom.com>
Tested-by: David Regan <dregan@broadcom.com>
Link: https://patch.msgid.link/20251217211026.173946-1-jonas.gorski@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-bcm63xx-hsspi.c