From patchwork Fri Apr 10 18:26:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1078 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 731173F0CC for ; Fri, 10 Apr 2020 20:27:10 +0200 (CEST) Received: by mail-pj1-f71.google.com with SMTP id go23sf2736021pjb.2 for ; Fri, 10 Apr 2020 11:27:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1586543229; cv=pass; d=google.com; s=arc-20160816; b=NbygLevxbnbcs2bB0aLscfjyPXwA2KkvuCsYUyATnvnPI01JrdAT9kc3yO0wijmogM S5bhJzvgKzHPPt/yEI1YZJ2ZWV7QIma394J/d3mOiGJQi6fVJFw2pcKeLa/yswXeaCBs ZqbbiVLdroJGPnfQ11xzOV+UEYxyT9ozy3Ww3+BRy9mwGxPzoQlGdWDIhbB9Gg2Og93S Jzj3N5bS34luJV6rXkmsaoHUEcQzG8MTzLS1euurbKWJWQj4gKLxNkooFVqTwpHeSvIC 4UANaQD3vNWON4tdDV7BsvijpErDbfqyAp3SDaKU4ATGduFmF5u77X+64aoOMIlGQZhO +tUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:references:in-reply-to:message-id:date :subject:cc:to:from:mime-version:dkim-signature; bh=gAax+BOlVskyZ/oirKxxBraGnvqtVgRaAUxqvXPttfs=; b=PTazeE1pvo1+FD+rDl7flHFALVzi0FFZ4yrAkwsxNNDRqRC8vhpsYLGfWemUvWV8ZI AzLvdRzOTkjRqw9UK3eonftCd4LIYM6/tb6eeueo6Hb5X3Kc8GC4zUP6ttCCezZoWErZ dDkd0Pqkc3G3QVL+1NZYxQjDASZp5onY2uY/vA1sM/xXQpGa9DtAfdCFxJSrem1A6e9l BhNsBhqVOdswGGlAs5Yy9MlJJ1pTc+4QHX3Z6gkCRRnDXgDbt2blq5Iu82YLzI04pEL/ +oFeqK19/yxChVvOnT9RuSQfeWRjTH+9DWvK7upisPLxmslGpgt8GhankD4sUcC9FOAd Ag1g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=fR5SDbrE; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=gAax+BOlVskyZ/oirKxxBraGnvqtVgRaAUxqvXPttfs=; b=dQsnEyaYjFpjo8YdgUdQFA6+WJRLniBURB74VhlfgzP8yhZ/moHb65vfuFGS6myf02 d7kkrjDGOYP7p9A14szQk9KeMWRgknn8Y+7iyxyUg2e7sJw5jWIi6TvWfwIb2KZRbpAb HdS4P1eAvuiGDdD/pJ47J3ljPGbBiftTSWi9I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:to:cc:subject:date:message-id :in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=gAax+BOlVskyZ/oirKxxBraGnvqtVgRaAUxqvXPttfs=; b=cqvXja/qgDHO31kiFjM4cCgy4jeCCqNTqWRe6AjHxPGdO17FafAeiwexclbc0f0qh2 A37L1f6tMmrAz1Lfa2zahYdl/Z5fKb5DiHmulI32fdfPWTSd9NokEbIZu9b4hxrsB7yP IFRVxsHd14qEAUjCMDdRyPvkMW3UuBpdTLfcj6DPfRH3J+fBxmcZbFxOjmnzUfMlHlyJ QT6GqwJDOZvmGYGAnSuqujQO93VJmpUXnYP/DqCztK14RYWVolHwmTMEzscRJPTzSy0D bgKtAvzrWub0nn6vlV/yWdbZBKrR9YeQzWspOEa3LSaymkHGsjURp2C7BKXbSdR0mbkr gEhg== X-Gm-Message-State: AGi0PuavOYcdeGW3czXeEYsd0WgWosRaHP6CV7OHH+6aMxBnHRw7I9g3 CBbQBOq2J+6MFJmC6r2BVJ0nDRmv X-Google-Smtp-Source: APiQypJLF8ZT6QXn6d4Z8YI3JEaE2QCdWXoEbS/D2A5CobSUcStjXiL2JCLn7l0PLjpL/U6xarVZrQ== X-Received: by 2002:a62:3487:: with SMTP id b129mr6268261pfa.150.1586543228919; Fri, 10 Apr 2020 11:27:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:c344:: with SMTP id e4ls4862117pgd.1.gmail; Fri, 10 Apr 2020 11:27:08 -0700 (PDT) X-Received: by 2002:a63:5053:: with SMTP id q19mr5723002pgl.66.1586543228357; Fri, 10 Apr 2020 11:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586543228; cv=none; d=google.com; s=arc-20160816; b=L+GxeuXhUHrM6PiUhdwbY1NdZGZTUxEc9xKZV/MP0zQtQvPtliM6aLk0ejC/9a2I4c OMvFg4MLmlJV8varhKfXYvsXj7vZwFMksfdrWs/Tb5jZ5xBMpHAjPqMf6rxb07SQ/W6o ZfTMjDvq1yuLX964mEO004TPlfvHFADuoI9/L8kJEEcmd+3VUwlablq1Uj7vKPQ1H9B6 mkhyhnqgEiB3+hYV57hI64BRBdBDH+fZifiCIqeETgSGz1cDsf6PNKToZ5g1mBIgkoBU k2lwzJqQKx9Di7gqelyFl0x86uKzUMpTcuF624aOyhstvX9Uc39WgkzP+Rxsz9FmfE97 VufQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Z5tYs86UgQjVIaZ4/weCq1kZNUCxBsvq1+pNvaLhNSM=; b=QdjR2sLn3qF9Yya8ypJNumMBMNo6bBrRc8t4GYsaCVpclK6N7KlVsdurS3BKwD/WfD 3sCeGs2itK4t+r67AQZfpwSlnIvebrgiy6eW32cWBJXpGHQNZnbJvywp8YpP17IDY9yk AUjVHGz2opscPGW+j8AgzTQHUg0JIOL1aTI0zAVGk55sLOUUKYPEHkJo74dzLc/dcSSP zofjPbnblG9ASLct4Kt6knibPryIhsCLsNx+KKxNd+o2/rrWQi53asRRivaMnbSGzsaW ClM3b68fnSWZmkmu+wGerI1kjdCPsd40VH5Rtx1vkbHBOQHscAzUKAbnbegagaGcivuM JR7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=fR5SDbrE; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id e21sor3865598pgv.71.2020.04.10.11.27.07 for (Google Transport Security); Fri, 10 Apr 2020 11:27:07 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:4850:: with SMTP id x16mr5744920pgk.317.1586543227545; Fri, 10 Apr 2020 11:27:07 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:e854:42b6:1a5:a40e]) by smtp.gmail.com with ESMTPSA id w90sm2214694pjj.2.2020.04.10.11.27.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 11:27:07 -0700 (PDT) From: Jagan Teki To: Tom Rini , Kever Yang , Simon Glass , Philipp Tomsich Cc: sunil@amarulasolutions.com, u-boot@lists.denx.de, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v2 1/3] environment: distro: Add SF distro command Date: Fri, 10 Apr 2020 23:56:29 +0530 Message-Id: <20200410182631.11951-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200410182631.11951-1-jagan@amarulasolutions.com> References: <20200410182631.11951-1-jagan@amarulasolutions.com> X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=fR5SDbrE; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add distro boot command support for SPI flash (SF). This distro boot will read the boot script at specific location at the flash and start sourcing the same. This file need to include on required include/config file. Cc: Tom Rini Signed-off-by: Jagan Teki Reviewed-by: Tom Rini --- Changes for v2: - new patch include/environment/distro/sf.h | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 include/environment/distro/sf.h diff --git a/include/environment/distro/sf.h b/include/environment/distro/sf.h new file mode 100644 index 0000000000..e793be06c6 --- /dev/null +++ b/include/environment/distro/sf.h @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2020 Amarula Solutions(India) + * + * SF distro configurations. + */ + +#ifndef __DISTRO_SF_CONFIG_H +#define __DISTRO_SF_CONFIG_H + +#if CONFIG_IS_ENABLED(CMD_SF) +#define BOOTENV_SHARED_SF(devtypel) \ + #devtypel "_boot=" \ + "if " #devtypel " probe ${busnum}; then " \ + "devtype=" #devtypel "; " \ + "run scan_sf_for_scripts; " \ + "fi\0" +#define BOOTENV_DEV_SF(devtypeu, devtypel, instance) \ + "bootcmd_" #devtypel #instance "=" \ + "busnum=" #instance "; " \ + "run " #devtypel "_boot\0" +#define BOOTENV_DEV_NAME_SF(devtypeu, devtypel, instance) \ + #devtypel #instance " " +#else +#define BOOTENV_SHARED_SF(devtypel) +#define BOOTENV_DEV_SF \ + BOOT_TARGET_DEVICES_references_SF_without_CONFIG_CMD_SF +#define BOOTENV_DEV_NAME_SF \ + BOOT_TARGET_DEVICES_references_SF_without_CONFIG_CMD_SF + +#endif /* CONFIG_CMD_SF */ + +#define BOOTENV_SF \ + BOOTENV_SHARED_SF(sf) \ + "scan_sf_for_scripts=" \ + "${devtype} read ${scriptaddr} " \ + "${script_offset_f} ${script_size_f}; " \ + "source ${scriptaddr}; " \ + "echo SCRIPT FAILED: continuing...\0" + +#endif /* __DISTRO_SF_CONFIG_H */