From patchwork Sat Jun 2 17:22:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matwey V. Kornilov" X-Patchwork-Id: 137594 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2334829lji; Sat, 2 Jun 2018 10:22:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIAGzRWuK5742uc4wWUwauNpDgooVCFNGOCPENM2X9nRTfiUjvGMny0IiZYIVzuDOM9UzMz X-Received: by 2002:a50:d4c4:: with SMTP id e4-v6mr17951018edj.127.1527960164196; Sat, 02 Jun 2018 10:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527960164; cv=none; d=google.com; s=arc-20160816; b=d1sCMO8OrtCAixxyRd1SrwHmWXe19CR4Lxt169BH2vCaAdeX0opJcgvnk2fHd6W0O5 k/HrnMmzS5eik7ta3TzZcD943H92ruso20m8959+YvJmoa2qFtuzKpZ5OlE9aQd+CDNl rikw0ocUrZHC/oejPQwzDmAgdv6LiSvY6R8nW2i62cnIDQr8pupn5gF64i92YtY51FIo 1puWMHkJHIEaEgG6w8BnhbFnp1OU3LYF3HXWIBrBi9d1C4Y35hJaSKH9znSfoAozyEMJ Nnzo7DfhNse+jqvqJUHNyT9SbVvRn/TGt2q2YifIReUKqTXjVbGBQjNIS9vFjMZFyMxq yVNg== 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=qiqmPHO6SdXWMawyE4vci0NxwjberxX1uZpn6FOMThA=; b=xMN5Kl6zooeRbQ0+Fk5NabYR7G84xtlnvv+Z1M+GzL0uR1Lqjy+e0E04PFwfB4XKoU DdB1Cp2LMmJjXq+/K68KMm79xZK/kM7aXxq8m6cKP84yeQA9OtV1jwrWyiFcq1PSrKx7 iiv6nksrFgS/SLIIuigfzM+D2v/A9vzWQ0oxajXmwEqw501P9Zkg1MdpB1Wfdc+jgBjV eHd+Ee4XAcWy1jZ7iRTfmJ5AnGQwz4GX4OzMmrLhSO5Yc0PNQ4kYFYjacf+Ioo05VbnM Wq/zoyhvROyPWzcyvM0oYGe5ImAWlwfVOMIaY0m2xXXafR/g8kZ9U4OzC2muN2jPcVRb L/oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=EAQpReOF; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id p59-v6si7265448edd.302.2018.06.02.10.22.43; Sat, 02 Jun 2018 10:22:44 -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=@gmail.com header.s=20161025 header.b=EAQpReOF; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: by lists.denx.de (Postfix, from userid 105) id 63C54C21DF8; Sat, 2 Jun 2018 17:22:40 +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=FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED, 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 60105C21C27; Sat, 2 Jun 2018 17:22:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 09B1FC21C29; Sat, 2 Jun 2018 17:22:36 +0000 (UTC) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) by lists.denx.de (Postfix) with ESMTPS id A1728C21C27 for ; Sat, 2 Jun 2018 17:22:36 +0000 (UTC) Received: by mail-lf0-f54.google.com with SMTP id u4-v6so19241053lff.3 for ; Sat, 02 Jun 2018 10:22:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=r/hZpKq8LnRHK+teA18lueVP89dHWsrjSuT+oo8f7kk=; b=EAQpReOF0wRPoMbCme/F5MdPguOFnkYjpX0/GqmGdDBvVBPCdZoeZ81XeaynNbpgeZ ORz8Xbk6ECO722QJV0MlSdwZPAM7bhbwKSJmZZvkwpOriI3QUBA3kz7pvh9EjEAZUHHQ Phi2V+HS3EMUg4HARF5TG5fUiy+kCGh8S+xEDEokNLEx7Prlfapr1zYi3iLjV05Lq65t K06DmOLslS1A8c4vi63tg+kjNGXgKiD/Vrd6yh6Z0qpR1O93Wl+6VwGE70iFZ63yb7e1 C2QuVPG8qFslO/NUOTCkXQihVWNKv5C8PDzLpK5ED9PnvGXa0E3Zj0fjHW+sKgeAGja7 2+fQ== 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=r/hZpKq8LnRHK+teA18lueVP89dHWsrjSuT+oo8f7kk=; b=UN+66VmZ+QXSMLH/aRpXIqDzyYAsxcGFCLiLC7EOAy8DzVHpwc5VARgYCQykpMN3Af l7K4r0niTrLpSpvqBPSJMp6AbC6zU8UAgCSlUFTd4+hZQB8fIgX4CJBr6w9zcRniEQRQ fPy13MDf5ZLekYLMFBa2dCrxhDa3EWHxWSDHLH1ZAG0HgfIAQkvHXM5zTAlU1vP3SL78 fxIqV2UYqCrVJmQP9Df+/zbe4feqQ6ZLC5hIeF1aEEL4sUcSYoyqYD5QGaA5afZqJSVJ 3K6Ar8KVA4fK7L1iBnH+YCEA1Mgf+VckMn/UCa6/iuU3uoieTa//qTrNUUncsSP+Z9SX PlUA== X-Gm-Message-State: ALKqPwfW8bt/R9rsnBodkNx1HEnKHrSkgAJv53w9u2iSDo5sMM4IvkSP Q/KuUgVIuNRWBpe7Eaov8FzRVQ== X-Received: by 2002:a2e:82d6:: with SMTP id n22-v6mr11042488ljh.142.1527960155601; Sat, 02 Jun 2018 10:22:35 -0700 (PDT) Received: from oak.local ([92.243.181.209]) by smtp.gmail.com with ESMTPSA id t126-v6sm1333993lff.7.2018.06.02.10.22.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 02 Jun 2018 10:22:34 -0700 (PDT) From: "Matwey V. Kornilov" To: u-boot@lists.denx.de Date: Sat, 2 Jun 2018 20:22:25 +0300 Message-Id: <20180602172228.10664-1-matwey.kornilov@gmail.com> X-Mailer: git-send-email 2.13.6 Cc: trini@konsulko.com, "Matwey V. Kornilov" Subject: [U-Boot] [PATCH 1/4] configs: pcm051: Support distro bootcmds 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 support for distro bootcmds. Signed-off-by: Matwey V. Kornilov --- include/configs/pcm051.h | 49 ++++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/include/configs/pcm051.h b/include/configs/pcm051.h index a59e88171f..c1a5c6fe32 100644 --- a/include/configs/pcm051.h +++ b/include/configs/pcm051.h @@ -25,6 +25,34 @@ #define CONFIG_MACH_TYPE MACH_TYPE_PCM051 /* set to negative value for no autoboot */ +#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=" \ + "setenv mmcdev " #instance"; "\ + "setenv bootpart " #instance":2 ; "\ + "run mmcboot\0" + +#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \ + #devtypel #instance " " + +#define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel "=" \ + "run nandboot\0" + +#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \ + #devtypel #instance " " + +#define BOOT_TARGET_DEVICES(func) \ + func(MMC, mmc, 0) \ + func(LEGACY_MMC, legacy_mmc, 0) \ + func(MMC, mmc, 1) \ + func(LEGACY_MMC, legacy_mmc, 1) \ + func(NAND, nand, 0) + +#define CONFIG_BOOTCOMMAND \ + "run distro_bootcmd" + +#include + #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80007fc0\0" \ "fdtaddr=0x80000000\0" \ @@ -62,26 +90,7 @@ "ramboot=echo Booting from ramdisk ...; " \ "run ramargs; " \ "bootm ${loadaddr}\0" \ - -#define CONFIG_BOOTCOMMAND \ - "mmc dev ${mmcdev}; if mmc rescan; then " \ - "echo SD/MMC found on device ${mmcdev};" \ - "if run loadbootscript; then " \ - "run bootscript;" \ - "else " \ - "if run loadbootenv; then " \ - "echo Loaded environment from ${bootenv};" \ - "run importbootenv;" \ - "fi;" \ - "if test -n $uenvcmd; then " \ - "echo Running uenvcmd ...;" \ - "run uenvcmd;" \ - "fi;" \ - "if run loaduimage; then " \ - "run mmcboot;" \ - "fi;" \ - "fi ;" \ - "fi;" \ + BOOTENV /* Clock Defines */ #define V_OSCK 25000000 /* Clock output from T2 */