Pali has quit [Ping timeout: 268 seconds]
Daaanct12 has joined #maemo-leste
Daaanct12 has quit [Ping timeout: 240 seconds]
Daaanct12 has joined #maemo-leste
Daaanct12 has quit [Ping timeout: 260 seconds]
Daaanct12 has joined #maemo-leste
Daaanct12 has quit [Quit: Leaving]
joerg is now known as DocPyrolyser
DocPyrolyser is now known as joerg
Daaanct12 has joined #maemo-leste
Daaanct12 has quit [Ping timeout: 268 seconds]
<tmlind> Wizzup: so the MASTER_USBHOSTHS corresponds to ohci/echi, so usbhshost in omap4-l4.dtsi, seems that on low battery mdm6600 shuts down, and the usb phy is on the mdm6600 causing invalid access to the phy, or at least that's my guess
<tmlind> seems like usbhs_omap_remove() or similar should get called to remove the related phys at that point
<tmlind> freemangordon: to me it seems that usb gadget framework should add/remove a vbus regulator as needed telling the max current, then chargers could try to get it and check the max current after connecting.. somehow the regulator should be drivers/phy instance specific though.. just trying to think of ideas how it could be done
joerg has quit [Killed (erbium.libera.chat (Nickname regained by services))]
joerg has joined #maemo-leste
n900 has quit [*.net *.split]
r3boot has quit [*.net *.split]
r3boot has joined #maemo-leste
n900 has joined #maemo-leste
Daaanct12 has joined #maemo-leste
sicelo has quit [*.net *.split]
MartijnBraam[m] has quit [*.net *.split]
mighty17[m] has quit [*.net *.split]
sicelo has joined #maemo-leste
sicelo has quit [Changing host]
sicelo has joined #maemo-leste
mighty17[m] has joined #maemo-leste
MartijnBraam[m] has joined #maemo-leste
Daaanct12 has quit [Ping timeout: 260 seconds]
mardy has joined #maemo-leste
<freemangordon> tmlind: and what about just adding second notifier that is dedicated to chargers?
<freemangordon> hmm, wait. don;t we already have a regulator for vbus?
<freemangordon> so, what about gadget asking phy for the regulator and setting the max current on it>
<freemangordon> ?
<freemangordon> phy can do as well, if needed
<freemangordon> and ti is needed, in host mode
<freemangordon> so, phy core can register some "usb-charger" regulator and this can be used by chargers to limit the current and gadgets or phy itself to set the current limit
<freemangordon> do you like that?
<freemangordon> I just wonder if it should be only one, global, regulator or per phy
<freemangordon> ah, you said it should not e global
<freemangordon> well, phy_create() can create a dummy regulator based on device name or some other string (phy label?)
xmn has quit [Ping timeout: 252 seconds]
norayr has left #maemo-leste [Disconnected: timeout during receiving]
xmn has joined #maemo-leste
xmn has quit [Quit: ZZZzzz…]
Twig has joined #maemo-leste
<tmlind> yeah that vbus regulator could be common to the phy framework maybe, then gadget would somehow set max value, then charger could query it..
<tmlind> or how about add phy_set_charge_current() and phy_get_charge_current() ?
<freemangordon> we already have that
<tmlind> oh we do?
<freemangordon> usb_phy_get_charger_current
<freemangordon> and usb_phy_set_charger_current(
<freemangordon> I was about to add regulator in usb_phy struct
<tmlind> ok but that's specific to the old drivers/usb/phy and won't work with drivers/phy?
<freemangordon> is it?
<tmlind> i think so, it's a different old framework for drivers/usb/phy
<freemangordon> cpcap phy calls usb_add_phy_dev()
<freemangordon> is this obsolete too?
<tmlind> oh not sure
<tmlind> it might be legacy needed for musb still
<freemangordon> what I see is that usb_phy is used all over the place
<tmlind> ok maybe it's still the way to go
<freemangordon> so, what I think is:
<tmlind> vbus_get_charge_current(phy) vbus_set_charge_current(phy) ?
<freemangordon> add regulator in usb_phy and create it in usb_charger_init()
<tmlind> so how do you map a phy instance to that particular vbus regulator?
<freemangordon> usb_charger_init is called by usb_add_phy_dev and usb_add_phy_dev
<tmlind> or vbus supply..
<freemangordon> vbus supply is another regulator
<freemangordon> this one is $device_name-charger or something
<freemangordon> and is a member of phy struct
<freemangordon> so chargers can either use regulator framework to register notigier on it
<freemangordon> or we can have usb_charger_notifier_register() function
<tmlind> hmm so looks like there's common vbus-supply devicetree property
<freemangordon> and in DTS we set the phy on the charger
<freemangordon> there is
<freemangordon> but it is not what we need
<tmlind> ok
<freemangordon> IIUC
<freemangordon> maybe I am wrong
<freemangordon> but, this supply is the one that exists in the device, no?
<freemangordon> why we want some dummy regulator used to carry the min/max current
<tmlind> Documentation/devicetree/bindings/connector/usb-connector.yaml
<tmlind> documents vbus-supply
<freemangordon> ok, but this is the internal supply, no?
* freemangordon reads the docs
<tmlind> compatible = "usb-b-connector"
<freemangordon> hmm
<tmlind> not sure what is handling it, but cpcap-charger could query it
<freemangordon> I dont think anyone uses that, lemme grep
Pali has joined #maemo-leste
<tmlind> cpcap-charger must not try to claim it on init though.. loading the phy should be optional, otherwise assume 500mA max current if regulator not available
<freemangordon> sure
<freemangordon> the same as in wm831x driver
<tmlind> ok
<freemangordon> so, if devm_usb_get_phy_by_phandle() fails, we just assume 500mA
<tmlind> looks like we may just need to add the usb-b-connector node as a child of the usb or the phy
<Wizzup> tmlind: I see, it clearly was proceeded by an empty battery warning, but it looks like what triggered it was the modem dropping off?
<freemangordon> who is going to set that?
<Wizzup> oh, you wrote that too.
<freemangordon> tmlind: hmm, this is usb-conn-gpio.c
<freemangordon> so this vbus-supply is specific to this driver, no?
<freemangordon> we still have that and I see no signs of it being obsolete
<freemangordon> but what do I know :)
<freemangordon> still, with soma small fixes this can be made to use a dummy regulator
<freemangordon> and everything will start working
<freemangordon> the real issue right now is that code currently uses the same atomic notifier as what gadget network uses to report VBUS state
<freemangordon> s/gadget network/gadget framework
<freemangordon> so my idea is to fix that by doing regulator_get() (that creates dummy regulator) in usb_charger_init()
<freemangordon> and then usb_charger_notifier_register() registering notifier on that regulator to be used by charger
<freemangordon> or, simply adding second notifier to the phy
<tmlind> seems like there are multiple drivers setting up a usb connector: git grep -C20 usb-b-connector arch/arm*/boot/dts
<freemangordon> sure
<freemangordon> but this is gpio based charger detection
mardy has quit [Read error: Connection reset by peer]
<freemangordon> IIUC
<tmlind> well adding gpio support for connect and vbus to cpcap would be trivial, it has all kind of gpios anyways
<tmlind> we're just not using them right now
* freemangordon is looking in usb-conn-gpio.c
<tmlind> seems like to use that we should add drivers/gpio/gpio-cpcap.c, the gpio code for cpcap is there in the v3.0.8 android kernel
<freemangordon> tmlind: umm, I don;t get that, like, how we are goping to detect ACA by using gpios?
<freemangordon> or even a simple charger?
<freemangordon> for ACA we have to do voltage measurement
<freemangordon> android kernel uses switch driver for charger detection == extcon
<freemangordon> maybe I don;t understand the idea
<tmlind> hmm what's aca?
akossh has joined #maemo-leste
norayr has joined #maemo-leste
<tmlind> some regulator somewhere to query would be still needed it seems
<tmlind> bbl, family
<freemangordon> tmlind: "Accessory Charger Adaptor"
<freemangordon> tmlind: ok, I will create some small patch to have something to discuss :)
xmn has joined #maemo-leste
mardy has joined #maemo-leste
norayr has left #maemo-leste [Error from remote client]
<freemangordon> tmlind: this https://pastebin.com/WfVwFwYL
uvos has joined #maemo-leste
xmn has quit [Quit: ZZZzzz…]
norayr has joined #maemo-leste
xmn has joined #maemo-leste
uvos has quit [Quit: Konversation terminated!]
uvos has joined #maemo-leste
<sicelo> freemangordon: regarding my kernel size issue ... i build a kernel with plain omap2plus_defconfig. kernel size was exactly 5MB (i.e. 500kB less than before). the irq problem still happens. tbh, i doubt it's related to kernel size. plus, the only one with missing irq is musb. other drivers don't have the issue
<freemangordon> hmm
<freemangordon> I still think it is DTB related, but yeah, maybe it is not the size that bugs it
<freemangordon> uvos: tmlind: https://pastebin.com/S7wusWBf
<Wizzup> sicelo: is it always attached?
<Wizzup> (dtb)
<Wizzup> maybe you need to adjust the u-boot load addrs
<freemangordon> uvos: tmlind: this is the patch https://pastebin.com/xHpWzDth
xmn has quit [Ping timeout: 268 seconds]
<sicelo> Wizzup: yes i'm using attached dtb. Not sure how to make u-boot use a standalone dtb yet on n900, although that'd be a nice thing to have
<freemangordon> oh, and as a side effect now we have stable usb ethernet even when the battery is full :D
<freemangordon> Wizzup: ^^^
<Wizzup> freemangordon: that is so lovely, I'm so happy about that
<freemangordon> on the cons side - dumb chargers does not work :p
<Wizzup> really
<Wizzup> heh
<sicelo> dumb charger being?
<freemangordon> wall charger :)
* freemangordon hides
<sicelo> hehe
<sicelo> does not work - doesn't charge the device now?
<freemangordon> sure
<freemangordon> we need one more driver
<freemangordon> cpcap-extcon
<freemangordon> that detects wall chargers
<freemangordon> but, I want tmlind to confirm what I have done so far is correct
<freemangordon> as writing extcon driver from scratch is not a fun and if I am doing something wrong will be in vain
<freemangordon> which I want to avoid
<uvos> sicelo: so if you compile dtb and then decompile it again with dtc is the irq there?
<freemangordon> yes
<uvos> ok
<uvos> what about after attaching it, pull it back out of the uboot image
<uvos> maybe it gets messed up there
<sicelo> maybe ... but the question would then be - why it it's fine in 5.18.x, and not fine in 5.19.1 :-)
<sicelo> but yes, let me see if can find how to 'detach' it from uImage
<uvos> sicelo: no idea just thinking of steps, clearly somehow it gets ruined on the way to ram
<uvos> so some step in the process must be doing it
<freemangordon> uvos: attaching it to uImage is simply doing cat, so can't be this
<uvos> freemangordon: ok
<uvos> maybe sicelo has a broken flash cell in a inauspicious place
<freemangordon> I'd rather bet on u-boot allocating no enough RAM, or not reading the full uImage
<freemangordon> or not reading the full attached DTB
<freemangordon> Pali: ^^^
<freemangordon> any idea?
<uvos> sure maybe
<Pali> u-boot should be able to load separate zImage and separate DTB without any issue
<uvos> not really a reason to ignore it breaking uimage
<freemangordon> Pali: yeah, the point is that it seems it somehow breaks the attached DTB
<freemangordon> either u-boot or kernel
meldrian has joined #maemo-leste
meldrian has left #maemo-leste [https://quassel-irc.org - Chat comfortably. Anywhere.]
<Pali> You can enable CONFIG_DEBUG_LL and kernel starts printing debug info prior reading attached dtb to serial console
<Pali> serial console is available also in u-boot
<Pali> IIRC it prints attached dtb address and size
<Pali> so you can verify if the issue is in kernel code
<freemangordon> sicelo: ^^^
<freemangordon> that should help
<freemangordon> Pali: is ther some size limit on DTB?
<sicelo> the CONFIG_DEBUG_LL should be enabled in u-boot? or kernel?
<freemangordon> u-boot
<Pali> In past there was a DTB limit. And n900 dtb file triggered that limit, so it was increased
<Pali> in kernel
<freemangordon> maybe it triggered it again?
<Pali> it is part of zImage wrapper
<freemangordon> do you remember file was that limit in?
<Pali> it was in zImage wrapper, so some in arch/arm/boot/
<freemangordon> ok, thanks
<Pali> Also enable CONFIG_DEBUG_OMAP3UART3
<sicelo> unfortunately i don't have access to good/reliable serial. but let me first try with u-boot that has serial enabled, although i recall this just loses connectivity as soon as kernel starts
<Pali> right, this would not work. kernel prints only to UART, not to usb
<Pali> but you can test it in qemu
<Pali> qemu has working UART nad kernel CONFIG_DEBUG_LL can print to it
<sicelo> standard `qemu-system-arm`, or a special/n900 one?
<Pali> special n900 one
<Pali> linaro's qemu-system-arm
Twig has quit [Remote host closed the connection]
<sicelo> thanks very much
<sicelo> Pali: u-boot should be able to load separate zImage and separate DTB without any issue <--- how would one know which memory address to use for the dtb blob?
<Pali> you can use any unused address
<Pali> for example ${initrdaddr} if you are not going to use initrd
<Pali> e.g.: load mmc ${mmcnum}:${mmcpart} ${kernaddr} zImage && load mmc ${mmcnum}:${mmcpart} ${initrdaddr} dtb && bootz ${kernaddr} - ${initrdaddr}
<Pali> it boots zImage (not uImage)
<sicelo> thank you. i'll give this a try. charging the device for now
<freemangordon> uvos: could you please test the ^^^ patch, to see if it still crashes the device with 30mA limit
<uvos> freemangordon: yes
<uvos> i will
<freemangordon> ok, thanks
<freemangordon> that'd confirm I am on the right track
<uvos> i mean the implementation looks fine
<uvos> i just dont know if its the right way to do it
<uvos> so cant really comment on that
<freemangordon> sure, but if it fixes the issue...
<freemangordon> hmm...
<freemangordon> my a33 supports OTG
<freemangordon> I can test there
<uvos> freemangordon: reducing the current in sysfs
<uvos> also fixes the issue atm
<uvos> so i see no reason why the patch would not alos
<uvos> but i will test
<uvos> the device trying to pull 500mA just trippes the over current protection in xt1602 causing it to resett
<freemangordon> sure, but there might be some transitions or who knows what that'd break it still
norayr has left #maemo-leste [Disconnected: Replaced by new connection]
<freemangordon> tablet seems to provide 500 mA
norayr has joined #maemo-leste
Twig has joined #maemo-leste
akossh has quit [Ping timeout: 240 seconds]
uvos has quit [Ping timeout: 260 seconds]
norayr has left #maemo-leste [Disconnected: timeout during receiving]
elastic_1 has joined #maemo-leste
elastic_dog is now known as Guest6159
Guest6159 has quit [Killed (iridium.libera.chat (Nickname regained by services))]
norayr has joined #maemo-leste
mardy has quit [Quit: WeeChat 3.5]
norayr has left #maemo-leste [Error from remote client]
norayr has joined #maemo-leste
Twig has quit [Remote host closed the connection]
xmn has joined #maemo-leste