[coreboot-gerrit] Change in coreboot[master]: soc/amd/stoneyridge: Disable SATA by default

Richard Spiegel (Code Review) gerrit at coreboot.org
Fri Aug 3 16:03:24 CEST 2018


Richard Spiegel has uploaded this change for review. ( https://review.coreboot.org/27817


Change subject: soc/amd/stoneyridge: Disable SATA by default
......................................................................

soc/amd/stoneyridge: Disable SATA by default

Grunt based boards don't use SATA, so it should be disabled to save power.
However, other boards might use, so the change has to be configurable.
Create a config parameter that if selected will enable SATA, but if not
selected SATA will be disabled.

BUG=b:112139043
TEST=Buil and boot grunt, checked the absence of SATA PCI.

Change-Id: I33015baff5bbb869c40aa53d3ef316dcec377734
Signed-off-by: Richard Spiegel <richard.spiegel at silverbackltd.com>
---
M src/soc/amd/stoneyridge/BiosCallOuts.c
M src/soc/amd/stoneyridge/Kconfig
M src/soc/amd/stoneyridge/southbridge.c
3 files changed, 38 insertions(+), 17 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/27817/1

diff --git a/src/soc/amd/stoneyridge/BiosCallOuts.c b/src/soc/amd/stoneyridge/BiosCallOuts.c
index 430dc45..bda5367 100644
--- a/src/soc/amd/stoneyridge/BiosCallOuts.c
+++ b/src/soc/amd/stoneyridge/BiosCallOuts.c
@@ -67,19 +67,22 @@
 
 		/* SATA configuration */
 		FchParams_env->Sata.SataClass = CONFIG_STONEYRIDGE_SATA_MODE;
-		switch ((SATA_CLASS)CONFIG_STONEYRIDGE_SATA_MODE) {
-		case SataRaid:
-		case SataAhci:
-		case SataAhci7804:
-		case SataLegacyIde:
+		if (IS_ENABLED(CONFIG_STONEYRIDGE_SATA_ENABLE)) {
+			switch ((SATA_CLASS)CONFIG_STONEYRIDGE_SATA_MODE) {
+			case SataRaid:
+			case SataAhci:
+			case SataAhci7804:
+			case SataLegacyIde:
+				FchParams_env->Sata.SataIdeMode = FALSE;
+				break;
+			case SataIde2Ahci:
+			case SataIde2Ahci7804:
+			default: /* SataNativeIde */
+				FchParams_env->Sata.SataIdeMode = TRUE;
+				break;
+			}
+		} else
 			FchParams_env->Sata.SataIdeMode = FALSE;
-			break;
-		case SataIde2Ahci:
-		case SataIde2Ahci7804:
-		default: /* SataNativeIde */
-			FchParams_env->Sata.SataIdeMode = TRUE;
-			break;
-		}
 
 		/* Platform updates */
 		platform_FchParams_env(FchParams_env);
diff --git a/src/soc/amd/stoneyridge/Kconfig b/src/soc/amd/stoneyridge/Kconfig
index 7675bce..305aa83 100644
--- a/src/soc/amd/stoneyridge/Kconfig
+++ b/src/soc/amd/stoneyridge/Kconfig
@@ -191,6 +191,12 @@
 	string "AMD public Key"
 	default "3rdparty/blobs/soc/amd/stoneyridge/PSP/AmdPubKeyST.bin"
 
+config STONEYRIDGE_SATA_ENABLE
+	bool "Enable Stoney Ridge SATA Controller"
+	default n
+	help
+	  Select this option if your board uses SATA.
+
 config STONEYRIDGE_SATA_MODE
 	int "SATA Mode"
 	default 0
diff --git a/src/soc/amd/stoneyridge/southbridge.c b/src/soc/amd/stoneyridge/southbridge.c
index 63d8806..36cfc2b 100644
--- a/src/soc/amd/stoneyridge/southbridge.c
+++ b/src/soc/amd/stoneyridge/southbridge.c
@@ -73,17 +73,29 @@
 void SetFchResetParams(FCH_RESET_INTERFACE *params)
 {
 	params->Xhci0Enable = IS_ENABLED(CONFIG_STONEYRIDGE_XHCI_ENABLE);
-	params->SataEnable = sb_sata_enable();
-	params->IdeEnable = sb_ide_enable();
+	if (IS_ENABLED(CONFIG_STONEYRIDGE_SATA_ENABLE)) {
+		params->SataEnable = sb_sata_enable();
+		params->IdeEnable = sb_ide_enable();
+	} else {
+		params->SataEnable = FALSE;
+		params->IdeEnable = FALSE;
+	}
 }
 
 void SetFchEnvParams(FCH_INTERFACE *params)
 {
 	params->AzaliaController = AzEnable;
 	params->SataClass = CONFIG_STONEYRIDGE_SATA_MODE;
-	params->SataEnable = is_sata_config();
-	params->IdeEnable = !params->SataEnable;
-	params->SataIdeMode = (CONFIG_STONEYRIDGE_SATA_MODE == SataLegacyIde);
+	if (IS_ENABLED(CONFIG_STONEYRIDGE_SATA_ENABLE)) {
+		params->SataEnable = is_sata_config();
+		params->IdeEnable = !params->SataEnable;
+		params->SataIdeMode = (CONFIG_STONEYRIDGE_SATA_MODE ==
+					SataLegacyIde);
+	} else {
+		params->SataEnable = FALSE;
+		params->IdeEnable = FALSE;
+		params->SataIdeMode = FALSE;
+	}
 }
 
 void SetFchMidParams(FCH_INTERFACE *params)

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

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I33015baff5bbb869c40aa53d3ef316dcec377734
Gerrit-Change-Number: 27817
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Spiegel <richard.spiegel at silverbackltd.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180803/0d2a497f/attachment-0001.html>


More information about the coreboot-gerrit mailing list