Re: [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point
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 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 0x0200 > elr: lr : ff8c7e8c > x 0: ff8e x 1: > x 2: x 3: ff8e0180 > x 4: x 5: > x 6: 0030 x 7: ff8e0188 > x 8: 01e0 x 9: > x10: 0007fcdc x11: 002881b8 > x12: 01a2 x13: 0198 > x14: 0007fdcc x15: 002881b8 > x16: 003c0724 x17: 003c0718 > x18: 0007fe80 x19: ff8e > x20: 0020 x21: ff8e > x22: x23: 0007fe30 > x24: ff8d1c3c x25: ff8d5000 > x26: deadbeef x27: 04a0 > x28: 009c x29: 0007fd90 > > Fix it by using the entry point from the elf header. > > Signed-off-by: Mian Yousaf Kaukab > --- > 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@lists.denx.de > https://lists.denx.de/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point
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 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point
On Wed, Jun 13, 2018 at 4: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? 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 0x0200 >> elr: lr : ff8c7e8c >> x 0: ff8e x 1: >> x 2: x 3: ff8e0180 >> x 4: x 5: >> x 6: 0030 x 7: ff8e0188 >> x 8: 01e0 x 9: >> x10: 0007fcdc x11: 002881b8 >> x12: 01a2 x13: 0198 >> x14: 0007fdcc x15: 002881b8 >> x16: 003c0724 x17: 003c0718 >> x18: 0007fe80 x19: ff8e >> x20: 0020 x21: ff8e >> x22: x23: 0007fe30 >> x24: ff8d1c3c x25: ff8d5000 >> x26: deadbeef x27: 04a0 >> x28: 009c x29: 0007fd90 >> >> Fix it by using the entry point from the elf header. >> >> Signed-off-by: Mian Yousaf Kaukab >> --- >> 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@lists.denx.de > https://lists.denx.de/listinfo/u-boot ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point
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 0x0200 > elr: lr : ff8c7e8c > x 0: ff8e x 1: > x 2: x 3: ff8e0180 > x 4: x 5: > x 6: 0030 x 7: ff8e0188 > x 8: 01e0 x 9: > x10: 0007fcdc x11: 002881b8 > x12: 01a2 x13: 0198 > x14: 0007fdcc x15: 002881b8 > x16: 003c0724 x17: 003c0718 > x18: 0007fe80 x19: ff8e > x20: 0020 x21: ff8e > x22: x23: 0007fe30 > x24: ff8d1c3c x25: ff8d5000 > x26: deadbeef x27: 04a0 > x28: 009c x29: 0007fd90 > > Fix it by using the entry point from the elf header. > > Signed-off-by: Mian Yousaf Kaukab > --- > 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@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point
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 0x0200 > elr: lr : ff8c7e8c > x 0: ff8e x 1: > x 2: x 3: ff8e0180 > x 4: x 5: > x 6: 0030 x 7: ff8e0188 > x 8: 01e0 x 9: > x10: 0007fcdc x11: 002881b8 > x12: 01a2 x13: 0198 > x14: 0007fdcc x15: 002881b8 > x16: 003c0724 x17: 003c0718 > x18: 0007fe80 x19: ff8e > x20: 0020 x21: ff8e > x22: x23: 0007fe30 > x24: ff8d1c3c x25: ff8d5000 > x26: deadbeef x27: 04a0 > x28: 009c x29: 0007fd90 > > Fix it by using the entry point from the elf header. > > Signed-off-by: Mian Yousaf Kaukab > --- > 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@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point
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 ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point
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 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 0x0200 > elr: lr : ff8c7e8c > x 0: ff8e x 1: > x 2: x 3: ff8e0180 > x 4: x 5: > x 6: 0030 x 7: ff8e0188 > x 8: 01e0 x 9: > x10: 0007fcdc x11: 002881b8 > x12: 01a2 x13: 0198 > x14: 0007fdcc x15: 002881b8 > x16: 003c0724 x17: 003c0718 > x18: 0007fe80 x19: ff8e > x20: 0020 x21: ff8e > x22: x23: 0007fe30 > x24: ff8d1c3c x25: ff8d5000 > x26: deadbeef x27: 04a0 > x28: 009c x29: 0007fd90 > > Fix it by using the entry point from the elf header. > > Signed-off-by: Mian Yousaf Kaukab > --- > 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 > signature.asc Description: Message signed with OpenPGP ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
[U-Boot] [PATCH RESEND 1/2] rockchip: make_fit_atf: use elf entry point
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 0x0200 elr: lr : ff8c7e8c x 0: ff8e x 1: x 2: x 3: ff8e0180 x 4: x 5: x 6: 0030 x 7: ff8e0188 x 8: 01e0 x 9: x10: 0007fcdc x11: 002881b8 x12: 01a2 x13: 0198 x14: 0007fdcc x15: 002881b8 x16: 003c0724 x17: 003c0718 x18: 0007fe80 x19: ff8e x20: 0020 x21: ff8e x22: x23: 0007fe30 x24: ff8d1c3c x25: ff8d5000 x26: deadbeef x27: 04a0 x28: 009c x29: 0007fd90 Fix it by using the entry point from the elf header. Signed-off-by: Mian Yousaf Kaukab --- 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@lists.denx.de https://lists.denx.de/listinfo/u-boot