All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point
@ 2018-06-08  8:47 Mian Yousaf Kaukab
  2018-06-08  8:47 ` [U-Boot] [PATCH RESEND 2/2] rockchip: make_fit_atf: make python3 compatible Mian Yousaf Kaukab
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Mian Yousaf Kaukab @ 2018-06-08  8:47 UTC (permalink / raw)
  To: u-boot

make_fit_atf.py uses physical address of first segment as the
entry point to bl31. It is incorrect and causes following abort
when bl31_entry() is called:

U-Boot SPL board initTrying to boot from MMC1
"Synchronous Abort" handler, esr 0x02000000
elr: 0000000000000000 lr : 00000000ff8c7e8c
x 0: 00000000ff8e0000 x 1: 0000000000000000
x 2: 0000000000000000 x 3: 00000000ff8e0180
x 4: 0000000000000000 x 5: 0000000000000000
x 6: 0000000000000030 x 7: 00000000ff8e0188
x 8: 00000000000001e0 x 9: 0000000000000000
x10: 000000000007fcdc x11: 00000000002881b8
x12: 00000000000001a2 x13: 0000000000000198
x14: 000000000007fdcc x15: 00000000002881b8
x16: 00000000003c0724 x17: 00000000003c0718
x18: 000000000007fe80 x19: 00000000ff8e0000
x20: 0000000000200000 x21: 00000000ff8e0000
x22: 0000000000000000 x23: 000000000007fe30
x24: 00000000ff8d1c3c x25: 00000000ff8d5000
x26: 00000000deadbeef x27: 00000000000004a0
x28: 000000000000009c x29: 000000000007fd90

Fix it by using the entry point from the elf header.

Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
---
 arch/arm/mach-rockchip/make_fit_atf.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py
index 6b3d9201c9..b88a5e1f16 100755
--- a/arch/arm/mach-rockchip/make_fit_atf.py
+++ b/arch/arm/mach-rockchip/make_fit_atf.py
@@ -53,7 +53,7 @@ DT_END="""
 };
 """
 
-def append_atf_node(file, atf_index, phy_addr):
+def append_atf_node(file, atf_index, phy_addr, elf_entry):
     """
     Append ATF DT node to input FIT dts file.
     """
@@ -67,7 +67,7 @@ def append_atf_node(file, atf_index, phy_addr):
     print >> file, '\t\t\tcompression = "none";'
     print >> file, '\t\t\tload = <0x%08x>;' % phy_addr
     if atf_index == 1:
-        print >> file, '\t\t\tentry = <0x%08x>;' % phy_addr
+        print >> file, '\t\t\tentry = <0x%08x>;' % elf_entry
     print >> file, '\t\t};'
     print >> file, ''
 
@@ -141,12 +141,13 @@ def generate_atf_fit_dts(fit_file_name, bl31_file_name, uboot_file_name, dtbs_fi
 
     with open(bl31_file_name) as bl31_file:
         bl31 = ELFFile(bl31_file)
+        elf_entry = bl31.header['e_entry']
         for i in range(bl31.num_segments()):
             seg = bl31.get_segment(i)
             if ('PT_LOAD' == seg.__getitem__(ELF_SEG_P_TYPE)):
                 paddr = seg.__getitem__(ELF_SEG_P_PADDR)
                 p= seg.__getitem__(ELF_SEG_P_PADDR)
-                append_atf_node(fit_file, i+1, paddr)
+                append_atf_node(fit_file, i+1, paddr, elf_entry)
     atf_cnt = i+1
     append_fdt_node(fit_file, dtbs_file_name)
     print >> fit_file, '%s' % DT_IMAGES_NODE_END
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH RESEND 2/2] rockchip: make_fit_atf: make python3 compatible
  2018-06-08  8:47 [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point Mian Yousaf Kaukab
@ 2018-06-08  8:47 ` Mian Yousaf Kaukab
  2018-10-03 19:11   ` [U-Boot] [U-Boot, RESEND, " Philipp Tomsich
  2018-10-04 20:08   ` Philipp Tomsich
  2018-06-08 15:09 ` [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point Dr. Philipp Tomsich
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 13+ messages in thread
From: Mian Yousaf Kaukab @ 2018-06-08  8:47 UTC (permalink / raw)
  To: u-boot

Make script python3 compatible. No functional changes intended.

Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
---
 arch/arm/mach-rockchip/make_fit_atf.py | 89 +++++++++++++++++-----------------
 1 file changed, 45 insertions(+), 44 deletions(-)

diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py
index b88a5e1f16..d72a364ff1 100755
--- a/arch/arm/mach-rockchip/make_fit_atf.py
+++ b/arch/arm/mach-rockchip/make_fit_atf.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python
 """
 A script to generate FIT image source for rockchip boards
 with ARM Trusted Firmware
@@ -43,6 +43,7 @@ DT_HEADER="""// SPDX-License-Identifier: GPL-2.0+ OR X11
 			compression = "none";
 			load = <0x%08x>;
 		};
+
 """
 
 DT_IMAGES_NODE_END="""
@@ -58,18 +59,18 @@ def append_atf_node(file, atf_index, phy_addr, elf_entry):
     Append ATF DT node to input FIT dts file.
     """
     data = 'bl31_0x%08x.bin' % phy_addr
-    print >> file, '\t\tatf@%d {' % atf_index
-    print >> file, '\t\t\tdescription = \"ARM Trusted Firmware\";'
-    print >> file, '\t\t\tdata = /incbin/("%s");' % data
-    print >> file, '\t\t\ttype = "firmware";'
-    print >> file, '\t\t\tarch = "arm64";'
-    print >> file, '\t\t\tos = "arm-trusted-firmware";'
-    print >> file, '\t\t\tcompression = "none";'
-    print >> file, '\t\t\tload = <0x%08x>;' % phy_addr
+    file.write('\t\tatf@%d {\n' % atf_index)
+    file.write('\t\t\tdescription = \"ARM Trusted Firmware\";\n')
+    file.write('\t\t\tdata = /incbin/("%s");\n' % data)
+    file.write('\t\t\ttype = "firmware";\n')
+    file.write('\t\t\tarch = "arm64";\n')
+    file.write('\t\t\tos = "arm-trusted-firmware";\n')
+    file.write('\t\t\tcompression = "none";\n')
+    file.write('\t\t\tload = <0x%08x>;\n' % phy_addr)
     if atf_index == 1:
-        print >> file, '\t\t\tentry = <0x%08x>;' % elf_entry
-    print >> file, '\t\t};'
-    print >> file, ''
+        file.write('\t\t\tentry = <0x%08x>;\n' % elf_entry)
+    file.write('\t\t};\n')
+    file.write('\n')
 
 def append_fdt_node(file, dtbs):
     """
@@ -78,43 +79,43 @@ def append_fdt_node(file, dtbs):
     cnt = 1
     for dtb in dtbs:
         dtname = os.path.basename(dtb)
-        print >> file, '\t\tfdt@%d {' % cnt
-        print >> file, '\t\t\tdescription = "%s";' % dtname
-        print >> file, '\t\t\tdata = /incbin/("%s");' % dtb
-        print >> file, '\t\t\ttype = "flat_dt";'
-        print >> file, '\t\t\tcompression = "none";'
-        print >> file, '\t\t};'
-        print >> file, ''
+        file.write('\t\tfdt@%d {\n' % cnt)
+        file.write('\t\t\tdescription = "%s";\n' % dtname)
+        file.write('\t\t\tdata = /incbin/("%s");\n' % dtb)
+        file.write('\t\t\ttype = "flat_dt";\n')
+        file.write('\t\t\tcompression = "none";\n')
+        file.write('\t\t};\n')
+        file.write('\n')
         cnt = cnt + 1
 
 def append_conf_section(file, cnt, dtname, atf_cnt):
-    print >> file, '\t\tconfig@%d {' % cnt
-    print >> file, '\t\t\tdescription = "%s";' % dtname
-    print >> file, '\t\t\tfirmware = "atf at 1";'
-    print >> file, '\t\t\tloadables = "uboot at 1",',
+    file.write('\t\tconfig@%d {\n' % cnt)
+    file.write('\t\t\tdescription = "%s";\n' % dtname)
+    file.write('\t\t\tfirmware = "atf at 1";\n')
+    file.write('\t\t\tloadables = "uboot at 1",')
     for i in range(1, atf_cnt):
-        print >> file, '"atf@%d"' % (i+1),
+        file.write('"atf@%d"' % (i+1))
         if i != (atf_cnt - 1):
-            print >> file, ',',
+            file.write(',')
         else:
-            print >> file, ';'
-    print >> file, '\t\t\tfdt = "fdt at 1";'
-    print >> file, '\t\t};'
-    print >> file, ''
+            file.write(';\n')
+    file.write('\t\t\tfdt = "fdt at 1";\n')
+    file.write('\t\t};\n')
+    file.write('\n')
 
 def append_conf_node(file, dtbs, atf_cnt):
     """
     Append configeration nodes.
     """
     cnt = 1
-    print >> file, '\tconfigurations {'
-    print >> file, '\t\tdefault = "config at 1";'
+    file.write('\tconfigurations {\n')
+    file.write('\t\tdefault = "config at 1";\n')
     for dtb in dtbs:
         dtname = os.path.basename(dtb)
         append_conf_section(file, cnt, dtname, atf_cnt)
         cnt = cnt + 1
-    print >> file, '\t};'
-    print >> file, ''
+    file.write('\t};\n')
+    file.write('\n')
 
 def generate_atf_fit_dts(fit_file_name, bl31_file_name, uboot_file_name, dtbs_file_name):
     """
@@ -127,7 +128,7 @@ def generate_atf_fit_dts(fit_file_name, bl31_file_name, uboot_file_name, dtbs_fi
 
     num_load_seg = 0
     p_paddr = 0xFFFFFFFF
-    with open(uboot_file_name) as uboot_file:
+    with open(uboot_file_name, 'rb') as uboot_file:
         uboot = ELFFile(uboot_file)
         for i in range(uboot.num_segments()):
             seg = uboot.get_segment(i)
@@ -137,9 +138,9 @@ def generate_atf_fit_dts(fit_file_name, bl31_file_name, uboot_file_name, dtbs_fi
 
     assert (p_paddr != 0xFFFFFFFF and num_load_seg == 1)
 
-    print >> fit_file, DT_HEADER % p_paddr
+    fit_file.write(DT_HEADER % p_paddr)
 
-    with open(bl31_file_name) as bl31_file:
+    with open(bl31_file_name, 'rb') as bl31_file:
         bl31 = ELFFile(bl31_file)
         elf_entry = bl31.header['e_entry']
         for i in range(bl31.num_segments()):
@@ -150,15 +151,15 @@ def generate_atf_fit_dts(fit_file_name, bl31_file_name, uboot_file_name, dtbs_fi
                 append_atf_node(fit_file, i+1, paddr, elf_entry)
     atf_cnt = i+1
     append_fdt_node(fit_file, dtbs_file_name)
-    print >> fit_file, '%s' % DT_IMAGES_NODE_END
+    fit_file.write('%s\n' % DT_IMAGES_NODE_END)
     append_conf_node(fit_file, dtbs_file_name, atf_cnt)
-    print >> fit_file, '%s' % DT_END
+    fit_file.write('%s\n' % DT_END)
 
     if fit_file_name != sys.stdout:
         fit_file.close()
 
 def generate_atf_binary(bl31_file_name):
-    with open(bl31_file_name) as bl31_file:
+    with open(bl31_file_name, 'rb') as bl31_file:
         bl31 = ELFFile(bl31_file)
 
         num = bl31.num_segments()
@@ -179,17 +180,17 @@ def get_bl31_segments_info(bl31_file_name):
         bl31 = ELFFile(bl31_file)
 
         num = bl31.num_segments()
-        print 'Number of Segments : %d' % bl31.num_segments()
+        print('Number of Segments : %d' % bl31.num_segments())
         for i in range(num):
-            print 'Segment %d' % i
+            print('Segment %d' % i)
             seg = bl31.get_segment(i)
             ptype = seg[ELF_SEG_P_TYPE]
             poffset = seg[ELF_SEG_P_OFFSET]
             pmemsz = seg[ELF_SEG_P_MEMSZ]
             pfilesz = seg[ELF_SEG_P_FILESZ]
-            print 'type: %s\nfilesz: %08x\nmemsz: %08x\noffset: %08x' % (ptype, pfilesz, pmemsz, poffset)
+            print('type: %s\nfilesz: %08x\nmemsz: %08x\noffset: %08x' % (ptype, pfilesz, pmemsz, poffset))
             paddr = seg[ELF_SEG_P_PADDR]
-            print 'paddr: %08x' % paddr
+            print('paddr: %08x' % paddr)
 
 def main():
     uboot_elf="./u-boot"
@@ -205,7 +206,7 @@ def main():
         elif opt == "-b":
             bl31_elf=val
         elif opt == "-h":
-            print __doc__
+            print(__doc__)
             sys.exit(2)
 
     dtbs = args
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point
  2018-06-08  8:47 [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point Mian Yousaf Kaukab
  2018-06-08  8:47 ` [U-Boot] [PATCH RESEND 2/2] rockchip: make_fit_atf: make python3 compatible Mian Yousaf Kaukab
@ 2018-06-08 15:09 ` Dr. Philipp Tomsich
  2018-06-09 19:24   ` Mian Yousaf Kaukab
  2018-06-13  3:43 ` Kever Yang
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Dr. Philipp Tomsich @ 2018-06-08 15:09 UTC (permalink / raw)
  To: u-boot

Mian,

Did you change anything or is this just a resend with the same content?
I didn’t have a chance to review this yet, so wanted to make sure I work off
the latest version...

Thanks,
Philipp.

> On 8 Jun 2018, at 10:47, Mian Yousaf Kaukab <yousaf.kaukab@suse.com> wrote:
> 
> make_fit_atf.py uses physical address of first segment as the
> entry point to bl31. It is incorrect and causes following abort
> when bl31_entry() is called:
> 
> U-Boot SPL board initTrying to boot from MMC1
> "Synchronous Abort" handler, esr 0x02000000
> elr: 0000000000000000 lr : 00000000ff8c7e8c
> x 0: 00000000ff8e0000 x 1: 0000000000000000
> x 2: 0000000000000000 x 3: 00000000ff8e0180
> x 4: 0000000000000000 x 5: 0000000000000000
> x 6: 0000000000000030 x 7: 00000000ff8e0188
> x 8: 00000000000001e0 x 9: 0000000000000000
> x10: 000000000007fcdc x11: 00000000002881b8
> x12: 00000000000001a2 x13: 0000000000000198
> x14: 000000000007fdcc x15: 00000000002881b8
> x16: 00000000003c0724 x17: 00000000003c0718
> x18: 000000000007fe80 x19: 00000000ff8e0000
> x20: 0000000000200000 x21: 00000000ff8e0000
> x22: 0000000000000000 x23: 000000000007fe30
> x24: 00000000ff8d1c3c x25: 00000000ff8d5000
> x26: 00000000deadbeef x27: 00000000000004a0
> x28: 000000000000009c x29: 000000000007fd90
> 
> Fix it by using the entry point from the elf header.
> 
> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
> ---
> arch/arm/mach-rockchip/make_fit_atf.py | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py
> index 6b3d9201c9..b88a5e1f16 100755
> --- a/arch/arm/mach-rockchip/make_fit_atf.py
> +++ b/arch/arm/mach-rockchip/make_fit_atf.py
> @@ -53,7 +53,7 @@ DT_END="""
> };
> """
> 
> -def append_atf_node(file, atf_index, phy_addr):
> +def append_atf_node(file, atf_index, phy_addr, elf_entry):
>     """
>     Append ATF DT node to input FIT dts file.
>     """
> @@ -67,7 +67,7 @@ def append_atf_node(file, atf_index, phy_addr):
>     print >> file, '\t\t\tcompression = "none";'
>     print >> file, '\t\t\tload = <0x%08x>;' % phy_addr
>     if atf_index == 1:
> -        print >> file, '\t\t\tentry = <0x%08x>;' % phy_addr
> +        print >> file, '\t\t\tentry = <0x%08x>;' % elf_entry
>     print >> file, '\t\t};'
>     print >> file, ''
> 
> @@ -141,12 +141,13 @@ def generate_atf_fit_dts(fit_file_name, bl31_file_name, uboot_file_name, dtbs_fi
> 
>     with open(bl31_file_name) as bl31_file:
>         bl31 = ELFFile(bl31_file)
> +        elf_entry = bl31.header['e_entry']
>         for i in range(bl31.num_segments()):
>             seg = bl31.get_segment(i)
>             if ('PT_LOAD' == seg.__getitem__(ELF_SEG_P_TYPE)):
>                 paddr = seg.__getitem__(ELF_SEG_P_PADDR)
>                 p= seg.__getitem__(ELF_SEG_P_PADDR)
> -                append_atf_node(fit_file, i+1, paddr)
> +                append_atf_node(fit_file, i+1, paddr, elf_entry)
>     atf_cnt = i+1
>     append_fdt_node(fit_file, dtbs_file_name)
>     print >> fit_file, '%s' % DT_IMAGES_NODE_END
> --
> 2.11.0
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 525 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180608/e2dbfdbd/attachment.sig>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point
  2018-06-08 15:09 ` [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point Dr. Philipp Tomsich
@ 2018-06-09 19:24   ` Mian Yousaf Kaukab
  0 siblings, 0 replies; 13+ messages in thread
From: Mian Yousaf Kaukab @ 2018-06-09 19:24 UTC (permalink / raw)
  To: u-boot

On 06/08/2018 08:09 PM, Dr. Philipp Tomsich wrote:
> Mian,
> 
> Did you change anything or is this just a resend with the same content?
Its a resend with the same content. Just sending both patches together.

> I didn’t have a chance to review this yet, so wanted to make sure I work off
> the latest version...
> 
> Thanks,
> Philipp.

Thanks,
Yousaf

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point
  2018-06-08  8:47 [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point Mian Yousaf Kaukab
  2018-06-08  8:47 ` [U-Boot] [PATCH RESEND 2/2] rockchip: make_fit_atf: make python3 compatible Mian Yousaf Kaukab
  2018-06-08 15:09 ` [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point Dr. Philipp Tomsich
@ 2018-06-13  3:43 ` Kever Yang
  2018-06-13  3:45 ` Kever Yang
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Kever Yang @ 2018-06-13  3:43 UTC (permalink / raw)
  To: u-boot

Hi Yousaf,

    Could you have a look at this patch:

https://patchwork.ozlabs.org/patch/924244/


Thanks,
- Kever
On 06/08/2018 04:47 PM, Mian Yousaf Kaukab wrote:
> make_fit_atf.py uses physical address of first segment as the
> entry point to bl31. It is incorrect and causes following abort
> when bl31_entry() is called:
>
> U-Boot SPL board initTrying to boot from MMC1
> "Synchronous Abort" handler, esr 0x02000000
> elr: 0000000000000000 lr : 00000000ff8c7e8c
> x 0: 00000000ff8e0000 x 1: 0000000000000000
> x 2: 0000000000000000 x 3: 00000000ff8e0180
> x 4: 0000000000000000 x 5: 0000000000000000
> x 6: 0000000000000030 x 7: 00000000ff8e0188
> x 8: 00000000000001e0 x 9: 0000000000000000
> x10: 000000000007fcdc x11: 00000000002881b8
> x12: 00000000000001a2 x13: 0000000000000198
> x14: 000000000007fdcc x15: 00000000002881b8
> x16: 00000000003c0724 x17: 00000000003c0718
> x18: 000000000007fe80 x19: 00000000ff8e0000
> x20: 0000000000200000 x21: 00000000ff8e0000
> x22: 0000000000000000 x23: 000000000007fe30
> x24: 00000000ff8d1c3c x25: 00000000ff8d5000
> x26: 00000000deadbeef x27: 00000000000004a0
> x28: 000000000000009c x29: 000000000007fd90
>
> Fix it by using the entry point from the elf header.
>
> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
> ---
>  arch/arm/mach-rockchip/make_fit_atf.py | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py
> index 6b3d9201c9..b88a5e1f16 100755
> --- a/arch/arm/mach-rockchip/make_fit_atf.py
> +++ b/arch/arm/mach-rockchip/make_fit_atf.py
> @@ -53,7 +53,7 @@ DT_END="""
>  };
>  """
>  
> -def append_atf_node(file, atf_index, phy_addr):
> +def append_atf_node(file, atf_index, phy_addr, elf_entry):
>      """
>      Append ATF DT node to input FIT dts file.
>      """
> @@ -67,7 +67,7 @@ def append_atf_node(file, atf_index, phy_addr):
>      print >> file, '\t\t\tcompression = "none";'
>      print >> file, '\t\t\tload = <0x%08x>;' % phy_addr
>      if atf_index == 1:
> -        print >> file, '\t\t\tentry = <0x%08x>;' % phy_addr
> +        print >> file, '\t\t\tentry = <0x%08x>;' % elf_entry
>      print >> file, '\t\t};'
>      print >> file, ''
>  
> @@ -141,12 +141,13 @@ def generate_atf_fit_dts(fit_file_name, bl31_file_name, uboot_file_name, dtbs_fi
>  
>      with open(bl31_file_name) as bl31_file:
>          bl31 = ELFFile(bl31_file)
> +        elf_entry = bl31.header['e_entry']
>          for i in range(bl31.num_segments()):
>              seg = bl31.get_segment(i)
>              if ('PT_LOAD' == seg.__getitem__(ELF_SEG_P_TYPE)):
>                  paddr = seg.__getitem__(ELF_SEG_P_PADDR)
>                  p= seg.__getitem__(ELF_SEG_P_PADDR)
> -                append_atf_node(fit_file, i+1, paddr)
> +                append_atf_node(fit_file, i+1, paddr, elf_entry)
>      atf_cnt = i+1
>      append_fdt_node(fit_file, dtbs_file_name)
>      print >> fit_file, '%s' % DT_IMAGES_NODE_END

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point
  2018-06-08  8:47 [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point Mian Yousaf Kaukab
                   ` (2 preceding siblings ...)
  2018-06-13  3:43 ` Kever Yang
@ 2018-06-13  3:45 ` Kever Yang
  2018-06-13  3:49   ` Peter Robinson
  2018-06-13  5:30   ` Mian Yousaf Kaukab
  2018-10-03 19:01 ` Peter Robinson
                   ` (2 subsequent siblings)
  6 siblings, 2 replies; 13+ messages in thread
From: Kever Yang @ 2018-06-13  3:45 UTC (permalink / raw)
  To: u-boot

Hi Yousaf,

    You patch looks good, but I don't know why the script always work
for me,

and I don't met the abort, where do you get the BL31?


Thanks,
- Kever
On 06/08/2018 04:47 PM, Mian Yousaf Kaukab wrote:
> make_fit_atf.py uses physical address of first segment as the
> entry point to bl31. It is incorrect and causes following abort
> when bl31_entry() is called:
>
> U-Boot SPL board initTrying to boot from MMC1
> "Synchronous Abort" handler, esr 0x02000000
> elr: 0000000000000000 lr : 00000000ff8c7e8c
> x 0: 00000000ff8e0000 x 1: 0000000000000000
> x 2: 0000000000000000 x 3: 00000000ff8e0180
> x 4: 0000000000000000 x 5: 0000000000000000
> x 6: 0000000000000030 x 7: 00000000ff8e0188
> x 8: 00000000000001e0 x 9: 0000000000000000
> x10: 000000000007fcdc x11: 00000000002881b8
> x12: 00000000000001a2 x13: 0000000000000198
> x14: 000000000007fdcc x15: 00000000002881b8
> x16: 00000000003c0724 x17: 00000000003c0718
> x18: 000000000007fe80 x19: 00000000ff8e0000
> x20: 0000000000200000 x21: 00000000ff8e0000
> x22: 0000000000000000 x23: 000000000007fe30
> x24: 00000000ff8d1c3c x25: 00000000ff8d5000
> x26: 00000000deadbeef x27: 00000000000004a0
> x28: 000000000000009c x29: 000000000007fd90
>
> Fix it by using the entry point from the elf header.
>
> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
> ---
>  arch/arm/mach-rockchip/make_fit_atf.py | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py
> index 6b3d9201c9..b88a5e1f16 100755
> --- a/arch/arm/mach-rockchip/make_fit_atf.py
> +++ b/arch/arm/mach-rockchip/make_fit_atf.py
> @@ -53,7 +53,7 @@ DT_END="""
>  };
>  """
>  
> -def append_atf_node(file, atf_index, phy_addr):
> +def append_atf_node(file, atf_index, phy_addr, elf_entry):
>      """
>      Append ATF DT node to input FIT dts file.
>      """
> @@ -67,7 +67,7 @@ def append_atf_node(file, atf_index, phy_addr):
>      print >> file, '\t\t\tcompression = "none";'
>      print >> file, '\t\t\tload = <0x%08x>;' % phy_addr
>      if atf_index == 1:
> -        print >> file, '\t\t\tentry = <0x%08x>;' % phy_addr
> +        print >> file, '\t\t\tentry = <0x%08x>;' % elf_entry
>      print >> file, '\t\t};'
>      print >> file, ''
>  
> @@ -141,12 +141,13 @@ def generate_atf_fit_dts(fit_file_name, bl31_file_name, uboot_file_name, dtbs_fi
>  
>      with open(bl31_file_name) as bl31_file:
>          bl31 = ELFFile(bl31_file)
> +        elf_entry = bl31.header['e_entry']
>          for i in range(bl31.num_segments()):
>              seg = bl31.get_segment(i)
>              if ('PT_LOAD' == seg.__getitem__(ELF_SEG_P_TYPE)):
>                  paddr = seg.__getitem__(ELF_SEG_P_PADDR)
>                  p= seg.__getitem__(ELF_SEG_P_PADDR)
> -                append_atf_node(fit_file, i+1, paddr)
> +                append_atf_node(fit_file, i+1, paddr, elf_entry)
>      atf_cnt = i+1
>      append_fdt_node(fit_file, dtbs_file_name)
>      print >> fit_file, '%s' % DT_IMAGES_NODE_END

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point
  2018-06-13  3:45 ` Kever Yang
@ 2018-06-13  3:49   ` Peter Robinson
  2018-06-13  5:30   ` Mian Yousaf Kaukab
  1 sibling, 0 replies; 13+ messages in thread
From: Peter Robinson @ 2018-06-13  3:49 UTC (permalink / raw)
  To: u-boot

On Wed, Jun 13, 2018 at 4:45 AM, Kever Yang <kever.yang@rock-chips.com> wrote:
> Hi Yousaf,
>
>     You patch looks good, but I don't know why the script always work
> for me,
>
> and I don't met the abort, where do you get the BL31?

It looks similar to what I was seeing previously and haven't had a
chance to get to the bottom of.

Peter

> Thanks,
> - Kever
> On 06/08/2018 04:47 PM, Mian Yousaf Kaukab wrote:
>> make_fit_atf.py uses physical address of first segment as the
>> entry point to bl31. It is incorrect and causes following abort
>> when bl31_entry() is called:
>>
>> U-Boot SPL board initTrying to boot from MMC1
>> "Synchronous Abort" handler, esr 0x02000000
>> elr: 0000000000000000 lr : 00000000ff8c7e8c
>> x 0: 00000000ff8e0000 x 1: 0000000000000000
>> x 2: 0000000000000000 x 3: 00000000ff8e0180
>> x 4: 0000000000000000 x 5: 0000000000000000
>> x 6: 0000000000000030 x 7: 00000000ff8e0188
>> x 8: 00000000000001e0 x 9: 0000000000000000
>> x10: 000000000007fcdc x11: 00000000002881b8
>> x12: 00000000000001a2 x13: 0000000000000198
>> x14: 000000000007fdcc x15: 00000000002881b8
>> x16: 00000000003c0724 x17: 00000000003c0718
>> x18: 000000000007fe80 x19: 00000000ff8e0000
>> x20: 0000000000200000 x21: 00000000ff8e0000
>> x22: 0000000000000000 x23: 000000000007fe30
>> x24: 00000000ff8d1c3c x25: 00000000ff8d5000
>> x26: 00000000deadbeef x27: 00000000000004a0
>> x28: 000000000000009c x29: 000000000007fd90
>>
>> Fix it by using the entry point from the elf header.
>>
>> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
>> ---
>>  arch/arm/mach-rockchip/make_fit_atf.py | 7 ++++---
>>  1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py
>> index 6b3d9201c9..b88a5e1f16 100755
>> --- a/arch/arm/mach-rockchip/make_fit_atf.py
>> +++ b/arch/arm/mach-rockchip/make_fit_atf.py
>> @@ -53,7 +53,7 @@ DT_END="""
>>  };
>>  """
>>
>> -def append_atf_node(file, atf_index, phy_addr):
>> +def append_atf_node(file, atf_index, phy_addr, elf_entry):
>>      """
>>      Append ATF DT node to input FIT dts file.
>>      """
>> @@ -67,7 +67,7 @@ def append_atf_node(file, atf_index, phy_addr):
>>      print >> file, '\t\t\tcompression = "none";'
>>      print >> file, '\t\t\tload = <0x%08x>;' % phy_addr
>>      if atf_index == 1:
>> -        print >> file, '\t\t\tentry = <0x%08x>;' % phy_addr
>> +        print >> file, '\t\t\tentry = <0x%08x>;' % elf_entry
>>      print >> file, '\t\t};'
>>      print >> file, ''
>>
>> @@ -141,12 +141,13 @@ def generate_atf_fit_dts(fit_file_name, bl31_file_name, uboot_file_name, dtbs_fi
>>
>>      with open(bl31_file_name) as bl31_file:
>>          bl31 = ELFFile(bl31_file)
>> +        elf_entry = bl31.header['e_entry']
>>          for i in range(bl31.num_segments()):
>>              seg = bl31.get_segment(i)
>>              if ('PT_LOAD' == seg.__getitem__(ELF_SEG_P_TYPE)):
>>                  paddr = seg.__getitem__(ELF_SEG_P_PADDR)
>>                  p= seg.__getitem__(ELF_SEG_P_PADDR)
>> -                append_atf_node(fit_file, i+1, paddr)
>> +                append_atf_node(fit_file, i+1, paddr, elf_entry)
>>      atf_cnt = i+1
>>      append_fdt_node(fit_file, dtbs_file_name)
>>      print >> fit_file, '%s' % DT_IMAGES_NODE_END
>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point
  2018-06-13  3:45 ` Kever Yang
  2018-06-13  3:49   ` Peter Robinson
@ 2018-06-13  5:30   ` Mian Yousaf Kaukab
  1 sibling, 0 replies; 13+ messages in thread
From: Mian Yousaf Kaukab @ 2018-06-13  5:30 UTC (permalink / raw)
  To: u-boot

On 06/13/2018 08:45 AM, Kever Yang wrote:
> Hi Yousaf,
> 
>      You patch looks good, but I don't know why the script always work
> for me,
> 
> and I don't met the abort, where do you get the BL31?
I am building it with the following command line:
make -j4 CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399 DEBUG=1 all
Abort is 100% reproducible with ATF v1.4 and v1.5.

> 
> 
> Thanks,
> - Kever
BR,
Yousaf

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point
  2018-06-08  8:47 [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point Mian Yousaf Kaukab
                   ` (3 preceding siblings ...)
  2018-06-13  3:45 ` Kever Yang
@ 2018-10-03 19:01 ` Peter Robinson
  2018-10-03 19:11 ` [U-Boot] [U-Boot, RESEND, " Philipp Tomsich
  2018-10-04 20:08 ` Philipp Tomsich
  6 siblings, 0 replies; 13+ messages in thread
From: Peter Robinson @ 2018-10-03 19:01 UTC (permalink / raw)
  To: u-boot

Philipp,

Can we get get a decision on this one, it fixes issues for me on
Rockchips devices. While I'm sure a rewrite in C to reduce
dependenciees is an option, this fix doesn't add any extra
dependencies and I think is still a candidate for 2018.11

Peter
On Fri, Jun 8, 2018 at 11:34 AM Mian Yousaf Kaukab
<yousaf.kaukab@suse.com> wrote:
>
> make_fit_atf.py uses physical address of first segment as the
> entry point to bl31. It is incorrect and causes following abort
> when bl31_entry() is called:
>
> U-Boot SPL board initTrying to boot from MMC1
> "Synchronous Abort" handler, esr 0x02000000
> elr: 0000000000000000 lr : 00000000ff8c7e8c
> x 0: 00000000ff8e0000 x 1: 0000000000000000
> x 2: 0000000000000000 x 3: 00000000ff8e0180
> x 4: 0000000000000000 x 5: 0000000000000000
> x 6: 0000000000000030 x 7: 00000000ff8e0188
> x 8: 00000000000001e0 x 9: 0000000000000000
> x10: 000000000007fcdc x11: 00000000002881b8
> x12: 00000000000001a2 x13: 0000000000000198
> x14: 000000000007fdcc x15: 00000000002881b8
> x16: 00000000003c0724 x17: 00000000003c0718
> x18: 000000000007fe80 x19: 00000000ff8e0000
> x20: 0000000000200000 x21: 00000000ff8e0000
> x22: 0000000000000000 x23: 000000000007fe30
> x24: 00000000ff8d1c3c x25: 00000000ff8d5000
> x26: 00000000deadbeef x27: 00000000000004a0
> x28: 000000000000009c x29: 000000000007fd90
>
> Fix it by using the entry point from the elf header.
>
> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
> ---
>  arch/arm/mach-rockchip/make_fit_atf.py | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-rockchip/make_fit_atf.py b/arch/arm/mach-rockchip/make_fit_atf.py
> index 6b3d9201c9..b88a5e1f16 100755
> --- a/arch/arm/mach-rockchip/make_fit_atf.py
> +++ b/arch/arm/mach-rockchip/make_fit_atf.py
> @@ -53,7 +53,7 @@ DT_END="""
>  };
>  """
>
> -def append_atf_node(file, atf_index, phy_addr):
> +def append_atf_node(file, atf_index, phy_addr, elf_entry):
>      """
>      Append ATF DT node to input FIT dts file.
>      """
> @@ -67,7 +67,7 @@ def append_atf_node(file, atf_index, phy_addr):
>      print >> file, '\t\t\tcompression = "none";'
>      print >> file, '\t\t\tload = <0x%08x>;' % phy_addr
>      if atf_index == 1:
> -        print >> file, '\t\t\tentry = <0x%08x>;' % phy_addr
> +        print >> file, '\t\t\tentry = <0x%08x>;' % elf_entry
>      print >> file, '\t\t};'
>      print >> file, ''
>
> @@ -141,12 +141,13 @@ def generate_atf_fit_dts(fit_file_name, bl31_file_name, uboot_file_name, dtbs_fi
>
>      with open(bl31_file_name) as bl31_file:
>          bl31 = ELFFile(bl31_file)
> +        elf_entry = bl31.header['e_entry']
>          for i in range(bl31.num_segments()):
>              seg = bl31.get_segment(i)
>              if ('PT_LOAD' == seg.__getitem__(ELF_SEG_P_TYPE)):
>                  paddr = seg.__getitem__(ELF_SEG_P_PADDR)
>                  p= seg.__getitem__(ELF_SEG_P_PADDR)
> -                append_atf_node(fit_file, i+1, paddr)
> +                append_atf_node(fit_file, i+1, paddr, elf_entry)
>      atf_cnt = i+1
>      append_fdt_node(fit_file, dtbs_file_name)
>      print >> fit_file, '%s' % DT_IMAGES_NODE_END
> --
> 2.11.0
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [U-Boot, RESEND, 2/2] rockchip: make_fit_atf: make python3 compatible
  2018-06-08  8:47 ` [U-Boot] [PATCH RESEND 2/2] rockchip: make_fit_atf: make python3 compatible Mian Yousaf Kaukab
@ 2018-10-03 19:11   ` Philipp Tomsich
  2018-10-04 20:08   ` Philipp Tomsich
  1 sibling, 0 replies; 13+ messages in thread
From: Philipp Tomsich @ 2018-10-03 19:11 UTC (permalink / raw)
  To: u-boot

> Make script python3 compatible. No functional changes intended.
> 
> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
> ---
>  arch/arm/mach-rockchip/make_fit_atf.py | 89 +++++++++++++++++-----------------
>  1 file changed, 45 insertions(+), 44 deletions(-)
> 

Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [U-Boot, RESEND, 1/2] rockchip: make_fit_atf: use elf entry point
  2018-06-08  8:47 [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point Mian Yousaf Kaukab
                   ` (4 preceding siblings ...)
  2018-10-03 19:01 ` Peter Robinson
@ 2018-10-03 19:11 ` Philipp Tomsich
  2018-10-04 20:08 ` Philipp Tomsich
  6 siblings, 0 replies; 13+ messages in thread
From: Philipp Tomsich @ 2018-10-03 19:11 UTC (permalink / raw)
  To: u-boot

> make_fit_atf.py uses physical address of first segment as the
> entry point to bl31. It is incorrect and causes following abort
> when bl31_entry() is called:
> 
> U-Boot SPL board initTrying to boot from MMC1
> "Synchronous Abort" handler, esr 0x02000000
> elr: 0000000000000000 lr : 00000000ff8c7e8c
> x 0: 00000000ff8e0000 x 1: 0000000000000000
> x 2: 0000000000000000 x 3: 00000000ff8e0180
> x 4: 0000000000000000 x 5: 0000000000000000
> x 6: 0000000000000030 x 7: 00000000ff8e0188
> x 8: 00000000000001e0 x 9: 0000000000000000
> x10: 000000000007fcdc x11: 00000000002881b8
> x12: 00000000000001a2 x13: 0000000000000198
> x14: 000000000007fdcc x15: 00000000002881b8
> x16: 00000000003c0724 x17: 00000000003c0718
> x18: 000000000007fe80 x19: 00000000ff8e0000
> x20: 0000000000200000 x21: 00000000ff8e0000
> x22: 0000000000000000 x23: 000000000007fe30
> x24: 00000000ff8d1c3c x25: 00000000ff8d5000
> x26: 00000000deadbeef x27: 00000000000004a0
> x28: 000000000000009c x29: 000000000007fd90
> 
> Fix it by using the entry point from the elf header.
> 
> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
> ---
>  arch/arm/mach-rockchip/make_fit_atf.py | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 

Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [U-Boot, RESEND, 1/2] rockchip: make_fit_atf: use elf entry point
  2018-06-08  8:47 [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point Mian Yousaf Kaukab
                   ` (5 preceding siblings ...)
  2018-10-03 19:11 ` [U-Boot] [U-Boot, RESEND, " Philipp Tomsich
@ 2018-10-04 20:08 ` Philipp Tomsich
  6 siblings, 0 replies; 13+ messages in thread
From: Philipp Tomsich @ 2018-10-04 20:08 UTC (permalink / raw)
  To: u-boot

> make_fit_atf.py uses physical address of first segment as the
> entry point to bl31. It is incorrect and causes following abort
> when bl31_entry() is called:
> 
> U-Boot SPL board initTrying to boot from MMC1
> "Synchronous Abort" handler, esr 0x02000000
> elr: 0000000000000000 lr : 00000000ff8c7e8c
> x 0: 00000000ff8e0000 x 1: 0000000000000000
> x 2: 0000000000000000 x 3: 00000000ff8e0180
> x 4: 0000000000000000 x 5: 0000000000000000
> x 6: 0000000000000030 x 7: 00000000ff8e0188
> x 8: 00000000000001e0 x 9: 0000000000000000
> x10: 000000000007fcdc x11: 00000000002881b8
> x12: 00000000000001a2 x13: 0000000000000198
> x14: 000000000007fdcc x15: 00000000002881b8
> x16: 00000000003c0724 x17: 00000000003c0718
> x18: 000000000007fe80 x19: 00000000ff8e0000
> x20: 0000000000200000 x21: 00000000ff8e0000
> x22: 0000000000000000 x23: 000000000007fe30
> x24: 00000000ff8d1c3c x25: 00000000ff8d5000
> x26: 00000000deadbeef x27: 00000000000004a0
> x28: 000000000000009c x29: 000000000007fd90
> 
> Fix it by using the entry point from the elf header.
> 
> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
>  arch/arm/mach-rockchip/make_fit_atf.py | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 

Applied to u-boot-rockchip, thanks!

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [U-Boot] [U-Boot, RESEND, 2/2] rockchip: make_fit_atf: make python3 compatible
  2018-06-08  8:47 ` [U-Boot] [PATCH RESEND 2/2] rockchip: make_fit_atf: make python3 compatible Mian Yousaf Kaukab
  2018-10-03 19:11   ` [U-Boot] [U-Boot, RESEND, " Philipp Tomsich
@ 2018-10-04 20:08   ` Philipp Tomsich
  1 sibling, 0 replies; 13+ messages in thread
From: Philipp Tomsich @ 2018-10-04 20:08 UTC (permalink / raw)
  To: u-boot

> Make script python3 compatible. No functional changes intended.
> 
> Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@suse.com>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
>  arch/arm/mach-rockchip/make_fit_atf.py | 89 +++++++++++++++++-----------------
>  1 file changed, 45 insertions(+), 44 deletions(-)
> 

Applied to u-boot-rockchip, thanks!

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-10-04 20:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-08  8:47 [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point Mian Yousaf Kaukab
2018-06-08  8:47 ` [U-Boot] [PATCH RESEND 2/2] rockchip: make_fit_atf: make python3 compatible Mian Yousaf Kaukab
2018-10-03 19:11   ` [U-Boot] [U-Boot, RESEND, " Philipp Tomsich
2018-10-04 20:08   ` Philipp Tomsich
2018-06-08 15:09 ` [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point Dr. Philipp Tomsich
2018-06-09 19:24   ` Mian Yousaf Kaukab
2018-06-13  3:43 ` Kever Yang
2018-06-13  3:45 ` Kever Yang
2018-06-13  3:49   ` Peter Robinson
2018-06-13  5:30   ` Mian Yousaf Kaukab
2018-10-03 19:01 ` Peter Robinson
2018-10-03 19:11 ` [U-Boot] [U-Boot, RESEND, " Philipp Tomsich
2018-10-04 20:08 ` Philipp Tomsich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.