Mangy_Dog has quit [Remote host closed the connection]
victhor has quit [Ping timeout: 265 seconds]
Danct12 has quit [Remote host closed the connection]
shailangsa has quit [Ping timeout: 260 seconds]
JohnDoe_71Rus has joined #linux-sunxi
Danct12 has joined #linux-sunxi
shailangsa has joined #linux-sunxi
chewitt has quit [Quit: Zzz..]
chewitt has joined #linux-sunxi
vagrantc has quit [Ping timeout: 245 seconds]
upupbb-user2 has joined #linux-sunxi
upupbb-user2 has left #linux-sunxi [#linux-sunxi]
pnill has joined #linux-sunxi
chewitt_ has joined #linux-sunxi
pnill has left #linux-sunxi [#linux-sunxi]
chewitt has quit [Ping timeout: 252 seconds]
pnill has joined #linux-sunxi
<pnill>
Joined in here because I'm trying to compile u-boot mainline for a board using an Allwinner H6 SoC and it's bailing out after "DRAM: 1024 MiB" with "Trying to boot from FEL"... I suspect it's related to the PMIC, the boot0 setup the board used by default was using "dummy axp" but I'm not sure how to set that up in u-boot any ideas?
<pnill>
I was able to use an Orange Pi 3 build environment and modify parameters there to get a working boot1 and stuff, just can't get a working u-boot going.
Danct12 has quit [Remote host closed the connection]
Danct12 has joined #linux-sunxi
buzzmarshall has quit [Remote host closed the connection]
<pnill>
So doing research I guess the output implies that either it wasn't able to copy u-boot into DRAM or it wasn't able to jump to it
<pnill>
Even knowing that though, I'm not sure what to do/how to troubleshoot from there.
<pnill>
or what could even be wrong
<pnill>
As I've got the DRAM speeds setup properly, I know the PMIC probably isn't right and it does do something with that as far as I can tell, so I have to assume that's it.
<pnill>
clock_set_pll1(CONFIG_SYS_CLK_FREQ);
<pnill>
looks like this gets called directly after "DRAM:" is printed.
apritzel has joined #linux-sunxi
doppo has quit [Ping timeout: 245 seconds]
doppo has joined #linux-sunxi
vagrantc has joined #linux-sunxi
gsz has joined #linux-sunxi
ganbold has quit [Quit: Leaving]
ganbold has joined #linux-sunxi
shailangsa has quit [Ping timeout: 260 seconds]
vagrantc has quit [Quit: leaving]
MartijnBraam has quit [Ping timeout: 245 seconds]
fevv8[m] has quit [Ping timeout: 245 seconds]
MartijnBraam has joined #linux-sunxi
fevv8[m] has joined #linux-sunxi
suprothunderbolt has quit [Ping timeout: 240 seconds]
shailangsa has joined #linux-sunxi
cmeerw has joined #linux-sunxi
<pnill>
Ok, so using standard 'spl' command it did init ram as I was able to use write to place my u-boot there
<pnill>
but upon trying to run exe and specifying the address, nada.. no output
<pnill>
Tried writing my custom compiled u-boot.bin to emmc as well via FEL and booting from the device's normal boot0
<pnill>
it just hangs after it goes through the sunxi/allwinner monitor process
<pnill>
So, I guess it's something with my u-boot image that gets compiled because not even the banner shows
<pnill>
Something odd, the original u-boot from the device is actually compiled as 32bit... and the one I'm compiling is 64bit.
<pnill>
I'm wondering if there's something up there.
<apritzel>
pnill: the 64-bit mainline boot flow is quite different from the BSP one
<apritzel>
if you have the latest sunxi-fel version (compiled from git), you can just use "sunxi-fel u-boot u-boot-sunxi-with-spl.bin" to get you going
dev1990 has joined #linux-sunxi
<apritzel>
pnill: and you can't use the BSP DTB, this is not compatible with mainline code (both U-Boot and kernel)
<apritzel>
pnill: ah, just reading over the logs: You are missing Trusted Firmware: "loading image "ARM Trusted Firmware" (0 bytes) to 0x104000"
<apritzel>
pnill: did you look at board/sunxi/README.sunxi64 in the U-Boot tree? That should contain the instructions for getting everything compiled
<apritzel>
pnill: the easiest is to build U-Boot like this: make BL31=/path/to/tf-a/build/sun50i-a64/debug/bl31.bin SCP=/dev/null
<apritzel>
pnill: from what I can see there your DRAM is fine (which is very good news!), and I wouldn't worry so much about the PMIC at this point
choozy has joined #linux-sunxi
netlynx has joined #linux-sunxi
netlynx has joined #linux-sunxi
jstein has joined #linux-sunxi
Mangy_Dog has joined #linux-sunxi
apritzel has quit [Ping timeout: 246 seconds]
victhor has joined #linux-sunxi
victhor has quit [Quit: Leaving]
victhor has joined #linux-sunxi
lerc has quit [Read error: Connection reset by peer]
lerc has joined #linux-sunxi
specing_ has joined #linux-sunxi
apritzel has joined #linux-sunxi
specing has quit [Ping timeout: 265 seconds]
specing_ is now known as specing
jelly has quit [Quit: ""]
jelly-home has joined #linux-sunxi
jelly-home is now known as jelly
buzzmarshall has joined #linux-sunxi
JoaoSchim has joined #linux-sunxi
\\Mr_C\\ has quit [Quit: Ping timeout: 999,999,999 years]
\\Mr_C\\ has joined #linux-sunxi
apritzel has quit [Ping timeout: 240 seconds]
victhor has quit [Remote host closed the connection]
warpme_ has joined #linux-sunxi
rzerres has quit [Ping timeout: 250 seconds]
rzerres has joined #linux-sunxi
danqo has quit [Ping timeout: 245 seconds]
danqo has joined #linux-sunxi
thefloweringash has quit [Ping timeout: 245 seconds]
rzerres has quit [Ping timeout: 245 seconds]
thefloweringash has joined #linux-sunxi
gaston1980 has quit [Quit: Konversation terminated!]
lkcl has quit [Ping timeout: 240 seconds]
tuxd3v has joined #linux-sunxi
<tuxd3v>
hello guys, I have a bananapi m2 zero, it has a h2+ Soc..
<tuxd3v>
I know that it doesn't have TRNG, but I believe it should have PRNG, right?
<tuxd3v>
sun8i-ce should provide it?
<tuxd3v>
however my rng-tools package is compalaining:
<tuxd3v>
[FAIL] startpar: service(s) returned failure: rng-tools ... failed!
lkcl has joined #linux-sunxi
apritzel has joined #linux-sunxi
<apritzel>
tuxd3v: what do you expect from a hardware PRNG? Not sure that's really useful, especially when compared to the Linux PRNG.
rzerres has joined #linux-sunxi
<montjoie>
tuxd3v: sun8i-ce provides a prng yes, (trng is present but only working on h6)
<montjoie>
and I am not sure that rng-tools use the crypto_rng, ( for be honest I know no tool using it)
<tuxd3v>
I believe with H6 it uses, but I am not sure
<pnill>
apritzel: Thanks a ton, so... I originally had tried sunxi-fel u-boot u-boot-sunxi-with-spl.bin using the mainline .bin I'd compiled but this is where it would init DRAM and hang... so next I tried writing it to ram and exe 0x4A0000XXXX but I understand why this didn't work because opening the 64bit u-boot bin in IDA it's a totally different format and the reset vector isn't the first instruction there.. so obliviously exe 0x4A000 would've just hit the
<pnill>
ELF header.
<pnill>
Should I be compiling BSP instead of mainline? The only issue I had with BSP was lack of DDR3 support that mainline seemed to have now, Am I going to have problems booting mainline when the board originally used BSP? My goal is to use U-Boot to modify the root file system to change some stuff as part of a 'hack' not really install it permanently
<pnill>
I saw the trusted firmware page but hadn't read it yet, and noticed it wasn't there but the board also (based on boot log and stock u-boot variables) appeared to have all 'secure boot' stuff and such turned off so I didn't think trusted firmware would've been important... I do have the stock BL/monitor.bin that I also dumped from the board in a sunxi-package
<pnill>
or not sure what they mean by this, "FEL capable SPL binaries, built using an off-tree branch to generate 32-bit ARM code"
<pnill>
Kind of confused, as the 64bit SPL I loaded *did work* and DRAM was initialized as I was able to use sunxi-fel to write to the address space.
<pnill>
Oh cool, when it said "Trying to boot from FEL" I didn't realize that didn't mean it was jumping back into FEL mode but was actually attempting to boot off of FEL
<pnill>
So looks like with a ARM trusted firmware, compiled against aarch64 I was able to get a bit further
<smaeul>
pnill: previously using BSP will not cause problems for mainline. though you can't mix and match pieces. either you need boot0 + BSP ATF + BSP U-Boot + BSP Linux or you need mainline ATF + mainline U-Boot + mainline Linux
<smaeul>
you always need ATF. it provides the SMP and power-off/reboot implementation, and as you saw, early regulator setup
<pnill>
smaeul: I'm using mainline ATF, I compiled, mainline U-Boot I compiled
<pnill>
the output at 13:27:10 was mainline ATF, with PMIC init disabled because that was locking things up and the PMIC is "dummy" according to some other stuff.
<pnill>
yeah, but U-boot never came up
<pnill>
and I'm not sure why
<pnill>
That was mainline u-boot compiled with "make -j5 CROSS_COMPILE=aarch64-linux-gnu- BL31=/home/crich/arm-trusted-firmware/build/sun50i_h6/debug/bl31.bin" then using the produced -spl.bin
<smaeul>
btw you are correct that the docs are out of date wrt FEL. it no longer needs a special SPL -- that's why apritzel had you use master
<smaeul>
...branch of sunxi-tools
<pnill>
yeah, I'm on master branch of sunxi-tools as well
<pnill>
I just don't understand why there's a lockup when it tries to get to u-boot
<pnill>
and not sure how to go about trying to troubleshoot that
JohnDoe_71Rus has quit [Quit: KVIrc KVIrc Aria 5.0.1, revision: 5.0.1+git-7433-0df9f22f2, build type: debug, sources date: 20160102, built on: 2019-12-08 19:19:20 UTC 5.0.1+git-7433-0df9f22f2 http://www.kvirc.net/]
<pnill>
oh nvm
<pnill>
Idk what I did
<pnill>
but I got it :D
<smaeul>
pnill: if it works intermittently, likely it is due to marginal dram configuration
<smaeul>
ATF runs from SRAM only, so the jump from ATF to U-Boot is also the jump from SRAM to DRAM
<pnill>
I think it was my dtb/dts, I cleaned the environment reversed that
<pnill>
then re-built
<pnill>
and it worked.
<pnill>
after applying my DRAM changes and such as well on top of those setps
<pnill>
*steps
<pnill>
and enabling TWI0
<smaeul>
congrats on getting it working :) is this a custom board? or something generally available?
<pnill>
it's not a off the shelf board like an orange pi or etc.
<pnill>
I was able to get it to run duckhunt prior to this, but required soldering a header on for UART and stuff.. trying to achieve similar just over FEL.
<pnill>
This whole thing has been a major learning experience though,before touching that I didn't know what FEL/allwinner were
<pnill>
read a lot of CPU docs, had help from a friend who got me started with dumping the boot rom and reverse engineering that.
<smaeul>
sure, it still seems like a board that others could run in to. so it would be great if you could add a wiki page for it
<pnill>
So, the board itself is in 3 of their cabinets and custom made for them
<pnill>
but I absolutely planned on documenting my findings
<pnill>
they have variations of their boards in different cabinets some run other allwinner chipsets
<smaeul>
thanks, that sounds interesting
<pnill>
Yeah, it's a fun learning experience and linux-sunxi helped alot.
<pnill>
Originally when trying to SPL boot over FEL I was actually writing custom payloads and using my own tools to communicate with it
<pnill>
but the USB stack was getting smashed writing my payload to SRAM
<pnill>
so I was getting screwed
<pnill>
and wasn't having luck relocating it
<pnill>
so without the sunxi-fel spl support I certainly would've still been struggling there I'm sure.
<smaeul>
yeah, you may have noticed the `sram_swap_buffers` in sunxi-tools
<pnill>
yup
apritzel has joined #linux-sunxi
cmeerw has quit [Ping timeout: 245 seconds]
<pnill>
apritzel: Have to give you a thank you for pointing out the BL31 and such
<pnill>
Got u-boot running over FEL finally
<apritzel>
pnill: yeah, just read the logs, glad that it worked for you
apritzel has quit [*.net *.split]
pnill has quit [*.net *.split]
aballier_ has quit [*.net *.split]
macc24 has quit [*.net *.split]
cnxsoft1 has quit [*.net *.split]
qschulz has quit [*.net *.split]
Irenes has quit [*.net *.split]
fl_0 has quit [*.net *.split]
willmore has quit [*.net *.split]
mnemoc has quit [*.net *.split]
Danct12 has quit [*.net *.split]
lucas_ has quit [*.net *.split]
bauen1 has quit [*.net *.split]
marble_visions has quit [*.net *.split]
Perlovka has quit [*.net *.split]
slapin has quit [*.net *.split]
maciejjo has quit [*.net *.split]
wb9688 has quit [*.net *.split]
gaston1980 has quit [*.net *.split]
\\Mr_C\\ has quit [*.net *.split]
luke-jr has quit [*.net *.split]
tbueno_ has quit [*.net *.split]
freemangordon has quit [*.net *.split]
fest has quit [*.net *.split]
mirko has quit [*.net *.split]
abelvesa has quit [*.net *.split]
jo0nas has quit [*.net *.split]
rellla has quit [*.net *.split]
agraf has quit [*.net *.split]
NiteHawk has quit [*.net *.split]
Esmil has quit [*.net *.split]
samueldr has quit [*.net *.split]
fourkbomb has quit [*.net *.split]
Peetz0r has quit [*.net *.split]
kevans91 has quit [*.net *.split]
charco has quit [*.net *.split]
thefloweringash has quit [*.net *.split]
danqo has quit [*.net *.split]
MartijnBraam has quit [*.net *.split]
solderfumes[m] has quit [*.net *.split]
hanetzer has quit [*.net *.split]
KotCzarny has quit [*.net *.split]
plaes has quit [*.net *.split]
[TheBug] has quit [*.net *.split]
warpme_ has quit [*.net *.split]
jbrown has quit [*.net *.split]
_0x5eb_ has quit [*.net *.split]
aliosa27_ has quit [*.net *.split]
Harrier has quit [*.net *.split]
ric96 has quit [*.net *.split]
pdp7 has quit [*.net *.split]
Benjojo has quit [*.net *.split]
jeandet has quit [*.net *.split]
ccaione has quit [*.net *.split]
liushuyu has quit [*.net *.split]
matteosilex has quit [*.net *.split]
ullbeking has quit [*.net *.split]
wens has quit [*.net *.split]
mripard has quit [*.net *.split]
jelly has quit [*.net *.split]
specing has quit [*.net *.split]
chewitt_ has quit [*.net *.split]
xes_ has quit [*.net *.split]
pgreco has quit [*.net *.split]
e1z0 has quit [*.net *.split]
wigyori has quit [*.net *.split]
longsleep has quit [*.net *.split]
Mangy_Dog has quit [*.net *.split]
shailangsa has quit [*.net *.split]
uis has quit [*.net *.split]
indy has quit [*.net *.split]
tuxd3v has quit [*.net *.split]
ldevulder has quit [*.net *.split]
Ashleee has quit [*.net *.split]
Kwiboo has quit [*.net *.split]
montjoie has quit [*.net *.split]
pg12 has quit [*.net *.split]
sunilmohan has quit [*.net *.split]
fevv8[m] has quit [*.net *.split]
jernej has quit [*.net *.split]
psydruid[m] has quit [*.net *.split]
Laa[m] has quit [*.net *.split]
clementp[m] has quit [*.net *.split]
z3ntu has quit [*.net *.split]
davidebeatrici has quit [*.net *.split]
vbmithr_ has quit [*.net *.split]
JoaoSchim has quit [*.net *.split]
lkcl has quit [*.net *.split]
buzzmarshall has quit [*.net *.split]
matthewcroughan has quit [*.net *.split]
tmlind has quit [*.net *.split]
paulk-leonov has quit [*.net *.split]
bill-auger has quit [*.net *.split]
maz has quit [*.net *.split]
dlan has quit [*.net *.split]
alexxy has quit [*.net *.split]
Wizzup has quit [*.net *.split]
gendevbot has quit [*.net *.split]
janhenrik has quit [*.net *.split]
jonkerj has quit [*.net *.split]
JuniorJPDJ has quit [*.net *.split]
leio has quit [*.net *.split]
embed-3d has quit [*.net *.split]
smaeul has quit [*.net *.split]
kelvan_ has quit [*.net *.split]
mru has quit [*.net *.split]
DrFrankensteinUK has quit [*.net *.split]
kveremitz has quit [*.net *.split]
vpeter has quit [*.net *.split]
aib42 has quit [*.net *.split]
rtp has quit [*.net *.split]
buZz has quit [*.net *.split]
bshah has quit [*.net *.split]
ndufresne has quit [*.net *.split]
zumbi has quit [*.net *.split]
techn has quit [*.net *.split]
egbert has quit [*.net *.split]
marvs has quit [*.net *.split]
xzz53__ has quit [*.net *.split]
igraltist has quit [*.net *.split]
ChanServ has quit [*.net *.split]
pnill has joined #linux-sunxi
montjoie has joined #linux-sunxi
Ashleee has joined #linux-sunxi
ldevulder has joined #linux-sunxi
uis has joined #linux-sunxi
Mangy_Dog has joined #linux-sunxi
tuxd3v has joined #linux-sunxi
apritzel has joined #linux-sunxi
gaston1980 has joined #linux-sunxi
\\Mr_C\\ has joined #linux-sunxi
qschulz has joined #linux-sunxi
luke-jr has joined #linux-sunxi
marble_visions has joined #linux-sunxi
jo0nas has joined #linux-sunxi
Perlovka has joined #linux-sunxi
freemangordon has joined #linux-sunxi
wb9688 has joined #linux-sunxi
maciejjo has joined #linux-sunxi
slapin has joined #linux-sunxi
NiteHawk has joined #linux-sunxi
agraf has joined #linux-sunxi
Esmil has joined #linux-sunxi
samueldr has joined #linux-sunxi
rellla has joined #linux-sunxi
Kwiboo has joined #linux-sunxi
bauen1 has joined #linux-sunxi
lucas_ has joined #linux-sunxi
aballier_ has joined #linux-sunxi
cnxsoft1 has joined #linux-sunxi
macc24 has joined #linux-sunxi
Danct12 has joined #linux-sunxi
Irenes has joined #linux-sunxi
mnemoc has joined #linux-sunxi
mirko has joined #linux-sunxi
fl_0 has joined #linux-sunxi
abelvesa has joined #linux-sunxi
willmore has joined #linux-sunxi
fest has joined #linux-sunxi
sunilmohan has joined #linux-sunxi
tbueno_ has joined #linux-sunxi
pg12 has joined #linux-sunxi
<apritzel>
pnill: I was wondering where documentation should be improved. What did you find that led you to use sunxi-fel?
fevv8[m] has joined #linux-sunxi
jernej has joined #linux-sunxi
vbmithr_ has joined #linux-sunxi
z3ntu has joined #linux-sunxi
davidebeatrici has joined #linux-sunxi
clementp[m] has joined #linux-sunxi
Laa[m] has joined #linux-sunxi
\\Mr_C\\ has quit [Max SendQ exceeded]
buZz has joined #linux-sunxi
marvs has joined #linux-sunxi
zumbi has joined #linux-sunxi
egbert has joined #linux-sunxi
aib42 has joined #linux-sunxi
DrFrankensteinUK has joined #linux-sunxi
kveremitz has joined #linux-sunxi
vpeter has joined #linux-sunxi
rtp has joined #linux-sunxi
bshah has joined #linux-sunxi
ndufresne has joined #linux-sunxi
techn has joined #linux-sunxi
xzz53__ has joined #linux-sunxi
igraltist has joined #linux-sunxi
embed-3d has joined #linux-sunxi
JuniorJPDJ has joined #linux-sunxi
smaeul has joined #linux-sunxi
leio has joined #linux-sunxi
kelvan_ has joined #linux-sunxi
mru has joined #linux-sunxi
lkcl has joined #linux-sunxi
JoaoSchim has joined #linux-sunxi
buzzmarshall has joined #linux-sunxi
maz has joined #linux-sunxi
tmlind has joined #linux-sunxi
bill-auger has joined #linux-sunxi
dlan has joined #linux-sunxi
alexxy has joined #linux-sunxi
gendevbot has joined #linux-sunxi
Wizzup has joined #linux-sunxi
paulk-leonov has joined #linux-sunxi
janhenrik has joined #linux-sunxi
jonkerj has joined #linux-sunxi
Peetz0r has joined #linux-sunxi
charco has joined #linux-sunxi
kevans91 has joined #linux-sunxi
z3ntu has quit [Ping timeout: 248 seconds]
jelly has joined #linux-sunxi
specing has joined #linux-sunxi
xes_ has joined #linux-sunxi
chewitt_ has joined #linux-sunxi
e1z0 has joined #linux-sunxi
wigyori has joined #linux-sunxi
longsleep has joined #linux-sunxi
pgreco has joined #linux-sunxi
Tooniis has quit [Ping timeout: 258 seconds]
kayterina has quit [Ping timeout: 258 seconds]
JuniorJPDJ has quit [Max SendQ exceeded]
fevv8[m] has quit [Ping timeout: 248 seconds]
Benjojo has joined #linux-sunxi
Laa[m] has quit [Ping timeout: 248 seconds]
davidebeatrici has quit [Ping timeout: 248 seconds]
Ke has quit [Ping timeout: 258 seconds]
Jeremy_Rand_DT[m has quit [Ping timeout: 258 seconds]
junak[m] has quit [Ping timeout: 258 seconds]
solderfumes[m] has joined #linux-sunxi
thefloweringash has joined #linux-sunxi
hanetzer has joined #linux-sunxi
danqo has joined #linux-sunxi
KotCzarny has joined #linux-sunxi
plaes has joined #linux-sunxi
[TheBug] has joined #linux-sunxi
thefloweringash has quit [Ping timeout: 247 seconds]
danqo has quit [Ping timeout: 247 seconds]
solderfumes[m] has quit [Ping timeout: 247 seconds]
warpme_ has joined #linux-sunxi
_0x5eb_ has joined #linux-sunxi
jbrown has joined #linux-sunxi
aliosa27_ has joined #linux-sunxi
Harrier has joined #linux-sunxi
mripard has joined #linux-sunxi
pdp7 has joined #linux-sunxi
liushuyu has joined #linux-sunxi
ccaione has joined #linux-sunxi
wens has joined #linux-sunxi
matteosilex has joined #linux-sunxi
jeandet has joined #linux-sunxi
\\Mr_C\\ has joined #linux-sunxi
paulk-leonov has quit [Max SendQ exceeded]
ric96 has joined #linux-sunxi
clementp[m] has quit [Ping timeout: 248 seconds]
jeandet has quit [Ping timeout: 265 seconds]
fourkbomb has joined #linux-sunxi
ullbeking has joined #linux-sunxi
Avamander[m]1 has quit [Ping timeout: 258 seconds]
paulk-leonov has joined #linux-sunxi
jeandet has joined #linux-sunxi
solderfumes[m] has joined #linux-sunxi
reinforce has joined #linux-sunxi
shailangsa has joined #linux-sunxi
jstein has quit [Ping timeout: 240 seconds]
<apritzel>
does anyone have some hands-on Travis CI knowledge?
<apritzel>
the sunxi-tools CI build is failing, because we now need libfdt to build sunxi-fel
<apritzel>
it looks like we should add the libfdt package name (which one? from which distro?) to travis.yml?
<pnill>
apritzel: honestly, it was just a bunch of googling
<pnill>
and reading the source of sunxi-fel was what led me to realizing it could re-align the stack properly
<pnill>
I was mostly avoiding usage of it because my goal was to eventually make a tool to launch my custom u-boot/do other stuff
<pnill>
and man, it's been so long since I've been on IRC
<pnill>
I forgot net-splits were a thing
ChanServ has joined #linux-sunxi
ric96 is now known as Guest73870
matthewcroughan has joined #linux-sunxi
indy has joined #linux-sunxi
qschulz has quit [Quit: qschulz]
<apritzel>
tuxd3v: so this doc talks about Ubuntu, so the package name should be libfdt-dev then
<apritzel>
pnill: why do you need a "tool" to run custom U-Boot stuff? Loading multiple binaries via FEL is somewhat tricky (return to FEL, plus not smashing the FEL stacks), so I'd leave this to sunxi-fel
<apritzel>
pnill: you can customise the process by uploading a boot script, sumxi-fel will then make sure it's executed
qschulz has joined #linux-sunxi
<pnill>
apritzel: I don't know if you're familiar with the NES classic stuff, but similar concept..
<pnill>
Closed PCB, I want other people to be able to do things with and eventually plan to make a payload that gets executed yatta yatta
<pnill>
so the idea was to make a easy to use interface for others to do what I'd already been doing (running additional games and such on the PCB)
<apritzel>
no SD card on that device?
<pnill>
difference is I did it via breaking into u-boot putting kernel into rescue mode, and modifying content that way over UART.
<pnill>
I'd cross compiled emulators and such for it, and am just trying to share the love by getting an easy way for other people to be able to do it as well
<pnill>
So with u-boot now booting, I should be able to abuse ext4write
<pnill>
to update the rc.local on it
<pnill>
to check for additional scripts or such over USB
<pnill>
to execute a payload
<apritzel>
pnill: you can upload a kernel and initrd via FEL as well
<pnill>
yeah, I know but I don't know why I'd go that far if I can just manipulate the startup script to check for a payload over USB
<apritzel>
then use proper Linux (via UART) to access the eMMC
<pnill>
Oh, I have proper eMMC access over UART
<pnill>
in the original distro running on it.
<pnill>
it runs a variation of ubuntu by default
<pnill>
I'm just trying to take the pain of soldering UART headers onto the board away from other people that want to do what I'm doing
<pnill>
and make it more easily accessible.
<pnill>
They'll never even realize what "FEL" is because they'll just click buttons
<apritzel>
I see, you want other people to just connect USB and run some script
<pnill>
Yeah, exactly.
<pnill>
So basically it's a locked down PCB, and it only runs one game and the lightguns don't work on PC/Pi because it utilizes proprietary drivers
<pnill>
I could rip/re-distribute those drivers but ethically and legally that's not really acceptable and due to my employment and some of the things I do I have to operate in as little of a grey area as possible
<pnill>
So, long story short just going to create some form of a payload that's check for on USB and gets executed at boot time of the original linux distro
<pnill>
But I wanted to be able to use U-Boot to write that additional check for USB into place.
<apritzel>
yeah, that sound reasonable
<pnill>
I wasn't sure how accepting this channel/group would be to that sort of thing, but I saw people documenting TV boxes and stuff so figured it was ok here.
<pnill>
I have 2 others of their cabinets that use the same SoC and a similar PCB layout, hoping my work translates to those as well
<apritzel>
sure, whatever helps other people to get full access to the device
<pnill>
one is a Android system that runs Pinball and a port of pinballfx
<pnill>
the other is a little racing cabinet.
<apritzel>
so once you have U-Boot, put your U-Boot commands into some boot.scr, run mkimage on it and upload it via FEL
<pnill>
I'm trying to figure that part out now lol... I just compiled with ext4write and was going to do some testing before coming up with the commands to execute
<pnill>
I was also planning to use sunxi-fel to write the new file into DRAM in order to utilize ext4write to write it to disk
<apritzel>
sunxi-fel will detect a "U-Boot legacy script image" among the uploaded payloads, and pass the address to U-Boot in a special way, so it executes it as a script
<apritzel>
yeah, I did this as well in the past: upload an ext4 image (gzip'ed), then use "mmc write" to write to the eMMC
<pnill>
oh, I was trying to actually write a single file instead of the whole image
<pnill>
The cabinet by default uses rc.local as it's boot process and has an update mechanism that executes a signed payload off a USB stick
<pnill>
basically just going to throw something similar in before the normal boot process goes
<apritzel>
not sure how good U-Boot's ext4write is, but that would be the easiest then, yes
<pnill>
well, good news is the rc.local is text based file
<pnill>
lol
<pnill>
otherwise the ext4 partition is rather large.
<pnill>
dumping over FEL was already a nightmare in the first place.
<pnill>
I actually wrote a payload to dump pieces of emmc over FEL
<pnill>
init the emmc/dump sector by sector
<pnill>
that's how I was writing/reading was using the brom and executing custom payloads to call out to the emmc functions within it
<apritzel>
you should not need to look at the BROM
<pnill>
initially I did, to get the boot0
<pnill>
I used BROM to init emmc, then dumped boot0
<pnill>
that way
<pnill>
I had no other way to init emmc
<pnill>
and uart was 'disabled' with wrong pin configuration in boot0
<pnill>
so I actually got the proper pin configuration, wrote it into the stock boot0
<pnill>
fixed the checksum
<pnill>
and re-wrote it using my payload executing within the BROM to write sectors.
<pnill>
That's how I initially got *working* UART.
<apritzel>
that sounds nice, but should not be needed if you just try with mainline U-Boot first ;-)
<apritzel>
hacking around boot0 is quite a waste of time (been there, done that)
<apritzel>
sunxi-tools has a tiny hello world payload to upload via FEL, to test the UART
<apritzel>
next step is then just the SPL, this is pretty board agnostic
<pnill>
well..
<pnill>
at the time according to documentation available currently
<pnill>
mainline u-boot didn't support DDR3 on the H6 ytet
<pnill>
*yet
<pnill>
that was just recently added
<pnill>
lol
<pnill>
at least in a 'stable' build
<pnill>
and the sunxi-tools hello world didn't initially work I forget why.
<pnill>
but tbh, I enjoyed hacking around boot0/brom
<pnill>
it was a fun learning experience, and it gave me all the appropriate pin configurations and such that I needed
<pnill>
not that they were entirely useful for u-boot mainline haha.
<pnill>
I'm new to all of this so for me to get this far is already an accomplishment.
<pnill>
I've done high level software RE/programming and such for awhile but nothing like this.
<apritzel>
yeah, I see, just be warned that boot0 and the BROM are pretty sh*t
<pnill>
This was utilizing the 'framework' that my buddy wrote
<pnill>
for talking to FEL
<pnill>
before I was using sunxi-tools
<apritzel>
why not use the routines from sunxi-fel
<pnill>
really only used sunxi-tools for spl/uboot now
<pnill>
idk
<pnill>
I didn't know sunxi-fel existed yet
<pnill>
he handed me his code for this stuff
<pnill>
and I used that
<pnill>
lol
<apritzel>
there is something like fel_lib in there
<apritzel>
it's not really a self containted library, but can be made from it pretty easily
<apritzel>
or you call sunxi-fel from your tool or script, that then takes cares of all the special tricks needed
<pnill>
yeah, that's what I plan on doing now that I have everything together like I was saying
<pnill>
write some C# interface
<pnill>
and call sunxi-fel from there
<pnill>
to do the dirty work
<pnill>
so the noobs don't have to be scared away by command line
<pnill>
The community involved in this are the kind of people who have bought sd cards off amazon because they didn't know how to put roms on their raspberry pi
<pnill>
so making it as simple as possible for them is crucial lol
<apritzel>
so glad you had so much fun, but sorry for the Allwinner pain you needed to endure
<pnill>
hey man, it was amazing.
<pnill>
I do RE/Vuln research for a living
<pnill>
so learning so much about the hardware as honestly great for me even professionally
<pnill>
My co-workers were all really interested when I embarked on this
<pnill>
lol
<apritzel>
problem is you can do only so much this way on Allwinner
<pnill>
And it turned into a project where I started obtaining more of these PCBs from different arcades...
<apritzel>
there are many hidden and undocumented bits, that we collected over the years here
<pnill>
Yeah, it was annoying the BROM didn't have the ability to write to emmc built-in lol
<pnill>
I'm guessing people developing boards like this burn the flash ahead of time and don't care?
<apritzel>
you can upload mainline U-Boot, then use fastboot
<pnill>
ahh
<pnill>
So after I finish this up
<pnill>
the other PCB is the one I'm wanting to play with
<pnill>
that runs android
<pnill>
I'm hoping I can get adb enabled on it
<apritzel>
or use TFTP or USB to get your payload into DRAM
<apritzel>
I figured over time it's not really worth to come up with custom solutions for accessing peripherals on a low level (via FEL or UART or what not), it's mostly easier to get U-Boot running
<apritzel>
we upload some SPI code over FEL, so you can read or write (bootable) SPI flash directly with sunxi-fel
<pnill>
Yeah, it doesn't have SPI
<pnill>
one of them is NAND based
<apritzel>
I was always curious to enable MMC this way
<pnill>
and my buddy said NAND is more of a headache than emmc for some reason...
<apritzel>
it is
<apritzel>
much more
<apritzel>
so much that we nobody is really using raw NAND anymore
<apritzel>
I think we never saw raw NAND on boards with H3 or later
warpme_ has quit [Quit: Connection closed for inactivity]
<apritzel>
eMMC is a "soldered down SD card", if you like, all the flash magic is done by the chip
<pnill>
yeah, that's kind of the way my buddy explained it.
<pnill>
There's a wide variety of these boards
<pnill>
they use rockchip, a20, H6, etc.
<apritzel>
many A20 boards use raw NAND, and there is only some basic SLC support for mainline, AFAIK
<pnill>
there's an example of one of the other boards.
<pnill>
I don't know what's under that heatsink on that one though
<pnill>
"Hardware: AllWinner A13 SoC, 128MB Flash, 40-pin "IDE"-style cable to control panel breakout/encoder board
<pnill>
"
<pnill>
I guess that was one of em
<pnill>
they seem to prefer allwinner SoCs on all their boards.
<apritzel>
there are three good reasons for Allwinner SoCs: they are cheap, they don't cost much, and they are not expensive
<apritzel>
I wouldn't know of other good reasons
<pnill>
So the Gen 1 were A13, Gen2 H3 Gen 3 doesn't specify but says Allwinner, Gen4 Actions Semi ATM7051H, Gen 5 Rockchip RK3032 SoC, Gen 5b AllWinner V306 SoC and then their newest boards these ones the H6.
<pnill>
On their gen1 they didn't have the microusb soldered on
<pnill>
and they started adding it for firmware update capabilities
<pnill>
and they made use of FEL mode to achieve that.
<pnill>
so they even put an "ON" switch on the back
<pnill>
that triggers FEL
<pnill>
So yeah in the long wrong I eventually plan to play with as many of those as possible to do something similar
<pnill>
because it's a waste that people usually just rip these out and replace em with a rapsberry pi when they're perfectly capable of doing more on their own
<pnill>
imo
<apritzel>
from a hacker's perspective Allwinner SoCs are also nice, yes, which makes we wonder why board vendors use them
<apritzel>
well, I hope you don't plan on dumping BROM and such anymore
<pnill>
hopefully not haha.
<pnill>
now that I know this channel is rather inviting
shailangsa has quit []
<pnill>
and open to noobs like myself trying to figure it out
<apritzel>
what you did doesn't sound very "nooby" ;-)
<apritzel>
the BROM operation is quite well understood here, and it's basically FEL, resume from suspend and trying to load magic binaries from SD, eMMC, SPI
<apritzel>
and FEL is covered by sunxi-fel, and the binary header/checksum is pretty trivial
<pnill>
Actually, I think that was something that initially put me off of sunxi-tools
<pnill>
was I thought they were outdated/didn't have support for the H6
<pnill>
because I tried to read something I dumped at some point
<pnill>
and it was "Uknown"
<apritzel>
H6 support in sunxi-tools should be around for a while
<pnill>
It was really overwhelming being honest trying to figure out how sunxi tools worked, and U-Boot documentation almost went in a rabbit hole lol
<pnill>
It's easy to get lost on the wiki is what I mean to say
<apritzel>
new SoC FEL support is mostly pretty straight-forward once you know where to look at, and is what we do first here to enable U-Boot/kernel development
<apritzel>
yeah, the Wiki is full of older stuff, that is somewhat misleading for newer SoCs
<pnill>
welp, now to figure out how I'll accomplish my goal
<apritzel>
but this is all a walk in the park compared to understanding the Allwinner BSP ;-)
<pnill>
get a PoC going and get someone else to test it out
<pnill>
well yeah, once you get that far haha.
<pnill>
Prior to any of this, I'd never even cross-compiled.
<pnill>
I'm a windows dev normally, and know enough about linux to be dangerous
<pnill>
Like I've back-ported kernel exploits and such, and know a bit about lower level driver interfaces
<pnill>
but never really done development on a linux system.
<apritzel>
at least with WSL2 that should be more accessible now
<pnill>
So ofc my first approach to this was avoiding mainline.
<pnill>
and going straight for BSP
<pnill>
I found the orange pi 3 build-env
<apritzel>
big mistake
<pnill>
and tried to use that to build u-boot initially
<pnill>
that was a hugeeeee rabit hole
<apritzel>
the BSP is broken beyond repair
<pnill>
So why is there a separate BSP
<pnill>
did allwinner just not like u-boot mainline or?
<pnill>
And why do vendors not run u-boot mainline and opt for the BSP instead
<apritzel>
board vendors get the BSP from Allwinner, and this is all Allwinner ever tells them
<apritzel>
mainline development typically only starts once boards are actually sold
<pnill>
ahh ok
<apritzel>
Allwinner's code is completely decoupled from mainline, they use ancient version for their hacky port, and even ignore many existing support code already in there
<pnill>
That sucks
<pnill>
That was part of the whole getting lost on the wiki too
<pnill>
So
<pnill>
The whole reason I even found linux-sunxi.org
<pnill>
was because I was googling the PMIC wondering what it was.