#qi-hardware IRC log for Saturday, 2011-06-25

stefan_schmidtwpwrak: Why do you have this line of code?00:00
stefan_schmidtprv = spi_master_get_devdata(master);00:00
stefan_schmidtprv is atben_usb and master gets in atben->master one line later00:01
stefan_schmidtprv->master = master;00:01
wpwrakbecause my private structure was allocated when i got the master00:01
stefan_schmidtI have seen this before in other drivers. Never understood00:01
wpwrakprv->master is my pointer back to the master. not sure if i actually need it ...00:01
wpwraksome spi foo00:01
stefan_schmidtwell, master is clear but devdata() to the atben struct looked odd00:02
wpwrakthat's what other spi drivers do. i didn't bother finding out if they're right ;-) (well, i looked mainly at the s3c24xx driver)00:02
stefan_schmidtyeah, I have seen it at other spi drivers as well but never understood why00:03
stefan_schmidtwell, lets keep it :)00:03
wpwrakspi_alloc_master gets the size of your "private" data block and allocates it for you00:03
wpwrakspi_master_get_devdata just give you the pointer to your area00:03
stefan_schmidtah!00:04
stefan_schmidtno I get it.00:04
stefan_schmidtI have a pointer to master in atben but the master driver needs a pointer to the private data (atben) as well00:04
stefan_schmidtmakes sense :)00:04
wpwrakthe pings are going strong: [ 3737.570000] at86rf230 spi2.0: PHR 0xaa >= buffer 128 bytes00:04
wpwrakthe master driver being spi_atben, yes00:05
stefan_schmidtcool00:05
wpwrakhow about this ? http://downloads.qi-hardware.com/people/werner/wpan/tmp/rssi-wlan-tees.png00:11
stefan_schmidtwpwrak: indicating wifi activity on this channels?00:12
wpwraktry it. atrf-rssi -g00:13
wpwrakit'll look more interesting on your machine00:13
wpwrak(my the atusb board i'm using is half-dead. can't wait to actually get some working boards on monday :)00:13
wpwraks/my//00:14
wpwrakthe blue tees are static. they indicate the US channel assignment. still have to add a means to switch to EU.00:14
stefan_schmidtfancy00:16
wpwrakactually need to shrink the lines a bit. otherwise they'd overlap with the EU assignment.00:16
stefan_schmidtthe "pikes" are data it sees on the channels?00:16
wpwrakthe peaks are just some signal. it doesn't try to demodulate, just measures the power00:17
stefan_schmidtouch, switching the workspace kills the sdl app :)00:17
wpwrakall very crude. super-simple spectrum analyzer00:17
stefan_schmidtyeah, sorry, wrong wording I meant signal not data00:17
stefan_schmidtwrong layer :)00:17
wpwrakswitching my virtual screens doesn't. you should use fvwm ;-)00:17
Action: stefan_schmidt thinks about is as to prepare some nice pictures for the thesis :)00:18
stefan_schmidtwpwrak: enlightenemnt e17 here00:18
wpwrakyour thesis will about meshes, right ?00:18
stefan_schmidtI'm pretty sure raster thinks its your app ;)00:18
stefan_schmidtwpwrak: no00:18
wpwrak;-))00:18
stefan_schmidtwpwrak: delay tolerant networking over ieee80215400:18
stefan_schmidtmy main work is to extend out convergence layer for it which I wrote during my study thesis00:19
wpwrakah :) good. not the stylish nonsense everyone else tries their luck at :)00:19
stefan_schmidtbut right now I'm sitting in the low level hell :)00:19
wpwrakwhat sort of application would run over that delay tolerance layer ?00:20
stefan_schmidtwpwrak: Not that I'm so much interested in delay tolerant networking (DTN) but its a nice thesis after all00:20
stefan_schmidtwpwrak: whatever you like00:20
stefan_schmidtwe also have video streaming over it :)00:20
stefan_schmidtin combination with ieee802154 we want to use it in wireless sensor networks00:21
stefan_schmidtso I would bridge between 802154 and standard IP/TCP/UDP00:21
stefan_schmidtcatching data from the sensor nodes and bringing it inot the main network00:22
wpwrakah, i see. so typically very large delays00:22
stefan_schmidt(sdl crash) its actually just pressing alt that kills it here00:23
stefan_schmidtyeah, driving around now and the and collect data00:23
wpwrakah yes, i implemented the "any key" quite literally ;-)00:23
stefan_schmidtheh00:23
stefan_schmidt"its a feature"00:23
stefan_schmidtthat means you switch workspaces by mice?00:24
wpwrak(feature) it actually is :)00:24
wpwrakno, but my workspaces are larger than 320x200 pixels :)00:24
wpwrakmore network trouble: [ 4612.960000] ieee802154: Bad frame received (type = 5)00:25
wpwrak[ 4857.990000] at86rf230 spi2.0: PHR 0x9a >= buffer 128 bytes00:25
wpwrakand still continuing. very good.00:25
stefan_schmidtwell, without focus it obviously does not crash00:25
wpwrakand maybe we should start looking at those CRCs ;-)00:25
stefan_schmidtlooks like your PHR fix is working as it shoudl00:25
stefan_schmidtshould00:25
stefan_schmidtdoes it do hardware crc?00:26
wpwrakit doesn't crash ! when pressing any key, it does a clean normal exit00:26
wpwrakthe chip does00:26
wpwrakthe driver ignores it :)00:26
wpwrakeventually, some higher layer may catch it, but ...00:27
stefan_schmidt(crash) its a question of what I expect. :)00:27
stefan_schmidtwpwrak: it should fill the two CRC bytes with other data like rssi, lqi and a crc flag, no?00:28
stefan_schmidtI'm ignoring the packets with wrong CRC in the driver now (cc2420)00:28
stefan_schmidtbesides debugging I see no use for them in the stack.00:29
wpwrakyou have to read the CRC result separately00:29
stefan_schmidturgs00:30
stefan_schmidtthats not nice00:30
wpwrakwell, you can actually avoid it on the 231. you can make it return the register PHY_RSSI, which happens to include the CRC status "underneath" the first byte of any SPI command.00:31
wpwrakand you even get 2 "truly random" bits on top of that. you could feed them into the entropy pool ;-)00:33
stefan_schmidtheh00:33
qi-bot[commit] Werner Almesberger: tools/atrf-rssi/: added WLAN channel display (US, EU, and JP) http://qi-hw.com/p/ben-wpan/9af0f9300:54
wpwrakstefan_schmidt: use E, J, U to select regulation domain, Q to quit00:54
stefan_schmidtwpwrak: you are such an UI hacker00:55
wpwrak;-)00:55
wpwrakstill 3000 pings to go00:55
wpwraktwo more bad PHRs00:55
stefan_schmidtworks great00:56
stefan_schmidthmm, I'm fighting with having a usb_register for the usb side and a platform_register for the fake spi side00:56
stefan_schmidtthey don't want to go with one generic probe and remove functions00:57
stefan_schmidtwrong device struct type as params00:57
stefan_schmidtbut when I have to I need to sync the private data struct somehow00:57
wpwraki would just overwrite spi->dev.platwhatever00:58
wpwrakin atben_setup00:58
stefan_schmidthmm01:01
stefan_schmidtnot really elegant01:01
stefan_schmidtbut maybe it does the job01:01
wpwrakthat's exactly the idea ;-)01:01
qi-bot[commit] Werner Almesberger: tools/atrf-rssi/: added menu for regulation area selection http://qi-hw.com/p/ben-wpan/539240101:31
wpwrakstefan_schmidt: more GUI fun :)01:31
stefan_schmidtwpwrak: yay :)01:32
wpwrak700 pings to go ...01:34
wpwrakhow's the platform manipulation working ?01:34
stefan_schmidtgot sidetracked by the motorola atrix. A smartphone with android _and_ a ubuntu system side by side sounds interesting01:38
stefan_schmidtespecially with a laptop dock and a normal dock available01:38
stefan_schmidtkinda the idea raster had at openmoko. Normal phone in the pocket and desktop system when docked01:39
stefan_schmidtanyway, back to coding now :)01:39
wpwraknot too bad: 10000 packets transmitted, 9999 packets received, 0% packet loss01:51
wpwrakthat's on the end with lots of errors. the other side got: 10000 packets transmitted, 10000 packets received, 13 duplicates, 0% packet loss01:51
stefan_schmidtnice01:52
stefan_schmidtwhat size are the ping packets?01:52
wpwrak(some errors must have killed acks, hence the DUPs)01:53
wpwrakstandard size, 64 bytes01:53
wpwrakround-trip min/avg/max = 11.034/11.858/81.130 ms01:53
wpwrakben to ben01:53
stefan_schmidtplus ieee802154 header overhead01:53
stefan_schmidtthats 77 bytes01:53
stefan_schmidtor 7601:53
wpwrakyup. one byte for dirtpan, not sure if ping counts with or without IP header.01:54
stefan_schmidtmaybe worth to test with full size packets sometime later01:54
stefan_schmidtbut its nearly 2/3 already01:54
wpwraki tried that a while ago. 4000 bytes. dirtpan takes care of fragmentation and reassembly.01:55
stefan_schmidtand the packet loss is nice01:55
stefan_schmidtah, right. I always forgot as I don't use IP over it01:55
wpwrakand especially the absence of crashes ;-) i didn't like it that i kept on finding unresponsive systems after doing something else for a while.01:56
stefan_schmidtbut I will steal your fragmentation and reassembly when I get to the higher layers here01:56
stefan_schmidtits also on my list :D01:56
wpwrakit's as ugly and simple as it can possibly get ;-)01:56
stefan_schmidtsure, I can expand from there. At least it is known to work01:56
wolfspraulI want my atbens! tuxbrain where are you?01:57
stefan_schmidtwpwrak: no more warnings and the driver still loads without crashing. Not to bad. :)01:59
stefan_schmidtwpwrak: the usb_device does have a struct device under ->dev. Convenient.01:59
wpwrakwolfspraul: my boards are already in buenos aires. i should get them monday. finally :)02:00
stefan_schmidthi wolfspraul 02:00
wpwrakwolfspraul: and no a day too early - i'll leave for FISL tuesday morning. well, volcano willing ...02:00
stefan_schmidtwpwrak: I should rip out all the mac802154 stuff again as is will be a simple usb<->spi driver02:00
wpwrakstefan_schmidt: yeah, you won't need that anymore :)02:01
stefan_schmidtwpwrak: and also all the sysfs debug stuff. Hardware info printing during probe. No need for sysfs there02:01
stefan_schmidtbut thats later02:01
wolfspraulI'm not so lucky. Wired money to the big mega corporation, since then silence.02:02
stefan_schmidtThe question now is how I get the 230 to speak to my spi master driver02:02
wolfspraulthat smells like it needs some copyleft hardware competition, a NanoNote with integrated ben-wpan :-)02:02
wpwrakstefan_schmidt: ah yes, this will be a little tricky02:03
wpwrakwolfspraul: yes !! ;-)02:03
stefan_schmidtwpwrak: no board file to set it up, hmm02:03
wpwrakwolfspraul: maybe ping victor about the boards. he's usually more responsive.02:03
stefan_schmidtwolfspraul: is there space left in the case and SPI testpoints available?02:03
wpwrakstefan_schmidt: you could probably do all the formalities in atusb_init ... :)02:04
Action: wpwrak ducks02:04
wolfspraulah that's a long discussion. We are thinking about how to make the next NanoNote but there are many pieces that need to come together, and so far we haven't found any golden path yet.02:05
wolfspraulI wouldn't want to try to cram it into the current case.02:05
stefan_schmidtwolfspraul: ah, you plan for the next. I was thinking about a drop into for the current note02:05
stefan_schmidtok, got it02:06
wpwrak(current case) that wouldn't work anyway02:06
wolfspraulplus once you start this thinking, you open a can of worms. Say we use the Ingenic 4760 CPU, then we would want to expose more memory cards...02:06
stefan_schmidtwpwrak: I would not mind putting it there. I just don't see how. I mean the 230 have to "find" our master somehow02:06
wpwrakup to three of then, to be precise :)02:06
wpwraks/then/them/02:06
wolfspraulanother idea is to use the Milkymist SoC for the next NanoNote, but it may be a year too early02:06
wpwrakstefan_schmidt: spi_register_board_info ? see arch/mips/jz4740/board-qi_lb60.c02:07
wolfspraulthere's so much work everywhere, it's hard to find the shortest path to something we can sell today02:07
wolfspraulneeds more thinking :-)02:07
wpwrakwolfspraul: yes, make the MM+NN merge later. that will needs some power management work first.02:07
wolfspraulwhen I finally have Milkymist One RC3 out, I will go back to that02:07
wolfspraulwpwrak: yes, I think it also needs progress on MMU and Linux, and I think most of those efforts are in deep-freeze right now. (of course can continue later, it's just too much at once)02:08
stefan_schmidtwpwrak: hmm, good point. There is no reason that can't life in our driver instead of a board file.02:08
stefan_schmidtSometimes it sounds to easy :)02:08
wpwrakwolfspraul: Ya should be what the Ben ought to have been. properly free'd, own case, no silly performance/feature restrictions02:08
wolfspraulMaybe I do need to give myself a kick one of these days and go back to our Ingenic friends :-)02:09
wolfspraulbut first m1 now...02:09
wolfsprauland waiting for my ben-wpans02:09
wolfspraulreally not the best customer service there, I have to say02:09
wpwrakstefan_schmidt: there are a few variations of the theme in include/linux/spi/spi.h, right after spi_register_board_info02:10
rsharpewpwrak: Has stefan committed his stuff yet? I checked out jz-2.6.38 but cannot see any of Stefan's code02:10
stefan_schmidtwpwrak: yeah, I actually worked with it before. But somehow I believed thats bound to board file. No idea why :)02:11
wpwrakwolfspraul: yeah, the vanishing act gets a little silly02:11
stefan_schmidtrsharpe: its in ben-wpan-stefan02:11
stefan_schmidtrsharpe: hi, btw02:11
rsharpeYeah, I just noticed ... thanks02:11
stefan_schmidtrsharpe: but some of it will be obsolete soon. Working on the SPI master driver side now as wpwrak showed that it is possible02:12
wpwrakwolfspraul: ah, and if you can find some funding, i'd be more than happy to absolve you from most of the Ya R&D worries ;-)02:13
rsharpestefan_schmidt: OK, I will read through the emails ...02:17
stefan_schmidtrsharpe: oki02:17
rsharpeI saw the new branches when I pulled from upstream.02:17
stefan_schmidtwpwrak, wolfspraul. What kind of FPGA is needed for m1 soc?02:17
wolfspraulright now it runs on a Xilinx Spartan-602:18
wolfspraulusing about 44% of it (slx45 variant)02:18
wolfspraulone of the design goals was portability between fpgas, so we try to stay away from Xilinx-specific features02:19
stefan_schmidtIIRC, its some time since my fpga course, that more like a high end model, right?02:19
wolfspraulbut bringing it to another chip is definitely work02:19
stefan_schmidtverilog or vhdl?02:19
wolfspraulstefan_schmidt: no not at all. the spartan is the low-end series for Xilinx02:19
wolfspraulVerilog02:20
wpwrakvhdl = cobol :)02:20
stefan_schmidtwolfspraul: good to know. Brain is getting old :)02:20
wolfspraulthe fpga in m1 costs about 39 USD02:20
rsharpeYeah, verilog is great ...02:20
stefan_schmidtwpwrak: well, I had verilog as well, but vhdl is used a lot here in .de02:20
wolfspraulso is Java02:21
wolfspraul:-)02:21
stefan_schmidtwolfspraul: thats ok. And going for an asic is just no option in this quantities02:21
wolfspraulthat's another long story02:21
stefan_schmidtand we can still update the soc in filed :)02:21
stefan_schmidtfield02:21
wolfspraulthere are multiple 'asic' approaches02:21
urandom__though 39 USD is still expesive. the spartan 3a is a lot cheaper i gues but m1 might be far to large02:22
wolfspraulthere's this 'structured asic' stuff, where I believe you can make chips at volumes of a few hundred02:22
wpwraki actually like the idea of having an fpga around. once llhdl works, there would be an awful lot you could do with it.02:22
stefan_schmidtwolfspraul: interesting. Did not know about it02:22
wolfspraulyes correct, then there are tools issues, like llhdl02:22
wolfspraulstefan_schmidt: when you 'go asic', the question is also which process technology you want, and thus which 'IP partners' you need to get into your boat (cell libraries)02:23
stefan_schmidtwolfspraul: thus I know again. But I would not like to think about all the details of IP partners. :)02:23
wolfspraulso for me that whole 'go asic' thing is about learning, understanding where it can help us to make products, and finally waiting for an economic reason/opportunity02:23
wolfspraulstefan_schmidt: well that's why I say - it depends on what you want. If you are OK in making a Milkymist SoC in a 1um process that's just something entirely different from making it in a 90nm process02:24
wolfspraulbut in a 1um process, maybe in the end your chip will perform worse than in an fpga that was made in a Samsung 45nm process :-)02:24
wolfspraulor 28nm as the upcoming Xilinx -7 series02:25
wolfspraulso I look at this from product back02:25
stefan_schmidtwolfspraul: actually size should not be such a big problem. Heat and power might be more problematic. But you get experience with this on the m102:25
wolfspraulwhere is the product? how many can we sell? what is the best way to build the product?02:25
wpwrakplan B: build a direct writer for wafers and let azonenberg make the asic ;-)02:25
wolfspraulyes correct02:25
wolfspraulstefan_schmidt: that's our latest mental exercise - follow azonenberg and his #homecmos project02:26
wolfspraulvery cool stuff!02:26
wolfspraulwe won't be able to make a Milkymist SoC in that process anytime soon, but who knows, it may at some point be possible to make some specialized chips in that way, chips that can still help us a lot with a particular product...02:26
wolfspraulit's not further away than llhdl :-)02:27
wolfspraulthat's his chipmaking lab http://colossus.cs.rpi.edu/~azonenberg/images/homecmos/2011-06-10/S7300808.JPG02:30
wolfspraulI think his first big goal is to make a replica of the Intel 4004 CPU :-)02:30
wpwrakgrmbl. my atusb is even too broken to act as a decent jammer :-( tries to make my pings run into trouble more often, but absolutely nothing happens. very disappointing. so i'll have to wait for "natural" errors ...02:30
wolfspraulsorry wrong url, one sec02:31
wolfspraulthis is the lab http://colossus.cs.rpi.edu/~azonenberg/images/homecmos/2011-06-10/S7300809.JPG02:32
wpwraki was about to ask in which of the boxes he sleeps ;-)02:32
stefan_schmidtwpwrak: usrp?02:34
wpwrak(lab) nice and compact :)02:34
wpwrakstefan_schmidt: yeah, i could fire up the usrp. that one's good for jam sessions.02:34
wolfspraulchipmaking http://colossus.cs.rpi.edu/~azonenberg/images/homecmos/2011-06-08/S7300798.JPG02:36
wolfspraulI need to put these pics into a nice gallery...02:36
qi-bot[commit] Werner Almesberger: Revert "at86rf230: initialize unused buffers in struct spi_transfer to NULL" http://qi-hw.com/p/qi-kernel/01c171f03:21
qi-bot[commit] Werner Almesberger: at86rf230: check PHR of inbound packets and make sure frame fits into skb http://qi-hw.com/p/qi-kernel/fe7850b03:21
qi-bot[commit] Werner Almesberger: at86rf230: check PHR of inbound packets and make sure frame fits into skb http://qi-hw.com/p/qi-kernel/eb5fe3b03:22
wpwrakhmm, without indicating the branch, such commits are a tad confusing03:23
wpwrakaha. seems i have a very noisy neighbour at wifi channel 1. good, just where it causes the most interesting effects :)03:35
stefan_schmidtaaaaargh03:51
stefan_schmidttwo hours checking a linking problem03:51
stefan_schmidtand it turns out that I'm not able to use spi_register_board_info in the driver03:52
stefan_schmidtand then there is this magic spi_new_device() call which takes a master and a board_info and glues them together03:52
stefan_schmidthmm, but 230 seems still not happy03:53
stefan_schmidtanyway, its 6am and I need some sleep03:54
stefan_schmidtnight all03:54
DocScrutinizermoo08:51
DocScrutinizerany issues with PM flooding recently, anybody?08:52
DocScrutinizerthere's been a runaway or rogue bot at 74.63.*.*08:52
DocScrutinizerseems freenode sorted it08:52
dvdkwhitequark: any news about the ubbs?11:22
whitequarkdvdk: yeah, they came two days ago12:04
dvdkcool12:12
dvdkso still % of loss with german mail is 012:12
whitequarkdvdk: here in russia, germans are commonly perceived as being incredibly accurate and pedantic, even a bit obsessed about keeping things in order :)12:21
dvdkwhitequark: yeah, here, too :)12:21
whitequarkthere's even a phrase "exemplary deutsch order". somewhat like that12:22
kristianpaulffffffffff....14:49
kristianpaul:-/14:49
wpwrakkristianpaul: NO SATELLITES FOUND. ARE YOU INDOORS ?15:00
kristianpaulwpwrak: atenna is no indoor15:01
kristianpauli already tested it worked with a gps receivre i have 15:01
kristianpaul(fffff) just testing a different way of sampling15:02
kristianpauli was polling froma  register, but i did something wrong surelly15:02
wpwrakkristianpaul: you suspect over/underruns ?15:06
wpwrakkristianpaul: that register is in the FPGA, right ? maybe add logic that checks for overrun/underrun and generates some signal15:07
kristianpaulyeah, i will do that better, as i was detecting overrun by reading a pointer15:08
kristianpaula pointer coming from the counter that address the buffer 15:10
kristianpaulindeed something is definetelly not good, at current sampling i just should sample 256Kb per second (considering every word is 32Bits..) and thats no true right now..15:20
wpwrakdo you actually need a counter ? why not a fifo ?15:20
kristianpaulhum, you suguested the circular buffer time ago, so i implemented sort of that :)15:20
kristianpauli remenber..15:20
wpwrakwell, depends on how much data can pile up15:21
wpwrakif you need to collect lots of data, when a circular buffer is better15:22
wpwrakif you're polling anyway, a FIFO may be lighter15:22
wpwrakis the buffer fill rate correct ? e.g., when you signal beginning and end of a buffer fill (e.g., via some I/O pin) does the duration correspond to the correct buf_size/data_rate ?15:23
kristianpaulwell in theory it should be correct as the counter clk is coming from the sync signal from the sige chip15:24
kristianpaulbut i realize now, i may be reading same value many times.. because i wasnt taking care of overrun15:25
wpwrak"shuold be correct" means that you may be chasing a problem that's elsewhere :)15:26
wpwrakif things refuse to work as stubbornly as your data collection, it makes sense to systematically verify every single step for correctness15:27
kristianpaulbut how i can measure the sampling rate?15:27
wpwrakyou wouldn't be the first one to spend weeks trying to catch a bug at A while A is perfect and the real problem is an input coming from buggy B ;-)15:27
wpwrakyou could raise an I/O signal when you begin collecting data, drop it when the buffer is full (or the counter wraps), then check the timing with the scope15:28
kristianpaulokay i'll try that15:33
kristianpaulwhen you said check timing with scope, i guess you mean that i can measure that I/O overrun signal, so i can confirm sampling rate from it15:34
wpwrakyes. you can measure the duration of the pulse (or if you use two I/Os, one to indicate start, the other to indicate wrap/overrun/end, the time between them)15:47
qi-bot[commit] Werner Almesberger: spi_atben: added section titles (ben-wpan-atben) http://qi-hw.com/p/qi-kernel/4926b1017:10
qi-bot[commit] Werner Almesberger: spi_atben: moved atben_reset and at86rf230_platform_data from board to driver (ben-wpan-atben) http://qi-hw.com/p/qi-kernel/9a7d79a17:10
qi-bot[commit] Werner Almesberger: spi_atben: moved qi_lb60_atben platform device from board to spi_atben (ben-wpan-atben) http://qi-hw.com/p/qi-kernel/00fded817:10
qi-bot[commit] Werner Almesberger: spi_atben: moved spi_board_info of atben from board to spi_atben (ben-wpan-atben) http://qi-hw.com/p/qi-kernel/b9def2217:10
qi-bot[commit] Werner Almesberger: spi_atben: allocate SPIP bus_num dynamically (ben-wpan-atben) http://qi-hw.com/p/qi-kernel/e08d15617:10
qi-bot[commit] Werner Almesberger: spi_atben: some cleanup (ben-wpan-atben) http://qi-hw.com/p/qi-kernel/3e7de6017:10
wpwrakstefan_schmidt: the rest should be trivial ;-)17:12
stefan_schmidtwpwrak: let me dig through it.17:13
Action: stefan_schmidt has also some stuff to push17:13
qi-bot[commit] Stefan Schmidt: ieee802154/atusb: Remove all ieee802154 informations again. (ben-wpan-stefan) http://qi-hw.com/p/qi-kernel/38c312817:13
qi-bot[commit] Stefan Schmidt: spi/atusb: Initial setup to be a fake spi master driver. (ben-wpan-stefan) http://qi-hw.com/p/qi-kernel/5a03c6f17:13
qi-bot[commit] Stefan Schmidt: spi/atusb: Move Kconfig and Makefile handling from ieee802154 to spi (ben-wpan-stefan) http://qi-hw.com/p/qi-kernel/80b0bda17:13
qi-bot[commit] Stefan Schmidt: spi/atusb: Remove the sysfs entry for firmware build version. (ben-wpan-stefan) http://qi-hw.com/p/qi-kernel/c704f6417:13
qi-bot[commit] Stefan Schmidt: spi/atusb: Move atusb_id informations to probing as well. (ben-wpan-stefan) http://qi-hw.com/p/qi-kernel/f5cd31217:13
qi-bot[commit] Stefan Schmidt: spi/atusb: Clean up error path in probing and removing (ben-wpan-stefan) http://qi-hw.com/p/qi-kernel/cba21e817:13
stefan_schmidtwpwrak: Lets see if we have the same solution for the spi board info in the driver now :)17:14
stefan_schmidtwpwrak: you tested yours already?17:14
wpwrakhehe :)17:14
wpwraksure17:14
wpwrakthere are still 1-2 things i need to clean up. but by and large, that's how it should work17:17
stefan_schmidtwpwrak: great17:17
stefan_schmidtwpwrak: for reset I would just use the reset command?17:18
stefan_schmidtATUSB_RESET I mean17:18
rsharpewpwrak: stefan_schmidt: I want to push a small change that uses snprintf rather than sprintf17:19
rsharpeHmmm, looks like atusb.c did not get compiled in my recent build.17:19
wpwrakATUSB_RF_RESET17:20
stefan_schmidtrsharpe: I'm not sure if that is worth it. I already removed some of the sysfs and planing to remov ethe rest once the at86rf230 driver get loaded17:20
stefan_schmidtwpwrak: ok17:20
stefan_schmidtrsharpe: the information in the files is so static that giving them during driver probe is fine IMHO17:22
stefan_schmidtand the reg reads for the 230 will come from the driver itself then17:22
rsharpeOK, so you are working on the at86rf230 driver then?17:22
rsharpeAnyway, make menuconfig does not seem to give me a way to build atusb.c or at86rf230 that I can find17:23
wpwrakbtw, spi_atben is stiill only in branch ben-wpan-atben. i'll merge into ben-wpan once done with it.17:23
wpwrakrsharpe: on which branch are you ?17:24
stefan_schmidtrsharpe: the driver moved also to drivers/spi now as it will only handle spi stuff no ieee80215417:24
stefan_schmidtrsharpe: I bit rough right now17:24
stefan_schmidtI just have to change some things back as wpwrak showed that the spi master idea will work17:25
rsharpeI am on ben-wpan-stefan ...17:25
rsharpeOK, I guess I do not understand the architecture so well.17:26
stefan_schmidtrsharpe: let us help to explain it to you :)17:26
stefan_schmidtrsharpe: etben and atusb are similar as they connect a 230 over SPI to a host17:27
stefan_schmidtrsharpe: atusb uses USB for this and atben GPIOs17:27
stefan_schmidtAnd we don't want to re-implement the at86rf230 driver that is already there and working17:28
stefan_schmidtthat is the base we start from17:28
stefan_schmidtas the given at86rf230 speaks SPI in slave mode we are implementing these driver to be the SPI master counterpart17:29
rsharpeSo does the at86rf230 think it is an SPI slave to the 230 on the SPI bus?17:30
stefan_schmidtSo we abstract the connection to the host in the drivers and let at86rf230 work as normally by speaking to a SPI master driver17:30
stefan_schmidtrsharpe: yes17:30
stefan_schmidtrsharpe: and thus needs no changes17:30
stefan_schmidtOn the other hand that makes the atben and atusb driver simpler as they only handle data shifting without knowing about the payload17:31
rsharpeLet me look some at the at86rf230 ... does it have a way to do a software connection to another module that is pretending to be the SPI master to it?17:31
rsharpeAnyway, sounds interesting.17:31
stefan_schmidtrsharpe: That is handled by the linux spi framework already17:31
rsharpeHuh, pretty neat.17:31
stefan_schmidtrsharpe: at86rf230 is just a plain slave driver and we can setup in our driver that it gets bound to our master driver17:32
stefan_schmidtthats what in embedded normally is handled in the machine (board) file17:32
rsharpeOK, I gotta look at that some more ... I should have been on this board weeks ago ...17:35
wpwrakalmost plain. it knows some gpios, reset and slp_tr17:35
stefan_schmidtwpwrak: did I miss anything or got it wrong?17:35
stefan_schmidtrsharpe: I hope you don't take this as a hostile takeover of your work. Its just that I have some time at hand right now and really need these devices working for my thesis17:36
wpwrakalso, atusb can't be 100% generic spi. the firmware only implements a few transfer patterns. (optimized for what the 230/1 can do)17:37
stefan_schmidtwpwrak: its a hw dependent driver anyway. Its bound to the USB ids of the atusb board and speaks gooed enough SPI for the chip on it. :)17:38
rsharpestefan_schmidt: I really want whatever works ... and you have just clued me in on some interesting stuff ... so no problems.17:38
stefan_schmidtrsharpe: cool, glad you see it this way!17:38
rsharpestefan_schmidt: Also, it's "get it wrong." In English the tense goes on the first verb for the most part and we use present tense for the others (I am not sure if that is the correct explanation, just that "did I miss anything or _got_ anything wrong" is wrong :-)17:40
stefan_schmidtrsharpe: thanks17:40
stefan_schmidt:)17:41
rsharpenp. I study Mandarin and speak some Cantonese, and really wish that native speakers would correct me more often. They are just too polite.17:41
stefan_schmidtDinner now. Will check wpwrak's latest commits after this and see what atusb can use from them17:48
wpwrakrsharpe: hmm, you'll need some thoroughly westernized chinese for that ;-)17:48
wpwrakstefan_schmidt: just finished brunch :) now, the remaining cleanup ....17:48
rsharpeSo, what is needed is a driver that is an SPI master to the at86rf230 and speaks USB out the other side ...17:53
rsharpeThat is kind of like a SCSI LLD that is also a SCSI Target driver, ie, scst_local ...17:53
rsharpewpwrak: Is my understanding correct?17:56
wpwrakrsharpe: yup. in branch ben-wpan-atben, drivers/spi/spi_atben.c, there's one that does SPI -> GPIOs for atben. (similar to spi_gpio, but more efficient. plus, it takes care of all the plumbing, so no changed to the board init needed)17:56
rsharpewpwrak: Hmmmm, the spi.h include file suggests that there is no slave-side support. Have I misunderstood this?18:15
wpwrakhmm, dunno. could be. in any case, we don't need a slave :)18:16
rsharpeOK, so I misunderstood the above then. I assumed you mean that the at86rf230 driver thought it was a slave, but it seems that it is a master and treats the chip as a slave.18:17
stefan_schmidtrsharpe: right, there is no slave support. What we need as slave support is only the protocol part18:18
stefan_schmidtrsharpe: The slave itself is the at86rf230 chip18:18
rsharpeOK, now I have that clear. 18:18
rsharpeOK, more questions: wpwrak: So our driver has to register itself as an SPI master driver? That is, spi_atusb.c pretends to be an SPI controller driver and the at86rf230 is an SPI protocol driver?18:28
stefan_schmidtrsharpe: correct18:29
wpwrakyes. see spi_atben.c. the registration process is a little tricky18:31
rsharpeOK, thanks. Now I have a better mental picture.18:31
stefan_schmidtwpwrak: on atusb it is tricky as well, but different :)18:32
rjeffriesanybody home this fine Saturday?18:38
wpwrakhome, hacking :)18:38
rsharpewpwrak: You are in a similar time zone to me aren't you?18:40
rjeffriescool.I just learned about the $2K fee to get a USB address block. I assume Wolfgang had tp pomy up? it really sucks.18:40
qi-bot[commit] Werner Almesberger: spi_atben: announce atben_reset and don't modify global variables (ben-wpan-atben) http://qi-hw.com/p/qi-kernel/add45cd18:41
Action: rjeffries is GMT +8 (usa pacific daylight time zone) is now 11:42am Saturday18:41
wpwrakrsharpe: you're still US west coast ? i'm argentina (east) coast. one hour "east" of US east cost. so somewhat similar18:42
wpwrakyou guys will also need.reset_data for spi_atusb. i think all the bits and pieces are now in place.18:42
wpwrakah, and i'll kick out the transfer classifier soonish.18:43
wpwrakthat is, thinking of it ... maybe i'm not in a hurry with that. may still be useful18:44
rsharpeOK, so you are four hours ahead of me 18:44
stefan_schmidtwpwrak: yeah, I was already thinking about reset_data :)18:45
stefan_schmidtwpwrak: spi_atben is now ready from your side?18:45
wpwrakyeah, should be good to copy from now18:49
stefan_schmidtwpwrak: oki18:49
wpwraki still have to optimize the bit-banging functions a little. still got some precious cycles to squeeze out of them ;-)18:50
stefan_schmidtwpwrak: only the irq forwarding with usb irqs is unknown to me now18:50
wpwrakoh, wait. one mistake ...18:50
rsharpewpwrak: Why do you need to bitbang the SPI stuff? Doesn't the JZ have an SPI controller on chip? Or are the pins connected to the wrong place?18:53
qi-bot[commit] Werner Almesberger: spi_atben: we set prv->board_info.platform_data later, don't mis-initialize (ben-wpan-atben) http://qi-hw.com/p/qi-kernel/8a07eed18:54
wpwraknow it's better :)18:54
wpwrakrsharpe: the latter, unfortunately. we have a perfectly good SPI controller, doing nothing :-(18:54
rsharpeAhhh, that is a pity :-(18:55
wpwrakyeah. the SPI pins are used for the keyboard matrix instead. a sad fate ...18:59
rsharpeOK, I begin to see some of the details for ATUSB. It has to register itself as a USB driver and as an SPI device controller, but I guess I am restating myself ...19:01
stefan_schmidtrsharpe: be aware that the code in git has some problems right now. I'm working my way through it.19:02
wpwrakthe whole spi master registration bureaucracy is already covered in spi_atben. maybe we can even have some common functions shared by spi_atben and spi_atusb in the future, to avoid redundancy19:02
stefan_schmidtJust that you don't get on the wrong path :)19:02
rsharpeYeah, I am looking at this article: http://jumpnowtek.com/index.php?option=com_content&view=article&id=57&Itemid=6219:04
rsharpeand don't yet see where we can hook in ... I guess I will need to read through the spi core code to understand that.19:04
wpwrakhehe. ping -s 4000 from both sides. meltdown ;-)19:05
wpwrakrsharpe: all the SPI registration is already handled in spi_atben. copy & paste is your friend :)19:10
stefan_schmidtwpwrak: some bits are different thought as as you have a struct device and we have a struct usb_device here.19:10
stefan_schmidtNeeds a bit of a different handling19:11
stefan_schmidtpretty similar anyway :)19:11
wpwrakof course, if you want to review what i've done in spi_atben. that would also be useful. i also have a platform_device_register followed by platform_driver_probe in atben_init that i'm not entirely fond of. it works, but ...19:11
stefan_schmidtI'm just going through all this. Give me some time.19:12
wpwrakstefan_schmidt: usb_device ... just a pointer from atusb_prv ? the struct device is part of the SPI bureaucracy, it doesn't have much to do with what's underneath19:13
wpwraksure :)19:13
stefan_schmidtneed to reboot. Broke my system with a NULL pointer deref during modprobe :)19:25
stefan_schmidtbrb19:25
stefan_schmidtwpwrak: going to split my changes in some sensible commits now and push it.19:29
stefan_schmidtwpwrak: The we can have a look why I think its different as you have a platform_device and I have a usb_device here19:29
stefan_schmidtthat's different probe function parameters due to this.19:30
stefan_schmidtMaybe I don't see the easy solution.19:30
wpwrakah .. now i understand what you mean19:31
qi-bot[commit] Stefan Schmidt: spi/atusb: Add RF reset function. (ben-wpan-stefan) http://qi-hw.com/p/qi-kernel/bbcabbe19:38
qi-bot[commit] Stefan Schmidt: spi/atusb: Move interface ignore function to the beginning of the probe function (ben-wpan-stefan) http://qi-hw.com/p/qi-kernel/b7cfe7019:38
qi-bot[commit] Stefan Schmidt: spi/atusb: Mimic atben on the latest changes for spi master. (ben-wpan-stefan) http://qi-hw.com/p/qi-kernel/bf166fe19:38
stefan_schmidtwpwrak: I would be glad if you could have a look at the probe function in drivers/spi/atusb.c19:38
stefan_schmidtwpwrak: let me explain what I'm trying to do there19:38
stefan_schmidtwpwrak: I get the usb_device during probe. That one has a struct device in ->dev19:39
stefan_schmidtwpwrak: but I can't relay on spi_alloc_master for allocating my private data struct as this function already needs the struct device19:40
stefan_schmidthmm, moment19:40
stefan_schmidtI should just use this without putting the usb device into my private struct19:41
Action: stefan_schmidt ponders19:41
wpwrakping -s 4000, unoptimized: round-trip min/avg/max = 521.951/538.744/665.387 ms19:59
wpwraklightly optimized: round-trip min/avg/max = 505.119/521.531/643.175 ms19:59
wpwraknow, once i have debugged the heavily optimized version ...20:00
stefan_schmidtgrumbl20:37
stefan_schmidtcrashing your main machine is no fun20:37
wpwraki can vividly imagine how badly this would suck ;-)20:38
stefan_schmidtheh20:40
stefan_schmidtwpwrak: making progress here20:40
stefan_schmidtwpwrak: at86rf230 starts probing now20:40
stefan_schmidtfails on irq as I don't provide this yet. Overruling it now20:40
wpwraknice. you're close then :)20:43
stefan_schmidtyeah, but IRQ handling will be fun again20:44
stefan_schmidtI count on your experience for this :)20:44
wpwrakIRQ handler might be pretty easy - just reuse my stuff, then trigger the interrupt when you get an EP 1 URB20:45
wpwrakthat will still give you races, but you should be able to make it at least through a basic functional test20:46
stefan_schmidtwpwrak: ok, overruling the irq was not a good idea :)20:47
wpwrakone of these days, i'll port myroot ... a ping without fractional seconds for the inter-packet delay, no calulation of stddev, ... oh the suckiness ...20:47
wpwrakstefan_schmidt: have you tried irq_alloc_desc ? if yes, what does it return ?20:48
stefan_schmidtwpwrak: not done yet. Coming to it now20:48
stefan_schmidtI hoped for a shortcut without IRQ20:49
stefan_schmidtbut I need to get this up first20:49
wpwrakat least it shouldn't return 0. that's taken by the timer on PCs. 2 may be available. wonder what's there ...20:50
stefan_schmidtwpwrak: ah!! that explains one of my hard crashes. Using the timer irq number was not a good idea ;)20:51
wpwrakhmm RTC alarm20:51
wpwrak;-))20:51
wpwrakheavily optimized: round-trip min/avg/max = 498.807/517.709/640.434 ms20:56
wpwrak4 lousy milliseconds :-(((20:57
stefan_schmidt:/20:57
stefan_schmidtwpwrak: maybe optimize dirtpan as well?20:58
wpwrakyou mean auto-ack ;-)20:59
stefan_schmidtwpwrak: the chip should be able to do it, right?20:59
stefan_schmidtI was able to get it working on cc242020:59
stefan_schmidtand the 230 should do re-submit in hw as well21:00
wpwrakyeah, it can do quite a number of things automatically21:00
wpwrakincluding automatic CSMA-CA21:03
stefan_schmidtwpwrak: any reason that is not enabled? Just not done yet or hw problems?21:05
wpwrakjust not done yet21:23
wpwrakhmm, optimized out one more writel. interesting: round-trip min/avg/max = 489.195/512.363/627.084 ms21:24
stefan_schmidtthats again 5 ms21:28
qi-bot[commit] Werner Almesberger: spi_atben: added optimized unidirectional SPI bitbangers (ben-wpan-atben) http://qi-hw.com/p/qi-kernel/1fe9fab21:28
wpwrakhere we go21:28
stefan_schmidtwpwrak: I merged your branch into mine now for easier code sharing21:29
stefan_schmidtwpwrak: once I have something that works we should but the generic part into atben_common or such21:30
wpwrakyup. a lot of common stuff ?21:30
stefan_schmidtwe will see when I have it running21:31
stefan_schmidtBut some parts are indeed worth sharing between the two21:31
wpwraknice21:39
qi-bot[commit] Werner Almesberger: spi_atben: more minor cleanup (ben-wpan-atben) http://qi-hw.com/p/qi-kernel/db9015221:45
wpwrakfor interrupt synchronization, i think it will be sufficient to just detect a FORCE_TX_ON write to TRX_STATE, and in this case wait ~ 10 ms for any news on EP 121:46
wpwrakboth cases where we need messy interrupt synchronization are forced transitions into TX_ON/PPL_ON21:46
stefan_schmidthmm, fiddling with the data stream we route is not really nice imho :)21:47
stefan_schmidteven if it is only reading and only lookign for one pattern21:47
wpwrakat least it's a well-defined condition :)21:48
wpwrakanything else would be more complex21:49
stefan_schmidthmm21:49
stefan_schmidtshould be ok21:50
wpwrakactually, i should do this in spi_atben.c too. need to sync with the interrupt ... (not that this race is likely to ever go the wrong way, but ... ;-)21:50
wpwrakanyway. afk for a bit. getting my laundry.21:51
stefan_schmidtwpwrak: cu21:51
wpwrakback to hack22:37
wpwraki wonder if there's a way to enqueue an URB at the host for reading such that it completes after one IN, whether there was DATA or a NAK from the device/gadget22:38
kristianpaulwpwrak: the overun signal should stop the acquisition or just fire a flag?22:40
wpwrakkristianpaul: how about just driving an I/O pin ? that way, you can measure with the scope. that gives you reasonably accurate time from a completely independent source22:42
kristianpaulsure22:43
wpwrakkristianpaul: what you do with the acquisition doesn't matter so much. it's just for testing that things are as expected until that point. if they are, you can proceed to the next stage. if not, well, then you'll have some fun ;-)22:44
Action: kristianpaul stripping some wires22:58
wpwrakrejon: (trip details) thanks ! let's see how bad the delays are for my inbound flight. the volcano was busy again. not too badly this time, though.23:00
kristianpaulvolcano?23:01
kristianpaulah, you live near chile..23:01
wpwrakit's some 1500 km away, but messes up air traffic in the whole region23:04
qi-bot[commit] Werner Almesberger: spi_atben: removed classifier (ben-wpan-atben) http://qi-hw.com/p/qi-kernel/ccfe8ad23:29
qi-bot[commit] Werner Almesberger: spi_atben: added detection of FORCE_TX_ON commands for interrupt synchronization (ben-wpan-atben) http://qi-hw.com/p/qi-kernel/46b0b6b23:29
--- Sun Jun 26 201100:00

Generated by irclog2html.py 2.9.2 by Marius Gedminas - find it at mg.pov.lt!