From patchwork Thu Jun 20 20:34:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sjoerd Simons X-Patchwork-Id: 1119777 X-Patchwork-Delegate: sbabic@denx.de 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; dmarc=fail (p=none dis=none) header.from=collabora.co.uk Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45VD9B0zvZz9s9y for ; Fri, 21 Jun 2019 06:35:42 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id C9A06C21D9A; Thu, 20 Jun 2019 20:35:19 +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=SPF_HELO_PASS, 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 53EBBC21D72; Thu, 20 Jun 2019 20:34:43 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7E2C2C21BE5; Thu, 20 Jun 2019 20:34:41 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lists.denx.de (Postfix) with ESMTPS id 17789C21BE5 for ; Thu, 20 Jun 2019 20:34:41 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sjoerd) with ESMTPSA id BEE9B263AA2 Received: by beast.luon.net (Postfix, from userid 1000) id E7A0D3E0580; Thu, 20 Jun 2019 22:34:36 +0200 (CEST) From: Sjoerd Simons To: u-boot@lists.denx.de Date: Thu, 20 Jun 2019 22:34:36 +0200 Message-Id: <20190620203436.20374-2-sjoerd.simons@collabora.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190620203436.20374-1-sjoerd.simons@collabora.co.uk> References: <20190620203436.20374-1-sjoerd.simons@collabora.co.uk> MIME-Version: 1.0 Cc: Joe Hershberger , Fabio Estevam Subject: [U-Boot] [PATCH 2/2] mx6: mx6sabre common: Add distro boot config 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Allow mx6 sabreauto and sabresd to boot via the default distro boot commands to make it easier to support general distributions. The previous boot setup is still supported via legacy boot targets. Signed-off-by: Sjoerd Simons --- configs/mx6sabreauto_defconfig | 2 ++ include/configs/mx6sabre_common.h | 52 +++++++++++++++++++++++-------- 2 files changed, 41 insertions(+), 13 deletions(-) diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig index 558b1cd996..e3430fd131 100644 --- a/configs/mx6sabreauto_defconfig +++ b/configs/mx6sabreauto_defconfig @@ -1,6 +1,8 @@ CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x17800000 +CONFIG_DISTRO_DEFAULTS=y +CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd" CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h index 270cd2bae2..bc4444700b 100644 --- a/include/configs/mx6sabre_common.h +++ b/include/configs/mx6sabre_common.h @@ -48,7 +48,45 @@ #define EMMC_ENV "" #endif +#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=" \ + "setenv mmcdev " #instance "; "\ + "mmc dev ${mmcdev};" \ + "if mmc rescan; then " \ + "if run loadbootscript; then " \ + "run bootscript; " \ + "else " \ + "if run loadimage; then " \ + "run mmcboot; " \ + "fi; " \ + "fi; " \ + "fi;\0" + +#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \ + #devtypel #instance " " + +#define BOOTENV_DEV_LEGACY_NET(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel "=" \ + "run netboot\0" + +#define BOOTENV_DEV_NAME_LEGACY_NET(devtypeu, devtypel, instance) \ + #devtypel " " + +#define BOOT_TARGET_DEVICES(func) \ + func(MMC, mmc, CONFIG_SYS_MMC_ENV_DEV) \ + func(LEGACY_MMC, legacy_mmc, CONFIG_SYS_MMC_ENV_DEV) \ + func(PXE, pxe, na) \ + func(DHCP, dhcp, na) \ + func(LEGACY_NET, legacy_net, na) + +#include + #define CONFIG_EXTRA_ENV_SETTINGS \ + "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ + "ramdisk_addr_r=0x14000000\0" \ + "fdt_addr_r=0x18000000\0" \ "script=boot.scr\0" \ "image=zImage\0" \ "fdtfile=undefined\0" \ @@ -144,20 +182,8 @@ "if test $fdtfile = undefined; then " \ "echo WARNING: Could not determine dtb to use; fi; " \ "fi;\0" \ + BOOTENV -#define CONFIG_BOOTCOMMAND \ - "run findfdt;" \ - "mmc dev ${mmcdev};" \ - "if mmc rescan; then " \ - "if run loadbootscript; then " \ - "run bootscript; " \ - "else " \ - "if run loadimage; then " \ - "run mmcboot; " \ - "else run netboot; " \ - "fi; " \ - "fi; " \ - "else run netboot; fi" #define CONFIG_ARP_TIMEOUT 200UL