Xiang Wang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32394
Change subject: riscv: add support to boot linux kernel binary using opensbi
......................................................................
riscv: add support to boot linux kernel binary using opensbi
Change-Id: I2a178595bd2aa2e1f114cbc69e8eadd46955b54d
Signed-off-by: Xiang Wang <wxjstz(a)126.com>
---
M payloads/Kconfig
M payloads/external/Makefile.inc
M src/arch/riscv/Makefile.inc
M src/arch/riscv/boot.c
M src/soc/sifive/fu540/Kconfig
5 files changed, 49 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/94/32394/1
diff --git a/payloads/Kconfig b/payloads/Kconfig
index d0f8a44..4cf9d1e 100644
--- a/payloads/Kconfig
+++ b/payloads/Kconfig
@@ -28,6 +28,18 @@
You will be able to specify the location and file name of the
payload image later.
+config PAYLOAD_RISCV_LINUX_BINARY
+ bool "An linux binary payload"
+ depends on ARCH_RISCV
+ help
+ Select this option if you have a payload image (an binary file)
+ which coreboot should run as soon as the basic hardware
+ initialization is completed. This image will be used as the
+ payload of opensbi and will be started by coreboot.
+
+ You will be able to specify the location and file name of the
+ payload image later.
+
config PAYLOAD_FIT
bool "A FIT payload"
depends on ARCH_ARM64
@@ -57,9 +69,10 @@
config PAYLOAD_FILE
string "Payload path and filename"
- depends on PAYLOAD_ELF || PAYLOAD_FIT
+ depends on PAYLOAD_ELF || PAYLOAD_FIT || PAYLOAD_RISCV_LINUX_BINARY
default "payload.elf" if PAYLOAD_ELF
default "uImage" if PAYLOAD_FIT
+ default "payload.bin" if PAYLOAD_RISCV_LINUX_BINARY
help
The path and filename of the ELF executable file to use as payload.
diff --git a/payloads/external/Makefile.inc b/payloads/external/Makefile.inc
index 5f9d800..3b29b41 100644
--- a/payloads/external/Makefile.inc
+++ b/payloads/external/Makefile.inc
@@ -48,7 +48,11 @@
endif
cbfs-files-y += $(CONFIG_CBFS_PREFIX)/payload
+ifeq ($(CONFIG_PAYLOAD_RISCV_LINUX_BINARY),y)
+$(CONFIG_CBFS_PREFIX)/payload-file := $(obj)/opensbi.elf
+else
$(CONFIG_CBFS_PREFIX)/payload-file := $(CONFIG_PAYLOAD_FILE)
+endif
ifeq ($(CONFIG_PAYLOAD_IS_FLAT_BINARY),y)
$(CONFIG_CBFS_PREFIX)/payload-type := flat-binary
else
diff --git a/src/arch/riscv/Makefile.inc b/src/arch/riscv/Makefile.inc
index d5f6295..d4d362b 100644
--- a/src/arch/riscv/Makefile.inc
+++ b/src/arch/riscv/Makefile.inc
@@ -174,4 +174,27 @@
endif #CONFIG_ARCH_RISCV_RV32
endif #CONFIG_ARCH_RAMSTAGE_RISCV
+
+ifeq ($(CONFIG_PAYLOAD_RISCV_LINUX_BINARY),y)
+
+OPENSBI := $(obj)/opensbi.elf
+OPENSBI_SOURCE := $(top)/payloads/external/opensbi
+OPENSBI_BUILD := $(abspath $(obj)/payloads/external/opensbi)
+OPENSBI_TARGET := $(OPENSBI_BUILD)/platform/$(CONFIG_OPENSBI_PLATFORM)/firmware/fw_payload.elf
+
+$(OPENSBI):$(obj)/build.h
+ printf " MAKE $(subst $(obj)/,,$(@))\n"
+ mkdir -p $(OPENSBI_BUILD)
+ $(MAKE) \
+ -C $(OPENSBI_SOURCE) \
+ CROSS_COMPILE=riscv64-elf- \
+ PLATFORM=$(CONFIG_OPENSBI_PLATFORM) \
+ O=$(OPENSBI_BUILD) \
+ FW_PAYLOAD_PATH=$(abspath $(CONFIG_PAYLOAD_FILE))
+ cp $(OPENSBI_TARGET) $(abspath $@)
+
+.PHONY: $(OPENSBI)
+
+endif #CONFIG_PAYLOAD_RISCV_LINUX_BINARY
+
endif #CONFIG_ARCH_RISCV
diff --git a/src/arch/riscv/boot.c b/src/arch/riscv/boot.c
index 535067e..9998255 100644
--- a/src/arch/riscv/boot.c
+++ b/src/arch/riscv/boot.c
@@ -49,7 +49,11 @@
fdt = HLS()->fdt;
if (ENV_RAMSTAGE && prog_type(prog) == PROG_PAYLOAD) {
+#if CONFIG(PAYLOAD_RISCV_LINUX_BINARY)
+ run_payload(prog, fdt, RISCV_PAYLOAD_MODE_M);
+#else
run_payload(prog, fdt, RISCV_PAYLOAD_MODE_S);
+#endif
return;
}
diff --git a/src/soc/sifive/fu540/Kconfig b/src/soc/sifive/fu540/Kconfig
index 6ebde33..2e88150 100644
--- a/src/soc/sifive/fu540/Kconfig
+++ b/src/soc/sifive/fu540/Kconfig
@@ -49,4 +49,8 @@
int
default 0
+config OPENSBI_PLATFORM
+ string
+ default "sifive/fu540"
+
endif
--
To view, visit https://review.coreboot.org/c/coreboot/+/32394
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2a178595bd2aa2e1f114cbc69e8eadd46955b54d
Gerrit-Change-Number: 32394
Gerrit-PatchSet: 1
Gerrit-Owner: Xiang Wang <wxjstz(a)126.com>
Gerrit-MessageType: newchange
Hello nsekar(a)codeaurora.org,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/32271
to review the following change.
Change subject: TEMP: NOT FOR REVIEW: Mistral: Add board id detection using TPM
......................................................................
TEMP: NOT FOR REVIEW: Mistral: Add board id detection using TPM
This patch adds support to select the board id
based on the TPM availability.
Change-Id: Ib75d51a21a6129e3650e2af24ff85f37a462591b
Signed-off-by: Nitheesh Sekar <nsekar(a)codeaurora.org>
---
M src/mainboard/google/mistral/boardid.c
1 file changed, 16 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/32271/1
diff --git a/src/mainboard/google/mistral/boardid.c b/src/mainboard/google/mistral/boardid.c
index 8258ac3..9a0d309 100644
--- a/src/mainboard/google/mistral/boardid.c
+++ b/src/mainboard/google/mistral/boardid.c
@@ -32,7 +32,22 @@
[1] = GPIO(106),
[0] = GPIO(105)};
- bid = gpio_binary_first_base3_value(pins, ARRAY_SIZE(pins));
+ if (is_tpm_detected() == 0) {
+ bid = 25; /* Assign 25 for EVB boards */
+ printk(BIOS_DEBUG, "EVB Board ID: %d\n", bid);
+ } else {
+ bid = 0; /* Assign 0 for Proto boards */
+
+ /* The board id assigned for Proto boards is 0.
+ * Since gpios are not wired in the initial phase,
+ * we will get 0 whihch is a coincidence.
+ * To make sure it starts working, after gpios are
+ * wired, reassign the value read from gpios to id.
+ */
+ bid = gpio_binary_first_base3_value(pins, ARRAY_SIZE(pins));
+
+ printk(BIOS_DEBUG, "Proto Board ID: %d\n", bid);
+ }
return bid;
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/32271
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib75d51a21a6129e3650e2af24ff85f37a462591b
Gerrit-Change-Number: 32271
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: nsekar(a)codeaurora.org
Gerrit-MessageType: newchange
Sumeet R Pawnikar has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33147
Change subject: mb/google/hatch/variants/baseboard: Set PCH Thermal Trip value to 75 degree C
......................................................................
mb/google/hatch/variants/baseboard: Set PCH Thermal Trip value to 75 degree C
PMC logic shuts down the PCH thermal sensor when CPU is in a C-state and
DTS Temp <= Low Temp Threshold (LTT) in case of Dynamic Thermal Shutdown
when S0ix is enabled.
BUG=133345634
BRANCH=None
TEST=Verified Thermal Device (B0: D20: F2) TSPM offset 0x1c [LTT (8:0)]
value is 0xFA on Hatch.
Change-Id: Ib20fae04080b28c6105e5a187cc5d7a55b48d709
Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar(a)intel.com>
---
M src/mainboard/google/hatch/variants/baseboard/devicetree.cb
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/47/33147/1
diff --git a/src/mainboard/google/hatch/variants/baseboard/devicetree.cb b/src/mainboard/google/hatch/variants/baseboard/devicetree.cb
index 9d10cac..e5f4651 100644
--- a/src/mainboard/google/hatch/variants/baseboard/devicetree.cb
+++ b/src/mainboard/google/hatch/variants/baseboard/devicetree.cb
@@ -47,6 +47,9 @@
# Unlock GPIO pads
register "PchUnlockGpioPads" = "1"
+ # PCH Trip Temperature in degree C
+ register "pch_trip_temp" = "75"
+
register "PchPmSlpS3MinAssert" = "2" # 50ms
register "PchPmSlpS4MinAssert" = "1" # 1s
register "PchPmSlpSusMinAssert" = "1" # 500ms
--
To view, visit https://review.coreboot.org/c/coreboot/+/33147
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib20fae04080b28c6105e5a187cc5d7a55b48d709
Gerrit-Change-Number: 33147
Gerrit-PatchSet: 1
Gerrit-Owner: Sumeet R Pawnikar <sumeet.r.pawnikar(a)intel.com>
Gerrit-MessageType: newchange