rush: switch to padconfig API in ramstage
BUG=chrome-os-partner:29981 BRANCH=None TEST=Compiles successfully and boots until kernel FIT header error as before. Change-Id: Ib4160b622c15cc5e4230bb43688a825ef68a69f0 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 4fed2969242909921dc843de063e67b3769d1786 Original-Change-Id: I5637b84d5153c745b4a07a4bf8c72ae1e6f2f21c Original-Signed-off-by: Furquan Shaikh <furquan@google.com> Original-Reviewed-on: https://chromium-review.googlesource.com/211033 Original-Tested-by: Furquan Shaikh <furquan@chromium.org> Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Original-Commit-Queue: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/8909 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
2f3a7fb45d
commit
908f19a406
|
@ -21,68 +21,47 @@
|
||||||
#include <boot/coreboot_tables.h>
|
#include <boot/coreboot_tables.h>
|
||||||
|
|
||||||
#include <soc/clock.h>
|
#include <soc/clock.h>
|
||||||
#include <soc/nvidia/tegra132/gpio.h>
|
|
||||||
#include <soc/nvidia/tegra132/clk_rst.h>
|
#include <soc/nvidia/tegra132/clk_rst.h>
|
||||||
#include <soc/nvidia/tegra132/spi.h>
|
#include <soc/nvidia/tegra132/spi.h>
|
||||||
#include <soc/addressmap.h>
|
#include <soc/addressmap.h>
|
||||||
|
#include <soc/padconfig.h>
|
||||||
|
|
||||||
static struct clk_rst_ctlr *clk_rst = (void *)TEGRA_CLK_RST_BASE;
|
static struct clk_rst_ctlr *clk_rst = (void *)TEGRA_CLK_RST_BASE;
|
||||||
|
|
||||||
static void init_mmc(void)
|
static const struct pad_config padcfgs[] = {
|
||||||
|
/* MMC3(SDCARD) */
|
||||||
|
PAD_CFG_SFIO(SDMMC3_CLK, PINMUX_INPUT_ENABLE, SDMMC3),
|
||||||
|
PAD_CFG_SFIO(SDMMC3_CMD, PINMUX_INPUT_ENABLE | PINMUX_PULL_UP, SDMMC3),
|
||||||
|
PAD_CFG_SFIO(SDMMC3_DAT0, PINMUX_INPUT_ENABLE | PINMUX_PULL_UP, SDMMC3),
|
||||||
|
PAD_CFG_SFIO(SDMMC3_DAT1, PINMUX_INPUT_ENABLE | PINMUX_PULL_UP, SDMMC3),
|
||||||
|
PAD_CFG_SFIO(SDMMC3_DAT2, PINMUX_INPUT_ENABLE | PINMUX_PULL_UP, SDMMC3),
|
||||||
|
PAD_CFG_SFIO(SDMMC3_DAT3, PINMUX_INPUT_ENABLE | PINMUX_PULL_UP, SDMMC3),
|
||||||
|
PAD_CFG_SFIO(SDMMC3_CLK_LB_IN, PINMUX_INPUT_ENABLE | PINMUX_PULL_UP, SDMMC3),
|
||||||
|
PAD_CFG_SFIO(SDMMC3_CLK_LB_OUT, PINMUX_INPUT_ENABLE | PINMUX_PULL_DOWN, SDMMC3),
|
||||||
|
/* MMC3 Card Detect pin */
|
||||||
|
PAD_CFG_GPIO_INPUT(SDMMC3_CD_N, PINMUX_PULL_UP),
|
||||||
|
/* Disable SD card reader power so it can be reset even on warm boot.
|
||||||
|
Payloads must enable power before accessing SD card slots. */
|
||||||
|
PAD_CFG_GPIO_OUT0(KB_ROW0, PINMUX_PULL_NONE),
|
||||||
|
/* MMC4 (eMMC) */
|
||||||
|
PAD_CFG_SFIO(SDMMC4_CLK, PINMUX_INPUT_ENABLE, SDMMC4),
|
||||||
|
PAD_CFG_SFIO(SDMMC4_CMD, PINMUX_INPUT_ENABLE | PINMUX_PULL_UP, SDMMC4),
|
||||||
|
PAD_CFG_SFIO(SDMMC4_DAT0, PINMUX_INPUT_ENABLE | PINMUX_PULL_UP, SDMMC4),
|
||||||
|
PAD_CFG_SFIO(SDMMC4_DAT1, PINMUX_INPUT_ENABLE | PINMUX_PULL_UP, SDMMC4),
|
||||||
|
PAD_CFG_SFIO(SDMMC4_DAT2, PINMUX_INPUT_ENABLE | PINMUX_PULL_UP, SDMMC4),
|
||||||
|
PAD_CFG_SFIO(SDMMC4_DAT3, PINMUX_INPUT_ENABLE | PINMUX_PULL_UP, SDMMC4),
|
||||||
|
PAD_CFG_SFIO(SDMMC4_DAT4, PINMUX_INPUT_ENABLE | PINMUX_PULL_UP, SDMMC4),
|
||||||
|
PAD_CFG_SFIO(SDMMC4_DAT5, PINMUX_INPUT_ENABLE | PINMUX_PULL_UP, SDMMC4),
|
||||||
|
PAD_CFG_SFIO(SDMMC4_DAT6, PINMUX_INPUT_ENABLE | PINMUX_PULL_UP, SDMMC4),
|
||||||
|
PAD_CFG_SFIO(SDMMC4_DAT7, PINMUX_INPUT_ENABLE | PINMUX_PULL_UP, SDMMC4),
|
||||||
|
};
|
||||||
|
|
||||||
|
static void configure_clocks(void)
|
||||||
{
|
{
|
||||||
|
/* MMC */
|
||||||
|
clock_enable_clear_reset(CLK_L_SDMMC4, 0, CLK_U_SDMMC3, 0, 0, 0);
|
||||||
clock_configure_source(sdmmc3, PLLP, 48000);
|
clock_configure_source(sdmmc3, PLLP, 48000);
|
||||||
clock_configure_source(sdmmc4, PLLP, 48000);
|
clock_configure_source(sdmmc4, PLLP, 48000);
|
||||||
|
|
||||||
uint32_t pin_up = PINMUX_PULL_UP | PINMUX_INPUT_ENABLE,
|
|
||||||
pin_down = PINMUX_PULL_DOWN | PINMUX_INPUT_ENABLE,
|
|
||||||
pin_none = PINMUX_PULL_NONE | PINMUX_INPUT_ENABLE;
|
|
||||||
|
|
||||||
// MMC3 (sdcard reader)
|
|
||||||
pinmux_set_config(PINMUX_SDMMC3_CLK_INDEX,
|
|
||||||
PINMUX_SDMMC3_CLK_FUNC_SDMMC3 | pin_none);
|
|
||||||
pinmux_set_config(PINMUX_SDMMC3_CMD_INDEX,
|
|
||||||
PINMUX_SDMMC3_CMD_FUNC_SDMMC3 | pin_up);
|
|
||||||
pinmux_set_config(PINMUX_SDMMC3_DAT0_INDEX,
|
|
||||||
PINMUX_SDMMC3_DAT0_FUNC_SDMMC3 | pin_up);
|
|
||||||
pinmux_set_config(PINMUX_SDMMC3_DAT1_INDEX,
|
|
||||||
PINMUX_SDMMC3_DAT1_FUNC_SDMMC3 | pin_up);
|
|
||||||
pinmux_set_config(PINMUX_SDMMC3_DAT2_INDEX,
|
|
||||||
PINMUX_SDMMC3_DAT2_FUNC_SDMMC3 | pin_up);
|
|
||||||
pinmux_set_config(PINMUX_SDMMC3_DAT3_INDEX,
|
|
||||||
PINMUX_SDMMC3_DAT3_FUNC_SDMMC3 | pin_up);
|
|
||||||
pinmux_set_config(PINMUX_SDMMC3_CLK_LB_IN_INDEX,
|
|
||||||
PINMUX_SDMMC3_CLK_LB_IN_FUNC_SDMMC3 | pin_up);
|
|
||||||
pinmux_set_config(PINMUX_SDMMC3_CLK_LB_OUT_INDEX,
|
|
||||||
PINMUX_SDMMC3_CLK_LB_OUT_FUNC_SDMMC3 | pin_down);
|
|
||||||
|
|
||||||
// MMC3 Card Detect pin.
|
|
||||||
gpio_input_pullup(GPIO(V2));
|
|
||||||
// Disable SD card reader power so it can be reset even on warm boot.
|
|
||||||
// Payloads must enable power before accessing SD card slots.
|
|
||||||
gpio_output(GPIO(R0), 0);
|
|
||||||
|
|
||||||
// MMC4 (eMMC)
|
|
||||||
pinmux_set_config(PINMUX_SDMMC4_CLK_INDEX,
|
|
||||||
PINMUX_SDMMC4_CLK_FUNC_SDMMC4 | pin_none);
|
|
||||||
pinmux_set_config(PINMUX_SDMMC4_CMD_INDEX,
|
|
||||||
PINMUX_SDMMC4_CMD_FUNC_SDMMC4 | pin_up);
|
|
||||||
pinmux_set_config(PINMUX_SDMMC4_DAT0_INDEX,
|
|
||||||
PINMUX_SDMMC4_DAT0_FUNC_SDMMC4 | pin_up);
|
|
||||||
pinmux_set_config(PINMUX_SDMMC4_DAT1_INDEX,
|
|
||||||
PINMUX_SDMMC4_DAT1_FUNC_SDMMC4 | pin_up);
|
|
||||||
pinmux_set_config(PINMUX_SDMMC4_DAT2_INDEX,
|
|
||||||
PINMUX_SDMMC4_DAT2_FUNC_SDMMC4 | pin_up);
|
|
||||||
pinmux_set_config(PINMUX_SDMMC4_DAT3_INDEX,
|
|
||||||
PINMUX_SDMMC4_DAT3_FUNC_SDMMC4 | pin_up);
|
|
||||||
pinmux_set_config(PINMUX_SDMMC4_DAT4_INDEX,
|
|
||||||
PINMUX_SDMMC4_DAT4_FUNC_SDMMC4 | pin_up);
|
|
||||||
pinmux_set_config(PINMUX_SDMMC4_DAT5_INDEX,
|
|
||||||
PINMUX_SDMMC4_DAT5_FUNC_SDMMC4 | pin_up);
|
|
||||||
pinmux_set_config(PINMUX_SDMMC4_DAT6_INDEX,
|
|
||||||
PINMUX_SDMMC4_DAT6_FUNC_SDMMC4 | pin_up);
|
|
||||||
pinmux_set_config(PINMUX_SDMMC4_DAT7_INDEX,
|
|
||||||
PINMUX_SDMMC4_DAT7_FUNC_SDMMC4 | pin_up);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setup_ec_spi(void)
|
static void setup_ec_spi(void)
|
||||||
|
@ -94,9 +73,10 @@ static void setup_ec_spi(void)
|
||||||
|
|
||||||
static void mainboard_init(device_t dev)
|
static void mainboard_init(device_t dev)
|
||||||
{
|
{
|
||||||
clock_enable_clear_reset(CLK_L_SDMMC4, 0, CLK_U_SDMMC3, 0, 0, 0);
|
configure_clocks();
|
||||||
|
|
||||||
|
soc_configure_pads(padcfgs, ARRAY_SIZE(padcfgs));
|
||||||
|
|
||||||
init_mmc();
|
|
||||||
setup_ec_spi();
|
setup_ec_spi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue