ti: AM43xx: Use CONFIG options from SOC Kconfig

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>
This commit is contained in:
Madan Srinivas 2016-05-19 19:10:47 -05:00 committed by Tom Rini
parent 883dfd1553
commit 9aac7d0ec9
3 changed files with 9 additions and 12 deletions

View File

@ -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

View File

@ -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

View File

@ -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