Justin van Son has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/72712 )
Change subject: mb/prodrive/hermes: Add SATA hotplug EEPROM setting ......................................................................
mb/prodrive/hermes: Add SATA hotplug EEPROM setting
Add an option to the EEPROM to configure SATA hotplug. Per port configuration is not needed, so add a global option to toggle the hotplug setting on all SATA ports.
Change-Id: Ib7dcd12049bdf7c2d200530acd8a6da5df726203 Signed-off-by: Justin van Son justin.van.son@prodrive-technologies.com --- M src/mainboard/prodrive/hermes/eeprom.h M src/mainboard/prodrive/hermes/mainboard.c 2 files changed, 33 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/12/72712/1
diff --git a/src/mainboard/prodrive/hermes/eeprom.h b/src/mainboard/prodrive/hermes/eeprom.h index f02206f..82d56d3 100644 --- a/src/mainboard/prodrive/hermes/eeprom.h +++ b/src/mainboard/prodrive/hermes/eeprom.h @@ -60,8 +60,9 @@ uint8_t pink_rear_vref; uint8_t vtx_disabled; uint8_t boot_menu_disabled; + uint8_t sata_hotplug; }; - uint8_t raw_settings[12]; + uint8_t raw_settings[13]; }; };
@@ -70,7 +71,7 @@ PRIMARY_VIDEO_INTEL = 1, };
-_Static_assert(sizeof(struct eeprom_board_settings) == (12 + sizeof(uint32_t)), +_Static_assert(sizeof(struct eeprom_board_settings) == (13 + sizeof(uint32_t)), "struct eeprom_board_settings has invalid size!");
struct __packed eeprom_bmc_settings { diff --git a/src/mainboard/prodrive/hermes/mainboard.c b/src/mainboard/prodrive/hermes/mainboard.c index 0b0eb88..9e2b111 100644 --- a/src/mainboard/prodrive/hermes/mainboard.c +++ b/src/mainboard/prodrive/hermes/mainboard.c @@ -143,6 +143,17 @@ printk(BIOS_ERR, "MB: Failed to update Board Layout\n"); }
+static void mainboard_set_sata_hotplug(bool on) +{ + uint8_t sata_hotplug[] = { 1, 1, 0, 0, 1, 1, 1, 1 }; + config_t *config = config_of_soc(); + + if (!on) + memset(sata_hotplug, 0, sizeof(sata_hotplug)); + + memcpy(config->SataPortsHotPlug, sata_hotplug, sizeof(sata_hotplug)); +} + static void mainboard_init(void *chip_info) { const struct eeprom_board_settings *const board_cfg = get_board_settings(); @@ -166,6 +177,11 @@ if (!board_cfg) return;
+ /* 0: Disable SATA hotplug, 1: Enable SATA hotplug. For all ports.*/ + const bool hotplug = board_cfg->sata_hotplug; + + mainboard_set_sata_hotplug(hotplug); + /* Encoding: 0 -> S0, 1 -> S5 */ const bool on = !board_cfg->power_state_after_g3;