From nobody Wed Jan 19 21:19:31 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E5AD2193BCF4; Wed, 19 Jan 2022 21:19:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JfJS33jPCz4cvx; Wed, 19 Jan 2022 21:19:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642627171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pEcqcsdp04HToMiuF1SogCp4oDW5GVSGv3wIW4sMeDE=; b=mX+o0A2s5ZuVY0bBcjsiJMT9XIsk6ND+AsCekBOlU0EgjxeWkg22B9jSUEKcEdlZ9pyMYh MwTPTDM2wd2bXOazCUd3Dzjy8bR3PoZtup2Pxdip0lkLe0fv+mpMomFxiA+dqye1ZZwvSh TzVyH/GZgOpJNpN6PO/pGH8sJDqTH3IhFVARiEWS5xLQJgv4PR9U8e6lZan/+u0SZKdKdF tW8723/e4prKYs0RefEF54xfMHYXC0/EsrTkCJ7ZGUkvf51VFfW4oqzIWeaEzEAn0IVs2t R/sZ5k/C9y0OTxh/4zG09oE38fQ6xPzq1M4Z0FZpHxkp0e2UXlSnGNQ8E++r4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5688B1BC40; Wed, 19 Jan 2022 21:19:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20JLJVX1059763; Wed, 19 Jan 2022 21:19:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20JLJVWj059762; Wed, 19 Jan 2022 21:19:31 GMT (envelope-from git) Date: Wed, 19 Jan 2022 21:19:31 GMT Message-Id: <202201192119.20JLJVWj059762@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mitchell Horne Subject: git: b0216f3b4482 - main - sysutils/opensbi: update to version v1.0 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b0216f3b4482137d573f9d6f7789504d302fc47b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642627171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pEcqcsdp04HToMiuF1SogCp4oDW5GVSGv3wIW4sMeDE=; b=hnBec4y1FvcTxMB6ZlWBdXJFd7rQPXO19AVhw6Bv4hpHpcz6JZXQg1FJzXjb0QARF94V1B PZAHyUesax8BoVENKMC8Nf5YA+w+lpSnT5V63Nl3P8N7q//E55XluIhQ8qkh+WceXM903Q tgUYFTEs6tUqTDta/lCwu/YC0Bh8HEyw/PAG2qvAmg6cmJyCqfGAquy5JEztQnk1W6k3c9 duNYkgF991+n9wZnbZ8p3rNN11HBGjpHVwnxDZWzxYECWlEOW9oMQdI3sXMkbYvrScPO/+ qVI8aRQ+ByNAXzCDdI+Xug/yA6upVbdm8BwnFvFsnRpfthP5F2dc0M1Uc9o9aA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642627171; a=rsa-sha256; cv=none; b=Fjx3x/IriKKmKQMi77C80MOdHo8ol6WGOt6Y5mz01MmJFNjDjymSJkeLfuMBNwZqkbRNGC e2lxJgfY+wdp5OlhyBNLB8yw2LIej0tC0vnyWB0yy2VeyEMmmY+3SYuCx+goNOKD9rS3z6 qfC5o7GB3Qo895wOKFJtl7hZVNnGT8PIL/j9tD46B8V05X8ZerVBY4Ciq9VOcdWfsz1yxd k+QmZG7Ni+pnxyi+FKbKc97RKifK57aBX0Di0EndkdZMSYcr83DHaz8D+kuOhDowpMSDTV h17WuvWscxtPwC7wGVj/sHjDn57zHHSFtLs34PRx/BS/hCvH4VmRODMqULAFdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne (src committer): URL: https://cgit.FreeBSD.org/ports/commit/?id=b0216f3b4482137d573f9d6f7789504d302fc47b commit b0216f3b4482137d573f9d6f7789504d302fc47b Author: Mitchell Horne AuthorDate: 2022-01-19 21:15:34 +0000 Commit: Mitchell Horne CommitDate: 2022-01-19 21:15:34 +0000 sysutils/opensbi: update to version v1.0 As the fu540 platform has been removed with this version, fall back to building the generic platform only. Keep the platform logic around in the Makefile in case we need it in the future. Switch to building with base system clang+binutils. Bump the PORTREVISION for sysutils/u-boot-sifive-fu540. Reviewed by: jrtc27, lwhsu (previous version both) Approved by: lwhsu (ports) Tested by: Klaus Küchemann Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33845 --- sysutils/opensbi/Makefile | 20 +++++------------ sysutils/opensbi/distinfo | 6 ++--- sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c | 4 ++-- .../files/patch-platform_generic_platform.c | 6 ++--- .../files/patch-platform_generic_sifive__fu540.c | 26 ++++++++++++++++++++++ .../files/patch-platform_sifive_fu540_platform.c | 10 --------- sysutils/opensbi/pkg-plist | 17 +++++++++----- sysutils/u-boot-sifive-fu540/Makefile | 4 +++- 8 files changed, 54 insertions(+), 39 deletions(-) diff --git a/sysutils/opensbi/Makefile b/sysutils/opensbi/Makefile index 1391f5099c90..fb8b248abac6 100644 --- a/sysutils/opensbi/Makefile +++ b/sysutils/opensbi/Makefile @@ -1,6 +1,6 @@ PORTNAME= opensbi DISTVERSIONPREFIX=v -DISTVERSION= 0.9 +DISTVERSION= 1.0 CATEGORIES= sysutils MAINTAINER= mhorne@FreeBSD.org @@ -8,29 +8,21 @@ COMMENT= RISC-V SBI bootloader and firmware LICENSE= BSD2CLAUSE -BUILD_DEPENDS= ${RISCV_PREFIX}gcc:devel/riscv64-none-elf-gcc \ - ${RISCV_PREFIX}ld:devel/binutils@riscv64_none_elf - USES= gmake USE_GITHUB= yes GH_ACCOUNT= riscv -RISCV_PREFIX= riscv64-none-elf- - -MAKE_ARGS= CROSS_COMPILE=${RISCV_PREFIX} I=${STAGEDIR}${PREFIX} FW_PAYLOAD=n +MAKE_ARGS= CC=clang I=${STAGEDIR}${PREFIX} V=1 FW_PAYLOAD=n OPTIONS_GROUP= PLATFORMS -OPTIONS_GROUP_PLATFORMS=GENERIC SIFIVE_FU540 +OPTIONS_GROUP_PLATFORMS=GENERIC OPTIONS_SUB= yes -OPTIONS_DEFAULT= GENERIC SIFIVE_FU540 +OPTIONS_DEFAULT= GENERIC GENERIC_DESC= Support for generic platform GENERIC_PLATFORM= generic GENERIC_STRIP_ARGS= -K tohost -K fromhost -SIFIVE_FU540_DESC= Support for SiFive U540 platform -SIFIVE_FU540_PLATFORM= sifive/fu540 - INSTALL_TARGET= install PLIST_SUB+= RISCV_ABI=${PLATFORM_RISCV_ABI} @@ -45,9 +37,9 @@ post-build-${platform}-on: do-install-${platform}-on: ${MKDIR} ${STAGEDIR}${PREFIX} ${MAKE_CMD} -C ${WRKSRC} PLATFORM=${${platform}_PLATFORM} ${MAKE_ARGS} \ - I=${STAGEDIR}${PREFIX} install_firmwares + I=${STAGEDIR}${PREFIX} V=1 install_firmwares ${MAKE_CMD} -C ${WRKSRC} PLATFORM=${${platform}_PLATFORM} ${MAKE_ARGS} \ - I=${STAGEDIR}${PREFIX} install_libplatsbi + I=${STAGEDIR}${PREFIX} V=1 install_libplatsbi post-install-${platform}-on: ${STRIP_CMD} ${${platform}_STRIP_ARGS} \ diff --git a/sysutils/opensbi/distinfo b/sysutils/opensbi/distinfo index e7c663bbcc9c..6a679cea4bfb 100644 --- a/sysutils/opensbi/distinfo +++ b/sysutils/opensbi/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1610993580 -SHA256 (riscv-opensbi-v0.9_GH0.tar.gz) = 60f995cb3cd03e3cf5e649194d3395d0fe67499fd960a36cf7058a4efde686f0 -SIZE (riscv-opensbi-v0.9_GH0.tar.gz) = 189688 +TIMESTAMP = 1641325249 +SHA256 (riscv-opensbi-v1.0_GH0.tar.gz) = a5efaeb24f5ee88d13d5788e4e00623ff312ee12c0bf736aa75a6ad9a850fb76 +SIZE (riscv-opensbi-v1.0_GH0.tar.gz) = 225774 diff --git a/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c b/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c index 184d17771466..e9b4ed6abde2 100644 --- a/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c +++ b/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c @@ -1,6 +1,6 @@ ---- lib/sbi/sbi_hart.c.orig 2021-01-30 20:30:32 UTC +--- lib/sbi/sbi_hart.c.orig 2021-12-24 11:57:44 UTC +++ lib/sbi/sbi_hart.c -@@ -188,6 +188,16 @@ int sbi_hart_pmp_configure(struct sbi_scratch *scratch +@@ -203,6 +203,16 @@ int sbi_hart_pmp_configure(struct sbi_scratch *scratch if (!pmp_count) return 0; diff --git a/sysutils/opensbi/files/patch-platform_generic_platform.c b/sysutils/opensbi/files/patch-platform_generic_platform.c index 39a427424842..5d39f954ee76 100644 --- a/sysutils/opensbi/files/patch-platform_generic_platform.c +++ b/sysutils/opensbi/files/patch-platform_generic_platform.c @@ -1,11 +1,11 @@ ---- platform/generic/platform.c.orig 2021-01-30 20:29:48 UTC +--- platform/generic/platform.c.orig 2021-12-24 11:57:44 UTC +++ platform/generic/platform.c -@@ -22,6 +22,8 @@ +@@ -23,6 +23,8 @@ #include #include +int need_pmp_war = FALSE; + extern const struct platform_override sifive_fu540; + extern const struct platform_override sifive_fu740; - static const struct platform_override *special_platforms[] = { diff --git a/sysutils/opensbi/files/patch-platform_generic_sifive__fu540.c b/sysutils/opensbi/files/patch-platform_generic_sifive__fu540.c new file mode 100644 index 000000000000..bdd0dce39569 --- /dev/null +++ b/sysutils/opensbi/files/patch-platform_generic_sifive__fu540.c @@ -0,0 +1,26 @@ +--- platform/generic/sifive_fu540.c.orig 2021-12-24 11:57:44 UTC ++++ platform/generic/sifive_fu540.c +@@ -11,6 +11,15 @@ + #include + #include + ++extern int need_pmp_war; ++ ++static int sifive_fu540_early_init(bool cold_boot, const struct fdt_match *match) ++{ ++ need_pmp_war = TRUE; ++ ++ return 0; ++} ++ + static u64 sifive_fu540_tlbr_flush_limit(const struct fdt_match *match) + { + /* +@@ -41,6 +50,7 @@ static const struct fdt_match sifive_fu540_match[] = { + }; + + const struct platform_override sifive_fu540 = { ++ .early_init = sifive_fu540_early_init, + .match_table = sifive_fu540_match, + .tlbr_flush_limit = sifive_fu540_tlbr_flush_limit, + .fdt_fixup = sifive_fu540_fdt_fixup, diff --git a/sysutils/opensbi/files/patch-platform_sifive_fu540_platform.c b/sysutils/opensbi/files/patch-platform_sifive_fu540_platform.c deleted file mode 100644 index b0662361545d..000000000000 --- a/sysutils/opensbi/files/patch-platform_sifive_fu540_platform.c +++ /dev/null @@ -1,10 +0,0 @@ ---- platform/sifive/fu540/platform.c.orig 2021-01-30 20:28:07 UTC -+++ platform/sifive/fu540/platform.c -@@ -20,6 +20,7 @@ - #include - - /* clang-format off */ -+int need_pmp_war = TRUE; - - #define FU540_HART_COUNT 5 - diff --git a/sysutils/opensbi/pkg-plist b/sysutils/opensbi/pkg-plist index c28e264b8902..6a660f894053 100644 --- a/sysutils/opensbi/pkg-plist +++ b/sysutils/opensbi/pkg-plist @@ -2,6 +2,7 @@ include/sbi/fw_dynamic.h include/sbi/riscv_asm.h include/sbi/riscv_atomic.h include/sbi/riscv_barrier.h +include/sbi/riscv_elf.h include/sbi/riscv_encoding.h include/sbi/riscv_fp.h include/sbi/riscv_io.h @@ -28,6 +29,7 @@ include/sbi/sbi_list.h include/sbi/sbi_math.h include/sbi/sbi_misaligned_ldst.h include/sbi/sbi_platform.h +include/sbi/sbi_pmu.h include/sbi/sbi_scratch.h include/sbi/sbi_string.h include/sbi/sbi_system.h @@ -40,17 +42,25 @@ include/sbi/sbi_version.h include/sbi_utils/fdt/fdt_domain.h include/sbi_utils/fdt/fdt_fixup.h include/sbi_utils/fdt/fdt_helper.h +include/sbi_utils/fdt/fdt_pmu.h +include/sbi_utils/gpio/fdt_gpio.h +include/sbi_utils/gpio/gpio.h +include/sbi_utils/i2c/fdt_i2c.h +include/sbi_utils/i2c/i2c.h +include/sbi_utils/ipi/aclint_mswi.h include/sbi_utils/ipi/fdt_ipi.h include/sbi_utils/irqchip/fdt_irqchip.h include/sbi_utils/irqchip/plic.h include/sbi_utils/reset/fdt_reset.h include/sbi_utils/serial/fdt_serial.h +include/sbi_utils/serial/gaisler-uart.h +include/sbi_utils/serial/litex-uart.h include/sbi_utils/serial/shakti-uart.h include/sbi_utils/serial/sifive-uart.h include/sbi_utils/serial/uart8250.h -include/sbi_utils/sys/clint.h include/sbi_utils/sys/htif.h include/sbi_utils/sys/sifive_test.h +include/sbi_utils/timer/aclint_mtimer.h include/sbi_utils/timer/fdt_timer.h lib64/%%RISCV_ABI%%/libsbi.a lib64/%%RISCV_ABI%%/libsbiutils.a @@ -59,8 +69,3 @@ lib64/%%RISCV_ABI%%/libsbiutils.a %%GENERIC%%%%DATADIR%%/%%RISCV_ABI%%/generic/firmware/fw_dynamic.elf %%GENERIC%%%%DATADIR%%/%%RISCV_ABI%%/generic/firmware/fw_jump.bin %%GENERIC%%%%DATADIR%%/%%RISCV_ABI%%/generic/firmware/fw_jump.elf -%%SIFIVE_FU540%%lib64/%%RISCV_ABI%%/opensbi/sifive/fu540/lib/libplatsbi.a -%%SIFIVE_FU540%%%%DATADIR%%/%%RISCV_ABI%%/sifive/fu540/firmware/fw_dynamic.bin -%%SIFIVE_FU540%%%%DATADIR%%/%%RISCV_ABI%%/sifive/fu540/firmware/fw_dynamic.elf -%%SIFIVE_FU540%%%%DATADIR%%/%%RISCV_ABI%%/sifive/fu540/firmware/fw_jump.bin -%%SIFIVE_FU540%%%%DATADIR%%/%%RISCV_ABI%%/sifive/fu540/firmware/fw_jump.elf diff --git a/sysutils/u-boot-sifive-fu540/Makefile b/sysutils/u-boot-sifive-fu540/Makefile index be02869fb2ac..3fba52d998dc 100644 --- a/sysutils/u-boot-sifive-fu540/Makefile +++ b/sysutils/u-boot-sifive-fu540/Makefile @@ -1,12 +1,14 @@ MASTERDIR= ${.CURDIR}/../u-boot-master +U_BOOT_SLAVE_PORTREVISION_2021.07=1 + MODEL= sifive-fu540 BOARD_CONFIG= sifive_unleashed_defconfig FAMILY= sifive UBOOT_ARCH= riscv64 # The FIT image will embed an OpenSBI firmware binary -OPENSBI_FIRM= ${LOCALBASE}/share/opensbi/lp64/sifive/fu540/firmware/fw_dynamic.bin +OPENSBI_FIRM= ${LOCALBASE}/share/opensbi/lp64/generic/firmware/fw_dynamic.bin BUILD_DEPENDS+= ${OPENSBI_FIRM}:sysutils/opensbi MAKE_ENV+= OPENSBI=${OPENSBI_FIRM}