Tristan Hsieh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31604
Change subject: mediatek: Pass board specific message to BL31
......................................................................
mediatek: Pass board specific message to BL31
Sometimes we need to pass board specific messages to BL31, so that BL31
can do board specific operation based on common code.
BUG=b:80501386
BRANCH=none
TEST=emerge-kukui coreboot
Change-Id: I60b09423d479b356ac5c04517906042fc8d512ca
Signed-off-by: Tristan Shieh <tristan.shieh(a)mediatek.com>
---
A src/soc/mediatek/common/bl31_plat_params.c
A src/soc/mediatek/common/include/soc/bl31_plat_params.h
M src/soc/mediatek/mt8183/Makefile.inc
3 files changed, 54 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/04/31604/1
diff --git a/src/soc/mediatek/common/bl31_plat_params.c b/src/soc/mediatek/common/bl31_plat_params.c
new file mode 100644
index 0000000..eb7477a
--- /dev/null
+++ b/src/soc/mediatek/common/bl31_plat_params.c
@@ -0,0 +1,30 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2019 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <arm_tf.h>
+#include <soc/bl31_plat_params.h>
+
+static struct bl31_plat_param *plat_params;
+
+void register_bl31_param(struct bl31_plat_param *param)
+{
+ param->next = plat_params;
+ plat_params = param;
+}
+
+void *soc_get_bl31_plat_params(bl31_params_t *bl31_params)
+{
+ return plat_params;
+}
diff --git a/src/soc/mediatek/common/include/soc/bl31_plat_params.h b/src/soc/mediatek/common/include/soc/bl31_plat_params.h
new file mode 100644
index 0000000..399b0d5
--- /dev/null
+++ b/src/soc/mediatek/common/include/soc/bl31_plat_params.h
@@ -0,0 +1,23 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2019 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __BL31_PLAT_PARAMS_H__
+#define __BL31_PLAT_PARAMS_H__
+
+#include <arm-trusted-firmware/plat/mediatek/common/plat_params.h>
+
+void register_bl31_param(struct bl31_plat_param *param);
+
+#endif
diff --git a/src/soc/mediatek/mt8183/Makefile.inc b/src/soc/mediatek/mt8183/Makefile.inc
index 8af3d68..fc2bbe2 100644
--- a/src/soc/mediatek/mt8183/Makefile.inc
+++ b/src/soc/mediatek/mt8183/Makefile.inc
@@ -50,6 +50,7 @@
ramstage-y += ../common/usb.c
ramstage-y += ../common/wdt.c
+ramstage-y += ../common/bl31_plat_params.c
BL31_MAKEARGS += PLAT=mt8183
CPPFLAGS_common += -Isrc/soc/mediatek/mt8183/include
--
To view, visit https://review.coreboot.org/c/coreboot/+/31604
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I60b09423d479b356ac5c04517906042fc8d512ca
Gerrit-Change-Number: 31604
Gerrit-PatchSet: 1
Gerrit-Owner: Tristan Hsieh <tristan.shieh(a)mediatek.com>
Gerrit-MessageType: newchange
Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30564
Change subject: google/buddy: adjust CID for realtek audio codec
......................................................................
google/buddy: adjust CID for realtek audio codec
Adjust CID to allow for Windows driver to attach without breaking
functionality under Linux. Same change made as to google/cyan
(which uses same Realtek RT5650 codec) in commit 607d72b.
Test: build/boot Windowns 10 on google/buddy, observe audio
drivers correctly attached to codec and Intel SST devices.
Change-Id: I839acc8427ee9b5c425885858a513e9b0b9d0f93
Signed-off-by: Matt DeVillier <matt.devillier(a)gmail.com>
---
M src/mainboard/google/auron/variants/buddy/include/variant/acpi/mainboard.asl
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/64/30564/1
diff --git a/src/mainboard/google/auron/variants/buddy/include/variant/acpi/mainboard.asl b/src/mainboard/google/auron/variants/buddy/include/variant/acpi/mainboard.asl
index 788fbdc..f4ed69e 100644
--- a/src/mainboard/google/auron/variants/buddy/include/variant/acpi/mainboard.asl
+++ b/src/mainboard/google/auron/variants/buddy/include/variant/acpi/mainboard.asl
@@ -19,7 +19,7 @@
Device (RTEK)
{
Name (_HID, "10EC5650")
- Name (_CID, "10EC5650")
+ Name (_CID, "INTCCFFD")
Name (_DDN, "RTEK Codec Controller ")
Name (_UID, 1)
--
To view, visit https://review.coreboot.org/c/coreboot/+/30564
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I839acc8427ee9b5c425885858a513e9b0b9d0f93
Gerrit-Change-Number: 30564
Gerrit-PatchSet: 1
Gerrit-Owner: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-MessageType: newchange
Philipp Hug has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31215
Change subject: WIP: riscv: Implement FIT for RISC-V
......................................................................
WIP: riscv: Implement FIT for RISC-V
Change-Id: Ic50f14a4f483d904db590ecd53bb1fc5bdeb06d6
---
M payloads/Kconfig
M src/arch/riscv/Makefile.inc
A src/arch/riscv/fit_payload.c
M src/soc/sifive/fu540/Kconfig
4 files changed, 171 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/31215/1
diff --git a/payloads/Kconfig b/payloads/Kconfig
index c7a7ba6..0c5ce8f 100644
--- a/payloads/Kconfig
+++ b/payloads/Kconfig
@@ -30,7 +30,7 @@
config PAYLOAD_FIT
bool "A FIT payload"
- depends on ARCH_ARM64
+ depends on ARCH_ARM64 || ARCH_RISCV
select PAYLOAD_FIT_SUPPORT
help
Select this option if you have a payload image (a FIT file) which
diff --git a/src/arch/riscv/Makefile.inc b/src/arch/riscv/Makefile.inc
index e4c8468..12609d4 100644
--- a/src/arch/riscv/Makefile.inc
+++ b/src/arch/riscv/Makefile.inc
@@ -139,6 +139,7 @@
ramstage-y += tables.c
ramstage-y += payload.S
ramstage-$(ARCH_RISCV_PMP) += pmp.c
+ramstage-$(CONFIG_PAYLOAD_FIT_SUPPORT) += fit_payload.c
ramstage-y += \
$(top)/src/lib/memchr.c \
$(top)/src/lib/memcmp.c \
diff --git a/src/arch/riscv/fit_payload.c b/src/arch/riscv/fit_payload.c
new file mode 100644
index 0000000..2176095
--- /dev/null
+++ b/src/arch/riscv/fit_payload.c
@@ -0,0 +1,166 @@
+/*
+ * Copyright 2013 Google Inc.
+ * Copyright 2018 Facebook, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <console/console.h>
+#include <bootmem.h>
+#include <stdlib.h>
+#include <program_loading.h>
+#include <string.h>
+#include <commonlib/compression.h>
+#include <commonlib/cbfs_serialized.h>
+#include <lib.h>
+#include <fit.h>
+#include <endian.h>
+
+#define MAX_KERNEL_SIZE (64*MiB)
+
+static bool fit_place_kernel(const struct range_entry *r, void *arg)
+{
+ struct region *region = arg;
+ resource_t start;
+
+ if (range_entry_tag(r) != BM_MEM_RAM)
+ return true;
+
+ /**
+ * The Image must be placed text_offset bytes from a 2MB aligned base
+ * address anywhere in usable system RAM and called there. The region
+ * between the 2 MB aligned base address and the start of the image has
+ * no special significance to the kernel, and may be used for other
+ * purposes.
+ *
+ * If the reserved memory (BL31 for example) is smaller than text_offset
+ * we can use the 2 MiB base address, otherwise use the next 2 MiB page.
+ * It's not mandatory, but wastes less memory below the kernel.
+ */
+ start = ALIGN_DOWN(range_entry_base(r), 2 * MiB);
+
+ if (start < range_entry_base(r))
+ start += 2 * MiB;
+ /**
+ * At least image_size bytes from the start of the image must be free
+ * for use by the kernel.
+ */
+ if (start + region->size < range_entry_end(r)) {
+ region->offset = (size_t)start;
+ return false;
+ }
+
+ return true;
+}
+
+/**
+ * Place the region in free memory range.
+ *
+ * The caller has to set region->offset to the minimum allowed address.
+ * The region->offset is usually 0 on kernel >v4.6 and kernel_base + kernel_size
+ * on kernel <v4.6.
+ */
+static bool fit_place_mem(const struct range_entry *r, void *arg)
+{
+ struct region *region = arg;
+ resource_t start;
+
+ if (range_entry_tag(r) != BM_MEM_RAM)
+ return true;
+
+ /* Linux 4.15 doesn't like 4KiB alignment. Align to 1 MiB for now. */
+ start = ALIGN_UP(MAX(region->offset, range_entry_base(r)), 1 * MiB);
+
+ if (start + region->size < range_entry_end(r)) {
+ region->offset = (size_t)start;
+ return false;
+ }
+
+ return true;
+}
+
+bool fit_payload_arch(struct prog *payload, struct fit_config_node *config,
+ struct region *kernel,
+ struct region *fdt,
+ struct region *initrd)
+{
+ bool place_anywhere;
+ void *arg = NULL;
+
+ if (!config->fdt || !fdt) {
+ printk(BIOS_CRIT, "CRIT: Providing a valid FDT is mandatory to "
+ "boot an RISCV kernel!\n");
+ return false;
+ }
+
+ /* Update kernel size from image header, if possible */
+ kernel->size = 0x2000000; //get_kernel_size(config->kernel_node);
+ printk(BIOS_DEBUG, "FIT: Using kernel size of 0x%zx bytes\n",
+ kernel->size);
+
+
+ /**
+ * The code assumes that bootmem_walk provides a sorted list of memory
+ * regions, starting from the lowest address.
+ * The order of the calls here doesn't matter, as the placement is
+ * enforced in the called functions.
+ * For details check code on top.
+ */
+
+ if (!bootmem_walk(fit_place_kernel, kernel))
+ return false;
+
+ /* Mark as reserved for future allocations. */
+ bootmem_add_range(kernel->offset, kernel->size, BM_MEM_PAYLOAD);
+
+ /**
+ * NOTE: versions prior to v4.6 cannot make use of memory below the
+ * physical offset of the Image so it is recommended that the Image be
+ * placed as close as possible to the start of system RAM.
+ *
+ * For kernel <v4.6 the INITRD and FDT can't be placed below the kernel.
+ * In that case set region offset to an address on top of kernel.
+ */
+
+ place_anywhere = false;
+ printk(BIOS_DEBUG, "FIT: Placing FDT and INITRD %s\n",
+ place_anywhere ? "anywhere" : "on top of kernel");
+
+ /* Place INITRD */
+ if (config->ramdisk) {
+ initrd->offset = 0;
+
+ if (!bootmem_walk(fit_place_mem, initrd))
+ return false;
+ /* Mark as reserved for future allocations. */
+ bootmem_add_range(initrd->offset, initrd->size, BM_MEM_PAYLOAD);
+ }
+
+ /* Place FDT */
+ if (place_anywhere)
+ fdt->offset = 0;
+ else
+ fdt->offset = kernel->offset + kernel->size;
+
+ if (!bootmem_walk(fit_place_mem, fdt))
+ return false;
+ /* Mark as reserved for future allocations. */
+ bootmem_add_range(fdt->offset, fdt->size, BM_MEM_PAYLOAD);
+
+ /* Kernel expects FDT as argument */
+ arg = (void *)fdt->offset;
+
+ prog_set_entry(payload, (void *)kernel->offset, arg);
+
+ bootmem_dump_ranges();
+
+ return true;
+}
diff --git a/src/soc/sifive/fu540/Kconfig b/src/soc/sifive/fu540/Kconfig
index 6ebde33..20645da 100644
--- a/src/soc/sifive/fu540/Kconfig
+++ b/src/soc/sifive/fu540/Kconfig
@@ -49,4 +49,7 @@
int
default 0
+config HEAP_SIZE
+ default 0x10000
+
endif
--
To view, visit https://review.coreboot.org/c/coreboot/+/31215
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic50f14a4f483d904db590ecd53bb1fc5bdeb06d6
Gerrit-Change-Number: 31215
Gerrit-PatchSet: 1
Gerrit-Owner: Philipp Hug <philipp(a)hug.cx>
Gerrit-MessageType: newchange