Posterdati has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/]
brook_ has joined #beagle
brook_ has quit [Read error: Connection reset by peer]
brook_ has joined #beagle
brook_ has quit [Read error: Connection reset by peer]
brook has quit [Ping timeout: 260 seconds]
brook has joined #beagle
vagrantc has quit [Quit: leaving]
brook has quit [Ping timeout: 268 seconds]
hnv has quit [Quit: Client closed]
brook has joined #beagle
hnv has joined #beagle
Stat_headcrabed has joined #beagle
Shadyman has joined #beagle
buzzmarshall has quit [Quit: Konversation terminated!]
zmatt has quit [Server closed connection]
zmatt has joined #beagle
set_ has quit [Remote host closed the connection]
Stat_headcrabed has quit [Quit: Connection closed for inactivity]
philenotfound has quit [Server closed connection]
philenotfound has joined #beagle
mvaittin has joined #beagle
Abhishek_ has quit [Server closed connection]
Abhishek_ has joined #beagle
Tamarinen has quit [Quit: Tamarinen]
djinni has quit [Quit: Leaving]
Shadyman has left #beagle [#beagle]
Whiskey` has quit [Server closed connection]
CygniX has quit [Ping timeout: 252 seconds]
Whiskey` has joined #beagle
Stat_headcrabed has joined #beagle
rob_w has joined #beagle
djinni has joined #beagle
renrelkha has quit [Quit: bye]
renrelkha has joined #beagle
Posterdati has joined #beagle
denix has quit [Server closed connection]
denix has joined #beagle
mvaittin has quit [Ping timeout: 240 seconds]
ikarso has joined #beagle
mvaittin has joined #beagle
Stat_headcrabed has quit [Quit: Stat_headcrabed]
hnv has quit [Quit: Client closed]
Stat_headcrabed has joined #beagle
Stat_headcrabed has quit [Quit: Stat_headcrabed]
ft has quit [Quit: leaving]
rob_w has quit [Remote host closed the connection]
michaelo has quit [Server closed connection]
michaelo has joined #beagle
marcheu has quit [Server closed connection]
marcheu has joined #beagle
akaWolf has quit [Ping timeout: 268 seconds]
hnv has joined #beagle
hnv has quit [Quit: Client closed]
mvaittin has quit [Ping timeout: 268 seconds]
otisolsen70 has joined #beagle
mayab has joined #beagle
<zmatt> (you should definitely never define a phandle)
brook has quit [Remote host closed the connection]
brook has joined #beagle
florian_kc has quit [Quit: Ex-Chat]
CygniX has joined #beagle
jfsimon1981 has joined #beagle
ft has joined #beagle
ft has quit [Quit: leaving]
ft has joined #beagle
hnv has joined #beagle
<zmatt> hnv: what did you mean by "I should define the phandle anyway" ? you should definitely never assign a value to the "phandle" property of nodes, the dtc compiler deals with that
<zmatt> *the dt compiler (dtc) deals with that
<zmatt> whatever overlay enables the i2c bus should also attach appropriate pinmux to it
<zmatt> (or you can use runtime pin configuration using config-pin)
<zmatt> you can use my show-pins script to verify pin configuration: https://github.com/mvduin/bbb-pin-utils#show-pins
ikarso has quit [Quit: Connection closed for inactivity]
vagrantc has joined #beagle
<hnv> zmatt: about the phandle, I have that footnote wrong maybe. I was talking about the string? assigned to `pinctrl-0` that should match the label in `&am33xx_pinmux`
jfsimon1981 is now known as jfsimon
<hnv> I wrote the overlay and the physical part works. The bbb as i2c slave works fine, most of the time. My main issue is that I'm missing the first byte. `I2C_SLAVE_WRITE_RECEIVED` event arrives with the second byte; sometimes the first if I'm lucky. I have no clue. maybe there is an "no-idle" directive to add?
outrageous has joined #beagle
vagrantc has quit [Quit: leaving]
vagrantc has joined #beagle
jfsimon1981 has joined #beagle
xet7 has quit [Remote host closed the connection]
hnv has quit [Quit: Client closed]
hnv has joined #beagle
xet7 has joined #beagle
afd has joined #beagle
brook has quit [Read error: Connection reset by peer]
brook_ has joined #beagle
jfsimon1981 has quit [Remote host closed the connection]
hnv has quit [Ping timeout: 250 seconds]
<zmatt> sounds more like whatever this "slave patch" for the kernel driver is doing is broken
hnv has joined #beagle
<zmatt> note that multi-master is inherently broken in the omap i2c peripheral, but using it slave-only should iirc be fine
<hnv> There is only one master in this bus. The thing is, this master is so rude, it's constantly reading bytes, like "anything new?" like in a FreeRTOS task with no sleep/delay. It's achieving some sort of unintended "attack" and Opps-ing the subsystem and disabling the irq
<zmatt> (apart from the lockup bug where an sda glitch or certain other protocol errors causes the peripheral to no longer respond to slave address nor initiate any master transaction)
<zmatt> hnv: well, that doesn't matter with i2c since the am335x will simply stretch the clock
<zmatt> if the master is going too fast
<zmatt> oh ew I found some old messages, I found more issues with the omap i2c peripheral in slave mode
<zmatt> a fragment from an old message I wrote: https://pastebin.com/s1QJg9fq
<zmatt> an oops is a kernel bug, though since you've applied an unofficial patch and are testing with a custom driver I'd say those are the most likely candidates for being responsible for the oops
<zmatt> looks like an i2c transfer was started whose data was a NULL pointer?
<zmatt> regardless, if this master is constantly performing reads then you really don't want to handle this in linux since your system will be frozen, I'd say use PRU instead.
<zmatt> as in, have PRU service the I2C controller that's operating in slave mode... it will have no trouble keeping up with it
<zmatt> brb
<hnv> I would love to, but I'm a bit rusted with the PRUs
<hnv> "I2C controller" in the silicon or in the kernel/module?
<zmatt> silicon
<zmatt> i2c is so slow that it wouldn't matter if you take the performance hit of programming the PRU core in C instead of asm :P
<hnv> And who is going to configure the controller, the PRUs? or using UIO? or some other driver?
<hnv> (if the controller takes care of the slave state machine it will be great)
<zmatt> many years ago I did quite extensive testing of TI's i2c controller, I had a perfect environment for it with a baremetal Forth on the SoC that allows me to interactively poke the peripheral while logging changes in irq status and on the bus I had a microcontroller running a simple i2c debugger I wrote which could log i2c bus activity in real time (using clock stretching as needed to slow it down) as ...
<zmatt> ...well as having a mode where I could single-step i2c transactions bit for bit
<hnv> awesome.
<zmatt> here are the notes I wrote, showing detailed i2c controller behavioured in various examples and corner cases: https://pastebin.com/rrphk18q
<zmatt> but yeah, the controller takes care of a lot of it
<zmatt> if you only need to support i2c reads then the only case you'll ever see is the very first one listed, "slave transmitter"
<zmatt> so what is the master reading, what data are you sending in response?
<zmatt> like, is this data the PRU could easily produce? (e.g. read a fixed buffer in memory)
aussetg has quit [Server closed connection]
aussetg has joined #beagle
afd has quit [Quit: Leaving]
<hnv> Yeah, I think. apart from constantly reading for any news from the slave, the master writes something like `size, -question-, checksum, stop` and the slave stops transmitting "nothing new", and sends `size, checksum, stop`,`-answer-, checksum, stop`. There are multiple questions and answers I'm trying to figure up. I have the actual slave too.
<hnv> There are multiple questions, and I was using hashtables for that. But I can switch to a fixed buffer I guess
<zmatt> ah okay so it's not just reads
otisolsen70_ has joined #beagle
otisolsen70 has quit [Ping timeout: 255 seconds]
<zmatt> well okay so the code won't be completely trivial, but it's still pretty straightforward. like, you get an event when addressed as slave and you'll either get bytes of data for a write or you'll be expected to provide bytes of data for a read
<zmatt> assuming the work of preparing data to be read is done when the write is performed, the read is presumably trivial
otisolsen70_ has quit [Remote host closed the connection]
set_ has joined #beagle
<zmatt> I'm looking at some bare metal code I wrote... initialization appears to be like 10 lines of code
<zmatt> or less
<zmatt> writing this code in PRU is probably simpler than debugging whatever is going on in the linux kernel :P
<zmatt> and as a bonus you'll have something that can actually tolerate getting spammed by the master
<hnv> A long time ago, I wrote the initialization for the spi0 on C and share it to the PRU through shared memory
<hnv> Yeah, I was starting to set up kgdb
<zmatt> what bus speed are you using? 100 kHz ?
<hnv> yes
<zmatt> so 2000 pru clock cycles per bit... like, PRU will have no problem handling any event before the next clock edge
<zmatt> which also eliminates most headaches of this controller (like the possibility of losing track of which bytes belong to which transaction obviously doesn't apply)
<zmatt> bbl