Re: [U-Boot] [PATCH 2/2] arm: add spl relocation support for armv8

2019-04-29 Thread Marek Vasut
On 4/29/19 1:58 PM, Andy Yan wrote:
> Hi Marek, Fabio:
> 
> On 2019/4/29 下午7:46, Marek Vasut wrote:
>> On 4/29/19 1:38 PM, Andy Yan wrote:
>>> Hi Fabio:
>>>
>>> On 2019/4/29 下午7:08, Fabio Estevam wrote:
 Hi Andy,

 On Mon, Apr 29, 2019 at 6:06 AM Andy Yan 
 wrote:
> Relocate spl itself to a high memory.
 Please improve the commit message and explain the reason for doing
 this.


>>> The detail reason I described in [PATCH 1/2],  you are in the list.
>> Once this is committed to git, there will be no PATCH 1/2 in the git log
>> , so the commit message should explain what this patch does.
>>
> 
> I will add the detail in next version.

Thanks

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] arm: add spl relocation support for armv8

2019-04-29 Thread Andy Yan

Hi Marek, Fabio:

On 2019/4/29 下午7:46, Marek Vasut wrote:

On 4/29/19 1:38 PM, Andy Yan wrote:

Hi Fabio:

On 2019/4/29 下午7:08, Fabio Estevam wrote:

Hi Andy,

On Mon, Apr 29, 2019 at 6:06 AM Andy Yan  wrote:

Relocate spl itself to a high memory.

Please improve the commit message and explain the reason for doing this.



The detail reason I described in [PATCH 1/2],  you are in the list.

Once this is committed to git, there will be no PATCH 1/2 in the git log
, so the commit message should explain what this patch does.



I will add the detail in next version.



___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] arm: add spl relocation support for armv8

2019-04-29 Thread Marek Vasut
On 4/29/19 1:38 PM, Andy Yan wrote:
> Hi Fabio:
> 
> On 2019/4/29 下午7:08, Fabio Estevam wrote:
>> Hi Andy,
>>
>> On Mon, Apr 29, 2019 at 6:06 AM Andy Yan  wrote:
>>> Relocate spl itself to a high memory.
>> Please improve the commit message and explain the reason for doing this.
>>
>>
> 
> The detail reason I described in [PATCH 1/2],  you are in the list.

Once this is committed to git, there will be no PATCH 1/2 in the git log
, so the commit message should explain what this patch does.

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] arm: add spl relocation support for armv8

2019-04-29 Thread Andy Yan

Hi Fabio:

On 2019/4/29 下午7:08, Fabio Estevam wrote:

Hi Andy,

On Mon, Apr 29, 2019 at 6:06 AM Andy Yan  wrote:

Relocate spl itself to a high memory.

Please improve the commit message and explain the reason for doing this.




The detail reason I described in [PATCH 1/2],  you are in the list.



___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] arm: add spl relocation support for armv8

2019-04-29 Thread Fabio Estevam
Hi Andy,

On Mon, Apr 29, 2019 at 6:06 AM Andy Yan  wrote:
>
> Relocate spl itself to a high memory.

Please improve the commit message and explain the reason for doing this.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 2/2] arm: add spl relocation support for armv8

2019-04-29 Thread Andy Yan
Relocate spl itself to a high memory.

Signed-off-by: Andy Yan 
---

 arch/arm/config.mk|  6 ++
 arch/arm/cpu/armv8/start.S|  4 
 arch/arm/cpu/armv8/u-boot-spl.lds | 17 +
 arch/arm/lib/Makefile |  2 +-
 arch/arm/lib/crt0_64.S|  3 ++-
 5 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index f25603109e..7f6ad89601 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -102,6 +102,12 @@ endif
 # needed for relocation
 LDFLAGS_u-boot += -pie
 
+ifndef CONFIG_SPL_SKIP_RELOCATE
+LDFLAGS_u-boot-spl = -pie
+else
+SPL_LDFLAGS_u-boot-spl =
+endif
+
 #
 # FIXME: binutils versions < 2.22 have a bug in the assembler where
 # branches to weak symbols can be incorrectly optimized in thumb mode
diff --git a/arch/arm/cpu/armv8/start.S b/arch/arm/cpu/armv8/start.S
index fe52166e28..a7dad3cd69 100644
--- a/arch/arm/cpu/armv8/start.S
+++ b/arch/arm/cpu/armv8/start.S
@@ -35,7 +35,11 @@ _start:
 
 .globl _TEXT_BASE
 _TEXT_BASE:
+#if defined(CONFIG_SPL_BUILD)
+   .quad   CONFIG_SPL_TEXT_BASE
+#else
.quad   CONFIG_SYS_TEXT_BASE
+#endif
 
 /*
  * These are defined in the linker script.
diff --git a/arch/arm/cpu/armv8/u-boot-spl.lds 
b/arch/arm/cpu/armv8/u-boot-spl.lds
index ccbf359bd1..64102afc8b 100644
--- a/arch/arm/cpu/armv8/u-boot-spl.lds
+++ b/arch/arm/cpu/armv8/u-boot-spl.lds
@@ -53,6 +53,23 @@ SECTIONS
*(.__end)
} >.sram
 
+#ifndef CONFIG_SPL_SKIP_RELOCATE
+   . = ALIGN(8);
+
+   .rel_dyn_start :
+   {
+   *(.__rel_dyn_start)
+   } >.sram
+
+   .rela.dyn : {
+   *(.rela*)
+   } >.sram
+
+   .rel_dyn_end :
+   {
+   *(.__rel_dyn_end)
+   } >.sram
+#endif
_image_binary_end = .;
 
.bss_start (NOLOAD) : {
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 48ee6c3c60..f27b3fb79f 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -21,7 +21,7 @@ else
 obj-y   += setjmp.o
 endif
 
-ifndef CONFIG_SPL_BUILD
+ifndef CONFIG_TPL_BUILD
 ifdef CONFIG_ARM64
 obj-y  += relocate_64.o
 else
diff --git a/arch/arm/lib/crt0_64.S b/arch/arm/lib/crt0_64.S
index d6b632aa87..e5605fe325 100644
--- a/arch/arm/lib/crt0_64.S
+++ b/arch/arm/lib/crt0_64.S
@@ -89,7 +89,8 @@ ENTRY(_main)
mov x0, #0
bl  board_init_f
 
-#if !defined(CONFIG_SPL_BUILD)
+#if (defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) && 
!defined(CONFIG_SPL_SKIP_RELOCATE)) || \
+   !defined(CONFIG_SPL_BUILD)
 /*
  * Set up intermediate environment (new sp and gd) and call
  * relocate_code(addr_moni). Trick here is that we'll return
-- 
2.17.1



___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot