summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2014-08-06 15:54:43 -0500
committerPatrick Georgi <pgeorgi@google.com>2015-03-26 00:26:43 +0100
commit9a1691dabe0a13f17f58ecfab7a9c162011f5780 (patch)
treec761338aa99faf57db3b818815343241fe8f5ea1 /src
parente68ee3b6a3bbf74ec971a3b2a230a59c1944da91 (diff)
downloadcoreboot-9a1691dabe0a13f17f58ecfab7a9c162011f5780.tar.xz
ryu: convert mainboard initialization to use padconfig API
BUG=chrome-os-partner:29981 BRANCH=None TEST=Built and booted through depthcharge on ryu Change-Id: I79373a171922bffacb56f8ba2c0f8d40d0215963 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: d635c8b67658fa95ab2688eac926334849c286a2 Original-Change-Id: I129c17045db95732aa7d548ba6dde754937fdb08 Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/211192 Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: http://review.coreboot.org/8918 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/rush_ryu/mainboard.c57
1 files changed, 21 insertions, 36 deletions
diff --git a/src/mainboard/google/rush_ryu/mainboard.c b/src/mainboard/google/rush_ryu/mainboard.c
index 140ca5f63e..93ffca9adc 100644
--- a/src/mainboard/google/rush_ryu/mainboard.c
+++ b/src/mainboard/google/rush_ryu/mainboard.c
@@ -20,61 +20,46 @@
#include <device/device.h>
#include <boot/coreboot_tables.h>
+#include <soc/addressmap.h>
#include <soc/clock.h>
+#include <soc/padconfig.h>
#include <soc/nvidia/tegra132/clk_rst.h>
-#include <soc/nvidia/tegra132/pinmux.h>
-#include <soc/addressmap.h>
static struct clk_rst_ctlr *clk_rst = (void *)TEGRA_CLK_RST_BASE;
+static const struct pad_config mmcpads[] = {
+ /* MMC4 (eMMC) */
+ PAD_CFG_SFIO(SDMMC4_CLK, PINMUX_INPUT_ENABLE|PINMUX_PULL_DOWN, 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 init_mmc(void)
{
+ clock_enable_clear_reset(CLK_L_SDMMC4, 0, 0, 0, 0, 0);
clock_configure_source(sdmmc4, PLLP, 48000);
- uint32_t pin_up = PINMUX_PULL_UP | PINMUX_INPUT_ENABLE,
- pin_none = PINMUX_PULL_NONE | PINMUX_INPUT_ENABLE;
-
- // 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_i2c(void)
-{
+ soc_configure_pads(mmcpads, ARRAY_SIZE(mmcpads));
}
static void mainboard_init(device_t dev)
{
- clock_enable_clear_reset(CLK_L_SDMMC4, 0, 0, 0, 0, 0);
-
init_mmc();
- setup_ec_i2c();
}
static void mainboard_enable(device_t dev)
{
- dev->ops->init = &mainboard_init;
+ dev->ops->init = &mainboard_init;
}
struct chip_operations mainboard_ops = {
- .name = "rush_ryu",
- .enable_dev = mainboard_enable,
+ .name = "rush_ryu",
+ .enable_dev = mainboard_enable,
};