aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/amd/mandolin/emmc_gpio.c
diff options
context:
space:
mode:
authorFelix Held <felix.held@amd.corp-partner.google.com>2020-06-27 01:41:21 +0200
committerFelix Held <felix-coreboot@felixheld.de>2020-06-28 14:20:11 +0000
commit346f391642623a132a539edeabbe8a638015b1f9 (patch)
tree5cebeff3f297cad162b273205fb807147b4dba86 /src/mainboard/amd/mandolin/emmc_gpio.c
parent664ba9767d1171c4bd918a76e3c1d1bc4703b028 (diff)
mb/amd/mandolin: factor out eMMC GPIO pin mux setup
This also makes the calling of the eMMC GPIO mux setup function conditional on PICASSO_LPC_IOMUX instead of AMD_LPC_DEBUG_CARD which only makes the selection of PICASSO_LPC_IOMUX user-configurable. Change-Id: Ic49a668f82fbc1b851c07d312b543d2889fe4734 Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/42842 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/mainboard/amd/mandolin/emmc_gpio.c')
-rw-r--r--src/mainboard/amd/mandolin/emmc_gpio.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mainboard/amd/mandolin/emmc_gpio.c b/src/mainboard/amd/mandolin/emmc_gpio.c
new file mode 100644
index 0000000000..2ae72a6ec7
--- /dev/null
+++ b/src/mainboard/amd/mandolin/emmc_gpio.c
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <soc/gpio.h>
+#include "gpio.h"
+
+/* eMMC controller driving either an SD card or eMMC device. */
+static const struct soc_amd_gpio emmc_gpios[] = {
+ PAD_NF(GPIO_21, EMMC_CMD, PULL_UP),
+ PAD_NF(GPIO_22, EMMC_PRW_CTRL, PULL_UP),
+ PAD_NF(GPIO_68, EMMC_CD, PULL_UP),
+ PAD_NF(GPIO_70, EMMC_CLK, PULL_NONE),
+ PAD_NF(GPIO_104, EMMC_DATA0, PULL_UP),
+ PAD_NF(GPIO_105, EMMC_DATA1, PULL_UP),
+ PAD_NF(GPIO_106, EMMC_DATA2, PULL_UP),
+ PAD_NF(GPIO_107, EMMC_DATA3, PULL_NONE),
+ PAD_NF(GPIO_74, EMMC_DATA4, PULL_UP),
+ PAD_NF(GPIO_75, EMMC_DATA6, PULL_UP),
+ PAD_NF(GPIO_87, EMMC_DATA7, PULL_UP),
+ PAD_NF(GPIO_88, EMMC_DATA5, PULL_UP),
+ PAD_NF(GPIO_109, EMMC_DS, PULL_UP),
+};
+
+/* Don't call this if the board uses the LPC bus. */
+void mainboard_program_emmc_gpios(void)
+{
+ program_gpios(emmc_gpios, ARRAY_SIZE(emmc_gpios));
+}