rellla changed the topic of #linux-sunxi to: Allwinner/sunxi /development discussion - did you try looking at our wiki? https://linux-sunxi.org - Don't ask to ask. Just ask and wait! - https://github.com/linux-sunxi/ - Logs at http://irclog.whitequark.org/linux-sunxi - *only registered users can talk*
Guest8986 has joined #linux-sunxi
catphish has joined #linux-sunxi
<catphish> is there somewhere i can find the ram settings for my (banana pro) board?
Guest8986 has quit [Ping timeout: 250 seconds]
<veremitz> you could check the device-tree source?
<catphish> ah, found the most critical thing i need for now: CONFIG_DRAM_CLK=432
<catphish> and CONFIG_NR_DRAM_BANKS=1
<catphish> other stuff seems to be worked out by trial and error
<catphish> that's what i need immediately anyway :)
<veremitz> :D
kever has joined #linux-sunxi
DoomPatrol26 has joined #linux-sunxi
DoomPatrol26 has quit [Remote host closed the connection]
<apritzel> karlp: can you try to set the CPU clock frequency to 408 MHz (instead of the 1008 MHz) on your OPi-Zero?
<apritzel> this fixes it for me
<apritzel> that wouldn't be the proper fix, but a good hint that the DRAM controller code runs too fast
dev1990 has quit [Quit: Konversation terminated!]
catphish has quit [Quit: Leaving]
apritzel has quit [Ping timeout: 272 seconds]
NeuroScr has joined #linux-sunxi
anarsoul|2 has quit [Ping timeout: 272 seconds]
kever has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
kever has joined #linux-sunxi
kever has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
kevery has joined #linux-sunxi
kever has joined #linux-sunxi
kever has quit [Client Quit]
kevery has quit [Ping timeout: 245 seconds]
kever has joined #linux-sunxi
kever is now known as kevery
kevery is now known as kever
yangxuan has joined #linux-sunxi
lurchi_ is now known as lurchi__
NeuroScr has quit [Quit: NeuroScr]
yangxuan has quit [Ping timeout: 250 seconds]
popolon has quit [Quit: WeeChat 2.3]
NeuroScr has joined #linux-sunxi
dddddd has quit [Remote host closed the connection]
NeuroScr has quit [Quit: NeuroScr]
freddor[m] has quit [Quit: issued !quit command]
freddor[m] has joined #linux-sunxi
Xalius_Ph has quit [Quit: Bye]
freddor[m] has quit [Quit: issued !quit command]
freddor has joined #linux-sunxi
Ownix9 has joined #linux-sunxi
Ownix9 has quit [Read error: Connection reset by peer]
NeuroScr has joined #linux-sunxi
pihpah9 has joined #linux-sunxi
pihpah9 has quit [Ping timeout: 244 seconds]
megi has quit [Ping timeout: 250 seconds]
arete74 has quit [Ping timeout: 268 seconds]
merlin1991 has quit [Remote host closed the connection]
kelvan has quit [Remote host closed the connection]
merlin1991 has joined #linux-sunxi
kelvan has joined #linux-sunxi
arete74 has joined #linux-sunxi
victhor has quit [Remote host closed the connection]
NeuroScr has quit [Quit: NeuroScr]
meltingwax15 has joined #linux-sunxi
meltingwax15 has quit [Ping timeout: 268 seconds]
IgorPec has joined #linux-sunxi
reinforce has joined #linux-sunxi
\\Mr_C\\ has quit [Ping timeout: 250 seconds]
\\Mr_C\\ has joined #linux-sunxi
selfbg has joined #linux-sunxi
yann has quit [Ping timeout: 250 seconds]
f0xx has joined #linux-sunxi
\\Mr-C\\ has joined #linux-sunxi
\\Mr_C\\ has quit [Ping timeout: 250 seconds]
reinforce has quit [Ping timeout: 240 seconds]
kever has quit [Ping timeout: 246 seconds]
kever has joined #linux-sunxi
reinforce has joined #linux-sunxi
\\Mr_C\\ has joined #linux-sunxi
\\Mr-C\\ has quit [Ping timeout: 250 seconds]
nuuuciano has quit [Ping timeout: 246 seconds]
\\Mr-C\\ has joined #linux-sunxi
\\Mr_C\\ has quit [Ping timeout: 250 seconds]
apritzel has joined #linux-sunxi
\\Mr-C\\ has quit [Ping timeout: 250 seconds]
\\Mr_C\\ has joined #linux-sunxi
apritzel has quit [Ping timeout: 250 seconds]
paulliu has joined #linux-sunxi
leviathanch has joined #linux-sunxi
NeuroScr has joined #linux-sunxi
clemens3_ has joined #linux-sunxi
m4ssi has joined #linux-sunxi
\\Mr-C\\ has joined #linux-sunxi
\\Mr_C\\ has quit [Ping timeout: 250 seconds]
\\Mr_C\\ has joined #linux-sunxi
\\Mr-C\\ has quit [Ping timeout: 250 seconds]
NeuroScr has quit [Quit: NeuroScr]
\\Mr-C\\ has joined #linux-sunxi
\\Mr_C\\ has quit [Ping timeout: 250 seconds]
<Net147> jernej: I noticed on A64 that 4.20-rc7 kernel sometimes only reads part of the HDMI EDID not the whole EDID if HDMI is also enabled in U-Boot 2018.11. as a result the resolution is incorrect. any ideas?
florianH has joined #linux-sunxi
\\Mr-C\\ has quit [Ping timeout: 250 seconds]
\\Mr_C\\ has joined #linux-sunxi
\\Mr-C\\ has joined #linux-sunxi
\\Mr_C\\ has quit [Ping timeout: 250 seconds]
leviathanch has quit [Remote host closed the connection]
s_frit has quit [Remote host closed the connection]
s_frit has joined #linux-sunxi
kever has quit [Ping timeout: 250 seconds]
leviathanch has joined #linux-sunxi
kever has joined #linux-sunxi
victhor has joined #linux-sunxi
\\Mr-C\\ has quit [Ping timeout: 250 seconds]
\\Mr_C\\ has joined #linux-sunxi
msimpson has joined #linux-sunxi
msimpson has quit [Client Quit]
yann has joined #linux-sunxi
_0x5eb_ has quit [Ping timeout: 246 seconds]
apritzel has joined #linux-sunxi
_0x5eb_ has joined #linux-sunxi
yann has quit [Ping timeout: 272 seconds]
<karlp> apritzel: where do I set that? (and plaes has the opi zero, I only have the nanopi duo2)
<apritzel> karlp: either you overwrite the constant in the "clock_set_pll1(CONFIG_SYS_CLK_FREQ);" line
<apritzel> or you set this symbol in the .config, for instance via make menuconfig, under the "Boot images" submenu
dddddd has joined #linux-sunxi
AneoX_ has joined #linux-sunxi
AneoX has quit [Ping timeout: 244 seconds]
argulp has joined #linux-sunxi
jaganteki has joined #linux-sunxi
AneoX has joined #linux-sunxi
AneoX_ has quit [Ping timeout: 250 seconds]
AneoX_ has joined #linux-sunxi
AneoX has quit [Ping timeout: 250 seconds]
leviathanch has quit [Remote host closed the connection]
<plaes> apritzel: oh wait.. DRAM_CLK does not affect it?
<apritzel> plaes: DRAM_CLK is independent
<apritzel> the difference is that now the DRAM init runs with a higher *CPU* clock frequency
matthias_bgg has joined #linux-sunxi
<apritzel> 42 times higher, actually
<plaes> ok, I was wondering why you had 1008MHz as default :P
<plaes> yup, works fine with 408MHz
<apritzel> plaes: in general lowering DRAM_CLK tends to paper over other issues, like wrong DRAM timing settings
<apritzel> plaes: 1008 MHz is the default CPU frequency for most SoCs
<plaes> apritzel: anything else you want me to test?
<apritzel> plaes: I guess reverting the patch works for you as well?
<plaes> yes
<apritzel> plaes: OK, thanks
yangxuan has joined #linux-sunxi
megi has joined #linux-sunxi
IgorPec has quit [Ping timeout: 244 seconds]
<jaganteki> plaes, try to enable DM_USB_GADGET for musb breakage
<karlp> apritzel: yep, that boots fine with it set to 408. fails at 1008 and 808. (where did you get 408 from? why so specific?)
<apritzel> karlp: thanks
<apritzel> karlp: 408 is the default "safe" frequency according to the H3 manual
<karlp> 608 detects (wrongly) 1024 meg, but boots ok.
<apritzel> I tried to "bisect" some frequencies, but didn't get much higher than 408
<karlp> are clocks not turned on before ram?
<plaes> jaganteki: doesn't help :(
<plaes> wait, sorry
<plaes> need to prefix with with CONFIG_
<plaes> /home/plaes/code/u-boot/drivers/usb/gadget/udc/udc-uclass.c:52: undefined reference to `dm_usb_gadget_handle_interrupts'
<apritzel> karlp: the BROM sets up the basic clocks, but runs the CPU at 24MHz, for the beginning
<apritzel> karlp: the existing code (before Olliver's patch) ran the DRAM init still with this clock
<apritzel> karlp: do you want to resend with an amended commit message?
<karlp> apritzel: I can amend the patch if you like, but can you write the summary you want to see there then?
<karlp> I'm also happy if you post an alternative revert yourself.
<apritzel> can do, will just keep your authorship, so shouldn't make a difference
<karlp> I'm not fussed on being author of a revert :)
<karlp> just happy to get it resolved.
AneoX has joined #linux-sunxi
AneoX_ has quit [Ping timeout: 246 seconds]
<karlp> hrm, silly board powering itself therough the usb-serial converter tx/rx lines.
AneoX_ has joined #linux-sunxi
<plaes> yeah :(
<beeble> karlp: add a schottky diode in series on the rx line (board side) if there is no PU on the cpu side add a 1 to 10k too
AneoX has quit [Ping timeout: 268 seconds]
<karlp> at home, on the usb3 hub I've been using, it works ok, I get all power through a microusb and the usb power monitor, but the work laptop setup powers through the usb-serial.
aalm has quit [Ping timeout: 240 seconds]
willmore has quit [Ping timeout: 272 seconds]
aalm has joined #linux-sunxi
<apritzel> beeble: do you know how long a PLL typically needs to lock to its target frequency? Is this more micro- or milliseconds?
<apritzel> after tuning the CPU clock PLL to 1008 MHz in the Allwinner SPL code, we wait a mere 400 CPU cycles at 24 MHz, which sounds a bit short to me
<karlp> is there not a bit to check for the pll being locked?
<karlp> that's we do in cortex-m land at least... (but we also have docs on what bits are what I guess....)
lurchi__ is now known as lurchi_
<apritzel> karlp: yes, "modern" SoCs have this
<apritzel> but this routine seems to cover also older parts like the A20
<karlp> ahh. joys
<karlp> do you reckon it's still bit 28? or do they _reallllly_ mean "unimpelemtned" not just "undocumented"
noctarius has quit [Ping timeout: 260 seconds]
noctarius has joined #linux-sunxi
scroll2_ has quit [Ping timeout: 252 seconds]
pmpp_ has joined #linux-sunxi
pmpp has quit [Disconnected by services]
scroll2_ has joined #linux-sunxi
jernej has quit [Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net]
jernej has joined #linux-sunxi
<apritzel> karlp: waiting for bit 28 doesn't fix it anyway on my OPi Zero
catphish has joined #linux-sunxi
<catphish> yay my h3 has arrived
<KotCzarny> what did you buy?
<karlp> apritzel: boo hiss :|
<karlp> was worth a try I guess :)
<apritzel> karlp: although bit 28 is still 0 after the sdelay call, so the 400 cycles are indeed too optimistic
<apritzel> anyway it does not seem to be the clock *setting* that causes it
indy has quit [Quit: ZNC - http://znc.sourceforge.net]
<catphish> KotCzarny: orange pi one, largely because it was what i could easily source locally
<KotCzarny> fine choice, ethernet on board
<KotCzarny> :)
IgorPec has joined #linux-sunxi
<catphish> it's probably the simplest of the orange PIs, half gig of ram, not much voltage control, 100Mbit ethernet, but it's all i need for what i'm playing with
<KotCzarny> nah, opi0 is even more cut down
<catphish> oh yeah that's true, no hdmi on those though :(
<KotCzarny> and keep in mind that even simple voltage control is nice if you dont need much cpu
<KotCzarny> which allows cooler board
<catphish> yeah i'll probably leave it running at low speed anyway
<catphish> will see how i get on
<catphish> you guys weren't kidding about DRAM being complicated, i tried to start configuring it last night, didn't get very far :)
<apritzel> karlp: aargh, CC:ed everyone and his dog, but forgot you :-(
* karlp loves these non-hdmi boards.
<karlp> apritzel: I don't mind :)
<karlp> thanks for picking this up
<catphish> non-hdmi boards are super neat if you only want GPIO
<catphish> as soon as i enabled the DRAM PLL, things started getting weird, then i fell asleep :) will try again tonight
indy has joined #linux-sunxi
<karlp> well, I want more than gpio, I just don't need a screen :) I want the processing power and cheapness
<catphish> plenty of uses for a zero indeed, robots in particular
<KotCzarny> since soc already supports it, adding hdmi jack doesnt add much
<beeble> apritzel: "depends". time is dependent on the input clock frequency and the internal build up. so the safe bet if unkown is to be in the milliseconds. typically it's in the us range
<KotCzarny> and allows a lot of additional uses
<karlp> KotCzarny: yes, but it gets in the way physcially.
<KotCzarny> mhm
<beeble> apritzel: and also be aware that sometimes the lock bit on allwinner socs are just timers that set the bit after a timeout (iirc)
<catphish> hopefully later today i can figure out this DRAM clock mess
<karlp> beeble: wat :)
<karlp> that's...... crazy
<KotCzarny> you get what you pay for
<KotCzarny> ;)
<apritzel> beeble: really? thanks anyway
<apritzel> beeble: I did a quick test and indeed the 400 cycles were too short
<apritzel> given there is at least some sense in the lock bit ;-)
<beeble> apritzel: not 100% sure if it was allwinner or another chinese chip vendor. mixing up a lot of stuff at the end of year
<beeble> but if it's crazy it's usually allwinner :)
<apritzel> beeble: agreed ;-)
netlynx has joined #linux-sunxi
netlynx has quit [Changing host]
netlynx has joined #linux-sunxi
AneoX has joined #linux-sunxi
AneoX_ has quit [Ping timeout: 246 seconds]
<catphish> what clock does the cpu use by default?
<catphish> oh, got it, 24MHz osc
AneoX has quit [Ping timeout: 240 seconds]
<apritzel> karlp: a naked readl loop takes 136 iterations until bit 28 becomes 1, the sdelay(200) in the code before reduces this only to 101 iterations
yangxuan has quit [Quit: Leaving]
AneoX has joined #linux-sunxi
nuuuciano has joined #linux-sunxi
AneoX has quit [Ping timeout: 246 seconds]
Gerwin_J has joined #linux-sunxi
AneoX has joined #linux-sunxi
s_frit has quit [Remote host closed the connection]
s_frit has joined #linux-sunxi
aalm has quit [Read error: Connection reset by peer]
argulp has quit [Remote host closed the connection]
popolon has joined #linux-sunxi
<mru> rockchip is best, their rtc has a 31-day november
<KotCzarny> lol
<KotCzarny> but.. how?
AneoX_ has joined #linux-sunxi
AneoX has quit [Ping timeout: 268 seconds]
Andy-D has joined #linux-sunxi
Andy-D has quit [Remote host closed the connection]
<apritzel> the commit message is hilarious
<KotCzarny> truly.
wasutton3_mobile has joined #linux-sunxi
apritzel has quit [Ping timeout: 245 seconds]
JohnDoe_71Rus has joined #linux-sunxi
selfbg has quit [Remote host closed the connection]
reinforce has quit [Quit: Leaving.]
vagrantc has joined #linux-sunxi
fl_0 has quit [Ping timeout: 250 seconds]
fl_0 has joined #linux-sunxi
matthias_bgg has quit [Read error: Connection reset by peer]
matthias_bgg has joined #linux-sunxi
AneoX has joined #linux-sunxi
AneoX_ has quit [Ping timeout: 246 seconds]
aalm has joined #linux-sunxi
popolon has quit [Ping timeout: 252 seconds]
<tautologico> catphish: you should write a blog about your baremetal explorations on allwinner SoCs
<KotCzarny> wiki is better
lurchi_ is now known as lurchi__
<tautologico> yeah, probably. any way to document this stuff
Gerwin_J has quit [Quit: Gerwin_J]
popolon has joined #linux-sunxi
sparks1x has joined #linux-sunxi
<sparks1x> Hi ^^
<catphish> tautologico: i can certainly do so, i really feel like i'm just regurgitating what linux does perfectly well, but perhaps others will be interested in small bare metal code like me
<catphish> tautologico: tonight i'll attack the DRAM PLL, once i have the DRAM and graphcs working, i'll write some blog :)
<KotCzarny> catphish: since i'm also interested in simple dram bringup, dont be shy!
<KotCzarny> (on H3)
<catphish> i'm currently targetting the a20, but i feel like it might be a dying breed and since i have an h3 on my desk now i'm tempted to make the switch
<KotCzarny> graphical bios running on openrisc core? why not ;)
<KotCzarny> a20 is nice if you need mobility
<KotCzarny> battery suport is very handy
<catphish> i tried to enable the PLL for the dram last night, as soon as i did my A20 went into an inexplicable infinite loop, i'll get back on it shortly, i might just have been lacking sleep
<catphish> h3 is the better platform what what i hope to achieve anyway, so i'll switch
<tautologico> I'm on H3 too
<catphish> i'm worried i'll have to start over on the graphics output (DE2 vs original DE)
<tautologico> there are lots of resources about baremetal on the rpi
<tautologico> there should be stuff about baremetal allwinner too
<catphish> well i can certainly get writing
<catphish> i'm pretty familiar with the a20 now and hopefully the h3 will be the same in many ways
<KotCzarny> yeah
<KotCzarny> they are similar
<KotCzarny> evolutionary build up
<mru> similarly lacking in docs, yes
<KotCzarny> then came h6 and they broke everything
<catphish> lol
jaganteki has quit [Ping timeout: 256 seconds]
<KotCzarny> bbl
<catphish> i like the look (and price) of the h3, quad core is a nice bonus
<mru> I have a few here
<mru> mostly they do what they're meant to
<catphish> lol that's a good start
<catphish> this board doesn't seem to have a reset button which is mildly annoying
<tautologico> which one?
<catphish> orange pi one
<tautologico> right, that's the one I have too
<catphish> there's not even a RST on the GPIO breakout
<catphish> well i'll live :) i'll just try not to keep crashing it
<tautologico> power adapter with on/off switch :)
<catphish> i'll be powering from the OTG port i hope
<catphish> there's also a power button, so can probably long press tat
<catphish> *that
reinforce has joined #linux-sunxi
m4ssi has quit [Remote host closed the connection]
apritzel has joined #linux-sunxi
<tautologico> I don't have an A20 to test your current code
<catphish> well initially everything i did was dependent on u-boot, now i'm aiming for genuine bare metal
<catphish> i don't really have anything much to present or to ask yet :)
<catphish> but will pester people here with questions as i go along i'm sure
<tautologico> that's why it would be good to have a permanent record of this information, instead of it being lost in IRC logs
<catphish> i agree entirely
<catphish> well my first (messy, u-boot dependent) attempt is published at https://github.com/catphish/a20-lowres - the new version that doesn't do much at all except the uart is at https://github.com/catphish/allwinner-bare-metal
AneoX_ has joined #linux-sunxi
AneoX has quit [Ping timeout: 250 seconds]
anarsoul|2 has joined #linux-sunxi
AneoX has joined #linux-sunxi
AneoX_ has quit [Ping timeout: 246 seconds]
<miasma> tautologico: there's the wiki..
Andy-D has joined #linux-sunxi
<tautologico> can anyone create an account and start editing?
Mandragor_ has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
Mandragor has joined #linux-sunxi
<apritzel> how is "bare metal" documentation different from other documentation?
<apritzel> I mean clocks are clocks and registers are registers ...
<catphish> apritzel: that was my feeling to, but i'm happy to contribute some basic code examples for people who might want to do similar
<tautologico> in the end it's the same, but I think that the only documentation righ tnow is the linux code and the allwinner manuals that only list the registers
<karlp> tautologico: don't forget the uboot code.
<catphish> the wiki has /some/ wordy discussion of how things work, obviously more of that would be nice
<karlp> doesn't look like barebox has any sunxi stuff at all?
<tautologico> catphish: also some things are scattered in different pages and it's not always easy to find what you're looking for
<catphish> anyway, as i said, my interest is in a nice simple low level example, so if i get it all working i'll write it up
<catphish> seems dram is going to be the hard part
<catphish> but uboot has plenty of code i can copy
return0e has quit [Ping timeout: 246 seconds]
willmore has joined #linux-sunxi
<tautologico> yeah I spent some time reading u-boot's NAND flash code and learning about nand, never thought it would be so complicated (raw nand I mean)
<catphish> ah, yeah, i haven't even considered how i'm going to do persistent storage
<catphish> most likely i'll only do SD card
<tautologico> emmc is easier, I think
<catphish> i actually don't know much about it, there's multiple modes? SPI, MMC, SD? all on the same socket?
return0e has joined #linux-sunxi
<catphish> anyway, i worry about dram clocks first :) ttyl
catphish has quit [Quit: Leaving]
popolon has quit [Ping timeout: 252 seconds]
AneoX has quit [Ping timeout: 246 seconds]
AneoX has joined #linux-sunxi
<apritzel> from a software POV eMMC and SD are virtually the same
<apritzel> setup a bit here or there differently
<karlp> hooray for internal FTLs
<karlp> head in sand ftw
<plaes> technically it's software in sand
<KotCzarny> catphish: no pmic, no reset
<KotCzarny> ;)
<KotCzarny> but you can write openrisc fw that checks gpio button and resets arm cores
<KotCzarny> if you want
<KotCzarny> as long you dont nuke openrisc clocks it will run along
<KotCzarny> it could even wait for ethernet frames with code and run it
pgreco has quit [Ping timeout: 245 seconds]
tl_lim has quit [Ping timeout: 250 seconds]
tl_lim has joined #linux-sunxi
formruga has quit [Ping timeout: 252 seconds]
NeuroScr has joined #linux-sunxi
pgreco has joined #linux-sunxi
catphish has joined #linux-sunxi
AneoX has quit [Ping timeout: 244 seconds]
AneoX has joined #linux-sunxi
<catphish> well the h3 is sufficiently different from the a20 that absolutely none of my init code works :)
lurchi__ is now known as lurchi_
<KotCzarny> :)
<apritzel> catphish: really? actually those two are not too far away ...
<KotCzarny> might be missed clock or register
matthias_bgg has quit [Ping timeout: 250 seconds]
<catphish> i've missed something fundamental, i'm running nothing but a "ldr pc fel-8" and it's crashing
paulliu has quit [Quit: Leaving.]
<catphish> i guess FEL moved, else this would surely work: "sunxi-fel exe 0xffff020"
<KotCzarny> missed 0?
<catphish> you're right, but doesn' make a difference
<catphish> sunxi-fel exe 0xffff0000 similarly fails, where'd the brom go :(
apritzel has quit [Ping timeout: 246 seconds]
<KotCzarny> quite informative
<KotCzarny> a bit better
<KotCzarny> no sun8i tho
<catphish> KotCzarny: nice :)
<catphish> i'm 99% sure the BROM *is* at 0xffff0000 still
<catphish> so i'm confused as to what i'm doing wrong
<catphish> oh, that "sunxi-fel exe 0xffff020" trick doesn't work on the a20 either
<catphish> (even with the right number of zeros
lkcl has quit [Read error: Connection reset by peer]
florianH has quit [Quit: Connection closed for inactivity]
<KotCzarny> 0xffff0020
<catphish> to clarify, running "sunxi-fel exe 0xffff0020" crashes both my a20 and my h3
<catphish> i don't really understand why
<KotCzarny> the only h3 related memory map http://linux-sunxi.org/AR100#H3
<catphish> it's irrelivant to them being the same or different, but interesting that this doesn'w tork
<catphish> the h3 memory map is in the h3 datasheet
sparks1x has quit [Remote host closed the connection]
<catphish> no worries, i'll work out how to do this correctly
vagrantc has quit [Remote host closed the connection]
lkcl has joined #linux-sunxi
vagrantc has joined #linux-sunxi
<KotCzarny> remember to take datasheets from aw with a grain of salt
<catphish> they've served me pretty well so far, but i will indeed :)
JohnDoe_71Rus has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/]
apritzel has joined #linux-sunxi
<catphish> this also fails on all boards: asm("ldr r1, =0xffff0020; bx r1;"); - am i just an idiot? shouldn't this definitely load the FEL?
<apritzel> catphish: where are you running this from? SD card? Are you sure that your code is actually executing?
<catphish> it's definitely executing
<catphish> this is my complete main function right now: https://paste.ubuntu.com/p/H72ytcxFKj/ LED goes on, LED goes off, FEL doesn't become responsive
<apritzel> catphish: do you come from FEL? Or SD card?
<catphish> from FEL
<apritzel> well, why not just return?
<apritzel> I don't think this jumping into FEL again works too reliably
<catphish> interestingly return *does* work, but that depends on keeping the return pointer
<apritzel> since OTG is already initialises, it might be in a funny state
<catphish> maybe FEL it's supposed to initialize more than once
<apritzel> do it in assembly:
<catphish> but instead you're supposed to return to it
<apritzel> save LR and SP, then setup your SP, bl to main
<apritzel> after the bl, restore LR and SP and do a bx lr
<apritzel> in boot.s
<catphish> that makes perfect sense, i just need to work out how to save the lr/sp
<apritzel> to the top of your new stack
<catphish> yes, of course
<apritzel> meanwhile you just copy SP to some register, set your SP, then store the copy to the top
<apritzel> this is what I have: bic r0, pc, #0xff; add r1, r0, #0x3f00; str sp, [r1, #-4]; str lr, [r1, #-8]; sub sp, r1, #8; bl main
<catphish> cool, thanks!
<apritzel> leaving the return part to you, could actually be one pop instruction
<apritzel> I typically write aarch64, so am not too familiar with those ldmia/stmia tricks
<mru> they are just push and pop with arbitrary base registers
<apritzel> mru: I know, it's just that there is no stmia/ldmia/push or pop in aarch64, so I tend to not use them
<mru> yeah, they're kind of tricky to implement sanely in a modern high-performance architecture
<mru> so aargh64 dropped them
<apritzel> indeed, it's not 1985 anymore ;-)
<mru> and saving a few bytes in the instruction prologue isn't as exciting
<catphish> no aarch64 for me :)
<mru> still, on some of the older arm cores, they could be used to very good effect
<apritzel> for handwritten assembly ARM(32) is probably nicer
<catphish> just gotta work out whether 1) my code isn't executing at all on the h3 or 2) the "bx lr" isn't working in the h3
<catphish> just need to get both chips to the point where they run code that does absolutely nothing, then i can get on :)
<catphish> that return works as expected on the a20
<mru> even cortex-a9 has a trick where if you write an entire cache line in one instruction, it avoids the redundant fetch from memory
<mru> if the region is write-allocate
netlynx has quit [Quit: Ex-Chat]
<apritzel> does anyone know how to tell the linker to insert a section with a certain alignment, but fill the gaps with other code?
<mru> huh?
<apritzel> mru: it's for the AArch64 exception vectors in the U-Boot SPL on Allwinner
<apritzel> there is no special handling for them, so the 2K alignment produces random gaps
<apritzel> I want the linker to put the vectors somewhere (2k aligned), but don't really care where
<apritzel> the linker should just make sure there is as little padding as possible
<apritzel> at the moment this works today, say the padding is 100 bytes or so
<apritzel> now some patch adds 104 bytes of code *before* the vectors, so suddenly there is 2044 bytes of padding :-(
<apritzel> I can't put them at the beginning, because there is both the header and entry point
<mru> put those in their own section, then the exception vectors, then all the other code
<apritzel> mmh, but that would create a constant big padding after the header, wouldn't it?
<karlp> just make sure the vectores get their section?
<karlp> whats you ld script look like?
<mru> apritzel: don't you have some other small bits you could put there?
<apritzel> http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/cpu/armv8/u-boot-spl.lds
<apritzel> mru: yeah, could try this, but this is all pretty tight and changes everytime
<apritzel> that's why I was thinking that the linker could arrange the functions cleverly, to keep the alignment minimal
<apritzel> the padding, I mean
popolon has joined #linux-sunxi
<jernej> Net147: Try commenting line 562 and 563 here: http://git.denx.de/?p=u-boot/u-boot-sunxi.git;a=blob;f=drivers/video/dw_hdmi.c;h=229bd63c97c8222b3ddbfbbb1985ddca47140a0b;hb=HEAD#l562
<jernej> I'm suspecting that values here are not correct
<Net147> jernej: I also notice that 3840x2160 30 Hz not stable for me (image flickers on and off) so I have to use 3840x2160 24 Hz
AneoX_ has joined #linux-sunxi
<catphish> cool, got code running happily on the h3 now :)
AneoX has quit [Ping timeout: 246 seconds]
<jernej> Net147: U-Boot code was written before many things were known, so it needs some updates
<jernej> I plan to do it, just have to find some time
<catphish> Net147: that's not bad, previously you said you only got 15Hz
<jernej> but since I don't have 4K screen, someone else will have to test and fix it after that
AneoX has joined #linux-sunxi
<Net147> jernej: I am testing display using sun4i-drm, not using U-Boot
<catphish> i also don't have a 4k screen, so can't test the DEBE for you
<jernej> ah, which version?
AneoX_ has quit [Ping timeout: 268 seconds]
<Net147> jernej: 4.20 rc7
<Net147> catphish: 24 Hz on A64, 15 Hz on A20 max
<catphish> Net147: ah ok
<catphish> i wonder where the bottleck is
<jernej> Net147: Allwinner have two different 4K settings for HDMI PHY, depending on SoC revision
<jernej> maybe that's it
<Net147> catphish: I tried on A20 switching HDMI source from backend to the internal colorbar generator, still no luck
<jernej> but currently I can't really tell you where is the difference
<jernej> maybe over weekend
<catphish> Net147: that's interesting, must be a limitation of the hdmi interface itself then
AneoX_ has joined #linux-sunxi
AneoX has quit [Ping timeout: 250 seconds]
<Net147> catphish: 3840x2160 15 Hz is roughly same pixels per second as 1920x1080 60 Hz
<catphish> it is indeed, makes sense
<catphish> this could just be a limitation of the input clock
f0xx has quit [Ping timeout: 244 seconds]
IgorPec has quit [Ping timeout: 250 seconds]
matthias_bgg has joined #linux-sunxi
AneoX has joined #linux-sunxi
AneoX_ has quit [Ping timeout: 245 seconds]
pmpp_ is now known as pmp-p
matthias_bgg has quit [Ping timeout: 250 seconds]
<karlp> apritzel: oh, I think I understand what you mean now, yeah, I don't know any tricks with ld scripts to do what you want.
<karlp> where are the vectors defined?
<apritzel> arch/arm/cpu/armv8/exceptions.S
AneoX_ has joined #linux-sunxi
<apritzel> from the linker's POV it's just ordinary code, just with an insane alignment
<karlp> yeah, but if you just give them their own sections, it will jsut pad as needed to make it start at the right place,
<karlp> I don't kno whow to re-order sections that don't matter to result in the tightest packing
<karlp> do they have to go in sram?
AneoX has quit [Ping timeout: 246 seconds]
<apritzel> karlp: that's another plan: they could be somewhere else (other SRAM, for instance)
<apritzel> but:
<apritzel> the BROM only loads 32KB into SRAM A1
s_frit has quit [Remote host closed the connection]
<apritzel> so we would need to copy them
<karlp> you can make artificial regions of the same ram, basically _always_ reserve the last 2k or something, or always the first 2k?
s_frit has joined #linux-sunxi
<apritzel> the first 2k don't work, because there needs to be the eGON header
<apritzel> and there are much smaller than 2K, so putting them at the end would be a waste as well
<mru> is there any harm in the image being a fixed size rather than the exact size needed by the code?
<apritzel> mru: the eventual image is padded to 8K anyway
<apritzel> so: no
<mru> otherwise, the best I can think of is finding some random stuff you can stuff between the entry code and the vectors
<apritzel> mru: yeah, I was looking into this
<mru> maybe a data table or something
<mru> anything that's not likely to grow
<apritzel> .rodata and data are a bit above 2K
<apritzel> maybe I can split this up
<apritzel> to put the first part right after the header
<mru> you can take anything from .rodata and put it wherever
<apritzel> and fill 2K
<apritzel> one question though:
<apritzel> how can I say: I want .text, then .data, then .text again
<apritzel> in the linker script
<apritzel> does that work?
<apritzel> as I read it it's per output section
<mru> the linker doesn't care what's in the sections
<apritzel> ah
<apritzel> so I can call the first one .header and still put code in there?
<mru> sure
* apritzel goes to divide (and conquer) the .data section
<apritzel> to find a bit less than 2K ...
<apritzel> btw: if that works, we can have a single image for multiple SoCs ...
<apritzel> that works already for A64 and H5, just with a 32-bit FEL
<apritzel> s/FEL/SPL/
wasutton3_mobile has quit [Ping timeout: 268 seconds]
Putti has quit [Ping timeout: 272 seconds]
atsampson has quit [Ping timeout: 264 seconds]
Andy-D has quit [Ping timeout: 268 seconds]
Andy-D has joined #linux-sunxi
victhor has quit [Remote host closed the connection]
<apritzel> mru: shoot, all the strings together are just 84 bytes too large to stuff them into this gap ...
<karlp> anyone know how I can idenfity the specific bluetoth variant I have as per the variants here? http://lists.infradead.org/pipermail/linux-arm-kernel/2018-December/621207.html
bielski has quit [Ping timeout: 245 seconds]
bielski has joined #linux-sunxi
msimpson has joined #linux-sunxi
reinforce has quit [Quit: Leaving.]
clemens3_ has quit [Ping timeout: 246 seconds]
msimpson has quit [Quit: Leaving]
atsampson has joined #linux-sunxi
dev1990 has joined #linux-sunxi