Re: [OpenWrt-Devel] Buffalo WZR-HP-G300NH2 support

2011-12-29 Thread Victor Khimenko
On Thu, Dec 29, 2011 at 3:47 AM, Peter Naulls  wrote:

> On 12/28/2011 11:09 AM, Victor Khimenko wrote:
>
> [Try and retain attributions if you can]
>
>
> For anyone who's not been following, this means that
>>WZR-HP-G300NH, WZR-HP-G300NH2 and WZR-HP-AG300N are
>>supported in a single image.
>>
>>
>> How is it supposed to work? I've just spent about six hours trying to
>> revive my
>> WZR-HP-AG300N after upgrade. Took so much time because upgrade
>> simultaneously
>> broke login (because it introduced /etc/shadow so ssh become useless) and
>> broke
>> failsafe mode so I was forced to learn to flash via tftp (easy and simple
>> to do
>> if you have everything ready and don't need to ask around for borrowable
>> switch).
>>
>
> All these are unrelated. My AG300N is broken too with recent changes, for
> reasons I haven't investigated closely, and could well be fixed by now.
>  But I
> promise it's nothing to do with my patch.  Despite the size of the patch,
> all it does it choose the machine setup based upon what the SoC is.
>
> Well, I hoped your patch will actually fix AG300N. It was broken in trunk
the same way.

Now it's fixed in trunk and I'm to lazy too check if it works with your
patch.


> If you are having problems with AG300N, then certainly avoid my patch
> and use unmodified trunk until that is resolved.  Then everything I've
> done will work just fine.
> __**_
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.**org 
> https://lists.openwrt.org/**mailman/listinfo/openwrt-devel
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Buffalo WZR-HP-G300NH2 support

2011-12-28 Thread Peter Naulls

On 12/28/2011 11:09 AM, Victor Khimenko wrote:

[Try and retain attributions if you can]


For anyone who's not been following, this means that
WZR-HP-G300NH, WZR-HP-G300NH2 and WZR-HP-AG300N are
supported in a single image.


How is it supposed to work? I've just spent about six hours trying to revive my
WZR-HP-AG300N after upgrade. Took so much time because upgrade simultaneously
broke login (because it introduced /etc/shadow so ssh become useless) and broke
failsafe mode so I was forced to learn to flash via tftp (easy and simple to do
if you have everything ready and don't need to ask around for borrowable 
switch).


All these are unrelated. My AG300N is broken too with recent changes, for 
reasons I haven't investigated closely, and could well be fixed by now.  But I

promise it's nothing to do with my patch.  Despite the size of the patch,
all it does it choose the machine setup based upon what the SoC is.

If you are having problems with AG300N, then certainly avoid my patch
and use unmodified trunk until that is resolved.  Then everything I've
done will work just fine.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Buffalo wzr-hp-g300nh2

2011-12-15 Thread Peter Naulls

On 12/14/2011 12:52 PM, Felix Fietkau wrote:


If I clean up the common mtd code between the various boards which
concat two partitions together, can we get this applied?

I recently moved the mtd concat code so that it can be shared. I also
added support for registering LEDs from ath9k (based on platform data,
see wzr-hp-g450h). Please update your patch to make use of this, and
I'll make sure it gets merged.



First cut.  There are obviously further changes to remove the ag300h
as an explicit target in image generation.  But this is the core
arch file change.




Index: files/arch/mips/ar71xx/mach-wzr-hp-g300nh.c
===
--- files/arch/mips/ar71xx/mach-wzr-hp-g300nh.c	(revision 29529)
+++ files/arch/mips/ar71xx/mach-wzr-hp-g300nh.c	(working copy)
@@ -1,7 +1,12 @@
 /*
  *  Buffalo WZR-HP-G300NH board support
+ *  Buffalo WZR-HP-G300NH2 board support
+ *  Buffalo WZR-HP-AG300H board support
  *
  *  Copyright (C) 2010 Gabor Juhos 
+ *  Copyright (C) 2011 Felix Fietkau 
+ *  Copyright (C) 2011 Mark Deneen 
+ *  Copyright (C) 2011 Peter Naulls 
  *
  *  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
@@ -11,8 +16,11 @@
 #include 
 #include 
 #include 
+#include 
+
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -20,10 +28,13 @@
 
 #include "machtype.h"
 #include "devices.h"
+#include "dev-ap94-pci.h"
 #include "dev-ar9xxx-wmac.h"
 #include "dev-gpio-buttons.h"
 #include "dev-leds-gpio.h"
 #include "dev-usb.h"
+#include "dev-ap91-pci.h"
+#include "dev-m25p80.h"
 
 #define WZRHPG300NH_GPIO_LED_USB	0
 #define WZRHPG300NH_GPIO_LED_DIAG	1
@@ -53,6 +64,18 @@
 
 #define WZRHPG300NH_MAC_OFFSET		0x20c
 
+
+#define WZRHPG300NH2_MAC_OFFSET		0x20c
+#define WZRHPG300NH2_KEYS_POLL_INTERVAL 20  /* msecs */
+#define WZRHPG300NH2_KEYS_DEBOUNCE_INTERVAL (3 * WZRHPG300NH2_KEYS_POLL_INTERVAL)
+
+
+#define WZRHPAG300H_MAC_OFFSET0x20c
+#define WZRHPAG300H_KEYS_POLL_INTERVAL 20  /* msecs */
+#define WZRHPAG300H_KEYS_DEBOUNCE_INTERVAL (3 * WZRHPAG300H_KEYS_POLL_INTERVAL)
+
+
+
 #ifdef CONFIG_MTD_PARTITIONS
 static struct mtd_partition wzrhpg300nh_flash_partitions[] = {
 	{
@@ -89,6 +112,47 @@
 		.size		= 0x1f6,
 	}
 };
+
+
+/* AG300H and G300NH2 use identical flash layouts */
+
+static struct mtd_partition wzrhpg300nh2_flash_partitions[] = {
+	{
+		.name		= "u-boot",
+		.offset		= 0,
+		.size		= 0x004,
+		.mask_flags	= MTD_WRITEABLE,
+	}, {
+		.name		= "u-boot-env",
+		.offset		= 0x004,
+		.size		= 0x001,
+		.mask_flags	= MTD_WRITEABLE,
+	}, {
+		.name		= "art",
+		.offset		= 0x005,
+		.size		= 0x001,
+		.mask_flags	= MTD_WRITEABLE,
+	}, {
+		.name		= "kernel",
+		.offset		= 0x006,
+		.size		= 0x010,
+	}, {
+		.name		= "rootfs",
+		.offset		= 0x016,
+		.size		= 0x1e9,
+	}, {
+		.name		= "user_property",
+		.offset		= 0x1ff,
+		.size		= 0x001,
+		.mask_flags	= MTD_WRITEABLE,
+	}, {
+		.name		= "firmware",
+		.offset		= 0x006,
+		.size		= 0x1f9,
+	}
+};
+
+
 #endif /* CONFIG_MTD_PARTITIONS */
 
 static struct ar91xx_flash_platform_data wzrhpg300nh_flash_data = {
@@ -99,6 +163,16 @@
 #endif
 };
 
+
+static struct flash_platform_data wzrhpg300nh2_flash_data = {
+#ifdef CONFIG_MTD_PARTITIONS
+  .parts  = wzrhpg300nh2_flash_partitions,
+  .nr_parts   = ARRAY_SIZE(wzrhpg300nh2_flash_partitions),
+#endif
+};
+
+
+
 #define WZRHPG300NH_FLASH_BASE	0x1e00
 #define WZRHPG300NH_FLASH_SIZE	(32 * 1024 * 1024)
 
@@ -120,6 +194,7 @@
 	}
 };
 
+
 static struct gpio_led wzrhpg300nh_leds_gpio[] __initdata = {
 	{
 		.name		= "buffalo:orange:security",
@@ -144,6 +219,24 @@
 	}
 };
 
+/* There are more of these, but they must be accessed through ath9k */
+static struct gpio_led wzrhpg300nh2_leds_gpio[] __initdata = {
+	{
+		.name		= "wzr-hp-g300nh2:red:diag",
+		.gpio		= 16,
+		.active_low	= 1,
+	}, 
+};
+
+
+static struct gpio_led wzrhpag300h_leds_gpio[] __initdata = {
+  {
+.name   = "buffalo:red:diag",
+.gpio   = 1,
+.active_low = 1,
+  },
+};
+
 static struct gpio_keys_button wzrhpg300nh_gpio_keys[] __initdata = {
 	{
 		.desc		= "reset",
@@ -197,6 +290,78 @@
 	}
 };
 
+/* The AOSS button is likely also behind ath9k */
+static struct gpio_keys_button wzrhpg300nh2_gpio_keys[] __initdata = {
+	{
+		.desc		= "reset",
+		.type		= EV_KEY,
+		.code		= KEY_RESTART,
+		.debounce_interval = WZRHPG300NH2_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= 1,
+		.active_low	= 1,
+	}, {
+		.desc		= "usb",
+		.type		= EV_KEY,
+		.code		= BTN_2,
+		.debounce_interval = WZRHPG300NH2_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= 7,
+		.active_low	= 1,
+	}, {
+		.desc		= "qos",
+		.type		= EV_KEY,
+		.code		= BTN_3,
+		.debounce_interval = WZRHPG300NH2_KEYS_DEBOUNCE_INTERVAL,
+		.gpio		= 11,
+		.active_low	= 0,
+	}, {
+		.desc		= "router_on",
+		.type		= EV_KEY,
+		.code		= BTN_5,
+		.debounce_interval = WZRHPG300NH2_KEYS_DEB

Re: [OpenWrt-Devel] Buffalo wzr-hp-g300nh2

2011-12-14 Thread Mark Deneen
On Wed, Dec 14, 2011 at 3:52 PM, Felix Fietkau  wrote:
> On 2011-11-10 5:13 PM, Mark Deneen wrote:
>> On Thu, Nov 10, 2011 at 9:42 AM, Peter Naulls  wrote:
>>> On 11/10/2011 05:59 AM, Ben Pfountz wrote:

 I would like to see support in trunk as well. In the meantime I have been
 using
 the patch Mark Deneen created, which adds support for everything except
 some of
 the LEDs and switches, see his email and thread for more info...

 https://lists.openwrt.org/pipermail/openwrt-devel/2011-August/011901.html
>>>
>>> We have been using these patches for months on many devices.  See my
>>> addition patch to allow the same kernel to work on both the nh and nh2.
>>> I'd like to see the additional LED support too, but not sure I can
>>> justify the time to do it myself right now.
>>
>> If I clean up the common mtd code between the various boards which
>> concat two partitions together, can we get this applied?
> I recently moved the mtd concat code so that it can be shared. I also
> added support for registering LEDs from ath9k (based on platform data,
> see wzr-hp-g450h). Please update your patch to make use of this, and
> I'll make sure it gets merged.

Just a quick note -- I have all of the LEDs working except for the USB
LED.  I can't seem to find it anywhere.  I am also missing the AOSS
button, which is a GPIO off of the wmac similar to the way the LEDs
were handled.

I need to study the mtd concat code, because I was taking a different
route in my tree.  I guess it is a safe assumption that we'll only
have 2 flash devices to concat?

-M
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Buffalo wzr-hp-g300nh2

2011-12-14 Thread Felix Fietkau
On 2011-11-10 5:13 PM, Mark Deneen wrote:
> On Thu, Nov 10, 2011 at 9:42 AM, Peter Naulls  wrote:
>> On 11/10/2011 05:59 AM, Ben Pfountz wrote:
>>>
>>> I would like to see support in trunk as well. In the meantime I have been
>>> using
>>> the patch Mark Deneen created, which adds support for everything except
>>> some of
>>> the LEDs and switches, see his email and thread for more info...
>>>
>>> https://lists.openwrt.org/pipermail/openwrt-devel/2011-August/011901.html
>>
>> We have been using these patches for months on many devices.  See my
>> addition patch to allow the same kernel to work on both the nh and nh2.
>> I'd like to see the additional LED support too, but not sure I can
>> justify the time to do it myself right now.
> 
> If I clean up the common mtd code between the various boards which
> concat two partitions together, can we get this applied?
I recently moved the mtd concat code so that it can be shared. I also
added support for registering LEDs from ath9k (based on platform data,
see wzr-hp-g450h). Please update your patch to make use of this, and
I'll make sure it gets merged.

Thanks,

- Felix
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Buffalo wzr-hp-g300nh2

2011-11-17 Thread Peter Naulls

On 11/17/2011 12:37 AM, Matt Redfearn wrote:

That's great Peter, any ideas when you would be able to get the patches into 
trunk?



Did you read my previous posts?  Probably never.  The developers have
expressed a desire to not combine images.  Why?  I remain unsure.
There's an argument to be had about extra logic for yet unknown
devices, but that seems a bit disingenuous.


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


Re: [OpenWrt-Devel] Buffalo wzr-hp-g300nh2

2011-11-17 Thread Matt Redfearn
That's great Peter, any ideas when you would be able to get the patches into 
trunk?

Thanks,
Matt

-Original Message-
From: openwrt-devel-boun...@lists.openwrt.org 
[mailto:openwrt-devel-boun...@lists.openwrt.org] On Behalf Of Peter Naulls
Sent: 17 November 2011 00:24
To: OpenWrt Development List
Subject: Re: [OpenWrt-Devel] Buffalo wzr-hp-g300nh2

On 11/10/2011 08:21 AM, Peter Naulls wrote:

>
> I'll test any such patches of course. As an additional note, we're
> going to need the same thing on a300gh, since I'm getting one of those
> in next few days. I'll submit any work on that here, even if it's

Now done.  It's a mess right now, so not suitable for posting, but
in short, the wzr-hp-g300nh, wzr-hp-g300nh2 and wzr-hp-ag300h all
use different SoC models, so choosing the right init code based on
that is easy.  The setup for the g300ng2 and ag300h is 80% similar,
so that code could be combined more than I've done.

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


Re: [OpenWrt-Devel] Buffalo wzr-hp-g300nh2

2011-11-16 Thread Peter Naulls

On 11/10/2011 08:21 AM, Peter Naulls wrote:



I'll test any such patches of course. As an additional note, we're
going to need the same thing on a300gh, since I'm getting one of those
in next few days. I'll submit any work on that here, even if it's


Now done.  It's a mess right now, so not suitable for posting, but
in short, the wzr-hp-g300nh, wzr-hp-g300nh2 and wzr-hp-ag300h all
use different SoC models, so choosing the right init code based on
that is easy.  The setup for the g300ng2 and ag300h is 80% similar,
so that code could be combined more than I've done.

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


Re: [OpenWrt-Devel] Buffalo wzr-hp-g300nh2

2011-11-10 Thread Matt Redfearn
Great - this is good news :-) I will of course test these patches, and if there 
is anything I can do to help get them into the trunk then I will do so.
Thanks,
Matt

-Original Message-
From: openwrt-devel-boun...@lists.openwrt.org 
[mailto:openwrt-devel-boun...@lists.openwrt.org] On Behalf Of Peter Naulls
Sent: 10 November 2011 16:21
To: openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] Buffalo wzr-hp-g300nh2

On 11/10/2011 08:13 AM, Mark Deneen wrote:
> On Thu, Nov 10, 2011 at 9:42 AM, Peter Naulls  wrote:
>> On 11/10/2011 05:59 AM, Ben Pfountz wrote:
>>>
>>> I would like to see support in trunk as well. In the meantime I have been
>>> using
>>> the patch Mark Deneen created, which adds support for everything except
>>> some of
>>> the LEDs and switches, see his email and thread for more info...
>>>
>>> https://lists.openwrt.org/pipermail/openwrt-devel/2011-August/011901.html
>>
>> We have been using these patches for months on many devices.  See my
>> addition patch to allow the same kernel to work on both the nh and nh2.
>> I'd like to see the additional LED support too, but not sure I can
>> justify the time to do it myself right now.
>
> If I clean up the common mtd code between the various boards which
> concat two partitions together, can we get this applied?

I'll test any such patches of course.  As an additional note, we're
going to need the same thing on a300gh, since I'm getting one of those
in next few days.  I'll submit any work on that here, even if it's
decided not to use it.


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


Re: [OpenWrt-Devel] Buffalo wzr-hp-g300nh2

2011-11-10 Thread Peter Naulls

On 11/10/2011 08:13 AM, Mark Deneen wrote:

On Thu, Nov 10, 2011 at 9:42 AM, Peter Naulls  wrote:

On 11/10/2011 05:59 AM, Ben Pfountz wrote:


I would like to see support in trunk as well. In the meantime I have been
using
the patch Mark Deneen created, which adds support for everything except
some of
the LEDs and switches, see his email and thread for more info...

https://lists.openwrt.org/pipermail/openwrt-devel/2011-August/011901.html


We have been using these patches for months on many devices.  See my
addition patch to allow the same kernel to work on both the nh and nh2.
I'd like to see the additional LED support too, but not sure I can
justify the time to do it myself right now.


If I clean up the common mtd code between the various boards which
concat two partitions together, can we get this applied?


I'll test any such patches of course.  As an additional note, we're
going to need the same thing on a300gh, since I'm getting one of those
in next few days.  I'll submit any work on that here, even if it's
decided not to use it.


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


Re: [OpenWrt-Devel] Buffalo wzr-hp-g300nh2

2011-11-10 Thread Mark Deneen
On Thu, Nov 10, 2011 at 9:42 AM, Peter Naulls  wrote:
> On 11/10/2011 05:59 AM, Ben Pfountz wrote:
>>
>> I would like to see support in trunk as well. In the meantime I have been
>> using
>> the patch Mark Deneen created, which adds support for everything except
>> some of
>> the LEDs and switches, see his email and thread for more info...
>>
>> https://lists.openwrt.org/pipermail/openwrt-devel/2011-August/011901.html
>
> We have been using these patches for months on many devices.  See my
> addition patch to allow the same kernel to work on both the nh and nh2.
> I'd like to see the additional LED support too, but not sure I can
> justify the time to do it myself right now.

If I clean up the common mtd code between the various boards which
concat two partitions together, can we get this applied?

-M
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Buffalo wzr-hp-g300nh2

2011-11-10 Thread Peter Naulls

On 11/10/2011 05:59 AM, Ben Pfountz wrote:

I would like to see support in trunk as well. In the meantime I have been using
the patch Mark Deneen created, which adds support for everything except some of
the LEDs and switches, see his email and thread for more info...

https://lists.openwrt.org/pipermail/openwrt-devel/2011-August/011901.html


We have been using these patches for months on many devices.  See my
addition patch to allow the same kernel to work on both the nh and nh2.
I'd like to see the additional LED support too, but not sure I can
justify the time to do it myself right now.

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


Re: [OpenWrt-Devel] Buffalo wzr-hp-g300nh2

2011-11-10 Thread Ben Pfountz
I would like to see support in trunk as well.  In the meantime I have 
been using the patch Mark Deneen created, which adds support for 
everything except some of the LEDs and switches, see his email and 
thread for more info...


https://lists.openwrt.org/pipermail/openwrt-devel/2011-August/011901.html

Ben

On 11/10/2011 3:39 AM, Matt Redfearn wrote:

Hi all,

I have one of these routers, but there is no support in openWRT trunk or
seemingly in DD-WRT, even though it ships with that installed.

The wiki (http://wiki.openwrt.org/toh/buffalo/wzr-hp-g300nh2) suggests
that support is work in progress – please could you tell me if it is
being worked on and when support may get into the trunk?

Thanks,

Matt



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

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