From patchwork Wed Aug 5 22:47:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Ziswiler X-Patchwork-Id: 504412 X-Patchwork-Delegate: twarren@nvidia.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 728B7140280 for ; Thu, 6 Aug 2015 08:50:11 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BB08F3A1D; Thu, 6 Aug 2015 00:50:07 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pe6Xpcv2wwCz; Thu, 6 Aug 2015 00:50:07 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E176A39D3; Thu, 6 Aug 2015 00:50:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F3D2639C3 for ; Thu, 6 Aug 2015 00:50:02 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ykOXQvBGBSTw for ; Thu, 6 Aug 2015 00:50:02 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mout.perfora.net (mout.perfora.net [74.208.4.197]) by theia.denx.de (Postfix) with ESMTPS id 7D60E39A7 for ; Thu, 6 Aug 2015 00:49:59 +0200 (CEST) Received: from localhost.net ([62.167.132.2]) by mrelay.perfora.net (mreueus002) with ESMTPSA (Nemesis) id 0LbKeK-1YyH9d36Ve-00l0iG; Thu, 06 Aug 2015 00:49:56 +0200 From: Marcel Ziswiler To: u-boot@lists.denx.de Date: Thu, 6 Aug 2015 00:47:00 +0200 Message-Id: X-Mailer: git-send-email 2.4.3 In-Reply-To: References: X-Provags-ID: V03:K0:nS+Kz/x6O6RL9H1gdHONjdWaRZqg9woAnWaXeQuN5jxNDRvBGu/ bKEIwjm8vJxj5wl7n2r6m3UrUrGo/saeZa7gXMdLPP7oBkTIldJf6l1DQHLku4aqwrVXPyi RsmllA5iWpiewR3K8BqPrRSTYDmbkBSmqZisxONTqnK04XmqfchtGL6eReGBsg7txiGgJP6 i8AU9Ge38t2AdpU5RdTHA== X-UI-Out-Filterresults: notjunk:1; V01:K0:lGEWhTJ2WP0=:4mmfg89nVZo3MDmNP75HVx YEUmG+2okBRVnB88iRPVytT++TXdAqYaF/tJ/2CVlT5ZQsP0vk3BLbIygBAFfMhpKwxEQ5efw LYFmAfATdIdPmBn6kLCBPteU/Y2YVoC+WOFwega8mbRV5GPYGNCIyuThT6exRSYkKXUissb53 KT4wcrnsg4mEuhZWMeNfR0SrSxXaLAz6ZyNT+kDUPJz4kaqQi53X6wH+hPt7mcFysK9ImaxCx CgHkIN1yUxQoUrAcwCU5455r3XBCrb9x430RIEwQOwMs2TLT8jHkvrEKbwD/JzooHc70n7QUy tDCTwFjoCdOMfGYH0Bi5p/802vk4CQyRzuNMrr0ehyYJDcysYLAW1My8YxPBUN5dBc3/jlEZx WnO9jhXRpxbSK3az/fBffs30yTdDowVP3X1uuN+qlqUlg1m2axXvwXwbIXj/CdS7GcYIiApk7 7lxZGPgLXTC8gaX5yHKl/rQ76kCBHqcWtjD9rsF0Mp8sBEZpa+k4we7pqRNCneqHDD2mfJNIp 26q7DdgUL4IaqkH4PwZyAQbnESf9qGb0+hOJxOZbN+uUAF1SaFpXIv+0jbbuZ9q9/UOMuU5WG t6Fj7OCMUMD4tOLjxDyXBb3DgvUIvGR5OggAmLzP4c71MSBZtVRMpg4tGnbk5kYL7zPqlRPhA DbIylUby/asAwkB9cyNzRmoJ6 Cc: Stefan Agner , Tom Rini , Marcel Ziswiler , Tom Warren , Scott Wood , Stephen Warren , Marcel Ziswiler Subject: [U-Boot] [PATCH v3 03/16] apalis/colibri_t20/t30: integrate recovery mode detection X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" From: Marcel Ziswiler Allow detecting whether or not U-Boot was launched through the recovery mode of the resp. NVIDIA SoC. Make use of a board specific arch_misc_init() and enable the same via CONFIG_ARCH_MISC_INIT configuration option. Signed-off-by: Marcel Ziswiler Acked-by: Stephen Warren --- Changes in v2: Drop unrelated clean-up to be done as part of a separate patch. board/toradex/apalis_t30/apalis_t30.c | 12 ++++++++++++ board/toradex/colibri_t20/colibri_t20.c | 12 ++++++++++++ board/toradex/colibri_t30/colibri_t30.c | 12 ++++++++++++ include/configs/apalis_t30.h | 2 ++ include/configs/colibri_t20.h | 2 ++ include/configs/colibri_t30.h | 2 ++ 6 files changed, 42 insertions(+) diff --git a/board/toradex/apalis_t30/apalis_t30.c b/board/toradex/apalis_t30/apalis_t30.c index 6244214..b7a2219 100644 --- a/board/toradex/apalis_t30/apalis_t30.c +++ b/board/toradex/apalis_t30/apalis_t30.c @@ -9,7 +9,10 @@ #include #include #include +#include +#include #include +#include #include #include @@ -18,6 +21,15 @@ #define PMU_I2C_ADDRESS 0x2D #define MAX_I2C_RETRY 3 +int arch_misc_init(void) +{ + if (readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BOOTTYPE) == + NVBOOTTYPE_RECOVERY) + printf("USB recovery mode\n"); + + return 0; +} + /* * Routine: pinmux_init * Description: Do individual peripheral pinmux configs diff --git a/board/toradex/colibri_t20/colibri_t20.c b/board/toradex/colibri_t20/colibri_t20.c index 8ae9ccf..7210a8a 100644 --- a/board/toradex/colibri_t20/colibri_t20.c +++ b/board/toradex/colibri_t20/colibri_t20.c @@ -8,8 +8,20 @@ #include #include #include +#include #include +#include #include +#include + +int arch_misc_init(void) +{ + if (readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BOOTTYPE) == + NVBOOTTYPE_RECOVERY) + printf("USB recovery mode\n"); + + return 0; +} #ifdef CONFIG_TEGRA_MMC /* diff --git a/board/toradex/colibri_t30/colibri_t30.c b/board/toradex/colibri_t30/colibri_t30.c index f4bc7d8..7ca79eb 100644 --- a/board/toradex/colibri_t30/colibri_t30.c +++ b/board/toradex/colibri_t30/colibri_t30.c @@ -8,10 +8,22 @@ #include #include #include +#include +#include +#include #include "pinmux-config-colibri_t30.h" #include #include +int arch_misc_init(void) +{ + if (readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BOOTTYPE) == + NVBOOTTYPE_RECOVERY) + printf("USB recovery mode\n"); + + return 0; +} + /* * Routine: pinmux_init * Description: Do individual peripheral pinmux configs diff --git a/include/configs/apalis_t30.h b/include/configs/apalis_t30.h index 620ca02..7a27504 100644 --- a/include/configs/apalis_t30.h +++ b/include/configs/apalis_t30.h @@ -11,6 +11,8 @@ #include "tegra30-common.h" +#define CONFIG_ARCH_MISC_INIT + /* High-level configuration options */ #define V_PROMPT "Apalis T30 # " #define CONFIG_TEGRA_BOARD_STRING "Toradex Apalis T30" diff --git a/include/configs/colibri_t20.h b/include/configs/colibri_t20.h index 6d73f9d..5331c7c 100644 --- a/include/configs/colibri_t20.h +++ b/include/configs/colibri_t20.h @@ -9,6 +9,8 @@ #include "tegra20-common.h" +#define CONFIG_ARCH_MISC_INIT + /* High-level configuration options */ #define V_PROMPT "Colibri T20 # " #define CONFIG_TEGRA_BOARD_STRING "Toradex Colibri T20" diff --git a/include/configs/colibri_t30.h b/include/configs/colibri_t30.h index 1e94c34..9c5fdb2 100644 --- a/include/configs/colibri_t30.h +++ b/include/configs/colibri_t30.h @@ -11,6 +11,8 @@ #include "tegra30-common.h" +#define CONFIG_ARCH_MISC_INIT + /* High-level configuration options */ #define V_PROMPT "Colibri T30 # " #define CONFIG_TEGRA_BOARD_STRING "Toradex Colibri T30"