Tartarus changed the topic of #u-boot to: SOURCE MOVED TO https://source.denx.de/u-boot/u-boot.git / U-Boot v2023.07, v2023.10-rc1 are OUT / Merge Window is CLOSED, next branch is CLOSED until -rc2 / Release v2023.10 is scheduled for 02 October 2023 / Channel archives at https://libera.irclog.whitequark.org/u-boot
<Tartarus> Yes, it does retries now
<Tartarus> Which means either it failed twice, or it doesn't re-run for PRs via github?
<Tartarus> cambrian_invader: do you have the re-run failed jobs button?
naoki has joined #u-boot
qqq has joined #u-boot
vagrantc has quit [Quit: leaving]
ikarso has quit [Quit: Connection closed for inactivity]
rfs613 has joined #u-boot
<Forty-Bot> Tartarus: I have it but I don't have permissions
naoki has quit [Quit: naoki]
Wouter0100670440 has quit [Quit: The Lounge - https://thelounge.chat]
Wouter0100670440 has joined #u-boot
jclsn has quit [Ping timeout: 244 seconds]
jclsn has joined #u-boot
persmule has quit [Remote host closed the connection]
sng has joined #u-boot
sng has quit [Remote host closed the connection]
sng has joined #u-boot
sng has quit [Ping timeout: 250 seconds]
sng has joined #u-boot
stipa has quit [Quit: WeeChat 3.0]
sng has quit [Remote host closed the connection]
sng has joined #u-boot
sng_ has joined #u-boot
sng has quit [Ping timeout: 245 seconds]
sng_ has quit [Remote host closed the connection]
sng has joined #u-boot
sng_ has joined #u-boot
sng has quit [Ping timeout: 250 seconds]
sng_ has quit [Remote host closed the connection]
naoki has joined #u-boot
naoki has quit [Quit: naoki]
rockosov has quit [Ping timeout: 245 seconds]
rockosov has joined #u-boot
sng has joined #u-boot
sakman has quit [Remote host closed the connection]
GNUtoo has quit [Remote host closed the connection]
sng has quit [Remote host closed the connection]
GNUtoo has joined #u-boot
redbrain has quit [Read error: Connection reset by peer]
Wouter0100670440 has quit [Quit: The Lounge - https://thelounge.chat]
Wouter0100670440 has joined #u-boot
redbrain has joined #u-boot
stefanro has joined #u-boot
stefanro has quit [Quit: Leaving.]
sng has joined #u-boot
sng_ has joined #u-boot
sng has quit [Ping timeout: 245 seconds]
sng_ has quit [Ping timeout: 246 seconds]
sng has joined #u-boot
sng has quit [Remote host closed the connection]
sng has joined #u-boot
<matthewcroughan-> I've tried to get in touch with Naoki, the maintainer of rock-4c-plus-rk3399 for the past 3-4 days now, does anybody have any insight into whether the build results for this board were ever tested? I've been looking around the commits, PRs and mailing lists and I cannot find anything to indicate it was, and the u-boot-rockchip.bin build result flashed seek=64 into an SD Card does not yield anything. The RK33 ROCKCHIP_MAGIC is
<matthewcroughan-> present and mkimage seems to think the result is fine, but there is no activity over serial on the board.
<matthewcroughan-> I do see this commit though.. I'm going to try it for fun, and the rock-4c-plus-rk3399 defconfig is modified by it https://github.com/u-boot/u-boot/commit/012174e8c1a4cbc2162c2dafe26ef791356b6944
<matthewcroughan-> could CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y really be it? :D
camus has quit [Ping timeout: 245 seconds]
rvalue has quit [Ping timeout: 246 seconds]
sng_ has joined #u-boot
sng has quit [Read error: Connection reset by peer]
rvalue has joined #u-boot
sng has joined #u-boot
sng_ has quit [Read error: Connection reset by peer]
sng_ has joined #u-boot
sng has quit [Ping timeout: 245 seconds]
<matthewcroughan-> Nope, still appears to do nothing in my case
sng_ has quit [Remote host closed the connection]
<matthewcroughan-> Ah.. okay.. now I'm getting somewhere. I get scrambled serial if I set CONFIG_BAUDRATE=115200, whereas if I leave it at the default I get no serial at all
<matthewcroughan-> I guess my cable isn't up to the job :D
sng has joined #u-boot
sng has quit [Remote host closed the connection]
sng has joined #u-boot
sng has quit [Remote host closed the connection]
sng has joined #u-boot
<marex> matthewcroughan-: you seems to have missed this naoki person
<marex> oh
<marex> matthewcroughan-: btw if this is aarch64 system, you likely do need the atf blob
<marex> matthewcroughan-: do you have that blob ?
<matthewcroughan-> bl31.elf?
<matthewcroughan-> Here's the logs I'm getting from u-boot, a bit scrambled however https://termbin.com/n7uap
<matthewcroughan-> https://termbin.com/jkmq
<matthewcroughan-> I've tried various power supplies, and the official OS images boot of the same PSU, so can't be that I'm thinking
Wouter0100670440 has quit [Quit: The Lounge - https://thelounge.chat]
Wouter0100670440 has joined #u-boot
<matthewcroughan-> It seems not to want to boot from the extlinux on the sd card
<matthewcroughan-> strange
<matthewcroughan-> And it does crash and burn halfway through execution
<matthewcroughan-> I have tried the u-boot from 2023.07.02 and the current master, neither seem to be different in any way, both fail in the same way
bq has quit [Ping timeout: 244 seconds]
sng has quit [Remote host closed the connection]
sng has joined #u-boot
<marex> ah
<marex> hanetzer: sjg1: didnt one of you work with rockchip stuff ? ^
<marex> maybe you can help ?
<marex> matthewcroughan-: I _think_ naoki is in JST, so GMT+9 , maybe just monitor this channel for when they show up
<sjg1> matthewcroughan-: Looks like mangled serial to me...I don't have a rock4c plus but have been using mainline on rock5b
<matthewcroughan-> reducing the baudrate to 38400 cleans up the serial
<marex> isnt the problem something to do with TPL and DRAM ?
<marex> sjg1: ^
sng has quit [Read error: Connection reset by peer]
<matthewcroughan-> my cable has been doing 115200 just fine on other boards
<Kwiboo> matthewcroughan-: just tested on a rock-4c-plus and it boots fine using latest master here, see https://gist.github.com/Kwiboo/b6689a11bd5f7e6369f5c778ae581fd3, using normal 1500000 baudrate
<matthewcroughan-> I'll double check and try ga1b10fcc92 of arm-trusted-firmware
<matthewcroughan-> Kwiboo: Excellent, thank you so much
<sjg1> matthewcroughan-: Yes it's supposed to be 1.5Mbaud though, if that matters
<Kwiboo> not sure that is the correct git sha for atf, but this was using a build of the atf v2.8 tag
<matthewcroughan-> Yeah I'm building with 2.9, may cause an issue, it's possible but unlikely
<marex> remembering my massive issues with STM32MP13xx, TFA and OpTee-OS due to firmware ABI incompatibility and the tragic way in which TFA is maintained, I wouldn't be surprised Y_Y
<sjg1> marex: What happened to pulling that stuff into U-Boot, or at least making it a library? Last I looked it has libfdt!
<matthewcroughan-> marex: can you give me the exact commit hash your thing is based on?
<matthewcroughan-> v2.8.0 is currently at 9881bb9, I'd love to make triple sure that I'm using the same as you
<matthewcroughan-> Also, can you tell me what commit of u-boot you're using?
<marex> sjg1: what stuff ?
<marex> matthewcroughan-: ask Kwiboo
<matthewcroughan-> Oh derp, misread the chat log sorry
<matthewcroughan-> Kwiboo: and you're flashing the resulting `u-boot-rockchip.bin` in order to achieve the log you posted?
<Kwiboo> matthewcroughan-: atf is whatever commit https://github.com/ARM-software/arm-trusted-firmware/archive/v2.8.tar.gz has, will try a new build with atf v2.9 and plain u-boot v2023.10-rc1
<matthewcroughan-> thank you so much, this will reveal if I have other issues going on :D
sng_ has joined #u-boot
<sjg1> marex: ATF bits
<matthewcroughan-> Does the ATF not end up in u-boot-rockchip.bin because of binman?
<Kwiboo> matthewcroughan-: look like I was having a patch for atf that changed RK3399_BAUDRATE to 1500000, here are new boot logs: https://gist.github.com/Kwiboo/e11b04dda9cba08ef7b17429b55deb41 one using atf v2.9 and the second one using rkbin bl31 v1.36
stipa has joined #u-boot
<Kwiboo> matthewcroughan-: the second one using rkbin bl31 was the u-boot-rockchip.bin from my github actions run at https://github.com/Kwiboo/u-boot-build/actions/runs/5700788530
<marex> sjg1: you have to ask ARM why they dont want to cooperate on single bootloader codebase, but rather fragment the landscape
<sjg1> marex: I think I have done that enough, but ARM has not exactly led the way on bootloader innovation, so waiting for something from them seems brave to me
persmule has joined #u-boot
<matthewcroughan-> Kwiboo: What is rkbin needed for exactly? If my build produces a u-boot-rockchip.bin, do I still have to do some post-processing on this?
<Kwiboo> rkbin bl31 is an atf blob provided by rockchip, you should use mainline atf 2.9, my pipeline is only setup to use rkbin blobs as BL31=
<matthewcroughan-> Ah.. What I was doing was going to https://github.com/ARM-software/arm-trusted-firmware and making rk3399 my defconfig
<matthewcroughan-> I was then using the bl31.elf that comes out of that as bl31
<Kwiboo> as you should do and is mentioned at https://u-boot.readthedocs.io/en/latest/board/rockchip/rockchip.html
<matthewcroughan-> I wonder what's going wrong then.
<matthewcroughan-> I'm building natively, not cross-compiling, only other problem I can think of.
<matthewcroughan-> Kwiboo: `9525248 bytes (9.5 MB, 9.1 MiB) copied, 6.28027 s, 1.5 MB/s` how many bytes does your 2.9 ATF have?
<matthewcroughan-> when put into the u-boot-rockchip.bin, I mean
persmule has quit [Remote host closed the connection]
<Kwiboo> matthewcroughan-: you should not put anything into u-boot-rockchip.bin yourself, just build u-boot using e.g. make BL31=/path/to/bl31.elf etc. and binman puts it in u-boot-rockchip.bin
<Kwiboo> the resulting u-boot-rockchip.bin have everything or build should have failed
<matthewcroughan-> Yeah that is what I thought, and now the only difference I can see between what you are doing and what I am doing is that you're cross-compiling and I am not
<Kwiboo> try the bulid artifact from https://github.com/Kwiboo/u-boot-build/actions/runs/5700788530 and see if that boots on your board, it uses 1500000 baudrate
<matthewcroughan-> I don't seem to have a cable that can do that baudrate, sadly ;D
<matthewcroughan-> I would be able to try if you set it to CONFIG_BAUDRATE=38400, I'm really not sure why this is the case, as I've been using 115200 on other boards just fine, but I can only get normal output at 38400 on this board
<matthewcroughan-> although I'm going to try it and see if it boots my OS via HDMI still
<matthewcroughan-> Oh and additionally, the official OS images seem to be garbled at 1500000, until they boot into the OS, on my cable, once in the OS I can use it just fine, it's very odd
sng_ has quit [Remote host closed the connection]
rvalue has quit [Ping timeout: 246 seconds]
rvalue has joined #u-boot
<matthewcroughan-> It seems unhappy still, but I have no cable that can verify what's going on at that baudrate
<matthewcroughan-> Just borrowed a genuine FTDI, hopefully produces different results
<matthewcroughan-> I don't seem to get any output even with a genuine ftdi cable from your u-boot-rockchip.bin Kwiboo
<matthewcroughan-> dd if=u-boot-rockchip.bin of=/dev/sda bs=512 seek=64
<matthewcroughan-> It's a 3v3 cable
<matthewcroughan-> Yeah, still can't achieve 1.5mbps even with a genuine ftdi cable
<matthewcroughan-> 115200 is still garbled with that too
sng_ has joined #u-boot
qqq has quit [Quit: leaving]
<matthewcroughan-> Kwiboo: what serial cable are you using? What does it report in `dmesg` when you plug it in? I want to see if we have the same cable, or if yours is different in some way. I'm unable to achieve 1.5mbps with any cable I have here, including genuine FTDI
<matthewcroughan-> Kwiboo: My board is revision V1.41, can you confirm what your board revision is?
<marex> __ad: any plan to clean up NEEDS_MANUAL_RELOC on m68k ?
<matthewcroughan-> Does anybody know if rkbin is still required to produce the u-boot-rockchip.bin as part of the build process? Or is this documentation obsolete now? https://u-boot.readthedocs.io/en/latest/board/rockchip/rockchip.html#package-the-image-with-rockchip-miniloader
<matthewcroughan-> tools/binman/missing-blob-help still states: rockchip-tpl:
<matthewcroughan-> binary and build with ROCKCHIP_TPL=/path/to/ddr.bin. One possible source
<matthewcroughan-> for the external TPL binary is https://github.com/rockchip-linux/rkbin.
<matthewcroughan-> An external TPL is required to initialize DRAM. Get the external TPL
<matthewcroughan-> Is this actually still necessary to include in the build?
<Kwiboo> matthewcroughan-: I also have the v1.41 revision and are using the pine64 "Woodpecker" for serial console, and you only need atf 2.9 built for rk3399 and build u-boot with rock-4c-plus-rk3399_defconfig and BL31=/path/to/your/aft-2.9/bl31.elf
<matthewcroughan-> Not to bother too much, but can you do a CI run with a baudrate of 38400 so I can see what's going on?
<Kwiboo> ROCKCHIP_TPL and other rkbin blobs is only required for newer SoCs like rk3568 and rk3588, they do not have open source version of TPL or TF-A
<matthewcroughan-> and just to confirm, you're attaching your serial to UART2 not UART4?
<Kwiboo> correct, uart2 and 1500000 baudrate is the default on rockchip
<matthewcroughan-> Additionally, the logs are very random. Sometimes U-Boot tells me that there's a 256B stride. Sometimes Trying to boot from BOOTROM and sometimes Returning to boot ROM... TPL: failed to boot from all boot devices ### ERROR ### Please RESET the board ###
<matthewcroughan-> Sometimes 0B stride
<matthewcroughan-> Whatever the case, it never seems to get to the SPL
<Kwiboo> have you tried with another sd-card or emmc module, or any of the vendor images and see if they work? your device could be damaged
<matthewcroughan-> There is no emmc module inserted into the board, it came without one, and I do not have one. The vendor images work fine, that's what's so confounding about this :D
<matthewcroughan-> mkimage reports the same for the vendor images and my u-boot image
persmule has joined #u-boot
<matthewcroughan-> https://termbin.com/00pu
<matthewcroughan-> Well, slightly different, but same magic
<matthewcroughan-> But yes, even with the vendor images, u-boot is corrupted on all of my serial cables, at 1.5mbps.
<matthewcroughan-> Only once the OS boots does it stabilize and allow me to read it at 1.5mbps
<matthewcroughan-> vendor images won't be using the upstream u-boot though, they'll be using the old vendor methods, right?
<matthewcroughan-> I have thought about trying to reproduce the vendor methods, but I figure it's a better use of time to try to get official u-boot working
<matthewcroughan-> Kwiboo: just tried my fourth FTDI based cable, all from different manufacturers and various kinds, I can't get any serial out of your github actions binaries
<matthewcroughan-> the baudrate is just too damned high! :d
<marex> matthewcroughan-: why not just reduce the baudrate ?
<marex> matthewcroughan-: doesnt the code allow that ?
<matthewcroughan-> I have, on my builds, and my builds don't boot anything and do not get to the SPL for some reason
<matthewcroughan-> whereas kwiboo's builds supposedly work, and I want to test them on my hardware
<matthewcroughan-> but I can't test kwiboo's builds without 1.5mbps, which 4 of my serial cables cannot achieve
<matthewcroughan-> 4 diverse FTDI cables, 2 laptops, screen and picocom, 1.5mbps, it's a no go
<matthewcroughan-> Only on one of the cables do I get anything, and it's just garbage chars
<Kwiboo> matthewcroughan-: you should probably build with verbose debug logging and to see how far it gets
<matthewcroughan-> Kwiboo: Oh what's the option to do that?
sng_ has quit [Remote host closed the connection]
<matthewcroughan-> What's the appropriate level you're suggesting I set?
<matthewcroughan-> Finish SDRAM initialization...
<matthewcroughan-> SPL malloc() before relocation used 0x22b0 bytes (8 KB)
<matthewcroughan-> Trying to boot from BOOTROM
<matthewcroughan-> >>TPL: board_init_r()
<matthewcroughan-> Freezes at "Trying to boot from BOOTROM"
<matthewcroughan-> but only occasionally. Sometimes it freezes at Finish SDRAM initialization...; SPL malloc() before relocation used 0x22b0 bytes (8 KB) >>
<matthewcroughan-> sometimes at spl_init
<matthewcroughan-> The thing that is consistent is that it is always after a malloc() after SDRAM initialization:... (full message at <https://libera.ems.host/_matrix/media/v3/download/libera.chat/6d61735212188d9401e85f28ddc0a2bbdb2f5bdd>)
<matthewcroughan-> So I don't really think I have more information than I did before. It won't boot the SPL.
<matthewcroughan-> I see this patch from 2017, but it is no longer true I guess?
<Kwiboo> you could try using rockchip TPL blob from https://github.com/rockchip-linux/rkbin/tree/master/bin/rk33, e.g ROCKCHIP_TPL=/path/to/rk3399_ddr_800MHz_v1.30.bin and use CONFIG_ROCKCHIP_EXTERNAL_TPL=y
<matthewcroughan-> It's an RK3399-T just to be careful and sure, these bins will work with this chip?
<matthewcroughan-> the rock-4c-plus is a -T (low power edition) RK3399
<Kwiboo> change log at https://github.com/rockchip-linux/rkbin/blob/master/doc/release/RK3399_EN.md mention "Add support RK3399-T, RK3399-2T for DDR." for version 1.28, so v1.30 should have support for it
<clever> matthewcroughan-: *waves*
<matthewcroughan-> 👋
<matthewcroughan-> Oh, when I add the external TPL the size goes from 9.1MiB to 9.4MiB :D
<matthewcroughan-> Oh that made a big difference kwiboo
<matthewcroughan-> it gets a lot further
<Kwiboo> could be that u-boot tpl does not support the dram module used on your board
<matthewcroughan-> oh wonderful, hardware differences :)
<Kwiboo> the rockchip tpl blob should contain configuration for different dram modules and types, hence the size increase
urja has quit [Quit: WeeChat 3.6]
macromorgan has quit [Remote host closed the connection]
macromorgan has joined #u-boot
<matthewcroughan-> Kwiboo: https://termbin.com/ydb22
<matthewcroughan-> so we get to the point of it discovering ATF 2.9
<matthewcroughan-> why does it reset though?
<matthewcroughan-> full log https://termbin.com/v7ka
<matthewcroughan-> oops..
<matthewcroughan-> Kwiboo: it looks like there's an FDT Overlap, I've modified `lib/fdtdec.c` to print a better log `FDT:000000000031ecf0 gd:00000000002fbdf0 top:0000000000334000 &stack_ptr:00000000002fbdac `
<matthewcroughan-> Here's the full log
<matthewcroughan-> log can be seen on line 375
<matthewcroughan-> So close, hah
goliath has joined #u-boot
<Kwiboo> matthewcroughan-: a build without all debug flag would skip that crash, https://source.denx.de/u-boot/u-boot/-/blob/master/lib/fdtdec.c#L1240-1261
<matthewcroughan-> OH..
<matthewcroughan-> So I should just turn debug off
<matthewcroughan-> I can't have the best of both worlds? LD
<matthewcroughan-> :D*
<Forty-Bot> is it possible to prevent LTO from ignoring -marm ?
rvalue has quit [Read error: Connection reset by peer]
<Forty-Bot> I keep having my inline arm-only instructions put in thumb functions
<Forty-Bot> this doesn't happen with LTO off
<Forty-Bot> if I stick everything in a .S file it works out
<clever> Forty-Bot: i think there was an attribute to tag a single function as arm or thumb?
<Forty-Bot> yes, it's __attribute__(__target__("arm"))
<Forty-Bot> but it doesn't work
<clever> but i dont know what LTO would do in that case
<Forty-Bot> I think what's happening is that LTO is inlining everything, but these functions still need to be separate so they can be called in arm mode
<clever> yeah, its possible it inlined it into a thumb function
<clever> and LTO was able to just rebuild it in thumb mode, except for the asm
<clever> throw a no-inline on it as well? will LTO respect that?
rvalue has joined #u-boot
<marex> Forty-Bot: is there no thumb equivalent or what ?
<Forty-Bot> marex: not for arm5-arm6
<marex> arch/arm/lib/ashldi3.S- ARM( orrmi ah, ah, al, lsr ip )
<marex> arch/arm/lib/ashldi3.S: THUMB( lsrmi r3, al, ip )
<marex> cfr ^
<Forty-Bot> yeah, I think I'm going to end up just using a .S file, since it gets compiled correctly (afaik)
<marex> Forty-Bot: err , are you using inline asm or just C code that is miscompiled ?
<marex> if C code that is miscompiled, then that's compiler bug
<Forty-Bot> inline asm
<Forty-Bot> since the __builtin version was calling out to a library function
<marex> so what ?
<marex> just call the library function ?
<marex> that one probably handles it correctly, no ?
<Forty-Bot> it's part of the gcc builtins
<clever> then -lgcc ?
<marex> ... so ? :)
<Forty-Bot> well, the goal is to reduce code size
<marex> clever: you cannot do that easily
<marex> Forty-Bot: which function is that ?
<marex> Forty-Bot: u-boot already does provide PRIVATE_LIBGCC
<Forty-Bot> __clzsi2
<marex> linux lib/clz_ctz.c
<marex> Forty-Bot: just import that and let compiler do its thing
<Forty-Bot> no, I am implementing fls/ffs with ctz :P
<marex> import those from Linux too ?
<Forty-Bot> I did
<Forty-Bot> what I suspect is that Linux always runs in arm mode on armv5-armv6
<Forty-Bot> so they can always use __builtin_clz etc.
<Forty-Bot> but we need to support thumb1, so those instructions need to be arm
<marex> Forty-Bot: CONFIG_ARM_THUMB ?
<Forty-Bot> no, CONFIG_HAS_THUMB2
<Forty-Bot> the diff in arch/arm/include/asm/bitops.h shows the logic
BWhitten has joined #u-boot
<marex> oh hum
* marex is neck deep in m68k reloc cesspool
<Forty-Bot> well, the assembly version works and is not too bad, but it does generate these "call_foo_from_thumb" wrappers
<Forty-Bot> eh, maybe it is better to just only enable this for 7 and up
<Forty-Bot> it will be much easier and it will still be a good size reduction
BWhitten has quit [Ping timeout: 250 seconds]
ikarso has joined #u-boot
mmu_man has joined #u-boot
<marex> "Boards which are not fixed to support relocation will be REMOVED!" :-)
<marex> 92d5ecba47fe (Albert Aribaud 2010-10-11 13:13:28 +0200 39) Boards which are not fixed to support relocation will be REMOVED!
BWhitten has joined #u-boot
<Forty-Bot> do they still exist?
<marex> Forty-Bot: on m68k yeah
<marex> Forty-Bot: it's like the last stronghold of that crap
<Forty-Bot> ah, yeah
<marex> Forty-Bot: and the whole codebase is littered by this
<marex> Forty-Bot: so I'm trying to nuke it, finally
<marex> and then do massive code base clean up...
<Forty-Bot> why do they still do manual relo? is the linker broken?
<marex> Forty-Bot: coz nobody cared enough I guess
<marex> Forty-Bot: but I just keep plunging into this goo in networking stack and uh ... the time has come
<marex> Forty-Bot: I was trying to decide what to learn next, whether I should consider rust or m68k assembler ... I opted for the later :)
<Forty-Bot> one of these skills will be relevant in 50 years...
<marex> Forty-Bot: the later I'm sure
<marex> Forty-Bot: it's like COBOL
BWhitten has quit [Ping timeout: 264 seconds]
vagrantc has joined #u-boot
mmu_man has quit [Ping timeout: 246 seconds]
Wouter0100670440 has quit [Quit: The Lounge - https://thelounge.chat]
Wouter0100670440 has joined #u-boot
bq has joined #u-boot