aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Scheithauer <mario.scheithauer@siemens.com>2022-10-06 12:39:33 +0200
committerMartin Roth <martin.roth@amd.corp-partner.google.com>2022-10-07 22:03:54 +0000
commitd78722f2f85972cdf3e598cf2d374a216ae190c0 (patch)
tree1ddbf804bdcde157d6aee6d150ece61109757a85
parentc8c64c12a55a13116f33d00ebbf64e647f161a23 (diff)
mb/siemens/mc_ehl2: Use preset driver strength for SD-Card
The intention of predefining driver strength is to avoid that the OS SD-Card driver changes this setting. Change-Id: I02fdac94462da1cd77f8dc972faf16f28d94c946 Signed-off-by: Mario Scheithauer <mario.scheithauer@siemens.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/68166 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
-rw-r--r--src/mainboard/siemens/mc_ehl/variants/mc_ehl2/mainboard.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mainboard/siemens/mc_ehl/variants/mc_ehl2/mainboard.c b/src/mainboard/siemens/mc_ehl/variants/mc_ehl2/mainboard.c
index a798398254..339516057a 100644
--- a/src/mainboard/siemens/mc_ehl/variants/mc_ehl2/mainboard.c
+++ b/src/mainboard/siemens/mc_ehl/variants/mc_ehl2/mainboard.c
@@ -9,6 +9,8 @@
#include <soc/pci_devs.h>
#include <soc/pcr_ids.h>
+#define HOSTCTRL2 0x3E
+#define HOSTCTRL2_PRESET (1 << 15)
#define SD_CAP_BYP 0x810
#define SD_CAP_BYP_EN 0x5A
#define SD_CAP_BYP_REG1 0x814
@@ -34,6 +36,7 @@ void variant_mainboard_final(void)
dev = pcidev_path_on_root(PCH_DEVFN_SDCARD);
if (dev) {
uint32_t reg;
+ uint16_t reg16;
struct resource *res = probe_resource(dev, PCI_BASE_ADDRESS_0);
if (!res)
return;
@@ -43,6 +46,11 @@ void variant_mainboard_final(void)
reg &= ~(SD_CAP_BYP_SDR104 | SD_CAP_BYP_SDR50);
reg |= SD_CAP_BYP_DDR50;
write32(res2mmio(res, SD_CAP_BYP_REG1, 0), reg);
+
+ /* Use preset driver strength from preset value registers. */
+ reg16 = read16(res2mmio(res, HOSTCTRL2, 0));
+ reg16 |= HOSTCTRL2_PRESET;
+ write16(res2mmio(res, HOSTCTRL2, 0), reg16);
}
}