From 55de4d9ab4deeccd39f8c970e6b32a1e19bff28b Mon Sep 17 00:00:00 2001 From: Sean Rhodes Date: Fri, 14 Apr 2023 21:32:18 +0100 Subject: [PATCH] mb/starlabs/starfighter: Add Raptor Lake StarFighter Mk I variant Tested using `edk2` from `github.com/starlabsltd/edk2/tree/uefipayload_vs`: * Windows 11 * Ubuntu 24.04 No known issues. https://starlabs.systems/pages/starfighter-specification Signed-off-by: Sean Rhodes Change-Id: I046e70845a5201d6f6ab062aee91fa8be9728737 Reviewed-on: https://review.coreboot.org/c/coreboot/+/74445 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier --- Documentation/mainboard/index.md | 1 + .../mainboard/starlabs/starfighter_rpl.md | 91 ++++ src/mainboard/starlabs/starfighter/Kconfig | 131 +++++ .../starlabs/starfighter/Kconfig.name | 6 + .../starlabs/starfighter/Makefile.mk | 12 + .../starlabs/starfighter/acpi/ec.asl | 1 + .../starlabs/starfighter/acpi/mainboard.asl | 5 + .../starlabs/starfighter/acpi/sleep.asl | 11 + .../starlabs/starfighter/acpi/superio.asl | 1 + .../starlabs/starfighter/board_info.txt | 6 + .../starlabs/starfighter/bootblock.c | 14 + .../starlabs/starfighter/cmos.default | 25 + .../starlabs/starfighter/cmos.layout | 107 +++++ src/mainboard/starlabs/starfighter/dsdt.asl | 46 ++ src/mainboard/starlabs/starfighter/hda_verb.c | 26 + .../starlabs/starfighter/include/variants.h | 26 + .../starlabs/starfighter/mainboard.c | 27 ++ src/mainboard/starlabs/starfighter/smbios.c | 39 ++ .../starlabs/starfighter/spd/16gb.spd.hex | 32 ++ .../starlabs/starfighter/spd/32gb.spd.hex | 32 ++ .../starlabs/starfighter/spd/64gb.spd.hex | 32 ++ .../starlabs/starfighter/spd/Makefile.mk | 5 + .../starfighter/variants/rpl/Makefile.mk | 9 + .../starfighter/variants/rpl/board.fmd | 14 + .../starfighter/variants/rpl/data.vbt | Bin 0 -> 9216 bytes .../starfighter/variants/rpl/devicetree.cb | 270 +++++++++++ .../starfighter/variants/rpl/devtree.c | 67 +++ .../starlabs/starfighter/variants/rpl/gpio.c | 454 ++++++++++++++++++ .../starfighter/variants/rpl/hda_verb.c | 184 +++++++ .../starfighter/variants/rpl/ramstage.c | 11 + .../starfighter/variants/rpl/romstage.c | 144 ++++++ src/mainboard/starlabs/starfighter/vboot.c | 8 + 32 files changed, 1837 insertions(+) create mode 100644 Documentation/mainboard/starlabs/starfighter_rpl.md create mode 100644 src/mainboard/starlabs/starfighter/Kconfig create mode 100644 src/mainboard/starlabs/starfighter/Kconfig.name create mode 100644 src/mainboard/starlabs/starfighter/Makefile.mk create mode 100644 src/mainboard/starlabs/starfighter/acpi/ec.asl create mode 100644 src/mainboard/starlabs/starfighter/acpi/mainboard.asl create mode 100644 src/mainboard/starlabs/starfighter/acpi/sleep.asl create mode 100644 src/mainboard/starlabs/starfighter/acpi/superio.asl create mode 100644 src/mainboard/starlabs/starfighter/board_info.txt create mode 100644 src/mainboard/starlabs/starfighter/bootblock.c create mode 100644 src/mainboard/starlabs/starfighter/cmos.default create mode 100644 src/mainboard/starlabs/starfighter/cmos.layout create mode 100644 src/mainboard/starlabs/starfighter/dsdt.asl create mode 100644 src/mainboard/starlabs/starfighter/hda_verb.c create mode 100644 src/mainboard/starlabs/starfighter/include/variants.h create mode 100644 src/mainboard/starlabs/starfighter/mainboard.c create mode 100644 src/mainboard/starlabs/starfighter/smbios.c create mode 100644 src/mainboard/starlabs/starfighter/spd/16gb.spd.hex create mode 100644 src/mainboard/starlabs/starfighter/spd/32gb.spd.hex create mode 100644 src/mainboard/starlabs/starfighter/spd/64gb.spd.hex create mode 100644 src/mainboard/starlabs/starfighter/spd/Makefile.mk create mode 100644 src/mainboard/starlabs/starfighter/variants/rpl/Makefile.mk create mode 100644 src/mainboard/starlabs/starfighter/variants/rpl/board.fmd create mode 100644 src/mainboard/starlabs/starfighter/variants/rpl/data.vbt create mode 100644 src/mainboard/starlabs/starfighter/variants/rpl/devicetree.cb create mode 100644 src/mainboard/starlabs/starfighter/variants/rpl/devtree.c create mode 100644 src/mainboard/starlabs/starfighter/variants/rpl/gpio.c create mode 100644 src/mainboard/starlabs/starfighter/variants/rpl/hda_verb.c create mode 100644 src/mainboard/starlabs/starfighter/variants/rpl/ramstage.c create mode 100644 src/mainboard/starlabs/starfighter/variants/rpl/romstage.c create mode 100644 src/mainboard/starlabs/starfighter/vboot.c diff --git a/Documentation/mainboard/index.md b/Documentation/mainboard/index.md index 2f5dd71861..259a2b2e4b 100644 --- a/Documentation/mainboard/index.md +++ b/Documentation/mainboard/index.md @@ -334,6 +334,7 @@ StarLite Mk V StarBook Mk V StarBook Mk VI Byte Mk II +StarFighter Mk I Flashing devices ``` diff --git a/Documentation/mainboard/starlabs/starfighter_rpl.md b/Documentation/mainboard/starlabs/starfighter_rpl.md new file mode 100644 index 0000000000..d386fb3d51 --- /dev/null +++ b/Documentation/mainboard/starlabs/starfighter_rpl.md @@ -0,0 +1,91 @@ +# StarFighter Mk I + +## Specs + +- CPU (full processor specs available at https://ark.intel.com) + - Intel i3-1315U (Raptor Lake) + - Intel i7-13700H (Raptor Lake) + - Intel i9-13900H (Raptor Lake) +- EC + - ITE IT5570E + - Backlit keyboard, with standard PS/2 keycodes and SCI hotkeys + - Battery + - USB-C PD Charger + - Suspend / resume +- GPU + - IntelĀ® IrisĀ® Xe Graphics + - GOP driver is recommended, VBT is provided + - eDP 16-inch 3840x2400 or 2560x1600 LCD + - HDMI video + - USB-C DisplayPort video +- Memory + - 16, 32 or 64GB LPDDR5 on-board memory +- Networking + - AX210 2230 WiFi / Bluetooth +- Sound + - Realtek ALC256 + - Internal speakers + - Removable microphone + - Combined headphone / microphone 3.5-mm jack + - HDMI audio + - USB-C DisplayPort audio +- Storage + - 2 xM.2 PCIe SSD + - RTS5129 MicroSD card reader +- USB + - 1920x1080 removable CCD camera + - 2 x Thunderbolt 4.0 (left) (Raptor Lake) + - USB 3.1 Gen 2 Type-A (left) + - USB 3.1 Gen 2 Type-A (right) + - USB 3.1 Gen 1 Type-A (right) + +## Building coreboot + +Please follow the [Star Labs build instructions](common/building.md) to build coreboot, using `config.starlabs_starfighter_rpl` as config file. + +### Preliminaries + +Prior to building coreboot the following files are required: +* Intel Flash Descriptor file (descriptor.bin) +* Intel Management Engine firmware (me.bin) +* ITE Embedded Controller firmware (ec.bin) + +The files listed below are optional: +- Splash screen image in Windows 3.1 BMP format (Logo.bmp) + +These files exist in the correct location in the StarLabsLtd/blobs repo on GitHub which is used in place of the standard 3rdparty/blobs repo. + +### Build + +The following commands will build a working image: + + +```bash +make distclean +make defconfig KBUILD_DEFCONFIG=configs/config.starlabs_starfighter_rpl +make +``` + +## Flashing coreboot + +```{eval-rst} ++---------------------+------------+ +| Type | Value | ++=====================+============+ +| Socketed flash | no | ++---------------------+------------+ +| Vendor | Winbond | ++---------------------+------------+ +| Model | W25Q256.V | ++---------------------+------------+ +| Size | 32 MiB | ++---------------------+------------+ +| Package | SOIC-8 | ++---------------------+------------+ +| Internal flashing | yes | ++---------------------+------------+ +| External flashing | yes | ++---------------------+------------+ +``` + +Please see [here](common/flashing.md) for instructions on how to flash with fwupd. diff --git a/src/mainboard/starlabs/starfighter/Kconfig b/src/mainboard/starlabs/starfighter/Kconfig new file mode 100644 index 0000000000..b3ee347036 --- /dev/null +++ b/src/mainboard/starlabs/starfighter/Kconfig @@ -0,0 +1,131 @@ +## SPDX-License-Identifier: GPL-2.0-only + +config BOARD_STARLABS_STARFIGHTER_SERIES + def_bool n + select BOARD_ROMSIZE_KB_32768 + select DRIVERS_INTEL_PMC + select DRIVERS_INTEL_USB4_RETIMER + select DRIVERS_I2C_HID + select EC_STARLABS_FAN + select EC_STARLABS_ITE + select EC_STARLABS_KBL_LEVELS + select EC_STARLABS_MAX_CHARGE + select EC_STARLABS_MERLIN + select EC_STARLABS_NEED_ITE_BIN + select HAVE_ACPI_RESUME + select HAVE_ACPI_TABLES + select HAVE_CMOS_DEFAULT + select HAVE_OPTION_TABLE + select HAVE_SPD_IN_CBFS + select INTEL_GMA_HAVE_VBT + select INTEL_LPSS_UART_FOR_CONSOLE + select MAINBOARD_HAS_TPM2 + select MEMORY_MAPPED_TPM + select NO_UART_ON_SUPERIO + select SOC_INTEL_ALDERLAKE + select SOC_INTEL_ALDERLAKE_PCH_P + select SOC_INTEL_COMMON_BLOCK_HDA_VERB + select SOC_INTEL_COMMON_BLOCK_TCSS + select SOC_INTEL_CRASHLOG + select SOC_INTEL_ENABLE_USB4_PCIE_RESOURCES + select SOC_INTEL_RAPTORLAKE + select SPI_FLASH_WINBOND + select SYSTEM_TYPE_LAPTOP + select TPM_MEASURED_BOOT + select VALIDATE_INTEL_DESCRIPTOR + +config BOARD_STARLABS_STARFIGHTER_RPL + select BOARD_STARLABS_STARFIGHTER_SERIES + +if BOARD_STARLABS_STARFIGHTER_SERIES + +config CCD_PORT + int + default 3 # TODO + +config CONSOLE_SERIAL + default n if !EDK2_DEBUG + +config D3COLD_SUPPORT + default n + +config DEVICETREE + default "variants/\$(CONFIG_VARIANT_DIR)/devicetree.cb" + +config DIMM_SPD_SIZE + default 512 + +config DRIVER_TPM_SPI_CHIP + default 2 + +config EC_GPE_SCI + default 0x6e + +config EC_STARLABS_ADD_ITE_BIN + default n + +config EC_STARLABS_BATTERY_MODEL + default "AEC617573-4S1P" + +config EC_STARLABS_BATTERY_TYPE + default "LION" + +config EC_STARLABS_BATTERY_OEM + default "Apower Electronics" + +config EC_STARLABS_ITE_BIN_PATH + string + depends on EC_STARLABS_NEED_ITE_BIN + default "3rdparty/blobs/mainboard/\$(MAINBOARDDIR)/\$(CONFIG_VARIANT_DIR)/ec.bin" + +config EC_VARIANT_DIR + default "merlin" + +config EDK2_BOOTSPLASH_FILE + string + default "3rdparty/blobs/mainboard/starlabs/Logo.bmp" + +config FMDFILE + default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/variants/\$(CONFIG_VARIANT_DIR)/vboot.fmd" if VBOOT + default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/variants/\$(CONFIG_VARIANT_DIR)/board.fmd" + +config IFD_BIN_PATH + string + default "3rdparty/blobs/mainboard/\$(MAINBOARDDIR)/\$(CONFIG_VARIANT_DIR)/flashdescriptor.bin" + +config MAINBOARD_DIR + default "starlabs/starfighter" + +config MAINBOARD_FAMILY + string + default "F1" + +config MAINBOARD_PART_NUMBER + default "StarFighter Mk I" + +config MAINBOARD_SMBIOS_PRODUCT_NAME + default "StarFighter" + +config ME_BIN_PATH + # string + default "3rdparty/blobs/mainboard/\$(MAINBOARDDIR)/\$(CONFIG_VARIANT_DIR)/intel_me.bin" + +config POWER_STATE_DEFAULT_ON_AFTER_FAILURE + default n + +config SOC_INTEL_CSE_SEND_EOP_EARLY + default n + +config UART_FOR_CONSOLE + default 0 + +config USE_PM_ACPI_TIMER + default n + +config VBOOT + select VBOOT_VBNV_FLASH + +config VARIANT_DIR + default "rpl" + +endif diff --git a/src/mainboard/starlabs/starfighter/Kconfig.name b/src/mainboard/starlabs/starfighter/Kconfig.name new file mode 100644 index 0000000000..0106256552 --- /dev/null +++ b/src/mainboard/starlabs/starfighter/Kconfig.name @@ -0,0 +1,6 @@ +## SPDX-License-Identifier: GPL-2.0-only + +comment "Star Labs StarFighter Series" + +config BOARD_STARLABS_STARFIGHTER_RPL + bool "Star Labs StarFighter Mk I (i3-1315U, i7-13700H and i9-13900H)" diff --git a/src/mainboard/starlabs/starfighter/Makefile.mk b/src/mainboard/starlabs/starfighter/Makefile.mk new file mode 100644 index 0000000000..dc26be0afa --- /dev/null +++ b/src/mainboard/starlabs/starfighter/Makefile.mk @@ -0,0 +1,12 @@ +## SPDX-License-Identifier: GPL-2.0-only + +CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include +subdirs-$(CONFIG_HAVE_SPD_IN_CBFS) += ./spd +subdirs-y += variants/$(VARIANT_DIR) + +bootblock-y += bootblock.c + +ramstage-y += hda_verb.c +ramstage-y += mainboard.c +ramstage-y += smbios.c +ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += variants/$(VARIANT_DIR)/gma-mainboard.ads diff --git a/src/mainboard/starlabs/starfighter/acpi/ec.asl b/src/mainboard/starlabs/starfighter/acpi/ec.asl new file mode 100644 index 0000000000..853b0877b3 --- /dev/null +++ b/src/mainboard/starlabs/starfighter/acpi/ec.asl @@ -0,0 +1 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ diff --git a/src/mainboard/starlabs/starfighter/acpi/mainboard.asl b/src/mainboard/starlabs/starfighter/acpi/mainboard.asl new file mode 100644 index 0000000000..34b90af325 --- /dev/null +++ b/src/mainboard/starlabs/starfighter/acpi/mainboard.asl @@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +Scope (\_SB) { + #include "sleep.asl" +} diff --git a/src/mainboard/starlabs/starfighter/acpi/sleep.asl b/src/mainboard/starlabs/starfighter/acpi/sleep.asl new file mode 100644 index 0000000000..7ed74e3514 --- /dev/null +++ b/src/mainboard/starlabs/starfighter/acpi/sleep.asl @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +Method (MPTS, 1, NotSerialized) +{ + RPTS (Arg0) +} + +Method (MWAK, 1, NotSerialized) +{ + RWAK (Arg0) +} diff --git a/src/mainboard/starlabs/starfighter/acpi/superio.asl b/src/mainboard/starlabs/starfighter/acpi/superio.asl new file mode 100644 index 0000000000..853b0877b3 --- /dev/null +++ b/src/mainboard/starlabs/starfighter/acpi/superio.asl @@ -0,0 +1 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ diff --git a/src/mainboard/starlabs/starfighter/board_info.txt b/src/mainboard/starlabs/starfighter/board_info.txt new file mode 100644 index 0000000000..2218f4e3d5 --- /dev/null +++ b/src/mainboard/starlabs/starfighter/board_info.txt @@ -0,0 +1,6 @@ +Vendor name: Star Labs +Board name: StarFighter +Category: laptop +ROM protocol: SPI +ROM socketed: n +Flashrom support: y diff --git a/src/mainboard/starlabs/starfighter/bootblock.c b/src/mainboard/starlabs/starfighter/bootblock.c new file mode 100644 index 0000000000..ca48bb1ab2 --- /dev/null +++ b/src/mainboard/starlabs/starfighter/bootblock.c @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include + +void bootblock_mainboard_init(void) +{ + const struct pad_config *pads; + size_t num; + + pads = variant_early_gpio_table(&num); + gpio_configure_pads(pads, num); +} diff --git a/src/mainboard/starlabs/starfighter/cmos.default b/src/mainboard/starlabs/starfighter/cmos.default new file mode 100644 index 0000000000..88cd1789fb --- /dev/null +++ b/src/mainboard/starlabs/starfighter/cmos.default @@ -0,0 +1,25 @@ +## SPDX-License-Identifier: GPL-2.0-only +# hardcoded +boot_option=Fallback +# console +debug_level=Debug +# cpu +hyper_threading=Enable +vtd=Enable +power_profile=Balanced +me_state=Disable +# Devices +wireless=Enable +webcam=Enable +microphone=Enable +pci_hot_plug=Disable +# EC +kbl_timeout=30 seconds +fn_ctrl_swap=Disable +# southbridge +power_on_after_fail=Disable +# Functions +fn_lock_state=0x1 +trackpad_state=0x1 +kbl_brightness=0x0 +kbl_state=0x1 diff --git a/src/mainboard/starlabs/starfighter/cmos.layout b/src/mainboard/starlabs/starfighter/cmos.layout new file mode 100644 index 0000000000..cdda7da26c --- /dev/null +++ b/src/mainboard/starlabs/starfighter/cmos.layout @@ -0,0 +1,107 @@ +# SPDX-License-Identifier: GPL-2.0-only + +# ----------------------------------------------------------------- +entries + +# Bank: 1 +# ----------------------------------------------------------------- +0 120 r 0 reserved_memory + +# ----------------------------------------------------------------- +# coreboot config options: ramtop +304 80 h 0 ramtop + +# RTC_BOOT_BYTE (coreboot hardcoded) +384 1 e 2 boot_option +388 4 h 0 reboot_counter + +# ----------------------------------------------------------------- +# coreboot config options: console +395 4 e 3 debug_level +# coreboot config options: cpu +#400 8 r 0 reserved for century byte +408 1 e 1 hyper_threading +416 1 e 1 vtd +424 2 e 7 power_profile +432 1 e 5 me_state +440 4 h 0 me_state_counter + +# coreboot config options: Devices +504 1 e 1 wireless +512 1 e 1 webcam +520 1 e 1 microphone + +# coreboot config options: EC +600 3 e 4 kbl_timeout +608 1 e 1 fn_ctrl_swap +616 2 e 8 max_charge +624 2 e 9 fan_mode + +# coreboot config options: southbridge +800 2 e 6 power_on_after_fail + +# coreboot config options: check sums +984 16 h 0 check_sum + +# Bank: 2 +# embedded controller settings (outside the checksummed area) +1024 8 h 1 fn_lock_state +1032 8 h 1 trackpad_state +1040 8 h 10 kbl_brightness +1048 8 h 1 kbl_state + +# ----------------------------------------------------------------- + +enumerations + +#ID value text +1 0 Disable +1 1 Enable + +2 0 Fallback +2 1 Normal + +3 0 Emergency +3 1 Alert +3 2 Critical +3 3 Error +3 4 Warning +3 5 Notice +3 6 Info +3 7 Debug +3 8 Spew + +4 0 30 seconds +4 1 1 minute +4 2 3 minutes +4 3 5 minutes +4 4 Never + +5 0 Enable +5 1 Disable + +6 0 Disable +6 1 Enable +6 2 Keep + +7 0 Power Saver +7 1 Balanced +7 2 Performance + +8 0 100% +8 1 80% +8 2 60% + +9 0 Normal +9 1 Aggressive +9 2 Quiet + +10 0 Off +10 1 Low +10 2 High +10 3 On + +# ----------------------------------------------------------------- +checksums + +checksum 392 983 984 diff --git a/src/mainboard/starlabs/starfighter/dsdt.asl b/src/mainboard/starlabs/starfighter/dsdt.asl new file mode 100644 index 0000000000..3a12299374 --- /dev/null +++ b/src/mainboard/starlabs/starfighter/dsdt.asl @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +DefinitionBlock( + "dsdt.aml", + "DSDT", + ACPI_DSDT_REV_2, + OEM_ID, + ACPI_TABLE_CREATOR, + 0x20220930 +) +{ + #include + #include + #include + #include + + Device (\_SB.PCI0) + { + #include + #include + #include + #include + + #include + + /* PS/2 Keyboard */ + #include + } + + #include + + /* Star Labs EC */ + #include + + Scope (\_SB) + { + /* HID Driver */ + #include + + /* Suspend Methods */ + #include + } + + #include "acpi/mainboard.asl" +} diff --git a/src/mainboard/starlabs/starfighter/hda_verb.c b/src/mainboard/starlabs/starfighter/hda_verb.c new file mode 100644 index 0000000000..0aec559a03 --- /dev/null +++ b/src/mainboard/starlabs/starfighter/hda_verb.c @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include + +#define AZALIA_CODEC_ALC256 0x10ec0256 + +static const u32 override_verb[] = { + AZALIA_PIN_CFG(0, 0x12, 0x411111f0), +}; + +static void disable_microphone(u8 *base) +{ + azalia_program_verb_table(base, override_verb, ARRAY_SIZE(override_verb)); +} + +void mainboard_azalia_program_runtime_verbs(u8 *base, u32 viddid) +{ + if (viddid == AZALIA_CODEC_ALC256) { + printk(BIOS_DEBUG, "CMOS: viddid = %08x\n", viddid); + if (get_uint_option("microphone", 1) == 0) + disable_microphone(base); + } +} diff --git a/src/mainboard/starlabs/starfighter/include/variants.h b/src/mainboard/starlabs/starfighter/include/variants.h new file mode 100644 index 0000000000..0dd41c062c --- /dev/null +++ b/src/mainboard/starlabs/starfighter/include/variants.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef _BASEBOARD_VARIANTS_H_ +#define _BASEBOARD_VARIANTS_H_ + +#include + +enum cmos_power_profile { + PP_POWER_SAVER = 0, + PP_BALANCED = 1, + PP_PERFORMANCE = 2, +}; +#define NUM_POWER_PROFILES 3 + +enum cmos_power_profile get_power_profile(enum cmos_power_profile fallback); + +/* + * The next set of functions return the gpio table and fill in the number of + * entries for each table. + */ +const struct pad_config *variant_gpio_table(size_t *num); +const struct pad_config *variant_early_gpio_table(size_t *num); + +void devtree_update(void); + +#endif /* _BASEBOARD_VARIANTS_H_ */ diff --git a/src/mainboard/starlabs/starfighter/mainboard.c b/src/mainboard/starlabs/starfighter/mainboard.c new file mode 100644 index 0000000000..d394f2579d --- /dev/null +++ b/src/mainboard/starlabs/starfighter/mainboard.c @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include + +enum cmos_power_profile get_power_profile(enum cmos_power_profile fallback) +{ + const unsigned int power_profile = get_uint_option("power_profile", fallback); + return power_profile < NUM_POWER_PROFILES ? power_profile : fallback; +} + +static void init_mainboard(void *chip_info) +{ + const struct pad_config *pads; + size_t num; + + pads = variant_gpio_table(&num); + gpio_configure_pads(pads, num); + + devtree_update(); +} + +struct chip_operations mainboard_ops = { + .init = init_mainboard, +}; diff --git a/src/mainboard/starlabs/starfighter/smbios.c b/src/mainboard/starlabs/starfighter/smbios.c new file mode 100644 index 0000000000..ab2c211a99 --- /dev/null +++ b/src/mainboard/starlabs/starfighter/smbios.c @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/* Get the Embedded Controller firmware version */ +void smbios_ec_revision(uint8_t *ec_major_revision, uint8_t *ec_minor_revision) +{ + u16 ec_version = ec_get_version(); + + *ec_major_revision = ec_version >> 8; + *ec_minor_revision = ec_version & 0xff; +} + +const char *smbios_system_sku(void) +{ + return CONFIG_MAINBOARD_FAMILY; +} + +u8 smbios_mainboard_feature_flags(void) +{ + return SMBIOS_FEATURE_FLAGS_HOSTING_BOARD | SMBIOS_FEATURE_FLAGS_REPLACEABLE; +} + +const char *smbios_chassis_version(void) +{ + return smbios_mainboard_version(); +} + +const char *smbios_chassis_serial_number(void) +{ + return smbios_mainboard_serial_number(); +} diff --git a/src/mainboard/starlabs/starfighter/spd/16gb.spd.hex b/src/mainboard/starlabs/starfighter/spd/16gb.spd.hex new file mode 100644 index 0000000000..642023b380 --- /dev/null +++ b/src/mainboard/starlabs/starfighter/spd/16gb.spd.hex @@ -0,0 +1,32 @@ +23 10 13 0E 15 1A B5 08 00 40 00 00 0A 01 00 00 +48 00 0A FF 92 55 05 00 AA 00 90 A8 90 90 06 C0 +03 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 16 36 16 36 +16 36 16 36 00 00 16 36 16 36 16 36 16 36 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 9C 00 00 00 00 00 7F 00 69 9A +11 01 40 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 D8 53 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +80 2C 25 20 02 F0 E6 A8 9B 38 41 54 46 31 47 36 +34 41 5A 2D 33 47 32 45 31 20 20 20 20 31 80 2C +45 48 4D 30 30 30 30 33 37 30 33 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/src/mainboard/starlabs/starfighter/spd/32gb.spd.hex b/src/mainboard/starlabs/starfighter/spd/32gb.spd.hex new file mode 100644 index 0000000000..00bc34ba02 --- /dev/null +++ b/src/mainboard/starlabs/starfighter/spd/32gb.spd.hex @@ -0,0 +1,32 @@ +23 10 13 0E 16 22 B5 08 00 40 00 00 0A 01 00 00 +48 00 0A FF 92 55 05 00 AA 00 90 A8 90 C0 08 60 +04 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 16 36 16 36 +16 36 16 36 00 00 16 36 16 36 16 36 16 36 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 9C 00 00 00 00 00 7F 00 69 9A +11 01 40 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 D8 53 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +80 2C 25 20 02 F0 E6 A8 9B 38 41 54 46 31 47 36 +34 41 5A 2D 33 47 32 45 31 20 20 20 20 31 80 2C +45 48 4D 30 30 30 30 33 37 30 33 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/src/mainboard/starlabs/starfighter/spd/64gb.spd.hex b/src/mainboard/starlabs/starfighter/spd/64gb.spd.hex new file mode 100644 index 0000000000..0d17713a1e --- /dev/null +++ b/src/mainboard/starlabs/starfighter/spd/64gb.spd.hex @@ -0,0 +1,32 @@ +23 10 15 0E 16 2A F9 08 00 40 00 00 09 01 00 00 +48 00 08 FF 92 55 05 00 AA 00 90 A8 90 C0 08 60 +04 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 16 36 16 36 +16 36 16 36 00 00 16 36 16 36 16 36 16 36 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 9C 00 00 00 00 00 7F 43 69 9A +11 01 40 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 D8 53 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +80 2C 25 20 02 F0 E6 A8 9B 38 41 54 46 31 47 36 +34 41 5A 2D 33 47 32 45 31 20 20 20 20 31 80 2C +45 48 4D 30 30 30 30 33 37 30 33 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/src/mainboard/starlabs/starfighter/spd/Makefile.mk b/src/mainboard/starlabs/starfighter/spd/Makefile.mk new file mode 100644 index 0000000000..2f4598ee8e --- /dev/null +++ b/src/mainboard/starlabs/starfighter/spd/Makefile.mk @@ -0,0 +1,5 @@ +## SPDX-License-Identifier: GPL-2.0-only + +SPD_SOURCES = 16gb # 13 +SPD_SOURCES += 32gb # 0 +SPD_SOURCES += 64gb # 8 diff --git a/src/mainboard/starlabs/starfighter/variants/rpl/Makefile.mk b/src/mainboard/starlabs/starfighter/variants/rpl/Makefile.mk new file mode 100644 index 0000000000..2a505c35c7 --- /dev/null +++ b/src/mainboard/starlabs/starfighter/variants/rpl/Makefile.mk @@ -0,0 +1,9 @@ +## SPDX-License-Identifier: GPL-2.0-only + +bootblock-y += gpio.c + +romstage-y += romstage.c + +ramstage-y += devtree.c +ramstage-y += gpio.c +ramstage-y += hda_verb.c diff --git a/src/mainboard/starlabs/starfighter/variants/rpl/board.fmd b/src/mainboard/starlabs/starfighter/variants/rpl/board.fmd new file mode 100644 index 0000000000..7f89c336ca --- /dev/null +++ b/src/mainboard/starlabs/starfighter/variants/rpl/board.fmd @@ -0,0 +1,14 @@ +FLASH 0x2000000 { + SI_ALL 0x1000000 { + SI_DESC 0x1000 + SI_ME 0x508000 + } + SI_BIOS 0x1000000 { + EC@0x0 0x20000 + RW_MRC_CACHE@0x20000 0x10000 + SMMSTORE@0x30000 0x40000 + CONSOLE@0x70000 0x20000 + FMAP@0x90000 0x1000 + COREBOOT(CBFS) + } +} diff --git a/src/mainboard/starlabs/starfighter/variants/rpl/data.vbt b/src/mainboard/starlabs/starfighter/variants/rpl/data.vbt new file mode 100644 index 0000000000000000000000000000000000000000..b788ede142beaa8e642d4adea8cb6f014477da36 GIT binary patch literal 9216 zcmeHMUrbw782`?_Z7H=#C%ARE;TbHf;DAfnkP#AY`RBUvrv*m3%!H1$Dv=FjOqns+ zHS$0-CO0v0Y%#H#m>7JJ7oY7TW-nwWiw~Oc=Cb%=vbSy4-#NFmmJO-S>6rbR@7~k% zedl++?|05U_uPB;k9LmmKwo#yP+#D9Pko3(Vx*B;^*)aGOJ{I!c&s}x5*X|38|*sH z@6b-VzVEkNL@~y8yPGtvDR^!+KIt2(<^5CR6O-}A?)drFXQ!rls4K_=XU@bY<1?pc z<1s!w`ci-kyb@REg^9@+AGmOKJU-LL0iwa1HyvtdKE%2I#YU~U(XTZfhNZ2krS0&M z5?6Om*I<7r*cTWH4i50aA>JJv4h#?X^mq21d_hC9VvacTLSqH}JsZBp(t!=lM|le0=83c&wqsC4iFTv@s&)qS7RxAmm;r zdB{ly)CSd|94hJ*D1#D%!b-3btOP5;3IkLelnI-bI$al?Zb-L|v|Gt~r_r>V2!ViXxt&V8 zm0Bq!X*$PEc7;ygO1teKvZHm9j2t%+h=}c@v|AaGL%NwcZZb@`eVuj_tsoma6&wn* zYa87t2Te51L+-u}r!+x~m=L08nSNi>YwF5x$vweP#%;f}8>eKQi za#(+f+SgNj!1=MTJ=dVF7P)A(=r&s@dpt`Ipl*|@>^$1Up-^35;2|0CRgt1L=YWWX zO-Qz~Zq#llYs}d3w7jV~XWY2LB8pp{Z!-_h_R<5CO5G?nOun|)lu^Z?ap-h~zm!P|04l^Xyc*vTdk+Ho`9 zJPWOk7Q>|J+BEK`LXZU-ijsTIUXd5V91mA`bk83Um?`ey`67JTIJXwAsL>;f*%+89 zZtmpP9m{#daI{0$#+UuNp3EXR#O?(MqxO85d}ZJ0QkW{WUNb!wf=N^C!U&<{!^1lb zW+GZqscSqv7GTn57RwlnqI|OOwHt})&8>Bb zR#prqu16pkMXho^h)KTrtXA3#?;EZ4dZa!(7Aj%?DPq8udF$(zWl@g@+fgAh z3%ONw_w|OxLZ{EgCkIZSjXwc@tOOtJF_n6ui8+p~kR!76=#HrkqA1EU(2R&}>%*v6 zlO9H$8)Pfa4-U{Ty>JR*>wSVk6r+ReW4fv0_H#$3igcvx+#sUSawXT0&+pzKyWJ6Az2qouZVIr{g5pd($Y)Mca&og#b9nG z?d|0BPt^3bFshz7=f{KMn6I7uaF>shI2U@(a#vvcpPym3ne|&J`|G9b$mEtBQd+ND zJAho8*RXc4xW9NX%gLb^j!bf7HT{5iI}{ftKK zORSen#8L^Hco0Tj&>vPAnT`Z$#DQ6vi8BeCc~T*x$g(Zls*$_(*-_YR2}TL~DhtsS znpdlUX+2{Lo5(?TtdN(&u*HNo)XHx&UXrlyFA=;X@JNqn)Lm$m<)yq^#NtKn_0(#s l&x!NuyZ9pQ#CLG~$Wew^