[coreboot-gerrit] Patch set updated for coreboot: 89a8f40 rush: audio: Setup I2S1/DAP2 and EXTPERIPH1/MCLK muxes correctly

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Mon Apr 13 13:07:27 CEST 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9579

-gerrit

commit 89a8f40b0891c17610a268b57efd2357d7d9bfd4
Author: Tom Warren <twarren at nvidia.com>
Date:   Fri Dec 5 13:34:53 2014 -0700

    rush: audio: Setup I2S1/DAP2 and EXTPERIPH1/MCLK muxes correctly
    
    With this change, audio 'beeps' are heard on boot if Ctrl-U is
    pressed, or devmode/recmode is entered. I also tested via an
    explicit call to VbExBeep in the kernel boot path. Note that
    a couple of Rush CLs for depthcharge are needed for audio, too.
    
    BUG=chrome-os-partner:32582
    BRANCH=none
    TEST=as above. Built and booted Rush/Norrin64.
    
    Change-Id: I43c65a4d11c5ab7b16289e19f3b42cfc0300ea7c
    Signed-off-by: Stefan Reinauer <reinauer at chromium.org>
    Original-Commit-Id: 4a682fb2403f7c6d53e74bfa945481242577f6c3
    Original-Change-Id: Ia37f077569afd806ce6574c4c58813fd7aca1644
    Original-Signed-off-by: Tom Warren <twarren at nvidia.com>
    Original-Reviewed-on: https://chromium-review.googlesource.com/233671
    Original-Reviewed-by: Aaron Durbin <adurbin at chromium.org>
---
 src/mainboard/google/rush/mainboard.c | 29 ++++++++++++++++++++++-------
 1 file changed, 22 insertions(+), 7 deletions(-)

diff --git a/src/mainboard/google/rush/mainboard.c b/src/mainboard/google/rush/mainboard.c
index bb4da19..341d373 100644
--- a/src/mainboard/google/rush/mainboard.c
+++ b/src/mainboard/google/rush/mainboard.c
@@ -95,18 +95,33 @@ static void setup_usb(void)
 	usb_setup_utmip((void *)TEGRA_USB3_BASE);
 }
 
+static const struct pad_config i2s1_pad[] = {
+	/* I2S1 */
+	PAD_CFG_SFIO(DAP2_SCLK, PINMUX_INPUT_ENABLE, I2S1),
+	PAD_CFG_SFIO(DAP2_FS, PINMUX_INPUT_ENABLE, I2S1),
+	PAD_CFG_SFIO(DAP2_DOUT, PINMUX_INPUT_ENABLE, I2S1),
+	PAD_CFG_SFIO(DAP2_DIN, PINMUX_INPUT_ENABLE | PINMUX_TRISTATE, I2S1),
+	/* codec MCLK via EXTPERIPH1 */
+	PAD_CFG_SFIO(DAP_MCLK1, PINMUX_PULL_NONE, EXTPERIPH1),
+};
+
+static const struct funit_cfg audio_funit[] = {
+	/* We need 1.5MHz for I2S1. So we use CLK_M */
+	FUNIT_CFG(I2S1, CLK_M, 1500, i2s1_pad, ARRAY_SIZE(i2s1_pad)),
+};
+
 /* Audio init: clocks and enables/resets */
 static void setup_audio(void)
 {
-	/* External peripheral 1: audio codec (max98090) using 12MHz CLK1 */
-	clock_configure_source(extperiph1, CLK_M, 12000);
-
 	/*
-	 * We need 1.5MHz for I2S1. So, we use CLK_M. CLK_DIVIDER macro
-	 * returns a divisor (0xe) a little bit off from the ideal value (0xd),
-	 * but it's good enough for beeps.
+	 * External peripheral 1: audio codec (max98090) uses 12MHz CLK1
+	 * NOTE: We can't use a funits struct/call here because EXTPERIPH1/2/3
+	 * don't have BASE regs or CAR RST/ENA bits. Also, the mux setting for
+	 * EXTPERIPH1/DAP_MCLK1 is rolled into the I2S1 padcfg.
 	 */
-	clock_configure_source(i2s1, CLK_M, 1500);
+	clock_configure_source(extperiph1, CLK_M, 12000);
+
+	soc_configure_funits(audio_funit, ARRAY_SIZE(audio_funit));
 
 	clock_external_output(1);	/* For external MAX98090 audio codec. */
 



More information about the coreboot-gerrit mailing list