google/*: Clean up Kconfg board selection for Google MTK boards

This patch tries to standardize and simplify the Kconfig option layout
for Google boards with MediaTek SoCs and align them to the scheme used
with other Arm-based Google boards.

Change-Id: I40880e7609ba703d0053ad01da742871e54d4e7a
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79063
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yidi Lin <yidilin@google.com>
This commit is contained in:
Julius Werner 2023-11-14 16:23:06 -08:00
parent 53b79bef61
commit 0712851ca3
9 changed files with 102 additions and 194 deletions

View File

@ -1,8 +1,14 @@
## SPDX-License-Identifier: GPL-2.0-only ## SPDX-License-Identifier: GPL-2.0-only
# Umbrella option to be selected by variant boards.
config BOARD_GOOGLE_ASURADA_COMMON config BOARD_GOOGLE_ASURADA_COMMON
def_bool n def_bool BOARD_GOOGLE_ASURADA || \
BOARD_GOOGLE_HAYATO || \
BOARD_GOOGLE_SPHERION
if BOARD_GOOGLE_ASURADA_COMMON
config BOARD_SPECIFIC_OPTIONS
def_bool y
select RTC select RTC
select SOC_MEDIATEK_MT8192 select SOC_MEDIATEK_MT8192
select BOARD_ROMSIZE_KB_8192 select BOARD_ROMSIZE_KB_8192
@ -24,17 +30,6 @@ config BOARD_GOOGLE_ASURADA_COMMON
select COMMONLIB_STORAGE select COMMONLIB_STORAGE
select COMMONLIB_STORAGE_MMC select COMMONLIB_STORAGE_MMC
config BOARD_GOOGLE_ASURADA
select BOARD_GOOGLE_ASURADA_COMMON
config BOARD_GOOGLE_HAYATO
select BOARD_GOOGLE_ASURADA_COMMON
config BOARD_GOOGLE_SPHERION
select BOARD_GOOGLE_ASURADA_COMMON
if BOARD_GOOGLE_ASURADA_COMMON
config VBOOT config VBOOT
select EC_GOOGLE_CHROMEEC_SWITCHES select EC_GOOGLE_CHROMEEC_SWITCHES
select VBOOT_VBNV_FLASH select VBOOT_VBNV_FLASH

View File

@ -1,8 +1,14 @@
## SPDX-License-Identifier: GPL-2.0-only ## SPDX-License-Identifier: GPL-2.0-only
# Umbrella option to be selected by variant boards.
config BOARD_GOOGLE_CHERRY_COMMON config BOARD_GOOGLE_CHERRY_COMMON
def_bool n def_bool BOARD_GOOGLE_CHERRY || \
BOARD_GOOGLE_DOJO || \
BOARD_GOOGLE_TOMATO
if BOARD_GOOGLE_CHERRY_COMMON
config BOARD_SPECIFIC_OPTIONS
def_bool y
select RTC select RTC
select SOC_MEDIATEK_MT8195 select SOC_MEDIATEK_MT8195
select BOARD_ROMSIZE_KB_8192 select BOARD_ROMSIZE_KB_8192
@ -23,17 +29,6 @@ config BOARD_GOOGLE_CHERRY_COMMON
select COMMONLIB_STORAGE select COMMONLIB_STORAGE
select COMMONLIB_STORAGE_MMC select COMMONLIB_STORAGE_MMC
config BOARD_GOOGLE_CHERRY
select BOARD_GOOGLE_CHERRY_COMMON
config BOARD_GOOGLE_DOJO
select BOARD_GOOGLE_CHERRY_COMMON
config BOARD_GOOGLE_TOMATO
select BOARD_GOOGLE_CHERRY_COMMON
if BOARD_GOOGLE_CHERRY_COMMON
config VBOOT config VBOOT
select EC_GOOGLE_CHROMEEC_SWITCHES select EC_GOOGLE_CHROMEEC_SWITCHES
select VBOOT_VBNV_FLASH select VBOOT_VBNV_FLASH

View File

@ -1,8 +1,36 @@
## SPDX-License-Identifier: GPL-2.0-only ## SPDX-License-Identifier: GPL-2.0-only
# Umbrella option to be selected by variant boards.
config BOARD_GOOGLE_CORSOLA_COMMON config BOARD_GOOGLE_CORSOLA_COMMON
def_bool n def_bool BOARD_GOOGLE_KINGLER_COMMON || \
BOARD_GOOGLE_KRABBY_COMMON || \
BOARD_GOOGLE_STARYU_COMMON
config BOARD_GOOGLE_KINGLER_COMMON
def_bool BOARD_GOOGLE_KINGLER || \
BOARD_GOOGLE_PONYTA || \
BOARD_GOOGLE_STEELIX || \
BOARD_GOOGLE_VOLTORB
config BOARD_GOOGLE_KRABBY_COMMON
def_bool BOARD_GOOGLE_CHINCHOU || \
BOARD_GOOGLE_KRABBY || \
BOARD_GOOGLE_MAGIKARP || \
BOARD_GOOGLE_TENTACRUEL
config BOARD_GOOGLE_STARYU_COMMON
def_bool BOARD_GOOGLE_STARMIE
select MIPI_PANEL_STA_HIMAX83102_J02
select MIPI_PANEL_STA_ILI9882T
if BOARD_GOOGLE_CORSOLA_COMMON
config CORSOLA_SDCARD_INIT
def_bool BOARD_GOOGLE_MAGIKARP || \
BOARD_GOOGLE_TENTACRUEL || \
BOARD_GOOGLE_KINGLER_COMMON
config BOARD_SPECIFIC_OPTIONS
def_bool y
select SOC_MEDIATEK_MT8186 select SOC_MEDIATEK_MT8186
select BOARD_ROMSIZE_KB_8192 select BOARD_ROMSIZE_KB_8192
select MAINBOARD_HAS_CHROMEOS select MAINBOARD_HAS_CHROMEOS
@ -21,62 +49,19 @@ config BOARD_GOOGLE_CORSOLA_COMMON
select MAINBOARD_HAS_TPM2 if VBOOT select MAINBOARD_HAS_TPM2 if VBOOT
select MAINBOARD_HAS_NATIVE_VGA_INIT select MAINBOARD_HAS_NATIVE_VGA_INIT
select HAVE_LINEAR_FRAMEBUFFER select HAVE_LINEAR_FRAMEBUFFER
select DRIVER_ANALOGIX_ANX7625 if BOARD_GOOGLE_CHINCHOU || \
BOARD_GOOGLE_KINGLER || \
BOARD_GOOGLE_PONYTA || \
BOARD_GOOGLE_STEELIX || \
BOARD_GOOGLE_VOLTORB
select DRIVER_PARADE_PS8640 if BOARD_GOOGLE_KRABBY || \
BOARD_GOOGLE_MAGIKARP || \
BOARD_GOOGLE_STEELIX || \
BOARD_GOOGLE_TENTACRUEL
select RTC select RTC
select FW_CONFIG select FW_CONFIG
select FW_CONFIG_SOURCE_CHROMEEC_CBI select FW_CONFIG_SOURCE_CHROMEEC_CBI
config BOARD_GOOGLE_KINGLER_COMMON
def_bool n
select BOARD_GOOGLE_CORSOLA_COMMON
config BOARD_GOOGLE_KRABBY_COMMON
def_bool n
select BOARD_GOOGLE_CORSOLA_COMMON
config BOARD_GOOGLE_STARYU_COMMON
def_bool n
select BOARD_GOOGLE_CORSOLA_COMMON
config BOARD_GOOGLE_KINGLER
select BOARD_GOOGLE_KINGLER_COMMON
select DRIVER_ANALOGIX_ANX7625
config BOARD_GOOGLE_PONYTA
select BOARD_GOOGLE_KINGLER_COMMON
select DRIVER_ANALOGIX_ANX7625
config BOARD_GOOGLE_STEELIX
select BOARD_GOOGLE_KINGLER_COMMON
select DRIVER_ANALOGIX_ANX7625
select DRIVER_PARADE_PS8640
config BOARD_GOOGLE_VOLTORB
select BOARD_GOOGLE_KINGLER_COMMON
select DRIVER_ANALOGIX_ANX7625
config BOARD_GOOGLE_KRABBY
select BOARD_GOOGLE_KRABBY_COMMON
select DRIVER_PARADE_PS8640
config BOARD_GOOGLE_CHINCHOU
select BOARD_GOOGLE_KRABBY_COMMON
select DRIVER_ANALOGIX_ANX7625
config BOARD_GOOGLE_TENTACRUEL
select BOARD_GOOGLE_KRABBY_COMMON
select DRIVER_PARADE_PS8640
config BOARD_GOOGLE_MAGIKARP
select BOARD_GOOGLE_KRABBY_COMMON
select DRIVER_PARADE_PS8640
config BOARD_GOOGLE_STARMIE
select BOARD_GOOGLE_STARYU_COMMON
select MIPI_PANEL_STA_HIMAX83102_J02
select MIPI_PANEL_STA_ILI9882T
if BOARD_GOOGLE_CORSOLA_COMMON
config VBOOT config VBOOT
select EC_GOOGLE_CHROMEEC_SWITCHES select EC_GOOGLE_CHROMEEC_SWITCHES
select VBOOT_VBNV_FLASH select VBOOT_VBNV_FLASH
@ -101,13 +86,6 @@ config BOOT_DEVICE_SPI_FLASH_BUS
int int
default 7 default 7
config SDCARD_INIT
bool
default y if BOARD_GOOGLE_MAGIKARP
default y if BOARD_GOOGLE_TENTACRUEL
default y if BOARD_GOOGLE_KINGLER_COMMON
default n if BOARD_GOOGLE_KRABBY_COMMON
config DRIVER_TPM_SPI_BUS config DRIVER_TPM_SPI_BUS
hex hex
default 0x2 default 0x2

View File

@ -42,7 +42,7 @@ static void mainboard_init(struct device *dev)
{ {
mtk_msdc_configure_emmc(true); mtk_msdc_configure_emmc(true);
if (CONFIG(SDCARD_INIT)) { if (CONFIG(CORSOLA_SDCARD_INIT)) {
printk(BIOS_INFO, "SD card init\n"); printk(BIOS_INFO, "SD card init\n");
/* External SD Card connected via USB */ /* External SD Card connected via USB */

View File

@ -1,17 +1,21 @@
## SPDX-License-Identifier: GPL-2.0-only ## SPDX-License-Identifier: GPL-2.0-only
# Umbrella option to be selected by variant boards.
config BOARD_GOOGLE_GERALT_COMMON config BOARD_GOOGLE_GERALT_COMMON
def_bool n def_bool BOARD_GOOGLE_CIRI || \
BOARD_GOOGLE_GERALT
config BOARD_GOOGLE_GERALT
select BOARD_GOOGLE_GERALT_COMMON
config BOARD_GOOGLE_CIRI
select BOARD_GOOGLE_GERALT_COMMON
if BOARD_GOOGLE_GERALT_COMMON if BOARD_GOOGLE_GERALT_COMMON
config GERALT_SDCARD_INIT
def_bool BOARD_GOOGLE_GERALT
config GERALT_USE_MAX98390
def_bool BOARD_GOOGLE_CIRI || \
BOARD_GOOGLE_GERALT
config GERALT_USE_NAU8318
def_bool n
config VBOOT config VBOOT
select VBOOT_VBNV_FLASH select VBOOT_VBNV_FLASH
select EC_GOOGLE_CHROMEEC_SWITCHES select EC_GOOGLE_CHROMEEC_SWITCHES
@ -66,21 +70,4 @@ config DRIVER_TPM_I2C_ADDR
hex hex
default 0x50 default 0x50
config SDCARD_INIT
bool
default y if BOARD_GOOGLE_GERALT
default n if BOARD_GOOGLE_CIRI
choice
prompt "Speaker AMP for Geralt"
default USE_MAX98390 if BOARD_GOOGLE_GERALT || BOARD_GOOGLE_CIRI
config USE_MAX98390
bool "MAX98390"
config USE_NAU8318
bool "NAU8318"
endchoice
endif endif

View File

@ -46,19 +46,19 @@ void fill_lb_gpios(struct lb_gpios *gpios)
fill_lp_backlight_gpios(gpios); fill_lp_backlight_gpios(gpios);
if (CONFIG(SDCARD_INIT)) { if (CONFIG(GERALT_SDCARD_INIT)) {
struct lb_gpio sd_card_gpios[] = { struct lb_gpio sd_card_gpios[] = {
{GPIO_SD_CD_ODL.id, ACTIVE_LOW, -1, "SD card detect"}, {GPIO_SD_CD_ODL.id, ACTIVE_LOW, -1, "SD card detect"},
}; };
lb_add_gpios(gpios, sd_card_gpios, ARRAY_SIZE(sd_card_gpios)); lb_add_gpios(gpios, sd_card_gpios, ARRAY_SIZE(sd_card_gpios));
} }
if (CONFIG(USE_MAX98390)) { if (CONFIG(GERALT_USE_MAX98390)) {
struct lb_gpio max98390_gpios[] = { struct lb_gpio max98390_gpios[] = {
{GPIO_RST_SPKR_L.id, ACTIVE_LOW, -1, "speaker reset"}, {GPIO_RST_SPKR_L.id, ACTIVE_LOW, -1, "speaker reset"},
}; };
lb_add_gpios(gpios, max98390_gpios, ARRAY_SIZE(max98390_gpios)); lb_add_gpios(gpios, max98390_gpios, ARRAY_SIZE(max98390_gpios));
} else if (CONFIG(USE_NAU8318)) { } else if (CONFIG(GERALT_USE_NAU8318)) {
struct lb_gpio nau8318_gpios[] = { struct lb_gpio nau8318_gpios[] = {
{GPIO_EN_SPKR.id, ACTIVE_HIGH, -1, "speaker enable"}, {GPIO_EN_SPKR.id, ACTIVE_HIGH, -1, "speaker enable"},
{GPIO_BEEP_ON_OD.id, ACTIVE_HIGH, -1, "beep enable"}, {GPIO_BEEP_ON_OD.id, ACTIVE_HIGH, -1, "beep enable"},

View File

@ -31,7 +31,7 @@ static void configure_i2s(void)
static void configure_audio(void) static void configure_audio(void)
{ {
if (CONFIG(USE_MAX98390)) { if (CONFIG(GERALT_USE_MAX98390)) {
printk(BIOS_DEBUG, "Configure MAX98390 audio\n"); printk(BIOS_DEBUG, "Configure MAX98390 audio\n");
mtk_i2c_bus_init(I2C0, I2C_SPEED_FAST); mtk_i2c_bus_init(I2C0, I2C_SPEED_FAST);
@ -54,7 +54,7 @@ static void mainboard_init(struct device *dev)
configure_audio(); configure_audio();
if (CONFIG(SDCARD_INIT)) if (CONFIG(GERALT_SDCARD_INIT))
mtk_msdc_configure_sdcard(); mtk_msdc_configure_sdcard();
setup_usb_host(); setup_usb_host();

View File

@ -1,76 +1,33 @@
## SPDX-License-Identifier: GPL-2.0-only ## SPDX-License-Identifier: GPL-2.0-only
# Umbrella option to be selected by variant boards.
config BOARD_GOOGLE_KUKUI_COMMON config BOARD_GOOGLE_KUKUI_COMMON
def_bool n def_bool BOARD_GOOGLE_FLAPJACK || \
BOARD_GOOGLE_JACUZZI_COMMON || \
BOARD_GOOGLE_KAKADU || \
BOARD_GOOGLE_KATSU || \
BOARD_GOOGLE_KODAMA || \
BOARD_GOOGLE_KRANE || \
BOARD_GOOGLE_KUKUI
config BOARD_GOOGLE_JACUZZI_COMMON config BOARD_GOOGLE_JACUZZI_COMMON
def_bool n def_bool BOARD_GOOGLE_BURNET || \
select BOARD_GOOGLE_KUKUI_COMMON BOARD_GOOGLE_COZMO || \
BOARD_GOOGLE_DAMU || \
BOARD_GOOGLE_CERISE || \
BOARD_GOOGLE_ESCHE || \
BOARD_GOOGLE_FENNEL || \
BOARD_GOOGLE_JACUZZI || \
BOARD_GOOGLE_JUNIPER || \
BOARD_GOOGLE_KAPPA || \
BOARD_GOOGLE_MAKOMO || \
BOARD_GOOGLE_MUNNA || \
BOARD_GOOGLE_PICO || \
BOARD_GOOGLE_STERN || \
BOARD_GOOGLE_WILLOW
select DRIVER_PARADE_PS8640 if BOARD_GOOGLE_JACUZZI select DRIVER_PARADE_PS8640 if BOARD_GOOGLE_JACUZZI
# All Jacuzzi followers are using ANX7625 except the reference board. # All Jacuzzi followers are using ANX7625 except the reference board.
select DRIVER_ANALOGIX_ANX7625 if !BOARD_GOOGLE_JACUZZI select DRIVER_ANALOGIX_ANX7625 if !BOARD_GOOGLE_JACUZZI
config BOARD_GOOGLE_KUKUI
select BOARD_GOOGLE_KUKUI_COMMON
config BOARD_GOOGLE_KRANE
select BOARD_GOOGLE_KUKUI_COMMON
config BOARD_GOOGLE_KODAMA
select BOARD_GOOGLE_KUKUI_COMMON
config BOARD_GOOGLE_KAKADU
select BOARD_GOOGLE_KUKUI_COMMON
config BOARD_GOOGLE_FLAPJACK
select BOARD_GOOGLE_KUKUI_COMMON
config BOARD_GOOGLE_KATSU
select BOARD_GOOGLE_KUKUI_COMMON
config BOARD_GOOGLE_JACUZZI
select BOARD_GOOGLE_JACUZZI_COMMON
config BOARD_GOOGLE_JUNIPER
select BOARD_GOOGLE_JACUZZI_COMMON
config BOARD_GOOGLE_KAPPA
select BOARD_GOOGLE_JACUZZI_COMMON
config BOARD_GOOGLE_DAMU
select BOARD_GOOGLE_JACUZZI_COMMON
config BOARD_GOOGLE_CERISE
select BOARD_GOOGLE_JACUZZI_COMMON
config BOARD_GOOGLE_STERN
select BOARD_GOOGLE_JACUZZI_COMMON
config BOARD_GOOGLE_WILLOW
select BOARD_GOOGLE_JACUZZI_COMMON
config BOARD_GOOGLE_ESCHE
select BOARD_GOOGLE_JACUZZI_COMMON
config BOARD_GOOGLE_BURNET
select BOARD_GOOGLE_JACUZZI_COMMON
config BOARD_GOOGLE_FENNEL
select BOARD_GOOGLE_JACUZZI_COMMON
config BOARD_GOOGLE_COZMO
select BOARD_GOOGLE_JACUZZI_COMMON
config BOARD_GOOGLE_MAKOMO
select BOARD_GOOGLE_JACUZZI_COMMON
config BOARD_GOOGLE_MUNNA
select BOARD_GOOGLE_JACUZZI_COMMON
config BOARD_GOOGLE_PICO
select BOARD_GOOGLE_JACUZZI_COMMON
if BOARD_GOOGLE_KUKUI_COMMON if BOARD_GOOGLE_KUKUI_COMMON
config VBOOT config VBOOT

View File

@ -1,7 +1,14 @@
## SPDX-License-Identifier: GPL-2.0-only ## SPDX-License-Identifier: GPL-2.0-only
config BOARD_GOOGLE_OAK_COMMON config BOARD_GOOGLE_OAK_COMMON
def_bool n def_bool BOARD_GOOGLE_ELM || \
BOARD_GOOGLE_HANA || \
BOARD_GOOGLE_OAK
if BOARD_GOOGLE_OAK_COMMON
config BOARD_SPECIFIC_OPTIONS
def_bool y
select SOC_MEDIATEK_MT8173 select SOC_MEDIATEK_MT8173
select BOARD_ROMSIZE_KB_4096 select BOARD_ROMSIZE_KB_4096
select COMMON_CBFS_SPI_WRAPPER select COMMON_CBFS_SPI_WRAPPER
@ -16,17 +23,6 @@ config BOARD_GOOGLE_OAK_COMMON
select MAINBOARD_HAS_CHROMEOS select MAINBOARD_HAS_CHROMEOS
select SPI_FLASH select SPI_FLASH
config BOARD_GOOGLE_OAK
select BOARD_GOOGLE_OAK_COMMON
config BOARD_GOOGLE_ELM
select BOARD_GOOGLE_OAK_COMMON
config BOARD_GOOGLE_HANA
select BOARD_GOOGLE_OAK_COMMON
if BOARD_GOOGLE_OAK_COMMON
config VBOOT config VBOOT
select EC_GOOGLE_CHROMEEC_SWITCHES select EC_GOOGLE_CHROMEEC_SWITCHES
select VBOOT_VBNV_FLASH select VBOOT_VBNV_FLASH