google/gru: drive WLAN_MODULE_RST# low as early as possible

GPIO1_B3 (WLAN_MODULE_RST#) defaults as a pull-up input, but it is also
"pulled up" by 1.8V_WLAN. However, 1.8V_WLAN remains low for some time
during early boot. This leaves the signal floating somewhere in the
middle.

This has two potential issues:
(1) we're leaking some power for some (hopefully) short period of time
(2) we are possibly screwing with the Wifi power sequence; we aren't
    supposed to deassert PDn (i.e., MODULE_RST#) until all the rails
    have fully ramped for some period of time

Neither of the above issues are likely to be significant, but it is nice
to fix, I expect.

BRANCH=gru
BUG=chrome-os-partner:54026
TEST=measure WLAN_MODULE_RST# on scope at boot time

Change-Id: Ia6af9ad6954ad8feeda33015e3f205842380939e
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 0e890a2787bf034d3358a33fc88c2dd8078593ab
Original-Change-Id: I120e26ad0ca486a326874986e142dcaee965b62d
Original-Signed-off-by: Brian Norris <briannorris@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/388009
Original-Reviewed-by: Douglas Anderson <dianders@chromium.org>
Original-Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/16882
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
diff --git a/src/mainboard/google/gru/mainboard.c b/src/mainboard/google/gru/mainboard.c
index b9d5355..0b55e7f 100644
--- a/src/mainboard/google/gru/mainboard.c
+++ b/src/mainboard/google/gru/mainboard.c
@@ -29,6 +29,16 @@
 
 #include "board.h"
 
+/*
+ * Wifi's PDN/RST line is pulled down by its (unpowered) voltage rails, but
+ * this reset pin is pulled up by default. Let's drive it low as early as we
+ * can.
+ */
+static void deassert_wifi_power(void)
+{
+	gpio_output(GPIO(1, B, 3), 0);  /* Assert WLAN_MODULE_RST# */
+}
+
 static void configure_emmc(void)
 {
 	/* Host controller does not support programmable clock generator.
@@ -237,6 +247,7 @@
 
 static void mainboard_init(device_t dev)
 {
+	deassert_wifi_power();
 	configure_sdmmc();
 	configure_emmc();
 	configure_codec();