From patchwork Wed Jun 14 18:34:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 105575 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp428928qgd; Wed, 14 Jun 2017 11:34:35 -0700 (PDT) X-Received: by 10.80.145.118 with SMTP id f51mr1019990eda.170.1497465275003; Wed, 14 Jun 2017 11:34:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497465274; cv=none; d=google.com; s=arc-20160816; b=ndLluzKMoXE5V7g5mOnQDPVsTB4qeGtfNTQBhQ7sS/Ng2pu+404fvLLpBy1kcVYUcr tKn2SMUfzT1yFd2OwtKsmnpYsrdZfolbg8UiGgVTyOuex4WVSdrcUDo8up4PIjfArWmz V7obzV4H5d8YWA4dUl4C7azRj5aBe5GICfnwyc4JfQmE58vd3ISx14e8iN31FPDtBbZQ DgYkQcfAC6/4G+kHh8qgDxryHjD7Z40ziRHCh5sdy5cjo9g59j2aj4eWLk/GQa3ounlS qb7V5A5pVY7YUdugKzN/H127UDYJJtO043YmDvQd+5EL7VBmakvG1jTrwkomOTSamB83 KN5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=sX2hG5djAT79Qrcpjcq094MkNLphqqG9aQHvsAmbLuI=; b=SN3gt+56gLF2hkMgxOsW6mPILBE/d0sfTAAyjdIaDsSusPuyXa5JTjQiAc/WHZqigB uT3EIrHLWlYzxOyYdh9a59XxFTHGTWwlD7JAOAAFcUzBqjmSbkUzLODZB8phVodtOuDb QIiloSBMbW5YH6krEWSQoVYi2nlFrcCWgeGbH5GZaOUKVNL9Q9N5Z2bEowB7mgmwdX66 C/3db2pDYEP990udd7zL3Jwob3qjqTz9/2JNKzir3iriF+PFYu9hJEBXjlt3JxaCO8Jj Qg6c3J8vAdnaDrOhlxD2/7lojTgyn0TDu8t2byNPkZVAKehbJWG/u2Anb5w/ETy8eTJD y5Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=M9yBzRNt; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id f26si648090edb.3.2017.06.14.11.34.34; Wed, 14 Jun 2017 11:34:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=M9yBzRNt; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 5919BC21CC3; Wed, 14 Jun 2017 18:34:32 +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=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID 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 EB498C21C3E; Wed, 14 Jun 2017 18:34:29 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0C781C21C3E; Wed, 14 Jun 2017 18:34:27 +0000 (UTC) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) by lists.denx.de (Postfix) with ESMTPS id 3E83BC21C39 for ; Wed, 14 Jun 2017 18:34:27 +0000 (UTC) Received: by mail-lf0-f51.google.com with SMTP id m77so7155411lfe.0 for ; Wed, 14 Jun 2017 11:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=TfqpE11IxRY36bq0/QhGiNzqIiIIMf08wlHzriHg38w=; b=M9yBzRNt2jmex5Kq9GRryUq/aerns38WybNg1sUb2LZoboZf7KyNH/F6ha4/5hWBao tsZ31cHw0Ehp4r+4lZdb81IA/55XR7y69VLTtL2t1F77+uJ4Ixkwv0eE845JTV/uJc5L Wv4DcIr6EBAeXQhxuZYFX4iyXkOkZBrAzKvC4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TfqpE11IxRY36bq0/QhGiNzqIiIIMf08wlHzriHg38w=; b=qx4KRy5/aQutxzRskLsmuUnSwXOX1EySD31L/r5A7qkMoeI3VVFRjiAXbawe1kuqJw 5oW7fXQ1R/Q6IbjEB9MrPeopGGq6uThhVHvCKR2jUp+qNw6gmptzLzNNxGKM29o5owrP 77FAJ+b5A6ImWtzkljdvQaIYDfJSYFkugamsI9ywvSh/u5R42sddrVaA/Ram5MkITMHh NGeL7NCMAaHGjrtgJz2QmJ0jQ9726Xg+N9I40lpz42gdxsWn774szeHe/BGDStaZj9At 3r1ZcmtjEh2glnRIhfjxDN42esiEIpCmRu+RIuKwJ2PoISK0KHI963wPL2rhUZeAd3Uq NfWg== X-Gm-Message-State: AKS2vOxeiB+QrqpGRCd3LR9RBegYrCJLqlVm64HKZNfqC+tkHyLy1CXw 2vlOBukOtysF3ABy2cPLlA== X-Received: by 10.25.195.81 with SMTP id t78mr492935lff.73.1497465266162; Wed, 14 Jun 2017 11:34:26 -0700 (PDT) Received: from localhost ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id a88sm174030ljb.54.2017.06.14.11.34.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Jun 2017 11:34:24 -0700 (PDT) From: Sam Protsenko To: u-boot@lists.denx.de Date: Wed, 14 Jun 2017 21:34:23 +0300 Message-Id: <20170614183423.31032-1-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.11.0 Cc: Praneeth Bajjuri , Tom Rini Subject: [U-Boot] [PATCH] arm: omap: Extract OMAP5 boot environment to separate file 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" Signed-off-by: Sam Protsenko Reviewed-by: Tom Rini --- include/configs/ti_omap5_common.h | 60 ++-------------------------- include/environment/ti/boot.h | 83 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 57 deletions(-) create mode 100644 include/environment/ti/boot.h diff --git a/include/configs/ti_omap5_common.h b/include/configs/ti_omap5_common.h index d45baabf0b..4c3a2766ec 100644 --- a/include/configs/ti_omap5_common.h +++ b/include/configs/ti_omap5_common.h @@ -50,14 +50,12 @@ /* * Environment setup */ -#ifndef PARTS_DEFAULT -#define PARTS_DEFAULT -#endif #ifndef DFUARGS #define DFUARGS #endif +#include #include #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG @@ -65,63 +63,11 @@ DEFAULT_LINUX_BOOT_ENV \ DEFAULT_MMC_TI_ARGS \ DEFAULT_FIT_TI_ARGS \ - "console=" CONSOLEDEV ",115200n8\0" \ - "fdtfile=undefined\0" \ - "bootpart=0:2\0" \ - "bootdir=/boot\0" \ - "bootfile=zImage\0" \ - "usbtty=cdc_acm\0" \ - "vram=16M\0" \ - "partitions=" PARTS_DEFAULT "\0" \ - "optargs=\0" \ - "dofastboot=0\0" \ - "findfdt="\ - "if test $board_name = omap5_uevm; then " \ - "setenv fdtfile omap5-uevm.dtb; fi; " \ - "if test $board_name = dra7xx; then " \ - "setenv fdtfile dra7-evm.dtb; fi;" \ - "if test $board_name = dra72x-revc; then " \ - "setenv fdtfile dra72-evm-revc.dtb; fi;" \ - "if test $board_name = dra72x; then " \ - "setenv fdtfile dra72-evm.dtb; fi;" \ - "if test $board_name = dra71x; then " \ - "setenv fdtfile dra71-evm.dtb; fi;" \ - "if test $board_name = beagle_x15; then " \ - "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \ - "if test $board_name = beagle_x15_revb1; then " \ - "setenv fdtfile am57xx-beagle-x15-revb1.dtb; fi;" \ - "if test $board_name = am572x_idk; then " \ - "setenv fdtfile am572x-idk.dtb; fi;" \ - "if test $board_name = am57xx_evm; then " \ - "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \ - "if test $board_name = am57xx_evm_reva3; then " \ - "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \ - "if test $board_name = am571x_idk; then " \ - "setenv fdtfile am571x-idk.dtb; fi;" \ - "if test $fdtfile = undefined; then " \ - "echo WARNING: Could not determine device tree to use; fi; \0" \ + DEFAULT_COMMON_BOOT_TI_ARGS \ + DEFAULT_FDT_TI_ARGS \ DFUARGS \ NETARGS \ -#define CONFIG_BOOTCOMMAND \ - "if test ${dofastboot} -eq 1; then " \ - "echo Boot fastboot requested, resetting dofastboot ...;" \ - "setenv dofastboot 0; saveenv;" \ - "echo Booting into fastboot ...; " \ - "fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " \ - "fi;" \ - "if test ${boot_fit} -eq 1; then " \ - "run update_to_fit;" \ - "fi;" \ - "run findfdt; " \ - "run envboot; " \ - "run mmcboot;" \ - "setenv mmcdev 1; " \ - "setenv bootpart 1:2; " \ - "setenv mmcroot /dev/mmcblk0p2 rw; " \ - "run mmcboot;" \ - "" - /* * SPL related defines. The Public RAM memory map the ROM defines the * area between 0x40300000 and 0x4031E000 as a download area for OMAP5. diff --git a/include/environment/ti/boot.h b/include/environment/ti/boot.h new file mode 100644 index 0000000000..1c3ae40a99 --- /dev/null +++ b/include/environment/ti/boot.h @@ -0,0 +1,83 @@ +/* + * Boot related environment variable definitions on TI boards. + * + * (C) Copyright 2017 Linaro Ltd. + * Sam Protsenko + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __TI_BOOT_H +#define __TI_BOOT_H + +#ifndef CONSOLEDEV +#define CONSOLEDEV "ttyO2" +#endif + +#ifndef PARTS_DEFAULT +#define PARTS_DEFAULT +#endif + +#define DEFAULT_COMMON_BOOT_TI_ARGS \ + "console=" CONSOLEDEV ",115200n8\0" \ + "fdtfile=undefined\0" \ + "bootpart=0:2\0" \ + "bootdir=/boot\0" \ + "bootfile=zImage\0" \ + "usbtty=cdc_acm\0" \ + "vram=16M\0" \ + "partitions=" PARTS_DEFAULT "\0" \ + "optargs=\0" \ + "dofastboot=0\0" + +#ifdef CONFIG_OMAP54XX + +#define DEFAULT_FDT_TI_ARGS \ + "findfdt="\ + "if test $board_name = omap5_uevm; then " \ + "setenv fdtfile omap5-uevm.dtb; fi; " \ + "if test $board_name = dra7xx; then " \ + "setenv fdtfile dra7-evm.dtb; fi;" \ + "if test $board_name = dra72x-revc; then " \ + "setenv fdtfile dra72-evm-revc.dtb; fi;" \ + "if test $board_name = dra72x; then " \ + "setenv fdtfile dra72-evm.dtb; fi;" \ + "if test $board_name = dra71x; then " \ + "setenv fdtfile dra71-evm.dtb; fi;" \ + "if test $board_name = beagle_x15; then " \ + "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \ + "if test $board_name = beagle_x15_revb1; then " \ + "setenv fdtfile am57xx-beagle-x15-revb1.dtb; fi;" \ + "if test $board_name = am572x_idk; then " \ + "setenv fdtfile am572x-idk.dtb; fi;" \ + "if test $board_name = am57xx_evm; then " \ + "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \ + "if test $board_name = am57xx_evm_reva3; then " \ + "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \ + "if test $board_name = am571x_idk; then " \ + "setenv fdtfile am571x-idk.dtb; fi;" \ + "if test $fdtfile = undefined; then " \ + "echo WARNING: Could not determine device tree to use; fi; \0" + +#define CONFIG_BOOTCOMMAND \ + "if test ${dofastboot} -eq 1; then " \ + "echo Boot fastboot requested, resetting dofastboot ...;" \ + "setenv dofastboot 0; saveenv;" \ + "echo Booting into fastboot ...; " \ + "fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " \ + "fi;" \ + "if test ${boot_fit} -eq 1; then " \ + "run update_to_fit;" \ + "fi;" \ + "run findfdt; " \ + "run envboot; " \ + "run mmcboot;" \ + "setenv mmcdev 1; " \ + "setenv bootpart 1:2; " \ + "setenv mmcroot /dev/mmcblk0p2 rw; " \ + "run mmcboot;" \ + "" + +#endif /* CONFIG_OMAP54XX */ + +#endif /* __TI_BOOT_H */