ftg has quit [Read error: Connection reset by peer]
adjtm is now known as Guest349
adjtm has joined #linux-sunxi
Guest349 has quit [Read error: Connection reset by peer]
vagrantc has quit [Quit: leaving]
adjtm is now known as Guest350
adjtm has joined #linux-sunxi
Guest350 has quit [Ping timeout: 480 seconds]
apritzel has quit [Ping timeout: 480 seconds]
cnxsoft has joined #linux-sunxi
JohnDoe_71Rus has joined #linux-sunxi
cnxsoft1 has joined #linux-sunxi
cnxsoft has quit [Ping timeout: 480 seconds]
Daanct12 has joined #linux-sunxi
hlauer has joined #linux-sunxi
apritzel has joined #linux-sunxi
kilobyte_ch has quit [Server closed connection]
kilobyte_ch has joined #linux-sunxi
obbardc has quit [Server closed connection]
obbardc has joined #linux-sunxi
gamiee has quit [Server closed connection]
gamiee has joined #linux-sunxi
apritzel has quit [Ping timeout: 480 seconds]
hentai has quit [Remote host closed the connection]
hentai has joined #linux-sunxi
Daaanct12 has joined #linux-sunxi
Daanct12 has quit [Ping timeout: 480 seconds]
baltazar has joined #linux-sunxi
Daaanct12 has quit [Read error: Connection reset by peer]
Daaanct12 has joined #linux-sunxi
jelly has quit [Server closed connection]
jelly has joined #linux-sunxi
megi has quit [Server closed connection]
megi has joined #linux-sunxi
Arthur[m]123 has quit [Server closed connection]
Arthur[m]123 has joined #linux-sunxi
samueldr has quit [Server closed connection]
samueldr has joined #linux-sunxi
Daaanct12 has quit [Ping timeout: 480 seconds]
chuang[m] has quit [Server closed connection]
chuang[m] has joined #linux-sunxi
<baltazar>
hi! I'm using a nanopi neo (allwinner h3 based), and I'm not sure how to enable uart1 and uart2.
<baltazar>
am I supposed to create a device tree overlay?
<gamiee>
baltazar: if your OS supports that, then yes. Else you need to modify device tree
<baltazar>
if so, how is that done?
<baltazar>
gamiee: I assume linux supports them
<gamiee>
Sorry, I meant distribution
<baltazar>
oh, well, I'm not sure. I'm on archlinuxarm
<gamiee>
No idea about archlinuxarm if it supports dt overlays. Then modifying the device tree is best bet
<baltazar>
is dt support really distro dependent?
<gamiee>
dt overlay, yes
<baltazar>
alright, thanks
<gamiee>
Or I might be wrong
<baltazar>
welp
<gamiee>
I was working with it very long time ago, but as far as I remember, in Armbian, it works by way that u-boot applies dt overlays into final device tree, which is afterwards loaded by kernel.
<gamiee>
Anyway, if you want to enable uart1 and uart2, just decompile current used .dtb to .dts, and enable them.
<gamiee>
and again convert it back to dtb
<baltazar>
yeah, well I tried applying it from u-boot, but it didn't work (can't remember the exact error)
<baltazar>
I mean, I might have messed up the overlay itself, I really don't know how this is supposed to work
<baltazar>
but this is what I have, based on how uart0 is enabled in the device tree sources: http://ix.io/3TvF
<gamiee>
overlays are made bit differently
<gamiee>
anyway, best is to just edit dtb directly
<baltazar>
but that sounds like a pain to update
<baltazar>
I mean, probably device trees don't get updated very often, but still
<gamiee>
well, if you plan to make many changes (and you want to be able to enable / disable it between reboots), dt overlay is needed
<baltazar>
and that's why I wrote my device tree overlay like I did, and if I compile it with dtc into a tdbo, printing it with dtc again shows something similar to the example in the u-boot docs you linked
<baltazar>
this is the output of `dtc enable-uart.dtbo`: http://ix.io/3TvH
<baltazar>
although I'm not sure why it has the actual references inside __fixups__ instead of having them in target or pinctrl-0
<baltazar>
oh, apparently if I compile then dump the u-boot example it looks exactly like that; the references are moved to __fixups__
<baltazar>
however, in u-boot, if I do `load ${devtype} ${devnum}:1 ${fdtoverlay_addr_r} ${bootdir}/enable-uart.dtbo` then `fdt apply ${fdtoverlay_addr_r}` it fails with the error `failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND`
<gamiee>
afk, will reply within 45 mins
<baltazar>
bah, I based my thing on how uart0 was configured, but its pinctrl parameter is called &uart0_pa_pins, unlike uart1&2's which is called &uart1_pins and &uart2_pins
<baltazar>
and I just blindly copied the config and only changed the number
<baltazar>
now it applies successfully in u-boot
apritzel has joined #linux-sunxi
Hypfer is now known as Guest404
Guest404 has quit [Read error: Connection reset by peer]
Hypfer has joined #linux-sunxi
rajkosto has joined #linux-sunxi
<gamiee>
back
rajkosto has quit [Read error: Connection reset by peer]
rajkosto has joined #linux-sunxi
rajkosto has quit [Remote host closed the connection]
<apritzel>
which brings up the question: should there be a repository for those rather common overlays?
<apritzel>
and should we simplify applying them in U-Boot? Like: "apply all .dtbo files in this directory"
<gamiee>
apritzel: I think simplified usage of overlays in u-boot would be amazing
<apritzel>
gamiee: what about: fdt apply_all mmc 0:1 overlays
<apritzel>
as in: fdt apply_all <ifname> <dev_part_str> [directory]
<baltazar>
apritzel: yeah, that would simplify usage a lot
<baltazar>
and yeah, an overlay repository would be pretty useful as well, but I'm not sure how generic you could make it. as I just learned, the naming of these references isn't very consistent
<baltazar>
at least it would surely be useful for people like me who want to figure out how to create such an overlay. I couldn't really find any straightforward examples, I only managed to put this together based on that linux kernel docs page and the original device tree sources
JohnDoe_71Rus has quit []
cnxsoft1 has quit []
<apritzel>
baltazar: well, overlays are board specific, not only because of the references
<apritzel>
or at least SoC specific, I guess
<baltazar>
apritzel: well, I kinda imagine maintaining such a repo for every individual board would be close to impossible. not to say it wouldn't be cool tho
Asara has quit [Ping timeout: 480 seconds]
Asara has joined #linux-sunxi
ftg has joined #linux-sunxi
hlauer has quit [Ping timeout: 480 seconds]
<jernej>
gamiee: applying DT overlays is extremely simple, if you're using PXE boot
<jernej>
you just list path to all overlays you want to apply in config file
vagrantc has joined #linux-sunxi
<jernej>
note, this DT overlay handling is custom U-Boot extension, so it's not portable
<jernej>
while I see why would be mechanism to apply all overlays from specified directory useful in some cases, I think it's easier for distros to ship all board/soc specific overlays and you just list those that you want in some file
<jernej>
we're using that in LE
vagrantc_ has joined #linux-sunxi
vagrantc has quit [Ping timeout: 480 seconds]
vagrantc_ is now known as vagrantc
<apritzel>
jernej: too late ...
<apritzel>
I implemented what I sketched above
<apritzel>
not sure why this was there for PXE, but not for filesystems/block devices, which are probably more used
<apritzel>
the plan would be to have a directory where users just drop the .dtbo files they want to have applied, and then: