* [U-Boot] [PATCH 1/6] ARM: tegra: Prepare for 64-bit support
@ 2015-03-20 12:24 Thierry Reding
2015-03-20 12:24 ` [U-Boot] [PATCH 2/6] ARM: tegra: Disable SPL and non-cached memory on 64-bit Thierry Reding
` (5 more replies)
0 siblings, 6 replies; 12+ messages in thread
From: Thierry Reding @ 2015-03-20 12:24 UTC (permalink / raw)
To: u-boot
From: Thierry Reding <treding@nvidia.com>
Move various selects from the TEGRA symbol to the symbols for 32-bit
Tegra boards. This is necessary because these settings do not extend
to U-Boot for 64-bit Tegra SoCs. Also tie the private libgcc build
to SPL, it isn't needed on 64-bit Tegra.
Cc: Tom Warren <twarren@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
arch/arm/Kconfig | 4 ----
arch/arm/mach-tegra/Kconfig | 17 +++++++++++++++++
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index b9ebee104628..40d2fac32e91 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -620,10 +620,6 @@ config TARGET_XILINX_ZYNQMP
config TEGRA
bool "NVIDIA Tegra"
- select SUPPORT_SPL
- select SPL
- select OF_CONTROL
- select CPU_V7
config TARGET_VEXPRESS64_AEMV8A
bool "Support vexpress_aemv8a"
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index fccfd79648ac..9b54a4b141f8 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -5,15 +5,31 @@ choice
config TEGRA20
bool "Tegra20 family"
+ select SUPPORT_SPL
+ select SPL
+ select OF_CONTROL
+ select CPU_V7
config TEGRA30
bool "Tegra30 family"
+ select SUPPORT_SPL
+ select SPL
+ select OF_CONTROL
+ select CPU_V7
config TEGRA114
bool "Tegra114 family"
+ select SUPPORT_SPL
+ select SPL
+ select OF_CONTROL
+ select CPU_V7
config TEGRA124
bool "Tegra124 family"
+ select SUPPORT_SPL
+ select SPL
+ select OF_CONTROL
+ select CPU_V7
endchoice
@@ -24,6 +40,7 @@ config SYS_MALLOC_F_LEN
default 0x1800
config USE_PRIVATE_LIBGCC
+ depends on SPL
default y
config DM
--
2.3.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 2/6] ARM: tegra: Disable SPL and non-cached memory on 64-bit
2015-03-20 12:24 [U-Boot] [PATCH 1/6] ARM: tegra: Prepare for 64-bit support Thierry Reding
@ 2015-03-20 12:24 ` Thierry Reding
2015-03-20 16:26 ` Stephen Warren
2015-03-20 12:24 ` [U-Boot] [PATCH 3/6] ARM: tegra: Use standard cache enable for 64-bit Thierry Reding
` (4 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: Thierry Reding @ 2015-03-20 12:24 UTC (permalink / raw)
To: u-boot
From: Thierry Reding <treding@nvidia.com>
For 64-bit ARM SoCs we rely on non-U-Boot code to bring up the CPU in
AArch64 mode so that we don't need the SPL. Non-cached memory is not
implemented (yet) for 64-bit ARM.
Cc: Tom Warren <twarren@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
include/configs/tegra-common.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h
index 2cf1f68404b1..5581d0878380 100644
--- a/include/configs/tegra-common.h
+++ b/include/configs/tegra-common.h
@@ -43,7 +43,9 @@
#define CONFIG_SYS_MALLOC_LEN (4 << 20) /* 4MB */
#endif
+#ifndef CONFIG_ARM64
#define CONFIG_SYS_NONCACHED_MEMORY (1 << 20) /* 1 MiB */
+#endif
/*
* NS16550 Configuration
@@ -109,9 +111,11 @@
#define CONFIG_SYS_MEMTEST_START (NV_PA_SDRC_CS0 + 0x600000)
#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x100000)
+#ifndef CONFIG_ARM64
#ifndef CONFIG_SPL_BUILD
#define CONFIG_USE_ARCH_MEMCPY
#endif
+#endif
/*-----------------------------------------------------------------------
* Physical Memory Map
--
2.3.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 3/6] ARM: tegra: Use standard cache enable for 64-bit
2015-03-20 12:24 [U-Boot] [PATCH 1/6] ARM: tegra: Prepare for 64-bit support Thierry Reding
2015-03-20 12:24 ` [U-Boot] [PATCH 2/6] ARM: tegra: Disable SPL and non-cached memory on 64-bit Thierry Reding
@ 2015-03-20 12:24 ` Thierry Reding
2015-03-20 12:24 ` [U-Boot] [PATCH 4/6] ARM: tegra: Restrict usable RAM to 32-bit on 64-bit SoCs Thierry Reding
` (3 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Thierry Reding @ 2015-03-20 12:24 UTC (permalink / raw)
To: u-boot
From: Thierry Reding <treding@nvidia.com>
On 64-bit SoCs the I-cache isn't enabled in early code, so the default
cache enable functions for 64-bit ARM can be used.
Cc: Tom Warren <twarren@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
arch/arm/mach-tegra/board.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-tegra/board.c b/arch/arm/mach-tegra/board.c
index 0ebaf1932556..7af1a44f49c5 100644
--- a/arch/arm/mach-tegra/board.c
+++ b/arch/arm/mach-tegra/board.c
@@ -190,7 +190,7 @@ void board_init_uart_f(void)
setup_uarts(uart_ids);
}
-#ifndef CONFIG_SYS_DCACHE_OFF
+#if !defined(CONFIG_SYS_DCACHE_OFF) && !defined(CONFIG_ARM64)
void enable_caches(void)
{
/* Enable D-cache. I-cache is already enabled in start.S */
--
2.3.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 4/6] ARM: tegra: Restrict usable RAM to 32-bit on 64-bit SoCs
2015-03-20 12:24 [U-Boot] [PATCH 1/6] ARM: tegra: Prepare for 64-bit support Thierry Reding
2015-03-20 12:24 ` [U-Boot] [PATCH 2/6] ARM: tegra: Disable SPL and non-cached memory on 64-bit Thierry Reding
2015-03-20 12:24 ` [U-Boot] [PATCH 3/6] ARM: tegra: Use standard cache enable for 64-bit Thierry Reding
@ 2015-03-20 12:24 ` Thierry Reding
2015-03-20 12:24 ` [U-Boot] [PATCH 5/6] ARM: tegra: Skip FDT and initrd relocation on 64-bit Thierry Reding
` (2 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Thierry Reding @ 2015-03-20 12:24 UTC (permalink / raw)
To: u-boot
From: Thierry Reding <treding@nvidia.com>
Most peripherals on Tegra can do DMA only to the lower 32-bit address
space, even on 64-bit SoCs. This limitation is typically overcome by the
use of an IOMMU. Since the IOMMU is not entirely trivial to set up and
serves no other purpose (I/O protection, ...) in U-Boot, restrict 64-bit
Tegra SoCs to the lower 32-bit address space for RAM. This ensures that
the physical addresses of buffers that are programmed into the various
DMA engines are valid and don't alias to lower addresses.
Cc: Tom Warren <twarren@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
board/nvidia/common/board.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index d945de456ea2..1134b31791db 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -264,3 +264,19 @@ void pad_init_mmc(struct mmc_host *host)
#endif /* T30 */
}
#endif /* MMC */
+
+#ifdef CONFIG_ARM64
+/*
+ * Most hardware on 64-bit Tegra is still restricted to DMA to the lower
+ * 32-bits of the physical address space. Cap the maximum usable RAM area
+ * at 4 GiB to avoid DMA buffers from being allocated beyond the 32-bit
+ * boundary that most devices can address.
+ */
+ulong board_get_usable_ram_top(ulong total_size)
+{
+ if (gd->ram_top > 0x100000000)
+ return 0x100000000;
+
+ return gd->ram_top;
+}
+#endif
--
2.3.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 5/6] ARM: tegra: Skip FDT and initrd relocation on 64-bit
2015-03-20 12:24 [U-Boot] [PATCH 1/6] ARM: tegra: Prepare for 64-bit support Thierry Reding
` (2 preceding siblings ...)
2015-03-20 12:24 ` [U-Boot] [PATCH 4/6] ARM: tegra: Restrict usable RAM to 32-bit on 64-bit SoCs Thierry Reding
@ 2015-03-20 12:24 ` Thierry Reding
2015-03-20 12:24 ` [U-Boot] [PATCH 6/6] ARM: tegra: Make pinmux.h standalone includible Thierry Reding
2015-03-20 16:24 ` [U-Boot] [PATCH 1/6] ARM: tegra: Prepare for 64-bit support Stephen Warren
5 siblings, 0 replies; 12+ messages in thread
From: Thierry Reding @ 2015-03-20 12:24 UTC (permalink / raw)
To: u-boot
From: Thierry Reding <treding@nvidia.com>
U-Boot inspects the initrd_high and fdt_high environment variables and
skips relocation of the initial ramdisk and FDT, respectively, if these
variables are set to all-ones. The Tegra configuration sets these
variables to ffffffff in the default environment. However on 64-bit SoC
generations this will cause the all-ones match to fail, so extend these
variables to 64 ones on 64-bit SoCs.
Cc: Tom Warren <twarren@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
include/configs/tegra-common-post.h | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/include/configs/tegra-common-post.h b/include/configs/tegra-common-post.h
index c3ad8beb903d..c1272a0d5b64 100644
--- a/include/configs/tegra-common-post.h
+++ b/include/configs/tegra-common-post.h
@@ -50,11 +50,19 @@
#define BOARD_EXTRA_ENV_SETTINGS
#endif
+#ifdef CONFIG_ARM64
+#define FDT_HIGH "ffffffffffffffff"
+#define INITRD_HIGH "ffffffffffffffff"
+#else
+#define FDT_HIGH "ffffffff"
+#define INITRD_HIGH "ffffffff"
+#endif
+
#define CONFIG_EXTRA_ENV_SETTINGS \
TEGRA_DEVICE_SETTINGS \
MEM_LAYOUT_ENV_SETTINGS \
- "fdt_high=ffffffff\0" \
- "initrd_high=ffffffff\0" \
+ "fdt_high=" FDT_HIGH "\0" \
+ "initrd_high=" INITRD_HIGH "\0" \
BOOTENV \
BOARD_EXTRA_ENV_SETTINGS
--
2.3.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 6/6] ARM: tegra: Make pinmux.h standalone includible
2015-03-20 12:24 [U-Boot] [PATCH 1/6] ARM: tegra: Prepare for 64-bit support Thierry Reding
` (3 preceding siblings ...)
2015-03-20 12:24 ` [U-Boot] [PATCH 5/6] ARM: tegra: Skip FDT and initrd relocation on 64-bit Thierry Reding
@ 2015-03-20 12:24 ` Thierry Reding
2015-03-20 16:30 ` Stephen Warren
2015-03-20 16:24 ` [U-Boot] [PATCH 1/6] ARM: tegra: Prepare for 64-bit support Stephen Warren
5 siblings, 1 reply; 12+ messages in thread
From: Thierry Reding @ 2015-03-20 12:24 UTC (permalink / raw)
To: u-boot
From: Thierry Reding <treding@nvidia.com>
This header file uses type definitions (u8, u32) from linux/types.h but
doesn't include it. If includes aren't carefully ordered this can cause
build failures.
Cc: Tom Warren <twarren@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
arch/arm/include/asm/arch-tegra/pinmux.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/include/asm/arch-tegra/pinmux.h b/arch/arm/include/asm/arch-tegra/pinmux.h
index 4212e5769930..9384985259db 100644
--- a/arch/arm/include/asm/arch-tegra/pinmux.h
+++ b/arch/arm/include/asm/arch-tegra/pinmux.h
@@ -8,6 +8,8 @@
#ifndef _TEGRA_PINMUX_H_
#define _TEGRA_PINMUX_H_
+#include <linux/types.h>
+
#include <asm/arch/tegra.h>
/* The pullup/pulldown state of a pin group */
--
2.3.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 1/6] ARM: tegra: Prepare for 64-bit support
2015-03-20 12:24 [U-Boot] [PATCH 1/6] ARM: tegra: Prepare for 64-bit support Thierry Reding
` (4 preceding siblings ...)
2015-03-20 12:24 ` [U-Boot] [PATCH 6/6] ARM: tegra: Make pinmux.h standalone includible Thierry Reding
@ 2015-03-20 16:24 ` Stephen Warren
2015-03-25 4:02 ` Masahiro Yamada
5 siblings, 1 reply; 12+ messages in thread
From: Stephen Warren @ 2015-03-20 16:24 UTC (permalink / raw)
To: u-boot
On 03/20/2015 06:24 AM, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> Move various selects from the TEGRA symbol to the symbols for 32-bit
> Tegra boards. This is necessary because these settings do not extend
> to U-Boot for 64-bit Tegra SoCs. Also tie the private libgcc build
> to SPL, it isn't needed on 64-bit Tegra.
I vaguely recall Masahiro enabling SPL for all Tegra builds recently for
some reason...
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 2/6] ARM: tegra: Disable SPL and non-cached memory on 64-bit
2015-03-20 12:24 ` [U-Boot] [PATCH 2/6] ARM: tegra: Disable SPL and non-cached memory on 64-bit Thierry Reding
@ 2015-03-20 16:26 ` Stephen Warren
2015-03-20 17:09 ` Tom Rini
0 siblings, 1 reply; 12+ messages in thread
From: Stephen Warren @ 2015-03-20 16:26 UTC (permalink / raw)
To: u-boot
On 03/20/2015 06:24 AM, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> For 64-bit ARM SoCs we rely on non-U-Boot code to bring up the CPU in
> AArch64 mode so that we don't need the SPL. Non-cached memory is not
> implemented (yet) for 64-bit ARM.
> diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h
> +#ifndef CONFIG_ARM64
> #ifndef CONFIG_SPL_BUILD
> #define CONFIG_USE_ARCH_MEMCPY
> #endif
> +#endif
We don't need SPL, but that stanza used to enable ARCH_MEMCPY *except*
for SPL. I would expect we still want ARCH_MEMCPY on ARM64, where
presumably ifndef CONFIG_SPL_BUILD will always be true?
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 6/6] ARM: tegra: Make pinmux.h standalone includible
2015-03-20 12:24 ` [U-Boot] [PATCH 6/6] ARM: tegra: Make pinmux.h standalone includible Thierry Reding
@ 2015-03-20 16:30 ` Stephen Warren
0 siblings, 0 replies; 12+ messages in thread
From: Stephen Warren @ 2015-03-20 16:30 UTC (permalink / raw)
To: u-boot
On 03/20/2015 06:24 AM, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> This header file uses type definitions (u8, u32) from linux/types.h but
> doesn't include it. If includes aren't carefully ordered this can cause
> build failures.
I think patches 3-6 look fine, so they're,
Acked-by: Stephen Warren <swarren@nvidia.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 2/6] ARM: tegra: Disable SPL and non-cached memory on 64-bit
2015-03-20 16:26 ` Stephen Warren
@ 2015-03-20 17:09 ` Tom Rini
2015-03-20 18:26 ` Stephen Warren
0 siblings, 1 reply; 12+ messages in thread
From: Tom Rini @ 2015-03-20 17:09 UTC (permalink / raw)
To: u-boot
On Fri, Mar 20, 2015 at 10:26:12AM -0600, Stephen Warren wrote:
> On 03/20/2015 06:24 AM, Thierry Reding wrote:
> >From: Thierry Reding <treding@nvidia.com>
> >
> >For 64-bit ARM SoCs we rely on non-U-Boot code to bring up the CPU in
> >AArch64 mode so that we don't need the SPL. Non-cached memory is not
> >implemented (yet) for 64-bit ARM.
>
> >diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h
>
> >+#ifndef CONFIG_ARM64
> > #ifndef CONFIG_SPL_BUILD
> > #define CONFIG_USE_ARCH_MEMCPY
> > #endif
> >+#endif
>
> We don't need SPL, but that stanza used to enable ARCH_MEMCPY
> *except* for SPL. I would expect we still want ARCH_MEMCPY on ARM64,
> where presumably ifndef CONFIG_SPL_BUILD will always be true?
First we need arch memcpy/memset for aarch64 copied over (and maybe
update the 32bit one and get everyone using them).
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150320/23ea86ac/attachment.sig>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 2/6] ARM: tegra: Disable SPL and non-cached memory on 64-bit
2015-03-20 17:09 ` Tom Rini
@ 2015-03-20 18:26 ` Stephen Warren
0 siblings, 0 replies; 12+ messages in thread
From: Stephen Warren @ 2015-03-20 18:26 UTC (permalink / raw)
To: u-boot
On 03/20/2015 11:09 AM, Tom Rini wrote:
> On Fri, Mar 20, 2015 at 10:26:12AM -0600, Stephen Warren wrote:
>> On 03/20/2015 06:24 AM, Thierry Reding wrote:
>>> From: Thierry Reding <treding@nvidia.com>
>>>
>>> For 64-bit ARM SoCs we rely on non-U-Boot code to bring up the CPU in
>>> AArch64 mode so that we don't need the SPL. Non-cached memory is not
>>> implemented (yet) for 64-bit ARM.
>>
>>> diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h
>>
>>> +#ifndef CONFIG_ARM64
>>> #ifndef CONFIG_SPL_BUILD
>>> #define CONFIG_USE_ARCH_MEMCPY
>>> #endif
>>> +#endif
>>
>> We don't need SPL, but that stanza used to enable ARCH_MEMCPY
>> *except* for SPL. I would expect we still want ARCH_MEMCPY on ARM64,
>> where presumably ifndef CONFIG_SPL_BUILD will always be true?
>
> First we need arch memcpy/memset for aarch64 copied over (and maybe
> update the 32bit one and get everyone using them).
Oh, that's missing? OK, it makes sense to disable it. However, the
commit description probably shouldn't imply this is related to having
SPL or not, but rather that ARM64 doesn't support ARCH_MEMCPY yet?
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 1/6] ARM: tegra: Prepare for 64-bit support
2015-03-20 16:24 ` [U-Boot] [PATCH 1/6] ARM: tegra: Prepare for 64-bit support Stephen Warren
@ 2015-03-25 4:02 ` Masahiro Yamada
0 siblings, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2015-03-25 4:02 UTC (permalink / raw)
To: u-boot
Hi.
2015-03-21 1:24 GMT+09:00 Stephen Warren <swarren@wwwdotorg.org>:
> On 03/20/2015 06:24 AM, Thierry Reding wrote:
>>
>> From: Thierry Reding <treding@nvidia.com>
>>
>> Move various selects from the TEGRA symbol to the symbols for 32-bit
>> Tegra boards. This is necessary because these settings do not extend
>> to U-Boot for 64-bit Tegra SoCs. Also tie the private libgcc build
>> to SPL, it isn't needed on 64-bit Tegra.
>
>
> I vaguely recall Masahiro enabling SPL for all Tegra builds recently for
> some reason...
Yes.
I enabled the private library for the U-boot proper of Tegra as well as SPL.
This change happened when we stitched into the single .config configuration
as CONFIG_SPL_BUILD no longer appears in Kconfig.
This thread:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/212545/focus=212771
As for Kconfig side, this patch looks good to me.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-03-25 4:02 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-20 12:24 [U-Boot] [PATCH 1/6] ARM: tegra: Prepare for 64-bit support Thierry Reding
2015-03-20 12:24 ` [U-Boot] [PATCH 2/6] ARM: tegra: Disable SPL and non-cached memory on 64-bit Thierry Reding
2015-03-20 16:26 ` Stephen Warren
2015-03-20 17:09 ` Tom Rini
2015-03-20 18:26 ` Stephen Warren
2015-03-20 12:24 ` [U-Boot] [PATCH 3/6] ARM: tegra: Use standard cache enable for 64-bit Thierry Reding
2015-03-20 12:24 ` [U-Boot] [PATCH 4/6] ARM: tegra: Restrict usable RAM to 32-bit on 64-bit SoCs Thierry Reding
2015-03-20 12:24 ` [U-Boot] [PATCH 5/6] ARM: tegra: Skip FDT and initrd relocation on 64-bit Thierry Reding
2015-03-20 12:24 ` [U-Boot] [PATCH 6/6] ARM: tegra: Make pinmux.h standalone includible Thierry Reding
2015-03-20 16:30 ` Stephen Warren
2015-03-20 16:24 ` [U-Boot] [PATCH 1/6] ARM: tegra: Prepare for 64-bit support Stephen Warren
2015-03-25 4:02 ` Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox