[U-Boot] [PATCH 57/60] ARM: tegra: don't access Boot Info Table from board code

Stephen Warren
2016-04-19T20:59:37Z

From: Stephen Warren <swarren@nvidia.com>

The only use of the BIT was to print a message indicating whether the
system booted via cold boot or USB ReCovery Mode (RCM). If that is worth
doing for some boards, it's worth doing for all, so make the core Tegra
code do that.

This will allow the definitions related to the BIT to be removed from
global visibility, and isolated into Tegra-specific code. This also avoids
the need to implement arch_misc_init() for a couple of boards.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
arch/arm/mach-tegra/board2.c | 4 ++++
board/toradex/apalis_t30/apalis_t30.c | 10 ----------
board/toradex/colibri_t20/colibri_t20.c | 5 -----
board/toradex/colibri_t30/colibri_t30.c | 10 ----------
include/configs/apalis_t30.h | 2 --
include/configs/colibri_t30.h | 2 --
6 files changed, 4 insertions(+), 29 deletions(-)

diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c
index 85de903559c6..cc12073d8ada 100644
--- a/arch/arm/mach-tegra/board2.c
+++ b/arch/arm/mach-tegra/board2.c
@@ -61,6 +61,10 @@ int checkboard(void)
printf(", ID: %d\n", board_id);
printf("\n");

+ if (readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BOOTTYPE) ==
+ NVBOOTTYPE_RECOVERY)
+ printf("Booted via USB recovery mode\n");
+
return 0;
}
#endif /* CONFIG_DISPLAY_BOARDINFO */
diff --git a/board/toradex/apalis_t30/apalis_t30.c b/board/toradex/apalis_t30/apalis_t30.c
index 3db9308323fd..9670018e1b7f 100644
--- a/board/toradex/apalis_t30/apalis_t30.c
+++ b/board/toradex/apalis_t30/apalis_t30.c
@@ -11,7 +11,6 @@
#include <i2c.h>
#include <asm/arch-tegra/tegra.h>
#include <asm/gpio.h>
-#include <asm/io.h>
#include <mach/board_init.h>
#include <mach/pinmux.h>
#include <mach/spl_uart.h>
@@ -21,15 +20,6 @@
#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;
-}
-
void tegra_spl_board_init(void)
{
tegra30_pinmux_uarta_ulpi();
diff --git a/board/toradex/colibri_t20/colibri_t20.c b/board/toradex/colibri_t20/colibri_t20.c
index 37d1d9c71eef..a7f15472536c 100644
--- a/board/toradex/colibri_t20/colibri_t20.c
+++ b/board/toradex/colibri_t20/colibri_t20.c
@@ -9,7 +9,6 @@
#include <dt-bindings/gpio/tegra-gpio.h>
#include <i2c.h>
#include <asm/gpio.h>
-#include <asm/io.h>
#include <asm/arch/clock.h>
#include <asm/arch-tegra/tegra.h>
#include <mach/board.h>
@@ -108,9 +107,5 @@ int arch_misc_init(void)
/* make sure SODIMM pin 87 nRESET_OUT is released properly */
pinmux_set_func(PMUX_PINGRP_ATA, PMUX_FUNC_GMI);

- if (readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BOOTTYPE) ==
- NVBOOTTYPE_RECOVERY)
- printf("USB recovery mode\n");
-
return 0;
}
diff --git a/board/toradex/colibri_t30/colibri_t30.c b/board/toradex/colibri_t30/colibri_t30.c
index 1860ac4fec4e..8188b2fb64b1 100644
--- a/board/toradex/colibri_t30/colibri_t30.c
+++ b/board/toradex/colibri_t30/colibri_t30.c
@@ -10,22 +10,12 @@
#include <i2c.h>
#include <dt-bindings/gpio/tegra-gpio.h>
#include <asm/gpio.h>
-#include <asm/io.h>
#include <asm/arch-tegra/tegra.h>
#include <mach/board_init.h>
#include <mach/pinmux.h>
#include <mach/spl_uart.h>
#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;
-}
-
void tegra_spl_board_init(void)
{
tegra30_pinmux_uarta_ulpi();
diff --git a/include/configs/apalis_t30.h b/include/configs/apalis_t30.h
index d104aa9ccae9..2d2b6af8fb2f 100644
--- a/include/configs/apalis_t30.h
+++ b/include/configs/apalis_t30.h
@@ -14,8 +14,6 @@

#include "tegra30-common.h"

-#define CONFIG_ARCH_MISC_INIT
-
/* High-level configuration options */
#define CONFIG_TEGRA_BOARD_STRING "Toradex Apalis T30"

diff --git a/include/configs/colibri_t30.h b/include/configs/colibri_t30.h
index e5aaab742388..2af03d10c429 100644
--- a/include/configs/colibri_t30.h
+++ b/include/configs/colibri_t30.h
@@ -14,8 +14,6 @@

#include "tegra30-common.h"

-#define CONFIG_ARCH_MISC_INIT
-
/* High-level configuration options */
#define CONFIG_TEGRA_BOARD_STRING "Toradex Colibri T30"

--
2.8.1