Re: [OpenWrt-Devel] [PATCH] ramips: rt305x: add add support for the Asus WL-330N3G board

2012-05-17 Thread LEO Airwarosu Yoichi Shinoda

Hi.

It looks like the current ramips config only generates sysupgrade.bin version
of the image for WL-330N3G. Is there any pointer to an write-up describing
how to put this image into the real hw?

Any info would be appreciated.

Thanks in advance.

--- shinoda

On 2012/04/22, at 18:31, Frédéric Leroy wrote:

> This patch adds support for the ASUS WL-330N3G
> 
> Comparing to the WL-330N, It have 32MB ram, usb support and a bicolor led.
> 
> The bi-color led is driven by 2 gpio.
> I don't know how to handle this, so I simply made 2 leds : one red, one blue. 
> But the red light takes precedence over the blue one according to the chart 
> below.
> 
> r = led is red
> b = led is blue
> 0 = led is off
> 
> xy= x->r for red, b for blue led, y->value of brightness in 
> /sys/class/leds/x/brughtness
> 
> initial state action   ledgpio state
> 
> r0b0  r0->r1   r  r0  b0
> r0b0  b0->b1   b  r0  b1
> 
> r1b0  r1->r0   0  r0  b0
> r1b0  b0->b1   r  r1  *b1*
> 
> r1b1  r1->r0   b  r0  b1
> r1b1  b1->b0   r  r1  b0
> 
> r0b1  r0->r1   r  r1  *b1*
> r0b1  b1->b0   0  r0  r0
> 
> Signed-off-by: Frédéric Leroy 
> ---
> target/linux/ramips/base-files/etc/diag.sh |2 +-
> .../etc/hotplug.d/firmware/10-rt2x00-eeprom|1 +
> .../ramips/base-files/lib/preinit/06_set_iface_mac |1 +
> target/linux/ramips/base-files/lib/ramips.sh   |3 +
> .../arch/mips/include/asm/mach-ralink/machine.h|1 +
> .../ramips/files/arch/mips/ralink/rt305x/Kconfig   |5 +
> .../ramips/files/arch/mips/ralink/rt305x/Makefile  |1 +
> .../files/arch/mips/ralink/rt305x/mach-wl-330n3g.c |  100 
> target/linux/ramips/image/Makefile |5 +
> target/linux/ramips/rt305x/config-3.2  |1 +
> 10 files changed, 119 insertions(+), 1 deletions(-)
> create mode 100644 
> target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wl-330n3g.c
> 
> diff --git a/target/linux/ramips/base-files/etc/diag.sh 
> b/target/linux/ramips/base-files/etc/diag.sh
> index 95f608a..aa02721 100755
> --- a/target/linux/ramips/base-files/etc/diag.sh
> +++ b/target/linux/ramips/base-files/etc/diag.sh
> @@ -69,7 +69,7 @@ get_status_led() {
>   rt-n10-plus)
>   status_led="asus:green:wps"
>   ;;
> - rt-n56u | wl-330n )
> + rt-n56u | wl-330n | wl-330n3g)
>   status_led="asus:blue:power"
>   ;;
>   sl-r7205)
> diff --git 
> a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom 
> b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
> index 62788cd..3a602f7 100644
> --- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
> +++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
> @@ -69,6 +69,7 @@ case "$FIRMWARE" in
>   wcr-150gn | \
>   whr-g300n | \
>   wl-330n | \
> + wl-330n3g | \
>   wl-351 | \
>   wli-tx4-ag300n | \
>   wr512-3gn | \
> diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac 
> b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
> index f523d69..131c9ba 100644
> --- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
> +++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
> @@ -30,6 +30,7 @@ preinit_set_mac_address() {
>   omni-emb |\
>   w502u|\
>   wl-330n |\
> + wl-330n3g |\
>   wr6202 |\
>   xdxrn502j)
>   mac=$(ramips_get_mac_binary factory 40)
> diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
> b/target/linux/ramips/base-files/lib/ramips.sh
> index 1298ebd..801a134 100755
> --- a/target/linux/ramips/base-files/lib/ramips.sh
> +++ b/target/linux/ramips/base-files/lib/ramips.sh
> @@ -59,6 +59,9 @@ ramips_board_name() {
>   *"Asus WL-330N")
>   name="wl-330n"
>   ;;
> + *"Asus WL-330N3G")
> + name="wl-330n3g"
> + ;;
>   *"Aztech HW550-3G")
>   name="hw550-3g"
>   ;;
> diff --git 
> a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h 
> b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h
> index c2ec146..46a091b 100644
> --- a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h
> +++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h
> @@ -30,6 +30,7 @@ enum ramips_mach_type {
>   RAMIPS_MACH_RT_N10_PLUS,/* Asus RT-N10+ */
>   RAMIPS_MACH_NW718,  /* Netcore NW718 */
>   RAMIPS_MACH_WL_330N,/* Asus WL-330N */
> + RAMIPS_MACH_WL_330N3G,  /* Asus WL-330N3G */
> 
>   /* RT3052 based machines */
>   RAMIPS_MACH_ARGUS_ATP52B,   /* Argus ATP-52B */
> diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig 
> b/target/linux/ramips/files/arch/mi

Re: [OpenWrt-Devel] [PATCH] ramips: rt305x: add add support for the Asus WL-330N3G board

2012-04-23 Thread Gabor Juhos
2012.04.22. 11:31 keltezéssel, Frédéric Leroy írta:
> This patch adds support for the ASUS WL-330N3G
> 
> Comparing to the WL-330N, It have 32MB ram, usb support and a bicolor led.
> 
> The bi-color led is driven by 2 gpio.
> I don't know how to handle this, so I simply made 2 leds : one red, one blue. 
> But the red light takes precedence over the blue one according to the chart 
> below.
> 
> r = led is red
> b = led is blue
> 0 = led is off
> 
> xy= x->r for red, b for blue led, y->value of brightness in 
> /sys/class/leds/x/brughtness
> 
> initial state action   ledgpio state
> 
> r0b0  r0->r1   r  r0  b0
> r0b0  b0->b1   b  r0  b1
> 
> r1b0  r1->r0   0  r0  b0
> r1b0  b0->b1   r  r1  *b1*
> 
> r1b1  r1->r0   b  r0  b1
> r1b1  b1->b0   r  r1  b0
> 
> r0b1  r0->r1   r  r1  *b1*
> r0b1  b1->b0   0  r0  r0
> 
> Signed-off-by: Frédéric Leroy 

Applied.

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


[OpenWrt-Devel] [PATCH] ramips: rt305x: add add support for the Asus WL-330N3G board

2012-04-22 Thread Frédéric Leroy
This patch adds support for the ASUS WL-330N3G

Comparing to the WL-330N, It have 32MB ram, usb support and a bicolor led.

The bi-color led is driven by 2 gpio.
I don't know how to handle this, so I simply made 2 leds : one red, one blue. 
But the red light takes precedence over the blue one according to the chart 
below.

r = led is red
b = led is blue
0 = led is off

xy= x->r for red, b for blue led, y->value of brightness in 
/sys/class/leds/x/brughtness

initial state   action   ledgpio state

r0  b0  r0->r1   r  r0  b0
r0  b0  b0->b1   b  r0  b1

r1  b0  r1->r0   0  r0  b0
r1  b0  b0->b1   r  r1  *b1*

r1  b1  r1->r0   b  r0  b1
r1  b1  b1->b0   r  r1  b0

r0  b1  r0->r1   r  r1  *b1*
r0  b1  b1->b0   0  r0  r0

Signed-off-by: Frédéric Leroy 
---
 target/linux/ramips/base-files/etc/diag.sh |2 +-
 .../etc/hotplug.d/firmware/10-rt2x00-eeprom|1 +
 .../ramips/base-files/lib/preinit/06_set_iface_mac |1 +
 target/linux/ramips/base-files/lib/ramips.sh   |3 +
 .../arch/mips/include/asm/mach-ralink/machine.h|1 +
 .../ramips/files/arch/mips/ralink/rt305x/Kconfig   |5 +
 .../ramips/files/arch/mips/ralink/rt305x/Makefile  |1 +
 .../files/arch/mips/ralink/rt305x/mach-wl-330n3g.c |  100 
 target/linux/ramips/image/Makefile |5 +
 target/linux/ramips/rt305x/config-3.2  |1 +
 10 files changed, 119 insertions(+), 1 deletions(-)
 create mode 100644 
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wl-330n3g.c

diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index 95f608a..aa02721 100755
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -69,7 +69,7 @@ get_status_led() {
rt-n10-plus)
status_led="asus:green:wps"
;;
-   rt-n56u | wl-330n )
+   rt-n56u | wl-330n | wl-330n3g)
status_led="asus:blue:power"
;;
sl-r7205)
diff --git 
a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom 
b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
index 62788cd..3a602f7 100644
--- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
+++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
@@ -69,6 +69,7 @@ case "$FIRMWARE" in
wcr-150gn | \
whr-g300n | \
wl-330n | \
+   wl-330n3g | \
wl-351 | \
wli-tx4-ag300n | \
wr512-3gn | \
diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac 
b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
index f523d69..131c9ba 100644
--- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
+++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
@@ -30,6 +30,7 @@ preinit_set_mac_address() {
omni-emb |\
w502u|\
wl-330n |\
+   wl-330n3g |\
wr6202 |\
xdxrn502j)
mac=$(ramips_get_mac_binary factory 40)
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 1298ebd..801a134 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -59,6 +59,9 @@ ramips_board_name() {
*"Asus WL-330N")
name="wl-330n"
;;
+   *"Asus WL-330N3G")
+   name="wl-330n3g"
+   ;;
*"Aztech HW550-3G")
name="hw550-3g"
;;
diff --git 
a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h 
b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h
index c2ec146..46a091b 100644
--- a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h
+++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h
@@ -30,6 +30,7 @@ enum ramips_mach_type {
RAMIPS_MACH_RT_N10_PLUS,/* Asus RT-N10+ */
RAMIPS_MACH_NW718,  /* Netcore NW718 */
RAMIPS_MACH_WL_330N,/* Asus WL-330N */
+   RAMIPS_MACH_WL_330N3G,  /* Asus WL-330N3G */
 
/* RT3052 based machines */
RAMIPS_MACH_ARGUS_ATP52B,   /* Argus ATP-52B */
diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig 
b/target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig
index ef4ddf4..5c86de3 100644
--- a/target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig
+++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig
@@ -36,6 +36,11 @@ config RT305X_MACH_WL_330N
select RALINK_DEV_GPIO_BUTTONS
select RALINK_DEV_GPIO_LEDS
 
+config RT305X_MACH_WL_330N3G
+   bool "Asus WL-330N3G board support"
+   select RALINK_DEV_GPIO_BUTTONS
+   select RALINK_DEV