Commit 7a5f71bc4056591574ea122ba58c55d14145eeb0

Authored by Sourav Poddar
Committed by Tom Rini
1 parent 867f03040f

am43xx_evm: Add qspiboot target

The ePOS EVM and EVM SK have QSPI as an option to boot.  Add a qspiboot
target that utilizes QSPI for env and so forth as an example of best
practices.  As QSPI is booted from directly we need to chang
CONFIG_SYS_TEXT_BASE.

Note that on ePOS EVM the QSPI and NAND are mutually exclusive choices
we need to handle that elsewhere, once NAND support is also added.

Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Tom Rini <trini@ti.com>

Showing 6 changed files with 34 additions and 7 deletions Side-by-side Diff

arch/arm/cpu/armv7/am33xx/board.c
... ... @@ -224,7 +224,7 @@
224 224 set_uart_mux_conf();
225 225 setup_clocks_for_console();
226 226 uart_soft_reset();
227   -#ifdef CONFIG_NOR_BOOT
  227 +#if defined(CONFIG_NOR_BOOT) || defined(CONFIG_QSPI_BOOT)
228 228 gd->baudrate = CONFIG_BAUDRATE;
229 229 serial_init();
230 230 gd->have_console = 1;
board/ti/am43xx/Makefile
... ... @@ -6,7 +6,7 @@
6 6 # SPDX-License-Identifier: GPL-2.0+
7 7 #
8 8  
9   -ifdef CONFIG_SPL_BUILD
  9 +ifeq ($(CONFIG_SKIP_LOWLEVEL_INIT),)
10 10 obj-y := mux.o
11 11 endif
12 12  
board/ti/am43xx/board.c
... ... @@ -70,7 +70,7 @@
70 70 return 0;
71 71 }
72 72  
73   -#ifdef CONFIG_SPL_BUILD
  73 +#ifndef CONFIG_SKIP_LOWLEVEL_INIT
74 74  
75 75 #define NUM_OPPS 6
76 76  
... ... @@ -279,6 +279,7 @@
279 279 Active arm armv7 am33xx ti am335x am335x_evm_uart5 am335x_evm:SERIAL6,CONS_INDEX=6,NAND Tom Rini <trini@ti.com>
280 280 Active arm armv7 am33xx ti am335x am335x_evm_usbspl am335x_evm:SERIAL1,CONS_INDEX=1,NAND,SPL_USBETH_SUPPORT Tom Rini <trini@ti.com>
281 281 Active arm armv7 am33xx ti am43xx am43xx_evm am43xx_evm:SERIAL1,CONS_INDEX=1 Lokesh Vutla <lokeshvutla@ti.com>
  282 +Active arm armv7 am33xx ti am43xx am43xx_evm_qspiboot am43xx_evm:SERIAL1,CONS_INDEX=1,QSPI,QSPI_BOOT Lokesh Vutla <lokeshvutla@ti.com>
282 283 Active arm armv7 am33xx ti ti814x ti814x_evm - Matt Porter <matt.porter@linaro.org>
283 284 Active arm armv7 am33xx ti ti816x ti816x_evm - -
284 285 Active arm armv7 at91 atmel sama5d3_xplained sama5d3_xplained_mmc sama5d3_xplained:SAMA5D3,SYS_USE_MMC Bo Shen <voice.shen@atmel.com>
include/configs/am43xx_evm.h
... ... @@ -48,15 +48,15 @@
48 48 * Since SPL did pll and ddr initialization for us,
49 49 * we don't need to do it twice.
50 50 */
51   -#if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_NOR_BOOT)
  51 +#if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_QSPI_BOOT)
52 52 #define CONFIG_SKIP_LOWLEVEL_INIT
53 53 #endif
54 54  
55 55 /* Now bring in the rest of the common code. */
56 56 #include <configs/ti_armv7_common.h>
57 57  
58   -/* Always 128 KiB env size */
59   -#define CONFIG_ENV_SIZE (128 << 10)
  58 +/* Always 64 KiB env size */
  59 +#define CONFIG_ENV_SIZE (64 << 10)
60 60  
61 61 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
62 62  
... ... @@ -86,6 +86,30 @@
86 86 #define CONFIG_OMAP_USB_PHY
87 87 #define CONFIG_AM437X_USB2PHY2_HOST
88 88  
  89 +#ifdef CONFIG_QSPI_BOOT
  90 +#define CONFIG_SYS_TEXT_BASE 0x30000000
  91 +#undef CONFIG_ENV_IS_NOWHERE
  92 +#define CONFIG_ENV_IS_IN_SPI_FLASH
  93 +#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
  94 +#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
  95 +#define CONFIG_ENV_SECT_SIZE (64 << 10) /* 64 KB sectors */
  96 +#define CONFIG_ENV_OFFSET 0x110000
  97 +#define CONFIG_ENV_OFFSET_REDUND 0x120000
  98 +#ifdef MTDIDS_DEFAULT
  99 +#undef MTDIDS_DEFAULT
  100 +#endif
  101 +#ifdef MTDPARTS_DEFAULT
  102 +#undef MTDPARTS_DEFAULT
  103 +#endif
  104 +#define MTDPARTS_DEFAULT "mtdparts=qspi.0:512k(QSPI.u-boot)," \
  105 + "512k(QSPI.u-boot.backup)," \
  106 + "512k(QSPI.u-boot-spl-os)," \
  107 + "64k(QSPI.u-boot-env)," \
  108 + "64k(QSPI.u-boot-env.backup)," \
  109 + "8m(QSPI.kernel)," \
  110 + "-(QSPI.file-system)"
  111 +#endif
  112 +
89 113 /* SPI */
90 114 #undef CONFIG_OMAP3_SPI
91 115 #define CONFIG_TI_QSPI
... ... @@ -94,6 +118,7 @@
94 118 #define CONFIG_CMD_SF
95 119 #define CONFIG_CMD_SPI
96 120 #define CONFIG_TI_SPI_MMAP
  121 +#define CONFIG_SPI_FLASH_BAR
97 122 #define CONFIG_QSPI_SEL_GPIO 48
98 123 #define CONFIG_SF_DEFAULT_SPEED 48000000
99 124 #define CONFIG_DEFAULT_SPI_MODE SPI_MODE_3
include/configs/ti_armv7_common.h
... ... @@ -196,7 +196,8 @@
196 196 * under common/spl/. Given our generally common memory map, we set a
197 197 * number of related defaults and sizes here.
198 198 */
199   -#ifndef CONFIG_NOR_BOOT
  199 +#if !defined(CONFIG_NOR_BOOT) && \
  200 + !(defined(CONFIG_QSPI_BOOT) && defined(CONFIG_AM43XX))
200 201 #define CONFIG_SPL
201 202 #define CONFIG_SPL_FRAMEWORK
202 203 #define CONFIG_SPL_OS_BOOT