Giter Site home page Giter Site logo

Comments (12)

jwinarske avatar jwinarske commented on May 23, 2024

Looks like this machine is behind a bit. Per the wiki aarch64 can be used, as well as upstream u-boot.

https://opensource.rock-chips.com/wiki_U-Boot

I'll take a look at this.

from meta-rockchip.

JeffyCN avatar JeffyCN commented on May 23, 2024

maybe try to hack it like:

--- a/recipes-bsp/u-boot/u-boot_%.bbappend
+++ b/recipes-bsp/u-boot/u-boot_%.bbappend
@@ -37,7 +37,8 @@ do_configure:prepend() {
        sed -i -e 's/\(open(.*[^"]\))/\1, "rb")/' -e 's/,$//' \
                -e 's/print >> \([^,]*\), *\(.*\)$/print(\2, file=\1)/' \
                -e 's/print \(.*\)$/print(\1)/' \
-               ${S}/arch/arm/mach-rockchip/make_fit_atf.py
+               ${S}/arch/arm/mach-rockchip/make_fit_atf.py \
+               ${S}/tools/dtoc/dtoc

or use u-boot-dummy

from meta-rockchip.

ballestrerod avatar ballestrerod commented on May 23, 2024

hi, I've got the same problem. after your patch build fails on this:

|   File "/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/tools/dtoc/dtoc", line 60
|     parser.add_option('-d', '--dtb-file', action='store'
|                                                  ^^^^^^^
| SyntaxError: invalid syntax. Perhaps you forgot a comma?

from meta-rockchip.

JeffyCN avatar JeffyCN commented on May 23, 2024

this should work:

--- a/recipes-bsp/u-boot/u-boot_%.bbappend
+++ b/recipes-bsp/u-boot/u-boot_%.bbappend
@@ -34,10 +34,11 @@ do_configure:prepend() {
        done

        # Support python3
-       sed -i -e 's/\(open(.*[^"]\))/\1, "rb")/' -e 's/,$//' \
-               -e 's/print >> \([^,]*\), *\(.*\)$/print(\2, file=\1)/' \
+       sed -i -e 's/\(open(.*[^"]\))/\1, "rb")/' \
+               -e 's/print >> \([^,]*\), *\(.*\),*$/print(\2, file=\1)/' \
                -e 's/print \(.*\)$/print(\1)/' \
-               ${S}/arch/arm/mach-rockchip/make_fit_atf.py
+               ${S}/arch/arm/mach-rockchip/make_fit_atf.py \
+               ${S}/tools/dtoc/dtoc

from meta-rockchip.

ballestrerod avatar ballestrerod commented on May 23, 2024

thank you very much. now compilation goes forward but stops on:

| Traceback (most recent call last):
|   File "/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/tools/dtoc/dtoc", line 75, in <module>
|     dtb_platdata.run_steps(args, options.dtb_file, options.include_disabled,
|   File "/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/tools/dtoc/dtb_platdata.py", line 558, in run_steps
|     plat.scan_dtb()
|   File "/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/tools/dtoc/dtb_platdata.py", line 246, in scan_dtb
|     self._fdt = fdt.FdtScan(self._dtb_fname)
|   File "/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/tools/dtoc/fdt.py", line 413, in FdtScan
|     dtb = Fdt(fname)
|   File "/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/tools/dtoc/fdt.py", line 275, in __init__
|     self._fdt = bytearray(fd.read())
|   File "/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/recipe-sysroot-native/usr/lib/python3.10/codecs.py", line 322, in decode
|     (result, consumed) = self._buffer_decode(data, self.errors, final)
| UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 0: invalid continuation byte
| make -f /home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/scripts/Makefile.build obj=spl/drivers/serial
| make -f /home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/scripts/Makefile.build obj=spl/lib/avb/rk_avb_user
| make[2]: *** [/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/scripts/Makefile.spl:278: include/generated/dt-structs-gen.h] Error 1
| make[2]: *** Waiting for unfinished jobs....

from meta-rockchip.

JeffyCN avatar JeffyCN commented on May 23, 2024

so this chip is building spl, which needs to parse dtb using dtoc.

all scripts of it need to hack

--- a/recipes-bsp/u-boot/u-boot_%.bbappend
+++ b/recipes-bsp/u-boot/u-boot_%.bbappend
@@ -34,10 +34,11 @@ do_configure:prepend() {
        done

        # Support python3
-       sed -i -e 's/\(open(.*[^"]\))/\1, "rb")/' -e 's/,$//' \
-               -e 's/print >> \([^,]*\), *\(.*\)$/print(\2, file=\1)/' \
+       sed -i -e 's/\(open([^,]*\))/\1, "rb")/' \
+               -e 's/print >> \([^,]*\), *\(.*\),*$/print(\2, file=\1)/' \
                -e 's/print \(.*\)$/print(\1)/' \
-               ${S}/arch/arm/mach-rockchip/make_fit_atf.py
+               ${S}/arch/arm/mach-rockchip/make_fit_atf.py \
+               ${S}/tools/dtoc/*.py

from meta-rockchip.

ballestrerod avatar ballestrerod commented on May 23, 2024

no way. sorry if I'm bothering you but that build keep failing.
maybe is the wrong u-boot version or too old for kirkstone? I'm trying to build for a Rockchip RK3328 on an Olimex SOM board.

| Traceback (most recent call last):
|   File "/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/tools/dtoc/dtoc", line 75, in <module>
|     dtb_platdata.run_steps(args, options.dtb_file, options.include_disabled,
|   File "/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/tools/dtoc/dtb_platdata.py", line 558, in run_steps
|     plat.scan_dtb()
|   File "/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/tools/dtoc/dtb_platdata.py", line 246, in scan_dtb
|     self._fdt = fdt.FdtScan(self._dtb_fname)
|   File "/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/tools/dtoc/fdt.py", line 414, in FdtScan
|     dtb.Scan()
|   File "/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/tools/dtoc/fdt.py", line 289, in Scan
|     self._root.Scan()
|   File "/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/tools/dtoc/fdt.py", line 228, in Scan
|     node.Scan()
|   File "/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/tools/dtoc/fdt.py", line 217, in Scan
|     val = fdt_util.fdt32_to_cpu(phandle.value)
|   File "/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/tools/dtoc/fdt_util.py", line 29, in fdt32_to_cpu
|     val = val.encode('raw_unicode_escape')
| AttributeError: 'list' object has no attribute 'encode'
| make[2]: *** [/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/scripts/Makefile.spl:278: include/generated/dt-structs-gen.h] Error 1
| make[1]: *** [/home/ballest/rockhevc_workspace/oses/rockhevc-kirkstone/build_rockhevc/tmp/work/rockhevc-poky-linux/u-boot/1_2017.09-r0/git/Makefile:1446: tpl/u-boot-tpl.bin] Error 2
| make[1]: *** Waiting for unfinished jobs....

from meta-rockchip.

jwinarske avatar jwinarske commented on May 23, 2024

@ballestrerod that was also my impression; old u-boot.

@JeffyCN Any reason you aren't keeping u-boot the same for all the machine types? Also what is the point of using the mirror repo, opposed to using origin repo?

from meta-rockchip.

JeffyCN avatar JeffyCN commented on May 23, 2024

the u-boot is bsp's 2017, which is using python2. but yocto switched to python3, so we need to hack it's scripts to python3, or use other u-boot.

3328's u-boot is different with other chips, it has spl stage, so calls more scripts.

for this error, need this u-boot commit:

commit a90df2b17282c43600284a92bf034d81d0c49444
Author: Simon Glass <[email protected]>
Date:   Thu Oct 31 07:43:04 2019 -0600
    dtoc: Convert fdt.py to Python 3

or use dummy u-boot and flash your old u-boot images instead of the generated ones:
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-dummy"
PREFERRED_PROVIDER_u-boot ?= "u-boot-dummy

from meta-rockchip.

JeffyCN avatar JeffyCN commented on May 23, 2024

FYI, i've uploaded a patch for it

from meta-rockchip.

ballestrerod avatar ballestrerod commented on May 23, 2024

great job! everything works now.

from meta-rockchip.

jwinarske avatar jwinarske commented on May 23, 2024

@JeffyCN Thanks!

from meta-rockchip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.