From patchwork Mon Dec 4 19:06:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Vadot X-Patchwork-Id: 844374 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=bidouilliste.com header.i=@bidouilliste.com header.b="QIivxkcf"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yrDrT2Qbcz9sNr for ; Tue, 5 Dec 2017 06:06:47 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 1CE3CC21DAB; Mon, 4 Dec 2017 19:06:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C6261C21D56; Mon, 4 Dec 2017 19:06:34 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 24908C21D56; Mon, 4 Dec 2017 19:06:33 +0000 (UTC) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by lists.denx.de (Postfix) with ESMTPS id BBAC1C21C4A for ; Mon, 4 Dec 2017 19:06:32 +0000 (UTC) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 23bce302 for ; Mon, 4 Dec 2017 20:06:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=from :to:cc:subject:date:message-id; s=mail; bh=tsexAw1dOkBaQZNIUzRnZ GwWtdk=; b=QIivxkcf7yh1tnFBXU0Pk9Poc9oPMC+KPuOq9Fdyg/QhEFd2kM9+m A5dMWLfixQKEYw/F3vlUMsS3OM3fWMZbdo1BsOqh1BxwvQnHk2mUod7HzUI7nBYY 9+PaW9QTUoDP28pzSdkYsZQWLwMKr8Lu2+l8rWkrfYwEh756JqTtLg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=from:to :cc:subject:date:message-id; q=dns; s=mail; b=q9gSCCGKzLcFzz/VxL OiSLO7v3+QKAireeIE8Y1/GItsj0JeQH5Y5VK0mH2vreuiIGvVyOaF+QxC4jjtOb 8SW6n8KCLDo4nWxeoczJ5Z5LYWEltHR6Ywp91ldb/q+T09cvAYRIuMYVDGn8Y2kT 8Pzm5tOnLa6a22PYtZoPng2+A= Received: from knuckles.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 1233a50a TLS version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO for ; Mon, 4 Dec 2017 20:06:25 +0100 (CET) Received: from elbarto (uid 1001) (envelope-from manu@bidouilliste.com) id 4888d by knuckles.blih.net (DragonFly Mail Agent v0.11); Mon, 04 Dec 2017 20:06:24 +0100 From: Emmanuel Vadot To: sjg@chromium.org, bmeng.cn@gmail.com, yamada.masahiro@socionext.com, maxime.ripard@free-electrons.com, patrick.delaunay@st.com, xypron.glpk@gmx.de, philipp.tomsich@theobroma-systems.com, robdclark@gmail.com Date: Mon, 4 Dec 2017 20:06:16 +0100 Message-Id: <20171204190617.13976-1-manu@bidouilliste.com> X-Mailer: git-send-email 2.15.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 1/2] distro_bootcmd: Add command to run FreeBSD X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add commands that scans for the FreeBSD loader and run it if found. FreeBSD has two loader: ubldr which is an ELF binary and ubldr.bin which is a PIE binary. Signed-off-by: Emmanuel Vadot --- include/config_distro_bootcmd.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index 5c469a23fa..424d63a355 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -158,6 +158,36 @@ #define SCAN_DEV_FOR_EFI #endif +#ifdef CONFIG_DISTRO_FREEBSD +#define BOOTENV_SHARED_FREEBSD \ + "boot_freebsd_binary=" \ + "load ${devtype} ${devnum}:${distro_bootpart} " \ + "${kernel_addr_r} ubldr.bin; " \ + "go ${kernel_addr_r}\0" \ + \ + "boot_freebsd_elf=" \ + "load ${devtype} ${devnum}:${distro_bootpart} " \ + "${kernel_addr_r} ubldr; " \ + "bootelf ${kernel_addr_r}\0" \ + \ + "scan_dev_for_freebsd=" \ + "if test -e ${devtype} ${devnum}:${distro_bootpart} " \ + "ubldr.bin; then " \ + "echo Found FreeBSD U-Boot Loader (bin);" \ + "run boot_freebsd_binary; " \ + "echo FREEBSD FAILED: continuing...; " \ + "elif test -e ${devtype} ${devnum}:${distro_bootpart} " \ + "ubldr; then " \ + "echo Found FreeBSD U-Boot Loader (elf);" \ + "run boot_freebsd_elf; " \ + "echo FREEBSD FAILED: continuing...; " \ + "fi;\0" +#define SCAN_DEV_FOR_FREEBSD "run scan_dev_for_freebsd;" +#else +#define BOOTENV_SHARED_FREEBSD +#define SCAN_DEV_FOR_FREEBSD +#endif + #ifdef CONFIG_SATA #define BOOTENV_SHARED_SATA BOOTENV_SHARED_BLKDEV(sata) #define BOOTENV_DEV_SATA BOOTENV_DEV_BLKDEV @@ -331,6 +361,7 @@ BOOTENV_SHARED_IDE \ BOOTENV_SHARED_UBIFS \ BOOTENV_SHARED_EFI \ + BOOTENV_SHARED_FREEBSD \ "boot_prefixes=/ /boot/\0" \ "boot_scripts=boot.scr.uimg boot.scr\0" \ "boot_script_dhcp=boot.scr.uimg\0" \ @@ -374,6 +405,7 @@ "run scan_dev_for_scripts; " \ "done;" \ SCAN_DEV_FOR_EFI \ + SCAN_DEV_FOR_FREEBSD \ "\0" \ \ "scan_dev_for_boot_part=" \ From patchwork Mon Dec 4 19:06:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Vadot X-Patchwork-Id: 844375 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=bidouilliste.com header.i=@bidouilliste.com header.b="XSMVUIWp"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yrDrz1By8z9rxl for ; Tue, 5 Dec 2017 06:07:14 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id A7555C21F3E; Mon, 4 Dec 2017 19:06:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id B33D5C22009; Mon, 4 Dec 2017 19:06:50 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B1360C21F0F; Mon, 4 Dec 2017 19:06:44 +0000 (UTC) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by lists.denx.de (Postfix) with ESMTPS id 2F6A7C21E71 for ; Mon, 4 Dec 2017 19:06:41 +0000 (UTC) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 4750de42 for ; Mon, 4 Dec 2017 20:06:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=from :to:cc:subject:date:message-id:in-reply-to:references; s=mail; bh=T1hfMEBJzAtT95VfMvcRnwL2yZA=; b=XSMVUIWpVJjct2ABtbou5QGh8x7p 6U73gDYlrQCkHPmlnxkc90PPJ+Yb4JBhXMwYrc413OwVfY/q0t7bWFPMUBj2j6y2 EDpyzheZetZkiMGPTvMDsT4V4HHmI6AteZ44Mssz+tQA3A+UCqCNG62wDs2gFWHx nOZP7z2Qsi98R7E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=from:to :cc:subject:date:message-id:in-reply-to:references; q=dns; s= mail; b=pGRMSyLPFjmMnpDGBcJDy1dt8Aoz5Zp6LB95CfrpScXLFT1F17x7nf4F 6knPc97OvsLepAqCEnV6K4GPEyoI9BrcHwUwwofzmjhLlxX/KpzeeiCCRiZ5ApMa 4rET9QFCguh86GAOm0tArYArsTurjnPg/zbzh3DkcS7yO9VLzl0= Received: from knuckles.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 6d1cd946 TLS version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO for ; Mon, 4 Dec 2017 20:06:28 +0100 (CET) Received: from elbarto (uid 1001) (envelope-from manu@bidouilliste.com) id 48899 by knuckles.blih.net (DragonFly Mail Agent v0.11); Mon, 04 Dec 2017 20:06:27 +0100 From: Emmanuel Vadot To: sjg@chromium.org, bmeng.cn@gmail.com, yamada.masahiro@socionext.com, maxime.ripard@free-electrons.com, patrick.delaunay@st.com, xypron.glpk@gmx.de, philipp.tomsich@theobroma-systems.com, robdclark@gmail.com Date: Mon, 4 Dec 2017 20:06:17 +0100 Message-Id: <20171204190617.13976-2-manu@bidouilliste.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171204190617.13976-1-manu@bidouilliste.com> References: <20171204190617.13976-1-manu@bidouilliste.com> Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 2/2] kconfig: Add a DISTRO_FREEBSD option X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add a FreeBSD option that enables the API and the data cache command as both are needed to boot the FreeBSD loader. Signed-off-by: Emmanuel Vadot --- common/Kconfig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/Kconfig b/common/Kconfig index c50d6ebb2a..acf20ade1d 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -502,4 +502,15 @@ config HASH endmenu +config DISTRO_FREEBSD + bool "Enable FreeBSD boot" + select API if !ARM64 + select CMD_CACHE + default n + help + This options adds boot configuration that can run the FreeBSD + loader. When enabled the distro_bootcmd will be expanded to + include scan_dev_for_freebsd which search for the FreeBSD loader + and if found run it. + source "common/spl/Kconfig"