ChanServ changed the topic of #linux-sunxi to: Allwinner/sunxi development - Did you try looking at our wiki? https://linux-sunxi.org - Don't ask to ask. Just ask and wait for an answer! - This channel is logged at https://oftc.irclog.whitequark.org/linux-sunxi
junari has joined #linux-sunxi
apritzel has quit [Ping timeout: 480 seconds]
cnxsoft has joined #linux-sunxi
hexdump01 has joined #linux-sunxi
hexdump02 has quit [Ping timeout: 480 seconds]
radxanaoki has joined #linux-sunxi
hexdump02 has joined #linux-sunxi
hexdump0815 has quit [Ping timeout: 480 seconds]
junari_ has joined #linux-sunxi
dsimic is now known as Guest12610
dsimic has joined #linux-sunxi
Guest12610 has quit [Ping timeout: 480 seconds]
junari has quit [Ping timeout: 480 seconds]
ungeskriptet has quit [Remote host closed the connection]
ungeskriptet has joined #linux-sunxi
ungeskriptet has quit [Remote host closed the connection]
ungeskriptet has joined #linux-sunxi
JohnDoe_71Rus has joined #linux-sunxi
ungeskriptet_ has joined #linux-sunxi
ungeskriptet_ has quit [Remote host closed the connection]
ungeskriptet_ has joined #linux-sunxi
ungeskriptet_ has quit [Remote host closed the connection]
ungeskriptet_ has joined #linux-sunxi
ungeskriptet_ has quit [Remote host closed the connection]
ungeskriptet_ has joined #linux-sunxi
ungeskriptet has quit [Ping timeout: 480 seconds]
junari_ has quit [Remote host closed the connection]
ungeskriptet_ has quit [Remote host closed the connection]
ungeskriptet has joined #linux-sunxi
ungeskriptet has quit [Remote host closed the connection]
ungeskriptet has joined #linux-sunxi
ungeskriptet has quit [Remote host closed the connection]
ungeskriptet has joined #linux-sunxi
hexdump01 has quit []
hexdump0815 has joined #linux-sunxi
ungeskriptet has quit [Remote host closed the connection]
ungeskriptet has joined #linux-sunxi
ungeskriptet has quit [Remote host closed the connection]
ungeskriptet has joined #linux-sunxi
montjoie_ has joined #linux-sunxi
mripard has joined #linux-sunxi
warpme has joined #linux-sunxi
ungeskriptet has quit [Remote host closed the connection]
ungeskriptet has joined #linux-sunxi
apritzel has joined #linux-sunxi
ungeskriptet has quit [Remote host closed the connection]
ungeskriptet has joined #linux-sunxi
ungeskriptet has quit [Remote host closed the connection]
ungeskriptet has joined #linux-sunxi
apritzel has quit [Ping timeout: 480 seconds]
Schimsalabim has quit [Ping timeout: 480 seconds]
Schimsalabim has joined #linux-sunxi
bauen1 has quit [Ping timeout: 480 seconds]
Schimsalabim has quit [Read error: Connection reset by peer]
Schimsalabim has joined #linux-sunxi
evgeny_boger has joined #linux-sunxi
hentai has joined #linux-sunxi
ad__ has quit []
ad__ has joined #linux-sunxi
warpme has quit []
Schimsalabim has quit [Read error: No route to host]
Schimsalabim has joined #linux-sunxi
apritzel has joined #linux-sunxi
bauen1 has joined #linux-sunxi
warpme has joined #linux-sunxi
pmp-p has quit [Ping timeout: 480 seconds]
pmp-p has joined #linux-sunxi
diego71_ has joined #linux-sunxi
diego71 has quit [Ping timeout: 480 seconds]
<loki666> apritzel: some activity for panfrost, I can fix the _init/_deinit sequence... should I sent a V2 with that, or a different patch ?
diego71 has joined #linux-sunxi
<apritzel> loki666: it would be a separate patch anyway. I would just wait for Rob to wake up and potentially comment, to see if we actually need a v2 of this series or not. If yes, it becomes [v2 3/3], if not, it's a new patch on its own
diego71_ has quit [Ping timeout: 480 seconds]
<loki666> Steve already like a V2 to merge the flags
<apritzel> yes, but wait for another day still, at least
warpme has quit []
ungeskriptet has quit [Remote host closed the connection]
warpme has joined #linux-sunxi
warpme has quit [Ping timeout: 480 seconds]
hexdump0815 has quit [Quit: WeeChat 3.8]
hexdump0815 has joined #linux-sunxi
warpme has joined #linux-sunxi
JohnDoe_71Rus has quit [Quit: KVIrc 5.2.6 Quasar http://www.kvirc.net/]
cp- has joined #linux-sunxi
cp-- has quit [Ping timeout: 480 seconds]
JohnDoe_71Rus has joined #linux-sunxi
sdfgsdfs has quit [Remote host closed the connection]
sdfgsdfs has joined #linux-sunxi
hentai has quit [Read error: No route to host]
hentai has joined #linux-sunxi
Schimsalabim has quit [Ping timeout: 480 seconds]
cnxsoft has quit [Ping timeout: 480 seconds]
warpme has quit []
Schimsalabim has joined #linux-sunxi
<gamiee> hi, did anyone made device tree for Banana Pi M4 Berry (Allwinner H618)?
colinsane has joined #linux-sunxi
colinsane has quit []
warpme has joined #linux-sunxi
warpme has quit []
warpme has joined #linux-sunxi
colinsane has joined #linux-sunxi
<apritzel> gamiee: yes, I did, I posted it a while back, but didn't want to have it merged without anyone testing it
<apritzel> gamiee: do you have the board? I think it needs some update (for audio support), but most importantly it needs testing
<gamiee> apritzel : I will have the board soon, so I can do some testing :)
warpme has quit [Ping timeout: 480 seconds]
<gamiee> oh commoooon
<gamiee> why you did this bpi
<gamiee> It seems Banana Pi used FE1.1s , which is ... problematic
<jernej> what's FE1.1?
<gamiee> jernej : USB Hub chip
colinsane has quit [Ping timeout: 480 seconds]
<gamiee> The problem is that FE1.1s have Single Transaction Translator, for all 4 downstream ports, instead having separate TT for every port.
<jakllsch> so they used a lower-end USB hub
<gamiee> yeah, and the worst thing is, that they connected WiFi to that hub, instead going with native port :(
ftg has joined #linux-sunxi
<jakllsch> transaction translators are only really relevant for USB 1.1 speeds though, right?
<gamiee> jakllsch : yeah, it seems to be related only for LS and FS. For some reason, I thought also HS will be impacted, but according to this, it's not. So it should be fine.
<gamiee> Still, connecting WiFi to native USB, and using USB hub port for USB on pin headers would be much better tbh.
warpme has joined #linux-sunxi
warpme has quit [Ping timeout: 480 seconds]
warpme has joined #linux-sunxi
radxanaoki has quit [Quit: radxanaoki]
warpme has quit [Ping timeout: 480 seconds]
warpme has joined #linux-sunxi
ungeskriptet has joined #linux-sunxi
warpme has quit [Ping timeout: 480 seconds]
warpme has joined #linux-sunxi
warpme has quit [Read error: No route to host]
warpme has joined #linux-sunxi
apritzel has quit [Ping timeout: 480 seconds]
warpme has quit [Ping timeout: 480 seconds]
warpme has joined #linux-sunxi
ungeskriptet_ has joined #linux-sunxi
ungeskriptet__ has joined #linux-sunxi
<Lightsword> anyone know why mkimage adds a SBROMSW_KEY section to toc0 images but the allwinner bsp does not for toc0 images?
warpme has quit [Ping timeout: 480 seconds]
ungeskriptet has quit [Ping timeout: 480 seconds]
ungeskriptet has joined #linux-sunxi
ungeskriptet_ has quit [Ping timeout: 480 seconds]
ungeskriptet__ has quit [Ping timeout: 480 seconds]
warpme has joined #linux-sunxi
mripard_ has joined #linux-sunxi
ungeskriptet has quit [Ping timeout: 480 seconds]
mripard has quit [Ping timeout: 480 seconds]
ungeskriptet has joined #linux-sunxi
evgeny_boger has quit [Ping timeout: 480 seconds]
warpme has quit [Ping timeout: 480 seconds]
Schimsalabim has quit [Read error: Connection reset by peer]
Schimsalabim has joined #linux-sunxi
warpme has joined #linux-sunxi
evgeny_boger has joined #linux-sunxi
ungeskriptet_ has joined #linux-sunxi
ungeskriptet has quit [Ping timeout: 480 seconds]
ungeskriptet_ has quit [Ping timeout: 480 seconds]
warpme has quit [Ping timeout: 480 seconds]
ungeskriptet has joined #linux-sunxi
warpme has joined #linux-sunxi
warpme has quit [Ping timeout: 480 seconds]
apritzel has joined #linux-sunxi
<apritzel> Lightsword: smaeul would probably know (as he wrote that code), but IIRC he just implemented what we need for mainline U-Boot
<smaeul> Lightsword: which SoC are you referring to? the key item (TOC0_ITEM_INFO_NAME_KEY, which I believe is what you are referring to) is only used on H6, as far as I know, but it doesn't hurt to put the item there for other chips
<smaeul> mkimage doesn't know what SoC it is generating an image for, so the code is written to generate an image that works on every SoC
<Lightsword> smaeul, it's for h616/h618 boards, TOC0_ITEM_INFO_NAME_KEY isn't used at all for bsp generated toc0's looks like
<smaeul> correct. h616 boot rom (at least, on the die revision I looked at) doesn't use that item
<Lightsword> smaeul, so that TOC0_ITEM_INFO_NAME_KEY key is required for h6?
<smaeul> yes
warpme has joined #linux-sunxi
<smaeul> > If the SBROM is configured to use a key item (this is the default on the H6; it is unavailable on older SoCs), the certificate must include (and be signed by) "KEY1" from the key item. Otherwise, it must include (and be signed by) the ROTPK.
<smaeul> (from https://linux-sunxi.org/TOC0) IIRC it's an efuse flag that determines if a key item is needed
<Lightsword> smaeul, when validating the rotpk on h616 is the boot rom supposed to skip that entry then?
<smaeul> what do you mean by validating the rotpk? the boot ROM does not read that entry, no
<Lightsword> btw does sunxi_secure: secure and sunxi_rotpk: 1 mean the rotpk is being validated on h616 boards or something? https://gist.github.com/jameshilliard/2d7893328510c5c4efb54f495b27f1ba
<smaeul> I can't answer any questions about the BSP software :) just the boot ROM
<smaeul> > IIRC it's an efuse flag that determines if a key item is needed // looks like it's bit 15 in https://linux-sunxi.org/SID_Register_Guide#BROM_CONFIG
JohnDoe_71Rus has quit [Quit: KVIrc 5.2.6 Quasar http://www.kvirc.net/]
evgeny_boger has quit [Ping timeout: 480 seconds]
<Lightsword> smaeul, that sysfs thing is just pulling info from efuses I think
<Lightsword> smaeul, is h6 BROM_CONFIG the same as h616?
<smaeul> probably not, since like I said, there's no code in the boot ROM to read TOC0_ITEM_INFO_NAME_KEY
<Lightsword> smaeul, so if the rotpk validation for h616 is enabled by burning the efuses then mkimage should be able to generate a toc0 that will validate correctly for it as long as the right root key is used?
<smaeul> yes. I never burned a ROTPK, but the signature verification part is tested on H616
<Lightsword> smaeul, hmm, so it might be completely broken if a rotpk is burned?
<smaeul> (the logic is that if the efuse ROTPK hash is all zeroes or all ones, the BROM accepts any TOC0 ROTPK hash, but other than that, the verification is the same)
<smaeul> no, the main thing you'd have to worry about is getting the endianness of the efuse value correct
warpme has quit [Ping timeout: 480 seconds]
<smaeul> even without the ROTPK hash programmed, the signature verification (SHA256+RSA) is still performed, just the public key can be anything
<smaeul> that said, it _might_ be completely broken; I provide no warranties ;-)
<Lightsword> smaeul, and you're sure there's not something that requires a SBROMSW_CERTIF to be the first toc0 item in the event the hash is programmed?
<smaeul> yes, I'm sure. but even if that were the case, it wouldn't brick your board, you'd just have to regenerate the image after patching mkimage
<Lightsword> smaeul, so can someone actually disable rotpk hash validation permenantly by setting any non-1 bits in the efuse?
<smaeul> yes, but the efuse can only be accessed from secure mode, so it's your software's resposibility to prevent that
<Lightsword> smaeul, so if I say have an exploit that gives me root access from Linux I could use that to disable hash validation entirely?
<smaeul> no, you'd have to get code execution in secure mode (e.g. TF-A in EL3)
warpme has joined #linux-sunxi
<Lightsword> smaeul, there isn't some interface Linux can use to ask the TF to burn the fuses?
<smaeul> no, the recommended way to burn the fuses is from FEL or a dedicated boot0/eGON/TOC0 image
<apritzel> though didn't the vendor TF-A have some SMC call to read or write arbitrary values in secure?
<smaeul> that sounds like a security hole :)
<Lightsword> allwinner security holes seem the norm, lol
<apritzel> smaeul: sure, but what's the question? ;-)
<apritzel> I think they needed it to get even read access to the SID from Linux, so they hacked it in
<Lightsword> smaeul, so when mkimage generates a uboot image, what was the reason that it puts SBROMSW_KEY before the SBROMSW_CERTIF as opposed to the other way around?
<smaeul> the order doesn't matter. the BROM searches for the item by ID
<Lightsword> apritzel, yeah pretty sure those sysfs kernel interfaces expose SID access to Linux
<smaeul> but logically the chain of trust is ROTPK -> SBROMSW_KEY -> SBROMSW_CERTIF -> firmware code, so that's the order I chose
<Lightsword> smaeul, but SBROMSW_KEY is only involved in the chain of trust on h6 boards right?
<smaeul> yes (AFAIK, I haven't looked at every SoC, but it's not used on H616 or D1)
<apritzel> ignore that Arm in that context is meant to say "as architected by Arm Ltd." ;-)
warpme has quit [Ping timeout: 480 seconds]
<Lightsword> smaeul, is there an example bsp generated h6 toc0 image somewhere?
<apritzel> the implementation of ARM_SVC_WRITE_SEC_REG is particularly hilarious: there is no check or validation whatsoever ...
<gamiee> smaeul : hi! The rotpk is in form of hash of rsa public key, burned into efuse? Then bootloader during boot gets public rsa key from boot header, calculate hask, compare with efuse, and if valid, it does RSA signature check on the firmware code?
<apritzel> Lightsword: can you dump the SID content from your BSP root shell?
<smaeul> gamiee: yes, effectively
<Lightsword> smaeul, how do I extract the toc0 image from that?
<smaeul> that is the toc0 image?
<smaeul> 00000000: ea00001a 30434f54 484c472e 227835f8 ....TOC0.GLH.5x"
<Lightsword> smaeul, hmm, weird, sunxi-fw isn't detecting it as a toc0 image
warpme has joined #linux-sunxi
<Lightsword> apritzel, some of them I can, some I think I can't
<apritzel> Lightsword: patches welcome ;-)
<gamiee> smaeul: I think I will try to play with it at some point on H616
<apritzel> Lightsword: if you can use some sysfs interface to dump the SID, we could check if the ROTPK hash contains a key or not
<apritzel> and then use the SMC interface to burn the remaining bits to "1", to put the BROM into "ignore mode" again
<apritzel> gamiee has some code here: https://github.com/linux-sunxi/sunxi-tools/pull/206
<apritzel> (that code is for FEL, but contains the algorithm)
<Lightsword> apritzel: I can get the value from here at least, which is "1" https://github.com/YuzukiHD/TinyVision/blob/main/kernel/bsp/drivers/sid/sunxi-sid.c#L551-L562
<apritzel> so that would explain why my test payload didn't boot ;-)
<Lightsword> maybe...but I think there's more going on here
warpme has quit [Ping timeout: 480 seconds]
warpme has joined #linux-sunxi
<smaeul> Lightsword: that sboot.bin may not be signed yet, so that's a bad example... in any case, the BSP tool for generating a TOC0 is here (not recommended reading): https://github.com/Allwinner-Homlet/H6-BSP4.9-brandy/tree/master/pack_tools/toc_tools
<Lightsword> smaeul, looks similar to h616 bsp code
<Lightsword> you don't have any already generated toc0 binaries?
warpme has quit [Ping timeout: 480 seconds]
<smaeul> Lightsword: I have one file generated by dragonsecboot, and it doesn't have SBROMSW_KEY, but I can upload it
<Lightsword> smaeul, yeah that would be helpful, it's generated for h6 platform?
<smaeul> > Jan 19 2021 I don't remember :)
warpme has joined #linux-sunxi
<Lightsword> smaeul, think it's possible the SBROMSW_KEY is entirely unnecessary even for h6?
<smaeul> 14:30 <smaeul> > IIRC it's an efuse flag that determines if a key item is needed // looks like it's bit 15 in https://linux-sunxi.org/SID_Register_Guide#BROM_CONFIG
<Lightsword> smaeul, but why wouldn't the h6 also use SBROMSW_CERTIF like the other boards? that's also signed right?
<smaeul> it uses both
<smaeul> SBROMSW_CERTIF is signed by the public key in SBROMSW_KEY, SBROMSW_KEY is signed by ROTPK
evgeny_boger has joined #linux-sunxi
<smaeul> in a real usage, the two keys shouldn't be the same -- this allows the ROTPK holder to delegate image signing for a subset of devices (those with matching vendor_id efuse) and revoke that privilege
psydroid has joined #linux-sunxi
<Lightsword> smaeul, so I'm comparisng h6 and h616 bsp tools code and they both appear to not need SBROMSW_KEY, the conditional here seems to switch the modes https://github.com/Allwinner-Homlet/H6-BSP4.9-brandy/blob/master/pack_tools/toc_tools/main/dragonsecboot.c#L207 if true it calls https://github.com/Allwinner-Homlet/H6-BSP4.9-brandy/blob/master/pack_tools/toc_tools/main/dragonsecboot.c#L224 which does use SBROMSW_CERTIF
<Lightsword> however the fallback same as h616 does not appear to use SBROMSW_KEY https://github.com/Allwinner-Homlet/H6-BSP4.9-brandy/blob/master/pack_tools/toc_tools/main/dragonsecboot.c#L246
warpme has quit [Ping timeout: 480 seconds]
<Lightsword> which does use SBROMSW_KEY*
<Lightsword> smaeul, so from what I can tell in theory h6 should work fine without SBROMSW_KEY and the ladder stuff isn't needed unless there's an actual need for that feature
<smaeul> 15:44 <smaeul> 14:30 <smaeul> > IIRC it's an efuse flag that determines if a key item is needed // looks like it's bit 15 in https://linux-sunxi.org/SID_Register_Guide#BROM_CONFIG
<smaeul> yes, H6 works without the SBROMSW_KEY iff you set the efuse bit
<smaeul> you're more than welcome to patch mkimage and try it out
warpme has joined #linux-sunxi
smaeul_ has joined #linux-sunxi
smaeul has quit [Read error: No route to host]
warpme has quit [Ping timeout: 480 seconds]
evgeny_boger has quit [Ping timeout: 480 seconds]
warpme has joined #linux-sunxi
warpme has quit [Ping timeout: 480 seconds]
szemzoa_ has joined #linux-sunxi
szemzoa has quit [Read error: Connection reset by peer]
sh1 has quit [Ping timeout: 480 seconds]
sh1 has joined #linux-sunxi
warpme has joined #linux-sunxi
warpme has quit [Ping timeout: 480 seconds]
warpme has joined #linux-sunxi
omar_mah has joined #linux-sunxi
warpme has quit [Ping timeout: 480 seconds]
warpme has joined #linux-sunxi
hentai has quit [Remote host closed the connection]
hentai has joined #linux-sunxi
omar_mah has quit [Remote host closed the connection]
warpme has quit [Ping timeout: 480 seconds]
warpme has joined #linux-sunxi
warpme has quit [Ping timeout: 480 seconds]
warpme has joined #linux-sunxi
hentai has quit [Ping timeout: 480 seconds]
hentai has joined #linux-sunxi
ftg has quit [Read error: Connection reset by peer]
warpme has quit [Ping timeout: 480 seconds]
warpme has joined #linux-sunxi