summaryrefslogtreecommitdiffstats
path: root/spi25_statusreg.c
diff options
context:
space:
mode:
authorSergii Dmytruk <sergii.dmytruk@3mdeb.com>2021-12-19 18:37:51 +0200
committerAnastasia Klimchuk <aklm@chromium.org>2022-04-29 00:37:00 +0000
commitdbbe1588b208204e19acebfb8b579bbdbe2e145e (patch)
tree6290961beaf8c387d1cb322d3b52ffd798fe3f3a /spi25_statusreg.c
parentdcac005071c058c2acd239eabcf00ce133c32823 (diff)
downloadflashrom-dbbe1588b208204e19acebfb8b579bbdbe2e145e.tar.gz
flashrom-dbbe1588b208204e19acebfb8b579bbdbe2e145e.tar.bz2
flashrom-dbbe1588b208204e19acebfb8b579bbdbe2e145e.zip
spi25_statusreg.c: add SR3 read/write support
Adds support for reading and writing the third status register. Feature flag is not needed because it would never on its own control whether SR3 access occurs. If added, it would be in one of three possible states: wrong, useless or redundant. Change-Id: Id987c544c02da2b956e6ad2c525265cac8f15be1 Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/60230 Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Nikolai Artemiev <nartemiev@google.com> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'spi25_statusreg.c')
-rw-r--r--spi25_statusreg.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/spi25_statusreg.c b/spi25_statusreg.c
index 6b1683984..0f430565d 100644
--- a/spi25_statusreg.c
+++ b/spi25_statusreg.c
@@ -66,6 +66,11 @@ int spi_write_register(const struct flashctx *flash, enum flash_reg reg, uint8_t
}
msg_cerr("Cannot write SR2: unsupported by chip\n");
return 1;
+ case STATUS3:
+ write_cmd[0] = JEDEC_WRSR3;
+ write_cmd[1] = value;
+ write_cmd_len = JEDEC_WRSR3_OUTSIZE;
+ break;
default:
msg_cerr("Cannot write register: unknown register\n");
return 1;
@@ -153,6 +158,9 @@ int spi_read_register(const struct flashctx *flash, enum flash_reg reg, uint8_t
}
msg_cerr("Cannot read SR2: unsupported by chip\n");
return 1;
+ case STATUS3:
+ read_cmd = JEDEC_RDSR3;
+ break;
default:
msg_cerr("Cannot read register: unknown register\n");
return 1;