Modify

Opened 11 years ago

Closed 3 years ago

#1666 closed enhancement (wontfix)

usb host controller not working on ar7

Reported by: quitte@… Owned by: florian
Priority: normal Milestone: Features Paradise
Component: kernel Version: Trunk
Keywords: Cc:

Description

Some of the Fritzboxes and probably other ar7 devices hava a usb host controller. I'm not a programmer so all I could do is try to find information about this.
It is probably a VLYNQ TO USB BRIDGE TI TNETV115PAP (52A60HT)
The AVM kernel has a driver for it in drivers/usb/ahci and can be downloaded from:
ftp://ftp.avm.de/develper/opensrc/
The fritzbox7141-source-files-04.30 is what I had a look at.
The Kconfig files gave me the impression that the same driver is also used for the davinci platform, which is arm. After some googling this leads me to believe that the ohci-omap driver is pretty much what is needed to make the controller work.
I made a small patch that just merges the ahci files from the avm kernel with the openwrt kernel and adds an option to the config. The missing header files can be found in the package mentioned above.
When I have time I'll translate all comments in the related headers to English and add them here.
If there is anything I can do to help in making the usb controller work don't hesitate to ask.

Attachments (1)

avm_usb_hci.patch (164.3 KB) - added by quitte@… 11 years ago.

Download all attachments as: .zip

Change History (15)

Changed 11 years ago by quitte@…

comment:1 Changed 10 years ago by Whoopie

Hi,

would we really great to see USB support for ar7.
But the mentioned driver from AVM is missing the isochronous transfer mode.

Best regards,
Whoopie

comment:2 Changed 10 years ago by quitte@…

I dont see how missing isochronous transfer mode would be a problem. All I want to connect to it is a usb flash stick to not run out of spaceas fast.

comment:3 Changed 10 years ago by Davidkra <david@…>

Hmm... is it availiable for 2.6.23, too? My modifications to it don't work: it doesn't build

comment:4 Changed 10 years ago by matteo

  • Owner changed from developers to matteo
  • Status changed from new to assigned

comment:5 Changed 9 years ago by florian

  • Owner changed from matteo to florian
  • Status changed from assigned to new

comment:6 Changed 8 years ago by Michael J Evans <mjevans1983@…>

This is a bloody nightmare today. I've edited a makefile above the one it patches to force it to /attempt/ to compile, but...

It looks like I'll have to track down everything before an error and see if I can guess what it wanted. I just spend the last few hours googling for ohioint.h "mips/ohio" and even checking out/searching the freetz box sources to try and find a copy of the reference files. As far as I can tell, MIPS OHIO is some internal freetz box or other name to reference a variant of the same mips family that's in the AR7 and other systems.

make[5]: Entering directory `/media/stuff/src/openwrt/svn/build_dir/linux-ar7/linux-2.6.30.10'
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-mips
  CALL    scripts/checksyscalls.sh
  CHK     include/linux/compile.h
  CC      drivers/usb/ahci/ahci.o
drivers/usb/ahci/ahci.c:21:37: error: asm/mips-boards/ohioint.h: No such file or directory
drivers/usb/ahci/ahci.c:54: error: expected ')' before string constant
drivers/usb/ahci/ahci.c:55: error: expected ')' before string constant
drivers/usb/ahci/ahci.c:56: error: expected ')' before string constant
drivers/usb/ahci/ahci.c: In function 'irq_mapping':
drivers/usb/ahci/ahci.c:65: error: 'OHIOINT_EXT_0' undeclared (first use in this function)
drivers/usb/ahci/ahci.c:65: error: (Each undeclared identifier is reported only once
drivers/usb/ahci/ahci.c:65: error: for each function it appears in.)
drivers/usb/ahci/ahci.c: At top level:
drivers/usb/ahci/ahci.c:101: error: variable 'ahci_device_operations' has initializer but incomplete type
drivers/usb/ahci/ahci.c:103: error: unknown field 'get_frame_number' specified in initializer
drivers/usb/ahci/ahci.c:103: warning: excess elements in struct initializer
drivers/usb/ahci/ahci.c:103: warning: (near initialization for 'ahci_device_operations')
drivers/usb/ahci/ahci.c:104: error: unknown field 'submit_urb' specified in initializer
drivers/usb/ahci/ahci.c:104: warning: excess elements in struct initializer
drivers/usb/ahci/ahci.c:104: warning: (near initialization for 'ahci_device_operations')
drivers/usb/ahci/ahci.c:105: error: unknown field 'unlink_urb' specified in initializer
drivers/usb/ahci/ahci.c:105: warning: excess elements in struct initializer
drivers/usb/ahci/ahci.c:105: warning: (near initialization for 'ahci_device_operations')
drivers/usb/ahci/ahci.c:106: error: unknown field 'buffer_alloc' specified in initializer
drivers/usb/ahci/ahci.c:106: warning: excess elements in struct initializer
drivers/usb/ahci/ahci.c:106: warning: (near initialization for 'ahci_device_operations')
drivers/usb/ahci/ahci.c:107: error: unknown field 'buffer_free' specified in initializer
drivers/usb/ahci/ahci.c:107: warning: excess elements in struct initializer
drivers/usb/ahci/ahci.c:107: warning: (near initialization for 'ahci_device_operations')
drivers/usb/ahci/ahci.c:108: error: unknown field 'disable' specified in initializer
drivers/usb/ahci/ahci.c:108: warning: excess elements in struct initializer
drivers/usb/ahci/ahci.c:108: warning: (near initialization for 'ahci_device_operations')
drivers/usb/ahci/ahci.c: In function 'ahci_init_bus':
drivers/usb/ahci/ahci.c:148: error: implicit declaration of function 'usb_alloc_bus'
drivers/usb/ahci/ahci.c:148: warning: assignment makes pointer from integer without a cast
drivers/usb/ahci/ahci.c:156: error: 'struct usb_bus' has no member named 'hcpriv'
drivers/usb/ahci/ahci.c:162: error: too few arguments to function 'kobject_add'
drivers/usb/ahci/ahci.c: In function 'init_ahci':
drivers/usb/ahci/ahci.c:224: warning: assignment makes pointer from integer without a cast
drivers/usb/ahci/ahci.c:225: error: 'KERN_ERROR' undeclared (first use in this function)
drivers/usb/ahci/ahci.c:225: error: expected ')' before string constant
drivers/usb/ahci/ahci.c:254: error: 'SA_INTERRUPT' undeclared (first use in this function)
drivers/usb/ahci/ahci.c:254: error: 'SA_SHIRQ' undeclared (first use in this function)
drivers/usb/ahci/ahci.c:257: warning: passing argument 2 of 'request_irq' from incompatible pointer type

comment:7 Changed 8 years ago by spudz76

  • Milestone set to Kamikaze
  • Priority changed from normal to high
  • Version set to Kamikaze trunk

[patchteam] This appears still active, just setting milestone/version and raising priority since USB support is reasonably important.

comment:8 Changed 8 years ago by florian

The usb driver certainly needs a complete rewrite or adaptation from an existing TI Davinci driver. That one is too hold.

comment:9 Changed 8 years ago by thepeople

  • Status changed from new to assigned

comment:10 Changed 8 years ago by florian

the ahci controller register do not seem to match any known usb implementation ohci or ehci, so this might need a separate controller driver.

comment:11 Changed 8 years ago by Michael J Evans <mjevans1983@…>

Since the last time I'd checked the Actiontec site, I noticed that the GPL download for my device was clarified.

CONFIG_MIPS_AVALANCHE_USB

http://opensource.actiontec.com/

GT701 / GT701A / GT701C / GT701D / GT701R / GT701WG / GT701WRU / GT704 / GT704WG / GT704WR / GT724R / GT724WG / GT724WGR / M1000 / PK5000 /

The following file contains all GPL and LGPL sources used to build firmware for the DSL Modem and Gateway models listed above.

GT, M, PK Series Products Type Size

actiontec_opensrc_gt4_2.tar.gz .tar.gz 43 MB

My understanding is, the Linux Kernel 2.4.17 (and that time-frame) is GPL-v2; further that by distributing binaries based off of it, any included source-code thus also MUST be licensed under GPL-v2 or permission obtained from each individual developer/etc. Since there is no notice of such, I can presume that the TI code in that version merely omits a factual statement that it is also licensed via GPL-v2? If that is the case, I will happily, as an owner of an Actiontec M1000 re-distribute the GPL-v2 source that happens to contain the above 2.4 driver, if for no other reason than to be a good reference source of Factual Non-Copyright worthy information required for writing a fresh driver.

diff -upbr linux-2.4.17-orig/ build/linux-2.4.17_mvl21/

5049314 May 21 15:07 linux-2.4.17-mvl21-diff.patch

0819184 May 21 15:07 linux-2.4.17-mvl21-diff.patch.xz

comment:12 Changed 8 years ago by Michael J Evans <mjevans1983@…>

Reviewing the diff-patch further, I needed to add --unidirectional-new-file as well.

21557887 bytes raw, 2815956 bytes compressed for everything. The USB specific code, at a glance, seems to consist of 901602 bytes of uncompressed code. A lot of it seems odd to me. Like they included a bunch of windows headers to make sure they had the exact same values for USB data as the windows driver's expected.

build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/usb_sal.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/psp_types.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/usb_sal.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/usb20_config.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/usb20_os_linux.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/Makefile
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/usb20_RndisEnd_Lx.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/usb20_config.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_usb20
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_usb20/cpswhalcpusb_isr.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_usb20/cpswhalcpusb.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_usb20/dox_cpusb.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_usb20/cpswhalcpusb_ecerrors.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_usb20/cpswhalcpusb_private.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_usb20/cpswhalcpusb_cppi.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_usb20/cpswhalcpusb_global.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_usb20/cpswhal_cpusb.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_usb20/readme.txt
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_usb20/cpswhalcpusb_params.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_usb20/cpswhalcpusb_global.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_usb20/cpswhalcpusb_regs.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_state.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_state.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_drvhal.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_mib2.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_tool.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_drvapi.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_drvrndis.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_rndis.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/ndis.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_drvhal.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_def.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_drvapi.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_tool.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_drv.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_drvrndis.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_lib.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_drv.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/rndis.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_rndis.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/drv_core/usb20_lib.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_common
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_common/cpswhalcommon_ecerrors.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_common/cpswhalcommon_global.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_common/cpswhalcommon_miimdio.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_common/cpswhalcommon_unreset.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_common/cpswhalcommon_defs.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_common/cpswhalcommon_support.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_common/cpswhal.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_common/cpswhalcommon_miimdio.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_common/cpswhalcommon_support.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_common/cpswhalcommon_miimdio_regs.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_common/cpswhalcommon_stddef.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_common/cpswhalcommon_params.h
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_common/readme.txt
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_common/cpswhalcommon_params.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_common/cpswhalcommon_global.c
build/linux-2.4.17_mvl21/drivers/net/avalanche_usb_slave20/hal_common/export.txt

comment:13 Changed 5 years ago by jogo

  • Milestone changed from Attitude Adjustment 12.09 to Features Paradise
  • Priority changed from high to normal
  • Version changed from Kamikaze trunk to Trunk

comment:14 Changed 3 years ago by florian

  • Resolution set to wontfix
  • Status changed from assigned to closed

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.