Emeryth / openwrt-zsun

OpenWrt 15.05 port for the ZSUN WiFi SD Card Reader
GNU General Public License v2.0
96 stars 28 forks source link

USB Gadget mode, any success? #9

Open stevelord opened 8 years ago

stevelord commented 8 years ago

Hi guys,

The Hackspace.pl wiki mentions USB gadget mode. I'm interested in trying it out, and was wondering if anyone has managed the steps described, which are:

Port the code
Remove the bootstrap resistor setting USB to host mode
Remove the card reader PCB and rewire the the USB signal pins

Has anyone managed this so far? If so, care to share your findings/code?

frakman1 commented 8 years ago

I'm also very interested in this feature. If anyone has information on using the Zsun in USB Gadget mode, then please share your findings.

pqyptixa commented 8 years ago

I'm interested, too. I did some googling, and found this: https://marc.info/?a=136188979700002&r=1&w=3 https://patchwork.linux-mips.org/patch/4968/ . Apparently, (unless I'm misreading) the patches were revised multiple times and sent, but they were never approved/pushed upstream... I wonder how much would it cost to (back) port them and push them to upstream + openwrt.

pqyptixa commented 8 years ago

Also, there is a repo in github owned (I guess) by the person that made these patches: https://github.com/neykov/chipidea-openwrt , but it seems to be a bit older than the latest patchset ("Latest commit b4b579b on 28 Feb 2013" vs March 28 show in the linux-mips.org link above).

pqyptixa commented 8 years ago

Digging a bit more... v3 of the patches: https://www.linux-mips.org/archives/linux-mips/2013-04/msg00009.html As plntyk @ #openwrt pointer out, looks like there never was a v4: https://www.google.com/search?q=%22PATCH+v4+*%5D+usb%3A+chipidea%22+%22Neykov%22

Phant0mC0der commented 7 years ago

Hope someone will port this

Emeryth commented 7 years ago

USB gadget is working in LEDE trunk (unfortunately it has not been included in the first stable release).

Here's a quick port I made some time ago: https://github.com/Emeryth/source/tree/zsun

Phant0mC0der commented 7 years ago

Is it possible to make zsun as rndis usb gadget?

Emeryth commented 7 years ago

Yes, I've tested it.

catalinii commented 7 years ago

Hi @Emeryth,

sorry for the question, does g_ether works without any hardware modifications ?

If yes, I was wondering if it is possible to post some compiled images as I believe g_ether is very useful.

Thank you

drawkula commented 6 years ago

I'd like to use that too but using LEDE which ignores my wishes or I just am a victim of pebcak. :-(

So probably I only can impatiently wait for a new LEDE release? Could it be "officially" supported then?

Where is the petition we need to sign? ;-)

x-magic commented 6 years ago

I've modded my old-PCB ZSUN by removing the card reader board and headers, then jumped D+ and D- to USB connector, and finally removed G13 resistor (well, the hard way, I yanked it with a pair of tweezers since its too tiny for the iron).

zsun_gadget (please ignore my crude soldering job)

On the original OpenWRT image (from here) the PC can detect the presence of an invalid device plugged in, while on an LEDE image (from here) nothing really happens. I haven't got time to compile my own kernel and image so I'd say it could be just a false hope.

Emeryth commented 6 years ago

The USB gadget driver for AR9331 is not present in OpenWrt or LEDE 17.01.4. You have to compile LEDE trunk with one of the USB gadget modules.

x-magic commented 6 years ago

@emeryth thanks mate

I guess hardware-wise I'm good? (Please tell me yes🤞)

Cheers

Emeryth commented 6 years ago

Yes, it looks that way. Remember that you will need to reduce the size of the LEDE kernel image by disabling some options (or it won't fit in the zsun's kernel partition). There's discussion about it in the thread you posted.

x-magic commented 6 years ago

@Emeryth Fantastic! Thanks for the tips.