mb/google/bluey: Add initial support for Bluey

This commit introduces basic support for the google/bluey mainboard,
based on the Qualcomm X1P-42-100 SoC.

Changes:

- Add placeholder mainboard callbacks to enable control flow from /lib
  and Qualcomm SoC code.
- Populate the bluey mainboard directory with a copy of the herobrine
  codebase, removing SoC/mainboard-specific implementations.

This provides a minimal working build for google/bluey, allowing
upstream builders to compile the mainboard. This facilitates easier
verification of subsequent changes.

BUG=b:404985109
TEST=Successfully built google/bluey with Qualcomm X1P-42-100 SoC.

Change-Id: Id0da1846b8aef6f4ef4345be9cd803aa60406cdf
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/86973
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Subrata Banik 2025-03-21 18:39:04 +05:30
commit 7da36ad79a
13 changed files with 246 additions and 0 deletions

View file

@ -0,0 +1,61 @@
## SPDX-License-Identifier: GPL-2.0-only
config BOARD_GOOGLE_BLUEY_COMMON
def_bool n
select BOARD_ROMSIZE_KB_8192
select COMMON_CBFS_SPI_WRAPPER
select EC_GOOGLE_CHROMEEC
select EC_GOOGLE_CHROMEEC_RTC
select EC_GOOGLE_CHROMEEC_SPI
select I2C_TPM
select MAINBOARD_HAS_CHROMEOS
select MAINBOARD_HAS_TPM2
select RTC
select SOC_QUALCOMM_X1P42100
select SPI_FLASH
select SPI_FLASH_EXIT_4_BYTE_ADDR_MODE
select SPI_FLASH_GIGADEVICE
select SPI_FLASH_MACRONIX
select SPI_FLASH_WINBOND
select TPM_GOOGLE_TI50
config BOARD_GOOGLE_BASEBOARD_BLUEY
def_bool n
select BOARD_GOOGLE_BLUEY_COMMON
config BOARD_GOOGLE_BLUEY
select BOARD_GOOGLE_BASEBOARD_BLUEY
if BOARD_GOOGLE_BLUEY_COMMON
config MAINBOARD_DIR
default "google/bluey"
config MAINBOARD_VENDOR
string
default "Google"
config VBOOT
select EC_GOOGLE_CHROMEEC_SWITCHES
select VBOOT_VBNV_FLASH
##########################################################
#### Update below when adding a new derivative board. ####
##########################################################
config MAINBOARD_PART_NUMBER
default "Bluey" if BOARD_GOOGLE_BLUEY
config DRIVER_TPM_I2C_BUS
depends on I2C_TPM
hex
default 0x00 # TODO
config DRIVER_TPM_I2C_ADDR
default 0x50
config EC_GOOGLE_CHROMEEC_SPI_BUS
hex
default 0x0 # TODO
endif # BOARD_GOOGLE_BLUEY_COMMON

View file

@ -0,0 +1,6 @@
## SPDX-License-Identifier: GPL-2.0-only
comment "Bluey"
config BOARD_GOOGLE_BLUEY
bool "-> Bluey"

View file

@ -0,0 +1,11 @@
## SPDX-License-Identifier: GPL-2.0-only
all-y += boardid.c
all-y += chromeos.c
all-y += reset.c
bootblock-y += bootblock.c
romstage-y += romstage.c
ramstage-y += mainboard.c

View file

@ -0,0 +1,14 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef MAINBOARD_GOOGLE_BLUEY_BOARD_H
#define MAINBOARD_GOOGLE_BLUEY_BOARD_H
#include <assert.h>
#include <gpio.h>
#define GPIO_AP_EC_INT GPIO(0)
#define GPIO_GSC_AP_INT GPIO(0)
void setup_chromeos_gpios(void);
#endif /* MAINBOARD_GOOGLE_BLUEY_BOARD_H */

View file

@ -0,0 +1,6 @@
Vendor name: Google
Board name: Bluey Qualcomm X1P-42-100 reference board
Category: eval
ROM protocol: SPI
ROM socketed: n
Flashrom support: y

View file

@ -0,0 +1,17 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <boardid.h>
uint32_t board_id(void)
{
static uint32_t id = UNDEFINED_STRAPPING_ID;
/* Placeholder */
return id;
}
uint32_t sku_id(void)
{
static uint32_t id = UNDEFINED_STRAPPING_ID;
/* Placeholder */
return id;
}

View file

@ -0,0 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <bootblock_common.h>
void bootblock_mainboard_init(void)
{
/* Placeholder */
}

View file

@ -0,0 +1,31 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <boot/coreboot_tables.h>
#include <bootmode.h>
#include "board.h"
#include <drivers/tpm/cr50.h>
void setup_chromeos_gpios(void)
{
gpio_input_pullup(GPIO_AP_EC_INT);
gpio_input_irq(GPIO_GSC_AP_INT, IRQ_TYPE_RISING_EDGE, GPIO_PULL_UP);
}
void fill_lb_gpios(struct lb_gpios *gpios)
{
/* TODO: Add required GPIO after referring to the schematics */
const struct lb_gpio chromeos_gpios[] = {
{GPIO_AP_EC_INT.addr, ACTIVE_LOW, gpio_get(GPIO_AP_EC_INT),
"EC interrupt"},
{GPIO_GSC_AP_INT.addr, ACTIVE_HIGH, gpio_get(GPIO_GSC_AP_INT),
"TPM interrupt"},
};
lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
}
int cr50_plat_irq_status(void)
{
return gpio_irq_status(GPIO_GSC_AP_INT);
}

View file

@ -0,0 +1,42 @@
## SPDX-License-Identifier: GPL-2.0-only
FLASH@0x0 CONFIG_ROM_SIZE {
WP_RO 4M {
RO_SECTION 0x3c4000 {
BOOTBLOCK 96K
COREBOOT(CBFS)
FMAP@0x3c0000 0x1000
GBB 0x2f00
RO_FRID 0x100
}
RO_GSCVD 8K
RO_VPD(PRESERVE)
}
RW_MISC 128K {
UNIFIED_MRC_CACHE(PRESERVE) 64K {
RECOVERY_MRC_CACHE 32K
RW_MRC_CACHE 32K
}
RW_ELOG(PRESERVE) 4K
RW_SHARED 4K {
SHARED_DATA
}
RW_VPD(PRESERVE) 32K
RW_NVRAM(PRESERVE) 16K
}
RW_SECTION_A 1536K {
VBLOCK_A 8K
FW_MAIN_A(CBFS)
RW_FWID_A 256
}
RW_SECTION_B 1536K {
VBLOCK_B 8K
FW_MAIN_B(CBFS)
RW_FWID_B 256
}
RW_LEGACY(CBFS)
}

View file

@ -0,0 +1,7 @@
## SPDX-License-Identifier: GPL-2.0-only
chip soc/qualcomm/x1p42100
device cpu_cluster 0 on end
device domain 0 on
end
end

View file

@ -0,0 +1,24 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <device/device.h>
#include <soc/pcie.h>
bool mainboard_needs_pcie_init(void)
{
/* Placeholder */
return false;
}
static void mainboard_init(struct device *dev)
{
/* Placeholder */
}
static void mainboard_enable(struct device *dev)
{
dev->ops->init = &mainboard_init;
}
struct chip_operations mainboard_ops = {
.enable_dev = mainboard_enable,
};

View file

@ -0,0 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <ec/google/chromeec/ec.h>
#include <reset.h>
/* Can't do a "real" reset before the PMIC is initialized in QcLib (romstage),
but this works well enough for our purposes. */
void do_board_reset(void)
{
google_chromeec_reboot(EC_REBOOT_COLD, 0);
}

View file

@ -0,0 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <arch/stages.h>
void platform_romstage_main(void)
{
/* Placeholder */
}