Yidi Lin has submitted this change. ( https://review.coreboot.org/c/coreboot/+/85858?usp=email )
Change subject: mb/google/rauru: Add ALC5650 support ......................................................................
mb/google/rauru: Add ALC5650 support
Configure ALC5650 for Hylia to support beep sound in the payload.
BRANCH=rauru BUG=b:383376419 TEST=Verify devbeep in depthcharge console
Change-Id: I2c247be87ad212fa52e21e1e6da17c07d82f1988 Signed-off-by: Yang Wu wuyang5@huaqin.corp-partner.google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/85858 Reviewed-by: Yidi Lin yidilin@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Yu-Ping Wu yupingso@google.com --- M src/mainboard/google/rauru/chromeos.c M src/mainboard/google/rauru/devicetree.cb M src/mainboard/google/rauru/gpio.h M src/mainboard/google/rauru/mainboard.c 4 files changed, 36 insertions(+), 2 deletions(-)
Approvals: Yu-Ping Wu: Looks good to me, approved Yidi Lin: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/src/mainboard/google/rauru/chromeos.c b/src/mainboard/google/rauru/chromeos.c index f530396..6a34cb9 100644 --- a/src/mainboard/google/rauru/chromeos.c +++ b/src/mainboard/google/rauru/chromeos.c @@ -46,8 +46,14 @@ {GPIO_EN_SPKR.id, ACTIVE_LOW, -1, "speaker reset"}, };
+ struct lb_gpio alc5645_gpios[] = { + {GPIO_EN_SPKR.id, ACTIVE_HIGH, -1, "speaker enable"}, + }; + if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_TAS2563))) lb_add_gpios(gpios, smartamp_gpios, ARRAY_SIZE(smartamp_gpios)); + else if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_ALC5645))) + lb_add_gpios(gpios, alc5645_gpios, ARRAY_SIZE(alc5645_gpios)); else lb_add_gpios(gpios, nau8318_gpios, ARRAY_SIZE(nau8318_gpios)); } diff --git a/src/mainboard/google/rauru/devicetree.cb b/src/mainboard/google/rauru/devicetree.cb index 7f6dc59..1705dbe 100644 --- a/src/mainboard/google/rauru/devicetree.cb +++ b/src/mainboard/google/rauru/devicetree.cb @@ -4,6 +4,7 @@ field AUDIO_AMP 28 29 option AMP_NAU8318 0 option AMP_TAS2563 1 + option AMP_ALC5645 2 end end
diff --git a/src/mainboard/google/rauru/gpio.h b/src/mainboard/google/rauru/gpio.h index 6191e05..c1c5b4b 100644 --- a/src/mainboard/google/rauru/gpio.h +++ b/src/mainboard/google/rauru/gpio.h @@ -20,6 +20,11 @@ #define GPIO_I2SI4_LRCK GPIO(I2SIN1_LRCK) #define GPIO_I2SO4_D0 GPIO(I2SOUT1_DO)
+#define GPIO_I2SI6_MCK GPIO(I2SIN0_MCK) +#define GPIO_I2SI6_BCK GPIO(I2SIN0_BCK) +#define GPIO_I2SI6_LRCK GPIO(I2SIN0_LRCK) +#define GPIO_I2SO6_D0 GPIO(I2SOUT0_DO) + void setup_chromeos_gpios(void);
#endif diff --git a/src/mainboard/google/rauru/mainboard.c b/src/mainboard/google/rauru/mainboard.c index a49caf6..5664585 100644 --- a/src/mainboard/google/rauru/mainboard.c +++ b/src/mainboard/google/rauru/mainboard.c @@ -18,7 +18,7 @@
#define AFE_SE_SECURE_CON1 (AUDIO_BASE + 0x5634)
-static void configure_i2s(void) +static void configure_tas2563(void) { /* Switch to normal mode */ write32p(AFE_SE_SECURE_CON1, 0x0); @@ -27,13 +27,35 @@ gpio_set_mode(GPIO_I2SI4_BCK, GPIO_FUNC(I2SIN1_BCK, I2SIN4_BCK)); gpio_set_mode(GPIO_I2SI4_LRCK, GPIO_FUNC(I2SIN1_LRCK, I2SIN4_LRCK)); gpio_set_mode(GPIO_I2SO4_D0, GPIO_FUNC(I2SOUT1_DO, I2SOUT4_DATA0)); + + printk(BIOS_INFO, "%s: done\n", __func__); }
+static void configure_alc5645(void) +{ + /* Switch to normal mode */ + write32p(AFE_SE_SECURE_CON1, 0x0); + + /* Set up I2S */ + gpio_set_mode(GPIO_I2SI6_MCK, GPIO_FUNC(I2SIN0_MCK, I2S_MCK0)); + gpio_set_mode(GPIO_I2SI6_BCK, GPIO_FUNC(I2SIN0_BCK, I2SIN6_0_BCK)); + gpio_set_mode(GPIO_I2SI6_LRCK, GPIO_FUNC(I2SIN0_LRCK, I2SIN6_0_LRCK)); + gpio_set_mode(GPIO_I2SO6_D0, GPIO_FUNC(I2SOUT0_DO, I2SOUT6_0_DO)); + + /* Init I2C bus timing register for audio codecs */ + mtk_i2c_bus_init(I2C3, I2C_SPEED_STANDARD); + + printk(BIOS_INFO, "%s: done\n", __func__); +} static void configure_audio(void) { if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_TAS2563))) { mtk_i2c_bus_init(I2C3, I2C_SPEED_FAST); - configure_i2s(); + configure_tas2563(); + } else if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_ALC5645))) { + configure_alc5645(); + } else { + printk(BIOS_INFO, "Audio configure default amps NAU8318\n"); }
printk(BIOS_INFO, "%s: done\n", __func__);