From patchwork Mon Jul 6 08:20:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Ziswiler X-Patchwork-Id: 491459 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 D8FD8140DBC for ; Mon, 6 Jul 2015 18:21:32 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D0D3E4B632; Mon, 6 Jul 2015 10:21:30 +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 LjVtNkqm_qIr; Mon, 6 Jul 2015 10:21:30 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 815974B622; Mon, 6 Jul 2015 10:21:30 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 875E44B622 for ; Mon, 6 Jul 2015 10:21:27 +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 z6ORRV3UzvzJ for ; Mon, 6 Jul 2015 10:21:27 +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 0DFFC4B61D for ; Mon, 6 Jul 2015 10:21:22 +0200 (CEST) Received: from localhost.localdomain ([46.140.72.82]) by mrelay.perfora.net (mreueus002) with ESMTPSA (Nemesis) id 0M3Tde-1YudK90MxU-00r1NS; Mon, 06 Jul 2015 10:21:17 +0200 From: Marcel Ziswiler To: u-boot@lists.denx.de Date: Mon, 6 Jul 2015 10:20:29 +0200 Message-Id: <84d93469cfb940421e8e84b822b441fbad8ca29c.1436170106.git.marcel.ziswiler@toradex.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: References: X-Provags-ID: V03:K0:o5SRMREh9y2q2NbmWBa8rGN9/NlXDN+P+X6G/NNfbyaffu++5lv w10cKOHCzJukOGNLdOC+dXIwbYERtw0hHzfYxjrgGU5auCOEEvKrJgmlpkgMrkQbA6XYtB1 UKA5r0yeZ7LHZLBOcVqFr8pYHjp/9jTMyzy+2KObSnKBRHn0AsSBQPMVp0p0s73icYipf4T gmAgUrIu4pOOKc22rLSvQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:ygmOMhAVggA=:6fkP2u1il1agBozZDEufRm F/iC5e1mXQ3wkP8ermXUDKjPWwt1HSFrqB4mQyAlPoMCsypNkOMtEtStpr6DB3L/fQCNMWAG4 j9+D3hoJ50OFSImYONa2ZoiwhebKJvLe8RBEW1ze4MYwS5uafov/tGQlk7Lpyyp1iH82k7ggV /+jcaViLX1xNT8VhXX5eQuRU2sAP5gJr3ZwkgQF7T9UwmmL/l88SOxDo//jJ3i8W+QZ2FGeaQ mD+G0zrbKJBxZ3n5K/w+2sV249oGf8JS0AlHjdaPBl2djZRc4sHu+aplqQt17zWcoQlTC9Zfn zK7hrSnBvZHo/7T34H/zTMPaa/Lcaopzv51ZOloNE4njyPLdLMtwPQs2vGzeKPw33Eh0kQh+f ObkwYv5K/1zi59j9+/PYNO7kr4wgfOPUDaYxUAZVWZ1lbKPvgfNDqwetkIWsnR2w5upf7zzJW SiNhgo4ibkfkBS4R3RmsDqZ7etW7BoX3z1Ymaw0ARlf0j5T5no3QSS7gDEgzfx1pATmZngstZ s6KoNygMFUxIxzSNX/Wzak/UxpB5sp3gQ+WgjaYeNkokwXDiAHQIMivDBnJT8hJwrkuVe1aZQ Pcto0aGRO+HKQeaQgvMx1y4a66W0XAQ+3VFDh9+YP9PYpYyYGag5NvzZ2U4GbPrr5qoWHw1tO alQr5EbSWI9evoO1nQVf/Xti1 Cc: Stefan Agner , Tom Rini , Marcel Ziswiler , Tom Warren , Max Krummenacher , Scott Wood , Stephen Warren Subject: [U-Boot] [PATCH 03/13] 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. While at it also sort the include files alphabetically (while leaving common.h on top of course). While at it also streamline some comments in the configuration files and fix the spacing from using spaces to tabs. Signed-off-by: Marcel Ziswiler --- board/toradex/apalis_t30/apalis_t30.c | 15 ++++++++++++++- board/toradex/colibri_t20/colibri_t20.c | 12 ++++++++++++ board/toradex/colibri_t30/colibri_t30.c | 18 +++++++++++++++--- include/configs/apalis_t30.h | 10 +++++++--- include/configs/colibri_t20.h | 14 +++++++++----- include/configs/colibri_t30.h | 10 +++++++--- 6 files changed, 64 insertions(+), 15 deletions(-) diff --git a/board/toradex/apalis_t30/apalis_t30.c b/board/toradex/apalis_t30/apalis_t30.c index 6244214..879006f 100644 --- a/board/toradex/apalis_t30/apalis_t30.c +++ b/board/toradex/apalis_t30/apalis_t30.c @@ -6,10 +6,13 @@ */ #include -#include #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 @@ -47,6 +59,7 @@ int tegra_pcie_board_init(void) debug("%s: Cannot find PMIC I2C chip\n", __func__); return err; } + /* TPS659110: VDD2_OP_REG = 1.05V */ data[0] = 0x27; addr = 0x25; 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..44b5beb 100644 --- a/board/toradex/colibri_t30/colibri_t30.c +++ b/board/toradex/colibri_t30/colibri_t30.c @@ -6,11 +6,23 @@ */ #include -#include #include -#include "pinmux-config-colibri_t30.h" -#include +#include +#include +#include #include +#include +#include +#include "pinmux-config-colibri_t30.h" + +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 diff --git a/include/configs/apalis_t30.h b/include/configs/apalis_t30.h index aba9ba6..bb58936 100644 --- a/include/configs/apalis_t30.h +++ b/include/configs/apalis_t30.h @@ -1,6 +1,8 @@ /* * Copyright (c) 2014-2015 Marcel Ziswiler * + * Configuration settings for the Toradex Apalis T30 modules. + * * SPDX-License-Identifier: GPL-2.0+ */ @@ -11,6 +13,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" @@ -26,7 +30,7 @@ #define CONFIG_SYS_I2C_TEGRA #define CONFIG_CMD_I2C -/* SD/MMC */ +/* SD/MMC support */ #define CONFIG_MMC #define CONFIG_GENERIC_MMC #define CONFIG_TEGRA_MMC @@ -38,10 +42,10 @@ #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_SYS_MMC_ENV_PART 2 -/* USB Host support */ +/* USB host support */ #define CONFIG_USB_EHCI #define CONFIG_USB_EHCI_TEGRA -#define CONFIG_USB_MAX_CONTROLLER_COUNT 3 +#define CONFIG_USB_MAX_CONTROLLER_COUNT 3 #define CONFIG_USB_STORAGE #define CONFIG_CMD_USB diff --git a/include/configs/colibri_t20.h b/include/configs/colibri_t20.h index a3f27e3..b22e82a 100644 --- a/include/configs/colibri_t20.h +++ b/include/configs/colibri_t20.h @@ -1,6 +1,8 @@ /* * Copyright (C) 2012 Lucas Stach * + * Configuration settings for the Toradex Colibri T20 modules. + * * SPDX-License-Identifier: GPL-2.0+ */ @@ -9,6 +11,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" @@ -32,7 +36,7 @@ #define CONFIG_USB_EHCI_TEGRA #define CONFIG_USB_ULPI #define CONFIG_USB_ULPI_VIEWPORT -#define CONFIG_USB_MAX_CONTROLLER_COUNT 3 +#define CONFIG_USB_MAX_CONTROLLER_COUNT 3 #define CONFIG_USB_STORAGE #define CONFIG_CMD_USB @@ -46,13 +50,13 @@ /* NAND support */ #define CONFIG_CMD_NAND #define CONFIG_TEGRA_NAND -#define CONFIG_SYS_MAX_NAND_DEVICE 1 +#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Environment in NAND, 64K is a bit excessive but erase block is 512K anyway */ #define CONFIG_ENV_IS_IN_NAND -#define CONFIG_ENV_OFFSET (SZ_2M) -#undef CONFIG_ENV_SIZE /* undef size from tegra20-common.h */ -#define CONFIG_ENV_SIZE (SZ_64K) +#define CONFIG_ENV_OFFSET (SZ_2M) +#undef CONFIG_ENV_SIZE /* undef size from tegra20-common.h */ +#define CONFIG_ENV_SIZE (SZ_64K) /* Debug commands */ #define CONFIG_CMD_BDI diff --git a/include/configs/colibri_t30.h b/include/configs/colibri_t30.h index 4655668..7710786 100644 --- a/include/configs/colibri_t30.h +++ b/include/configs/colibri_t30.h @@ -1,6 +1,8 @@ /* * Copyright (c) 2013-2015 Stefan Agner * + * Configuration settings for the Toradex Colibri T30 modules. + * * SPDX-License-Identifier: GPL-2.0+ */ @@ -11,6 +13,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" @@ -26,7 +30,7 @@ #define CONFIG_SYS_I2C_TEGRA #define CONFIG_CMD_I2C -/* SD/MMC */ +/* SD/MMC support */ #define CONFIG_MMC #define CONFIG_GENERIC_MMC #define CONFIG_TEGRA_MMC @@ -38,10 +42,10 @@ #define CONFIG_SYS_MMC_ENV_DEV 0 #define CONFIG_SYS_MMC_ENV_PART 2 -/* USB Host support */ +/* USB host support */ #define CONFIG_USB_EHCI #define CONFIG_USB_EHCI_TEGRA -#define CONFIG_USB_MAX_CONTROLLER_COUNT 3 +#define CONFIG_USB_MAX_CONTROLLER_COUNT 3 #define CONFIG_USB_STORAGE #define CONFIG_CMD_USB