[coreboot-gerrit] Change in ...coreboot[master]: drivers/spi/winbond: Fix TB bit

Philipp Deppenwiese (Code Review) gerrit at coreboot.org
Tue Dec 4 08:11:49 CET 2018


Philipp Deppenwiese has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/30014 )

Change subject: drivers/spi/winbond: Fix TB bit
......................................................................

drivers/spi/winbond: Fix TB bit

The TB has to be inverted to actually protected the correct region.

Tested on elgon using I67eb4ee8e0ad297a8d1984d55102146688c291fc.

Change-Id: I715791b8ae5d1db1ef587321ae5c9daa10eb7dbc
Signed-off-by: Patrick Rudolph <patrick.rudolph at 9elements.com>
Reviewed-on: https://review.coreboot.org/c/30014
Tested-by: build bot (Jenkins) <no-reply at coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki at gmail.com>
Reviewed-by: David Hendricks <david.hendricks at gmail.com>
Reviewed-by: Julius Werner <jwerner at chromium.org>
---
M src/drivers/spi/winbond.c
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  build bot (Jenkins): Verified
  David Hendricks: Looks good to me, approved
  Philipp Deppenwiese: Looks good to me, approved
  Julius Werner: Looks good to me, approved



diff --git a/src/drivers/spi/winbond.c b/src/drivers/spi/winbond.c
index 9eb3352..f8ea247 100644
--- a/src/drivers/spi/winbond.c
+++ b/src/drivers/spi/winbond.c
@@ -303,7 +303,7 @@
 		tb = !tb;
 	}
 
-	out->offset = tb ? flash_size - protected_size : 0;
+	out->offset = tb ? 0 : flash_size - protected_size;
 	out->size = protected_size;
 }
 
@@ -519,9 +519,9 @@
 	wp_region = *region;
 
 	if (region_offset(&wp_region) == 0)
-		tb = 0;
-	else
 		tb = 1;
+	else
+		tb = 0;
 
 	if (region_sz(&wp_region) > flash->size / 2) {
 		cmp = 1;

-- 
To view, visit https://review.coreboot.org/c/coreboot/+/30014
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I715791b8ae5d1db1ef587321ae5c9daa10eb7dbc
Gerrit-Change-Number: 30014
Gerrit-PatchSet: 2
Gerrit-Owner: Patrick Rudolph <patrick.rudolph at 9elements.com>
Gerrit-Reviewer: David Hendricks <david.hendricks at gmail.com>
Gerrit-Reviewer: Julius Werner <jwerner at chromium.org>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph at 9elements.com>
Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki at gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181204/0d3f647f/attachment.html>


More information about the coreboot-gerrit mailing list