flashchips: Add WP settings for Flash Chip `W25Q512NW`

This patch adds WP register bits and decode range for Flash
Chip `W25Q512NW`.

Tested: Able to flash AP FW, wp-enable/disable on Google/rex device
which has flash chip `W25Q512NW`.

Signed-off-by: Subrata Banik <subratabanik@google.com>
Change-Id: Ic5148f71404466dcf7772e3eb6e1800eb8666696
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/67827
Original-Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Original-Reviewed-by: Felix Singer <felixsinger@posteo.net>
Original-Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Original-Reviewed-by: Nikolai Artemiev <nartemiev@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/71239
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
diff --git a/flashchips.c b/flashchips.c
index 4157289..83a0e4f 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -18328,8 +18328,9 @@
 		.model_id       = WINBOND_NEX_W25Q512NW_IM,
 		.total_size     = 64 * 1024,
 		.page_size      = 256,
-		.feature_bits   = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_4BA,
-		.tested         = TEST_OK_PREW,
+		.feature_bits   = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_4BA  | FEATURE_WRSR2
+				  | FEATURE_WRSR3,
+		.tested         = TEST_OK_PREWB,
 		.probe          = probe_spi_rdid,
 		.probe_timing   = TIMING_ZERO,
 		.block_erasers  =
@@ -18361,6 +18362,16 @@
 		.write          = spi_chip_write_256,
 		.read           = spi_chip_read,
 		.voltage        = {1650, 1950},
+		.reg_bits       =
+		{
+			.srp	= {STATUS1, 7, RW},
+			.srl	= {STATUS2, 0, RW},
+			.bp	= {{STATUS1, 2, RW}, {STATUS1, 3, RW}, {STATUS1, 4, RW}, {STATUS1, 5, RW}},
+			.tb	= {STATUS1, 6, RW},
+			.cmp	= {STATUS2, 6, RW},
+			.wps	= {STATUS3, 2, RW},
+		},
+		.decode_range	= decode_range_spi25,
 	},
 
 	{