Re: [OpenWrt-Devel] TP-Link TL-WA901ND V2 support

2011-02-05 Thread Gabor Juhos
Hi Jonathan,

..
 Here's the relevant lines from dmesg:
 ag71xx_mdio: probed
 eth0: Atheros AG71xx at 0xb900, irq 4
 eth0: connected to PHY at ag71xx-mdio:0c [uid=8201, driver=Generic PHY]

The PHY is at address 0x0c. So the phy mask should be 0x1000 (1  12).

 
 I don't really understand the mask. I know it determines what phy is
 selected, but I'm in the dark about the correct value.
 I've tried using both b900 and 8201.
 both result in a 'no PHY found with phy_mask' message.

The b900 is the address of the ethernet registers, and the 8201 is the
ID of the PHY.

 
 
  set_preinit_iface() {
   ifname=eth0
 + [ $(ar71xx_board_name) = tl-wa901nd-v2 ]  mii-tool -R
 + /* The TP-link WA901ND V2 requires a hardware reset of
 +  * its ethernet port before it will connect.
 +  */
 +

 This looks strange. The phy core should reset the PHY automatically. Please 
 try
 to add this line into the machine setup code, somewhere before the
 'ar71xx_add_device_eth(0)' call:

 ar71xx_eth0_data.reset_bit = RESET_MODULE_GE0_MAC | RESET_MODULE_GE0_PHY;
 
 That works perfectly. Thank you! Using mii-tool was really bugging me, as 
 well.
 
 
 Once the correct phy_mask value is determined, I'll resubmit the patch.

Ok.

Regards,
Gabor
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] TP-Link TL-WA901ND V2 support

2011-02-02 Thread Jonathan Bennett
Included patch adds support for the TP-link WA901ND-v2. I have yet to
map out the leds and buttons, but I don't anticipate having much
problem with that. I'll push that patch through once I get it done.

This patch also adds an init script to the ar71xx platform. It checks
to see if it is running on a wa901ndv2 and brings up the ethernet port
if it is. There may be a better way to reset that phy chip, but this
is the best I've found.

Cheers,
Signed off by: Jonathan Bennett jbscienc...@gmail.com


Index: target/linux/ar71xx/config-2.6.36
===
--- target/linux/ar71xx/config-2.6.36   (revision 25332)
+++ target/linux/ar71xx/config-2.6.36   (working copy)
@@ -33,6 +33,7 @@
 CONFIG_AR71XX_MACH_TEW_632BRP=y
 CONFIG_AR71XX_MACH_TL_MR3X20=y
 CONFIG_AR71XX_MACH_TL_WA901ND=y
+CONFIG_AR71XX_MACH_TL_WA901ND_V2=y
 CONFIG_AR71XX_MACH_TL_WR1043ND=y
 CONFIG_AR71XX_MACH_TL_WR741ND=y
 CONFIG_AR71XX_MACH_TL_WR841N_V1=y
Index: target/linux/ar71xx/config-2.6.37
===
--- target/linux/ar71xx/config-2.6.37   (revision 25332)
+++ target/linux/ar71xx/config-2.6.37   (working copy)
@@ -33,6 +33,7 @@
 CONFIG_AR71XX_MACH_TEW_632BRP=y
 CONFIG_AR71XX_MACH_TL_MR3X20=y
 CONFIG_AR71XX_MACH_TL_WA901ND=y
+CONFIG_AR71XX_MACH_TL_WA901ND_V2=y
 CONFIG_AR71XX_MACH_TL_WR1043ND=y
 CONFIG_AR71XX_MACH_TL_WR741ND=y
 CONFIG_AR71XX_MACH_TL_WR841N_V1=y
Index: target/linux/ar71xx/files/arch/mips/ar71xx/Makefile
===
--- target/linux/ar71xx/files/arch/mips/ar71xx/Makefile (revision 25332)
+++ target/linux/ar71xx/files/arch/mips/ar71xx/Makefile (working copy)
@@ -48,6 +48,7 @@
 obj-$(CONFIG_AR71XX_MACH_TEW_632BRP)   += mach-tew-632brp.o
 obj-$(CONFIG_AR71XX_MACH_TL_MR3X20)+= mach-tl-mr3x20.o
 obj-$(CONFIG_AR71XX_MACH_TL_WA901ND)   += mach-tl-wa901nd.o
+obj-$(CONFIG_AR71XX_MACH_TL_WA901ND_V2)+= mach-tl-wa901nd-v2.o
 obj-$(CONFIG_AR71XX_MACH_TL_WR741ND)   += mach-tl-wr741nd.o
 obj-$(CONFIG_AR71XX_MACH_TL_WR841N_V1) += mach-tl-wr841n.o
 obj-$(CONFIG_AR71XX_MACH_TL_WR941ND)   += mach-tl-wr941nd.o
Index: target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h
===
--- target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h   (revision 25332)
+++ target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h   (working copy)
@@ -42,6 +42,7 @@
AR71XX_MACH_TL_MR3220,  /* TP-LINK TL-MR3220 */
AR71XX_MACH_TL_MR3420,  /* TP-LINK TL-MR3420 */
AR71XX_MACH_TL_WA901ND, /* TP-LINK TL-WA901ND */
+   AR71XX_MACH_TL_WA901ND_V2, /* TP-LINK TL-WA901ND v2 */
AR71XX_MACH_TL_WR741ND, /* TP-LINK TL-WR741ND */
AR71XX_MACH_TL_WR841N_V1, /* TP-LINK TL-WR841N v1 */
AR71XX_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */
Index: target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wa901nd-v2.c
===
--- target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wa901nd-v2.c 
(revision 0)
+++ target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wa901nd-v2.c 
(revision 0)
@@ -0,0 +1,127 @@
+/*
+ *  TP-LINK TL-WA901ND board support
+ *
+ *  Copyright (C) 2009-2010 Gabor Juhos juh...@openwrt.org
+ *  Copyright (C) 2010 Pieter Hollants pie...@hollants.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/mtd/mtd.h
+#include linux/mtd/partitions.h
+
+#include asm/mach-ar71xx/ar71xx.h
+
+#include machtype.h
+#include devices.h
+#include dev-m25p80.h
+#include dev-gpio-buttons.h
+#include dev-leds-gpio.h
+#include dev-ar913x-wmac.h
+
+#define TL_WA901ND_GPIO_LED_QSS0
+#define TL_WA901ND_GPIO_LED_SYSTEM 1
+
+#define TL_WA901ND_GPIO_BTN_RESET  11
+#define TL_WA901ND_GPIO_BTN_QSS12
+
+#define TL_WA901ND_BUTTONS_POLL_INTERVAL   20
+
+#ifdef CONFIG_MTD_PARTITIONS
+static struct mtd_partition tl_wa901nd_partitions[] = {
+   {
+   .name   = u-boot,
+   .offset = 0,
+   .size   = 0x02,
+   .mask_flags = MTD_WRITEABLE,
+   }, {
+   .name   = kernel,
+   .offset = 0x02,
+   .size   = 0x14,
+   }, {
+   .name   = rootfs,
+   .offset = 0x16,
+   .size   = 0x29,
+   }, {
+   .name   = art,
+   .offset = 0x3f,
+   .size   = 0x01,
+   .mask_flags = MTD_WRITEABLE,
+   }, {
+   .name   = firmware,
+   .offset = 0x02,
+   .size   = 0x3d,
+   }
+};
+#endif /* 

Re: [OpenWrt-Devel] TP-Link TL-WA901ND V2 support

2011-01-29 Thread Gabor Juhos
Hi Jonathan,

 OK, so, I was finally able to compile forcedeth support into the
 kernel. It seems that the kernel compile process prompts whether to
 actually compile that in. Without running V=99, I had no way of
 telling it to actually include forcedeth support.

You don't need forcedeth support. The ethernet controller is built into the
AR9132. The RTL8201CP is a PHY chip, and it should be supported by the generic
phy driver.

 That said, I still have no ethernet support. Strangely enough,
 absolutely no pci devices show up in /proc/bus/pci/devices. The file
 is altogether empty.

The AR9132 has no PCI bus at all.

 A couple questions: First, should I continue to document my efforts
 here, or create a thread in the forums?

Please show me your machine setup code.

Regards,
Gabor
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] TP-Link TL-WA901ND V2 support

2011-01-28 Thread Jonathan Bennett
OK, so, I was finally able to compile forcedeth support into the
kernel. It seems that the kernel compile process prompts whether to
actually compile that in. Without running V=99, I had no way of
telling it to actually include forcedeth support.

That said, I still have no ethernet support. Strangely enough,
absolutely no pci devices show up in /proc/bus/pci/devices. The file
is altogether empty.

A couple questions: First, should I continue to document my efforts
here, or create a thread in the forums?

Second, when I dumped the flash, I did a 'dd if=/dev/mtd[#]
of=/tmp/901V2dump[#].bin'  Should I have dd'ed from mtdblock instead?

The stock boot log is now up here:
http://oneru.dyndns.org/openwrt/WA901NDv2/901V2BootLog.txt

I do see one item that sticks out. There is a
'/lib/modules/2.6.15/net/ag7100_mod.ko' in the stock firmware. Could
it be a proprietary driver? I'd try to investigate it further, but I
can't think of a way to transfer the file off the router.

Cheers,
Jonathan Bennett
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] TP-Link TL-WA901ND V2 support

2011-01-26 Thread Jonathan Bennett
The stock firmware is now up at http://oneru.dyndns.org/openwrt/WA901NDv2/

The driver for the ethernet chip appears to be the the forcedeth.c
driver that ships with the kernel. I haven't been successful in making
the build process include that file for compilation, though. I've
added CONFIG_FORCEDETH=Y it to
trunk/target/linux/generic/config-2.6.32 and
trunk/target/linux/ar71xx/config-2.6.32. That driver isn't added to
the firmware, and the actual .config file in the build directory has
it unset. What am I missing to make this driver compile?

~Jonathan Bennett
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel