<narmstrong>
f_: looks good, anyway there's no magic in ddr init anyway
<f_>
Thanks!
<f_>
I'm trying to make it compile.
<f_>
And got this error:
<f_>
drivers/amlogic/ddr/timing.c:350:65: error: result of '1 << 31' requires 33 bits to represent, but 'int' only has 32 bits [-Werror=shift-overflow=]
<f_>
¯\_(ツ)_/¯
<f_>
Amlogic RAM "juju" then
camus has quit [Ping timeout: 246 seconds]
camus has joined #linux-amlogic
<f_>
AARGH
<f_>
drivers/amlogic/ddr/pll.c:91:42: error: result of '1 << 31' requires 33 bits to represent, but 'int' only has 32 bits [-Werror=shift-overflow=]
<f_>
Don't tell me they wrote the exact same undefined behaviour everywhere else!!!
<f_>
narmstrong: I'm doing all this because when trying to load an image there's an assertion error where fip_dev_handle is NULL. I highly suspect that's because of missing RAM init.
<f_>
fip_dev_handle is a uintptr_t.
<narmstrong>
I’m pretty sure they build with warning disabled like every vendor code out there :-p
<f_>
Me too :P
<f_>
There's a lot of missing #includes.
<f_>
Like: They use stuff in a C file that's defined in a header file they don't even #include.
<f_>
Also
<f_>
I've never seen #include used for including......C files.
<f_>
Also..TF-A is built with -Werr
<f_>
I can really tell Amlogic *loooooves* undefined behaviour.
<f_>
drivers/amlogic/ddr/ddr.h:23:14: error: redundant redeclaration of 'ddr_init' [-Werror=redundant-decls]
<f_>
Lots of redundant declarations, too.
<f_>
Oh well. They forgot:
<f_>
#ifndef DDR_H
<f_>
#define DDR_H
<f_>
#endif /* DDR_H */
<f_>
FINALLY......LINKING ERRORS!
<f_>
Built /home/thelinuxmacbook/Desktop/gitcodestolenfromothers/u-boot-aml/arm-trusted-firmware/build/gxbb/debug/bl2.bin successfully
<f_>
Got it to compile!
camus has quit [Remote host closed the connection]
camus has joined #linux-amlogic
JohnnyonFlame has quit [Ping timeout: 240 seconds]
elastic_dog has quit [Ping timeout: 240 seconds]
elastic_dog has joined #linux-amlogic
<f_>
So
<f_>
It compiles, but when running, it seems to be stuck at ddr_init_pctl.
<f_>
This is from a dump of the eMMC on my set-top box before I wiped it.
<f_>
Doesn't look like it's encrypted.
<f_>
And fun fact: I can see where acs.bin got inserted as well.
<f_>
And I can see that it's different from the WeTek Play2's ACS.
<f_>
(which works fine. meh)
<f_>
narmstrong: But, even when RAM init """succeeds""", I still get that assertion error:
<f_>
ASSERT: drivers/io/io_storage.c:174
<f_>
Looking at io_storage.c, I see this:
<f_>
int io_dev_init(uintptr_t dev_handle, const uintptr_t init_params)
<f_>
<...>
<f_>
assert(dev_handle != (uintptr_t)NULL);
<f_>
So yeah, fip_dev_handle is still NULL.
* narmstrong
hates rolling releases distro like Arch, I didn't boot on my Asahi install for 3months, now I need to update 900packages and download 2GiBs... anyway it's always surprising how asahi on my MacBook Air M2 works well
<narmstrong>
and I hate KDE, I always hated KDE for the last 20years
<f_>
I love Arch/Artix.
<narmstrong>
I'm too old for this :-p
<narmstrong>
for me Arch is Gentoo with pre-builds, in the old days we didn't have prebuilds and had to rebuild everything
<f_>
Anyways, a little off-topic here :P
<narmstrong>
yep, sorry for that^^
<f_>
No problem. It happens =)
<f_>
Even with channel operators.
<narmstrong>
f_: who's supposed to init dev_handle for io_dev_init ?
* f_
looks that up.
<f_>
plat_get_image_source()
vagrantc has joined #linux-amlogic
<f_>
Let's stick in a INFO() at the top.
<f_>
>INFO("hello plat_get_image_source\n")
<f_>
Perfect.
<f_>
At some point my logging style will be as bad as Amlogic's
<narmstrong>
at least at some point you'll clean it up
<f_>
Yup.
<f_>
I always do that sort of stuff with my software.
<f_>
Did it break? Just stick in a thousand printf()s! :P
<narmstrong>
we all do
<f_>
Glad I'm not the only person doing that. :P
<narmstrong>
I always do, to lazy to get a debugger running if a set a print does the work
<f_>
Nowadays, I more often use gdb..but TF-A doesn't have gdb..so...
<f_>
Damn, forgot a `;`.
<f_>
UART says INFO: hello plat_get_image_source
<f_>
So it IS being ran before the assertion error.
<f_>
In fact, it's JUST before the assertion error.
<f_>
Digging further.
<f_>
>INFO("hello io_open o/ how are you doing today?\n");