<f_>
USB mode in SPL...saw that SPL seems to have support for DFU mode?
<f_>
common/spl/spl_ram.c
rockosov has quit [Ping timeout: 255 seconds]
<f_>
At least have something standard for USB mode :P
<f_>
Some undocumented registers...
<f_>
e.g. DMC_DRAM_TAL
<f_>
so let's <del>guess the address</del> grep for ddrt.cfg_ddr_al (supposed to be written to that register) in ghidra
<f_>
_DAT_c8839140 = (uint)ddrt_p->cfg_ddr_al;
<f_>
^ there's our address.
<narmstrong>
f_: can you chainload stuff with DFU? not sure about that
<f_>
¯\_(ツ)_/¯
<f_>
I still have to do some more research on what would be the best way to support USB mode
<narmstrong>
if dfu can, let's keep dfu then
<f_>
I have no idea about if it can do that
<narmstrong>
so it seems DFU runs which permits you to write in RAM (run_dfu()) then spl will try to load from this RAM location (spl_ram_load_image()) like if was preloaded in RAM before SPL
<narmstrong>
smart
<f_>
Yeah that's what I thought by quickly looking at the code.
<f_>
So we could write a tiny tool that sends SPL and then just do DFU
<narmstrong>
yep
<narmstrong>
SPL would init ddr then run dfu for the rest
<f_>
<del>steal</del> borrow some code from pyamlboot/aml_boot
<narmstrong>
pyamlboot would only be needed to load SPL in BL1
<f_>
Indeed
<f_>
That's why we need only ~10% of pyamlboot
<narmstrong>
!%
<narmstrong>
1%
<f_>
1%?!
<narmstrong>
`dfu_alt_info_ram=uboot.bin ram 0x8000000 0x1000000` do DFU would export "ram" to write in it
<f_>
sending to BL1 is only 1%???
<f_>
so 99% of pyamlboot is used to handle BL2 USB mode?
<narmstrong>
compared to the G12A boot sequence, yeah it's ultra basic
<narmstrong>
dev.writeLargeMemory() then dev.run() and you're done
<f_>
as for the binary to send..instead of using u-boot-gx[bb,l]-with-spl.bin you can just use spl/u-boot-signed.bin
<f_>
narmstrong: ah so write to memory and run lol
<f_>
BL2 is where the fun ends then :P
<narmstrong>
yes
<f_>
Sounds good.
<f_>
I can try writing a tool that does that
<f_>
translate worldcup in french and slap the translation to your tool, you're done
<f_>
Should work fine on gxl as U-Boot can switch USB to device mode
<f_>
not sure about gxbb though.
<narmstrong>
GXBB has a dual mode dwc2
<narmstrong>
so it can
<f_>
I know, but is that supported in U-Boot?
<f_>
That's what I meant by 'not sure'.
<narmstrong>
so dfu-util has a --detach option which exits run_usb_dnl_gadget cleanly and continues boot, smart move DFU dudes
<f_>
so what shall we do?
<narmstrong>
nohingm everything is already done
<narmstrong>
got GXBB, it may already work since we declare a dual role dwc2 in DT
<f_>
I mean..should we teach people how to use 2 different tools to do DFU?
<f_>
1 to send SPL and the second to send commands to SPL?
<narmstrong>
no script should do the load with pyamlboot then continue with DFU if it detects DFU instead of the BL2
<f_>
Cut down pyamlboot or actually use it as a library :P
<narmstrong>
yeah whatever
<f_>
Still have to make it work on gxbb :P
<narmstrong>
so it seems nobody tried to enable USB gadget on GXBB
buzzmarshall has joined #linux-amlogic
<f_>
I mean sending stuff with pyamlboot
<narmstrong>
yeah also
<narmstrong>
could probably work as-is, no idea
<f_>
Tested an amlogic-usbdl fork a long time ago and it works fine on gxbb
<f_>
(of course)
<f_>
whatever, just load SPL from USB and mess with DFU
<f_>
That's all we need to do.
<narmstrong>
yep
f_[xmpp] has quit [Ping timeout: 255 seconds]
<f_>
one Amlogic-specific tool to send SPL, and just use one of the many DFU utils available
<f_>
They said they were going to restrict stuff if I don't enable 2FA.
<f_>
narmstrong: snagboot is looks nice though
<f_>
*snagboot looks nice though
<f_>
Am looking at the code
<narmstrong>
there was an embedded recipe talk after mine about it
<f_>
Oh nice
mripard has quit [Quit: mripard]
<mkorpershoek>
+1 for using snagboot. it's a great project and would benefit from more SoC support
<f_>
mkorpershoek: Let's use it then!
<f_>
After messing with gxl SPL support.
<f_>
7win 14
<lvrp16>
mkorpershoek: wow didn't know about it at all
<f_>
lvrp16: Didn't know about it either until narmstrong brought it up.
<f_>
+1 for using it as well.
<f_>
Not sure how it'll work on g12+
<f_>
narmstrong: I guess you do the same thing mostly?
* f_
clones aml_boot
<narmstrong>
it's the same goal yes
<f_>
Just load a binary and run it?
<narmstrong>
snagboot does either recovery, what I do, or factory program, which isn't doable on G12s, but doable on GXL since we can load other binaries in addition to u-boot
<f_>
IIRC snagflash just interacts with U-Boot
<f_>
>snagflash communicates with U-Boot to flash system images to non-volatile memories, using either DFU, UMS or Fastboot.
<f_>
^ README.md
<narmstrong>
hmm ok then not sure we enable any of those on all amlogic platforms
<f_>
UMS is enabled.
<f_>
(at least on libretech-cc defconfig)
<narmstrong>
My plabe was to add support for amlogic, but I failed...
<f_>
narmstrong: in snagboot?
<narmstrong>
yeah
<f_>
Where?
<f_>
what failed?
<mkorpershoek>
I personally use mostly `snagrecover`. Once I get an U-Boot shell I prefer to use my manual flashing scripts i'm more used to