]> git.sur5r.net Git - u-boot/commitdiff
apalis/colibri_t20/t30: integrate recovery mode detection
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>
Wed, 5 Aug 2015 22:47:00 +0000 (00:47 +0200)
committerTom Warren <twarren@nvidia.com>
Thu, 13 Aug 2015 20:06:01 +0000 (13:06 -0700)
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 <marcel.ziswiler@toradex.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
board/toradex/apalis_t30/apalis_t30.c
board/toradex/colibri_t20/colibri_t20.c
board/toradex/colibri_t30/colibri_t30.c
include/configs/apalis_t30.h
include/configs/colibri_t20.h
include/configs/colibri_t30.h

index 624421496a408fe72128bdf31083ab249559da8f..b7a221902b9d668cb6c158b143232bd55554e406 100644 (file)
@@ -9,7 +9,10 @@
 #include <dm.h>
 #include <asm/arch/gp_padctrl.h>
 #include <asm/arch/pinmux.h>
+#include <asm/arch-tegra/ap.h>
+#include <asm/arch-tegra/tegra.h>
 #include <asm/gpio.h>
+#include <asm/io.h>
 #include <i2c.h>
 #include <netdev.h>
 
 #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
index 8ae9ccf538488dfc2a16570bee81654b2304cb96..7210a8a34ecbbd50cacb5c0b69fd8f57f722acce 100644 (file)
@@ -8,8 +8,20 @@
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
+#include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/board.h>
+#include <asm/arch-tegra/tegra.h>
 #include <asm/gpio.h>
+#include <asm/io.h>
+
+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
 /*
index f4bc7d8728eeda63a0df9b133c3f9fa5757180ee..7ca79eb7f98e1b229511aca27aec5282566ff919 100644 (file)
@@ -8,10 +8,22 @@
 #include <common.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/gp_padctrl.h>
+#include <asm/arch-tegra/ap.h>
+#include <asm/arch-tegra/tegra.h>
+#include <asm/io.h>
 #include "pinmux-config-colibri_t30.h"
 #include <i2c.h>
 #include <asm/gpio.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
  * Description: Do individual peripheral pinmux configs
index bcaea95c4573a35f574b0d5181d96ca772acfd60..7e8ffaeb231ac0a063a120cd6cb268e854be3093 100644 (file)
@@ -11,6 +11,8 @@
 
 #include "tegra30-common.h"
 
+#define CONFIG_ARCH_MISC_INIT
+
 /* High-level configuration options */
 #define CONFIG_TEGRA_BOARD_STRING      "Toradex Apalis T30"
 
index 06c51c0923d199e0686164ef660e5e7ccecb1246..d5be60a3aeae02a17b85fa675dd3d71d9cdcc0d1 100644 (file)
@@ -9,6 +9,8 @@
 
 #include "tegra20-common.h"
 
+#define CONFIG_ARCH_MISC_INIT
+
 /* High-level configuration options */
 #define CONFIG_TEGRA_BOARD_STRING      "Toradex Colibri T20"
 
index fbfebcfc9b32b751afda6fc8120cb8c3f168ee26..f10fa161a70b263636e1ccbf17537c48d4af5862 100644 (file)
@@ -11,6 +11,8 @@
 
 #include "tegra30-common.h"
 
+#define CONFIG_ARCH_MISC_INIT
+
 /* High-level configuration options */
 #define CONFIG_TEGRA_BOARD_STRING      "Toradex Colibri T30"