<apritzel>
wens: me neither, but it looks like AW did their usual job of "just somehow get this to work", and interpret standards and specs rather loosely ...
gamiee has quit [Ping timeout: 480 seconds]
<gediz>
apritzel: i meant video output rotation
<gediz>
custom board with an A13
<gediz>
i had a similar problem while trying to enable TTF fonts after DM_VIDEO is implemented for sunxi
<gediz>
it's okay for now but i don't know how and why disabling private libgcc fixes this problem
<apritzel>
gediz: ah, I think there are some generic issues with DM_VIDEO
<apritzel>
amazingly this is not really up to par with the old video support
<gediz>
i think it's acceptable. looks more complex compared to the legacy video implementation.
<apritzel>
gediz: well, but if everyone is forced to move to DM_VIDEO, I would expect it to be at least not worse than the old one
<apritzel>
but for instance the nifty logo support is missing, also there is no visible cursor
MatrixTravelerbot[m] has quit []
<gediz>
i'm working on logo. going to send the patch.
<gediz>
but yes, it may actually be considered as a slight regression in some terms.
choozy has joined #linux-sunxi
<arnd>
apritzel: it sounds like T-Head already had the reserved page table bits, but AW relied on using them, rather than making the SoC cache-coherent
choozy has quit [Ping timeout: 480 seconds]
choozy has joined #linux-sunxi
Daaanct12 has joined #linux-sunxi
Danct12 has quit [Ping timeout: 480 seconds]
awe has joined #linux-sunxi
awe has quit []
tuxd3v has quit [Ping timeout: 480 seconds]
tmarangoni has joined #linux-sunxi
awe has joined #linux-sunxi
mripard has joined #linux-sunxi
ats_ has joined #linux-sunxi
diego71 has joined #linux-sunxi
Mangy_Dog has quit [Remote host closed the connection]
Mangy_Dog has joined #linux-sunxi
jernej_ is now known as jernej
cmeerw has joined #linux-sunxi
prefixcactus has quit [Ping timeout: 480 seconds]
prefixcactus has joined #linux-sunxi
<karlp>
delightfull. been trying to diagnose some spi issues, works _without_ teh LA attached, gives bad results when the LA is attached.
<jernej>
I updated this according to schematics and vendor images...
ftg has joined #linux-sunxi
awe has left #linux-sunxi [#linux-sunxi]
awenth has joined #linux-sunxi
<awenth>
I'm attempting to build u-boot with toc0 (efuses set) for the Allwinner H5. I have an orangepi-zero-plus module. The build of smaeul's u-boot (toc0 branch) fails with: MKIMAGE spl/sunxi-spl.bin; make[1]: *** [scripts/Makefile.spl:424: spl/sunxi-spl.bin] Error 1. If I tell make to verbosely print the commands (make V=1) then it succeeds.... u-boot-sunxi-with-spl.bin is generated successfully. Has anybody else had this problem?
<apritzel>
jernej: sure, send it to the list, and CC: the maintainers ;-)
<apritzel>
jernej: out of curiosity: why do you set the voltage in U-Boot? Is that for older kernels or DTs?
<jernej>
apritzel: well, there is regulator and it's supported by U-Boot already and other H3 boards do it, so...
<jernej>
I enabled it :)
<jernej>
to be honest, I don't know what is default sy8106a voltage
<awenth>
If I look inside u-boot-sunxi-with-spl.bin, the file is padded with 0's up to 0x840. This is clearly invalid. Compared to a mainline u-boot build, the file has the identifier 'eGON.BT0' at the top of the file. I'll investigate more why 'MKIMAGE spl/sunxi-spl.bin' is failing
<jernej>
apritzel: default (power up) voltage seems to be 0.68 V which is a bit low
<apritzel>
oh, indeed
<jernej>
ok, I'll send it and we can discuss it further there
<apritzel>
jernej: even better I can just test it ;-)
gamiee has joined #linux-sunxi
Danct12 has joined #linux-sunxi
Mangy_Dog has quit [Remote host closed the connection]
Daaanct12 has quit [Ping timeout: 480 seconds]
Mangy_Dog has joined #linux-sunxi
<awenth>
smaeul: Looking through the source of the u-boot repo, toc0 branch, I saw that sunxi_toc.0.c requires rotpk.pem. I've copied my key that I used to sign uart0_helloworld with to the root of the repo. Running "./tools/mkimage -T sunxi_toc0 -a 0x10060 -n "sun50i-h5-orangepi-zero-plus" -d spl/u-boot-spl.bin spl/sunxi-spl.bin" now prints: Allwinner TOC0 Image, 3 items, 32768 bytes ....; Writing the image to a SD card & booting it in the H5 with its e-fuses
<awenth>
burned doesn't boot u-boot. It sequence falls through to USB/FEL. Is there any settings that must be changed under menuconfig?
<apritzel>
awenth: so check the generated image: does it contain the "TOC0" magic at the beginning? (offset 0x4, I believe)
<apritzel>
awenth: and did you write it to the right location of the SD card (assuming you use that)?
<apritzel>
awenth: and of course the BROM should not boot normal eGON images anymore (have you checked that?)
<awenth>
apritzel: I'm looking with a binary editor at the contents of u-boot-sunxi-with-spl.bin. From byte offset 0, it starts with the text: TOC0.GLH
<apritzel>
awenth: offset 0?
<awenth>
apritzel: If I compare this to uart0-helloworld-sdboot.toc0, it also starts with TOC0.GLH at byte 0 of the file
<apritzel>
awenth: ah, OK, I thought it was offset 4
<awenth>
I wrote it to SD card as: dd if=<file.toc0 of=/dev/sdc bs=1024 seek=8
<apritzel>
so uart0.toc0 works?
gsz has left #linux-sunxi [#linux-sunxi]
<awenth>
The signed sunxi-tools uart0-helloworld-sdboot.toc0 example boots correctly.
<awenth>
However, using the same key during the build process of u-boot-sunxi-with-spl doesn't print anything on the UART during bootup.
<apritzel>
awenth: did you burn a hash into the fuses?
<awenth>
apritzel: yes. The contents of rotpk.bin was written with another tool into the fuses
<apritzel>
and uart0-helloworld-sdboot.toc0 is generated via this egon2toc0.rb script?
<awenth>
apretzel: I've seen it mentioned. I've already downloaded it but haven't yet used the tools.
<awenth>
apretzel: Should this tool be able to convert a stock u-boot image to toc0? Or was there other work done by smaeul in his u-boot repo to get toc0 working for u-boot?
<apritzel>
awenth: they are two different approaches: the script takes an existing eGON image and adds some code to make it compatible with the existing SPL code
<apritzel>
as some aspects of the booting process are different beyond the mere loading
<apritzel>
smaeul's version is the better solution, as it makes TOC0 a first class citizen in U-Boot's SPL
<awenth>
apritzel: Apart from attaching a JTAG, is there any way to get debug info on why the boot process failed? My u-boot copy build clean after adding the rotpk.pem file to the root of the repo
<apritzel>
awenth: I would run some experiments to narrow it down
<apritzel>
you said it ends up in FEL?
<apritzel>
that would point to the signature not being acknowledged by the BROM
<awenth>
apritzel: yes.
<apritzel>
on the working side you have uart0.toc0
<apritzel>
so as a test I would try building a normal U-Boot eGON image, then using egon2toc.rb
<awenth>
apritzel: I've just copied the contents of my rotpk.pem into egon2toc and converted the uart0 example to toc0. I want to test it quickly
<awenth>
apritzel: The uart0 example did print "Booted from MMC0, entering an infinite loop' on previous runs
<apritzel>
maybe the expected rotpk key format is different between mkimage and the ruby scripts?
<awenth>
mmm
<awenth>
could be.
<apritzel>
I think I ever only tried this without an actual key hash in the fuses, which means the BROM accepts any key
<awenth>
apritzel: A readme would have helped ;)
<apritzel>
awenth: hey, this is code in development, and smaeul was just kind enough to share his (pretty neat) code ...
<awenth>
apritzel: I know. I'm very gratefull for his effort.
<apritzel>
the README is a stretch goal for the funding process ;-)
<apritzel>
it would just be great if more people push for upstream: many people here show up, get their problems solved and then vanish :-(
<awenth>
apritzel: Thats the nature of the beast... Who's maintaining linux-sunxi.org? I'm keeping a step-by-step guide for myself of what I've done sofar. It might help some noobs to get toc0 going from scratch
<apritzel>
awenth: maintaining? It's a wiki. Just register (painless and anonymous), then edit the page
<awenth>
apritzel: I've successfully booted uart0-helloworld-sdboot.toc0 as generated by egon2toc.rb, which was updated to contain my private key certificate file. Output on UART0: Hello from Allwinner H5!\nBooted from MMC0, entering an infinite loop!
<awenth>
apritzel: I'm trying to convert my eGON u-boot image with the same script. It reports: The SPL is larger than 24K, so 'spl_addr' argument is required.
<awenth>
apritzel: Do you know off-hand what the correct adress value is?
<apritzel>
H5? 0x10000 I believe, but let me double check
choozy has joined #linux-sunxi
<apritzel>
yes, it is
<apritzel>
abort "'spl_addr' argument must be either 0x0 or 0x10000."
<awenth>
apritzel: Thx. Thats where SRAM A1 is mapped. On the 32-bit architectures its at 0x0
<apritzel>
yes, exactly
<awenth>
apritzel: Very interesting... I'm getting a uboot response: U-Boot SPL 2019.07 (Sep 03 2019 - 22:44:07 +0200)\nDRAM: 512 MiB\Trying to boot from MMC1
<apritzel>
and it stops there?
<awenth>
apritzel: Let me check with the eGON version on a board with unaltered efuses. I was expecting the board to do a boot countdown, but its hanging there
<apritzel>
did you build from a clean U-Boot branch? or from smaeul's branch? You can't do the latter with that script, the two approaches bite each other (trying to fix the same thing twice)
<apritzel>
if it stops there, it means it fails loading U-Boot proper, or your Trusted Firmware is wrong or missing
<awenth>
apritzel: This is an old mainline u-boot that I've been using for ages on the H5
<apritzel>
OK
<apritzel>
yeah, if you have an "insecure" board, try the unchanged eGON there
<awenth>
apritzel: This is the first successfull uboot response that I've seen sofar. the egon2toc.rb seems to be an inprovement over the older jemk_mktoc0.rb script
<apritzel>
yeah, that's the main reason for egon2toc0's existence, I believe
<apritzel>
but in the long run we want smaeul's version to work
<apritzel>
because that blends in much better into the building process
<awenth>
apritzel: The eGON version boots fine on an 'unsecured' board. It prints this immediately after 'Trying to boot from MMC1': NOTICE: BL3-1: Running on H5 (1718) in SRAM A2 (@0x44000)
<apritzel>
OK, thanks for verifying that
<awenth>
apritzel: Is the A2 ram the main system RAM or another onchip block? The 0x44000 address seems rather low. I wonder with the script complaining about the u-boot size and wanting another offset if everything works as expected in the egon2toc.rb script
<apritzel>
SRAM A2 is the secure SRAM
<apritzel>
it is where Trusted Firmware lives in
<apritzel>
and the egon2toc.rb script uses this area temporarily for something, IIRC
<apritzel>
but that shouldn't hurt, since it's only the SPL that loads TF-A, long after the script has done its magic
<apritzel>
awenth: and if you look into the script, you'll see that it's really either 0x0 or 0x10000, so that's definitely the right value for the H5
<awenth>
apritzel: Is there anything that needs to be set in the menuconfig as part of the configuration of smaeul's u-boot repo? The only setting that I've set was under SPL/TPL: Maximum size of SPL image: 0x20000
<awenth>
apritzel: I've used 'make orangepi_zero_plus_defconfig' to create the initial .config. If he's been using another board, presumably a H6, then the default configs might have some important difference
<apritzel>
I think the last patch hacks everything up so that it works (TM)
<apritzel>
awenth: you could try to revert the H616 patch, not sure if that breaks the other SoCs
<awenth>
apritzel: I've checked out his toc0 branch of his repo. Was it rolled up into his master already?
<awenth>
apritzel: I'm actually a BZR fan, so GIT navigation has always been a bit bizare for me
<apritzel>
"git show HEAD~1 | patch -p1 -R" is a quick hack to revert the penultimate patch
<apritzel>
awenth: that bracn
<apritzel>
awenth: that branch as is should be fine
<awenth>
apritzel: Meaning that I should not have to revert one patch back?
<apritzel>
well, that's a WIP branch, and I don't know if the H616 support patch is compatible with the other SoCs
<apritzel>
so I'd revert that patch if I were you, just to be sure
<awenth>
apritzel: I see tools/sunxi_toc0.c was modified. Let me rebuild
<apritzel>
it changes something in the TOC0 layout, so could theoretically break on older SoCs (pure speculaion)
<awenth>
apritzel: Nope, still falls through to FEL without printing anything on the uart.
<awenth>
apritzel: I see the 'allwinner' branch is newer and mentions the secure monitor being loaded into A2 SRAM.
<awenth>
apritzel: Will that be using toc0 too?
<awenth>
apritzel: Nope, it only has sunxi_egon.c under tools
cmeerw has quit [Ping timeout: 480 seconds]
pentabarf has joined #linux-sunxi
<apritzel>
awenth: yeah, but that patch is for the H3 only anyway
<apritzel>
but he also pulled that patch in
<awenth>
apritzel: If the rotpk.pem is present and I run the mkimage command manually, it prints the spl layout as follow: