Modify

Opened 4 years ago

Last modified 2 years ago

#15267 new defect

Netgear WNR2200: USB powered off (missing gpio pins)

Reported by: sinnerotuh@… Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: kernel Version: Trunk
Keywords: Cc:

Description

With DD-WRT, USB works after loading the ehci-hcd module and powering on the USB hub with gpio enable 36.

But I can't do the same with OpenWrt, because only 20 gpio pins are recognized.

DD-WRT:

# cat /sys/class/gpio/gpiochip0/ngpio 
48

OpenWrt:

# cat /sys/class/gpio/gpiochip0/ngpio 
20

How is the gpio pin count determined?

Attachments (2)

ar71xx-fix-Netgear-WNR2200-led-gpios.patch (4.6 KB) - added by sinnerotuh@… 4 years ago.
mach-wnr2200.patch (4.5 KB) - added by der_mar 3 years ago.
Patch to the master trunk

Download all attachments as: .zip

Change History (36)

comment:1 Changed 4 years ago by pepvf@…

According to this file: https://dev.openwrt.org/browser/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2200.c#L40
usb power gpio is 24.
Also take a look if exists something like /sys/class/gpio/gpiochipX/: some lantiq boards have various gpiochip.

comment:2 Changed 4 years ago by sinnerotuh@…

Yes, USB power GPIO is 0x024 (36 at base 10), but this is precisely the problem: OpenWRT kernel knows only about 20 GPIO pins, while DD-WRT kernel knew about 40. There is only one GPIO chip (/sys/class/gpio/gpiochip0).

By the way, I have tested with http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-wnr2200-squashfs-factory.img from 2014-03-14.

comment:3 Changed 4 years ago by guotao945@…

Hi

WNR2200 USB GPIO is on AR9287, not on AR7241, so you can't enable USB power use AR7241 gpiochip.

I have fixed every led and button gpio on WNR2200, I sent a patch days ago, but have not merged to master yet.

These are correct gpio pins number

AR9287 GPIO LED
#define WNR2200_GPIO_LED_WLAN 0
#define WNR2200_GPIO_LED_PWR_AMBER 1
#define WNR2200_GPIO_LED_PWR_GREEN 2
#define WNR2200_GPIO_USB_5V 4
AR9287 GPIO BUTTON
#define WNR2200_GPIO_BUTTON_WIFI 3
#define WNR2200_GPIO_BUTTON_WPS 5
#define WNR2200_GPIO_BUTTON_RESET 6
AR7241
#define WNR2200_GPIO_LED_WPS 7
#define WNR2200_GPIO_LED_USB 8
#define WNR2200_GPIO_LED_LAN1_AMBER 6
#define WNR2200_GPIO_LED_LAN2_AMBER 0
#define WNR2200_GPIO_LED_LAN4_AMBER 1
#define WNR2200_GPIO_LED_LAN3_AMBER 11
#define WNR2200_GPIO_LED_WAN_AMBER 12

To use every AR7241 gpio leds, you need to disable JTAG, use this code
ath79_gpio_function_setup(AR724X_GPIO_FUNC_JTAG_DISABLE, 0);

To use USB power, you need add this code
ap9x_pci_setup_wmac_gpio(0,

BIT(WNR2200_GPIO_USB_5V) | BIT(WNR2200_GPIO_LED_PWR_AMBER) | BIT(WNR2200_GPIO_LED_PWR_GREEN),
BIT(WNR2200_GPIO_USB_5V) | BIT(WNR2200_GPIO_LED_PWR_AMBER));

Changed 4 years ago by sinnerotuh@…

comment:4 follow-up: Changed 4 years ago by sinnerotuh@…

Thank you. USB is really working with your changes.

Maybe your patch wasn't merged because it didn't apply (whitespace was messed up)?
I am attaching a version with fixed whitespace (source: http://patchwork.openwrt.org/patch/4942/), it is tested against master (compiles, flashes and mounts a USB key).

The USB LED doesn't light up when a USB device is inserted, but I don't really care (it does light up when writing 1 to an exported /sys/class/gpio/gpio8/value). The WLAN LED works.

I don't really know the codebase, but why did you remove the WNR2200_GPIO_LED_LAN*_GREEN definitions and left only the WNR2200_GPIO_LED_LAN*_AMBER ones? My WNR2200 LAN LEDs are green by default but at least one of them does turn amber when booting up.

comment:5 in reply to: ↑ 4 Changed 4 years ago by guotao945@…

Replying to sinnerotuh@…:

Thank you. USB is really working with your changes.

Maybe your patch wasn't merged because it didn't apply (whitespace was messed up)?
I am attaching a version with fixed whitespace (source: http://patchwork.openwrt.org/patch/4942/), it is tested against master (compiles, flashes and mounts a USB key).

Thank you, I create this patch use git, I don't know why...

The USB LED doesn't light up when a USB device is inserted, but I don't really care (it does light up when writing 1 to an exported /sys/class/gpio/gpio8/value). The WLAN LED works.

To use USB led, add these code to /etc/config/system

config led

option default '0'
option name 'USB'
option sysfs 'netgear:green:usb'
option trigger 'usbdev'
option dev '1-1'

I don't really know the codebase, but why did you remove the WNR2200_GPIO_LED_LAN*_GREEN definitions and left only the WNR2200_GPIO_LED_LAN*_AMBER ones?

The WNR2200_GPIO_LED_LAN*_GREEN leds is controlled by AR7241 switch automatically and WNR2200_GPIO_LED_LAN*_AMBER leds are not useful (I think), so I don't care about lan leds. I just care about leds of WPS, WIFI, USB and POWER.

My WNR2200 LAN LEDs are green by default but at least one of them does turn amber when booting up.

Do you disable JTAG ?

I also write a dirver module to enable AR9287 GPIO. This module depend on ath9k ,but I have not found a better way to make sure this module load after ath9k(no modules.dep or modules.softdep in openwrt). Do you have any ideas?

comment:6 Changed 4 years ago by sinnerotuh@…

Are any developers monitoring this place? Will the attached patch be commited/reviewed (it fixes whitespace inconsistencies in http://patchwork.openwrt.org/patch/4942/)?

To guotao945:

But in your patch you leave only WNR2200_GPIO_LED_LAN*_AMBER leds and you remove WNR2200_GPIO_LED_LAN*_GREEN. I think that both should should stay, at least for informational purposes (so that the pins are known for anyone needing them in the future).

Regarding your question about module dependencies, this bug tracker is not the place to hold discussions, but I believe you are after /etc/modules.d and /etc/modules-boot.d/ (for example, see "/etc/modules.d/20-usb-core").

comment:7 Changed 4 years ago by anonymous

Hallo,
I have apply the patch, but with the following errors:

arch/mips/ath79/mach-wnr2200.c:86:5: error: implicit declaration of function 'ath79_gpio_function_setup' [-Werror=implicit-function-declaration]
     ath79_gpio_function_setup(AR724X_GPIO_FUNC_JTAG_DISABLE, 0);
     ^
arch/mips/ath79/mach-wnr2200.c:113:13: error: too few arguments to function 'ap9x_pci_setup_wmac_gpio'
             BIT(WNR2200_GPIO_USB_5V) | BIT(WNR2200_GPIO_LED_PWR_AMBER));
             ^
In file included from arch/mips/ath79/mach-wnr2200.c:19:0:
arch/mips/ath79/dev-ap9x-pci.h:19:6: note: declared here
 void ap9x_pci_setup_wmac_gpio(unsigned wmac, u32 mask, u32 val);
      ^
cc1: all warnings being treated as errors

comment:8 Changed 3 years ago by david@…

Hi,

Is there any progress on this? I have the same router (WNR2200) and USB does not seem to work. At least there are no sd* devices and /dev/ and I guess there is no power supplied to USB port. Using Barrier Breaker 14.07-rc3.

I am not an expert but feel free to ask, if that helps to solve this issue.

I have installed the following relevant packages: block-mount, kmod-fs-ext4, kmod-fs-ntfs, kmod-scsi-core, kmod-scsi-generic, kmod-usb-core, kmod-usb-storage, kmod-usb2, samba36-server.

# dmesg | grep usb
[ 6.330000] usbcore: registered new interface driver usbfs
[ 6.340000] usbcore: registered new interface driver hub
[ 6.340000] usbcore: registered new device driver usb
[ 12.660000] usbcore: registered new interface driver usb-storage

# dmesg | grep hci
[ 6.360000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 6.360000] ehci-platform: EHCI generic platform driver
[ 6.370000] ehci-platform ehci-platform: EHCI Host Controller
[ 6.370000] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[ 6.380000] ehci-platform ehci-platform: irq 3, io mem 0x1b000000
[ 6.410000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[ 6.420000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver

Cheers,

David

comment:9 Changed 3 years ago by kyaminskiy@…

Hello. there was one problem. This patch is made ​​to include the power to usb, but mount / overlay is not possible, as the power comes much later.

Yaminskiy Konstantin

comment:10 follow-up: Changed 3 years ago by david@…

Hi,

Thank you for informing me. So I guess USB will not be supported on this device soon, right?

David

comment:11 follow-up: Changed 3 years ago by sinnerotuh@…

A while ago I have compiled BARRIER BREAKER r39930 with the patch from this bug and my WNR2200 has 132 days uptime. But it doesn't use a root overlay, it only mounts an USB flash to /mnt.

comment:12 in reply to: ↑ 10 Changed 3 years ago by anonymous

Replying to david@…:

Hi,

Thank you for informing me. So I guess USB will not be supported on this device soon, right?

David

Do not Know

Yaminskiy Konstantin

comment:13 in reply to: ↑ 11 Changed 3 years ago by yaminskiy@…

Replying to sinnerotuh@…:

A while ago I have compiled BARRIER BREAKER r39930 with the patch from this bug and my WNR2200 has 132 days uptime. But it doesn't use a root overlay, it only mounts an USB flash to /mnt.

It is possible, but with the condition will be powered usb-hdd with external power supply

comment:14 Changed 3 years ago by sinnerotuh@…

/dev/sda is a simple USB flash drive and it does draw power from the USB port. Here is a snippet from /etc/config/fstab:

config mount
	option uuid 'f60f4c04-7a85-4dda-bfc7-ef2a7e22b647'
	option enabled '1'
	option device '/dev/sda1'
	option target '/mnt'
	option fstype 'ext4'
	option enabled_fsck '1'

comment:15 Changed 3 years ago by david@…

Thanks everyone.

Anyway, I am not an expert and therefore don't know what to do. I would like to attach a flash drive or a 2.5" USB HDD (powered from USB port) or a 3.5" USB HDD (with external power) to the router. Is any of these possible with the stock OpenWrt Barrier Breaker firmware?

If not, then which device will work with the patch?

Cheers,

David

comment:16 Changed 3 years ago by kyaminskiy@…

I found a workaround solution for mounting problem. We should run ath9k kernel module to power on usb port. Creating file /lib/preinit/81-ath9k with following contents resolves the problem:

#!/bin/sh
/usr/sbin/modprobe ath9k

This file must be created in a "base-files" package before building firmware.

Yaminskiy Konstantin

comment:17 Changed 3 years ago by kyaminskiy@…

As proof give the full log:

[ 0.000000] Linux version 3.10.49 (kyaminskiy@firmware-create) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r42554) ) #3 Tue Oct 14 14:25:21 VLAT 2014
[ 0.000000] MyLoader: sysp=ffffffff, boardp=ffffffff, parts=ffffbfff
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU revision is: 00019374 (MIPS 24Kc)
[ 0.000000] SoC: Atheros AR7241 rev 1
[ 0.000000] Clocks: CPU:360.000MHz, DDR:360.000MHz, AHB:180.000MHz, Ref:5.000MHz
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 04000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x00000000-0x03ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000-0x03ffffff]
[ 0.000000] On node 0 totalpages: 16384
[ 0.000000] free_area_init_node: node 0, pgdat 80312690, node_mem_map 81000000
[ 0.000000] Normal zone: 128 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 16384 pages, LIFO batch:3
[ 0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
[ 0.000000] Kernel command line: board=WNR2200 console=ttyS0,115200 mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro rootfstype=squashfs,jffs2 noinitrd
[ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Writing ErrCtl register=00000000
[ 0.000000] Readback ErrCtl register=00000000
[ 0.000000] Memory: 61208k/65536k available (2253k kernel code, 4328k reserved, 596k data, 284k init, 0k highmem)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:51
[ 0.060000] Calibrating delay loop... 239.61 BogoMIPS (lpj=1198080)
[ 0.070000] pid_max: default: 32768 minimum: 301
[ 0.070000] Mount-cache hash table entries: 512
[ 0.080000] NET: Registered protocol family 16
[ 0.090000] MIPS: machine is NETGEAR WNR2200
[ 0.490000] registering PCI controller with io_map_base unset
[ 0.540000] bio: create slab <bio-0> at 0
[ 0.540000] PCI host bridge to bus 0000:00
[ 0.550000] pci_bus 0000:00: root bus resource [mem 0x10000000-0x13ffffff]
[ 0.550000] pci_bus 0000:00: root bus resource [io 0x0000]
[ 0.560000] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[ 0.560000] pci 0000:00:00.0: [168c:002e] type 00 class 0x028000
[ 0.560000] pci 0000:00:00.0: fixup device configuration
[ 0.570000] pci 0000:00:00.0: reg 10: [mem 0x10000000-0x1000ffff 64bit]
[ 0.570000] pci 0000:00:00.0: supports D1
[ 0.570000] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[ 0.570000] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
[ 0.570000] pci 0000:00:00.0: BAR 0: assigned [mem 0x10000000-0x1000ffff 64bit]
[ 0.570000] pci 0000:00:00.0: using irq 40 for pin 1
[ 0.580000] Switching to clocksource MIPS
[ 0.590000] NET: Registered protocol family 2
[ 0.590000] TCP established hash table entries: 512 (order: 0, 4096 bytes)
[ 0.590000] TCP bind hash table entries: 512 (order: -1, 2048 bytes)
[ 0.600000] TCP: Hash tables configured (established 512 bind 512)
[ 0.600000] TCP: reno registered
[ 0.610000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.610000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.620000] NET: Registered protocol family 1
[ 0.620000] PCI: CLS 0 bytes, default 32
[ 0.650000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.650000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.660000] msgmni has been set to 119
[ 0.670000] io scheduler noop registered
[ 0.670000] io scheduler deadline registered (default)
[ 0.680000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[ 0.700000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A
[ 0.710000] console [ttyS0] enabled, bootconsole disabled
[ 0.720000] ath79-spi ath79-spi: master is unqueued, this is deprecated
[ 0.730000] m25p80 spi0.0: found mx25l12805d, expected m25p80
[ 0.740000] m25p80 spi0.0: mx25l12805d (16384 Kbytes)
[ 0.750000] 4 cmdlinepart partitions found on MTD device spi0.0
[ 0.750000] Creating 4 MTD partitions on "spi0.0":
[ 0.760000] 0x000000000000-0x000000040000 : "u-boot"
[ 0.760000] 0x000000040000-0x000000050000 : "u-boot-env"
[ 0.770000] 0x000000050000-0x0000007f0000 : "firmware"
[ 0.780000] 2 netgear-fw partitions found on MTD device firmware
[ 0.780000] 0x000000050000-0x000000156440 : "kernel"
[ 0.790000] mtd: partition "kernel" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[ 0.800000] 0x000000156440-0x0000007f0000 : "rootfs"
[ 0.810000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[ 0.820000] mtd: device 4 (rootfs) set to be root filesystem
[ 0.830000] 1 squashfs-split partitions found on MTD device rootfs
[ 0.840000] 0x000000690000-0x0000007f0000 : "rootfs_data"
[ 0.840000] 0x0000007f0000-0x000000800000 : "art"
[ 0.870000] libphy: ag71xx_mdio: probed
[ 1.420000] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.1:04 [uid=004dd041, driver=Generic PHY]
[ 1.430000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:MII
[ 1.990000] ag71xx-mdio.1: Found an AR7240/AR9330 built-in switch
[ 3.030000] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:GMII
[ 3.040000] TCP: cubic registered
[ 3.040000] NET: Registered protocol family 17
[ 3.050000] Bridge firewalling registered
[ 3.050000] 8021q: 802.1Q VLAN Support v1.8
[ 3.060000] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[ 3.070000] Freeing unused kernel memory: 284K (80329000 - 80370000)
[ 7.180000] usbcore: registered new interface driver usbfs
[ 7.190000] usbcore: registered new interface driver hub
[ 7.190000] usbcore: registered new device driver usb
[ 7.250000] SCSI subsystem initialized
[ 7.260000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 7.270000] ehci-platform: EHCI generic platform driver
[ 7.280000] ehci-platform ehci-platform: EHCI Host Controller
[ 7.280000] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[ 7.290000] ehci-platform ehci-platform: irq 3, io mem 0x1b000000
[ 7.320000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[ 7.320000] hub 1-0:1.0: USB hub found
[ 7.330000] hub 1-0:1.0: 1 port detected
[ 7.330000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 7.350000] usbcore: registered new interface driver usb-storage
[ 7.790000] Loading modules backported from Linux version master-2014-05-22-0-gf2032ea
[ 7.790000] Backport generated by backports.git backports-20140320-37-g5c33da0
[ 7.940000] cfg80211: Calling CRDA to update world regulatory domain
[ 7.960000] cfg80211: World regulatory domain updated:
[ 7.960000] cfg80211: DFS Master region: unset
[ 7.960000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[ 7.970000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 7.980000] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 7.990000] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[ 8.000000] cfg80211: (5170000 KHz - 5250000 KHz @ 160000 KHz), (N/A, 2000 mBm), (N/A)
[ 8.010000] cfg80211: (5250000 KHz - 5330000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[ 8.020000] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[ 8.020000] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 8.030000] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[ 8.110000] PCI: Enabling device 0000:00:00.0 (0000 -> 0002)
[ 8.120000] ath: phy0: eeprom contains invalid mac address: ff:ff:ff:ff:ff:ff
[ 8.130000] ath: phy0: random mac address will be used: d2:51:b1:c6:a2:39
[ 8.140000] ath: EEPROM regdomain: 0x0
[ 8.140000] ath: EEPROM indicates default country code should be used
[ 8.140000] ath: doing EEPROM country->regdmn map search
[ 8.140000] ath: country maps to regdmn code: 0x3a
[ 8.140000] ath: Country alpha2 being used: US
[ 8.140000] ath: Regpair used: 0x3a
[ 8.150000] ieee80211 phy0: Failed to initialize wep: -2
[ 8.150000] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[ 8.160000] cfg80211: Calling CRDA for country: US
[ 8.170000] cfg80211: Regulatory domain changed to country: US
[ 8.170000] cfg80211: DFS Master region: FCC
[ 8.180000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[ 8.190000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 3000 mBm), (N/A)
[ 8.190000] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 1700 mBm), (N/A)
[ 8.200000] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz), (N/A, 2300 mBm), (0 s)
[ 8.210000] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 mBm), (N/A)
[ 8.220000] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
[ 8.230000] ieee80211 phy0: Atheros AR9287 Rev:2 mem=0xb0000000, irq=40
[ 8.540000] usb 1-1: new high-speed USB device number 2 using ehci-platform
[ 8.770000] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 8.770000] scsi0 : usb-storage 1-1:1.0
[ 9.780000] scsi 0:0:0:0: Direct-Access JetFlash Transcend 4GB 8.07 PQ: 0 ANSI: 2
[ 9.790000] sd 0:0:0:0: [sda] 7843840 512-byte logical blocks: (4.01 GB/3.74 GiB)
[ 9.800000] sd 0:0:0:0: [sda] Write Protect is off
[ 9.800000] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[ 9.800000] sd 0:0:0:0: [sda] No Caching mode page found
[ 9.810000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 9.820000] sd 0:0:0:0: [sda] No Caching mode page found
[ 9.830000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 10.320000] sda: sda1 sda2
[ 10.330000] sd 0:0:0:0: [sda] No Caching mode page found
[ 10.330000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 10.340000] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 13.220000] jffs2: notice: (371) jffs2_build_xattr_subsystem: complete building xattr subsystem, 2 of xdatum (1 unchecked, 1 orphan) and 36 of xref (0 dead, 20 orphan) found.
[ 13.250000] EXT4-fs (sda2): mounting ext3 file system using the ext4 subsystem
[ 15.570000] EXT4-fs (sda2): recovery complete
[ 15.570000] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts:
[ 18.040000] Adding 131068k swap on /dev/sda1. Priority:-1 extents:1 across:131068k
[ 19.260000] NET: Registered protocol family 8
[ 19.260000] NET: Registered protocol family 20
[ 19.270000] tun: Universal TUN/TAP device driver, 1.6
[ 19.280000] tun: (C) 1999-2004 Max Krasnyansky <maxk@…>
[ 19.290000] l2tp_core: L2TP core driver, V2.0
[ 19.300000] l2tp_netlink: L2TP netlink interface
[ 19.310000] gre: GRE over IPv4 demultiplexor driver
[ 19.320000] ip_gre: GRE over IPv4 tunneling driver
[ 19.340000] PPP generic driver version 2.4.2
[ 19.380000] u32 classifier
[ 19.390000] input device check on
[ 19.390000] Actions configured
[ 19.400000] Mirror/redirect action on
[ 19.440000] nf_conntrack version 0.5.0 (960 buckets, 3840 max)
[ 19.470000] usbcore: registered new interface driver cdc_acm
[ 19.480000] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 19.540000] PPP MPPE Compression module registered
[ 19.560000] NET: Registered protocol family 24
[ 19.560000] PPTP driver version 0.8.5
[ 19.600000] usbcore: registered new interface driver ums-alauda
[ 19.620000] usbcore: registered new interface driver ums-cypress
[ 19.640000] usbcore: registered new interface driver ums-datafab
[ 19.650000] usbcore: registered new interface driver ums-freecom
[ 19.660000] usbcore: registered new interface driver ums-isd200
[ 19.680000] usbcore: registered new interface driver ums-jumpshot
[ 19.680000] usbcore: registered new interface driver ums-karma
[ 19.700000] usbcore: registered new interface driver ums-sddr09
[ 19.720000] usbcore: registered new interface driver ums-sddr55
[ 19.740000] usbcore: registered new interface driver ums-usbat
[ 19.760000] usbcore: registered new interface driver usbserial
[ 19.760000] usbcore: registered new interface driver usbserial_generic
[ 19.780000] usbserial: USB Serial support registered for generic
[ 19.890000] xt_time: kernel timezone is -0000
[ 19.910000] usbcore: registered new interface driver ark3116
[ 19.910000] usbserial: USB Serial support registered for ark3116
[ 19.940000] usbcore: registered new interface driver belkin_sa
[ 19.940000] usbserial: USB Serial support registered for Belkin / Peracom / GoHubs USB Serial Adapter
[ 19.960000] usbcore: registered new interface driver ch341
[ 19.960000] usbserial: USB Serial support registered for ch341-uart
[ 19.980000] usbcore: registered new interface driver cp210x
[ 19.980000] usbserial: USB Serial support registered for cp210x
[ 19.990000] usbcore: registered new interface driver cypress_m8
[ 20.010000] usbserial: USB Serial support registered for DeLorme Earthmate USB
[ 20.010000] usbserial: USB Serial support registered for HID->COM RS232 Adapter
[ 20.030000] usbserial: USB Serial support registered for Nokia CA-42 V2 Adapter
[ 20.090000] Ebtables v2.0 registered
[ 20.090000] usbcore: registered new interface driver ftdi_sio
[ 20.110000] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 20.120000] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 20.160000] l2tp_ppp: PPPoL2TP kernel driver, V2.0
[ 20.190000] usbcore: registered new interface driver ipw
[ 20.200000] usbserial: USB Serial support registered for IPWireless converter
[ 20.210000] usbcore: registered new interface driver option
[ 20.220000] usbserial: USB Serial support registered for GSM modem (1-port)
[ 35.330000] device eth1 entered promiscuous mode
[ 37.020000] cfg80211: Calling CRDA for country: RU
[ 37.030000] cfg80211: Regulatory domain changed to country: RU
[ 37.030000] cfg80211: DFS Master region: ETSI
[ 37.040000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[ 37.050000] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 37.050000] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 37.060000] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz), (N/A, 2000 mBm), (0 s)
[ 37.070000] cfg80211: (5650000 KHz - 5730000 KHz @ 80000 KHz), (N/A, 3000 mBm), (0 s)
[ 37.080000] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 mBm), (N/A)
[ 37.690000] eth0: link up (100Mbps/Full duplex)
[ 40.930000] device wlan0 entered promiscuous mode
[ 47.120000] device tap0 entered promiscuous mode
[ 47.130000] br-lan: port 3(tap0) entered forwarding state
[ 47.130000] br-lan: port 3(tap0) entered forwarding state
[ 48.340000] br-lan: port 2(wlan0) entered forwarding state
[ 48.350000] br-lan: port 2(wlan0) entered forwarding state
[ 49.130000] br-lan: port 3(tap0) entered forwarding state
[ 50.350000] br-lan: port 2(wlan0) entered forwarding state

comment:18 Changed 3 years ago by navhaxs

I can also confirm that extroot is working with the above fix once the patch has been applied.

comment:19 Changed 3 years ago by nonsferatum

Hi to all, i am an italian user with wnr2200. My router now work very well after built an image with the mod posted in this page.

For who want make an image with this fix I only download the last trunk version of openwrt
and changed the file called mach-wnr2200.c in .../trunk/target/linux/ar71xx/files/arch/mips/ath79.

Change the code in the file as pasted here

/*
 *  NETGEAR WNR2200 board support
 *
 *  Copyright (C) 2013 Aidan Kissane <aidankissane at googlemail.com>
 *
 *  This program is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License version 2 as published
 *  by the Free Software Foundation.
 */

#include <linux/gpio.h>

#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>

#include <asm/mach-ath79/ath79.h>
#include <asm/mach-ath79/ar71xx_regs.h>

#include "common.h"
#include "dev-ap9x-pci.h"
#include "dev-eth.h"
#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#include "dev-m25p80.h"
#include "dev-usb.h"
#include "machtypes.h"

// AR9287 GPIO LED
#define WNR2200_GPIO_LED_WLAN          0
#define WNR2200_GPIO_LED_PWR_AMBER     1
#define WNR2200_GPIO_LED_PWR_GREEN     2
#define WNR2200_GPIO_USB_5V            4

// AR9287 GPIO BUTTON
#define WNR2200_GPIO_BUTTON_WIFI       3
#define WNR2200_GPIO_BUTTON_WPS        5
#define WNR2200_GPIO_BUTTON_RESET      6

// AR7241
#define WNR2200_GPIO_LED_WPS           7
#define WNR2200_GPIO_LED_USB           8

#define WNR2200_GPIO_LED_LAN1_AMBER    6
#define WNR2200_GPIO_LED_LAN2_AMBER    0
#define WNR2200_GPIO_LED_LAN3_AMBER    11
#define WNR2200_GPIO_LED_LAN4_AMBER    1
#define WNR2200_GPIO_LED_WAN_AMBER     12

#define WNR2200_MAC0_OFFSET            0
#define WNR2200_MAC1_OFFSET            6
#define WNR2200_PCIE_CALDATA_OFFSET    0x1000

static struct gpio_led wnr2200_leds_gpio[] __initdata = {
	{
		.name		= "netgear:amber:lan1",
		.gpio		= WNR2200_GPIO_LED_LAN1_AMBER,
		.active_low	= 1,
	}, {
		.name		= "netgear:amber:lan2",
		.gpio		= WNR2200_GPIO_LED_LAN2_AMBER,
		.active_low	= 1,
	}, {
		.name		= "netgear:amber:lan3",
		.gpio		= WNR2200_GPIO_LED_LAN3_AMBER,
		.active_low	= 1,
	}, {
		.name		= "netgear:amber:lan4",
		.gpio		= WNR2200_GPIO_LED_LAN4_AMBER,
		.active_low	= 1,
	}, {
		.name		= "netgear:green:wps",
		.gpio		= WNR2200_GPIO_LED_WPS,
		.active_low	= 1,
	}, {
		.name		= "netgear:green:usb",
		.gpio		= WNR2200_GPIO_LED_USB,
		.active_low	= 1,
	}, {
		.name		= "netgear:amber:wan",
		.gpio		= WNR2200_GPIO_LED_WAN_AMBER,
		.active_low	= 1,
	}, {
		.name		= "netgear:amber:power",
		.gpio		= WNR2200_GPIO_LED_PWR_AMBER,
		.active_low	= 1,
	}, {
		.name		= "netgear:green:power",
		.gpio		= WNR2200_GPIO_LED_PWR_GREEN,
		.active_low	= 1,
	}
};

static void __init wnr2200_setup(void)
{
	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);

        // Disable JTAG to use all AR7241 gpio leds.
        ath79_gpio_function_setup(AR724X_GPIO_FUNC_JTAG_DISABLE, 0);

	ath79_register_mdio(0, 0x0);

	ath79_init_mac(ath79_eth0_data.mac_addr, art+WNR2200_MAC0_OFFSET, 0);
	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ath79_eth0_data.speed = SPEED_100;
	ath79_eth0_data.duplex = DUPLEX_FULL;

	ath79_init_mac(ath79_eth1_data.mac_addr, art+WNR2200_MAC1_OFFSET, 0);
	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
	ath79_eth1_data.phy_mask = 0x10;

	ath79_register_eth(0);
	ath79_register_eth(1);

	ath79_register_m25p80(NULL);
	ap91_pci_init(art + WNR2200_PCIE_CALDATA_OFFSET, NULL);

        ap9x_pci_setup_wmac_led_pin(0, WNR2200_GPIO_LED_WLAN);

	ath79_register_leds_gpio(-1, ARRAY_SIZE(wnr2200_leds_gpio),
					wnr2200_leds_gpio);

	/* enable power for the USB port */
        ap9x_pci_setup_wmac_gpio(0,
            BIT(WNR2200_GPIO_USB_5V) |
            BIT(WNR2200_GPIO_LED_PWR_AMBER) | BIT(WNR2200_GPIO_LED_PWR_GREEN),
            BIT(WNR2200_GPIO_USB_5V) | BIT(WNR2200_GPIO_LED_PWR_AMBER));

	ath79_register_usb();
}

MIPS_MACHINE(ATH79_MACH_WNR2200, "WNR2200", "NETGEAR WNR2200", wnr2200_setup);

And then i make the image. Thank so much for the code and the beautiful work, please fix the file.

comment:20 Changed 3 years ago by anonymous

nonsferatum please commit your working change to the openwrt trunk !

Changed 3 years ago by der_mar

Patch to the master trunk

comment:21 follow-up: Changed 3 years ago by der_mar

Send it to openwrt-devel@… http://patchwork.ozlabs.org/patch/448970/

comment:22 Changed 3 years ago by anonymous

Did you see the "signoff is missing" comment to the patch? http://patchwork.ozlabs.org/patch/448970/

comment:23 in reply to: ↑ 21 Changed 3 years ago by anonymous

Replying to der_mar:

Send it to openwrt-devel@… http://patchwork.ozlabs.org/patch/448970/

signoff is missing, resend please.

comment:24 Changed 3 years ago by anonymous

@ "
AR9287 GPIO BUTTON
#define WNR2200_GPIO_BUTTON_WIFI 3
#define WNR2200_GPIO_BUTTON_WPS 5
#define WNR2200_GPIO_BUTTON_RESET 6
"

I think that should be _GPIO_BTN_ instead.

comment:25 follow-up: Changed 2 years ago by navhaxs

The signoff is still missing. http://patchwork.ozlabs.org/patch/449067/

I am thinking of just resending the patch myself - it has been over half a year since the working solution was discovered. dd-wrt has already had this working.

Replying to anonymous:

@ "
AR9287 GPIO BUTTON
#define WNR2200_GPIO_BUTTON_WIFI 3
#define WNR2200_GPIO_BUTTON_WPS 5
#define WNR2200_GPIO_BUTTON_RESET 6
"

I think that should be _GPIO_BTN_ instead.

What is the problem with _GPIO_BUTTON_ ?

comment:26 in reply to: ↑ 25 Changed 2 years ago by anonymous

I am thinking of just resending the patch myself

please do, I'd be grateful

What is the problem with _GPIO_BUTTON_ ?

since button still don't work I thought it might be the name. it wasn't. just forget the comment about gpio button.

comment:27 Changed 2 years ago by anonymous

comment:28 Changed 2 years ago by navhaxs

I am going to send an email to the openwrt devel mailing list to ask for any comments on the preinit script in case there would be any issues.

comment:29 follow-up: Changed 2 years ago by navhaxs

I noticed that updating the base-files package from opkg will remove the 83_load_ath9k_mod file, so therefore the extroot workaround isn't really a permanent fix.

Upgrading base-files ...
...
Removing obsolete file /lib/preinit/83_load_ath9k_mod.
...

comment:30 in reply to: ↑ 29 Changed 2 years ago by anonymous

Replying to navhaxs:

I noticed that updating the base-files package from opkg will remove the 83_load_ath9k_mod file, so therefore the extroot workaround isn't really a permanent fix.

Upgrading base-files ...
...
Removing obsolete file /lib/preinit/83_load_ath9k_mod.
...

Isn't that because you replace a patched build with an upstream package that isn't patched? If the patches are accepted, wouldn't that work even when updating?

comment:31 Changed 2 years ago by anonymous

I've just submitted another patch for this issue. It doesn't change the LED configuration, but it does send power to the USB port, which is what I'm guessing that most people here care about.

http://patchwork.ozlabs.org/patch/525859/

comment:33 Changed 2 years ago by anonymous

Latest trunk has no working USB and LED. Bug NOT fixed. Only working solution is /usr/sbin/modprobe ath9k

comment:34 Changed 2 years ago by milkamil93@…

Всем привет! ) Буду ли внесены когда нить фиксы, в недавней прошивке 25.11.15 числа USB всё так же не работает ((( Есть ли где нить правильная прошивка???

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.