Compare commits

...

22 Commits

Author SHA1 Message Date
Maximilian Brune
96084d5957 payloads/external/leanefi/Makefile: Fix clean target
Just follow the examples of other payloads and simply remove the build
directory of said payload.

Change-Id: Idf2a8f3b9ecbb300514d2d1deede76785fd402b7
Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82897
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
2024-06-04 15:33:06 +00:00
Seunghwan Kim
b152f10d5a mb/google/brya/var/xol: Enable FSP UPD LpDdrDqDqsReTraining
Set LpDdrDqDqsReTraining to 1 for xol. Value 0 will cause black screen
issue.

Reference: https://review.coreboot.org/c/coreboot/+/79527
> FSP default value for LpDdrDqDqsReTraining is 1. For boards
> that didn't set LpDdrDqDqsReTraining to any value, 0 was being
> assigned and it caused black screen issue.

BUG=b:332980211
BRANCH=brya
TEST=Built and verified there is no black screen issue during power
on/off test for over 100 cycles.

Change-Id: Ia346ce559b4509ea1a63abe28b12ad909f9b7b0d
Signed-off-by: Seunghwan Kim <sh_.kim@samsung.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82778
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2024-06-04 14:50:34 +00:00
Shon Wang
b870b66834 mb/google/brask/var/bujia: change ALC5650 to ALC5682I-VS
Due to system spec change, change audio codec ALC5650 to ALC5682I-VS

BUG=b:329787697
TEST= USE="-project_all project_bujia" emerge-brask coreboot

Change-Id: I38e5c58b3ef3fbe709b98601975ae3821bb77213
Signed-off-by: Shon Wang <shon.wang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82774
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Derek Huang <derekhuang@google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
2024-06-04 14:49:19 +00:00
Ronak Kanabar
79be6da071 vc/intel/fsp: Update ADL N FSP headers from v3343.05 to v5021.00
Update generated FSP headers for Alder Lake N from v5021.00

Changes include:
- Add FspProducerDataHeader.h header file
- Open Usb4CmMode & CnviWifiCore Upd in FspsUpd.h
- Update UPD Offset in FspsUpd.h

BUG=b:296433836
TEST=Able to build and boot google/nivviks

Change-Id: Ieb4cc8f2f83d8f6e821894f0ec2e56262a25743c
Signed-off-by: Ronak Kanabar <ronak.kanabar@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82780
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2024-06-04 13:59:30 +00:00
Ronak Kanabar
397a4965b2 Revert "vc/intel/fsp2/alderlake_n: Drop unused header files"
This reverts commit 79503ef515.

The Intel FSP repository at https://github.com/intel/FSP.git currently
lacks the Client ADL-N headers. The existing coreboot code references
the "IoT/AlderLakeN/" directory for these headers, but it is missing the
crucial FspProducerDataHeader.h file. Without this header, the ADL-N
platform is unable to utilize the appropriate MRC version needed for
updating MRC caches. This patch aims to restore the necessary FSP
headers for the ADL-N platform within the vendorcode directory.

Change-Id: I99e9d5a07b4ca8d1666e3fd50d3d363ed5d4618e
Signed-off-by: Ronak Kanabar <ronak.kanabar@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82779
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2024-06-04 13:59:24 +00:00
Elyes Haouas
78bd2710a7 util/xcompile: Use new GCC's warning options only if supported
Wflex-array-member-not-at-end & Wcalloc-transposed-args are
not supported when using GCC older than GCC-14.
Use them only when supported.

Change-Id: I11c1e729569c8130bd254a10454c5066a72974d6
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82785
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
2024-06-04 10:23:03 +00:00
Maximilian Brune
b62f86be43 payloads: Add leanefi payload
This adds another external payload to coreboot. The payload has been
heavily based on u-boots UEFI implementation.

The leanefi payload is basically a translator from coreboot to UEFI. It
takes the coreboot tables and transforms them into UEFI interfaces.
Although it can potentially load any efi application that can
handle the minimized interface that leanefi provides, it has only
been tested with LinuxBoot (v6.3.5) as a payload. It has been optimized
to support only those interfaces that Linux requires to start.

Among other leanefi does not support:
- efi capsule update (also efi system resource table)
- efi variables
- efi text input protocol (it can only output)
- most boot services. mostly memory services are left (e.g. alloc/free)
- all runtime services (although there is still a very small runtime
  footprint that is planned to be removed in the near future)
- TCG2/TPM (although that is mostly because of laziness)
The README.md currently provides more details on why.

The payload currently only supports arm64 and has only been tested
on emulation/simulator targets. The original motivation was to get ACPI
on arm64 published to the OS without using EDK2. It is however also
possible to supply the leanefi with a FDT that is published to the OS.
At that point one would however probably use coreboot only instead of
this shim layer on top. It would be way nicer to have Linux support
something else than UEFI to propagate the ACPI tables, but it requires
to get the Linux maintainer/community on board. So for now this shim
layer ciruimvents that.

LBBR Test:
// 1. dump FDT from QEMU like mentioned in aarch64 coreboot doc
// 2. compile u-root however you like (aarch64)
// 3. compile Linux (embed u-root initramfs via Kconfig)
// 4. copy Linux kernel to payloads/leanefi/Image
// 5. copy following coreboot defconfig to configs/defconfig:
CONFIG_BOARD_EMULATION_QEMU_AARCH64=y
CONFIG_PAYLOAD_NONE=n
CONFIG_PAYLOAD_LEANEFI=y
CONFIG_LEANEFI_PAYLOAD=y
CONFIG_LEANEFI_PAYLOAD_PATH="[path-to-linux]/arch/arm64/boot/Image"
CONFIG_LEANEFI_FDT=y
CONFIG_LEANEFI_FDT_PATH="[path-to-dumped-DTB]"
// 6. compile coreboot
make defconfig
make -j$(nproc)
// 7. run qemu like mentioned in coreboot doc (no FIT)
// 8. say hello to u-root and optionally kexec into the next kernel

Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com>
Change-Id: I4093378e89c3cb43fb0846666de80a7da36b03f1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78913
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Ron Minnich <rminnich@gmail.com>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
2024-06-04 00:26:14 +00:00
Elyes Haouas
178a5054b3 tree: Use calloc(n, sizeof(struct)) insteadof calloc(sizeof(struct), n)
Change-Id: I5e67e370d4eb8fe28227843bbca34db06ad84b26
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82786
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-06-03 19:02:31 +00:00
Elyes Haouas
ea7a83ee88 Revert "Makefile: Warn if flexible array members are not at the end"
This reverts commit f4acef92.

Reason for revert: '-Wflex-array-member-not-at-end' is new command
option came with GCC-14. older versions will not support it.

Change-Id: I179d0bc0db3e863645ae4c87e1534c5c20025dfb
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82758
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-06-03 17:27:24 +00:00
Reagan Bohan
ba39cd59db mb/razer/blade_stealth_kbl: Add H3Q variant
The Razer Blade Stealth Kaby Lake has 2 variants. One is the H2U
variant, as originally committed, with the SKU number RZ09-01962, also
known as the 2016 model, and the H3Q model with SKU numbers RZ09-01963
and RZ09-01964, known as the Mid 2017 model. This commit adds support
for the H3Q model. With respect to coreboot, there are few known
differences:

1. Only the H2U has TPM.
2. The USB ports are different.
3. The screen size (and therefore VBIOS Table) is different.
4. The hda_verb is very slightly different.
5. The gpio is different.

Change-Id: I493a651e52c2eb938daa67a05e9caaa784020fa4
Signed-off-by: Reagan Bohan <xbjfk.github@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82506
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2024-06-03 16:57:09 +00:00
Jeremy Soller
657cef204a soc/intel/meteorlake: Enable USB2 port reset message on Type-C ports
Apply commit c6b65c1a81 ("soc/intel/alderlake: Enable USB2 port reset
message on Type-C ports") to Meteor Lake.

This change is added to address the issue of USB3 ports downgrading to
high speed during low power modes and not returning back to super speed.

The patch enables port reset event on USB2 ports. This event is
is passed to USB3 upstream ports to upgrade back to super speed (USB3)
after a downgrade during low power state.

Change-Id: Iac702a8d8edd2b3b7e03abcac020be7e45335821
Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82730
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-06-03 16:55:47 +00:00
Shuo Liu
740cf98f0f util/cbfstool: Fix linux_trampoline.c generation
linux_trampoline.c generation is broken with latest crossgcc-i386
toolchain. Fix the issue to enable the building.

../cbfstool/linux_trampoline.S: Assembler messages:
../cbfstool/linux_trampoline.S💯 Error: no instruction mnemonic
	suffix given and no register operands; can't size
	instruction
<builtin>: recipe for target '../cbfstool/linux_trampoline.o'
	failed

TEST=Build and boot on intel/archercity CRB

cd util/cbfstool/
rm linux_trampoline.c
make linux_trampoline.c

Change-Id: I7faca296f946bb4e9fd510661357925e5dcf9a6b
Signed-off-by: Shuo Liu <shuo.liu@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82704
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2024-06-03 16:54:02 +00:00
Tim Crawford
ed55218c5e mb/system76/rpl: Fix addw4 Kconfig name
Change-Id: I1ed280c1e62e0f094fd40d2165892240f76de390
Fixes: 29f1b79127 ("mb/system76/rpl: Add Adder WS 4 as a variant")
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82725
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jeremy Soller <jeremy@system76.com>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
2024-06-03 16:47:40 +00:00
Tim Crawford
cfcd0851a2 mb/system76/rpl: Hook up TAS5825M init
Ensure per-board smart amp init is configured. Fixes speaker output on
oryp12.

Change-Id: I40ff1889dd144bf83ef85979a55535493aa7abdd
Fixes: 8b9716e226 ("mb/system76/rpl: Add Oryx Pro 12 as a variant")
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82726
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jeremy Soller <jeremy@system76.com>
2024-06-03 16:47:26 +00:00
Tim Crawford
8093b77c34 mb/system76: Add SPDX ID to devicetree files
Change-Id: I55f2730f7277a3c699b86ded5864e9690d92d518
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82700
Reviewed-by: Jeremy Soller <jeremy@system76.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-06-03 16:46:51 +00:00
Michał Kopeć
3a26aec8bd soc/intel/meteorlake: Hook up PchHdaAudioLinkHdaEnable to devicetree
The comment that the PchHdaAudioLink UPDs only configure GPIOs is
incorrect. Setting this to 1 is needed to enable HDA audio link.

Same exact situation as with Alder Lake in CL 71715.

Change-Id: Iecbe106ae18b5a8b53c04a5335a4e4c4ae27c7a0
Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82685
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Crawford <tcrawford@system76.com>
2024-06-03 16:46:00 +00:00
Michał Kopeć
a79af4c7fd ec/dasharo/ec: Add initial copy of ec/system76/ec
Initial commit is a copy of ec/system76/ec from tag v24.02.1 (commit
0a280ff7) with string changes. Dasharo-specific features will be added
in subsequent commits, similar to how Librem EC support was added in
changes 52390 and 52391.

Change-Id: Ic7c3d9413488026548514963eb78accc28e41e06
Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82671
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
2024-06-03 16:45:20 +00:00
Alper Nebi Yasak
377157c7fb device_tree: Add function to get top of memory from a FDT blob
coreboot needs to figure out top of memory to place CBMEM data. On some
non-x86 QEMU virtual machines, this is achieved by probing the RAM space
to find where the VM starts discarding data since it's not backed by
actual RAM. This behaviour seems to have changed on the QEMU side since
then, VMs using the "virt" model have started raising exceptions/errors
instead of silently discarding data (likely [1] for example) which has
previously broken coreboot on these emulation boards.

The qemu-aarch64 and qemu-riscv mainboards are intended for the "virt"
models and had this issue, which were mostly fixed by using exception
handlers in the RAM detection process [2][3]. But on 32-bit RISC-V we
fail to initialize CBMEM if we have 2048 MiB or more of RAM, and on
64-bit RISC-V we had to limit probing to 16383 MiB because it can run
into MMIO regions otherwise.

The qemu-armv7 mainboard code is intended for the "vexpress-a9" model VM
which doesn't appear to suffer from this issue. Still, the issue can be
observed on the ARMv7 "virt" model via a port based on qemu-aarch64.

QEMU docs for ARM and RISC-V "virt" models [4][5] recommend reading the
device tree blob it provides for device information (incl. RAM size).
Implement functions that parse the device tree blob to find described
memory regions and calculate the top of memory in order to use it in
mainboard code as an alternative to probing RAM space. ARM64 code
initializes CBMEM in romstage where malloc isn't available, so take care
to do parsing without unflattening the blob and make the code available
in romstage as well.

[1] https://lore.kernel.org/qemu-devel/1504626814-23124-1-git-send-email-peter.maydell@linaro.org/T/#u
[2] https://review.coreboot.org/c/coreboot/+/34774
[3] https://review.coreboot.org/c/coreboot/+/36486
[4] https://qemu-project.gitlab.io/qemu/system/arm/virt.html
[5] https://qemu-project.gitlab.io/qemu/system/riscv/virt.html

Change-Id: I8bef09bc1bc4e324ebeaa37f78d67d3aa315f52c
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80322
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2024-06-03 15:38:55 +00:00
Elyes Haouas
eed791e851 Revert "tree: Use Wcalloc-transposed-args command option"
This reverts commit b3db3abd63.

Reason for revert: `Wcalloc-transposed-args` is new command option came with GCC-14. older versions will not support it.

Change-Id: I74ef8de1f7d38e1e0519c3b41e79fd9b11d8e16f
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82759
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-06-03 14:58:01 +00:00
Maximilian Brune
6466354ee9 lib/device_tree.c: Fix wrong check for FDT validity
Obviously one should return NULL if a FDT is not valid an not the other
way around.

Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com>
Change-Id: I77c0e187b841e60965daac17025110181bdd32bc
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82773
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
2024-06-03 11:17:30 +00:00
Elyes Haouas
f38c940754 tree: Add some SMBIOS_PROCESSOR_FAMILY macros
Change-Id: Ibe551a4c83f416ba30326077aa165818cf79c1fd
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82648
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-06-01 06:40:14 +00:00
Subrata Banik
87a6600264 mainboard/google/rex: Enable Rex64 build configuration
- Add Rex64 board to Kconfig menu
- Enable building for Rex64 with x86_64 support

Change-Id: I02e2c49b4aeb2cb98d9d0cb66717db18c3f96d45
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82625
Reviewed-by: Dinesh Gehlot <digehlot@google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2024-05-31 22:11:55 +00:00
107 changed files with 9462 additions and 62 deletions

View File

@@ -501,8 +501,7 @@ CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer
CFLAGS_common += -fstrict-aliasing -ffunction-sections -fdata-sections -fno-pie
CFLAGS_common += -Wstring-compare
ifeq ($(CONFIG_COMPILER_GCC),y)
CFLAGS_common += -Wold-style-declaration -Wflex-array-member-not-at-end
CFLAGS_common += -Wcalloc-transposed-args
CFLAGS_common += -Wold-style-declaration
# Don't add these GCC specific flags when running scan-build
ifeq ($(CCC_ANALYZER_OUTPUT_FORMAT),)
CFLAGS_common += -Wno-packed-not-aligned

View File

@@ -28,6 +28,7 @@ payloads/external/edk2 \
payloads/external/GRUB2 \
payloads/external/LinuxBoot \
payloads/external/skiboot \
payloads/external/leanefi \
payloads/external/coreDOOM \
force-payload:

View File

@@ -436,6 +436,13 @@ payloads/external/skiboot/build/skiboot.elf:
$(MAKE) -C payloads/external/skiboot all \
CONFIG_SKIBOOT_GIT_REPO=$(CONFIG_SKIBOOT_GIT_REPO) \
CONFIG_SKIBOOT_REVISION=$(CONFIG_SKIBOOT_REVISION)
# leanefi
payloads/external/leanefi/leanefi/build/leanefi.elf: FORCE $(DOTCONFIG)
$(MAKE) -C payloads/external/leanefi
FORCE: ;
# COREDOOM
payloads/external/coreDOOM/coredoom/doomgeneric/coredoom.elf coredoom:

58
payloads/external/leanefi/Kconfig vendored Normal file
View File

@@ -0,0 +1,58 @@
if PAYLOAD_LEANEFI
menu "leanEFI configuration"
config PAYLOAD_FILE
string
default "payloads/external/leanefi/leanefi/build/leanefi.elf"
config LEANEFI_EFI_ECPT
bool
default y if ARCH_ARM64
config LEANEFI_HEAP_SIZE
int "Heap size"
default 131072
help
This is the heap size (malloc'able size) available
to the payload.
If unsure, set to 131072 (128K)
config LEANEFI_STACK_SIZE
int "Stack size"
default 16384
help
This is the stack size available to the payload.
If unsure, set to 16384 (16K)
config LEANEFI_BASE_ADDRESS
hex "Base address"
default 0x62000000 if BOARD_EMULATION_QEMU_AARCH64
#default 0x10023300000 if BOARD_EMULATION_QEMU_SBSA
help
This is the base address for the payload.
config LEANEFI_PAYLOAD
bool "Add a payload"
default y
help
If selected leanEFI will start a payload.
This option should only be unselected for debug purposes.
config LEANEFI_PAYLOAD_PATH
string "path to leanefi payload"
depends on LEANEFI_PAYLOAD
config LEANEFI_FDT
bool "Add an FDT that is propagated as EFI configuration table"
default y if BOARD_EMULATION_QEMU_AARCH64
config LEANEFI_FDT_PATH
string "path to FDT"
depends on LEANEFI_FDT
endmenu
endif

View File

@@ -0,0 +1,6 @@
config PAYLOAD_LEANEFI
bool "leanefi"
depends on ARCH_ARM64
help
Select this option if you want to build a coreboot image
with an leanefi payload.

22
payloads/external/leanefi/Makefile vendored Normal file
View File

@@ -0,0 +1,22 @@
unexport KCONFIG_AUTOHEADER
unexport KCONFIG_AUTOCONFIG
unexport KCONFIG_DEPENDENCIES
unexport KCONFIG_SPLITCONFIG
unexport KCONFIG_TRISTATE
unexport KCONFIG_NEGATIVES
unexport $(COREBOOT_EXPORTS)
build: leanefi
$(MAKE) -C leanefi
leanefi:
git clone "https://review.coreboot.org/leanefi"
distclean:
rm -rf leanefi
clean:
rm -rf leanefi/build
.PHONY: build clean distclean

View File

@@ -66,8 +66,8 @@ int smbios_write_type4(unsigned long *current, int handle)
smbios_processor_id(t->processor_id);
t->processor_manufacturer = smbios_processor_manufacturer(t->eos);
t->processor_version = smbios_processor_name(t->eos);
t->processor_family = 0xfe; /* Use processor_family2 field */
t->processor_family2 = 0x101; /* ARMv8 */
t->processor_family = SMBIOS_PROCESSOR_FAMILY_FROM_FAMILY2;
t->processor_family2 = SMBIOS_PROCESSOR_FAMILY2_ARMV8;
t->processor_type = SMBIOS_PROCESSOR_TYPE_CENTRAL;
smbios_cpu_get_core_counts(&t->core_count2, &t->thread_count2);

View File

@@ -68,7 +68,7 @@ static int get_socket_type(void)
unsigned int __weak smbios_processor_family(struct cpuid_result res)
{
return (res.eax > 0) ? 0x0c : 0x6;
return (res.eax > 0) ? SMBIOS_PROCESSOR_FAMILY_PENTIUM_PRO : SMBIOS_PROCESSOR_FAMILY_INTEL486;
}
static size_t get_number_of_caches(size_t max_logical_cpus_sharing_cache)

21
src/ec/dasharo/ec/Kconfig Normal file
View File

@@ -0,0 +1,21 @@
## SPDX-License-Identifier: GPL-2.0-only
config EC_DASHARO_EC
bool
help
Dasharo EC
config EC_DASHARO_EC_BAT_THRESHOLDS
depends on EC_DASHARO_EC
bool
default y
config EC_DASHARO_EC_DGPU
depends on EC_DASHARO_EC
bool
default n
config EC_DASHARO_EC_OLED
depends on EC_DASHARO_EC
bool
default n

View File

@@ -0,0 +1,10 @@
## SPDX-License-Identifier: GPL-2.0-only
ifeq ($(CONFIG_EC_DASHARO_EC),y)
all-y += dasharo_ec.c
ramstage-y += smbios.c
smm-$(CONFIG_DEBUG_SMI) += dasharo_ec.c
endif

View File

@@ -0,0 +1,22 @@
/* SPDX-License-Identifier: GPL-2.0-only */
Device (AC)
{
Name (_HID, "ACPI0003" /* Power Source Device */)
Name (_PCL, Package (0x01) // _PCL: Power Consumer List
{
_SB
})
Name (ACFG, 1)
Method (_PSR, 0, NotSerialized) // _PSR: Power Source
{
Return (ACFG)
}
Method (_STA, 0, NotSerialized)
{
Return (0x0F)
}
}

View File

@@ -0,0 +1,248 @@
/* SPDX-License-Identifier: GPL-2.0-only */
Device (BAT0)
{
Name (_HID, EisaId ("PNP0C0A") /* Control Method Battery */)
Name (_UID, 0)
Name (_PCL, Package (0x01) // _PCL: Power Consumer List
{
_SB
})
Name (BFCC, 0)
Method (_STA, 0, NotSerialized)
{
If (^^PCI0.LPCB.EC0.ECOK)
{
If (^^PCI0.LPCB.EC0.BAT0)
{
Return (0x1F)
}
Else
{
Return (0x0F)
}
}
Else
{
Return (0x0F)
}
}
Name (PBIF, Package (0x0D)
{
1, // 0 - Power Unit
0xFFFFFFFF, // 1 - Design Capacity
0xFFFFFFFF, // 2 - Last Full Charge Capacity
1, // 3 - Battery Technology
0xFFFFFFFF, // 4 - Design Voltage
0, // 5 - Design Capacity of Warning
0, // 6 - Design Capacity of Low
0x40, // 7 - Battery Capacity Granularity 1
0x40, // 8 - Battery Capacity Granularity 2
" ", // 9 - Model Number
" ", // 10 - Serial Number
" ", // 11 - Battery Type
" " // 12 - OEM Information
})
Method (IVBI, 0, NotSerialized)
{
PBIF [1] = 0xFFFFFFFF
PBIF [2] = 0xFFFFFFFF
PBIF [4] = 0xFFFFFFFF
PBIF [9] = " "
PBIF [10] = " "
PBIF [11] = " "
PBIF [12] = " "
BFCC = 0
}
Method (UPBI, 0, NotSerialized)
{
If (^^PCI0.LPCB.EC0.BAT0)
{
Local0 = (^^PCI0.LPCB.EC0.BDC0 & 0xFFFF)
PBIF [1] = Local0
Local0 = (^^PCI0.LPCB.EC0.BFC0 & 0xFFFF)
PBIF [2] = Local0
BFCC = Local0
Local0 = (^^PCI0.LPCB.EC0.BDV0 & 0xFFFF)
PBIF [4] = Local0
Local0 = (^^PCI0.LPCB.EC0.BCW0 & 0xFFFF)
PBIF [5] = Local0
Local0 = (^^PCI0.LPCB.EC0.BCL0 & 0xFFFF)
PBIF [6] = Local0
PBIF [9] = "BAT"
PBIF [10] = "0001"
PBIF [11] = "LION"
PBIF [12] = "Notebook"
}
Else
{
IVBI ()
}
}
Method (_BIF, 0, NotSerialized) // _BIF: Battery Information
{
If (^^PCI0.LPCB.EC0.ECOK)
{
UPBI ()
}
Else
{
IVBI ()
}
Return (PBIF) /* \_SB_.BAT0.PBIF */
}
Name (PBIX, Package ()
{
0, // 0 - Revision
1, // 1 - Power Unit: mAh
0xFFFFFFFF, // 2 - Design Capacity
0xFFFFFFFF, // 3 - Last Full Charge Capacity
1, // 4 - Battery Technology: Rechargeable
0xFFFFFFFF, // 5 - Design Voltage
0, // 6 - Design Capacity of Warning
0, // 7 - Design Capacity of Low
0, // 8 - Cycle Count
98000, // 9 - Measurement Accuracy
0xFFFFFFFF, // 10 - Max Sampling Time
0xFFFFFFFF, // 11 - Min Sampling Time
0xFFFFFFFF, // 12 - Max Averaging Interval
0xFFFFFFFF, // 13 - Min Averaging Interval
0x40, // 14 - Battery Capacity Granularity 1
0x40, // 15 - Battery Capacity Granularity 2
" ", // 16 - Model Number
" ", // 17 - Serial Number
" ", // 18 - Battery Type
" " // 19 - OEM Information
})
Method (IVBX, 0, NotSerialized)
{
PBIX [2] = 0xFFFFFFFF
PBIX [3] = 0xFFFFFFFF
PBIX [5] = 0xFFFFFFFF
PBIX [16] = " "
PBIX [17] = " "
PBIX [18] = " "
PBIX [19] = " "
BFCC = 0
}
Method (UPBX, 0, NotSerialized)
{
If (^^PCI0.LPCB.EC0.BAT0)
{
Local0 = (^^PCI0.LPCB.EC0.BDC0 & 0xFFFF)
PBIX [2] = Local0
Local0 = (^^PCI0.LPCB.EC0.BFC0 & 0xFFFF)
PBIX [3] = Local0
BFCC = Local0
Local0 = (^^PCI0.LPCB.EC0.BDV0 & 0xFFFF)
PBIX [5] = Local0
Local0 = (^^PCI0.LPCB.EC0.BCW0 & 0xFFFF)
PBIX [6] = Local0
Local0 = (^^PCI0.LPCB.EC0.BCL0 & 0xFFFF)
PBIX [7] = Local0
LOCAL0 = ^^PCI0.LPCB.EC0.CYC0
PBIX [8] = LOCAL0
PBIX [16] = "BAT"
PBIX [17] = "0001"
PBIX [18] = "LION"
PBIX [19] = "Notebook"
}
Else
{
IVBX ()
}
}
// _BIX: Battery Information Extended
Method (_BIX, 0, NotSerialized)
{
If (^^PCI0.LPCB.EC0.ECOK)
{
UPBX ()
}
Else
{
IVBX ()
}
Return (PBIX) /* \_SB_.BAT0.PBIX */
}
Name (PBST, Package (0x04)
{
0, // 0 - Battery state
0xFFFFFFFF, // 1 - Battery present rate
0xFFFFFFFF, // 2 - Battery remaining capacity
0xFFFFFFFF // 3 - Battery present voltage
})
Method (IVBS, 0, NotSerialized)
{
PBST [0] = 0
PBST [1] = 0xFFFFFFFF
PBST [2] = 0xFFFFFFFF
PBST [3] = 0xFFFFFFFF
}
Method (UPBS, 0, NotSerialized)
{
If (^^PCI0.LPCB.EC0.BAT0)
{
Local0 = 0
Local1 = 0
If (^^AC.ACFG)
{
If (((^^PCI0.LPCB.EC0.BST0 & 0x02) == 0x02))
{
Local0 |= 0x02
Local1 = (^^PCI0.LPCB.EC0.BPR0 & 0xFFFF)
}
}
Else
{
Local0 |= 1
Local1 = (^^PCI0.LPCB.EC0.BPR0 & 0xFFFF)
}
Local7 = (Local1 & 0x8000)
If ((Local7 == 0x8000))
{
Local1 ^= 0xFFFF
}
Local2 = (^^PCI0.LPCB.EC0.BRC0 & 0xFFFF)
Local3 = (^^PCI0.LPCB.EC0.BPV0 & 0xFFFF)
PBST [0] = Local0
PBST [1] = Local1
PBST [2] = Local2
PBST [3] = Local3
If ((BFCC != ^^PCI0.LPCB.EC0.BFC0))
{
Notify (BAT0, 0x81) // Information Change
}
}
Else
{
IVBS ()
}
}
Method (_BST, 0, NotSerialized) // _BST: Battery Status
{
If (^^PCI0.LPCB.EC0.ECOK)
{
UPBS ()
}
Else
{
IVBS ()
}
Return (PBST) /* \_SB_.BAT0.PBST */
}
}

View File

@@ -0,0 +1,46 @@
/* SPDX-License-Identifier: GPL-2.0-only */
Field (ERAM, ByteAcc, Lock, Preserve)
{
Offset (0xBC),
BTL0, 8, /* BAT0 charging start threshold */
BTH0, 8, /* BAT0 charging end threshold */
}
/*
* Get battery charging threshold
*
* Arg0: 0: Start threshold
* 1: Stop threshold
*/
Method (GBCT, 1, NotSerialized)
{
If (Arg0 == 0) {
Return (BTL0)
}
If (Arg0 == 1) {
Return (BTH0)
}
Return (0xFF)
}
/*
* Set battery charging threshold
*
* Arg0: 0: Start threshold
* 1: Stop threshold
* Arg1: Percentage
*/
Method (SBCT, 2, NotSerialized)
{
If (Arg1 <= 100) {
If (Arg0 == 0) {
BTL0 = Arg1
}
If (Arg0 == 1) {
BTH0 = Arg1
}
}
}

View File

@@ -0,0 +1,13 @@
/* SPDX-License-Identifier: GPL-2.0-only */
Device (PWRB)
{
Name (_HID, EisaId ("PNP0C0C"))
Name (_PRW, Package () { EC_GPE_SWI, 3 })
}
Device (SLPB)
{
Name (_HID, EisaId ("PNP0C0E"))
Name (_PRW, Package () { EC_GPE_SWI, 3 })
}

View File

@@ -0,0 +1,241 @@
/* SPDX-License-Identifier: GPL-2.0-only */
Scope (\_SB) {
#include "ac.asl"
#include "battery.asl"
#include "buttons.asl"
#include "hid.asl"
#include "lid.asl"
#include "s76.asl"
}
Device (\_SB.PCI0.LPCB.EC0)
{
Name (_HID, EisaId ("PNP0C09") /* Embedded Controller Device */)
Name (_GPE, EC_GPE_SCI) // _GPE: General Purpose Events
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
IO (Decode16,
0x0062, // Range Minimum
0x0062, // Range Maximum
0x00, // Alignment
0x01, // Length
)
IO (Decode16,
0x0066, // Range Minimum
0x0066, // Range Maximum
0x00, // Alignment
0x01, // Length
)
})
#include "ec_ram.asl"
Name (ECOK, 0)
Method (_REG, 2, Serialized) // _REG: Region Availability
{
Printf ("EC: _REG %o %o", ToHexString(Arg0), ToHexString(Arg1))
If ((Arg0 == 0x03) && (Arg1 == 1)) {
// Enable hardware touchpad lock, airplane mode, and keyboard backlight keys
ECOS = 1
// Enable software display brightness keys
WINF = 1
// Set current AC state
^^^^AC.ACFG = ADP
// Update battery information and status
^^^^BAT0.UPBI()
^^^^BAT0.UPBS()
// Notify of changes
Notify(^^^^AC, 0)
Notify(^^^^BAT0, 0)
PNOT ()
// EC is now available
ECOK = Arg1
// Reset Dasharo Device
^^^^S76D.RSET()
}
}
Name (S3OS, 0)
Method (PTS, 1, Serialized) {
Printf ("EC: PTS: %o", ToHexString(Arg0))
If (ECOK) {
// Save ECOS during sleep
S3OS = ECOS
// Clear wake cause
WFNO = 0
}
}
Method (WAK, 1, Serialized) {
Printf ("EC: WAK: %o", ToHexString(Arg0))
If (ECOK) {
// Restore ECOS after sleep
ECOS = S3OS
// Set current AC state
^^^^AC.ACFG = ADP
// Update battery information and status
^^^^BAT0.UPBI()
^^^^BAT0.UPBS()
// Notify of changes
Notify(^^^^AC, 0)
Notify(^^^^BAT0, 0)
}
}
Method (_Q0A, 0, NotSerialized) // Touchpad Toggle
{
Printf ("EC: Touchpad Toggle")
}
Method (_Q0B, 0, NotSerialized) // Screen Toggle
{
Printf ("EC: Screen Toggle")
#if CONFIG(EC_DASHARO_EC_OLED)
Notify (^^^^S76D, 0x85)
#endif // CONFIG(EC_DASHARO_EC_OLED)
}
Method (_Q0C, 0, NotSerialized) // Mute
{
Printf ("EC: Mute")
}
Method (_Q0D, 0, NotSerialized) // Keyboard Backlight
{
Printf ("EC: Keyboard Backlight")
}
Method (_Q0E, 0, NotSerialized) // Volume Down
{
Printf ("EC: Volume Down")
}
Method (_Q0F, 0, NotSerialized) // Volume Up
{
Printf ("EC: Volume Up")
}
Method (_Q10, 0, NotSerialized) // Switch Video Mode
{
Printf ("EC: Switch Video Mode")
}
Method (_Q11, 0, NotSerialized) // Brightness Down
{
Printf ("EC: Brightness Down")
if (^^^^HIDD.HRDY) {
^^^^HIDD.HPEM (20)
}
}
Method (_Q12, 0, NotSerialized) // Brightness Up
{
Printf ("EC: Brightness Up")
if (^^^^HIDD.HRDY) {
^^^^HIDD.HPEM (19)
}
}
Method (_Q13, 0, NotSerialized) // Camera Toggle
{
Printf ("EC: Camera Toggle")
}
Method (_Q14, 0, NotSerialized) // Airplane Mode
{
Printf ("EC: Airplane Mode")
if (^^^^HIDD.HRDY) {
^^^^HIDD.HPEM (8)
}
// TODO: hardware airplane mode
}
Method (_Q15, 0, NotSerialized) // Suspend Button
{
Printf ("EC: Suspend Button")
Notify (SLPB, 0x80)
}
Method (_Q16, 0, NotSerialized) // AC Detect
{
Printf ("EC: AC Detect")
^^^^AC.ACFG = ADP
Notify (AC, 0x80) // Status Change
If (BAT0)
{
Notify (^^^^BAT0, 0x81) // Information Change
Notify (^^^^BAT0, 0x80) // Status Change
}
}
Method (_Q17, 0, NotSerialized) // BAT0 Update
{
Printf ("EC: BAT0 Update (17)")
Notify (^^^^BAT0, 0x81) // Information Change
}
Method (_Q19, 0, NotSerialized) // BAT0 Update
{
Printf ("EC: BAT0 Update (19)")
Notify (^^^^BAT0, 0x81) // Information Change
}
Method (_Q1B, 0, NotSerialized) // Lid Close
{
Printf ("EC: Lid Close")
Notify (LID0, 0x80)
}
Method (_Q1C, 0, NotSerialized) // Thermal Trip
{
Printf ("EC: Thermal Trip")
/* TODO
Notify (\_TZ.TZ0, 0x81) // Thermal Trip Point Change
Notify (\_TZ.TZ0, 0x80) // Thermal Status Change
*/
}
Method (_Q1D, 0, NotSerialized) // Power Button
{
Printf ("EC: Power Button")
Notify (PWRB, 0x80)
}
Method (_Q50, 0, NotSerialized) // Other Events
{
Local0 = OEM4
If (Local0 == 0x8A) {
Printf ("EC: White Keyboard Backlight")
Notify (^^^^S76D, 0x80)
} ElseIf (Local0 == 0x9F) {
Printf ("EC: Color Keyboard Toggle")
Notify (^^^^S76D, 0x81)
} ElseIf (Local0 == 0x81) {
Printf ("EC: Color Keyboard Down")
Notify (^^^^S76D, 0x82)
} ElseIf (Local0 == 0x82) {
Printf ("EC: Color Keyboard Up")
Notify (^^^^S76D, 0x83)
} ElseIf (Local0 == 0x80) {
Printf ("EC: Color Keyboard Color Change")
Notify (^^^^S76D, 0x84)
} Else {
Printf ("EC: Other: %o", ToHexString(Local0))
}
}
#if CONFIG(EC_DASHARO_EC_BAT_THRESHOLDS)
#include "battery_thresholds.asl"
#endif
}

View File

@@ -0,0 +1,55 @@
/* SPDX-License-Identifier: GPL-2.0-only */
OperationRegion (ERAM, EmbeddedControl, 0, 0xFF)
Field (ERAM, ByteAcc, Lock, Preserve)
{
Offset (0x03),
LSTE, 1, // Lid is open
, 1,
LWKE, 1, // Lid wake
, 5,
Offset (0x07),
TMP1, 8, // CPU temperature
Offset (0x10),
ADP, 1, // AC adapter connected
, 1,
BAT0, 1, // Battery connected
, 5,
WFNO, 8, // Wake cause (not implemented)
Offset (0x16),
BDC0, 32, // Battery design capacity
BFC0, 32, // Battery full capacity
Offset (0x22),
BDV0, 32, // Battery design voltage
BST0, 32, // Battery status
BPR0, 32, // Battery current
BRC0, 32, // Battery remaining capacity
BPV0, 32, // Battery voltage
Offset (0x3A),
BCW0, 32,
BCL0, 32,
CYC0, 16, // Battery cycle count
Offset (0x68),
ECOS, 8, // Detected OS, 0 = no ACPI, 1 = ACPI but no driver, 2 = ACPI with driver
Offset (0xC8),
OEM1, 8,
OEM2, 8,
OEM3, 16,
OEM4, 8, // Extra SCI data
Offset (0xCD),
TMP2, 8, // GPU temperature
DUT1, 8, // Fan 1 duty
DUT2, 8, // Fan 2 duty
RPM1, 16, // Fan 1 RPM
RPM2, 16, // Fan 2 RPM
Offset (0xD9),
AIRP, 8, // Airplane mode LED
WINF, 8, // Enable ACPI brightness controls
Offset (0xF8),
FCMD, 8,
FDAT, 8,
FBUF, 8,
FBF1, 8,
FBF2, 8,
FBF3, 8,
}

View File

@@ -0,0 +1,50 @@
/* SPDX-License-Identifier: GPL-2.0-only */
Device (HIDD)
{
Name (_HID, "INT33D5")
Name (HBSY, 0)
Name (HIDX, 0)
Name (HRDY, 0)
Method (HDEM, 0, Serialized)
{
HBSY = 0
Return (HIDX)
}
Method (HDMM, 0, Serialized)
{
Return (0)
}
Method (HDSM, 1, Serialized)
{
HRDY = Arg0
}
Method (HPEM, 1, Serialized)
{
HBSY = 1
HIDX = Arg0
Notify (HIDD, 0xC0)
Local0 = 0
While ((Local0 < 0xFA) && HBSY)
{
Sleep (0x04)
Local0++
}
If (HBSY == 1)
{
HBSY = 0
HIDX = 0
Return (1)
}
Else
{
Return (0)
}
}
}

View File

@@ -0,0 +1,23 @@
/* SPDX-License-Identifier: GPL-2.0-only */
Device (LID0)
{
Name (_HID, EisaId ("PNP0C0D"))
Name (_PRW, Package () { EC_GPE_SWI, 3 })
Method (_LID, 0, NotSerialized) {
Printf ("LID: _LID")
If (^^PCI0.LPCB.EC0.ECOK) {
Return (^^PCI0.LPCB.EC0.LSTE)
} Else {
Return (1)
}
}
Method (_PSW, 1, NotSerialized) {
Printf ("LID: _PSW: %o", ToHexString(Arg0))
If (^^PCI0.LPCB.EC0.ECOK) {
^^PCI0.LPCB.EC0.LWKE = Arg0
}
}
}

View File

@@ -0,0 +1,178 @@
/* SPDX-License-Identifier: GPL-2.0-only */
// Notifications:
// 0x80 - hardware backlight toggle
// 0x81 - backlight toggle
// 0x82 - backlight down
// 0x83 - backlight up
// 0x84 - backlight color change
// 0x85 - OLED screen toggle
Device (S76D) {
Name (_HID, "17761776")
Name (_UID, 0)
// Hide the device so that Windows does not warn about a missing driver.
Name (_STA, 0xB)
Method (RSET, 0, Serialized) {
Printf ("S76D: RSET")
SAPL(0)
SKBB(0)
SKBC(0xFFFFFF)
}
Method (INIT, 0, Serialized) {
Printf ("S76D: INIT")
RSET()
If (^^PCI0.LPCB.EC0.ECOK) {
// Set flags to use software control
^^PCI0.LPCB.EC0.ECOS = 2
Return (0)
} Else {
Return (1)
}
}
Method (FINI, 0, Serialized) {
Printf ("S76D: FINI")
RSET()
If (^^PCI0.LPCB.EC0.ECOK) {
// Set flags to use hardware control
^^PCI0.LPCB.EC0.ECOS = 1
Return (0)
} Else {
Return (1)
}
}
// Get Airplane LED
Method (GAPL, 0, Serialized) {
If (^^PCI0.LPCB.EC0.ECOK) {
If (^^PCI0.LPCB.EC0.AIRP & 0x40) {
Return (1)
}
}
Return (0)
}
// Set Airplane LED
Method (SAPL, 1, Serialized) {
If (^^PCI0.LPCB.EC0.ECOK) {
If (Arg0) {
^^PCI0.LPCB.EC0.AIRP |= 0x40
} Else {
^^PCI0.LPCB.EC0.AIRP &= 0xBF
}
}
}
// Get Keyboard Backlight Kind
// 0 - No backlight
// 1 - White backlight
// 2 - RGB backlight
Method (GKBK, 0, Serialized) {
Local0 = 0
If (^^PCI0.LPCB.EC0.ECOK) {
^^PCI0.LPCB.EC0.FDAT = 2
^^PCI0.LPCB.EC0.FCMD = 0xCA
Local0 = ^^PCI0.LPCB.EC0.FBUF
}
Return (Local0)
}
// Get Keyboard Brightness
Method (GKBB, 0, Serialized) {
Local0 = 0
If (^^PCI0.LPCB.EC0.ECOK) {
^^PCI0.LPCB.EC0.FDAT = 1
^^PCI0.LPCB.EC0.FCMD = 0xCA
Local0 = ^^PCI0.LPCB.EC0.FBUF
}
Return (Local0)
}
// Set Keyboard Brightness
Method (SKBB, 1, Serialized) {
If (^^PCI0.LPCB.EC0.ECOK) {
^^PCI0.LPCB.EC0.FDAT = 0
^^PCI0.LPCB.EC0.FBUF = Arg0
^^PCI0.LPCB.EC0.FCMD = 0xCA
}
}
// Get Keyboard Color
Method (GKBC, 0, Serialized) {
Local0 = 0
If (^^PCI0.LPCB.EC0.ECOK) {
^^PCI0.LPCB.EC0.FDAT = 4
^^PCI0.LPCB.EC0.FCMD = 0xCA
Local0 = ^^PCI0.LPCB.EC0.FBUF
Local0 |= (^^PCI0.LPCB.EC0.FBF1) << 16
Local0 |= (^^PCI0.LPCB.EC0.FBF2) << 8
}
Return (Local0)
}
// Set Keyboard Color
Method (SKBC, 1, Serialized) {
If (^^PCI0.LPCB.EC0.ECOK) {
^^PCI0.LPCB.EC0.FDAT = 3
^^PCI0.LPCB.EC0.FBUF = (Arg0 & 0xFF)
^^PCI0.LPCB.EC0.FBF1 = ((Arg0 >> 16) & 0xFF)
^^PCI0.LPCB.EC0.FBF2 = ((Arg0 >> 8) & 0xFF)
^^PCI0.LPCB.EC0.FCMD = 0xCA
}
}
// Fan names
Method (NFAN, 0, Serialized) {
Return (Package() {
"CPU fan",
#if CONFIG(EC_DASHARO_EC_DGPU)
"GPU fan",
#endif
})
}
// Get fan duty cycle and RPM as a single value
Method (GFAN, 1, Serialized) {
Local0 = 0
Local1 = 0
If (^^PCI0.LPCB.EC0.ECOK) {
If (Arg0 == 0) {
Local0 = ^^PCI0.LPCB.EC0.DUT1
Local1 = ^^PCI0.LPCB.EC0.RPM1
} ElseIf (Arg0 == 1) {
Local0 = ^^PCI0.LPCB.EC0.DUT2
Local1 = ^^PCI0.LPCB.EC0.RPM2
}
}
If (Local1 != 0) {
// 60 * (EC frequency / 120) / 2
Local1 = 2156250 / Local1
}
Return ((Local1 << 8) | Local0)
}
// Temperature names
Method (NTMP, 0, Serialized) {
Return (Package() {
"CPU temp",
#if CONFIG(EC_DASHARO_EC_DGPU)
"GPU temp",
#endif
})
}
// Get temperature
Method (GTMP, 1, Serialized) {
Local0 = 0;
If (^^PCI0.LPCB.EC0.ECOK) {
If (Arg0 == 0) {
Local0 = ^^PCI0.LPCB.EC0.TMP1
} ElseIf (Arg0 == 1) {
Local0 = ^^PCI0.LPCB.EC0.TMP2
}
}
Return (Local0)
}
}

View File

@@ -0,0 +1,112 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include "dasharo_ec.h"
#include <arch/io.h>
#include <console/dasharo_ec.h>
#include <console/console.h>
#include <timer.h>
// This is the command region for Dasharo EC firmware. It must be
// enabled for LPC in the mainboard.
#define DASHARO_EC_BASE 0x0E00
#define DASHARO_EC_SIZE 256
#define REG_CMD 0
#define REG_RESULT 1
#define REG_DATA 2 // Start of command data
// When command register is 0, command is complete
#define CMD_FINISHED 0
#define RESULT_OK 0
// Print command. Registers are unique for each command
#define CMD_PRINT 4
#define CMD_PRINT_REG_FLAGS 2
#define CMD_PRINT_REG_LEN 3
#define CMD_PRINT_REG_DATA 4
static inline uint8_t dasharo_ec_read(uint8_t addr)
{
return inb(DASHARO_EC_BASE + (uint16_t)addr);
}
static inline void dasharo_ec_write(uint8_t addr, uint8_t data)
{
outb(data, DASHARO_EC_BASE + (uint16_t)addr);
}
void dasharo_ec_init(void)
{
// Clear entire command region
for (int i = 0; i < DASHARO_EC_SIZE; i++)
dasharo_ec_write((uint8_t)i, 0);
}
void dasharo_ec_flush(void)
{
dasharo_ec_write(REG_CMD, CMD_PRINT);
// Wait for command completion, for up to 10 milliseconds, with a
// test period of 1 microsecond
wait_us(10000, dasharo_ec_read(REG_CMD) == CMD_FINISHED);
dasharo_ec_write(CMD_PRINT_REG_LEN, 0);
}
void dasharo_ec_print(uint8_t byte)
{
uint8_t len = dasharo_ec_read(CMD_PRINT_REG_LEN);
dasharo_ec_write(CMD_PRINT_REG_DATA + len, byte);
dasharo_ec_write(CMD_PRINT_REG_LEN, len + 1);
// If we hit the end of the buffer, or were given a newline, flush
if (byte == '\n' || len >= (DASHARO_EC_SIZE - CMD_PRINT_REG_DATA))
dasharo_ec_flush();
}
bool dasharo_ec_cmd(uint8_t cmd, const uint8_t *request_data,
uint8_t request_size, uint8_t *reply_data, uint8_t reply_size)
{
if (request_size > DASHARO_EC_SIZE - REG_DATA ||
reply_size > DASHARO_EC_SIZE - REG_DATA) {
printk(BIOS_ERR, "EC command %d too long - request size %u, reply size %u\n",
cmd, request_size, reply_size);
return false;
}
/* If any data were buffered by dasharo_ec_print(), flush it first */
uint8_t buffered_len = dasharo_ec_read(CMD_PRINT_REG_LEN);
if (buffered_len > 0)
dasharo_ec_flush();
/* Write the data */
uint8_t i;
for (i = 0; i < request_size; ++i)
dasharo_ec_write(REG_DATA + i, request_data[i]);
/* Write the command */
dasharo_ec_write(REG_CMD, cmd);
/* Wait for the command to complete */
bool ret = true;
int elapsed = wait_ms(1000, dasharo_ec_read(REG_CMD) == CMD_FINISHED);
if (elapsed == 0) {
/* Timed out: fail the command, don't attempt to read a reply. */
printk(BIOS_WARNING, "EC command %d timed out - request size %d, reply size %d\n",
cmd, request_size, reply_size);
ret = false;
} else {
/* Read the reply */
for (i = 0; i < reply_size; ++i)
reply_data[i] = dasharo_ec_read(REG_DATA+i);
/* Check the reply status */
ret = (dasharo_ec_read(REG_RESULT) == RESULT_OK);
}
/* Reset the flags and length so we can buffer console prints again */
dasharo_ec_write(CMD_PRINT_REG_FLAGS, 0);
dasharo_ec_write(CMD_PRINT_REG_LEN, 0);
return ret;
}

View File

@@ -0,0 +1,17 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef DASHARO_EC_H
#define DASHARO_EC_H
#include <stdbool.h>
#include <stdint.h>
/*
* Send a command to the EC. request_data/request_size are the request payload,
* request_data can be NULL if request_size is 0. reply_data/reply_size are
* the reply payload, reply_data can be NULL if reply_size is 0.
*/
bool dasharo_ec_cmd(uint8_t cmd, const uint8_t *request_data,
uint8_t request_size, uint8_t *reply_data, uint8_t reply_size);
#endif

View File

@@ -0,0 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <smbios.h>
smbios_wakeup_type smbios_system_wakeup_type(void)
{
// TODO: Read wake source from EC.
return SMBIOS_WAKEUP_TYPE_POWER_SWITCH;
}

View File

@@ -129,6 +129,12 @@ u32 fdt_find_node_by_alias(const void *blob, const char *alias_name,
*/
int fdt_next_node_name(const void *blob, uint32_t node_offset, const char **name);
/* Read memory regions from a flat device-tree. */
size_t fdt_read_memory_regions(const void *blob, struct device_tree_region regions[],
size_t regions_count);
/* Find top of memory from a flat device-tree. */
uint64_t fdt_get_memory_top(const void *blob);
/* Read a flattened device tree into a hierarchical structure which refers to
the contents of the flattened tree in place. Modifying the flat tree
invalidates the unflattened one. */

View File

@@ -584,7 +584,13 @@ enum smbios_processor_upgrade_field {
/* defines for processor family */
#define SMBIOS_PROCESSOR_FAMILY_OTHER 0x01
#define SMBIOS_PROCESSOR_FAMILY_UNKNOWN 0x02
#define SMBIOS_PROCESSOR_FAMILY_INTEL486 0x06
#define SMBIOS_PROCESSOR_FAMILY_PENTIUM_PRO 0x0c
#define SMBIOS_PROCESSOR_FAMILY_XEON 0xb3
#define SMBIOS_PROCESSOR_FAMILY_FROM_FAMILY2 0xfe
/* defines for processor family 2 */
#define SMBIOS_PROCESSOR_FAMILY2_ARMV8 0x101
/* defines for processor characteristics */
#define PROCESSOR_64BIT_CAPABLE (1 << 2)

View File

@@ -160,10 +160,12 @@ ramstage-$(CONFIG_GENERIC_GPIO_LIB) += gpio.c
ramstage-$(CONFIG_GENERIC_UDELAY) += timer.c
ramstage-y += b64_decode.c
ramstage-$(CONFIG_ACPI_NHLT) += nhlt.c
ramstage-$(CONFIG_FLATTENED_DEVICE_TREE) += device_tree.c
ramstage-$(CONFIG_PAYLOAD_FIT_SUPPORT) += fit.c
ramstage-$(CONFIG_PAYLOAD_FIT_SUPPORT) += fit_payload.c
romstage-$(CONFIG_FLATTENED_DEVICE_TREE) += device_tree.c
ramstage-$(CONFIG_FLATTENED_DEVICE_TREE) += device_tree.c
romstage-$(CONFIG_TIMER_QUEUE) += timer_queue.c
ramstage-$(CONFIG_TIMER_QUEUE) += timer_queue.c

View File

@@ -12,9 +12,12 @@
#include <string.h>
#include <stddef.h>
#include <stdlib.h>
#include <limits.h>
#define FDT_PATH_MAX_DEPTH 10 // should be a good enough upper bound
#define FDT_PATH_MAX_LEN 128 // should be a good enough upper bound
#define FDT_MAX_MEMORY_NODES 4 // should be a good enough upper bound
#define FDT_MAX_MEMORY_REGIONS 16 // should be a good enough upper bound
/*
* Functions for picking apart flattened trees.
@@ -503,6 +506,96 @@ void fdt_print_node(const void *blob, uint32_t offset)
print_flat_node(blob, offset, 0);
}
/*
* fdt_read_memory_regions finds memory ranges from a flat device-tree
*
* @params blob address of FDT
* @params regions all regions that are read inside the reg property of
* memory nodes are saved inside this array
* @params regions_count maximum number of entries that can be saved inside
* the regions array.
*
* Returns: Either 0 on error or returns the number of regions put into the regions array.
*/
size_t fdt_read_memory_regions(const void *blob,
struct device_tree_region regions[],
size_t regions_count)
{
u32 node, root, addrcp, sizecp;
u32 nodes[FDT_MAX_MEMORY_NODES] = {0};
size_t region_idx = 0;
size_t node_count = 0;
if (!fdt_is_valid(blob))
return 0;
node = fdt_find_node_by_path(blob, "/memory", &addrcp, &sizecp);
if (node) {
region_idx += fdt_read_reg_prop(blob, node, addrcp, sizecp,
regions, regions_count);
if (region_idx >= regions_count) {
printk(BIOS_WARNING, "FDT: Too many memory regions\n");
goto out;
}
}
root = fdt_find_node_by_path(blob, "/", &addrcp, &sizecp);
node_count = fdt_find_subnodes_by_prefix(blob, root, "memory@",
&addrcp, &sizecp, nodes,
FDT_MAX_MEMORY_NODES);
if (node_count >= FDT_MAX_MEMORY_NODES) {
printk(BIOS_WARNING, "FDT: Too many memory nodes\n");
/* Can still reading the regions for those we got */
}
for (size_t i = 0; i < MIN(node_count, FDT_MAX_MEMORY_NODES); i++) {
region_idx += fdt_read_reg_prop(blob, nodes[i], addrcp, sizecp,
&regions[region_idx],
regions_count - region_idx);
if (region_idx >= regions_count) {
printk(BIOS_WARNING, "FDT: Too many memory regions\n");
goto out;
}
}
out:
for (size_t i = 0; i < MIN(region_idx, regions_count); i++) {
printk(BIOS_DEBUG, "FDT: Memory region [%#llx - %#llx]\n",
regions[i].addr, regions[i].addr + regions[i].size);
}
return region_idx;
}
/*
* fdt_get_memory_top finds top of memory from a flat device-tree
*
* @params blob address of FDT
*
* Returns: Either 0 on error or returns the maximum memory address
*/
uint64_t fdt_get_memory_top(const void *blob)
{
struct device_tree_region regions[FDT_MAX_MEMORY_REGIONS] = {0};
uint64_t top = 0;
uint64_t total = 0;
size_t count;
if (!fdt_is_valid(blob))
return 0;
count = fdt_read_memory_regions(blob, regions, FDT_MAX_MEMORY_REGIONS);
for (size_t i = 0; i < MIN(count, FDT_MAX_MEMORY_REGIONS); i++) {
top = MAX(top, regions[i].addr + regions[i].size);
total += regions[i].size;
}
printk(BIOS_DEBUG, "FDT: Found %u MiB of RAM\n",
(uint32_t)(total / MiB));
return top;
}
/*
* Functions to turn a flattened tree into an unflattened one.
*/
@@ -608,7 +701,7 @@ struct device_tree *fdt_unflatten(const void *blob)
const struct fdt_header *header = (const struct fdt_header *)blob;
tree->header = header;
if (fdt_is_valid(blob))
if (!fdt_is_valid(blob))
return NULL;
uint32_t struct_offset = be32toh(header->structure_offset);

View File

@@ -159,14 +159,15 @@ chip soc/intel/alderlake
end
device ref i2c0 on
chip drivers/i2c/generic
register "hid" = ""10EC5650""
register "hid" = ""RTL5682""
register "name" = ""RT58""
register "desc" = ""Realtek RT5650""
register "desc" = ""Headset Codec""
register "irq_gpio" = "ACPI_GPIO_IRQ_EDGE_BOTH(GPP_A23)"
# Set the jd_src to RT5668_JD1 for jack detection
register "property_count" = "1"
register "property_list[0].type" = "ACPI_DP_TYPE_INTEGER"
register "property_list[0].name" = ""realtek,jd-mode""
register "property_list[0].integer" = "2"
register "property_list[0].name" = ""realtek,jd-src""
register "property_list[0].integer" = "1"
device i2c 1a on end
end
end # I2C0

View File

@@ -63,6 +63,8 @@ static const struct mb_cfg variant_memcfg = {
.ccc_config = 0xff,
},
.LpDdrDqDqsReTraining = 1,
.ect = 1, /* Early Command Training */
.UserBd = BOARD_TYPE_ULT_ULX,

View File

@@ -122,6 +122,11 @@ config BOARD_GOOGLE_OVIS4ES
config BOARD_GOOGLE_REX0
select BOARD_GOOGLE_MODEL_REX
config BOARD_GOOGLE_REX64
select BOARD_GOOGLE_MODEL_REX
select HAVE_X86_64_SUPPORT
select USE_X86_64_SUPPORT
config BOARD_GOOGLE_REX_EC_ISH
select BOARD_GOOGLE_MODEL_REX_EC_ISH
@@ -182,6 +187,7 @@ config MAINBOARD_FAMILY
config MAINBOARD_PART_NUMBER
default "Rex" if BOARD_GOOGLE_REX0
default "Rex64" if BOARD_GOOGLE_REX64
default "Rex_Ec_Ish" if BOARD_GOOGLE_REX_EC_ISH
default "Rex4ES" if BOARD_GOOGLE_REX4ES
default "Rex4ES_Ec_Ish" if BOARD_GOOGLE_REX4ES_EC_ISH

View File

@@ -32,6 +32,9 @@ config BOARD_GOOGLE_REX4ES
config BOARD_GOOGLE_REX4ES_EC_ISH
bool "-> Rex4ES EC ISH"
config BOARD_GOOGLE_REX64
bool "-> Rex 64"
config BOARD_GOOGLE_SCREEBO
bool "-> Screebo"

View File

@@ -1,16 +1,12 @@
## SPDX-License-Identifier: GPL-2.0-only
if BOARD_RAZER_BLADE_STEALTH_KBL
config BOARD_SPECIFIC_OPTIONS
def_bool y
config BOARD_RAZER_BLADE_STEALTH_KBL
bool
select SYSTEM_TYPE_LAPTOP
select BOARD_ROMSIZE_KB_8192
select SUPERIO_ITE_IT8528E
select SOC_INTEL_KABYLAKE
select SOC_INTEL_COMMON_BLOCK_HDA_VERB
select MEMORY_MAPPED_TPM
select MAINBOARD_HAS_TPM2
select MAINBOARD_HAS_LIBGFXINIT
select HAVE_SPD_IN_CBFS
select DRIVERS_I2C_HID
@@ -18,6 +14,31 @@ config BOARD_SPECIFIC_OPTIONS
select HAVE_ACPI_TABLES
select DRIVERS_GENERIC_CBFS_SERIAL
config BOARD_RAZER_BLADE_H2U
select BOARD_RAZER_BLADE_STEALTH_KBL
select MEMORY_MAPPED_TPM
select MAINBOARD_HAS_TPM2
config BOARD_RAZER_BLADE_H3Q
select BOARD_RAZER_BLADE_STEALTH_KBL
if BOARD_RAZER_BLADE_STEALTH_KBL
config VARIANT_DIR
default "h2u" if BOARD_RAZER_BLADE_H2U
default "h3q" if BOARD_RAZER_BLADE_H3Q
config OVERRIDE_DEVICETREE
default "variants/\$(CONFIG_VARIANT_DIR)/overridetree.cb"
config MAINBOARD_FAMILY
string
default "BLADE_STEALTH"
config MAINBOARD_PART_NUMBER
default "H2U: RZ09-01962" if BOARD_RAZER_BLADE_H2U
default "H3Q: RZ09-01963/RZ09-01964" if BOARD_RAZER_BLADE_H3Q
# For now no way to choose the correct the available RAM
config BOARD_RAZER_BLADE_STEALTH_KBL_16GB
bool "16GB RAM (4x MT52L1G32D4PG)"
@@ -27,13 +48,6 @@ config VGA_BIOS_ID
string
default "8086,5916"
config MAINBOARD_FAMILY
string
default "BLADE_STEALTH"
config MAINBOARD_PART_NUMBER
default "H2U"
config MAINBOARD_VERSION
string
default "1.0"

View File

@@ -1,4 +1,7 @@
## SPDX-License-Identifier: GPL-2.0-only
config BOARD_RAZER_BLADE_STEALTH_KBL
bool "Razer Blade Stealth KabyLake (2016)"
config BOARD_RAZER_BLADE_H2U
bool "Razer Blade Stealth KabyLake (2016, RZ09-01962, 12.5\")"
config BOARD_RAZER_BLADE_H3Q
bool "Razer Blade Stealth KabyLake (Mid 2017, RZ09-01963/RZ09-10964, 13.3\")"

View File

@@ -3,6 +3,8 @@
subdirs-y += spd
ramstage-y += ramstage.c
ramstage-y += hda_verb.c
ramstage-y += variants/$(VARIANT_DIR)/hda_verb.c
ramstage-$(CONFIG_MAINBOARD_USE_LIBGFXINIT) += gma-mainboard.ads
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include

View File

@@ -1,5 +1,5 @@
Vendor name: RAZER
Board name: Blade Stealth KabyLake (H2U)
Board name: Blade Stealth KabyLake
Category: laptop
ROM package: SOIC8
ROM protocol: SPI

View File

@@ -126,24 +126,6 @@ chip soc/intel/skylake
register "PcieRpHotPlug[4]" = "1"
register "usb2_ports" = "{
[0] = USB2_PORT_MID(OC1), /* Type-A Port (right) */
[1] = USB2_PORT_MID(OC1), /* Type-A Port (left) */
[2] = USB2_PORT_MID(OC1), /* TODO Unknown. Maybe USBC? */
[3] = USB2_PORT_MID(OC1), /* TODO Unknown. Maybe USBC? */
[4] = USB2_PORT_MID(OC1), /* TODO Unknown. Maybe USBC? */
[5] = USB2_PORT_MID(OC1), /* TODO Unknown. Maybe USBC? */
[6] = USB2_PORT_FLEX(OC2), /* Camera */
[7] = USB2_PORT_FLEX(OC2), /* Keyboard */
[8] = USB2_PORT_FLEX(OC2), /* Touchscreen */
}"
register "usb3_ports" = "{
[0] = USB3_PORT_DEFAULT(OC1), /* Type-A Port (left) */
[1] = USB3_PORT_DEFAULT(OC1), /* Type-A Port (right) */
[5] = USB3_PORT_DEFAULT(OC1), /* TODO Unknown. Maybe USBC? */
}"
# PL1 override 25W
# PL2 override 44W
register "power_limits_config" = "{
@@ -191,9 +173,6 @@ chip soc/intel/skylake
device ref pcie_rp5 on end
device ref pcie_rp9 on end
device ref lpc_espi on
chip drivers/pc80/tpm
device pnp 0c31.0 on end
end
chip superio/ite/it8528e
device pnp 6e.1 off end
device pnp 6e.2 off end

View File

@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <soc/ramstage.h>
#include "gpio.h"
#include <variant/gpio.h>
void mainboard_silicon_init_params(FSP_SIL_UPD *params)
{

View File

@@ -4,7 +4,6 @@
#define MAINBOARD_SPD_H
#include <gpio.h>
#include "../gpio.h"
void mainboard_fill_dq_map_data(void *dq_map_ptr);
void mainboard_fill_dqs_map_data(void *dqs_map_ptr);

View File

@@ -0,0 +1,9 @@
Vendor name: RAZER
Board name: Blade Stealth KabyLake (H2U: RZ09-01962)
Board URL: https://mysupport.razer.com/app/answers/detail/a_id/3698/
Category: laptop
ROM package: SOIC8
ROM protocol: SPI
ROM socketed: n
Flashrom support: y
Release year: 2016

View File

@@ -20,7 +20,7 @@ const u32 cim_verb_data[] = {
AZALIA_PIN_CFG(0, 0x1f, 0x411111f0),
AZALIA_PIN_CFG(0, 0x21, 0x03211020),
/* Intel, KabylakeHDMI */
/* Intel, Kaby Lake HDMI */
0x8086280b, /* Vendor ID */
0x80860101, /* Subsystem ID */
4, /* Number of entries */

View File

@@ -0,0 +1,31 @@
## SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/skylake
device domain 0 on
device ref south_xhci on
register "usb2_ports" = "{
[0] = USB2_PORT_MID(OC1), /* Type-A Port (right) */
[1] = USB2_PORT_MID(OC1), /* Type-A Port (left) */
[2] = USB2_PORT_MID(OC1), /* TODO Unknown. Maybe USBC? */
[3] = USB2_PORT_MID(OC1), /* TODO Unknown. Maybe USBC? */
[4] = USB2_PORT_MID(OC1), /* TODO Unknown. Maybe USBC? */
[5] = USB2_PORT_MID(OC1), /* TODO Unknown. Maybe USBC? */
[6] = USB2_PORT_FLEX(OC2), /* Camera */
[7] = USB2_PORT_FLEX(OC2), /* Keyboard */
[8] = USB2_PORT_FLEX(OC2), /* Touchscreen */
}"
register "usb3_ports" = "{
[0] = USB3_PORT_DEFAULT(OC1), /* Type-A Port (left) */
[1] = USB3_PORT_DEFAULT(OC1), /* Type-A Port (right) */
[5] = USB3_PORT_DEFAULT(OC1), /* TODO Unknown. Maybe USBC? */
}"
end
device ref lpc_espi on
chip drivers/pc80/tpm
device pnp 0c31.0 on end
end
end
end
end

View File

@@ -0,0 +1,9 @@
Vendor name: RAZER
Board name: Blade Stealth KabyLake (H3Q: RZ09-01963 / RZ09-01964)
Board URL: https://mysupport.razer.com/app/answers/detail/a_id/3694/
Category: laptop
ROM package: SOIC8
ROM protocol: SPI
ROM socketed: n
Flashrom support: y
Release year: 2017

View File

@@ -0,0 +1,34 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <device/azalia_device.h>
const u32 cim_verb_data[] = {
/* Realtek, ALC298 */
0x10ec0298, /* Vendor ID */
0x1a586753, /* Subsystem ID */
12, /* Number of entries */
AZALIA_SUBVENDOR(0, 0x1a586753),
AZALIA_PIN_CFG(0, 0x12, 0x90a60130),
AZALIA_PIN_CFG(0, 0x13, 0x40000000),
AZALIA_PIN_CFG(0, 0x14, 0x90170110),
AZALIA_PIN_CFG(0, 0x17, 0x411111f0),
AZALIA_PIN_CFG(0, 0x18, 0x04a11040),
AZALIA_PIN_CFG(0, 0x19, 0x411111f0),
AZALIA_PIN_CFG(0, 0x1a, 0x411111f0),
AZALIA_PIN_CFG(0, 0x1d, 0x4075812d),
AZALIA_PIN_CFG(0, 0x1e, 0x411111f0),
AZALIA_PIN_CFG(0, 0x1f, 0x411111f0),
AZALIA_PIN_CFG(0, 0x21, 0x04211020),
/* Intel, Kaby Lake HDMI */
0x8086280b, /* Vendor ID */
0x80860101, /* Subsystem ID */
4, /* Number of entries */
AZALIA_SUBVENDOR(2, 0x80860101),
AZALIA_PIN_CFG(2, 0x05, 0x18560010),
AZALIA_PIN_CFG(2, 0x06, 0x18560010),
AZALIA_PIN_CFG(2, 0x07, 0x18560010),
};
const u32 pc_beep_verbs[] = {};
AZALIA_ARRAY_SIZES;

View File

@@ -0,0 +1,200 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef CFG_GPIO_H
#define CFG_GPIO_H
#include <gpio.h>
/* Pad configuration was generated automatically using intelp2m utility */
static const struct pad_config gpio_table[] = {
/* ------- GPIO Community 0 ------- */
/* ------- GPIO Group GPP_A ------- */
PAD_CFG_NF(GPP_A0, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_A1, NATIVE, DEEP, NF1),
PAD_CFG_NF(GPP_A2, NATIVE, DEEP, NF1),
PAD_CFG_NF(GPP_A3, NATIVE, DEEP, NF1),
PAD_CFG_NF(GPP_A4, NATIVE, DEEP, NF1),
PAD_CFG_NF(GPP_A5, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_A6, NONE, DEEP, NF1),
PAD_CFG_GPI_TRIG_OWN(GPP_A7, NONE, PLTRST, OFF, ACPI),
PAD_CFG_NF(GPP_A8, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_A9, DN_20K, DEEP, NF1),
PAD_CFG_NF(GPP_A10, DN_20K, DEEP, NF1),
PAD_CFG_GPO(GPP_A11, 0, DEEP),
PAD_NC(GPP_A12, NONE),
PAD_CFG_NF(GPP_A13, NONE, DEEP, NF1),
PAD_CFG_GPO(GPP_A14, 0, DEEP),
PAD_CFG_GPO(GPP_A15, 0, DEEP),
PAD_CFG_GPO(GPP_A16, 0, DEEP),
PAD_CFG_GPO(GPP_A17, 0, DEEP),
PAD_CFG_GPO(GPP_A18, 0, DEEP),
PAD_CFG_GPO(GPP_A19, 0, DEEP),
PAD_CFG_GPO(GPP_A20, 0, DEEP),
PAD_CFG_GPO(GPP_A21, 0, DEEP),
PAD_CFG_GPO(GPP_A22, 0, DEEP),
PAD_CFG_GPO(GPP_A23, 0, DEEP),
/* ------- GPIO Group GPP_B ------- */
PAD_CFG_GPO(GPP_B0, 0, DEEP),
PAD_CFG_GPO(GPP_B1, 0, DEEP),
PAD_CFG_GPO(GPP_B2, 0, DEEP),
PAD_CFG_GPO(GPP_B3, 0, DEEP),
PAD_CFG_GPO(GPP_B4, 0, DEEP),
PAD_CFG_NF(GPP_B5, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_B6, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_B7, NONE, DEEP, NF1),
PAD_CFG_GPO(GPP_B8, 0, DEEP),
PAD_CFG_NF(GPP_B9, NONE, DEEP, NF1),
PAD_CFG_GPO(GPP_B10, 0, DEEP),
PAD_CFG_NF(GPP_B11, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_B12, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_B13, NONE, DEEP, NF1),
PAD_CFG_TERM_GPO(GPP_B14, 1, DN_20K, DEEP),
PAD_CFG_GPO(GPP_B15, 0, DEEP),
PAD_CFG_GPO(GPP_B16, 0, DEEP),
PAD_CFG_GPO(GPP_B17, 0, DEEP),
PAD_CFG_GPI_SCI(GPP_B18, UP_20K, PLTRST, LEVEL, INVERT),
PAD_NC(GPP_B19, NONE),
PAD_CFG_NF(GPP_B20, DN_20K, DEEP, NF1),
PAD_CFG_NF(GPP_B21, DN_20K, DEEP, NF1),
PAD_CFG_NF(GPP_B22, DN_20K, DEEP, NF1),
PAD_CFG_TERM_GPO(GPP_B23, 1, DN_20K, DEEP),
/* ------- GPIO Community 1 ------- */
/* ------- GPIO Group GPP_C ------- */
PAD_CFG_NF(GPP_C0, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_C1, DN_20K, DEEP, NF1),
PAD_CFG_TERM_GPO(GPP_C2, 1, DN_20K, DEEP),
PAD_CFG_NF(GPP_C3, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_C4, NONE, DEEP, NF1),
PAD_CFG_GPI_APIC_LOW(GPP_C5, DN_20K, DEEP),
/* GPP_C6 - RESERVED */
/* GPP_C7 - RESERVED */
PAD_CFG_NF(GPP_C8, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_C9, NONE, DEEP, NF1),
PAD_CFG_GPO(GPP_C10, 0, DEEP),
PAD_CFG_GPO(GPP_C11, 0, DEEP),
PAD_CFG_GPO(GPP_C12, 0, DEEP),
PAD_CFG_GPO(GPP_C13, 0, DEEP),
PAD_CFG_GPO(GPP_C14, 0, DEEP),
PAD_CFG_GPO(GPP_C15, 0, DEEP),
PAD_CFG_NF(GPP_C16, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_C17, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_C18, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_C19, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_C20, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_C21, NONE, DEEP, NF1),
PAD_CFG_GPO(GPP_C22, 0, DEEP),
PAD_CFG_GPO(GPP_C23, 0, DEEP),
/* ------- GPIO Group GPP_D ------- */
PAD_CFG_GPO(GPP_D0, 0, DEEP),
PAD_CFG_GPO(GPP_D1, 0, DEEP),
PAD_CFG_GPO(GPP_D2, 0, DEEP),
PAD_CFG_GPO(GPP_D3, 0, DEEP),
PAD_CFG_GPO(GPP_D4, 0, DEEP),
PAD_CFG_GPO(GPP_D5, 0, DEEP),
PAD_CFG_GPO(GPP_D6, 0, DEEP),
PAD_CFG_GPO(GPP_D7, 0, DEEP),
PAD_CFG_GPO(GPP_D8, 0, DEEP),
PAD_CFG_GPO(GPP_D9, 0, DEEP),
PAD_CFG_GPO(GPP_D10, 0, DEEP),
PAD_CFG_GPO(GPP_D11, 0, DEEP),
PAD_CFG_GPO(GPP_D12, 0, DEEP),
PAD_CFG_GPO(GPP_D13, 0, DEEP),
PAD_CFG_GPO(GPP_D14, 0, DEEP),
PAD_CFG_GPO(GPP_D15, 0, DEEP),
PAD_CFG_GPO(GPP_D16, 0, DEEP),
PAD_CFG_GPO(GPP_D17, 0, DEEP),
PAD_CFG_GPO(GPP_D18, 0, DEEP),
PAD_CFG_GPO(GPP_D19, 0, DEEP),
PAD_CFG_GPO(GPP_D20, 0, DEEP),
PAD_CFG_GPO(GPP_D21, 0, DEEP),
PAD_CFG_GPO(GPP_D22, 0, DEEP),
PAD_CFG_GPO(GPP_D23, 0, DEEP),
/* ------- GPIO Group GPP_E ------- */
PAD_CFG_GPO(GPP_E0, 0, DEEP),
PAD_CFG_GPO(GPP_E1, 0, DEEP),
PAD_CFG_NF(GPP_E2, NONE, DEEP, NF1),
PAD_CFG_GPO(GPP_E3, 0, DEEP),
PAD_CFG_GPO(GPP_E4, 0, DEEP),
PAD_CFG_GPI_SCI(GPP_E5, NONE, PLTRST, EDGE_SINGLE, INVERT),
PAD_CFG_GPO(GPP_E6, 0, DEEP),
PAD_CFG_GPI_DUAL_ROUTE(GPP_E7, NONE, PLTRST, LEVEL, NONE, IOAPIC, SCI),
PAD_CFG_NF(GPP_E8, NONE, DEEP, NF1),
PAD_CFG_GPO(GPP_E9, 0, DEEP),
PAD_CFG_TERM_GPO(GPP_E10, 1, DN_20K, DEEP),
PAD_CFG_TERM_GPO(GPP_E11, 1, DN_20K, DEEP),
PAD_NC(GPP_E12, NONE),
PAD_CFG_NF(GPP_E13, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_E14, NONE, DEEP, NF1),
PAD_CFG_GPI_SMI(GPP_E15, NONE, DEEP, EDGE_SINGLE, INVERT),
PAD_CFG_GPI_SCI(GPP_E16, NONE, PLTRST, LEVEL, INVERT),
PAD_CFG_NF(GPP_E17, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_E18, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_E19, DN_20K, DEEP, NF1),
PAD_CFG_NF(GPP_E20, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_E21, DN_20K, DEEP, NF1),
PAD_CFG_GPO(GPP_E22, 0, DEEP),
PAD_CFG_TERM_GPO(GPP_E23, 0, DN_20K, PLTRST),
/* ------- GPIO Community 2 ------- */
/* -------- GPIO Group GPD -------- */
PAD_CFG_NF(GPD0, NONE, PWROK, NF1),
PAD_CFG_NF(GPD1, NONE, PWROK, NF1),
PAD_CFG_NF(GPD2, NONE, PWROK, NF1),
PAD_CFG_NF(GPD3, UP_20K, PWROK, NF1),
PAD_CFG_NF(GPD4, NONE, PWROK, NF1),
PAD_CFG_NF(GPD5, NONE, PWROK, NF1),
PAD_CFG_NF(GPD6, NONE, PWROK, NF1),
PAD_CFG_GPO(GPD7, 0, DEEP),
PAD_NC(GPD8, NONE),
PAD_CFG_NF(GPD9, NONE, PWROK, NF1),
PAD_CFG_NF(GPD10, NONE, PWROK, NF1),
PAD_CFG_NF(GPD11, NONE, PWROK, NF1),
/* ------- GPIO Community 3 ------- */
/* ------- GPIO Group GPP_F ------- */
PAD_CFG_GPO(GPP_F0, 0, DEEP),
PAD_CFG_GPO(GPP_F1, 0, DEEP),
PAD_CFG_GPO(GPP_F2, 0, DEEP),
PAD_CFG_GPO(GPP_F3, 0, DEEP),
PAD_CFG_GPO(GPP_F4, 0, DEEP),
PAD_CFG_GPO(GPP_F5, 0, DEEP),
PAD_CFG_GPO(GPP_F6, 0, DEEP),
PAD_CFG_GPO(GPP_F7, 0, DEEP),
PAD_CFG_NF(GPP_F8, NONE, DEEP, NF1),
PAD_CFG_NF(GPP_F9, NONE, DEEP, NF1),
PAD_CFG_GPO(GPP_F10, 0, DEEP),
PAD_CFG_GPO(GPP_F11, 0, DEEP),
PAD_CFG_GPO(GPP_F12, 0, DEEP),
PAD_CFG_GPI_TRIG_OWN(GPP_F13, NONE, DEEP, OFF, ACPI),
PAD_CFG_GPI_TRIG_OWN(GPP_F14, NONE, DEEP, OFF, ACPI),
PAD_CFG_GPI_TRIG_OWN(GPP_F15, NONE, DEEP, OFF, ACPI),
PAD_CFG_NF(GPP_F16, NONE, DEEP, NF1),
PAD_CFG_GPO(GPP_F17, 0, DEEP),
PAD_CFG_GPO(GPP_F18, 0, DEEP),
PAD_CFG_GPO(GPP_F19, 0, DEEP),
PAD_CFG_GPO(GPP_F20, 0, DEEP),
PAD_CFG_GPO(GPP_F21, 0, DEEP),
PAD_CFG_GPO(GPP_F22, 0, DEEP),
PAD_CFG_GPO(GPP_F23, 0, DEEP),
/* ------- GPIO Group GPP_G ------- */
PAD_CFG_GPO(GPP_G0, 0, DEEP),
PAD_CFG_GPO(GPP_G1, 0, DEEP),
PAD_CFG_GPO(GPP_G2, 0, DEEP),
PAD_CFG_GPO(GPP_G3, 0, DEEP),
PAD_CFG_GPO(GPP_G4, 0, DEEP),
PAD_CFG_GPO(GPP_G5, 0, DEEP),
PAD_CFG_GPO(GPP_G6, 0, DEEP),
PAD_CFG_GPO(GPP_G7, 0, DEEP),
};
#endif /* CFG_GPIO_H */

View File

@@ -0,0 +1,23 @@
## SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/skylake
device domain 0 on
device ref south_xhci on
# NOTE: TYPE-C port is controlled by Intel Thunderbolt
register "usb2_ports" = "{
[0] = USB2_PORT_MID(OC0), /* Type-A Port (right) */
[1] = USB2_PORT_MID(OC0), /* Type-A Port (left) */
[5] = USB2_PORT_SHORT(OC2), /* M.2 Slot (Bluetooth) */
[6] = USB2_PORT_FLEX(OC3), /* Camera */
[7] = USB2_PORT_FLEX(OC3), /* Keyboard */
[8] = USB2_PORT_FLEX(OC_SKIP), /* Touchscreen */
}"
register "usb3_ports" = "{
[0] = USB3_PORT_DEFAULT(OC0), /* Type-A Port (left) */
[1] = USB3_PORT_DEFAULT(OC0), /* Type-A Port (right) */
}"
end
end
end

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
register "common_soc_config" = "{
// Touchpad I2C bus

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
# Serial I/O
register "SerialIoDevMode" = "{

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
# Serial I/O
register "SerialIoDevMode" = "{

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/alderlake
register "common_soc_config" = "{
// Touchpad I2C bus

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/alderlake
register "power_limits_config[ADL_P_282_442_482_28W_CORE]" = "{
.tdp_pl1_override = 20,

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/alderlake
register "power_limits_config[ADL_P_282_442_482_28W_CORE]" = "{
.tdp_pl1_override = 28,

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/alderlake
# FIVR configuration
# Read EXT_RAIL_CONFIG to determine bitmaps

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/alderlake
# FIVR configuration
# Read EXT_RAIL_CONFIG to determine bitmaps

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/alderlake
register "power_limits_config[ADL_P_142_242_282_15W_CORE]" = "{
.tdp_pl1_override = 15,

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/alderlake
register "power_limits_config[ADL_P_642_682_45W_CORE]" = "{
.tdp_pl1_override = 45,

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/alderlake
register "power_limits_config[ADL_P_642_682_45W_CORE]" = "{
.tdp_pl1_override = 45,

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
register "common_soc_config" = "{
// Touchpad I2C bus

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
register "common_soc_config" = "{
/* Touchpad */

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
device domain 0 on
subsystemid 0x1558 0x1404 inherit

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
device domain 0 on
subsystemid 0x1558 0x1403 inherit

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
device domain 0 on
subsystemid 0x1558 0x1401 inherit

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
register "common_soc_config" = "{
// Touchpad I2C bus

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
# Serial I/O
register "SerialIoDevMode" = "{

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
# Serial I/O
register "SerialIoDevMode" = "{

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/skylake
# Send an extra VR mailbox command for the PS4 exit issue
register "SendVrMbxCmd" = "2"

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/skylake
device domain 0 on
subsystemid 0x1558 0x1303 inherit

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/skylake
device domain 0 on
subsystemid 0x1558 0x1413 inherit

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/skylake
device domain 0 on
subsystemid 0x1558 0x1313 inherit

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
register "common_soc_config" = "{
// Touchpad I2C bus

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
register "common_soc_config" = "{
// Touchpad I2C bus

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
device domain 0 on
subsystemid 0x1558 0x50d3 inherit

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
device domain 0 on
subsystemid 0x1558 0x65e5 inherit

View File

@@ -4,7 +4,7 @@ config BOARD_SYSTEM76_ADDW3
bool "addw3"
config BOARD_SYSTEM76_ADDW4
bool "addw3"
bool "addw4"
config BOARD_SYSTEM76_BONW15
bool "bonw15"

View File

@@ -10,5 +10,6 @@ romstage-y += variants/$(VARIANT_DIR)/romstage.c
ramstage-y += ramstage.c
ramstage-y += variants/$(VARIANT_DIR)/hda_verb.c
ramstage-y += variants/$(VARIANT_DIR)/gpio.c
ramstage-$(CONFIG_DRIVERS_I2C_TAS5825M) += variants/$(VARIANT_DIR)/tas5825m.c
SPD_SOURCES = samsung-M425R1GB4BB0-CQKOD

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/alderlake
register "common_soc_config" = "{
// Touchpad I2C bus

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/alderlake
# Support 5600 MT/s memory
register "max_dram_speed_mts" = "5600"

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/alderlake
# Support 5600 MT/s memory
register "max_dram_speed_mts" = "5600"

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/alderlake
register "power_limits_config[RPL_P_682_482_282_28W_CORE]" = "{
.tdp_pl1_override = 20,

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/alderlake
register "power_limits_config[RPL_P_682_642_482_45W_CORE]" = "{
.tdp_pl1_override = 45,

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/alderlake
device domain 0 on
subsystemid 0x1558 0x5630 inherit

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/alderlake
register "power_limits_config[RPL_P_282_242_142_15W_CORE]" = "{
.tdp_pl1_override = 15,

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/alderlake
device domain 0 on
subsystemid 0x1558 0x66a2 inherit

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/alderlake
# Support 5600 MT/s memory
register "max_dram_speed_mts" = "5600"

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/tigerlake
register "common_soc_config" = "{
// Touchpad I2C bus

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/tigerlake
device domain 0 on
subsystemid 0x1558 0x5015 inherit

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/tigerlake
device domain 0 on
subsystemid 0x1558 0x50e1 inherit

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/tigerlake
# Power limits
register "power_limits_config[POWER_LIMITS_H_8_CORE]" = "{

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/tigerlake
register "common_soc_config" = "{
// Touchpad I2C bus

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/tigerlake
# Power limits
register "power_limits_config[POWER_LIMITS_U_4_CORE]" = "{

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/tigerlake
# Power limits
register "power_limits_config[POWER_LIMITS_U_4_CORE]" = "{

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/tigerlake
# Power limits
register "power_limits_config[POWER_LIMITS_U_4_CORE]" = "{

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
# Lock Down
register "common_soc_config" = "{

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
device domain 0 on
subsystemid 0x1558 0x1325 inherit

View File

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
chip soc/intel/cannonlake
device domain 0 on
subsystemid 0x1558 0x1323 inherit

View File

@@ -373,7 +373,7 @@ bool generate_pin_irq_map(void)
if (!cached_entries)
return false;
pin_irq_map = calloc(MAX_SLOTS, sizeof(struct slot_pin_irq_map) * PCI_INT_MAX);
pin_irq_map = calloc(MAX_SLOTS * PCI_INT_MAX, sizeof(struct slot_pin_irq_map));
pirq_map.type = PIRQ_GSI;
legacy_pirq_routing = lpc_get_pic_pirq_routing(&pirq_routes);

View File

@@ -247,6 +247,7 @@ struct soc_intel_meteorlake_config {
uint16_t sata_ports_dito_val[8];
/* Audio related */
uint8_t pch_hda_audio_link_hda_enable;
uint8_t pch_hda_dsp_enable;
bool pch_hda_sdi_enable[MAX_HD_AUDIO_SDI_LINKS];

View File

@@ -476,6 +476,8 @@ static void fill_fsps_xhci_params(FSP_S_CONFIG *s_cfg,
s_cfg->Usb2OverCurrentPin[i] = config->usb2_ports[i].ocpin;
else
s_cfg->Usb2OverCurrentPin[i] = OC_SKIP;
s_cfg->PortResetMessageEnable[i] = config->usb2_ports[i].type_c;
}
max_port = get_max_usb30_port();

View File

@@ -31,6 +31,7 @@ struct usb2_port_config {
uint8_t tx_emp_enable;
uint8_t pre_emp_bias;
uint8_t pre_emp_bit;
uint8_t type_c;
};
/* USB Overcurrent pins definition */
@@ -112,6 +113,7 @@ enum {
.tx_emp_enable = USB2_PRE_EMP_ON, \
.pre_emp_bias = USB2_BIAS_56P3MV, \
.pre_emp_bit = USB2_HALF_BIT_PRE_EMP, \
.type_c = 1, \
}
struct usb3_port_config {

View File

@@ -288,17 +288,11 @@ static void fill_fspm_audio_params(FSP_M_CONFIG *m_cfg,
m_cfg->PchHdaIDispLinkTmode = config->pch_hda_idisp_link_tmode;
m_cfg->PchHdaIDispLinkFrequency = config->pch_hda_idisp_link_frequency;
m_cfg->PchHdaIDispCodecDisconnect = !config->pch_hda_idisp_codec_enable;
m_cfg->PchHdaAudioLinkHdaEnable = config->pch_hda_audio_link_hda_enable;
for (int i = 0; i < MAX_HD_AUDIO_SDI_LINKS; i++)
m_cfg->PchHdaSdiEnable[i] = config->pch_hda_sdi_enable[i];
/*
* All the PchHdaAudioLink{Hda|Dmic|Ssp|Sndw}Enable UPDs are used by FSP only to
* configure GPIO pads for audio. Mainboard is expected to perform all GPIO
* configuration in coreboot and hence these UPDs are set to 0 to skip FSP GPIO
* configuration for audio pads.
*/
m_cfg->PchHdaAudioLinkHdaEnable = 0;
memset(m_cfg->PchHdaAudioLinkDmicEnable, 0, sizeof(m_cfg->PchHdaAudioLinkDmicEnable));
memset(m_cfg->PchHdaAudioLinkSspEnable, 0, sizeof(m_cfg->PchHdaAudioLinkSspEnable));
memset(m_cfg->PchHdaAudioLinkSndwEnable, 0, sizeof(m_cfg->PchHdaAudioLinkSndwEnable));

View File

@@ -0,0 +1,68 @@
/** @file
Header file for Firmware Version Information
@copyright
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License which accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _FIRMWARE_VERSION_INFO_HOB_H_
#define _FIRMWARE_VERSION_INFO_HOB_H_
#include <Uefi/UefiMultiPhase.h>
#include <Pi/PiBootMode.h>
#include <Pi/PiHob.h>
#pragma pack(1)
///
/// Firmware Version Structure
///
typedef struct {
UINT8 MajorVersion;
UINT8 MinorVersion;
UINT8 Revision;
UINT16 BuildNumber;
} FIRMWARE_VERSION;
///
/// Firmware Version Information Structure
///
typedef struct {
UINT8 ComponentNameIndex; ///< Offset 0 Index of Component Name
UINT8 VersionStringIndex; ///< Offset 1 Index of Version String
FIRMWARE_VERSION Version; ///< Offset 2-6 Firmware version
} FIRMWARE_VERSION_INFO;
#ifndef __SMBIOS_STANDARD_H__
///
/// The Smbios structure header.
///
typedef struct {
UINT8 Type;
UINT8 Length;
UINT16 Handle;
} SMBIOS_STRUCTURE;
#endif
///
/// Firmware Version Information HOB Structure
///
typedef struct {
EFI_HOB_GUID_TYPE Header; ///< Offset 0-23 The header of FVI HOB
SMBIOS_STRUCTURE SmbiosData; ///< Offset 24-27 The SMBIOS header of FVI HOB
UINT8 Count; ///< Offset 28 Number of FVI elements included.
///
/// FIRMWARE_VERSION_INFO structures followed by the null terminated string buffer
///
} FIRMWARE_VERSION_INFO_HOB;
#pragma pack()
#endif // _FIRMWARE_VERSION_INFO_HOB_H_

Some files were not shown because too many files have changed in this diff Show More