Jiaxin Yu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32459
Change subject: google/kukui: Enable boot sound support ......................................................................
google/kukui: Enable boot sound support
Config enable gpio for speaker amp max98357a.
BUG=b:117254418 TEST=Build pass and verified on kukui p1 board BRANCH=None
Change-Id: I97655702dff402245326d2eff71fae0e336df9f5 Signed-off-by: Jiaxin Yu jiaxin.yu@mediatek.com --- M src/mainboard/google/kukui/chromeos.c M src/mainboard/google/kukui/gpio.h M src/mainboard/google/kukui/mainboard.c 3 files changed, 16 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/32459/1
diff --git a/src/mainboard/google/kukui/chromeos.c b/src/mainboard/google/kukui/chromeos.c index 44e75e2..ad2edaa 100644 --- a/src/mainboard/google/kukui/chromeos.c +++ b/src/mainboard/google/kukui/chromeos.c @@ -27,6 +27,7 @@ gpio_input_pullup(EC_IRQ); gpio_input_pullup(CR50_IRQ); gpio_output(GPIO_RESET, 0); + gpio_output(EN_SPK_AMP, 0); }
void fill_lb_gpios(struct lb_gpios *gpios) @@ -38,6 +39,7 @@ {EC_IN_RW.id, ACTIVE_HIGH, -1, "EC in RW"}, {EC_IRQ.id, ACTIVE_LOW, -1, "EC interrupt"}, {CR50_IRQ.id, ACTIVE_HIGH, -1, "TPM interrupt"}, + {EN_SPK_AMP.id, ACTIVE_HIGH, -1, "SPK enable"}, }; lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios)); } diff --git a/src/mainboard/google/kukui/gpio.h b/src/mainboard/google/kukui/gpio.h index 92d238e..0a98997 100644 --- a/src/mainboard/google/kukui/gpio.h +++ b/src/mainboard/google/kukui/gpio.h @@ -23,6 +23,7 @@ #define EC_IN_RW GPIO(PERIPHERAL_EN14) #define CR50_IRQ GPIO(PERIPHERAL_EN3) #define GPIO_RESET GPIO(PERIPHERAL_EN8) +#define EN_SPK_AMP GPIO(PERIPHERAL_EN12)
void setup_chromeos_gpios(void);
diff --git a/src/mainboard/google/kukui/mainboard.c b/src/mainboard/google/kukui/mainboard.c index e1d8f5f..40b8a49 100644 --- a/src/mainboard/google/kukui/mainboard.c +++ b/src/mainboard/google/kukui/mainboard.c @@ -16,6 +16,7 @@ #include <device/device.h> #include <soc/gpio.h> #include <soc/mmu_operations.h> +#include <soc/mtcmos.h> #include <soc/usb.h>
static void configure_emmc(void) @@ -37,10 +38,22 @@ setup_usb_host(); }
+static void configure_audio(void) +{ + /* Audio PWR*/ + mtcmos_audio_power_on(); + + /* SoC I2S */ + gpio_set_mode(GPIO(CAM_RST0), PAD_CAM_RST0_FUNC_I2S2_LRCK); + gpio_set_mode(GPIO(CAM_PDN1), PAD_CAM_PDN1_FUNC_I2S2_BCK); + gpio_set_mode(GPIO(CAM_PDN0), PAD_CAM_PDN0_FUNC_I2S2_MCK); + gpio_set_mode(GPIO(EINT3), PAD_EINT3_FUNC_I2S3_DO); +} static void mainboard_init(struct device *dev) { configure_emmc(); configure_usb(); + configure_audio(); }
static void mainboard_enable(struct device *dev)
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32459 )
Change subject: google/kukui: Enable boot sound support ......................................................................
Patch Set 1:
(6 comments)
https://review.coreboot.org/#/c/32459/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/32459/1//COMMIT_MSG@7 PS1, Line 7: Enable boot sound support Support sound in boot process
https://review.coreboot.org/#/c/32459/1//COMMIT_MSG@9 PS1, Line 9: gpio GPIO
https://review.coreboot.org/#/c/32459/1//COMMIT_MSG@9 PS1, Line 9: Config enable Configure and enable
https://review.coreboot.org/#/c/32459/1/src/mainboard/google/kukui/chromeos.... File src/mainboard/google/kukui/chromeos.c:
https://review.coreboot.org/#/c/32459/1/src/mainboard/google/kukui/chromeos.... PS1, Line 42: SPK enable Enable speaker
https://review.coreboot.org/#/c/32459/1/src/mainboard/google/kukui/gpio.h File src/mainboard/google/kukui/gpio.h:
https://review.coreboot.org/#/c/32459/1/src/mainboard/google/kukui/gpio.h@26 PS1, Line 26: EN_SPK_AMP GPIO_EN_SPK_AMP
https://review.coreboot.org/#/c/32459/1/src/mainboard/google/kukui/mainboard... File src/mainboard/google/kukui/mainboard.c:
https://review.coreboot.org/#/c/32459/1/src/mainboard/google/kukui/mainboard... PS1, Line 44: mtcmos_audio_power_on Should we configure GPIOs to I2S first or power on audio first?
Hello Tristan Hsieh, Hung-Te Lin, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32459
to look at the new patch set (#2).
Change subject: google/kukui: Support sound in boot process ......................................................................
google/kukui: Support sound in boot process
Configure and enable GPIO for speaker amp max98357a.
BUG=b:117254418 TEST=Build pass and verified on kukui p1 board BRANCH=None
Change-Id: I97655702dff402245326d2eff71fae0e336df9f5 Signed-off-by: Jiaxin Yu jiaxin.yu@mediatek.com --- M src/mainboard/google/kukui/chromeos.c M src/mainboard/google/kukui/gpio.h M src/mainboard/google/kukui/mainboard.c 3 files changed, 16 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/32459/2
Jiaxin Yu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32459 )
Change subject: google/kukui: Support sound in boot process ......................................................................
Patch Set 2:
(6 comments)
Hi Hung-Te,please help to review again,thanks.
https://review.coreboot.org/#/c/32459/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/32459/1//COMMIT_MSG@7 PS1, Line 7: Enable boot sound support
Support sound in boot process
Done
https://review.coreboot.org/#/c/32459/1//COMMIT_MSG@9 PS1, Line 9: gpio
GPIO
Done
https://review.coreboot.org/#/c/32459/1//COMMIT_MSG@9 PS1, Line 9: Config enable
Configure and enable
Done
https://review.coreboot.org/#/c/32459/1/src/mainboard/google/kukui/chromeos.... File src/mainboard/google/kukui/chromeos.c:
https://review.coreboot.org/#/c/32459/1/src/mainboard/google/kukui/chromeos.... PS1, Line 42: SPK enable
Enable speaker
Done
https://review.coreboot.org/#/c/32459/1/src/mainboard/google/kukui/gpio.h File src/mainboard/google/kukui/gpio.h:
https://review.coreboot.org/#/c/32459/1/src/mainboard/google/kukui/gpio.h@26 PS1, Line 26: EN_SPK_AMP
GPIO_EN_SPK_AMP
Done
https://review.coreboot.org/#/c/32459/1/src/mainboard/google/kukui/mainboard... File src/mainboard/google/kukui/mainboard.c:
https://review.coreboot.org/#/c/32459/1/src/mainboard/google/kukui/mainboard... PS1, Line 44: mtcmos_audio_power_on
Should we configure GPIOs to I2S first or power on audio first?
Usually we power on audio first and then config other audio related such as gpio mode.
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32459 )
Change subject: google/kukui: Support sound in boot process ......................................................................
Patch Set 2: Code-Review+1
@Julius, do you want to take a final look?
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32459 )
Change subject: google/kukui: Support sound in boot process ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/#/c/32459/2/src/mainboard/google/kukui/chromeos.... File src/mainboard/google/kukui/chromeos.c:
https://review.coreboot.org/#/c/32459/2/src/mainboard/google/kukui/chromeos.... PS2, Line 42: {GPIO_EN_SPK_AMP.id, ACTIVE_HIGH, -1, "Enable speaker"}, Please use "speaker enable" which has precedent in Gru. (We should probably define constants for all of these one of these days...)
Hello Julius Werner, You-Cheng Syu, Tristan Hsieh, Hung-Te Lin, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/32459
to look at the new patch set (#3).
Change subject: google/kukui: Support sound in boot process ......................................................................
google/kukui: Support sound in boot process
Configure and enable GPIO for speaker amp max98357a.
BUG=b:117254418 TEST=Build pass and verified on kukui p1 board BRANCH=None
Change-Id: I97655702dff402245326d2eff71fae0e336df9f5 Signed-off-by: Jiaxin Yu jiaxin.yu@mediatek.com --- M src/mainboard/google/kukui/chromeos.c M src/mainboard/google/kukui/gpio.h M src/mainboard/google/kukui/mainboard.c 3 files changed, 16 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/32459/3
yu jiaxin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32459 )
Change subject: google/kukui: Support sound in boot process ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/#/c/32459/2/src/mainboard/google/kukui/chromeos.... File src/mainboard/google/kukui/chromeos.c:
https://review.coreboot.org/#/c/32459/2/src/mainboard/google/kukui/chromeos.... PS2, Line 42: {GPIO_EN_SPK_AMP.id, ACTIVE_HIGH, -1, "Enable speaker"},
Please use "speaker enable" which has precedent in Gru. […]
Done
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32459 )
Change subject: google/kukui: Support sound in boot process ......................................................................
Patch Set 3: Code-Review+2
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/32459 )
Change subject: google/kukui: Support sound in boot process ......................................................................
google/kukui: Support sound in boot process
Configure and enable GPIO for speaker amp max98357a.
BUG=b:117254418 TEST=Build pass and verified on kukui p1 board BRANCH=None
Change-Id: I97655702dff402245326d2eff71fae0e336df9f5 Signed-off-by: Jiaxin Yu jiaxin.yu@mediatek.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/32459 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Julius Werner jwerner@chromium.org --- M src/mainboard/google/kukui/chromeos.c M src/mainboard/google/kukui/gpio.h M src/mainboard/google/kukui/mainboard.c 3 files changed, 16 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved
diff --git a/src/mainboard/google/kukui/chromeos.c b/src/mainboard/google/kukui/chromeos.c index 44e75e2..3539501 100644 --- a/src/mainboard/google/kukui/chromeos.c +++ b/src/mainboard/google/kukui/chromeos.c @@ -27,6 +27,7 @@ gpio_input_pullup(EC_IRQ); gpio_input_pullup(CR50_IRQ); gpio_output(GPIO_RESET, 0); + gpio_output(GPIO_EN_SPK_AMP, 0); }
void fill_lb_gpios(struct lb_gpios *gpios) @@ -38,6 +39,7 @@ {EC_IN_RW.id, ACTIVE_HIGH, -1, "EC in RW"}, {EC_IRQ.id, ACTIVE_LOW, -1, "EC interrupt"}, {CR50_IRQ.id, ACTIVE_HIGH, -1, "TPM interrupt"}, + {GPIO_EN_SPK_AMP.id, ACTIVE_HIGH, -1, "speaker enable"}, }; lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios)); } diff --git a/src/mainboard/google/kukui/gpio.h b/src/mainboard/google/kukui/gpio.h index 92d238e..977acc3 100644 --- a/src/mainboard/google/kukui/gpio.h +++ b/src/mainboard/google/kukui/gpio.h @@ -23,6 +23,7 @@ #define EC_IN_RW GPIO(PERIPHERAL_EN14) #define CR50_IRQ GPIO(PERIPHERAL_EN3) #define GPIO_RESET GPIO(PERIPHERAL_EN8) +#define GPIO_EN_SPK_AMP GPIO(PERIPHERAL_EN12)
void setup_chromeos_gpios(void);
diff --git a/src/mainboard/google/kukui/mainboard.c b/src/mainboard/google/kukui/mainboard.c index e1d8f5f..40b8a49 100644 --- a/src/mainboard/google/kukui/mainboard.c +++ b/src/mainboard/google/kukui/mainboard.c @@ -16,6 +16,7 @@ #include <device/device.h> #include <soc/gpio.h> #include <soc/mmu_operations.h> +#include <soc/mtcmos.h> #include <soc/usb.h>
static void configure_emmc(void) @@ -37,10 +38,22 @@ setup_usb_host(); }
+static void configure_audio(void) +{ + /* Audio PWR*/ + mtcmos_audio_power_on(); + + /* SoC I2S */ + gpio_set_mode(GPIO(CAM_RST0), PAD_CAM_RST0_FUNC_I2S2_LRCK); + gpio_set_mode(GPIO(CAM_PDN1), PAD_CAM_PDN1_FUNC_I2S2_BCK); + gpio_set_mode(GPIO(CAM_PDN0), PAD_CAM_PDN0_FUNC_I2S2_MCK); + gpio_set_mode(GPIO(EINT3), PAD_EINT3_FUNC_I2S3_DO); +} static void mainboard_init(struct device *dev) { configure_emmc(); configure_usb(); + configure_audio(); }
static void mainboard_enable(struct device *dev)