rellla changed the topic of #linux-sunxi to: Allwinner/sunxi /development discussion - did you try looking at our wiki? https://linux-sunxi.org - Don't ask to ask. Just ask and wait! - https://github.com/linux-sunxi/ - Logs at http://irclog.whitequark.org/linux-sunxi - *only registered users can talk*
sunshavi has quit [Ping timeout: 260 seconds]
sunshavi has joined #linux-sunxi
<gameblabla> Btw, was able to make SDL 1.2 work and change the scaling mode. Seems like the kms magic needs to be done within the library itself
<gameblabla> Although now i wonder if it's able to upscale 8bpp via the Display Engine ? I know that 16bpp isn't supporting for upscaling and indeed, 16bpp isn't mentionned in the A20 doc
<gameblabla> *supported
<gameblabla> I had to make SDL 1.2 force to a software surface for 16bpp.
gameblabla has quit [Remote host closed the connection]
gameblabla has joined #linux-sunxi
<gameblabla> Yup, 8bpp doesn't work
<gameblabla> So only 32bpp it seems for Display engine
rah_ has joined #linux-sunxi
tuxillo has joined #linux-sunxi
sunshavi has quit [Ping timeout: 264 seconds]
gameblabla has quit [Ping timeout: 246 seconds]
cnxsoft1 has joined #linux-sunxi
Mangy_Dog has quit [Ping timeout: 256 seconds]
cnxsoft has quit [Ping timeout: 246 seconds]
rah_ has left #linux-sunxi [#linux-sunxi]
netlynx has quit [Quit: Ex-Chat]
gameblabla has joined #linux-sunxi
apritzel has quit [Ping timeout: 256 seconds]
kaspter has joined #linux-sunxi
jstein_ has joined #linux-sunxi
jstein is now known as Guest64420
jstein_ is now known as jstein
lucascastro has joined #linux-sunxi
lucascastro has quit [Read error: Connection reset by peer]
Guest64420 has quit [Ping timeout: 264 seconds]
jstein has quit [Quit: quit]
sunshavi has joined #linux-sunxi
kaspter has quit [Ping timeout: 240 seconds]
kaspter has joined #linux-sunxi
gaston1980 has quit [Quit: Konversation terminated!]
asdf28 has joined #linux-sunxi
Net147 has quit [Quit: Quit]
lurchi_ is now known as lurchi__
vagrantc has quit [Ping timeout: 264 seconds]
Net147 has joined #linux-sunxi
ChriChri_ has joined #linux-sunxi
ChriChri has quit [Ping timeout: 240 seconds]
ChriChri_ is now known as ChriChri
JohnDoe_71Rus has joined #linux-sunxi
[7] has quit [Disconnected by services]
TheSeven has joined #linux-sunxi
<smaeul> bauen1: All I know is the SPC register layout (confirmed against the BSP once I knew what to look for), not the meaning of individual bits
<smaeul> bauen1: the "crypto" registers in the RTC are for DRAM scrambling, which I was able to get working on the A64
<smaeul> apritzel: yes, they survive a watchdog reset
<smaeul> the values also survive a power-on reset from the PMIC (since VCC-RTC is maintained), but the registers are ignored at that point
camus has joined #linux-sunxi
kaspter has quit [Ping timeout: 240 seconds]
camus is now known as kaspter
asdf28 has quit [Ping timeout: 264 seconds]
random_yanek has quit [Ping timeout: 258 seconds]
random_yanek has joined #linux-sunxi
lurchi_ has joined #linux-sunxi
lurchi__ has quit [Ping timeout: 240 seconds]
kevans91 has quit [Ping timeout: 246 seconds]
daregap has joined #linux-sunxi
kevans91 has joined #linux-sunxi
gameblabla has quit [Remote host closed the connection]
_whitelogger has joined #linux-sunxi
vagrantc has joined #linux-sunxi
cmeerw has joined #linux-sunxi
apritzel has joined #linux-sunxi
cmeerw has quit [Ping timeout: 260 seconds]
<Tooniis> I'm trying to get the mali 400 on a13 to work. I've added a node for it: https://gitlab.com/Tooniis/linux/-/commit/473587e6df0312a38eee448443b70eb73078581b
<Tooniis> also now I have `/sys/kernel/debug/dri/0`
<Tooniis> but I still don't know how to make use of the gpu
<Tooniis> I think there's something to do with the display engine
<Tooniis> there's nothing about it in dmesg
<Tooniis> I've made sure it's enabled in the kernel config and dts
<Tooniis> I've noticed that `allwinner,sun5i-a13-display-frontend` isn't in sun4i_frontend.c. So it's not supported yet I guess?
<Tooniis> I tried just adding it just to see if I get anything in dmesg https://gist.github.com/Tooniis/ee6a7b4bd41e94db1705537701015fa9
<Tooniis> I still got nothing
<wens> Tooniis: the gpu itself is render only, i.e. it renders back to memory
<wens> check under /dev/dri/by-path and you can see what you have active
<Tooniis> wens: yes it's there
<Tooniis> but how do I make use of it?
<Tooniis> what's responsible for copying the data it outputs to the framebuffer?
<Tooniis> as far as I understand the display engine is responsible for that
<Tooniis> or does the display engine just take the data in the framebuffer and send it to the display?
<wens> the latter
apritzel has quit [Ping timeout: 272 seconds]
<Ashleee> smaeul, bad news, the timer fix on a64 on mainline doesn't work, had +95 years again this morning on one of the nodes :(
<bauen1> smaeul: nice, do you have some example code of getting DRAM scrambling on the a64 or some general idea of what it does (just xor, or maybe something more complicated ?)
_whitelogger has joined #linux-sunxi
gameblabla has joined #linux-sunxi
<Tooniis> * I'm trying to get the mali 400 on a13 to work. I've added a node for it: https://gitlab.com/Tooniis/linux/-/commit/5f0bd65afaef0567af6a40cc8cbbf9878cd6d348
<smaeul> bauen1: it's address-dependent, so it breaks DRAM size detection if enabled at that point. the easist way to play with it is from the crust "shell"
<smaeul> patch crust to also call debug_monitor(); in the SS_AWAKE case, and then put Linux in s2idle (*not* mem sleep)
<smaeul> > m 0x1f00210 0x1689 > m 0x1f00214 0x12345678 > m 0x1f00210 0x1689 > m 0x1f00218 1
<smaeul> 0x1689 is the SoC ID for A64, but the code from the H6 BSP (that does this on H6) uses the same value. I've only tested on A64
<bauen1> thanks, i'll take a look then when i get to the point of having crust working
<smaeul> 0x1f00218 is enable/disable, so write it back before resuming Linux: > m 0x1f00210 0x1689 > m 0x1f00218 1
<smaeul> I mean > m 0x1f00210 0x1689 > m 0x1f00218 0
<smaeul> obviously anything touching these registers has to run from SRAM. TF-A has console_getc() but nothing uses it; crust has the interactive part already :)
<smaeul> benchmarks with ramspeed-smp showed no difference with scrambling on/off
<bauen1> so with scrambling it just mixes where the values are actually stored, so that they're no longer stored in a linear order ?
_whitelogger has joined #linux-sunxi
apritzel has joined #linux-sunxi
<bauen1> apritzel: the 32kb limit is artificial and created by my code in the rtc that "patches" the sbrom to make it actually secure, in theory the h6 can boot a toc0 image up to around 128kb
<bauen1> but i only have 1 instruction to ensure the size doesn't exceed 128kb, and just storing zeros in the upper two bytes is simple enough
<bauen1> actually that means i have 64kb *facepalm*
<smaeul> bauen1: https://tpaste.us/qg5K hopefully that explains things a bit
apritzel has quit [Ping timeout: 246 seconds]
kaspter has quit [Ping timeout: 260 seconds]
warpme_ has joined #linux-sunxi
<smaeul> Ashleee: bummer. I have some testing tools I'll clean up and send your way to help pinpoint where the problem is
<Ashleee> thanks
<Ashleee> actually had two nodes happen overnight, the second one happened as I was rebooting the first one :) other 14 are ok so far
asdf28 has joined #linux-sunxi
<smaeul> can you try applying this patch? it is not something upstreamable, but it is equivalent to one of the things the BSP does: https://patchwork.kernel.org/project/linux-arm-kernel/patch/1445952073-7260-3-git-send-email-yangyingliang@huawei.com/
<Ashleee> or just the 2nd part of the patch?
<smaeul> just the second one. the first patch was already applied
<Ashleee> ah
<Ashleee> ok will rebuild and reboot half of the nodes, thanks :)
<Ashleee> I will remove the armbian patch that I wanted to retry on 5.10.4
cnxsoft1 has quit [Quit: cnxsoft1]
<smaeul> bauen1: it looks like there is some fixed component, then the key is shuffled and XORed with the data https://tpaste.us/N8nm
gameblabla has quit [Remote host closed the connection]
gameblabla has joined #linux-sunxi
<bauen1> yes, that looks like it
cnxsoft has joined #linux-sunxi
<smaeul> so it does more for signal integrity than security :)
<bauen1> yet they named it "CRYPTO", gotta love allwinner manuals
cnxsoft has quit [Client Quit]
<smaeul> yeah, the naming is bad, but I didn't really expect anything more; after all, it has to work at "line speed" (3GB/s or more)
<bauen1> i mean i can still use it, security by obscurity isn't bad, it just shouldn't be the only thing
<Ashleee> there we go, booted 9 nodes into the 5.10.4 kernel with the clocksource config enabled..
<smaeul> good luck :)
<smaeul> bauen1: right, that's all it is
<smaeul> since 4 bytes of known plaintext anywhere in DRAM are all you need to break it
<bauen1> you first need to know about the feature, and allwinner has done a good job hiding that it exists lol
BroderTuck has joined #linux-sunxi
<bauen1> smaeul: by the way, did you try using mkimage to put the spl directly into the toc0 image ?
<BroderTuck> Hey, did everything in the "Planned for 5.10" section of "Linux Mainlining effort" land in 5.10?
<jernej> BroderTuck: only exception I can think of is that one R40 Cedrus patch was missed for 5.10 so it was postponed to 5.11
<bauen1> smaeul: so far i've used pine_h64_defconfig, adjusted SPL_TEXT_START = 0x20840 and then used mkimage with '-a 0x20840', which should result in not copying the spl around at all
<bauen1> the spl is loaded and activates uart before going into a loop of printing its version
apritzel has joined #linux-sunxi
<bauen1> oh, looks like it was trying to boot some left over spl
fl_0 has quit [Quit: STRG + Q]
kaspter has joined #linux-sunxi
fl_0 has joined #linux-sunxi
<smaeul> bauen1: I use what I pushed, so CONFIG_SPL_TEXT_BASE (== 0x20060). the memmove() is unconditional, I don't know if there's an optimization to skip copying when src == dst
<smaeul> not sure what you mean by "directly into the toc0 image"
<smaeul> btw that's why the ruby script has its own shim, so it can copy the boot source byte to where SPL expects it
<bauen1> there is no optimization, but i would like to avoid having "two" copies of the bootloader in memory, especially if i later need to abuse those header fields to make sure the header is signed
<bauen1> yes, i just mean without that shim, but everything works fine now
<smaeul> probably because I removed the check for the eGON magic :) https://github.com/smaeul/u-boot/commit/1ccb10a4e913fefd507513178d4c7830f06c4b67
<bauen1> still even with 64kb i'm having trouble fitting the spl, since the fit_signature features requires massive amounts of code, just for a simple rsa implementation
<smaeul> yeah, there's a lot of junk in there you don't need. you could probably plug in a CE driver instead of the software implementation
<bauen1> there's a few other concerning things too, i don't really want to have anything up to a firmware tpm implementation touch dram at all, but that might not be possible without some heavy patches ; and the sbrom still lacks rollback pervention
<bauen1> i think rollbacks could be prevented by having a tiny shim at the start of any signed boot code that does the rollback counter check
<smaeul> there's *supposed* to be hardware rollback prevention, if we can figure out how to make it work
<smaeul> so you mean putting the next-stage counter in the code itself?
<bauen1> smaeul: i would have to double check the sbrom dump, but i don't think the sbrom actually implements the rollback counter
<smaeul> bauen1: you could implement the rollback counter using the vendor ID
<bauen1> the "documented" rollback counter registers of the trusted watchdog are also not persistent, so that is annoying
<bauen1> smaeul: my idea would be to start the bootloader with a tiny shim that loads the current rollback counter (e.g. from sid or rtc) and then compares it to its own, update the rollback counter if necessary or prevent boot
<smaeul> set one bit for each update and publish a key item with a new public key
<bauen1> oh right
<bauen1> but doesn't the sbrom do a == check on the vendor id ?
<bauen1> so you would need to first boot with a new image signed by the old key
apritzel has quit [Ping timeout: 258 seconds]
<smaeul> or an old image signed by the old key
<smaeul> as long as you update the SPL and program the SID bit before the same reboot
<bauen1> right, not as smooth as possible, but doable
<bauen1> you could even put the old image at the backup spl location for automatic fallback i think
<smaeul> you wanted rollback prevention, but you got rollforward prevention for free :)
<smaeul> yes, and AFAIK the backup SPL location is the only way to do eGON/TOC0 universal images as well
cmeerw has joined #linux-sunxi
<smaeul> it's a bit unfortunate that you can't put multiple certificates/binaries in a single TOC0
<bauen1> if you smash the stack you can do just about anything you want
<smaeul> :P
<bauen1> but yes, using vendorid is good enough, and leaves more bytes for the secure state encryption key and rollback counter
vagrantc has quit [Quit: leaving]
<smaeul> firmware TPM sounds very tricky. the only secure SRAM is A2, and it is already crowded in there
yann has joined #linux-sunxi
yann has quit [Ping timeout: 260 seconds]
<bauen1> yes, ideally i would use all available sram as secure, including the spi flash as secure peripheral, but even then things are tight
dev1990 has joined #linux-sunxi
apritzel has joined #linux-sunxi
warpme_ has quit [Quit: Connection closed for inactivity]
_whitelogger has joined #linux-sunxi
lucascastro has joined #linux-sunxi
daregap has quit [Quit: daregap]
kaspter has quit [Quit: kaspter]
Mangy_Dog has joined #linux-sunxi
apritzel has quit [Ping timeout: 260 seconds]
vpeter has quit [Remote host closed the connection]
<bauen1> actually, probably quite hard, there's only 32k + 80k sram, part of which will be used up by the trusted-firmware-a, so very tight, even if you swap+encrypt pages to dram when possible
vpeter has joined #linux-sunxi
<bauen1> i'll just worry about that when i run out of memory to put things
apritzel has joined #linux-sunxi
iamfrankenstein has joined #linux-sunxi
<apritzel> bauen1: I see, thanks. I thought that this limit was somewhat artificial, just wanted to point out that the SPL can go beyond 32KB (we need this for the H616 already)
<apritzel> bauen1: and on the H6 the BROM does even boot larger SPLs (up to 139KB) with an eGON header (w/o the secure fuse burnt)
apritzel has quit [Ping timeout: 246 seconds]
apritzel has joined #linux-sunxi
damex has quit [Ping timeout: 240 seconds]
gameblabla has quit [Ping timeout: 264 seconds]
yann has joined #linux-sunxi
gaston1980 has joined #linux-sunxi
yann has quit [Ping timeout: 264 seconds]
netlynx has joined #linux-sunxi
netlynx has joined #linux-sunxi
lurchi__ has joined #linux-sunxi
lurchi_ has quit [Ping timeout: 265 seconds]
iamfrankenstein has quit [Ping timeout: 246 seconds]
lurchi__ is now known as lurchi_
lkcl has quit [Ping timeout: 260 seconds]
lurchi__ has joined #linux-sunxi
lurchi__ has quit [Read error: Connection reset by peer]
lurchi_ has quit [Ping timeout: 240 seconds]
lurchi__ has joined #linux-sunxi
lurchi__ has quit [Read error: Connection reset by peer]
lurchi__ has joined #linux-sunxi
iyzsong has quit [Quit: ZNC 1.7.5 - https://znc.in]
lucascastro has quit [Ping timeout: 260 seconds]
lkcl has joined #linux-sunxi
iyzsong has joined #linux-sunxi
asdf28 has quit [Ping timeout: 264 seconds]
asdf28 has joined #linux-sunxi
tuxd3v has quit [Ping timeout: 264 seconds]
yann has joined #linux-sunxi
lurchi_ has joined #linux-sunxi
lurchi__ has quit [Ping timeout: 265 seconds]
yann has quit [Ping timeout: 272 seconds]
lurchi_ is now known as lurchi__
lucascastro has joined #linux-sunxi
victhor has joined #linux-sunxi
lurchi__ is now known as lurchi_
lurchi_ has quit [Ping timeout: 256 seconds]
lurchi_ has joined #linux-sunxi
lurchi_ is now known as lurchi__
warpme_ has joined #linux-sunxi
lurchi__ is now known as lurchi_
lurchi__ has joined #linux-sunxi
lurchi_ has quit [Ping timeout: 268 seconds]
andy25225 has quit [Ping timeout: 272 seconds]
andy25225 has joined #linux-sunxi
\\Mr_C\\ has quit [Quit: (Read error: Connection reset by beer)]
\\Mr_C\\ has joined #linux-sunxi
victhor has quit [Remote host closed the connection]
victhor has joined #linux-sunxi
apritzel has quit [Ping timeout: 260 seconds]
apritzel has joined #linux-sunxi
apritzel has quit [Ping timeout: 264 seconds]
ldevulder_ has joined #linux-sunxi
arnd has quit [Ping timeout: 260 seconds]
Turl_ has quit [Quit: >.<]
ldevulder__ has quit [Ping timeout: 260 seconds]
Turl has joined #linux-sunxi
lerc has quit [Read error: Connection reset by peer]
NekoEd has quit [Ping timeout: 260 seconds]
lerc has joined #linux-sunxi
NekoEd has joined #linux-sunxi
arnd has joined #linux-sunxi
DrFrankensteinUK has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
DrFrankensteinUK has joined #linux-sunxi
lucascastro has quit [Ping timeout: 260 seconds]
t3st3r has joined #linux-sunxi
warpme_ has quit [Quit: Connection closed for inactivity]
apritzel has joined #linux-sunxi
gaston1980 has quit [Quit: Konversation terminated!]
JohnDoe_71Rus has quit [Quit: KVIrc 5.0.1 Aria http://www.kvirc.net/]
asdf28 has quit [Ping timeout: 240 seconds]
cmeerw has quit [Ping timeout: 260 seconds]
cmeerw has joined #linux-sunxi
apritzel has quit [Ping timeout: 240 seconds]
BroderTuck has quit [Quit: -]