aloksinha2001 / picuntu-3.0.8-alok

Integrated kernel for Picuntu 3.0.8-alok+
Other
36 stars 34 forks source link

MT5931 Wifi and MT6622 Bluetooth support #2

Open Galland opened 11 years ago

Galland commented 11 years ago

Thanks for adding the Rikomagic Mediatek code. From my side, I've found more Linux-like drivers in this repo: git://github.com/Anderxale/7300-kern.git

Take a look at folder: 7300-kern/common/drivers/amlogic/wifi/mtk_5931/

UPDATE: The repo has been deleted!! I cloned it a couple weeks ago. I'll reupload the mtk folder to a repo of my own

aloksinha2001 commented 11 years ago

Very interesting...

Looks like we have a match... atleast on the face of it...

Can you spend some time, to get a pull request for me to merge into main ... If you can compile a module for picuntu-3.0.8-alok+ kernel, I can test this out...

Alok

On Wed, Apr 3, 2013 at 11:50 PM, Galland notifications@github.com wrote:

Thanks for adding the Rikomagic Mediatek code. From my side, I've found more Linux-like drivers in this repo: git://github.com/Anderxale/7300-kern.git

Take a look at folder: 7300-kern/common/drivers/amlogic/wifi/mtk_5931/

— Reply to this email directly or view it on GitHubhttps://github.com/aloksinha2001/picuntu-3.0.8-alok/issues/2 .


http://www.linkedin.com/profile/view?id=12406006&trk=tab_pro http://aloksinha2001.blogspot.in

Galland commented 11 years ago

Yes I'll try that. I'm currently uploading the code to: https://github.com/Galland/MTK5931

If you want to follow-up on my findings, I've been posting everything to http://hwswbits.blogspot.com

aloksinha2001 commented 11 years ago

Very impressive documentation on the blog... When I get to update the sites.. I will add up links to your blog as well.. very well done !!

Let's hope the next wifi and bt adventures work out... :)

Alok

On Thu, Apr 4, 2013 at 12:03 AM, Galland notifications@github.com wrote:

Yes I'll try that. I'm currently uploading the code to: https://github.com/Galland/MTK5931

If you want to follow-up on my findings, I've been posting everything to http://hwswbits.blogspot.com

— Reply to this email directly or view it on GitHubhttps://github.com/aloksinha2001/picuntu-3.0.8-alok/issues/2#issuecomment-15854938 .


http://www.linkedin.com/profile/view?id=12406006&trk=tab_pro http://aloksinha2001.blogspot.in

aloksinha2001 commented 11 years ago

Any views or thoughts on this, mate ?

Alok

On Wed, Apr 3, 2013 at 2:49 PM, Alok Sinha asinha@g8.net wrote:

Very impressive documentation on the blog... When I get to update the sites.. I will add up links to your blog as well.. very well done !!

Let's hope the next wifi and bt adventures work out... :)

Alok

On Thu, Apr 4, 2013 at 12:03 AM, Galland notifications@github.com wrote:

Yes I'll try that. I'm currently uploading the code to: https://github.com/Galland/MTK5931

If you want to follow-up on my findings, I've been posting everything to http://hwswbits.blogspot.com

— Reply to this email directly or view it on GitHubhttps://github.com/aloksinha2001/picuntu-3.0.8-alok/issues/2#issuecomment-15854938 .


http://www.linkedin.com/profile/view?id=12406006&trk=tab_pro http://aloksinha2001.blogspot.in


http://www.linkedin.com/profile/view?id=12406006&trk=tab_pro http://aloksinha2001.blogspot.in

Galland commented 11 years ago

I'm stuck with that part :( I moved to the 3D. I wish you better luck with it!

aloksinha2001 commented 11 years ago

Ok - if the 3D has worked for you.. then it might be useful to merge the forks... ??

Alok

Galland commented 11 years ago

That's great! we have been working on this, but did not get it to work. Could you elaborate on how did you integrate the MTK5931 repo into the picuntu kernel? from that point I can help you with getting it fully working. Awesome work!

Galland commented 11 years ago

Here is the latest MT5931 WIFI_RAM_CODE (released today!): https://github.com/aloksinha2001/Linux3188/tree/master/drivers/net/wireless/mt5931/firmware_5931

About the gpio, the pins are likely to be the same for many other sticks since they tend to copy Rockchip's standard PCB design, so hopefully your work will help many people, please let me know when you upload your source :)

Galland commented 11 years ago

You have done an excellent job with this. Thank you very much!

We are currently working very hard on the last released kernel (which includes rk3188 support), which may include an updated driver along with the FW I linked you to (that link points to this kernel). I'm currently working on having that kernel boot for rk3066 devices.

Thanks again for your development updates!

usumfabricae commented 11 years ago

I'll check that driver to see wether it works with his firmware. I saw some changes in the source that could solve this issue. I'll keep you updated

Galland commented 11 years ago

I've just finished tonight the changes required for the rk3188 kernel to boot also for rk3066 devices. There is a config option for MT5931 and MT662X that I guess enables those drivers. If you would like to check if it works, here is the repo: https://github.com/Galland/Linux3188

RubCaj commented 11 years ago

Great Work ! Thanks I will also test ist just now! Searching and probing for working MT5931 since weeks :-( I'll share the results

fgroenendijk commented 11 years ago

Hello guys,

unrelated to this issue, but for me a bit related since I have the mediatek chip as well, and that's not working yet. I've got an external usb network adapter with the cryptic name HG20F9. Compiling it was a success, but I did need to make some small adjustments to the code. Do you want this code as a git diff?

Currently running this external usb network adapter, and it's working like a charm.

RubCaj commented 11 years ago

now a quick and dirty test: RK3066 (MK 802IIIS) with MT5931 and 6622

GPIO failed ... [ 1.399196] mt6622_probe. [ 1.400740] mt6622 reset_gpio is busy! [ 1.402364] mt6622: probe of mt6622 failed with error -1 ... Like to build modules mt5931.ko to test

Long dmesg :

[ 0.000000] Initializing cgroup subsys cpuset [ 0.000000] Initializing cgroup subsys cpu [ 0.000000] Linux version 3.0.36+ (root@z9ubi64) (gcc version 4.6 20120106 (prerelease) (GCC) ) #6 SMP PREEMPT Thu Jun 20 20:54:35 CEST 2013 [ 0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c53c7d [ 0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache [ 0.000000] Machine: RK30board [ 0.000000] Ignoring tag cmdline (using the default kernel command line) [ 0.000000] memory reserve: Memory(base:0x96000000 size:8M) reserved for [ 0.000000] memory reserve: Memory(base:0x94000000 size:32M) reserved for [ 0.000000] memory reserve: Memory(base:0x93800000 size:8M) reserved for [ 0.000000] memory reserve: Memory(base:0x93000000 size:8M) reserved for [ 0.000000] memory reserve: Memory(base:0x91c00000 size:20M) reserved for [ 0.000000] memory reserve: Total reserved 76M [ 0.000000] Memory policy: ECC disabled, Data cache writeback [ 0.000000] bootconsole [earlycon0] enabled [ 0.000000] CPU SRAM: copied sram code from c0df2000 to fef00010 - fef02528 [ 0.000000] CPU SRAM: copied sram data from c0df4518 to fef02528 - fef02c9c [ 0.000000] sramlog: : <W 24 n n \ B > 2 DV % 6Y DX k o ('E [ 0.000000] Omegamoon >> board_clock_init called [ 0.000000] rk30_dvfs_init [ 0.000000] Omegamoon >> Current GPU frequency is 148MHz [ 0.000000] Omegamoon >> Current CPU frequency is 816MHz [ 0.000000] Omegamoon >> aclk_cpu = 272 MHz [ 0.000000] Omegamoon >> hclk_cpu = 136 MHz [ 0.000000] Omegamoon >> pclk_cpu = 68 MHz [ 0.000000] Omegamoon >> aclk_periph = 148 MHz [ 0.000000] Omegamoon >> hclk_periph = 148 MHz [ 0.000000] Omegamoon >> pclk_periph = 74 MHz [ 0.000000] L310 cache controller enabled [ 0.000000] l2x0: 16 ways, CACHE_ID 0x4100c0c8, AUX_CTRL 0x76050001, Cache size: 524288 B [ 0.000000] DDR DEBUG: version 1.00 20130427 [ 0.000000] DDR DEBUG: Omegamoon >> ddr_init(21, 400) called... [ 0.000000] DDR DEBUG: Omegamoon >> loops_per_us is 0 at this point [ 0.000000] DDR DEBUG: Omegamoon >> Adjusted loops_per_us to 300 [ 0.000000] DDR DEBUG: DDR3 Device [ 0.000000] DDR DEBUG: Bus Width=32 Col=10 Bank=8 Row=15 CS=1 Total Capability=1024MB [ 0.000000] DDR DEBUG: Omegamoon >> ddr_init called, SKIPPING ddr_adjust_config [ 0.000000] DDR DEBUG: Omegamoon >> ddr_init called, SKIPPING ddr_change_freq [ 0.000000] DDR DEBUG: Omegamoon >> ddr_init called, just before clk_set_rate [ 0.000000] DDR DEBUG: init success!!! freq=300MHz [ 0.000000] DDR DEBUG: DTONE=0x1, DTERR=0x0, DTIERR=0x0, DTPASS=0x5, DGSL=1 extra clock, DGPS=90 [ 0.000000] DDR DEBUG: DTONE=0x1, DTERR=0x0, DTIERR=0x0, DTPASS=0x4, DGSL=1 extra clock, DGPS=90 [ 0.000000] DDR DEBUG: DTONE=0x1, DTERR=0x0, DTIERR=0x0, DTPASS=0x4, DGSL=1 extra clock, DGPS=90 [ 0.000000] DDR DEBUG: DTONE=0x1, DTERR=0x0, DTIERR=0x0, DTPASS=0x5, DGSL=1 extra clock, DGPS=90 [ 0.000000] DDR DEBUG: ZERR=0, ZDONE=1, ZPD=0x0, ZPU=0x0, OPD=0x0, OPU=0x0 [ 0.000000] DDR DEBUG: DRV Pull-Up=0xa, DRV Pull-Dwn=0xb [ 0.000000] DDR DEBUG: ODT Pull-Up=0x4, ODT Pull-Dwn=0x4 [ 0.000000] rk30_iomux_init [ 0.000000] Boot mode: RECOVERY (2) flag: RECOVER (0xc3524203) [ 0.000000] On node 0 totalpages: 242688 [ 0.000000] free_area_init_node: node 0, pgdat c0da6cc0, node_mem_map c187c000 [ 0.000000] Normal zone: 1744 pages used for memmap [ 0.000000] Normal zone: 0 pages reserved [ 0.000000] Normal zone: 202032 pages, LIFO batch:31 [ 0.000000] HighMem zone: 304 pages used for memmap [ 0.000000] HighMem zone: 38608 pages, LIFO batch:7 [ 0.000000] PERCPU: Embedded 7 pages/cpu @c2084000 s6976 r8192 d13504 u32768 [ 0.000000] pcpu-alloc: s6976 r8192 d13504 u32768 alloc=8_4096 [ 0.000000] pcpu-alloc: [0] 0 [0] 1 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 240640 [ 0.000000] Kernel command line: root=LABEL=linuxroot init=/sbin/init loglevel=8 rootfstype=ext4 rootwait mtdparts=rk29xxnand:0x00002000@0x00000000(parameter),0x00002000@0x00002000(misc),0x00004000@0x00004000(kernel),0x00008000@0x00008000(boot),0x00008000@0x00010000(recovery) [ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes) [ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) [ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) [ 0.000000] allocated 4194304 bytes of page_cgroup [ 0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups [ 0.000000] Memory: 796MB 152MB = 948MB total [ 0.000000] Memory: 936600k/936600k available, 111976k reserved, 155648K highmem [ 0.000000] Virtual kernel memory layout: [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB) [ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB) [ 0.000000] DMA : 0xffc00000 - 0xffe00000 ( 2 MB) [ 0.000000] vmalloc : 0xf7000000 - 0xfe800000 ( 120 MB) [ 0.000000] lowmem : 0xc0000000 - 0xf6800000 ( 872 MB) [ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB) [ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB) [ 0.000000] .init : 0xc0408000 - 0xc06f4000 (2992 kB) [ 0.000000] .text : 0xc06f4000 - 0xc0d77a4c (6671 kB) [ 0.000000] .data : 0xc0d78000 - 0xc0da7800 ( 190 kB) [ 0.000000] .bss : 0xc0df5024 - 0xc187bee0 (10780 kB) [ 0.000000] SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 [ 0.000000] Preemptible hierarchical RCU implementation. [ 0.000000] NR_IRQS:448 [ 0.000000] rk30_gpio_init: 176 gpio irqs in 6 banks [ 0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms [ 0.000000] Console: colour dummy device 80x30 [ 0.000000] console [tty0] enabled, bootconsole disabled [ 0.010696] Calibrating delay loop (skipped) preset value.. 1631.46 BogoMIPS (lpj=8157341) [ 0.010728] pid_max: default: 32768 minimum: 301 [ 0.010985] Mount-cache hash table entries: 512 [ 0.011630] Initializing cgroup subsys debug [ 0.011653] Initializing cgroup subsys cpuacct [ 0.011716] Initializing cgroup subsys memory [ 0.011754] Initializing cgroup subsys devices [ 0.011771] Initializing cgroup subsys freezer [ 0.011787] Initializing cgroup subsys blkio [ 0.011836] CPU: Testing write buffer coherency: ok [ 0.102594] CPU1: Booted secondary processor [ 0.102642] Brought up 2 CPUs [ 0.102669] SMP: Total of 2 processors activated (3262.93 BogoMIPS). [ 0.103084] devtmpfs: initialized [ 0.110865] NET: Registered protocol family 16 [ 0.110945] last_log: 0xf1500000 map to 0xf7004000 and copy to 0xc0df9328 (version 2.1) [ 0.124551] DVFS MSG: AVS Value(index=0): 0 0 0 0 0 0 0 0 0 0 [ 0.134965] lcdc0 is used as primary display device contoller! [ 0.135007] warning:lcdc1 not add to system! [ 0.235258] rk29sdk_wifi_bt_gpio_control_init: init finished [ 0.249666] bio: create slab at 0 [ 0.250330] SCSI subsystem initialized [ 0.250537] usbcore: registered new interface driver usbfs [ 0.250637] usbcore: registered new interface driver hub [ 0.250762] usbcore: registered new device driver usb [ 0.251051] rk30_i2c rk30_i2c.0: i2c-0: RK30 I2C adapter [ 0.251259] rk30_i2c rk30_i2c.1: i2c-1: RK30 I2C adapter [ 0.251403] rk30_i2c rk30_i2c.2: i2c-2: RK30 I2C adapter [ 0.251544] rk30_i2c rk30_i2c.3: i2c-3: RK30 I2C adapter [ 0.251682] rk30_i2c rk30_i2c.4: i2c-4: RK30 I2C adapter [ 0.251890] rk30-adc rk30-adc: rk30 adc: driver initialized [ 0.252238] timed_gpio_probe [ 0.252355] Advanced Linux Sound Architecture Driver Version 1.0.24. [ 0.252802] Bluetooth: Core ver 2.16 [ 0.252874] NET: Registered protocol family 31 [ 0.252911] Bluetooth: HCI device and connection manager initialized [ 0.252958] Bluetooth: HCI socket layer initialized [ 0.252995] Bluetooth: L2CAP socket layer initialized [ 0.253328] cfg80211: Calling CRDA to update world regulatory domain [ 0.254093] rk fb probe ok! [ 0.281479] tps65910_pre_init,line=20 [ 0.284509] TPS65910 Set default voltage. [ 0.286593] tps65910_pre_init,line=262 [ 0.296891] tps65910_post_init,line=271 [ 0.296925] tps65910_post_init:g_pmic_type=2 [ 0.299314] tps65910_post_init vdd_cpu =1200000mV end [ 0.301712] tps65910_post_init vdd2 =1200000mV end [ 0.312735] tps65910_post_init vio =3300000mV end [ 0.313773] tps65910_post_init vaux1 =2500000mV end [ 0.318449] tps65910_post_init,line=299 END [ 0.318485] tps65910_i2c_probe:irq=356,irq_base=384,gpio_base=384 [ 0.328149] tps65910-rtc tps65910-rtc: rtc core: registered tps65910 as rtc0 [ 0.330903] tps65910_rtc_probe:ok [ 0.330987] Switching to clocksource timer1 [ 0.331253] lcdc0:reg_phy_base = 0x1010c000,reg_vir_base:0xf70a0000 [ 0.331320] fb0:win1 [ 0.331326] fb1:win0 [ 0.331331] fb2:win2 [ 0.331444] rk30 lcdc0 clk enable... [ 0.331605] rk30 lcdc0 clk disable... [ 0.331644] lcdc0: dclk:148500000>>fps:60 rk30_load_screen for lcdc0 ok! [ 0.332031] Switched to NOHz mode on CPU #0 [ 0.332740] Switched to NOHz mode on CPU #1 [ 0.391784] fb0:phy:94000000>>vir:f8000000>>len:0x2000000 [ 0.391994] rk30_lcdc_open>>open:1>>cnt:0 [ 0.392126] rk30 lcdc0 clk enable... [ 0.392136] lcdc0 wakeup from standby! [ 0.392147] lcdc0 win1 open [ 0.392157] lcdc0 win1 open,atv layer:1 [ 0.392381] win1_set_par for lcdc0>>format:2>>>xact:1920>>yact:1080>>xsize:1920>>ysize:1080>>xvir:1920>>yvir:1080>>xpos:192>>ypos:41>> [ 0.392567] <6>lcdc0>>win1_display>>y_addr:0x94000000>>uv_addr:0x95000000 [ 0.409482] Console: switching to colour frame buffer device 240x67 [ 0.409514] <6>lcdc0>>win1_display>>y_addr:0x94000000>>uv_addr:0x95000000 [ 0.436023] rk_fb_register>>>>>fb0 [ 0.436328] rk_fb_register>>>>>fb1 [ 0.436576] rk_fb_register>>>>>fb2 [ 0.436651] rk30 lcdc0 probe ok! [ 0.436816] pwm_regulator_probe:n_voltages=19 [ 0.437054] pwm_regulator.0: driver initialized [ 0.453950] NET: Registered protocol family 2 [ 0.454177] IP route cache hash table entries: 32768 (order: 5, 131072 bytes) [ 0.454688] TCP established hash table entries: 131072 (order: 8, 1048576 bytes) [ 0.456667] TCP bind hash table entries: 65536 (order: 7, 786432 bytes) [ 0.457808] TCP: Hash tables configured (established 131072 bind 65536) [ 0.457933] TCP reno registered [ 0.458003] UDP hash table entries: 512 (order: 2, 16384 bytes) [ 0.458144] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes) [ 0.458641] NET: Registered protocol family 1 [ 0.577697] rk30-tsadc rk30-tsadc: initialized [ 0.577884] PMU: registered new PMU device of type 0 [ 0.578773] DVFS WARNING: vd_cpu : selector=86,but volt <=0

[ 0.579944] Loaded driver for PL330 DMAC-1 rk29-pl330 [ 0.580051] DBUFF-32x8bytes Num_Chans-6 Num_Peri-12 Num_Events-12 [ 0.580245] Loaded driver for PL330 DMAC-2 rk29-pl330 [ 0.580349] DBUFF-64x8bytes Num_Chans-7 Num_Peri-20 Num_Events-14 [ 0.581200] highmem bounce pool size: 64 pages [ 0.581476] ashmem: initialized [ 0.587642] fuse init (API version 7.16) [ 0.588018] msgmni has been set to 1525 [ 0.589044] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253) [ 0.589198] io scheduler noop registered [ 0.589279] io scheduler deadline registered [ 0.590998] io scheduler cfq registered (default) [ 0.592658] io scheduler vr registered [ 0.594182] io scheduler sio registered [ 0.601888] rga: Driver loaded succesfully [ 0.603476] HDMI: hdmi_register() - video source 0 display 0 [ 0.605148] HDMI: hdmi_submit_work event 0100 delay 0 [ 0.606718] HDMI: [ 0.606724] hdmi_work_queue() - evt= 1 0 [ 0.606825] RK30 HDMI: hdmi irq wake up [ 0.606838] [ 0.606858] HDMI: hdmi_submit_work event 0404 delay 10 [ 0.606921] HDMI: hdmi_submit_work event 0404 delay 10 [ 0.606975] rk30-hdmi rk30-hdmi: rk30 hdmi probe sucess. [ 0.612167] rk_serial.c v1.3 2012-12-14 [ 0.612421] rk_serial.0: ttyS0 at MMIO 0x10124000 (irq = 66) is a rk29_serial.0 [ 0.618798] HDMI: hdmi_work_queue() - exit [ 0.618808] [ 0.621440] HDMI: [ 0.621446] hdmi_work_queue() - evt= 4 4 [ 0.623942] RK30 HDMI: [rk30_hdmi_detect_hotplug] value c0 [ 0.623953] [ 0.626374] HDMI: hdmi_work_queue() - hpd is 2 hotplug is 0 [ 0.627662] HDMI: hdmi_wq_insert [ 0.628959] HDMI: hdmi_wq_parse_edid [ 0.630226] RK30 HDMI: [rk30_hdmi_read_edid] block 0 [ 0.630236] [ 0.641145] rk_serial rk_serial.0: membase 0xf70c4000 [ 0.642500] rk_serial.3: ttyS3 at MMIO 0x20068000 (irq = 69) is a rk29_serial.3 [ 0.651082] RK30 HDMI: [rk30_hdmi_read_edid] edid read value 98 [ 0.651095] [ 0.654321] RK30 HDMI: [rk30_hdmi_read_edid] edid read sucess [ 0.654334] [ 0.657058] 0x00 ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0x00 ,0x26 ,0xcd ,0x0c ,0x56 ,0x07 ,0x06 ,0x00 ,0x00 , [ 0.658773] 0x19 ,0x13 ,0x01 ,0x03 ,0x80 ,0x34 ,0x1d ,0x78 ,0x2a ,0x60 ,0x41 ,0xa6 ,0x56 ,0x4a ,0x9c ,0x25 , [ 0.660490] 0x12 ,0x50 ,0x54 ,0xbf ,0xef ,0x00 ,0x71 ,0x4f ,0x81 ,0x40 ,0x81 ,0x80 ,0x95 ,0x00 ,0x95 ,0x0f , [ 0.662229] 0xb3 ,0x00 ,0x01 ,0x01 ,0x01 ,0x01 ,0x02 ,0x3a ,0x80 ,0x18 ,0x71 ,0x38 ,0x2d ,0x40 ,0x58 ,0x2c , [ 0.663919] 0x45 ,0x00 ,0x09 ,0x25 ,0x21 ,0x00 ,0x00 ,0x1e ,0x00 ,0x00 ,0x00 ,0xfd ,0x00 ,0x38 ,0x4c ,0x1e , [ 0.665582] 0x53 ,0x11 ,0x00 ,0x0a ,0x20 ,0x20 ,0x20 ,0x20 ,0x20 ,0x20 ,0x00 ,0x00 ,0x00 ,0xfc ,0x00 ,0x50 , [ 0.667243] 0x4c ,0x32 ,0x34 ,0x30 ,0x39 ,0x48 ,0x44 ,0x0a ,0x20 ,0x20 ,0x20 ,0x20 ,0x00 ,0x00 ,0x00 ,0xff , [ 0.668932] 0x00 ,0x31 ,0x31 ,0x30 ,0x30 ,0x35 ,0x4d ,0x39 ,0x36 ,0x30 ,0x31 ,0x35 ,0x34 ,0x33 ,0x01 ,0x69 , [ 0.670667] RK30 HDMI: [rk30_hdmi_read_edid] block 1 [ 0.670678] [ 0.681066] rk_serial rk_serial.3: membase 0xf70c8000 [ 0.685433] loop: module loaded [ 0.686984] Android kernel panic handler initialized (bind=kpanic) [ 0.689289] rknand_init: [ 0.690967] rk_nand_probe: [ 0.692597] RK30 HDMI: [rk30_hdmi_read_edid] edid read value 98 [ 0.692611] [ 0.692618] platform_driver_register:ret = 0 [ 0.692644] PPP generic driver version 2.4.2 [ 0.693184] PPP Deflate Compression module registered [ 0.693204] PPP BSD Compression module registered [ 0.703406] RK30 HDMI: [rk30_hdmi_readedid] edid read sucess [ 0.703427] [ 0.706653] 0x02 ,0x03 ,0x1f ,0xf1 ,0x4c ,0x01 ,0x02 ,0x03 ,0x04 ,0x05 ,0x10 ,0x11 ,0x12 ,0x13 ,0x14 ,0x1e , [ 0.708524] 0x1f ,0x23 ,0x09 ,0x07 ,0x01 ,0x83 ,0x01 ,0x00 ,0x00 ,0x65 ,0x03 ,0x0c ,0x00 ,0x10 ,0x00 ,0x8c , [ 0.710364] 0x0a ,0xd0 ,0x8a ,0x20 ,0xe0 ,0x2d ,0x10 ,0x10 ,0x3e ,0x96 ,0x00 ,0x09 ,0x25 , [ 0.710752] PPP MPPE Compression module registered [ 0.710776] 0x21 ,0x00 ,0x00 , [ 0.710790] 0x18 ,0x01 ,0x1d ,0x00 ,0x72 ,0x51 ,0xd0 ,0x1e ,0x20 ,0x6e ,0x28 ,0x55 ,0x00 ,0x09 ,0x25 ,0x21 , [ 0.710833] 0x00 ,0x00 ,0x1e ,0x8c ,0x0a ,0xd0 ,0x90 ,0x20 ,0x40 ,0x31 ,0x20 ,0x0c ,0x40 ,0x55 ,0x00 ,0x09 , [ 0.710875] 0x25 ,0x21 ,0x00 ,0x00 ,0x18 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , [ 0.710915] 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , [ 0.710960] 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x4f , [ 0.711126] *\ Show Sink Info **** [ 0.711146] Support video mode: [ 0.711157] 1920x1080p@60Hz. [ 0.711173] 1920x1080p@50Hz. [ 0.711183] 1280x720p@60Hz. [ 0.711194] 1280x720p@50Hz. [ 0.711204] 720x576p@50Hz. [ 0.711213] 720x480p@60Hz. [ 0.711224] Support audio type: LPCM [ 0.711239] Support audio sample rate: [ 0.711252] 32000 [ 0.711260] 44100 [ 0.711268] 48000 [ 0.711276] Support audio word lenght: [ 0.711287] 16bit [ 0.711295] 20bit [ 0.711303] 24bit [ 0.711311] \ Show Sink Info ** [ 0.711333] HDMI: hdmi_wq_set_video [ 0.711374] lcdc0: dclk:148500000>>fps:60 rk30_load_screen for lcdc0 ok! [ 0.711434] win1_set_par for lcdc0>>format:2>>>xact:1920>>yact:1080>>xsize:1920>>ysize:1080>>xvir:1920>>yvir:1080>>xpos:192>>ypos:41>> [ 0.711489] <6>lcdc0>>win1_display>>y_addr:0x94000000>>uv_addr:0x95000000 [ 0.752541] NET: Registered protocol family 24 [ 0.752555] RK30 HDMI: [rk30_hdmi_config_video] [ 0.752566] [ 0.752846] RK30 HDMI: [rk30_hdmi_config_video] sucess output HDMI. [ 0.752860] [ 0.752869] RK30 HDMI: [rk30_hdmi_config_vsi] vic_3d 16 format 0. [ 0.752889] [ 0.752912] RK30 HDMI: [rk30_hdmi_config_vsi] info[0] is 0x81. [ 0.752934] [ 0.752945] RK30 HDMI: [rk30_hdmi_config_vsi] info[1] is 0x01. [ 0.752964] [ 0.752975] RK30 HDMI: [rk30_hdmi_config_vsi] info[2] is 0x04. [ 0.752995] [ 0.753004] RK30 HDMI: [rk30_hdmi_config_vsi] info[3] is 0x6b. [ 0.753019] [ 0.753028] RK30 HDMI: [rk30_hdmi_config_vsi] info[4] is 0x03. [ 0.753046] [ 0.753058] RK30 HDMI: [rk30_hdmi_config_vsi] info[5] is 0x0c. [ 0.753074] [ 0.753085] RK30 HDMI: [rk30_hdmi_config_vsi] info[6] is 0x00. [ 0.753103] [ 0.753115] RK30 HDMI: [rk30_hdmi_config_vsi] info[7] is 0x00. [ 0.753130] [ 0.753141] RK30 HDMI: [rk30_hdmi_config_vsi] info[8] is 0x00. [ 0.753162] [ 0.753174] RK30 HDMI: [rk30_hdmi_config_vsi] info[9] is 0x00. [ 0.753193] [ 0.799691] usbcore: registered new interface driver asix [ 0.801725] usbcore: registered new interface driver cdc_ether [ 0.803634] usbcore: registered new interface driver net1080 [ 0.805469] Rockchip WiFi SYS interface (V1.00) ... [ 0.807303] Initializing USB Mass Storage driver... [ 0.809091] usbcore: registered new interface driver usb-storage [ 0.810827] USB Mass Storage support registered. [ 0.812768] usbcore: registered new interface driver usbserial [ 0.814619] USB Serial support registered for generic [ 0.816476] usbcore: registered new interface driver usbserial_generic [ 0.818314] usbserial: USB Serial Driver core [ 0.820132] USB Serial support registered for GSM modem (1-port) [ 0.822062] usbcore: registered new interface driver option [ 0.823884] option: v0.7.2:USB Driver for GSM modems [ 0.951069] RK30 HDMI: [rk30_hdmi_control_output] 3 [ 0.951078] [ 0.954369] HDMI: hdmi_wq_set_audio [ 0.956088] HDMI: hdmi_wq_set_output mute 0 [ 0.957687] RK30 HDMI: [rk30_hdmi_control_output] 0 [ 0.957695] [ 0.960603] RK30 HDMI: [rk30_hdmi_set_pwr_mode] mode 4 [ 0.960611] [ 0.981053] RK30 HDMI: [rk30_hdmi_set_pwr_mode] curmode 40 [ 0.981062] [ 0.984256] RK30 HDMI: [rk30_hdmi_set_pwr_mode] mode 8 [ 0.984264] [ 1.001054] RK30 HDMI: [rk30_hdmi_set_pwr_mode] curmode 80 [ 1.001062] [ 1.021071] HDMI: hdmi_work_queue() - exit [ 1.021078] [ 1.024151] HDMI: [ 1.024156] hdmi_work_queue() - evt= 4 4 [ 1.026886] RK30 HDMI: [rk30_hdmi_detect_hotplug] value c0 [ 1.026894] [ 1.029732] HDMI: hdmi_work_queue() - hpd is 2 hotplug is 2 [ 1.031222] HDMI: hdmi_work_queue() - exit [ 1.031229] [ 1.047055] DWC_OTG: ^^^^^^^^^^^^^^^^^^Host Mode [ 1.048498] usb20_otg usb20_otg: DWC OTG Controller [ 1.049967] usb20_otg usb20_otg: new USB bus registered, assigned bus number 1 [ 1.051516] usb20_otg usb20_otg: irq 48, io mem 0x00000000 [ 1.053031] DWC_OTG: Init: Port Power? op_state=1 [ 1.054487] DWC_OTG: Init: Power Port (0) [ 1.055985] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 [ 1.057492] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 1.058981] usb usb1: Product: DWC OTG Controller [ 1.060346] usb usb1: Manufacturer: Linux 3.0.36+ dwc_otg_hcd [ 1.061873] usb usb1: SerialNumber: usb20_otg [ 1.063729] hub 1-0:1.0: USB hub found [ 1.065216] hub 1-0:1.0: 1 port detected [ 1.069025] DWC_OTG: host20_driver_probe host2.0 reg addr: 0x101c0000 remap:0xf7180000 [ 1.280981] DWC_OTG: ^^^^^^^^^^^^^^^^^^Host Mode [ 1.282612] usb20_host usb20_host: DWC OTG Controller [ 1.284239] usb20_host usb20_host: new USB bus registered, assigned bus number 2 [ 1.285907] usb20_host usb20_host: irq 49, io mem 0x00000000 [ 1.287560] DWC_OTG: Init: Port Power? op_state=1 [ 1.289160] DWC_OTG: Init: Power Port (0) [ 1.290809] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002 [ 1.292466] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 1.294082] usb usb2: Product: DWC OTG Controller [ 1.295743] usb usb2: Manufacturer: Linux 3.0.36+ host20_hcd [ 1.297432] usb usb2: SerialNumber: usb20_host [ 1.299405] hub 2-0:1.0: USB hub found [ 1.301059] hub 2-0:1.0: 1 port detected [ 1.302983] DWC_OTG: Mode Mismatch Interrupt: currently in Host mode [ 1.305568] android_usb gadget: Mass Storage Function, version: 2009/09/11 [ 1.307278] android_usb gadget: Number of LUNs=2 [ 1.308891] lun0: LUN: removable file: (no medium) [ 1.310387] lun1: LUN: removable file: (no medium) [ 1.312219] android_usb gadget: android_usb ready [ 1.314023] input: rk29-keypad as /devices/platform/rk29-keypad/input/input0 [ 1.316120] usbcore: registered new interface driver xpad [ 1.318153] using rtc device, tps65910, for alarms [ 1.318457] lirc_dev: IR Remote Control driver registered, major 251 [ 1.321675] IR NEC protocol handler initialized [ 1.323346] IR RC5(x) protocol handler initialized [ 1.325005] IR RC6 protocol handler initialized [ 1.326474] IR JVC protocol handler initialized [ 1.328080] IR Sony protocol handler initialized [ 1.329666] IR RC5 (streamzap) protocol handler initialized [ 1.331315] IR LIRC bridge handler initialized [ 1.332894] Linux video capture interface: v2.00 [ 1.334664] usbcore: registered new interface driver uvcvideo [ 1.336285] USB Video Class driver (v1.1.0) [ 1.337926] def_ref_volt: 2500mV, curr_ref_volt: 2500mV [ 1.340237] device-mapper: uevent: version 1.0.3 [ 1.342153] device-mapper: ioctl: 4.20.0-ioctl (2011-02-02) initialised: dm-devel@redhat.com [ 1.343899] Bluetooth: HCI UART driver ver 2.2 [ 1.345587] Bluetooth: HCI H4 protocol initialized [ 1.347228] Bluetooth: HCI BCSP protocol initialized [ 1.348910] Bluetooth: HCILL protocol initialized [ 1.350575] Bluetooth: HCIATH3K protocol initialized [ 1.352216] Bluetooth: BlueFRITZ! USB driver ver 1.2 [ 1.353855] usbcore: registered new interface driver bfusb [ 1.355452] Bluetooth: Generic Bluetooth USB driver ver 0.6 [ 1.357076] usbcore: registered new interface driver btusb [ 1.358660] Bluetooth: Generic Bluetooth SDIO driver ver 0.1 [ 1.360331] [imoseyon] interactiveX enter [ 1.362060] cpuidle: using governor ladder [ 1.363667] cpuidle: using governor menu [ 1.380531] [ 1.380535] drivers/mmc/core/core.c...1824.. ===== mmc_rescan Begin....[mmc0] [ 1.380549] .Line3910..The End of SDMMC-probe Ver.5.03 The last modify date is 2013-02-21. [sd_mmc] [ 1.380938] .Line3910..The End of SDMMC-probe Ver.5.03 The last modify date is 2013-02-21. [sdio] [ 1.382917] usbcore: registered new interface driver usbhid [ 1.382938] usbhid: USB HID core driver [ 1.391375] logger: created 256K log 'log_main' [ 1.392890] logger: created 256K log 'log_events' [ 1.394518] logger: created 256K log 'log_radio' [ 1.395630] rk29_sdmmc_change_clk_div..1935.. newDiv=62, newCLK=299Khz [sd_mmc] [ 1.397603] logger: created 256K log 'log_system' [ 1.399196] mt6622_probe. [ 1.400740] mt6622 reset_gpio is busy! [ 1.402364] mt6622: probe of mt6622 failed with error -1 [ 1.405069] asoc: hdmi-audio-codec <-> rk29_i2s.0 mapping ok [ 1.406954] ALSA device list: [ 1.408493] #0: ROCKCHIP HDMI [ 1.409947] GACT probability NOT on [ 1.411516] Mirror/redirect action on [ 1.411579] u32 classifier [ 1.413045] Actions configured [ 1.414518] Netfilter messages via NETLINK v0.30. [ 1.416086] nf_conntrack version 0.5.0 (14634 buckets, 58536 max) [ 1.418095] ctnetlink v0.93: registering with nfnetlink. [ 1.419672] NF_TPROXY: Transparent proxy support initialized, version 4.1.0 [ 1.421247] NF_TPROXY: Copyright (c) 2006-2007 BalaBit IT Ltd. [ 1.423086] xt_time: kernel timezone is -0000 [ 1.424772] ip_tables: (C) 2000-2006 Netfilter Core Team [ 1.426289] arp_tables: (C) 2002 David S. Miller [ 1.427872] TCP cubic registered [ 1.429793] NET: Registered protocol family 10 [ 1.432081] Mobile IPv6 [ 1.433670] ip6_tables: (C) 2000-2006 Netfilter Core Team [ 1.435349] IPv6 over IPv4 tunneling driver [ 1.437317] [ 1.437322] mmc_attach_sd..1219.. ===== Begin to identify card as SD-card. [mmc0] [ 1.437734] NET: Registered protocol family 17 [ 1.437821] NET: Registered protocol family 15 [ 1.438103] Bridge firewalling registered [ 1.438447] Bluetooth: RFCOMM TTY layer initialized [ 1.438492] Bluetooth: RFCOMM socket layer initialized [ 1.438510] Bluetooth: RFCOMM ver 1.11 [ 1.438531] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 1.438550] Bluetooth: BNEP filters: protocol multicast [ 1.438645] NET: Registered protocol family 35 [ 1.439012] lib80211: common routines for IEEE802.11 drivers [ 1.439026] lib80211_crypt: registered algorithm 'NULL' [ 1.439245] VFP support v0.3: rk30-camera version: v0.2.31 Zoom by ipp [ 1.459484] implementor 41 architecture 3 part 30 variant 9 rev 4 [ 1.461366] get cif ldo failed! [ 1.462901] get cif ldo failed! [ 1.467762] get cif ldo failed! [ 1.469233] camera 34-0-ov5642_back: Probe ov5642_back failed [ 1.470749] rk30-camera version: v0.2.31 Zoom by ipp [ 1.472450] tps65910-rtc tps65910-rtc: setting system clock to 2013-06-20 19:08:51 UTC (1371755331) [ 1.474361] usbcore: registered new interface driver snd-usb-audio [ 1.475928] Warning: unable to open an initial console. [ 1.477772] Freeing init memory: 2992K [ 1.479465] get cif ldo failed! [ 1.481352] get cif ldo failed! [ 1.487385] get cif ldo failed! [ 1.489082] camera 33-0-ov2659_front: Probe ov2659_front failed [ 1.514741] rk29_sdmmc_change_clk_div..1935.. newDiv=0, newCLK=37125Khz [sd_mmc] [ 1.516774] mmc0: new high speed SDHC card at address aaaa [ 1.519090] mmcblk0: mmc0:aaaa SU08G 7.40 GiB [ 1.522727] [ 1.522732] msdos_partition..461... ==== Begin to parse sdcard-partition. [mmc0] [ 1.526312] msdos_partition..530... ==== The sdcard has MBR. [mmc0] [ 1.528096] msdos_partition..543... ==== partition-1, size=7760896KB [mmc0] [ 1.529830] msdos_partition..571... ==== main partition-1....[mmc0] [ 1.531686] mmcblk0: p1 [ 1.534018] mmc_rescan_try_freq..1718.. ===== Initialize SD-card successfully. [mmc0] [ 1.536067] [ 1.536073] drivers/mmc/core/core.c...1824.. ===== mmc_rescan Begin....[mmc1] [ 1.558526] udevd[95]: starting version 175 [ 1.691248] usb 2-1: new high speed USB device number 2 using usb20_host [ 1.829889] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null) [ 1.901373] usb 2-1: New USB device found, idVendor=0409, idProduct=005a [ 1.903434] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 1.906195] hub 2-1:1.0: USB hub found [ 1.908345] hub 2-1:1.0: 4 ports detected [ 2.181722] usb 2-1.1: new high speed USB device number 3 using usb20_host [ 2.296825] usb 2-1.1: New USB device found, idVendor=0b95, idProduct=772a [ 2.310776] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 2.324061] usb 2-1.1: Product: AX88x72A [ 2.335295] usb 2-1.1: Manufacturer: ASIX Elec. Co\xffffffe0\xffffffbd\xffffffb2\xffffffbd\xffffffb2p. [ 2.346821] usb 2-1.1: SerialNumber: 000002 [ 2.953649] init: ureadahead main process (164) terminated with status 5 [ 3.044123] ASIX USB Ethernet Adapter:v4.1.1 20:47:29 Jun 20 2013 [ 3.044144] <6> http://www.asix.com.tw [ 3.049960] ----> axusbnet_probe 1276:bind ASIX AX88772A USB 2.0 Ethernet [ 3.052968] eth%d: status ep1in, 8 bytes period 11 [ 3.056729] eth0: register 'asix' at usb-usb20_host-1.1, ASIX AX88772A USB 2.0 Ethernet, 00:10:13:ae:a4:ba [ 3.141279] usb 2-1.2: new low speed USB device number 4 using usb20_host [ 3.224605] init: mounted-proc main process (170) terminated with status 1 [ 3.283148] usb 2-1.2: New USB device found, idVendor=04d9, idProduct=2519 [ 3.285276] usb 2-1.2: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [ 3.287313] usb 2-1.2: Product: 2.4G Wireless Touchpad Keyboard [ 3.311377] input: 2.4G Wireless Touchpad Keyboard as /devices/platform/usb20_host/usb2/2-1/2-1.2/2-1.2:1.0/input/input1 [ 3.314669] generic-usb 0003:04D9:2519.0001: input,hidraw0: USB HID v1.10 Keyboard [2.4G Wireless Touchpad Keyboard] on usb-usb20_host-1.2/input0 [ 3.343763] input: 2.4G Wireless Touchpad Keyboard as /devices/platform/usb20_host/usb2/2-1/2-1.2/2-1.2:1.1/input/input2 [ 3.346794] generic-usb 0003:04D9:2519.0002: input,hidraw1: USB HID v1.10 Mouse [2.4G Wireless Touchpad Keyboard] on usb-usb20_host-1.2/input1 [ 3.451805] EXT4-fs (mmcblk0p1): re-mounted. Opts: (null) [ 4.064598] udevd[322]: starting version 175 [ 4.604991] DWC_OTG: frame_number 0x18dc, start 0x18d7, complete: 1 [ 4.605042] DWC_OTG: frame_number 0x18dc, start 0x18d7, complete: 1 [ 4.934789] <6>lcdc0>>win1_display>>y_addr:0x94000000>>uv_addr:0x95000000 [ 5.337596] <6>lcdc0>>win1_display>>y_addr:0x94000000>>uv_addr:0x95000000 [ 5.483383] <6>lcdc0>>win1_display>>y_addr:0x94000000>>uv_addr:0x95000000 [ 5.817903] <6>lcdc0>>win1_display>>y_addr:0x94000000>>uv_addr:0x95000000 [ 6.112736] eth0: open: enable queueing (rx 44, tx 60) mtu 1500 ASIX framing [ 6.113029] eth0: rxqlen 0 --> 10 [ 6.113161] eth0: rxqlen 10 --> 20 [ 6.113373] eth0: rxqlen 20 --> 30 [ 6.113493] eth0: rxqlen 30 --> 40 [ 6.113564] eth0: rxqlen 40 --> 44 [ 8.546180] eth0: ax88772a - Link status is: 0 [ 10.338192] eth0: ax88772a - Link status is: 1

Galland commented 11 years ago

check arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c

usumfabricae used these ones in his iMito stick and communicated with it:

define RK30SDK_WIFI_GPIO_POWER_N RK30_PIN3_PC7

define RK30SDK_WIFI_GPIO_RESET_N RK30_PIN3_PD1

For reference: https://github.com/usumfabricae/picuntu-3.0.8-alok/commit/2ed3e5bc6479c854dd16384d14b4f2c81fcb3181

usumfabricae commented 11 years ago

Successfully tested Just do the changes on:

define RK30SDK_WIFI_GPIO_POWER_N RK30_PIN3_PC7

define RK30SDK_WIFI_GPIO_RESET_N RK30_PIN3_PD1

compile it as a module: comment in Linux3188/drivers/net/wireless/Makefile

obj-$(CONFIG_MT5931) += mt5931/

obj-$(CONFIG_MT5931_MT6622) += mt5931/

and build the kernel

Build wlan.ko replace Makefile with Makefile.modulein Linux3188/drivers/net/wireless/mt5931 and fix KDIR within Makefile

in ./os/linux/gl_init.c uncomment the following module_init(initWlan); module_exit(exitWlan); Than build the module

usumfabricae commented 11 years ago

Can I open another Issue on ISOCHRONOUS USB data transfer. Is there anyone interested in fixing this kind of bug?

RubCaj commented 11 years ago

6/21/2013 next compiling test with module creating Thanks to both !!!

Galland commented 11 years ago

by the way, just found a "wifi_launcher" folder under /drivers/net/wireless and see that it is the one calling "rockchip_wifi_init_module" (a symbol exported by mt5931), maybe that has to be compiled in (need to modify wireless Makefile to include that folder)

usumfabricae commented 11 years ago

committed changes on https://github.com/usumfabricae/Linux3188 Wifi Works fine thre're still some messages to be removed from log. Now I'm looking to see if I can get bluetooth 6522 working as well

RubCaj commented 11 years ago

No succes on MK802IIIS:

define RK30SDK_WIFI_GPIO_POWER_N RK30_PIN3_PC7

define RK30SDK_WIFI_GPIO_RESET_N RK30_PIN3_PD1

in arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c

[ 1.361765] mt6622_probe. [ 1.363231] mt6622 reset_gpio is busy! [ 1.364566] mt6622: probe of mt6622 failed with error -1

Inspection: .config https://gist.github.com/RubCaj/5841962#file-config-20130622_172213

board-rk30-sdk-sdmmc.c https://gist.github.com/RubCaj/5841962#file-board-rk30-sdk-sdmmc-c

Next test: module wlan.ko creation and newest https://github.com/usumfabricae/Linux3188 15 mins ago

usumfabricae commented 11 years ago

NO LUCK with Blutooth. As long as I try to power on BT I get the following. I think there's a mismatch in GPIO mapping for BT

<3>[ 85.502405] init: untracked pid 197 exited <6>[ 116.781044] [MT6622] mt_bt_power_on ++ <4>[ 116.787013] ------------[ cut here ]------------ <4>[ 116.792436] WARNING: at drivers/gpio/gpiolib.c:101 gpio_ensure_requested+0x44/0x118() <7>[ 116.798423] autorequest GPIO-359 <7>[ 116.804417] [](unwind_backtrace+0x0/0xe0) from [](warn_slowpath_common+0x4c/0x64) <7>[ 116.811470] [](warn_slowpath_common+0x4c/0x64) from [](warn_slowpath_fmt+0x2c/0x3c) <7>[ 116.818989] [](warn_slowpath_fmt+0x2c/0x3c) from [](gpio_ensure_requested+0x44/0x118) <7>[ 116.826858] [](gpio_ensure_requested+0x44/0x118) from [](gpio_direction_input+0x74/0xf0) <7>[ 116.835225] [](gpio_direction_input+0x74/0xf0) from [](mt_bt_power_on+0x28/0x178) <7>[ 116.843983] [](mt_bt_power_on+0x28/0x178) from [](bt_hwctl_ioctl+0x9c/0x190) <7>[ 116.853104] [](bt_hwctl_ioctl+0x9c/0x190) from [](do_vfs_ioctl+0x4d8/0x54c) <7>[ 116.862451] [](do_vfs_ioctl+0x4d8/0x54c) from [](sys_ioctl+0x34/0x54) <7>[ 116.872040] [](sys_ioctl+0x34/0x54) from [](ret_fast_syscall+0x0/0x30) <4>[ 116.881692] ---[ end trace 4b22d6b2b518088f ]--- <4>[ 116.895302] ------------[ cut here ]------------ <4>[ 116.905449] WARNING: at drivers/gpio/gpiolib.c:101 gpio_ensure_requested+0x44/0x118() <7>[ 116.916223] autorequest GPIO-279 <7>[ 116.927030] [](unwind_backtrace+0x0/0xe0) from [](warn_slowpath_common+0x4c/0x64) <7>[ 116.939033] [](warn_slowpath_common+0x4c/0x64) from [](warn_slowpath_fmt+0x2c/0x3c) <7>[ 116.951583] [](warn_slowpath_fmt+0x2c/0x3c) from [](gpio_ensure_requested+0x44/0x118) <7>[ 116.964625] [](gpio_ensure_requested+0x44/0x118) from [](gpio_direction_output+0x80/0x100) <7>[ 116.977909] [](gpio_direction_output+0x80/0x100) from [](mt_bt_power_on+0x4c/0x178) <7>[ 116.991318] [](mt_bt_power_on+0x4c/0x178) from [](bt_hwctl_ioctl+0x9c/0x190) <7>[ 117.005013] [](bt_hwctl_ioctl+0x9c/0x190) from [](do_vfs_ioctl+0x4d8/0x54c) <7>[ 117.018609] [](do_vfs_ioctl+0x4d8/0x54c) from [](sys_ioctl+0x34/0x54) <7>[ 117.032191] [](sys_ioctl+0x34/0x54) from [](ret_fast_syscall+0x0/0x30) <4>[ 117.045571] ---[ end trace 4b22d6b2b5180890 ]--- <4>[ 117.059355] rk29_sdmmc_command_complete..2906...CMD53(arg=0x94000804), hoststate=1, errorTimes=1, errorStep=0x1e ! [sdio] <4>[ 117.066876] rk29_sdmmc_command_complete..2906...CMD53(arg=0x10002058), hoststate=1, errorTimes=1, errorStep=0x1e ! [sdio] <7>[ 117.074074] sdio_readsb() reports error: fffffff4HAL_PORT_RD access fail! 0x10 <6>[ 118.491469] [MT6622] request_irq IRQ359 success <6>[ 118.504899] [MT6622] mt_bt_power_on --
RubCaj commented 11 years ago

HINT: last comment from usumfabricae was mutilated correct comment in mail

NEW: Linux rk3066dev 3.0.36+ #4 SMP PREEMPT Sat Jun 22 22:17:14 CEST 2013 armv7l armv7l armv7l GNU/Linux

module wlan.ko on MK802IIIS

insmod /lib/modules/3.0.36+/kernel/drivers/net/wireless/mt5931/wlan.ko dmesg: [ 2548.238535] MT5931 SDIO WiFi driver (Powered by Rockchip,Ver 2.12) init. [ 2548.238569] initWlan [ 2548.238580] ## Calling platform_driver_register [ 2548.238663] ## wifi_probe [ 2548.238677] wifi_set_power = 1 [ 2548.238692] rk29sdk_wifi_power: 1 [ 2548.502005] wifi turn on power [ 2548.502023] wifi_set_carddetect = 1 [ 2548.502036] rk29sdk_wifi_set_carddetect:1 [ 2548.502051] mmc1: slot status change detected(0-1) [ 2548.503541] wl_android_wifictrl_func_add success. [ 2548.701480] [ 2548.701508] drivers/mmc/core/core.c...1824.. ===== mmc_rescan Begin....[mmc1] [ 2548.747596] rk29_sdmmc_command_complete..2906...CMD5(arg=0x0), hoststate=1, errorTimes=1, errorStep=0x1e ! [sdio] [ 2548.748422] rk29_sdmmc_command_complete..2906...CMD55(arg=0x0), hoststate=1, errorTimes=1, errorStep=0x1e ! [sdio] [ 2548.749202] rk29_sdmmc_command_complete..2906...CMD55(arg=0x0), hoststate=1, errorTimes=1, errorStep=0x1e ! [sdio] [ 2548.749961] rk29_sdmmc_command_complete..2906...CMD55(arg=0x0), hoststate=1, errorTimes=1, errorStep=0x1e ! [sdio] [ 2548.750696] rk29_sdmmc_command_complete..2906...CMD55(arg=0x0), hoststate=1, errorTimes=1, errorStep=0x1e ! [sdio] [ 2548.751463] rk29_sdmmc_command_complete..2906...CMD1(arg=0x0), hoststate=1, errorTimes=1, errorStep=0x1e ! [sdio]

rmmod wlan

[ 2508.796052] Remove wlan! [ 2508.796143] 0 == u4WlanDevNum [ 2508.809904] ## Unregister platform_driver_register [ 2508.810096] ## wifi_remove [ 2508.810157] wifi_set_power = 0 [ 2508.810222] rk29sdk_wifi_power: 0 [ 2509.010365] wifi shut off power [ 2509.010381] wifi_set_carddetect = 0 [ 2509.010394] rk29sdk_wifi_set_carddetect:0 [ 2509.010409] mmc1: slot status change detected(1-0) [ 2509.010455] [ 2509.010460] drivers/mmc/core/core.c...1824.. ===== mmc_rescan Begin....[mmc1] [ 2509.012537] exitWlan

aloksinha2001 commented 11 years ago

Guys

Thanks for the fantastic work you guys are doing, taking this forward. I regret, I have not been able to contribute, as much I would have liked. 3188 and real life is making sure of that. I am very impressed with the progress you folks are making.

Alok

aloksinha2001 commented 11 years ago

When I was working on it, one of the things I tried was to check the debug on android, and compare with the Linux insmod log.

usumfabricae commented 11 years ago

RubCaj could you try https://github.com/usumfabricae/Linux3188 With that one I can have wlan working like a charm (only sometimes I have strange names for network when I iwlist, but I can live with that).

For some obscure reason seems that there's something different in GPIO management in this kernel release (didn't check if it's define related) but in the end for IMITO I didn't need to change RK30SDK_WIFI_GPIO_POWER_N definition. I only did a few changes to load wlan as a module and Kconfig, Makefile and .config to compile as I wish.

If this doesn't work, could you try dumping GPIO (https://github.com/usumfabricaeGPIO_DUMP.git a wonderful utility I found in internet during this testing period. You need to compile the module against the same kernel header version of your working ANDROID kernel) and try switching on and off wifi to check which GPIO pin are changing.

If you wish I could help in the late afternoon (now it's 11 am here).

RubCaj commented 11 years ago

A lot of thanks usumfabricae A small step further Incidentally, I was able to test with this git https://github.com/usumfabricae/Linux3188

modprobe wlan

Result: Open FW image: WIFI_RAM_CODE failed here is the relevant part of dmesg

[ 5623.612679] MT5931 SDIO WiFi driver (Powered by Rockchip,Ver 2.12) init. [ 5623.612712] initWlan [ 5623.612727] ## Calling platform_driver_register [ 5623.612811] ## wifi_probe [ 5623.612831] wifi_set_power = 1 [ 5623.612849] rk29sdk_wifi_power: 1 [ 5623.863960] wifi turn on power [ 5623.863976] wifi_set_carddetect = 1 [ 5623.863989] rk29sdk_wifi_set_carddetect:1 [ 5623.864005] mmc1: slot status change detected(0-1) [ 5623.864062] rk29_sdmmc_change_clk_div..1935.. newDiv=42, newCLK=294Khz [sdio] [ 5623.864601] wl_android_wifictrl_func_add success. [ 5624.063932] [ 5624.063959] drivers/mmc/core/core.c...1824.. ===== mmc_rescan Begin....[mmc1] [ 5624.108481] [ 5624.108508] mmc_attach_sdio..801.. ===== Begin to identify card as SDIO-card. [mmc1] [ 5624.144851] rk29_sdmmc_change_clk_div..1935.. newDiv=0, newCLK=24750Khz [sdio] [ 5624.150201] mmc1: new high speed SDIO card at address 0001 [ 5624.152700] wireless_dev prWdev(0xf0054200) allocated [ 5624.152912] wiphy (0xf03e0120) allocated [ 5624.156984] net_device prDev(0xf0186800) allocated [ 5624.157576] Open FW image: WIFI_RAM_CODE failed [ 5624.157660] Remove wlan! [ 5624.157711] 0 == u4WlanDevNum [ 5624.157850] wlan: probe of mmc1:0001:1 failed with error -1 [ 5624.157997] mmc_rescan_try_freq..1675.. ===== Initialize SDIO successfully. [mmc1]

your hint with https://github.com/usumfabricae/GPIO_DUMP.git (last slash is missing) and compiling against the kernel accomplished app/gpio created Next step? Tool is unknown to me. Thanks

Galland commented 11 years ago

WIFI_RAMCODE is a firmware, you can find it in /drivers/net/wireless/mt5931/fw.... it has to be placed in your uSD card's /etc/firmware or around, the place is specified in the mt5931 folder in one source file

usumfabricae commented 11 years ago

It should go under /system/etic/firmware/Wifi_ram_code (uppercase) it's hardcoded in one of mt5931 define. Since i'm testing on hybrid Linux/android rootfs image it wasn't an issue to me. Maybe we can put it in Kconfig. You can use the app to read gpio registrer values and dump them on a file. Just call it From a script passing one gpioid atre the other. Later i can share the script. Don't expect something magic. There're further options i'm still investigating.

RubCaj commented 11 years ago

Great! finally success. Thats it MT5931 as module wlan.ko runs smoothly on MK802IIIS Last step do not forget - as it happened to me - to copy
../drivers/net/wireless/mt5931/firmware_5931/WIFI_RAM_CODE to /etc/firmware/WIFI_RAM_CODE on the Android

background: In source ../drivers/net/wireless/mt5931/include/config.h WIFI_RAM_CODE is defined

#define CFG_FW_FILENAME             "WIFI_RAM_CODE"

and in ../drivers/net/wireless/mt5931/os/linux/gl_kal.c you find the hardcoded path

default:
    filp = filp_open("/etc/firmware/"CFG_FW_FILENAME, O_RDONLY, 0);

so the firmware-file must be fixed in the folder /etc/firmware/WIFI_RAM_CODE

Thanks guys

RubCaj commented 11 years ago

@usumfabricae I like to take your offer "Later i can share the script. Don't expect something magic. " for further tests also with regard to blutooth

aloksinha2001 commented 11 years ago

Wow... Great job. I cannot wait to be back home to test it.

Alok On Jun 24, 2013 4:14 AM, "Rub Caj" notifications@github.com wrote:

Great! finally success. Thats it MT5931 as module wlan.ko runs smoothly on MK802IIIS Last step do not forget - as it happened to me - to copy

../drivers/net/wireless/mt5931/firmware_5931/WIFI_RAM_CODE to /etc/firmware/WIFI_RAM_CODE on the Android

background: In source ../drivers/net/wireless/mt5931/include/config.h WIFI_RAM_CODE is defined

define CFG_FW_FILENAME "WIFI_RAM_CODE"

and in ../drivers/net/wireless/mt5931/os/linux/gl_kal.c you find the hardcoded path

default: filp = filp_open("/etc/firmware/"CFG_FW_FILENAME, O_RDONLY, 0);

so the firmware-file must be fixed in the folder /etc/firmware/WIFI_RAM_CODE

Thanks guys

— Reply to this email directly or view it on GitHubhttps://github.com/aloksinha2001/picuntu-3.0.8-alok/issues/2#issuecomment-19883047 .

usumfabricae commented 11 years ago

I've updated GPIO_DUMP utility in order to dump to dmesg the full GPIO list and lables Here's the difference on my IMITO between standard Android Kernel and Linux3188 I'll try to move forward and MATCH the Linux3188 to ANDROID values (I guess this is one of the problem with BT). Could you check on your ANDROID version to see if those are the same ANDROID LINUX GPIO gpio0 182 BT_PWR_EN | GPIO gpio0 182 (null) GPIO gpio0 191 | GPIO gpio0 191 \xffffff84{\x02 GPIO gpio1 207 (null) | GPIO gpio1 207 camera powerdown GPIO gpio1 222 (null) | GPIO gpio1 222 camera powerdown GPIO gpio3 264 mmc0-clk | GPIO gpio3 264 (null) GPIO gpio3 265 mmc0-cmd | GPIO gpio3 265 (null) GPIO gpio3 266 mmc0-data0 | GPIO gpio3 266 (null) GPIO gpio3 278 (null) | GPIO gpio3 278 wifi_power GPIO gpio3 279 wifi_power | GPIO gpio3 279 (null) GPIO gpio3 282 BT_EINT | GPIO gpio3 282 (null) GPIO gpio4 309 BT_RESET | GPIO gpio4 309 vol- GPIO gpio6 320 (null) | GPIO gpio6 352 (null) GPIO gpio6 321 remotectl | GPIO gpio6 353 (null) GPIO gpio6 322 play | GPIO gpio6 354 play GPIO gpio6 323 usb_detect | GPIO gpio6 355 usb_detect GPIO gpio6 324 wm831x | GPIO gpio6 356 (null) GPIO gpio6 325 (null) | GPIO gpio6 357 (null) GPIO gpio6 326 (null) | GPIO gpio6 358 (null) GPIO gpio6 327 (null) | GPIO gpio6 359 (null) GPIO gpio6 328 poweronpin | GPIO gpio6 360 poweronpin GPIO gpio6 329 (null) | GPIO gpio6 361 NULL GPIO gpio6 330 (null) | GPIO gpio6 362 (null) GPIO gpio6 331 ? | GPIO gpio6 363 (null) GPIO gpio6 332 (null) | GPIO gpio6 364 (null) GPIO gpio6 333 (null) | GPIO gpio6 365 (null) GPIO gpio6 334 (null) | GPIO gpio6 366 (null) GPIO gpio6 335 (null) | GPIO gpio6 367 (null) GPIO tps65910 364 (null) | GPIO tps65910 384 (null) GPIO tps65910 365 (null) | GPIO tps65910 385 (null) GPIO tps65910 366 (null) | GPIO tps65910 386 (null) GPIO tps65910 367 (null) | GPIO tps65910 387 (null) GPIO tps65910 368 (null) | GPIO tps65910 388 (null) GPIO tps65910 369 (null) | GPIO tps65910 389 (null)

usumfabricae commented 11 years ago

I found that in 3.0.8+ Kernel GPIO definition is different: ./mach-rk30/include/mach/gpio.h:#define RK30_PIN6_PA0 (5_NUM_GROUP + PIN_BASE + 0) ./mach-rk30/include/mach/gpio.h:#define RK30_PIN6_PA1 (5_NUM_GROUP + PIN_BASE + 1) ./mach-rk30/include/mach/gpio.h:#define RK30_PIN6_PA2 (5_NUM_GROUP + PIN_BASE + 2) ./mach-rk30/include/mach/gpio.h:#define RK30_PIN6_PA3 (5_NUM_GROUP + PIN_BASE + 3) ./mach-rk30/include/mach/gpio.h:#define RK30_PIN6_PA4 (5_NUM_GROUP + PIN_BASE + 4) ./mach-rk30/include/mach/gpio.h:#define RK30_PIN6_PA5 (5_NUM_GROUP + PIN_BASE + 5) ./mach-rk30/include/mach/gpio.h:#define RK30_PIN6_PA6 (5_NUM_GROUP + PIN_BASE + 6) ./mach-rk30/include/mach/gpio.h:#define RK30_PIN6_PA7 (5_NUM_GROUP + PIN_BASE + 7) ./mach-rk30/include/mach/gpio.h:#define RK30_PIN6_PB0 (5_NUM_GROUP + PIN_BASE + 8) ./mach-rk30/include/mach/gpio.h:#define RK30_PIN6_PB1 (5_NUM_GROUP + PIN_BASE + 9) ./mach-rk30/include/mach/gpio.h:#define RK30_PIN6_PB2 (5_NUM_GROUP + PIN_BASE + 10) ./mach-rk30/include/mach/gpio.h:#define RK30_PIN6_PB3 (5_NUM_GROUP + PIN_BASE + 11) ./mach-rk30/include/mach/gpio.h:#define RK30_PIN6_PB4 (5_NUM_GROUP + PIN_BASE + 12) ./mach-rk30/include/mach/gpio.h:#define RK30_PIN6_PB5 (5_NUM_GROUP + PIN_BASE + 13) ./mach-rk30/include/mach/gpio.h:#define RK30_PIN6_PB6 (5_NUM_GROUP + PIN_BASE + 14) ./mach-rk30/include/mach/gpio.h:#define RK30_PIN6_PB7 (5_NUM_GROUP + PIN_BASE + 15) in the new kernel they are 6*NUM_GROUP. Going to change them for iMito also in the new kernel

Galland commented 11 years ago

For rk3066: NUM_GROUP = 32 PIN_BASE = 160

and watch out because RK30_PIN5_P* is unavailable, it jumps from: RK30_PIN4_P* = 4_NUM_GROUP + PIN_BASE + to RK30_PIN6P = 6NUM_GROUP + PIN_BASE + *

For reference: https://github.com/Galland/Linux3188/blob/master/arch/arm/mach-rk30/include/mach/gpio.h

Galland commented 11 years ago

@usumfabricae then if "GPIO gpio3 279 wifi_power | GPIO gpio3 279 (null)" that means #define RK30_PIN3_PC7 (3_NUM_GROUP + PIN_BASE + 23) = 3_32 + 160 +23 = 279

but in the pull request, the pin in your patch is PC6: https://github.com/Galland/Linux3188/pull/1/files#diff-2

shall I modify it to RK30_PIN3_PC7 as you indicated previously?

usumfabricae commented 11 years ago

Leve it as Pc6 for the moment Since it works on imito and mk802. There're many gpio values that are different on my platform with this kernel. I tried the "correct" value but it seems there's something wrong. I think i have to fix them all in order to set to the "proper" value. I also tried to change pin6 define according with the 3.0.8 kernel in order to match tps65910 Pins but i have a problem during boot with a kernel fault, i cannot dump it (i do not have a serial port debugging). Do you have any guess on gpio layout? Did you have a chance to check them on your android kernel?

Galland commented 11 years ago

@usumfabricae I'm testing the pull request, and I'll go on to dump the android

However, I'm getting the same as RubCaj's first attempt, even though I'm using repo Linux3188 with your pull request merged:

Jun 25 14:32:27 picuntu kernel: [ 661.581185] MT5931 SDIO WiFi driver (Powered by Rockchip,Ver 2.12) init. Jun 25 14:32:27 picuntu kernel: [ 661.581224] initWlan Jun 25 14:32:27 picuntu kernel: [ 661.581242] ## Calling platform_driver_register Jun 25 14:32:27 picuntu kernel: [ 661.581342] ## wifi_probe Jun 25 14:32:27 picuntu kernel: [ 661.581360] wifi_set_power = 1 Jun 25 14:32:27 picuntu kernel: [ 661.581380] rk29sdk_wifi_power: 1 Jun 25 14:32:27 picuntu kernel: [ 661.852324] wifi turn on power Jun 25 14:32:27 picuntu kernel: [ 661.852341] wifi_set_carddetect = 1 Jun 25 14:32:27 picuntu kernel: [ 661.852355] rk29sdk_wifi_set_carddetect:1 Jun 25 14:32:27 picuntu kernel: [ 661.852376] mmc1: slot status change detected(0-1) Jun 25 14:32:27 picuntu kernel: [ 661.854109] wl_android_wifictrl_func_add success. Jun 25 14:32:27 picuntu kernel: [ 662.048907] Jun 25 14:32:27 picuntu kernel: [ 662.048935] drivers/mmc/core/core.c...1824.. ===== mmc_rescan Begin....[mmc1] Jun 25 14:32:27 picuntu kernel: [ 662.094093] rk29_sdmmc_command_complete..2906...CMD5(arg=0x0), hoststate=1, errorTimes=1, errorStep=0x1e ! [sdio] Jun 25 14:32:27 picuntu kernel: [ 662.094647] rk29_sdmmc_command_complete..2906...CMD55(arg=0x0), hoststate=1, errorTimes=1, errorStep=0x1e ! [sdio] Jun 25 14:32:27 picuntu kernel: [ 662.095167] rk29_sdmmc_command_complete..2906...CMD55(arg=0x0), hoststate=1, errorTimes=1, errorStep=0x1e ! [sdio] Jun 25 14:32:27 picuntu kernel: [ 662.095687] rk29_sdmmc_command_complete..2906...CMD55(arg=0x0), hoststate=1, errorTimes=1, errorStep=0x1e ! [sdio] Jun 25 14:32:27 picuntu kernel: [ 662.096215] rk29_sdmmc_command_complete..2906...CMD55(arg=0x0), hoststate=1, errorTimes=1, errorStep=0x1e ! [sdio] Jun 25 14:32:27 picuntu kernel: [ 662.096735] rk29_sdmmc_command_complete..2906...CMD1(arg=0x0), hoststate=1, errorTimes=1, errorStep=0x1e ! [sdio]

Firmware is in /etc/firmware, though it doesn't get to that step yet.

Any ideas? @RubCaj @usumfabricae ?

RubCaj commented 11 years ago

Sorry, i'm not at home, can't test this day,

you can find wlan.ko and recovery.img kernel.img, zImage includ' source for MT5931 and config at:

https://github.com/RubCaj/MK802IIIS/

(linuxroot as label for SD with OS)

RubCaj commented 11 years ago

Try if not in ../arch/arm/mach-rk30/board-rk30-sdk-sdmmc.c

change

define RK30SDK_WIFI_GPIO_POWER_N RK30_PIN3_PC7

in

define RK30SDK_WIFI_GPIO_POWER_N RK30_PIN0_PA5

compare .config

I have only found these differences to the previous version, in which occurred the same error. Here are the setting for the working version: (MTK802IIIS)

CONFIG_RK29_VPU=m

CONFIG_WLAN_80211=m

CONFIG_MT5931 is not set

CONFIG_MT5931_MT6622=y

CONFIG_DWC_OTG_DEFAULT_ID=y

CONFIG_DWC_OTG_DEFAULT_HOST is not set

CONFIG_MMC_DEBUG is not set

CONFIG_SDMMC0_RK29_SDCARD_DET_FROM_GPIO is not set

CONFIG_SDMMC1_RK29=y

CONFIG_SDMMC1_RK29_WRITE_PROTECT is not set

CONFIG_RK29_SDIO_IRQ_FROM_GPIO is not set

usumfabricae commented 11 years ago

Did you have a chance to Dump GPIO of your platform when running a working Android? Which model is it?

Galland commented 11 years ago

My stick is a Measy U2C, I tried RubCaj's RK30SDK_WIFI_GPIO_POWER_N RK30_PIN0_PA5 but same log CMD errors, so I guess I haven't found the right pin.

I don't know much about Android development but I'll do my best to run your useful tool for GPIO dumping, thanks guys!

RubCaj commented 11 years ago

I would like to take Galland's proposal. gpio_dump with app module and lib from Dave Hylands can you find on a wiki http://wiki.gumstix.org/index.php?title=GPIO My Teststicks are: RK3066 MK802IIIS RK3188 MK802IV RK3066 Zealz GK802 Galland: RK3066 Measy U2C usumfabricae RK3066 iMito MX1 RK3066 MK802 Alok ? There are apparently differences between the sticks, although almost all have the RK3066. @usumfabricae Could you please describe how your test method works exactly. So we were on the same level and we could better test together. Maybe you could show that on a new page. That would be very helpful. A lot of thanks

usumfabricae commented 11 years ago

I did some changes (updated on https://github.com/usumfabricae/GPIO_DUMP.git) to enable dumping into kernel log (dmesg or /proc/kmesg) all the GPIO registers labels at once. It has been usefull to find out "matching" between Android and rk3188 kernel.

Just copile the module (you need the proper headers related to kernel installed on your device) compile the app (you need android NDK for the proper Android version) load the module: user-gpio-drv.ko start tailing /proc/kmesg (just in case GPIO are not configured properly and kernel could crash) run: gpio dump gpio and collect the info from kernel tail

The other test (to check how GPIO value changes after switching on and off Wifi and bluetooth) is done by dumping all gpio registers values. Don't have my pc with me, but should be something like:

let count= while [ count -le ] do out=$(gpio get gpio $count) echo "GPIO $count: $out" let count=count+1 done

usumfabricae commented 11 years ago

I see there's something cut from the update: let count= while [ count -le ] do out=$(gpio get gpio $count) echo "GPIO $count: $out" let count=count+1 done

I'll setup a wiki page in the GPIO_DUMP to collect and share GPIO's info for rkxx :)

RubCaj commented 11 years ago

@usumfabricae
start debugging on weekend ;-) a lot of thanks

usumfabricae commented 11 years ago

getting closer. Fixed all the GPIO registers on iMito (not yet committed) I can switch on and off bluetooth and wifi without any issue. Still not be able to create hci device :(

<7>[ 193.502784] -106510 CMD:0x8b1a <7>[ 196.375983] [wifi] wlan0 netif_carrier_on [ssid:NETNI 00:1e:2a:fd:c6:88] <7>[ 201.651733] Set Wi-Fi PS mode to CAM (0) <3>[ 210.141403] init: untracked pid 195 exited <7>[ 211.861084] wlan0: no IPv6 routers present <6>[ 225.971708] [MT6622] mt_bt_power_on ++ <6>[ 227.401305] [MT6622] request_irq IRQ282 success <6>[ 227.406542] [MT6622] mt_bt_power_on --
usumfabricae commented 11 years ago

I did many changes on GPIO so I moved them all to https://github.com/usumfabricae/Linux3188/tree/MT5931_MT6622

Wifi works fine

On Bluetooth I uses the following so power up the device:

include /* open _/

include / exit /

include <sys/ioctl.h> /_ ioctl */

include <linux/ioctl.h>

define BTHWCTL_IOC_MAGIC 0xf6

define BTHWCTL_IOCTL_SET_POWER _IOWR(BTHWCTL_IOC_MAGIC, 0, uint32_t)

define BTHWCTL_IOCTL_SET_EINT _IOWR(BTHWCTL_IOC_MAGIC, 1, uint32_t)

define BTHWCTL_DEV_NAME "/dev/bthwctl"

typedef unsigned long uint32_t;

int main (int argc,char * argv []) { int file_desc=open(BTHWCTL_DEV_NAME, 0); int rc; int dato; printf ("File aperto %d\n",file_desc);

dato=atoi(argv[1]); rc = ioctl(file_desc, BTHWCTL_IOCTL_SET_POWER, &dato); printf ("ioctl fatto %d\n",rc);

close (file_desc); }

Than I can create the hci device: hciattach -n -s 115200 /dev/ttyS0 any 1500000 noflow Device setup complete

but I cannot set it up properly: hciconfig hci0 up Can't init device hci0: Connection timed out (110)

here's the relevant part of dmesg: [ 63.643251] [MT6622] mt_bt_power_on ++ [ 65.081297] [MT6622] request_irq IRQ282 success [ 65.090423] [MT6622] mt_bt_power_on -- [ 180.148148] rk_serial rk_serial.0: serial_rk_init_dma_rx sucess [ 1579.521218] Bluetooth: Unknown HCI packet type 00

I see on standard android the hciattach is different: hciattach -n -t10 -s 115200 /dev/ttyS0 mtk 1500000 noflow

Here the GPIO dump after changes, still have to fix mmc0-data0 and some others mmc0 pins:

<6>[ 2526.676345] User Mode GPIO Driver: 1.00 <7>[ 2529.113655] GPIO gpio0 160 (null) <7>[ 2529.117389] GPIO gpio0 161 (null) <7>[ 2529.120976] GPIO gpio0 162 (null) <7>[ 2529.124374] GPIO gpio0 163 (null) <7>[ 2529.127593] GPIO gpio0 164 vibrator <7>[ 2529.130633] GPIO gpio0 165 (null) <7>[ 2529.133711] GPIO gpio0 166 (null) <7>[ 2529.136802] GPIO gpio0 167 (null) <7>[ 2529.139910] GPIO gpio0 168 (null) <7>[ 2529.143022] GPIO gpio0 169 (null) <7>[ 2529.146150] GPIO gpio0 170 (null) <7>[ 2529.149281] GPIO gpio0 171 (null) <7>[ 2529.152437] GPIO gpio0 172 (null) <7>[ 2529.155582] GPIO gpio0 173 (null) <7>[ 2529.158736] GPIO gpio0 174 (null) <7>[ 2529.161907] GPIO gpio0 175 (null) <7>[ 2529.165101] GPIO gpio0 176 (null) <7>[ 2529.168299] GPIO gpio0 177 (null) <7>[ 2529.171505] GPIO gpio0 178 (null) <7>[ 2529.174727] GPIO gpio0 179 (null) <7>[ 2529.177965] GPIO gpio0 180 (null) <7>[ 2529.180923] GPIO gpio0 181 (null) <7>[ 2529.183697] GPIO gpio0 182 BT_PWR_EN <7>[ 2529.186570] GPIO gpio0 183 (null) <7>[ 2529.189473] GPIO gpio0 184 (null) <7>[ 2529.192376] GPIO gpio0 185 (null) <7>[ 2529.195224] GPIO gpio0 186 (null) <7>[ 2529.198024] GPIO gpio0 187 (null) <7>[ 2529.200801] GPIO gpio0 188 (null) <7>[ 2529.203593] GPIO gpio0 189 (null) <7>[ 2529.206391] GPIO gpio0 190 (null) <7>[ 2529.209179] GPIO gpio0 191 <7>[ 2529.211962] GPIO gpio1 192 (null) <7>[ 2529.214850] GPIO gpio1 193 (null) <7>[ 2529.217734] GPIO gpio1 194 (null) <7>[ 2529.220615] GPIO gpio1 195 (null) <7>[ 2529.223506] GPIO gpio1 196 (null) <7>[ 2529.226388] GPIO gpio1 197 (null) <7>[ 2529.229269] GPIO gpio1 198 (null) <7>[ 2529.232161] GPIO gpio1 199 (null) <7>[ 2529.235048] GPIO gpio1 200 (null) <7>[ 2529.237950] GPIO gpio1 201 (null) <7>[ 2529.240845] GPIO gpio1 202 (null) <7>[ 2529.243736] GPIO gpio1 203 (null) <7>[ 2529.246568] GPIO gpio1 204 (null) <7>[ 2529.249332] GPIO gpio1 205 (null) <7>[ 2529.252099] GPIO gpio1 206 (null) <7>[ 2529.254865] GPIO gpio1 207 (null) <7>[ 2529.257634] GPIO gpio1 208 (null) <7>[ 2529.260415] GPIO gpio1 209 (null) <7>[ 2529.263188] GPIO gpio1 210 (null) <7>[ 2529.265970] GPIO gpio1 211 (null) <7>[ 2529.268743] GPIO gpio1 212 (null) <7>[ 2529.271479] GPIO gpio1 213 (null) <7>[ 2529.274158] GPIO gpio1 214 (null) <7>[ 2529.276841] GPIO gpio1 215 (null) <7>[ 2529.279521] GPIO gpio1 216 (null) <7>[ 2529.282193] GPIO gpio1 217 (null) <7>[ 2529.284863] GPIO gpio1 218 (null) <7>[ 2529.287526] GPIO gpio1 219 (null) <7>[ 2529.290197] GPIO gpio1 220 (null) <7>[ 2529.292871] GPIO gpio1 221 (null) <7>[ 2529.295528] GPIO gpio1 222 (null) <7>[ 2529.298181] GPIO gpio1 223 (null) <7>[ 2529.300848] GPIO gpio2 224 (null) <7>[ 2529.303526] GPIO gpio2 225 (null) <7>[ 2529.306202] GPIO gpio2 226 (null) <7>[ 2529.308885] GPIO gpio2 227 (null) <7>[ 2529.311555] GPIO gpio2 228 (null) <7>[ 2529.314219] GPIO gpio2 229 (null) <7>[ 2529.316895] GPIO gpio2 230 (null) <7>[ 2529.319562] GPIO gpio2 231 (null) <7>[ 2529.322231] GPIO gpio2 232 (null) <7>[ 2529.324901] GPIO gpio2 233 (null) <7>[ 2529.327561] GPIO gpio2 234 (null) <7>[ 2529.330215] GPIO gpio2 235 (null) <7>[ 2529.332872] GPIO gpio2 236 (null) <7>[ 2529.335533] GPIO gpio2 237 (null) <7>[ 2529.338187] GPIO gpio2 238 (null) <7>[ 2529.340845] GPIO gpio2 239 (null) <7>[ 2529.343515] GPIO gpio2 240 (null) <7>[ 2529.346190] GPIO gpio2 241 (null) <7>[ 2529.348852] GPIO gpio2 242 (null) <7>[ 2529.351509] GPIO gpio2 243 (null) <7>[ 2529.354173] GPIO gpio2 244 (null) <7>[ 2529.356839] GPIO gpio2 245 (null) <7>[ 2529.359473] GPIO gpio2 246 (null) <7>[ 2529.362117] GPIO gpio2 247 (null) <7>[ 2529.364757] GPIO gpio2 248 (null) <7>[ 2529.367399] GPIO gpio2 249 (null) <7>[ 2529.370038] GPIO gpio2 250 (null) <7>[ 2529.372696] GPIO gpio2 251 (null) <7>[ 2529.375330] GPIO gpio2 252 (null) <7>[ 2529.377978] GPIO gpio2 253 (null) <7>[ 2529.380618] GPIO gpio2 254 (null) <7>[ 2529.383269] GPIO gpio2 255 (null) <7>[ 2529.385922] GPIO gpio3 256 (null) <7>[ 2529.388580] GPIO gpio3 257 (null) <7>[ 2529.391245] GPIO gpio3 258 (null) <7>[ 2529.393905] GPIO gpio3 259 (null) <7>[ 2529.396562] GPIO gpio3 260 (null) <7>[ 2529.399213] GPIO gpio3 261 (null) <7>[ 2529.401873] GPIO gpio3 262 (null) <7>[ 2529.404539] GPIO gpio3 263 sdmmc-power <7>[ 2529.407325] GPIO gpio3 264 (null) <7>[ 2529.410144] GPIO gpio3 265 (null) <7>[ 2529.412972] GPIO gpio3 266 (null) <7>[ 2529.415797] GPIO gpio3 267 mmc0-data1 <7>[ 2529.418722] GPIO gpio3 268 mmc0-data2 <7>[ 2529.421656] GPIO gpio3 269 mmc0-data3 <7>[ 2529.424611] GPIO gpio3 270 (null) <7>[ 2529.427600] GPIO gpio3 271 (null) <7>[ 2529.430576] GPIO gpio3 272 mmc1-cmd <7>[ 2529.433635] GPIO gpio3 273 mmc1-data0 <7>[ 2529.436748] GPIO gpio3 274 mmc1-data1 <7>[ 2529.439875] GPIO gpio3 275 mmc1-data2 <7>[ 2529.443013] GPIO gpio3 276 mmc1-data3 <7>[ 2529.446163] GPIO gpio3 277 mmc1-clk <7>[ 2529.449317] GPIO gpio3 278 (null) <7>[ 2529.452520] GPIO gpio3 279 wifi_power <7>[ 2529.455826] GPIO gpio3 280 (null) <7>[ 2529.459183] GPIO gpio3 281 wifi reset <7>[ 2529.462637] GPIO gpio3 282 BT_EINT <7>[ 2529.466147] GPIO gpio3 283 (null) <7>[ 2529.469687] GPIO gpio3 284 (null) <7>[ 2529.473132] GPIO gpio3 285 (null) <7>[ 2529.476510] GPIO gpio3 286 (null) <7>[ 2529.479883] GPIO gpio3 287 (null) <7>[ 2529.483263] GPIO gpio4 288 (null) <7>[ 2529.486572] GPIO gpio4 289 (null) <7>[ 2529.489872] GPIO gpio4 290 (null) <7>[ 2529.493143] GPIO gpio4 291 (null) <7>[ 2529.496357] GPIO gpio4 292 (null) <7>[ 2529.499571] GPIO gpio4 293 (null) <7>[ 2529.502716] GPIO gpio4 294 (null) <7>[ 2529.505840] GPIO gpio4 295 (null) <7>[ 2529.508948] GPIO gpio4 296 (null) <7>[ 2529.512039] GPIO gpio4 297 (null) <7>[ 2529.515125] GPIO gpio4 298 (null) <7>[ 2529.518175] GPIO gpio4 299 (null) <7>[ 2529.521164] GPIO gpio4 300 (null) <7>[ 2529.524093] GPIO gpio4 301 (null) <7>[ 2529.526945] GPIO gpio4 302 (null) <7>[ 2529.529723] GPIO gpio4 303 (null) <7>[ 2529.532426] GPIO gpio4 304 (null) <7>[ 2529.535085] GPIO gpio4 305 (null) <7>[ 2529.537752] GPIO gpio4 306 (null) <7>[ 2529.540409] GPIO gpio4 307 (null) <7>[ 2529.543072] GPIO gpio4 308 (null) <7>[ 2529.545742] GPIO gpio4 309 BT_RESET <7>[ 2529.548464] GPIO gpio4 310 (null) <7>[ 2529.551234] GPIO gpio4 311 (null) <7>[ 2529.554017] GPIO gpio4 312 (null) <7>[ 2529.556793] GPIO gpio4 313 (null) <7>[ 2529.559560] GPIO gpio4 314 (null) <7>[ 2529.562338] GPIO gpio4 315 (null) <7>[ 2529.565100] GPIO gpio4 316 (null) <7>[ 2529.567863] GPIO gpio4 317 (null) <7>[ 2529.570635] GPIO gpio4 318 (null) <7>[ 2529.573408] GPIO gpio4 319 (null) <7>[ 2529.576188] GPIO gpio6 320 (null) <7>[ 2529.578982] GPIO gpio6 321 (null) <7>[ 2529.581757] GPIO gpio6 322 play <7>[ 2529.584564] GPIO gpio6 323 usb_detect <7>[ 2529.587494] GPIO gpio6 324 (null) <7>[ 2529.590449] GPIO gpio6 325 (null) <7>[ 2529.593403] GPIO gpio6 326 (null) <7>[ 2529.596360] GPIO gpio6 327 (null) <7>[ 2529.599314] GPIO gpio6 328 poweronpin <7>[ 2529.602362] GPIO gpio6 329 NULL <7>[ 2529.605451] GPIO gpio6 330 (null) <7>[ 2529.608553] GPIO gpio6 331 (null) <7>[ 2529.611585] GPIO gpio6 332 (null) <7>[ 2529.614618] GPIO gpio6 333 (null) <7>[ 2529.617645] GPIO gpio6 334 (null) <7>[ 2529.620670] GPIO gpio6 335 (null) <7>[ 2529.623703] GPIO tps65910 364 (null) <7>[ 2529.626872] GPIO tps65910 365 (null) <7>[ 2529.630043] GPIO tps65910 366 (null) <7>[ 2529.633220] GPIO tps65910 367 (null) <7>[ 2529.636391] GPIO tps65910 368 (null) <7>[ 2529.639558] GPIO tps65910 369 (null)
usumfabricae commented 11 years ago

got it. Seems there's an other firmware to download into MT6622: MTK_MT6622_E2_Patch.nb0 using hciconfig I'm looking where I can use the android libbluetooth_mtk.so Does anyone knows where to get sources of this bluetooth_mtk ?

usumfabricae commented 11 years ago

I have bluetooth working using https://github.com/usumfabricae/Linux3188/tree/MT5931_MT6622. I had to use android hciattach since Picuntu image has a different elf (armhf) and I cannot link libbluetooth_mtk.so.

I also forced rk30xxnand_ko (default 3.0.8+) load and I can also access NAND memory.

Please let me know if you find an other way to re compile hciattach on armhf binary.