U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Allred <d-allred@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 07/15] ti: AM43xx: Use CONFIG options from SOC Kconfig
Date: Thu, 19 May 2016 19:10:47 -0500	[thread overview]
Message-ID: <1463703055-17484-8-git-send-email-d-allred@ti.com> (raw)
In-Reply-To: <1463703055-17484-1-git-send-email-d-allred@ti.com>

From: Madan Srinivas <madans@ti.com>

Updates configs/am43xx_evm.h to use CONFIG options from
SOC specific Kconfig file for various calculations.

On AM43x devices, the address of SPL entry point  depends on
the device type, i.e. whether it is secure or non-secure.

Further, for non-secure devices, the SPL entry point is different
between  USB HOST boot mode, other "memory" boot modes (MMC, NAND)
and "peripheral" boot modes (UART, USB)

To add to the complexity, on secure devices, in addition to the
above differences, the SPL entry point can change because of the
space occupied by other components (other than u-boot or spl)
that go into a secure boot image.

To prevent the user from having to modify source files every time
any component of the secure image changes, the value of
CONFIG_SPL_TEXT_BASE has been set using a Kconfig option that
is supplied in the am43xx_*_defconfig files

Using the CONFIG options also enables us to do away with some
compile time flags that were used to specify CONFIG_SPL_TEXT_BASE
for different boot modes.

On QSPI devices, the same problem described above occurs w.r.t. the
address of the u-boot entry point in flash, when booting secure
devices. To handle this, CONFIG_SYS_TEXT_BASE is also setup via
a Kconfig option and the defconfig files.

Signed-off-by: Madan Srinivas <madans@ti.com>
Signed-off-by: Daniel Allred <d-allred@ti.com>

Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Tested-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
 
V3:
 None

V2:
 Rebase against current master

 configs/am43xx_evm_qspiboot_defconfig     |  1 +
 configs/am43xx_evm_usbhost_boot_defconfig |  1 +
 include/configs/am43xx_evm.h              | 19 +++++++------------
 3 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/configs/am43xx_evm_qspiboot_defconfig b/configs/am43xx_evm_qspiboot_defconfig
index bda0ae1..79eac88 100644
--- a/configs/am43xx_evm_qspiboot_defconfig
+++ b/configs/am43xx_evm_qspiboot_defconfig
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_AM43XX=y
 CONFIG_TARGET_AM43XX_EVM=y
+CONFIG_ISW_ENTRY_ADDR=0x30000000
 CONFIG_SYS_EXTRA_OPTIONS="SERIAL1,CONS_INDEX=1,QSPI,QSPI_BOOT"
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
diff --git a/configs/am43xx_evm_usbhost_boot_defconfig b/configs/am43xx_evm_usbhost_boot_defconfig
index d9fc4de..9943be2 100644
--- a/configs/am43xx_evm_usbhost_boot_defconfig
+++ b/configs/am43xx_evm_usbhost_boot_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_AM43XX=y
 CONFIG_TARGET_AM43XX_EVM=y
 CONFIG_SPL=y
+CONFIG_ISW_ENTRY_ADDR=0x40300350
 CONFIG_SYS_EXTRA_OPTIONS="SERIAL1,CONS_INDEX=1,NAND,SPL_USB_HOST_SUPPORT"
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
diff --git a/include/configs/am43xx_evm.h b/include/configs/am43xx_evm.h
index a35541b..8a48a9a 100644
--- a/include/configs/am43xx_evm.h
+++ b/include/configs/am43xx_evm.h
@@ -37,17 +37,10 @@
 #define CONFIG_POWER_TPS62362
 
 /* SPL defines. */
-#ifdef CONFIG_SPL_USB_HOST_SUPPORT
-/*
- * For USB host boot, ROM uses DMA for copying MLO from USB storage
- * and ARM internal ram is not accessible for DMA, so SPL text base
- * should be in OCMC ram
- */
-#define CONFIG_SPL_TEXT_BASE		0x40300350
-#else
-#define CONFIG_SPL_TEXT_BASE		0x402F4000
-#endif
-#define CONFIG_SPL_MAX_SIZE		(220 << 10)	/* 220KB */
+#define CONFIG_SPL_TEXT_BASE		CONFIG_ISW_ENTRY_ADDR
+#define CONFIG_SPL_MAX_SIZE		(NON_SECURE_SRAM_END - \
+					CONFIG_PUB_ROM_DATA_SIZE - \
+					CONFIG_SPL_TEXT_BASE)
 #define CONFIG_SYS_SPL_ARGS_ADDR	(CONFIG_SYS_SDRAM_BASE + \
 					 (128 << 20))
 #define CONFIG_SPL_POWER_SUPPORT
@@ -190,7 +183,9 @@
 #endif
 
 #ifdef CONFIG_QSPI_BOOT
-#define CONFIG_SYS_TEXT_BASE           0x30000000
+#ifndef CONFIG_SYS_TEXT_BASE
+#define CONFIG_SYS_TEXT_BASE		CONFIG_ISW_ENTRY_ADDR
+#endif
 #undef CONFIG_ENV_IS_IN_FAT
 #define CONFIG_ENV_IS_IN_SPI_FLASH
 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
-- 
1.9.1

  parent reply	other threads:[~2016-05-20  0:10 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-20  0:10 [U-Boot] [PATCH v3 00/15] Support for boot image creation for TI secure devices Daniel Allred
2016-05-20  0:10 ` [U-Boot] [PATCH v3 01/15] doc: Add info on using secure devices from TI Daniel Allred
2016-05-30 18:07   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-05-20  0:10 ` [U-Boot] [PATCH v3 02/15] arm: am33xx: Kconfig: Add secure device definitions Daniel Allred
2016-05-30 18:01   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-05-20  0:10 ` [U-Boot] [PATCH v3 03/15] arm: Kconfig: Add support for AM43xx SoC specific Kconfig Daniel Allred
2016-05-30 18:01   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-05-20  0:10 ` [U-Boot] [PATCH v3 04/15] ti: omap-common: Add Kconfig file for secure device support Daniel Allred
2016-05-30 18:01   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-05-20  0:10 ` [U-Boot] [PATCH v3 05/15] ti: omap-common: Add commands for generating secure SPL images Daniel Allred
2016-05-30 18:02   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-05-20  0:10 ` [U-Boot] [PATCH v3 06/15] ti: AM43xx: config.mk: Add support for generating secure boot images Daniel Allred
2016-05-30 18:02   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-05-30 18:02   ` Tom Rini
2016-05-20  0:10 ` Daniel Allred [this message]
2016-05-30 18:02   ` [U-Boot] [U-Boot, v3, 07/15] ti: AM43xx: Use CONFIG options from SOC Kconfig Tom Rini
2016-05-20  0:10 ` [U-Boot] [PATCH v3 08/15] ti: AM43xx: board: Detect AM43xx HS EVM Daniel Allred
2016-05-30 18:02   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-05-20  0:10 ` [U-Boot] [PATCH v3 09/15] defconfig: Add a config for AM43xx secure part Daniel Allred
2016-05-30 18:02   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-05-20  0:10 ` [U-Boot] [PATCH v3 10/15] ti_omap5_common: Update SPL start address on secure parts Daniel Allred
2016-05-20 13:02   ` Tom Rini
2016-05-30 18:02   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-05-20  0:10 ` [U-Boot] [PATCH v3 11/15] spl: build: ti: add support for secure boot images Daniel Allred
2016-05-30 18:02   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-05-20  0:10 ` [U-Boot] [PATCH v3 12/15] ARM: omap-common: Add device type to CPU string Daniel Allred
2016-05-30 18:02   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-05-20  0:10 ` [U-Boot] [PATCH v3 13/15] ARM: omap5: add hooks for cpu/SoC fdt fixups Daniel Allred
2016-05-30 18:02   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-05-20  0:10 ` [U-Boot] [PATCH v3 14/15] ARM: omap5: add ft_board_setup for dra7xx/am57xx Daniel Allred
2016-05-30 18:02   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-05-20  0:10 ` [U-Boot] [PATCH v3 15/15] defconfig: ti: Add configs for OMAP5-class secure parts Daniel Allred
2016-05-30 18:03   ` [U-Boot] [U-Boot, v3, " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1463703055-17484-8-git-send-email-d-allred@ti.com \
    --to=d-allred@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox