8db79c1386
Set up EMMC gpios for payloads. BUG=b:80501386 BRANCH=none TEST=Boots correctly on Kukui Change-Id: I1e7ee9bfe3a26ed04374e8c74243f48552a1d254 Signed-off-by: Tristan Shieh <tristan.shieh@mediatek.com> Reviewed-on: https://review.coreboot.org/28546 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
47 lines
1.2 KiB
C
47 lines
1.2 KiB
C
/*
|
|
* This file is part of the coreboot project.
|
|
*
|
|
* Copyright 2018 MediaTek Inc.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; version 2 of the License.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#include <device/device.h>
|
|
#include <soc/gpio.h>
|
|
#include <soc/mmu_operations.h>
|
|
|
|
static void configure_emmc(void)
|
|
{
|
|
const gpio_t emmc_pin[] = {
|
|
GPIO(MSDC0_DAT0), GPIO(MSDC0_DAT1),
|
|
GPIO(MSDC0_DAT2), GPIO(MSDC0_DAT3),
|
|
GPIO(MSDC0_DAT4), GPIO(MSDC0_DAT5),
|
|
GPIO(MSDC0_DAT6), GPIO(MSDC0_DAT7),
|
|
GPIO(MSDC0_CMD), GPIO(MSDC0_RSTB),
|
|
};
|
|
|
|
for (size_t i = 0; i < ARRAY_SIZE(emmc_pin); i++)
|
|
gpio_set_pull(emmc_pin[i], GPIO_PULL_ENABLE, GPIO_PULL_UP);
|
|
}
|
|
|
|
static void mainboard_init(struct device *dev)
|
|
{
|
|
configure_emmc();
|
|
}
|
|
|
|
static void mainboard_enable(struct device *dev)
|
|
{
|
|
dev->ops->init = &mainboard_init;
|
|
}
|
|
|
|
struct chip_operations mainboard_ops = {
|
|
.name = CONFIG_MAINBOARD_PART_NUMBER,
|
|
.enable_dev = mainboard_enable,
|
|
};
|