OpenWrt Forum Archive

Topic: how to compile things and to handle things in the OpenWRT trunk ???

The content of this topic has been archived on 12 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

hi,
i am trying to understand the USB issue i have on 2.6.39 with Wr703, i do not understand the openWRT way to organize files, about USB i have not understood why i see these files inside trunk-r29284/target/linux/ar71xx/files/drivers/usb/host
1) ehci-ar71xx.c
2) ohci-ar71xx.c

which is the meaning ?
is the USB kernel module of WR703 handled OUTSIDE the kernel tree ?
also … i am having a lot of troubles in order to compile ehci-ar71xx.c as "kernel module"

how to compile them ?
i got a lot of uncommon errors

(Last edited by carlojpisani on 6 Nov 2014, 19:30)

Those files are shipped outside of the kernel tree since they're developed by OpenWrt and not part of upstream Linux.
During the build process they get copied into the kernel tree together with a number of corresponding patches which hook those files into the Kconfig/Kbuild system.

They're not intended to be compiled standalone as module. The best is you run "make target/linux/prepare" which will assemble a complete kernel tree + applying all patches in build_dir/linux-*/linux-* or - in later trunk versions - build_dir/target-*/linux-*/linux-*

umm i have done something similar, i have used OpenWRT to prepare the kernel 2.6.39.4, then i compiled it outside OpenWRT and it is pretty booting and working on my Wr703, everything is working except the USB which has uncommon reaction about the HUB

usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
...
ar71xx-ehci ar71xx-ehci: new USB bus registered, assigned bus number 1
ar71xx-ehci ar71xx-ehci: reset command 0080002 (park)=0 ithresh=8 period=1024 Reset HALT
ar71xx-ehci ar71xx-ehci: park 0
ar71xx-ehci ar71xx-ehci: ...powerdown ports...
ar71xx-ehci ar71xx-ehci: irq 3, io mem 0x1b000000
ar71xx-ehci ar71xx-ehci: init command 0010005 (park)=0 ithresh=1 period=512 RUN
ar71xx-ehci ar71xx-ehci: USB 2.0 started, EHCI 1.00
usb usb1: default language 0x0409
usb usb1: udev 1, busnum 1, minor = 0
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: Atheros AR91xx built-in EHCI controller
usb usb1: Manufacturer: Linux 2.6.39-Flesh-Eating-Bats-TL-WR703N ehci_hcd
usb usb1: SerialNumber: ar71xx-ehci
usb usb1: usb_probe_device
usb usb1: configuration #1 chosen from 1 choice
usb usb1: adding 1-0:1.0 (config #1, interface 0)
hub 1-0:1.0: usb_probe_interface
hub 1-0:1.0: usb_probe_interface - got id
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
hub 1-0:1.0: standalone hub
hub 1-0:1.0: individual port power switching
hub 1-0:1.0: individual port over-current protection
hub 1-0:1.0: Single TT
hub 1-0:1.0: TT requires at most 8 FS bit times (666 ns)
hub 1-0:1.0: power on to power good time: 20ms
hub 1-0:1.0: local power source is good
hub 1-0:1.0: enabling power on all ports
drivers/usb/core/inode.c: creating file '001'

the hub is not recognizing anything plugged in the USB port

i am wandering what is wrong, and how to fix it!

i applied the same ramrootfs and procedure to the following trunks's kernel

1) 2.6.39.4/OpenWRT-trunk-r29283: USB not working
2) 3.3.8/OpenWRT-trunk-carambola-last: USB working


see the kernel 3.3.8's dmesg

eth0: Atheros AG71xx at 0xb9000000, irq 4
ag71xx ag71xx.0: eth0: connected to PHY at ag71xx-mdio.1:04 [uid=004dd041, driver=Generic PHY]
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-platform ehci-platform: Generic Platform EHCI Controller
ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
ehci-platform ehci-platform: irq 3, io mem 0x1b000000
ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
usbcore: registered new interface driver uas
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
i8042: i8042 controller selftest timeout
Trying to free nonexistent resource <0000000000000060-000000000000006f>
mousedev: PS/2 mouse device common for all mice
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP cubic registered
NET: Registered protocol family 17
8021q: 802.1Q VLAN Support v1.8
Freeing unused kernel memory: 11500k freed
usb 1-1: new high-speed USB device number 2 using ehci-platform
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
usb 1-1.4: new high-speed USB device number 3 using ehci-platform
scsi0 : usb-storage 1-1.4:1.0
scsi 0:0:0:0: Direct-Access     SanDisk  Cruzer Blade     8.02 PQ: 0 ANSI: 0 CCS
sd 0:0:0:0: [sda] 7856127 512-byte logical blocks: (4.02 GB/3.74 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 45 00 00 08
sd 0:0:0:0: [sda] No Caching mode page present
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] No Caching mode page present
sd 0:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1 sda2
sd 0:0:0:0: [sda] No Caching mode page present
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Attached SCSI removable disk
eth0: link up (100Mbps/Full duplex)

unfortunately i need the 2.6.39.4 because i have developed an usb-fb-lcd that requires TOO many effort to be ported to kernel 3.x, so … what's/could wrong with 2.6.39.4 ?

(Last edited by carlojpisani on 6 Nov 2014, 23:35)

The discussion might have continued from here.