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*
specing_ has joined #linux-sunxi
<pnill> oh I was just running the menuconfig
<pnill> and making the serial stuff be compiled in
<pnill> would that not work?
<pnill> Like on the linux-sunxi wiki
specing has quit [Ping timeout: 260 seconds]
specing_ is now known as specing
<pnill> that's what it looks like it's doing
<apritzel> yeah, that's the old way: you select fixed configs and then load the modules
<pnill> oh, if you build it in via "Y"
<pnill> do you still need to load a module
<pnill> cool :D
<pnill> that's the same thing I did there with the defined CONFIG_SUN50I_GEN_H6
<pnill> so,
<pnill> is it bad to do it the old way?
<pnill> it seems less involved, and considering I'd only care for the serial for now
<pnill> would it at least *work?
<pnill> *work*
<pnill> also, you work for ARM?
<apritzel> yes, and yes
<pnill> yes to it's bad or yes to it'd work? lol
<apritzel> both
<pnill> haha.
<pnill> it's bad because it only allows for one thing vs multiple I'm guessing?
<apritzel> I think this was one of the restrictions
<apritzel> also I think multiple instances of the same device are a problem
<pnill> I don't think I should need that and was just trying to get quick access to the other PCB to see what was going on
<pnill> and serial is all but broken on it
<pnill> When I say the 'modern' method is more involved I just don't have /sys/kernel/config like the article you linked mentions
<pnill> I have a really slimmed down fs with nothing but busybox in it
<apritzel> /sys/kernel/config is a virtual fs
<apritzel> you just mount it
<apritzel> like sysfs or procfs
<pnill> it's part of the kernel?
<apritzel> yes
<pnill> ohhhh ok
<pnill> yeah, I've never dealt with any of this before.
<apritzel> it's just an easy way to communicate between userland and kernel
<apritzel> actually one that doesn't require any tools
<apritzel> just a shell is all you need, or a script
<pnill> yeah, so you can't compile it into the kernel itself instead of doing it from the shell?
<pnill> or am I misunderstanding
<apritzel> yes, you have the building blocks in the kernel, and configure them from userland
jbrown has quit [Ping timeout: 260 seconds]
<apritzel> you know, in the 21st century normal people don't compile their kernel anymore, they just use a distro version
<pnill> haha
<pnill> Which is why I don't understand any of this :P
<pnill> Hopefully will have a better idea of it all after all of this though.
<pnill> I mostly work on the userland side of things.
<pnill> very minimal kernel stuff, and most of it was windows.
<apritzel> well, then it should be much easier to use the configfs gadgets
<pnill> Touché
<apritzel> look at the white box in the Collabora blog I linked above
<apritzel> it's really like you plug together your USB device
<apritzel> once you wrapped your head around, you don't want to go back
<pnill> yeah lol
<pnill> I guess I should do it that way and build an init script then
<pnill> to handle creating it
<pnill> in my initramfs
<apritzel> yes
<pnill> but I still have to compile the support into the kernel right?
<pnill> (including editing the dtb to set it to otg vs host)
<apritzel> if you compile your own kernel: probably
<pnill> I didn't know using another was an option, lol.
<apritzel> if you have a micro-B socket on the board, it should really be otg to begin with
<pnill> When I started on this, I assumed custom kernel, custom dtb, custom u-boot, custom initramfs
<pnill> so I just compiled it all from source/built a really basic initramfs after doing some research
<apritzel> that's the old embedded approach, yes
<pnill> haha.
<pnill> I guess I just assumed nothing was going to work out of the box
<apritzel> Linux redbridge.cave 5.8.0-44-generic #50~20.04.1-Ubuntu SMP Thu Feb 11 07:01:18 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
<apritzel> works marvellously fine on some custom A64 board
jbrown has joined #linux-sunxi
<apritzel> and everything is just a modprobe or apt-get away
akaWolf has quit [Ping timeout: 252 seconds]
<apritzel> (also it's the exact same kernel that runs on that 224 core server at work)
apritzel has quit [Ping timeout: 245 seconds]
<pnill> hmm,
<pnill> mkdir: can't create directory 'f': No such file or directory
<pnill> in /sys/kernel/config
<pnill> guess I have more research to d
<pnill> *do
Mangy_Dog has quit [Ping timeout: 240 seconds]
<pnill> So, it shows the drivers, https://pastebin.com/raw/kniDLBxx
camus has joined #linux-sunxi
kaspter has quit [Ping timeout: 268 seconds]
camus is now known as kaspter
lucascastro has quit [Ping timeout: 252 seconds]
cnxsoft has joined #linux-sunxi
victhor has quit [Ping timeout: 240 seconds]
chewitt has joined #linux-sunxi
chewitt has quit [Quit: Adios!]
jernej_ has joined #linux-sunxi
buzzmarshall has quit [Remote host closed the connection]
jernej has quit [Ping timeout: 248 seconds]
jernej_ is now known as jernej
chewitt has joined #linux-sunxi
vagrantc has quit [Quit: leaving]
jernej has quit [Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net]
jernej has joined #linux-sunxi
<pnill> Can't get the linux gadget working, everything goes fine on the device side but it never shows up.
<pnill> I don't understand I figure if there was an issue it'd error or something at the very least but even using my mac nothing in lsusb or dmesg
<pnill> tried setting it to peripherial in the dtb, and otg as well
<pnill> also configuring it via configfs like apritzel suggested
<pnill> something weird though
<pnill> [ 65.694211] configfs-gadget gadget: adding 'cdc_ethernet'/(____ptrval____) to config 'c'/(____ptrval____)
<pnill> not sure wtf is going on there.
<pnill> the only things that make sense to me are that I screwed something up with the dtb, or because I'm booting over FEL the USB controller is left in a bad state or something, or I did something wrong with the kernel
<pnill> peripheral
<pnill> dr_mode shows peripheral
<pnill> before it showed otg
akaWolf has joined #linux-sunxi
<pnill> Hmm USB in general seems broken, I tried plugging in a USB stick and it doesn't show in dmesg or in lsusb
<pnill> (with dr_mode set to host)
anarsoul|c has joined #linux-sunxi
<pnill> I guess it's pinctrl issues again related to power settings
<pnill> or at least assume that based on digging through dmesg
apritzel has joined #linux-sunxi
<pnill> well, fixing the initial pinctrl power stuff broke my busybox shell but made the errors stop appearing... still have usb_phy_generic.2.auto: supply vcc not found, despite putting a bunch of stuff under usbphy2 like vcc-supply in my dtb.
<pnill> also, hi apritzel: Idk if you're able to see backlog or something since you seemed to have timed out but I got configsys stuff working, setup a gadget and such but it wasn't showing on my system so I tried just putting things to 'host' and plugging a usb stick in but it doesn't show up at all...
<pnill> There were no errors when using the gadget, it all seemed to init perfectly fine... but still no luck.
<pnill> and now no luck getting USB working at all even in host with a usb stick, nothing in dmesg or lsusb
<pnill> The only thing I see in dmesg that I think could be related is, [ 2.134418] usb_phy_generic usb_phy_generic.2.auto: supply vcc not found, using dummy regulator
reinforce has joined #linux-sunxi
cmeerw has joined #linux-sunxi
cmeerw has quit [Ping timeout: 250 seconds]
apritzel has quit [Ping timeout: 240 seconds]
jbrown has quit [Ping timeout: 260 seconds]
jbrown has joined #linux-sunxi
<pnill> yeah, dunno what more I can do... looked at all the different dts to see if any applied vcc-supply or "vcc" for usbphy2, nothin... tried setting vcc under phy2 but still get that vcc not found looked at the source that grabs that thought it was just looking for "vcc" maybe I'm placing it in the wrong node.
<pnill> still dunno if that's the issue just making the assumption that it is and that it may be the reason why USB isn't working in general
<pnill> This is the dts I'm using.. http://sprunge.us/vAm7jA
<pnill> and this was the boot log:
<pnill> hmm also see "[ 0.247202] sun4i-usb-phy 5100400.phy: Couldn't request ID GPIO
<pnill> " without &pio line but &pio line is what broke busy box last time
<pnill> also .config from kernel http://sprunge.us/kARvdA
<pnill> I just enabled basically everything USB in a brute-force attempt at trying to make it work.
Daanct12 has quit [Remote host closed the connection]
Daanct12 has joined #linux-sunxi
warpme_ has joined #linux-sunxi
<chewitt> :D
camus has joined #linux-sunxi
matthias_bgg has joined #linux-sunxi
kaspter has quit [Ping timeout: 265 seconds]
camus is now known as kaspter
uis has quit [Quit: ZNC 1.7.5 - https://znc.in]
uis has joined #linux-sunxi
jbrown has quit [Ping timeout: 260 seconds]
jbrown has joined #linux-sunxi
apritzel has joined #linux-sunxi
<apritzel> pnill: there might be a power switch (some GPIO) that provides USB bus power
<apritzel> pnill: try to measure the voltage on the USB socket
pmp-p has quit [Ping timeout: 250 seconds]
pmp-p has joined #linux-sunxi
Guest73870 is now known as ric96
camus has joined #linux-sunxi
kaspter has quit [Remote host closed the connection]
camus is now known as kaspter
prefixcactus has joined #linux-sunxi
pmp-p has quit [Read error: Connection reset by peer]
atsampson has joined #linux-sunxi
ats_ has quit [Ping timeout: 250 seconds]
camus has joined #linux-sunxi
kaspter has quit [Read error: Connection reset by peer]
camus is now known as kaspter
akaWolf has quit [Ping timeout: 240 seconds]
pmp-p has joined #linux-sunxi
tnovotny has joined #linux-sunxi
kaspter has quit [Ping timeout: 265 seconds]
gsz has quit [Remote host closed the connection]
gsz has joined #linux-sunxi
victhor has joined #linux-sunxi
kaspter has joined #linux-sunxi
fl_0 has quit [Ping timeout: 240 seconds]
fl__0 has joined #linux-sunxi
Mangy_Dog has joined #linux-sunxi
Mangy_Dog has quit [Changing host]
Mangy_Dog has joined #linux-sunxi
choozy has joined #linux-sunxi
asdf28 has joined #linux-sunxi
prefixcactus has quit [Ping timeout: 260 seconds]
qCactus has joined #linux-sunxi
choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jernej has quit [Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net]
lucascastro has joined #linux-sunxi
jernej has joined #linux-sunxi
chewitt has quit [Quit: Adios!]
atsampson has quit [Ping timeout: 260 seconds]
specing has quit [Ping timeout: 252 seconds]
specing has joined #linux-sunxi
atsampson has joined #linux-sunxi
ats_ has joined #linux-sunxi
atsampson has quit [Ping timeout: 260 seconds]
tnovotny has quit [Read error: Connection reset by peer]
ElBarto has quit [Remote host closed the connection]
ElBarto has joined #linux-sunxi
wigyori has quit [Remote host closed the connection]
gsz has quit [Quit: Konversation terminated!]
TEKrantz has quit [Quit: Take my advice. I don't use it anyway]
reinforce has quit [Quit: Leaving.]
cnxsoft has quit [Remote host closed the connection]
victhor has quit [Remote host closed the connection]
gaston1980 has quit [Quit: Konversation terminated!]
gaston1980 has joined #linux-sunxi
cmeerw has joined #linux-sunxi
vagrantc has joined #linux-sunxi
wigyori has joined #linux-sunxi
matthias_bgg has quit [Ping timeout: 246 seconds]
kaspter has quit [Ping timeout: 240 seconds]
kaspter has joined #linux-sunxi
victhor has joined #linux-sunxi
qCactus has quit [Ping timeout: 252 seconds]
apritzel has quit [Ping timeout: 246 seconds]
JohnDoe_71Rus has joined #linux-sunxi
<pnill> apritzel: yeah, there's no power going to the USB ports.
lukedashjr has joined #linux-sunxi
luke-jr has quit [Ping timeout: 260 seconds]
lukedashjr is now known as luke-jr
hlauer has joined #linux-sunxi
s_frit has quit [Remote host closed the connection]
s_frit has joined #linux-sunxi
jbrown has quit [Ping timeout: 240 seconds]
charco_ has joined #linux-sunxi
jbrown has joined #linux-sunxi
kevans91_ has joined #linux-sunxi
lukedashjr has joined #linux-sunxi
ganbold has quit [Ping timeout: 246 seconds]
davidebeatrici has quit [Ping timeout: 276 seconds]
JuniorJPDJ has quit [Ping timeout: 276 seconds]
Jeremy_Rand_DT[m has quit [Ping timeout: 276 seconds]
clementp[m] has quit [Ping timeout: 276 seconds]
Peetz0r has quit [Ping timeout: 276 seconds]
charco has quit [Ping timeout: 276 seconds]
kevans91 has quit [Ping timeout: 276 seconds]
charco_ is now known as charco
luke-jr has quit [Ping timeout: 241 seconds]
Peetz0r has joined #linux-sunxi
JuniorJPDJ1 has joined #linux-sunxi
lukedashjr is now known as luke-jr
Jeremy_Rand_DT[m has joined #linux-sunxi
clementp[m] has joined #linux-sunxi
davidebeatrici has joined #linux-sunxi
choozy has joined #linux-sunxi
kaspter has quit [Ping timeout: 265 seconds]
kaspter has joined #linux-sunxi
victhor has quit [Remote host closed the connection]
ganbold has joined #linux-sunxi
fl__0 is now known as fl_0
jstein has joined #linux-sunxi
victhor has joined #linux-sunxi
apritzel has joined #linux-sunxi
JohnDoe_71Rus has quit [Quit: KVIrc 5.0.1 Aria http://www.kvirc.net/]
<apritzel> pnill: you can try to check the BSP kernel boot log or the original DTB for any hints on the USB bus power, it's most likely just a GPIO
buzzmarshall has joined #linux-sunxi
asdf28 has quit [Ping timeout: 246 seconds]
hlauer has quit [Ping timeout: 260 seconds]
jbrown has quit [Ping timeout: 260 seconds]
jbrown has joined #linux-sunxi
victhor has quit [Remote host closed the connection]
DuClare_ has quit [Ping timeout: 260 seconds]
<pnill> apritzel: [ 1.167808] get ehci0-controller, regulator_io is no nocare
<pnill> It does this for each controller, found that sort of odd.
<pnill> [ 1.638787] get ohci3-controller, regulator_io is no nocare
<pnill> [ 1.809574] get xhci-controller, regulator_io is no nocare
sunshavi has quit [Remote host closed the connection]
<pnill> this is the whole boot log, but I don't see a ton else happening
<pnill> I know in u-boot I enabled twi0
<pnill> but I don't know how to do that in the linux kernel, I think that had something to do with power control but I really am not sure.
jstein has quit [Ping timeout: 268 seconds]
DuClare has joined #linux-sunxi
<pnill> So I'm assuming it's the usb_regulator_io = "nocare"
<pnill> unless it's usb_id_gpio,usb_drv_vbus_gpio from the original dtb.
choozy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<pnill> oh so I'm guessing usb_det_vbus_gpio in BSP is similar to usb0_id_det-gpios in mainline
<pnill> actually no, because usb_id_gpio is diffeernt from usb_det_vbus_gpio in bsp
<pnill> this is my original dts (usb portions)
<pnill> I'm not sure where to go from here 'porting' the dts
<pnill> because I don't understand what each individual option is doing or what translates/has to be translated
<apritzel> pnill: the Allwinner DT is in general unfortunately mostly nonsensical
<apritzel> the drive VBUS GPIO is PL5, if I count correctly
<apritzel> it might be worth to try that
<apritzel> it's easy do do in U-Boot: "gpio set pl5"
<apritzel> then measure the voltage on the USB socket
akaWolf has joined #linux-sunxi
<apritzel> USB ID GPIO is the sense pin that tells the system whether a host or a device cable is connected, on a micro B socket, for instance
<apritzel> pnill: if that works (try toggling the line as well), then you need something like reg_usb1_vbus in sun50i-a64-orangepi-win.dts (random example)
sunshavi has joined #linux-sunxi
<pnill> so the weird thing is, I thought the usb was working in u-boot
<pnill> because the OTG stuff was somewhat working
<pnill> OTG/Gadget
<pnill> in U-Boot
<apritzel> USB host and USB gadget are completely separate in U-Boot
<pnill> So I'm wondering if gpio set pl5
<pnill> would drive power to a single port or two of em
<pnill> Like idk if the microusb is wired to a separate controller
<pnill> trying to boot u-boot right now so I can do the 'gpio set pl5' and measure voltage.
<apritzel> yes, micro USB is controller 0, otherwise FEL and gadget wouldn't work
<apritzel> so that is clear
<apritzel> how many other USB sockets do you have?
<apritzel> and for USB power you have all possibilities: all ports always-on, one port switchable, all ports switched by the same GPIO, ...
<pnill> microusb and 2x standard
<pnill> but within u-boot
<pnill> I see voltage
<pnill> after issuing gpio set pl5
<pnill> should I try setting it to 0
<pnill> and see if It drops?
<pnill> I didn't test it before running it
<apritzel> yes, try everything
<apritzel> "gpio toggle pl5"
<apritzel> if I understand their weird DT correctly, it looks like it powers the OTG port and one USB port, the other should be always powered
<apritzel> and you also have an ID pin, apparently, so the micro B is a fully functional OTG socket
<pnill> well the OTG port is 1.Xv without pl5 set
<pnill> with pl5 set it's 5.5v
<pnill> other two are like 0.00XXv so basically not powered
<pnill> and 5.5v with pl5 set
<apritzel> both of them?
<pnill> yeah
<pnill> but maybe it's possible they use this other interface to expand the USB
<pnill> like this other 'control board' plugs in
<apritzel> other interface?
<pnill> and has some buttons on it
<pnill> so I'm wondering if that's utilzing the usb bus some how.
<pnill> Idk pinout doesn't look like USB though
<pnill> it actually is labeled urx1/utx1 utx3/urx3
<apritzel> but at least you found the USB issue now, didn't you? You need to copy the reg_usb1_vbus node from sun50i-a64-orangepi-win.dts (for instance)
<pnill> yeah..., and ok I'll try that
<apritzel> (and reference that node from the &usbphy node at the bottom
<pnill> thanks man, would've been totally lost on this without your help
<apritzel> there you can also add the ID GPIO (PC6)
cmeerw has quit [Ping timeout: 260 seconds]
<pnill> so it'd be gpio = <&pio 11 05 GPIO_ACTIVE_HIGH> right?
warpme_ has quit [Quit: Connection closed for inactivity]
<pnill> so ID pin PC6 so (3 6) and then the usb1-vbus stuff
<apritzel> ah, sorry, PL..PM are special snowflakes ...
<pnill> I have pio commented out in my uhh dts as well
<pnill> because it messed up my busybox shell some how, it never initiated with it enabled not sure what was up there
<apritzel> <&r_pio 0 5 GPIO_ACTIVE_HIGH>
<apritzel> you won't get very far with pio disabled ;-)
<apritzel> you mean you didn't override it in your board .dts?
<pnill> yeah
<pnill> that's what I mean
<pnill> didn't realize it was in the dtsi that gets inherited as well
<apritzel> "pio" controls all pins (not only GPIO!), without that literally nothing would work
qschulz has quit [Remote host closed the connection]
<apritzel> the input power rails in the &pio override should be mostly optional, that's nothing to worry about now, just remove it
qschulz has joined #linux-sunxi
<pnill> apritzel: Looks like they are working now.
<pnill> hopefully OTG works now
<apritzel> oh, and to get USB working automatically in U-Boot, you need to add 'CONFIG_USB1_VBUS_PIN="PL5"' to your _defconfig
<pnill> So... for some reason I thought fixing that USB issue was going to fix my gadget issue.
<pnill> apparently not lol
<pnill> still no gadget on my host after configuring through configfs
<pnill> USB drives work now, but OTG Gadget for ethernet still doesn't pop on my host machine
<apritzel> did you try dr_mode = "peripheral"; ?
<pnill> I did prior to fixing the usb, let me try that now
<apritzel> "otg" should be the correct entry, when you add: usb0_id_det-gpios = <&pio 2 6 GPIO_ACTIVE_HIGH>; /* PC6 */
<apritzel> but peripheral forces device mode, so it's a good test
diego71 has quit [Ping timeout: 252 seconds]
<pnill> yeah, nothing
<pnill> same output as the pastebin above
<pnill> in peripheral
paulk-leonov has quit [Ping timeout: 252 seconds]
<pnill> sys/firmware/devicetree/base/soc/usb@5100000# cat dr_mode peripheral
paulk-leonov has joined #linux-sunxi
<apritzel> well, that looks alright, maybe it's something general with the gadget setup?
<pnill> Not sure... unless it's something like that stuff with u-boot where a specific return was given but it doesn't show any errors
<pnill> and I turned on as much of the debugging stuff as I could
<pnill> otherwise, my only theories were... FEL breaking it.
<pnill> because it breaks the controller or USB stack or something before it makes it to kernel
<pnill> but then I would think U-Boot gadget wouldn't have worked at all (even showing "malfunctioning device") previously
<pnill> I thought maybe it was windows, but last night tried it on mac and that didn't see anything show up either.
<pnill> lsusb/dmesg showed nothing at all
<apritzel> pnill: oh, btw: did you try the USB mass storage gadget in U-Boot? CMD_USB_MASS_STORAGE=y, then "ums 0 mmc 1"?
<pnill> no, I didn't try that...
<apritzel> that exports the eMMC as a USB drive, from U-Boot
<pnill> I thought about that being another way to potentially modify the files of the original thing..
<pnill> instead of having to do it with a script in the kernel
<pnill> or linux/side not really kernel
<apritzel> doesn't help you so much with Windows users, though
<pnill> Oh, it'd mount with the original fs wouldn't it?
<pnill> I guess that makes sense.
<apritzel> as you would need to mount an ext4 partition ...
<pnill> I'm just wondering why this gadget isn't working it'd be really convenient lol
<apritzel> ums just exports the whole eMMC as a block device
<pnill> hmm
<pnill> other option instead of gadget.. USB ethernet adapter at least for me to troubleshoot it.
<pnill> on the other PCB where I don't have serial
<pnill> just wish gadget would work
<pnill> and don't get why it doesn't... like windows doesn't seem to even do the "malfunctioning" thing it did with u-boot
<pnill> it just acts like nothing was connected at all
<pnill> and dmesg doesn't show anything either on the board
<pnill> I remember reading on a forum someone mentioning dmesg was throwing a log when they disconnected/connected from the port that was doing the gadget
<pnill> oh well that's odd..
<pnill> apritzel: I was able to connect a device to the micro-usb port and it was recognized.
<pnill> shouldn't that not be possible if dr_mode = peripheral
vagrantc has quit [Quit: leaving]
<pnill> like it should be set to that mode instead of the other
<pnill> host vs peripheral or at least that's what I thought
<pnill> like I know otg, it should only be 'dual' mode
<pnill> but peripheral I thought you couldn't even plug in USB sticks or etc.
<apritzel> no idea
<pnill> and I don't think it's the board..
<pnill> because the gadget setup worked in u-boot
<apritzel> have you tried any other USB gadget in Linux?
<apritzel> like a serial port?
<pnill> no, just that one from the collabora blog post
<pnill> let me try others.
<apritzel> I think serial is both easy and useful
<pnill> yeah, serial does nothing either...
<pnill> the configfs-gadget text comes out on dmesg
<pnill> but host never sees anything
<pnill> kinda sucks, but I guess I have other ways to try and troubleshoot now
<pnill> like if I can get ssh in my initramfs and have it auto configure an ethernet adapter
<pnill> or something
<pnill> that kind of sucks
<pnill> that it gives no like log or anything of why it wouldn't be working
<pnill> and just doesn't work
jbrown has quit [Ping timeout: 260 seconds]
jbrown has joined #linux-sunxi
diego71 has joined #linux-sunxi