diff options
author | Furquan Shaikh <furquan@google.com> | 2019-10-23 09:52:32 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-10-25 06:55:05 +0000 |
commit | fb9f320d810b82790ecbaeeb8671c723f433e904 (patch) | |
tree | 838d7ce68dddefa6227be550f24593cfbc12cc9e /src/mainboard/google/fizz/ramstage.c | |
parent | 80212aa1040577cf052bbf9f12abe079e36e4cf8 (diff) |
mb/google/{poppy,eve,fizz}: Configure GPIOs in mainboard chip->init()
mainboard_silicon_init_params() is supposed to be used for only
overriding any FSP params as per mainboard configuration. GPIOs should
be configured by mainboard as part of its chip init(). This ensures
proper ordering w.r.t. any common operations that the SoC code might
want to perform e.g. snapshot ITSS polarities.
This change moves the configuration of GPIOs from
mainboard_silicon_init_params() to mainboard chip->init().
Change-Id: Ied0201b954894acd3503801e7739b91a2cc9b4a8
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36268
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google/fizz/ramstage.c')
-rw-r--r-- | src/mainboard/google/fizz/ramstage.c | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/src/mainboard/google/fizz/ramstage.c b/src/mainboard/google/fizz/ramstage.c deleted file mode 100644 index d42f68cad4..0000000000 --- a/src/mainboard/google/fizz/ramstage.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2017 Google 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 <baseboard/variants.h> -#include <bootmode.h> -#include <console/console.h> -#include <delay.h> -#include <ec/google/chromeec/ec.h> -#include <gpio.h> -#include <soc/gpio.h> -#include <soc/ramstage.h> -#include <timer.h> - -#include <variant/gpio.h> - -#define GPIO_HDMI_HPD GPP_E13 -#define GPIO_DP_HPD GPP_E14 - -/* TODO: This can be moved to common directory */ -static void wait_for_hpd(gpio_t gpio, long timeout) -{ - struct stopwatch sw; - - printk(BIOS_INFO, "Waiting for HPD\n"); - gpio_input(gpio); - - stopwatch_init_msecs_expire(&sw, timeout); - while (!gpio_get(gpio)) { - if (stopwatch_expired(&sw)) { - printk(BIOS_WARNING, - "HPD not ready after %ldms. Abort.\n", timeout); - return; - } - mdelay(200); - } - printk(BIOS_INFO, "HPD ready after %lu ms\n", - stopwatch_duration_msecs(&sw)); -} - -void mainboard_silicon_init_params(FSP_SIL_UPD *params) -{ - const struct pad_config *pads; - size_t num; - static const long display_timeout_ms = 3000; - - /* This is reconfigured back to whatever FSP-S expects by - gpio_configure_pads. */ - gpio_input(GPIO_HDMI_HPD); - if (display_init_required() && !gpio_get(GPIO_HDMI_HPD)) { - /* This has to be done before FSP-S runs. */ - if (google_chromeec_wait_for_displayport(display_timeout_ms)) - wait_for_hpd(GPIO_DP_HPD, display_timeout_ms); - } - - pads = variant_gpio_table(&num); - gpio_configure_pads(pads, num); -} |