luka177 has quit [Read error: Connection reset by peer]
luka177 has joined #linux-amlogic
f_ has joined #linux-amlogic
f11f12 has joined #linux-amlogic
<f_>
So. We don't have any databooks from Synopsys
<f_>
Let's look at other vendors for a sec...narmstrong: you told me that plenty of vendors use Synopsys DDR..maybe there's a chance of finding one that has libre RAM init?
<narmstrong>
Not sure about that, but you can try!
<f_>
Maybe they documented parts of their databook?
* f_
is still surprised about the fact that so many people are interested in reversing BL2.
<f_>
Now that I think about it, Amlogic did document some of their DDR code..
* f_
looks at code.
<f_>
Wait......they write the content of some struct members to registers!
<f_>
Of course! Makes sense now!
<f_>
This fact, combined with the reverse-engineering of newer BL2 versions, should give us all we need to write understandable code that could be included upstream!!
<f_>
We may not need the Synopsys DDR databook after all!
<narmstrong>
yeah no it's basically a dump of thousand of registers values that were generated by s synopsys TCL/TK tool running in an old CentOS8 VM based on the IP configuration set by the Synopsys engineer support team
<narmstrong>
true story
<f_>
I trust you :D
<f_>
But why did they even want to do this then?
<f_>
Did they really expect that anyone is going to modify those?
<f_>
narmstrong: But what you're telling me is that I'd need the data book after all, right?
<narmstrong>
f_: no, because you won't need to understand/change those values
<f_>
I could theoretically just write ddr init and get away with that, tbh
<narmstrong>
f_: basically until they do the physical tapeout they do not know how the IP behaves exactly, so first thing to do is pas some code to determines some physical values, pass them into the tool and you have optimized values for the soc
<f_>
But then it's not funny anymore!
<narmstrong>
yeah there's plenty of unfunny stuff in SoC design :-p
<f_>
I considered trying to write DDR init but then I wouldn't know what I'm doing :P
<f_>
Which is why I wanted to have documentation for the registers :P
<f_>
But I guess Amlogic doesn't even know how their stuff works then.
luka177 has quit [Ping timeout: 258 seconds]
<f_>
So ¯\_(ツ)_/¯ it's gonna be fine
<narmstrong>
nop neither most of the synopsys people either lol
* f_
"laughs".
<f_>
So the Synopsys people don't even know what they're doing lol
<f_>
But yeah that also means most of the struct members are completly unnecessary and will be exactly the same everywhere
<narmstrong>
Synopsys is an huge company, and the knowledge is spread over the people
<narmstrong>
probably yes
<f_>
so I can just hardcode these values and get away with that
<f_>
and have the board-specific values somewhere in a device tree.
<f_>
No idea if I'm going to get sued for this lol :D
<f_>
(hope not)
<narmstrong>
move to france if you gwet problems lol
<f_>
Sure but I should be fiiiiiiiine!
<f_>
The license doesn't say anything about disassembly of their binaries lol
<f_>
and it doesn't say anything about reverse-engineering either, so I'm fairly confident it's allowed
<narmstrong>
ok then! (I'm not a lawyer, so...)
<f_>
me either
<f_>
But still, fairly confident.
<f_>
If I was reverse-engineering iwlwifi then I'll be in trouble though
<f_>
(license says that reverse-engineering is forbidden)
<f_>
But Amlogic's license doesn't say anything about that, and I assume I have the right to use their binaries, so I should have the right to disassemble and post reverse-engineering notes.
<f_>
well, at least I don't think repk_ has had any problem with that.
<f_>
(IIRC gxlimg repo contains a disassembly of BL2)
<narmstrong>
indeed, I did the G12A reverse but only by looking at the generated files
<f_>
yeah
<f_>
Let's get to work then!
<f_>
I'll try writing good code, i.e. code that be included in Arm Trusted Firmware-A.