Closed jwinarske closed 1 year ago
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.
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
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?
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
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....
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
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....
@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?
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 <sjg@chromium.org>
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
FYI, i've uploaded a patch for it
great job! everything works now.
@JeffyCN Thanks!