From nobody Wed Feb 14 15:17:27 2024 X-Original-To: dev-commits-src-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 4TZhdN1Xglz5B751; Wed, 14 Feb 2024 15:17:28 +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 4TZhdM5bmRz3y5p; Wed, 14 Feb 2024 15:17:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707923847; 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=z88Rl4SNL19tsNE+W2wcwMLkAGuVTMJ2rerIi30lxCY=; b=j5T9D8Ehl6uH5bDVEPMlDFcN4z1Lr/58LQCUiMZmmjHPRvMbfYXtLkASHzT4LQQWNtKoda baZK3B4T4wMoI2ZVuDap20AZCz5mBQvzMsa7u3B15GQnnP/KcdtQ1JJ3UGufFFMiXHMWzd mSGwb40QRgtlEQoYDHt8pvAdbbh4WhX7b33r1R743047Tbx+R8OKK3DoPCreNFFoibDXFl ZH9VlsGCSeSju3OH2v3ONCPHH6Vc9an96PhMtqyeMHj0ir7OKrhZPnmLDIAjvL33mvRq0K 59ZdQ6x++IlYfDRZ18iSDDelj/kipfWpfrRV5+V/6EHtEs7gn9mme0aBK0459A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707923847; a=rsa-sha256; cv=none; b=vinAS2uaFfa2yn+g7Ff47FFKDzUO7RFC+THREppQqMCyCjie82jl9NmjfNgKfBqN72NAfI F2OfuyuTmNrxcGceKa+SoORYvJSgQlDSbCo8GEdA2aWlZT4CeEqMgd2iaewf6mK3cbTnES VNJJjj2s02eAPuCbBhGlCjfUBL6DMP5X0bopR0KO5ss2WZVZktZx+SCRHXD2+Lu2+s4VOB 17UfhQihRk9yxNf2JpWc3ZZvO/iQzgJbiUpvBX4EbwIYQgaL89CFa0bqkbqxXBO9gpwan8 GCU4YBHB8F+CcHeo/CLAHAgYNhehQoBtODvVM8YI/g1OhKn36WQ/EvRy+qmtPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707923847; 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=z88Rl4SNL19tsNE+W2wcwMLkAGuVTMJ2rerIi30lxCY=; b=ha7LNaIxI4HHzBy3vkZPyHII/3Gget3Y/GEkhDJ+nIcO9FdV4z2lHB+1MarLcj59tYj5p9 gUtphcICkvea6T0pboE8Bhi/a5g6Kyz/0VRhqul7Jwx/2qDpCghJcFR8io/PB/8rI4sVpC 424bg1zlk/PMzgDL7/q8p/dPDRcS4KoSfegIu1vRGrgVCfN8IdXs/d5Y3VXtYjHfwfrWnc LR1HfhN/grKR68WY+p36svzH4xlWg52LpItd7V906Rq2EOlEVvpNJol4YRlHrtNtnd5r3O hTr/+qnFJyZKo2E/C7F2zlew1E730r6p/u5VAiB+jSrEDEgShQZ4MHqKblnzEA== 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 4TZhdM3VCKz138b; Wed, 14 Feb 2024 15:17:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41EFHRg8015287; Wed, 14 Feb 2024 15:17:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41EFHRxX015284; Wed, 14 Feb 2024 15:17:27 GMT (envelope-from git) Date: Wed, 14 Feb 2024 15:17:27 GMT Message-Id: <202402141517.41EFHRxX015284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 3fb8f1272b50 - main - riscv: add firmware partitions to GENERICSD.conf List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-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: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3fb8f1272b50cb87cb624b321f7b81e76627c437 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=3fb8f1272b50cb87cb624b321f7b81e76627c437 commit 3fb8f1272b50cb87cb624b321f7b81e76627c437 Author: Mitchell Horne AuthorDate: 2024-02-14 15:12:57 +0000 Commit: Mitchell Horne CommitDate: 2024-02-14 15:16:54 +0000 riscv: add firmware partitions to GENERICSD.conf Create two partitions in the existing space at the beginning of the image (8MB). These are intended to hold u-boot SPL and u-boot proper. The partition types selected are compatible with SiFive boards, e.g. the HiFive Unmatched. They can easily be overridden for a platform that uses the same scheme but different partition types, e.g. the StarFive VisionFive v2. Firmware is not actually installed, this too is left for the user. It is not as simple to create the firmware partitions after the fact, e.g. with partition indices 3 and 4. It is a shortcoming of current day u-boot that the SPL loader looks for a specific partition index, rather than the partition type, meaning that we will fail to boot if partition 2 doesn't contain u-boot. Thus, our GENERICSD images become more generically usable with current RISC-V hardware/firmware platforms. Reviewed by: manu, karels, imp MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43849 --- release/riscv/GENERICSD.conf | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/release/riscv/GENERICSD.conf b/release/riscv/GENERICSD.conf index 7bd58bc9f97b..d4abbc7965b8 100644 --- a/release/riscv/GENERICSD.conf +++ b/release/riscv/GENERICSD.conf @@ -1,6 +1,4 @@ #!/bin/sh -# -# EMBEDDED_TARGET_ARCH="riscv64" EMBEDDED_TARGET="riscv" @@ -11,4 +9,18 @@ IMAGE_SIZE="6144M" KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" PART_SCHEME="GPT" +EFIPART_SUFFIX=p3 +ROOTFSPART_SUFFIX=p4 export BOARDNAME="GENERICSD" + +arm_create_partitions() { + # Create two partitions for firmware, preceding EFI and ROOTFS: + # 1. u-boot SPL + # 2. u-boot loader + # + # The exact partition types can be rewritten by the user, but they should + # be reserved now. + + chroot ${CHROOTDIR} gpart add -t hifive-fsbl -l spl -a 512k -b 2m -s 2m ${mddev} + chroot ${CHROOTDIR} gpart add -t hifive-bbl -l uboot -a 512k -b 4m -s 4m ${mddev} +}