DocScrutinizer05 changed the topic of #qi-hardware to: Copyleft hardware - http://qi-hardware.com | hardware hackers join here to discuss Ben NanoNote, atben / atusb 802.15.4 wireless, and other community driven hw projects | public logging at http://en.qi-hardware.com/irclogs and http://irclog.whitequark.org/qi-hardware
dos1 has quit [Read error: Operation timed out]
guanucoluis has joined #qi-hardware
pcercuei has quit [Ping timeout: 246 seconds]
guanucoluis has quit [Ping timeout: 248 seconds]
guanucoluis has joined #qi-hardware
woakas has quit [Ping timeout: 272 seconds]
rz2k has joined #qi-hardware
guanucoluis has quit [Ping timeout: 252 seconds]
wolfspraul has joined #qi-hardware
rz2k has quit []
wej has quit [Ping timeout: 264 seconds]
valhalla has quit [Ping timeout: 246 seconds]
valhalla has joined #qi-hardware
jekhor has joined #qi-hardware
panda|x201 has joined #qi-hardware
wej has joined #qi-hardware
xiangfu has quit [Remote host closed the connection]
dos1 has joined #qi-hardware
lekernel has joined #qi-hardware
dos1 has quit [Ping timeout: 260 seconds]
xiangfu has joined #qi-hardware
jekhor has quit [Ping timeout: 252 seconds]
panda|x201 has quit [Ping timeout: 268 seconds]
viric has quit [Remote host closed the connection]
viric has joined #qi-hardware
xiangfu has quit [Ping timeout: 252 seconds]
xiangfu has joined #qi-hardware
pcercuei has joined #qi-hardware
porchao has joined #qi-hardware
porchaso0 has quit [Read error: Connection reset by peer]
pcercuei has quit [Ping timeout: 268 seconds]
porchaso0 has joined #qi-hardware
porchao has quit [Ping timeout: 272 seconds]
jekhor has joined #qi-hardware
FDCX_ has quit [Remote host closed the connection]
jekhor has quit [Read error: Connection reset by peer]
wej has quit [Quit: What!?]
wej has joined #qi-hardware
jekhor has joined #qi-hardware
ffio has joined #qi-hardware
ffio has quit [Quit: WeeChat 0.4.1]
guanucoluis has joined #qi-hardware
jekhor has quit [Ping timeout: 240 seconds]
guanucoluis has quit [Ping timeout: 272 seconds]
pcercuei has joined #qi-hardware
kilae has joined #qi-hardware
porchao has joined #qi-hardware
porchaso0 has quit [Ping timeout: 245 seconds]
pcercuei has quit [Ping timeout: 245 seconds]
jekhor has joined #qi-hardware
kristianpaul has joined #qi-hardware
kristianpaul has joined #qi-hardware
dos1 has joined #qi-hardware
pcercuei has joined #qi-hardware
pcercuei has quit [Ping timeout: 272 seconds]
jekhor has quit [Ping timeout: 240 seconds]
apelete has quit [Ping timeout: 245 seconds]
wolfspraul has quit [Ping timeout: 245 seconds]
<wpwrak> nice: developer gets approached by state spies who want to hire him, blogs about it: http://www.thoughtcrime.org/blog/saudi-surveillance/
pcercuei has joined #qi-hardware
<eintopf> wpwrak: hi :)
jekhor has joined #qi-hardware
<wpwrak> eintopf: heya ! you know how developers calculate time ... given an estimate of X, add one, them multiply by two, and convert to the next higher unit
<wpwrak> eintopf: so if i say "i'll review it tomorrow", that really means in about four weeks :)
<eintopf> it's ok
<eintopf> i made now the "easy to review trivial cleanup patchstack"
<eintopf> maybe you can review this
<eintopf> then I add your Acked, Reviewed
<eintopf> then netdev
<eintopf> my internet is damn slow today
kilae has quit [Quit: ChatZilla 0.9.90.1 [Firefox 24.0/20130910160258]]
<eintopf> wpwrak: https://dl.dropboxusercontent.com/u/5815386/IMG_20131022_215934.jpg development setup, just ignore the dust :D
<eintopf> first the contiki stick, then two of your atusb which controlled via qemu
apelete has joined #qi-hardware
wej_ has joined #qi-hardware
<apelete> Hello there
<kristianpaul> Hi :)
wej has quit [Ping timeout: 264 seconds]
<apelete> larsc mth: added some logging in ep_config_from_hw() in musb_core.c where the usb endpoints scanning happens -> http://paste.debian.net/60583/
<apelete> kristianpaul: Hi :)
<apelete> larsc mth: turns out the scanning is failing on the first musb_read_fifosize() call in there:
<apelete> [ 1.870000] musb-hdrc: epnums = 1 | musb_num_eps = 6
<apelete> [ 1.880000] musb_read_fifosize: musb_readb failed
<apelete> [ 1.890000] musb-hdrc: musb_read_fifosize failed
<apelete> [ 1.900000] musb-hdrc: missing bulk
<apelete> musb_read_fifosize() in turn calls musb_readb(), which fails.
<apelete> seems pretty bad since musb_readb() is trying to read hardware registers, if I'm not mistaken
<apelete> larsc mth: is possible the something may be missing or badly declared in platform data for the registers not to be readable ?
<mth> is the udc clock running?
<apelete> how do I check that ?
<mth> there is a register that contains the mask bits for all the clocks; printing the contents of that register should tell you whether it's enabled or not
<mth> clock gate register iirc
<apelete> ok, in the init function I'm doing:
<apelete> clk = devm_clk_get(dev, "udc");
<apelete> int ret = PTR_ERR(clk);
<apelete> if (IS_ERR(clk)) {
<apelete> dev_err(dev, "Failed to get clock: %d\n", ret);
<apelete> return ret;
<apelete> }
<apelete> glue->clk = clk;
<apelete> clk_enable(clk);
<apelete>
<apelete> thought that was enough to get the clock running
<apelete> will check the register you're talking about
<mth> there was something about clk_enable being replaced in recent kernel versions
<mth> larsc will know more about it
<mth> I don't know if clk_enable won't work anymore or is just wrong in theory
<mth> that fragment looks ok, but it's useful to double check, just in case the enable failed, the code gets executed in an unexpected order, something disabling the clock after it got enabled etc
<apelete> ok, couldn't find out how to check clock gate register so will start by adding checks for clk_enable in case it fails during init
<mth> simply casts its address to an unsigned int * and dereference that
<mth> address being the virtual address of the register, which is 0xB.......
<mth> physical address is 0x1......., add 0xA0000000 for kseg1
<apelete> mth: not sure about what you're saying. should I cast the return value of devm_clk_get() ?
<mth> no, the address from the programming manual, inside the musb endpoint scanning code
<apelete> ha
<apelete> ok, will look into the programming manual and try to do that from inside the musb endpoint scanning code
porchaso0 has joined #qi-hardware
<apelete> mth: found it:
<apelete> The Clock Gate Register (CLKGR) is a 32-bit read/write register that controls the CLOCK GATE
<apelete> function of peripherals. It is initialized to 0x00000000 by any reset.
porchao has quit [Read error: Connection reset by peer]
<apelete> the udc bit seems to be 11th bit according to programming manual
porchaso0 has quit [Ping timeout: 265 seconds]
pcercuei has quit [Ping timeout: 260 seconds]
pcercuei has joined #qi-hardware
pcercuei has quit [Ping timeout: 245 seconds]
jekhor has quit [Ping timeout: 240 seconds]
pcercuei has joined #qi-hardware
<apelete> mth: ok now, I added the folloqing lines at the beginning of ep_config_from_hw():
<apelete> u32 * clk_gate_reg = 0x10000020 + 0xA0000000;
<apelete> pr_debug("%s: clk_gate_reg value is %x\n", musb_driver_name, &clk_gate_reg);
<apelete> during boot I get:
<apelete> [ 1.940000] musb-hdrc: clk_gate_reg value is 81c25b18
<apelete> according to programming manual, udc bit in gate clock register is 11th bit (counting from 0)
<apelete> mth: if what I did seems correct to you, then 11th is set to 1 in hex number 81c25b18
<apelete> mth: programming manual says:
<apelete> 1: Only udc enters suspend mode, udc_hclk
<apelete> 0: udc_hclk always running, don’t stop
<apelete> has been stopped . if the bit is 1 and udc
<apelete> doesn’t enters suspend mode, udc_hclk
<apelete> always runs
<apelete> mth: so I guess the clock is not running then, as you hinted. is this correct ?
pcercuei has quit [Ping timeout: 272 seconds]
pcercuei has joined #qi-hardware
<mth> apelete: you're taking the address instead of dereferencing
<mth> to be on the safe side, adding "volatile" to the type would be good, but if you read it only once that doesn't really matter
<apelete> crap, didn't noticed I was writing & instead of * there...
lekernel has quit [Quit: Leaving]
<apelete> changing
<apelete> pr_debug("%s: clk_gate_reg value is %x\n", musb_driver_name, &clk_gate_reg);
<apelete> pr_debug("%s: clk_gate_reg value is %x\n", musb_driver_name, *clk_gate_reg);
<apelete> to
<apelete> I now get:
<apelete> [ 1.960000] musb-hdrc: clk_gate_reg value is eb58
<apelete> mth: correct value now, 11th bit still set to 1 it seems
<mth> 11th bit or bit 11?
<mth> (since bit 11 is the 12th bit from right)
<apelete> bit 11, sorry
<apelete> bit 11 indeed, counting from 0 it's the 12th bit :-)
<apelete> programming manual says: Bit -> 11, Module -> UDC, Descrption -> "0: udc_hclk always running, don’t stop
<apelete> 1: Only udc enters suspend mode, udc_hclk
<apelete> has been stopped . if the bit is 1 and udc
<apelete> doesn’t enters suspend mode, udc_hclk
<mth> yes, it's different from the other clock gate bits
<mth> so it being 1 might not be a problem, but you could try forcing it to 0 to see if that changes anything (just for testing)
<mth> or print the sleep control reg
<apelete> mth: here it is:
<apelete> [ 1.920000] musb-hdrc: sleep_control_reg value is 1540
<apelete> manual says: Bits -> 15:8, Name -> 01ST, Description:
<mth> ok, bit 6 is 1, so udc is not suspended
<apelete> ok
<apelete> so what do you think is going on then ?
<mth> no idea; the clock being disabled was my best guess
<mth> try looking inside the method that reports the read error, to see at what point it decides the read failed
<mth> also check whether the old driver does any kind of endpoint scanning
<mth> or if it doesn't, what addresses it uses to program endpoints
<apelete> ok
<apelete> mth: thanks for the help all along, that was very helpulf (and supportive) :)
<mth> you're welcome
<apelete> I might feel sleepy tomorrow at work (it's getting late here), but it was worth it. learned a few things tonight :)
dos1 has quit [Ping timeout: 240 seconds]