From nobody Wed Jan 25 15:23:04 2023 X-Original-To: dev-commits-src-branches@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 4P26zY0tFfz3bjcT; Wed, 25 Jan 2023 15:23:05 +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 4P26zY09xZz4H62; Wed, 25 Jan 2023 15:23:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674660185; 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=1KycRv6EL4Sa5Itl4zGrRDwNPFxnayYz/MyCIh8Eqfc=; b=gEVb/wRw5O3Ut4/1iSuW+97VdTfyKofJQjVkeMYkJzGT/KhAFF6iF5UIhS1mYIzOrryzna pNPCWtEZSsizhXromz0MbHF1mupsNXad33ViSpmx2slm5L/e1RUoPbyK7uu4PdVyMTJgTd s7WRhJJwkZ05wfXKeFxIx8kZ1u1+s5sCA25Bs6iH9ZM7hvnAYBiDXs3DsOpwWxaznRzI8e flRKVe/bAFfXv6ZNOxSQXGmK5Yx9arskAkdrxiZvcwPAcfB4FSvQzIrBYfJfNi2nAlSb1y X7JqcY6voeUo/RSAFFX5t5qWhoafaYN2hfvNT47Hal3ucTMhCwbXlccyn4isng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674660185; 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=1KycRv6EL4Sa5Itl4zGrRDwNPFxnayYz/MyCIh8Eqfc=; b=BSdyTfi8TAkKI7dhtpGyg6hwb1rDEGi3MKIwbx93+TAmkarR4OaIYdqSK9kXgLp1U02K+E WkQnwwTNVpn5tnP3vqfsUqoRFefp7vhmRijUXk+TDsRRLuK2o/MljxjLQ/zia2ncHndxCU L42kLtzvyfquaHam5hc5ZW9lALllrAm3fVHrzolbvUtURR40c+l9qg8afHYo0sSmbkzaBI fvcoJ2K9GQfJ54ElnxpIb1+W+laD5Ih5C5jjbN7BKbV6HviofY5KNl58S+SHM9uADLoM4Q LSqyajN6uQlxO6L6AniaidQPElSlfYT2BoqneNhMUHnTF9bamZDO7+apFVk+EQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674660185; a=rsa-sha256; cv=none; b=LFzL2eR9d+2qcy4pyX5GKz3WK2O4s7dbG0+zpFPO3BIpuJv9skzM/Fv+n8/JpV06qQvVh/ DOiWp13o6GSrkq67giyJF44+1cKdwXX+cEnbrSnDust4+15oXVql9nxodv5NBPTImpuvhe 4Q+qNRioWDsQt3qwlPxtQOqKxT+zMfohFFcRvyPHBlAO+cLbQ4ZIM75hYVThyEifCgHziJ qPKV+77CDPADXvg0HvkVwEQcqP7aJYOFnS1XwRoncZbcxW5WkfJPqbbhIMeIzMqHWsC6G6 exwTH1RyGoYvEK+LHT///juIwUrOtsFlTxI9eD/hQXILDl+fYEZpzvsrVxTs3g== 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 4P26zX6Mshzv4V; Wed, 25 Jan 2023 15:23:04 +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 30PFN4op071997; Wed, 25 Jan 2023 15:23:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30PFN4Wu071996; Wed, 25 Jan 2023 15:23:04 GMT (envelope-from git) Date: Wed, 25 Jan 2023 15:23:04 GMT Message-Id: <202301251523.30PFN4Wu071996@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 8c7293a0ea24 - stable/13 - stand: update mips uboot to uboot reorg List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8c7293a0ea2492344e17021550838600fbffdfc5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8c7293a0ea2492344e17021550838600fbffdfc5 commit 8c7293a0ea2492344e17021550838600fbffdfc5 Author: Warner Losh AuthorDate: 2023-01-25 14:54:03 +0000 Commit: Warner Losh CommitDate: 2023-01-25 15:21:04 +0000 stand: update mips uboot to uboot reorg uboot reorg in main happened after the mips support was removed. Go ahead and do the same reorg here. Move the mips files from mips/uboot to uboot/arch/mips. Move mips/uboot/Makefile to uboot/arch/mips/Makefile.inc and cut out the common lines. Split uboot target into uboot and uboot.bin to better fit into reorg. This is a direct commit to stable/13 --- share/mk/src.opts.mk | 4 +- stand/mips/Makefile | 2 - stand/mips/uboot/Makefile | 64 ---------------------- stand/mips/uboot/help.uboot | 27 --------- stand/mips/uboot/version | 10 ---- stand/uboot/arch/mips/Makefile.inc | 26 +++++++++ stand/{mips/uboot => uboot/arch/mips}/conf.c | 0 .../{mips/uboot => uboot/arch/mips}/ldscript.mips | 0 stand/{mips/uboot => uboot/arch/mips}/start.S | 0 9 files changed, 28 insertions(+), 105 deletions(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index fc98ce6c032b..962b58b82a25 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -320,8 +320,8 @@ BROKEN_OPTIONS+=LOADER_OFW .if ${__T} != "powerpc64" && ${__T} != "amd64" BROKEN_OPTIONS+=LOADER_KBOOT .endif -# UBOOT is only for arm, and big-endian powerpc -.if (${__T:Marm*} == "" && ${__T:Mpowerpc*} == "") || ${__T} == "powerpc64le" +# UBOOT is only for arm, mips, and big-endian powerpc +.if (${__T:Marm*} == "" && ${__T:Mmips*} == "" && ${__T:Mpowerpc*} == "") || ${__T} == "powerpc64le" BROKEN_OPTIONS+=LOADER_UBOOT .endif # GELI and Lua in loader currently cause boot failures on powerpc. diff --git a/stand/mips/Makefile b/stand/mips/Makefile index 90341b2f7e50..e0c80f9ac031 100644 --- a/stand/mips/Makefile +++ b/stand/mips/Makefile @@ -2,8 +2,6 @@ NO_OBJ=t -SUBDIR= uboot - # # The BERI boot loader port works only on 64-bit MIPS; not a hard port to # 32-bit if someone is interested. Build on all 64-bit MIPS platforms to diff --git a/stand/mips/uboot/Makefile b/stand/mips/uboot/Makefile deleted file mode 100644 index 984582027de5..000000000000 --- a/stand/mips/uboot/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -# $FreeBSD$ - -LOADER_CD9660_SUPPORT?= no -LOADER_EXT2FS_SUPPORT?= no -LOADER_MSDOS_SUPPORT?= yes -LOADER_UFS_SUPPORT?= yes -LOADER_NET_SUPPORT?= yes -LOADER_NFS_SUPPORT?= yes -LOADER_TFTP_SUPPORT?= no -LOADER_GZIP_SUPPORT?= no -LOADER_BZIP2_SUPPORT?= no - -.include - -FILES+= ubldr - -NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} -INSTALLFLAGS= -b -WARNS?= 1 -# Address at which ubldr will be loaded. -# This varies for different boards and SOCs. -.if ${MACHINE_ARCH:Mmips64*} -UBLDR_LOADADDR?= 0xffffffff80800000 -.else -UBLDR_LOADADDR?= 0x80800000 -.endif - -# Architecture-specific loader code -SRCS= start.S conf.c vers.c - -HELP_FILES= ${.CURDIR}/help.uboot ${BOOTSRC}/fdt/help.fdt - -# Always add MI sources -.include "${BOOTSRC}/loader.mk" - -CFLAGS+= -g - -LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} - -.include "${BOOTSRC}/uboot.mk" - -DPADD= ${LDR_INTERP} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} -LDADD= ${LDR_INTERP} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} - -OBJS+= ${SRCS:N*.h:R:S/$/.o/g} - -# ubldr on MIPS is built with '-mno-abicalls' flag, -# which is incompatible with PIE -MK_PIE= no - -ldscript.abs: - echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} - -ldscript.pie: - echo "UBLDR_LOADADDR = 0;" >${.TARGET} - -ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACHINE_CPUARCH} ${DPADD} - ${CC} ${CFLAGS} -T ldscript.abs ${LDFLAGS} \ - -o ${.TARGET} ${OBJS} ${LDADD} - ${OBJCOPY} -S -O binary ubldr ubldr.bin - -CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin - -.include diff --git a/stand/mips/uboot/help.uboot b/stand/mips/uboot/help.uboot deleted file mode 100644 index c1574af92715..000000000000 --- a/stand/mips/uboot/help.uboot +++ /dev/null @@ -1,27 +0,0 @@ -$FreeBSD$ - -############################################################################### -# Tubenv DShow or import U-Boot environment variables - - ubenv [varname ...] - - Display U-Boot environment variables, or import them into the - loader environment (which makes them available in the kernel). - -############################################################################### -# Tubenv Simport DImport U-Boot env vars - - ubenv import [varname ...] - - If no variable names are specified, all U-Boot environment - variables are imported. Each variable is prefixed with "uboot." - to avoid any possible conflicts with loader or kernel variables. - -############################################################################### -# Tubenv Sshow DShow U-Boot env vars - - ubenv show [varname ...] - - If no variable names are specified, all U-Boot environment - variables are shown. - diff --git a/stand/mips/uboot/version b/stand/mips/uboot/version deleted file mode 100644 index ec46b388b281..000000000000 --- a/stand/mips/uboot/version +++ /dev/null @@ -1,10 +0,0 @@ -$FreeBSD$ - -NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this -file is important. Make sure the current version number is on line 6. - -1.3: Remove NAND FS support. -1.2: Extended with NAND FS support. -1.1: Flattened Device Tree blob support. -1.0: Added storage support. Booting from HDD, USB, etc. is now possible. -0.5: Initial U-Boot/arm version (netbooting only). diff --git a/stand/uboot/arch/mips/Makefile.inc b/stand/uboot/arch/mips/Makefile.inc new file mode 100644 index 000000000000..676b3c88d191 --- /dev/null +++ b/stand/uboot/arch/mips/Makefile.inc @@ -0,0 +1,26 @@ +# Address at which ubldr will be loaded. +# This varies for different boards and SOCs. +.if ${MACHINE_ARCH:Mmips64*} +UBLDR_LOADADDR?= 0xffffffff80800000 +.else +UBLDR_LOADADDR?= 0x80800000 +.endif + +# Architecture-specific loader code +SRCS+= start.S conf.c + +# ubldr on MIPS is built with '-mno-abicalls' flag, +# which is incompatible with PIE +MK_PIE= no + +ldscript.abs: + echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} + +ubldr: ${OBJS} ldscript.abs ${LDSCRIPT} ${DPADD} + ${CC} ${CFLAGS} -T ldscript.abs ${LDFLAGS} \ + -o ${.TARGET} ${OBJS} ${LDADD} + +ubldr.bin: ubldr + ${OBJCOPY} -S -O binary ubldr ubldr.bin + +CLEANFILES+= ldscript.abs ubldr ubldr.pie ubldr.bin diff --git a/stand/mips/uboot/conf.c b/stand/uboot/arch/mips/conf.c similarity index 100% rename from stand/mips/uboot/conf.c rename to stand/uboot/arch/mips/conf.c diff --git a/stand/mips/uboot/ldscript.mips b/stand/uboot/arch/mips/ldscript.mips similarity index 100% rename from stand/mips/uboot/ldscript.mips rename to stand/uboot/arch/mips/ldscript.mips diff --git a/stand/mips/uboot/start.S b/stand/uboot/arch/mips/start.S similarity index 100% rename from stand/mips/uboot/start.S rename to stand/uboot/arch/mips/start.S