<p>Julius Werner would like Philip Chen to <strong>review</strong> this change.</p><p><a href="https://review.coreboot.org/22323">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gru: Fix and export SPK_PA_EN GPIO for Scarlet<br><br>On older Grus, GPIO0_A2 was an audio voltage rail enable line. On<br>Scarlet, we instead moved the audio codec enable (previously on<br>GPIO1_A2) there. Unfortunately the code still had some hardcoded<br>leftovers that were overlooked in the initial port and make our speakers<br>smell weird.<br><br>This patch fixes the incorrect GPIO settings and adds the speaker enable<br>pin to the GPIOs passed through the coreboot table, so that depthcharge<br>doesn't have to keep its own definition of the pin which may go out of<br>sync.<br><br>Change-Id: I1ac70ee47ebf04b8b92ff17a46cbf5d839421a61<br>Signed-off-by: Julius Werner <jwerner@chromium.org><br>---<br>M src/mainboard/google/gru/board.h<br>M src/mainboard/google/gru/chromeos.c<br>M src/mainboard/google/gru/mainboard.c<br>3 files changed, 6 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/23/22323/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/mainboard/google/gru/board.h b/src/mainboard/google/gru/board.h<br>index 7237d46..f95db57 100644<br>--- a/src/mainboard/google/gru/board.h<br>+++ b/src/mainboard/google/gru/board.h<br>@@ -31,6 +31,7 @@<br> #define GPIO_P15V_EN      dead_code_t(gpio_t, "PP1500 doesn't exist on Scarlet")<br> #define GPIO_P18V_AUDIO_PWREN dead_code_t(gpio_t, "doesn't exist on Scarlet")<br> #define GPIO_P30V_EN       GPIO(0, B, 1)<br>+#define GPIO_SPK_PA_EN  GPIO(0, A, 2)<br> #define GPIO_TP_RST_L   dead_code_t(gpio_t, "don't need TP_RST_L on Scarlet")<br> #define GPIO_TPM_IRQ      GPIO(1, C, 1)<br> #define GPIO_WP         GPIO(0, B, 5)<br>@@ -41,6 +42,7 @@<br> #define GPIO_P15V_EN GPIO(0, B, 2)<br> #define GPIO_P18V_AUDIO_PWREN GPIO(0, A, 2)<br> #define GPIO_P30V_EN      GPIO(0, B, 4)<br>+#define GPIO_SPK_PA_EN  GPIO(1, A, 2)<br> #define GPIO_TP_RST_L   GPIO(3, B, 4)   /* may also be an I2C pull-up enable */<br> #define GPIO_TPM_IRQ  GPIO(0, A, 5)<br> #define GPIO_WP         GPIO(1, C, 2)<br>diff --git a/src/mainboard/google/gru/chromeos.c b/src/mainboard/google/gru/chromeos.c<br>index b28e9fc..0dd03ea 100644<br>--- a/src/mainboard/google/gru/chromeos.c<br>+++ b/src/mainboard/google/gru/chromeos.c<br>@@ -36,6 +36,7 @@<br>                 {GPIO_EC_IN_RW.raw, ACTIVE_HIGH, -1, "EC in RW"},<br>           {GPIO_EC_IRQ.raw, ACTIVE_LOW, -1, "EC interrupt"},<br>          {GPIO_RESET.raw, ACTIVE_HIGH, -1, "reset"},<br>+                {GPIO_SPK_PA_EN.raw, ACTIVE_HIGH, -1, "speaker enable"},<br> #if IS_ENABLED(CONFIG_GRU_HAS_TPM2)<br>              {GPIO_TPM_IRQ.raw, ACTIVE_HIGH, -1, "TPM interrupt"},<br> #endif<br>diff --git a/src/mainboard/google/gru/mainboard.c b/src/mainboard/google/gru/mainboard.c<br>index 43fbb71..3721ce8 100644<br>--- a/src/mainboard/google/gru/mainboard.c<br>+++ b/src/mainboard/google/gru/mainboard.c<br>@@ -226,11 +226,9 @@<br>       /* AUDIO IO domain 1.8V voltage selection */<br>  write32(&rk3399_grf->io_vsel, RK_SETBITS(1 << 1));<br> <br>-   /* CPU1_P1.8V_AUDIO_PWREN for P1.8_AUDIO */<br>-  gpio_output(GPIO(0, A, 2), 1);<br>-<br>-    /* set CPU1_SPK_PA_EN output */<br>-      gpio_output(GPIO(1, A, 2), 0);<br>+       if (!IS_ENABLED(CONFIG_BOARD_GOOGLE_SCARLET))<br>+                gpio_output(GPIO_P18V_AUDIO_PWREN, 1);<br>+       gpio_output(GPIO_SPK_PA_EN, 0);<br> <br>    rkclk_configure_i2s(12288000);<br> }<br></pre><p>To view, visit <a href="https://review.coreboot.org/22323">change 22323</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/22323"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I1ac70ee47ebf04b8b92ff17a46cbf5d839421a61 </div>
<div style="display:none"> Gerrit-Change-Number: 22323 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Julius Werner <jwerner@chromium.org> </div>
<div style="display:none"> Gerrit-Reviewer: Philip Chen <philipchen@chromium.org> </div>