drivers/genesyslogic/gl9750: Add invert write protect polarity
Add an option to invert write protect polarity for GL9750.
Change-Id: I5761f3066291a2400caecbecc79ae893f0a0c146
Signed-off-by: Ben Chuang <benchuanggli@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77403
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/drivers/genesyslogic/gl9750/gl9750.c b/src/drivers/genesyslogic/gl9750/gl9750.c
index c021ead..8c40c49 100644
--- a/src/drivers/genesyslogic/gl9750/gl9750.c
+++ b/src/drivers/genesyslogic/gl9750/gl9750.c
@@ -22,6 +22,10 @@
*/
pci_and_config32(dev, CFG2, ~CFG2_L0S_SUPPORT);
+ if (CONFIG(DRIVERS_GENESYSLOGIC_GL9750_INVERT_WP))
+ /* invert write protect polarity */
+ pci_or_config32(dev, CFG1, CFG1_WP_INVERT);
+
/* Set Vendor Config to be non-configurable */
pci_and_config32(dev, CFG, ~CFG_EN);
}