[OpenWrt-Devel] [PATCH] DIR610A1: Fix remaining issues

2013-09-29 Thread Flavio Silveira
This patch fixes:

 - Ethernet and Wireless LEDs
 - Wireless MAC Address
 - Remove whitespaces from dts file

Signed-off-by: Flavio Silveira 
---
 .../etc/hotplug.d/firmware/10-rt2x00-eeprom|2 +-
 .../ramips/base-files/lib/upgrade/platform.sh  |1 +
 target/linux/ramips/dts/DIR-610-A1.dts |   24 
 3 files changed, 16 insertions(+), 11 deletions(-)

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 b0b0717..40e1796 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
@@ -34,6 +34,7 @@ case "$FIRMWARE" in
dir-300-b1 | \
dir-600-b1 | \
dir-600-b2 | \
+   dir-610-a1 | \
dir-615-d)
rt2x00_eeprom_extract "devdata" 16384 512
;;
@@ -71,7 +72,6 @@ case "$FIRMWARE" in
dcs-930 | \
dir-300-b7 | \
dir-320-b1 | \
-   dir-610-a1 | \
dir-615-h1 | \
dir-620-a1 | \
dir-620-d1 | \
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index e7087cc..6836e16 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -90,6 +90,7 @@ platform_check_image() {
}
return 0
;;
+   dir-610-a1 |\
dir-645)
[ "$magic" != "5ea3a417" ] && {
echo "Invalid image type."
diff --git a/target/linux/ramips/dts/DIR-610-A1.dts 
b/target/linux/ramips/dts/DIR-610-A1.dts
index 26caf5f..67c92b4 100644
--- a/target/linux/ramips/dts/DIR-610-A1.dts
+++ b/target/linux/ramips/dts/DIR-610-A1.dts
@@ -5,7 +5,7 @@
 / {
compatible = "DIR-610-A1", "ralink,rt5350-soc";
model = "D-Link DIR-610 A1";
-   
+
palmbus@1000 {
spi@b00 {
status = "okay";
@@ -23,10 +23,10 @@
read-only;
};
 
-   partition@3 {
+   devdata: partition@3 {
label = "devdata";
reg = <0x3 0x1>;
-   read-only;
+   read-only;
};
 
factory: partition@4 {
@@ -53,11 +53,15 @@
};
 
esw@1011 {
-   ralink,portmap = <0x1f>;
-   ralink,led-polarity = <0>;
+   status = "okay";
+   ralink,portmap = <0x2f>;
+   ralink,led_polarity = <0x17>;
+   };
 
-   pinctrl-names = "default";
-   pinctrl-0 = <&phy_led_pins>;
+   wmac@1018 {
+   status = "okay";
+   ralink,led-polarity = <1>;
+   ralink,mtd-eeprom = <&devdata 16384>;
};
 
gpio-leds {
@@ -66,13 +70,13 @@
label = "d-link:green:status";
gpios = <&gpio0 9 1>;
};
-   wps {
+   wps {
label = "d-link:green:wps";
gpios = <&gpio0 13 1>;
};
-};
+   };
 
-gpio-keys-polled {
+   gpio-keys-polled {
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] diag: Add WRT310N v1 gpio leds and buttons

2013-09-15 Thread Flavio Silveira
Signed-off-by: Flavio Silveira 
---
 package/kernel/broadcom-diag/src/diag.c |   15 +++
 1 file changed, 15 insertions(+)

diff --git a/package/kernel/broadcom-diag/src/diag.c 
b/package/kernel/broadcom-diag/src/diag.c
index 3f58718..a71731d 100644
--- a/package/kernel/broadcom-diag/src/diag.c
+++ b/package/kernel/broadcom-diag/src/diag.c
@@ -83,6 +83,7 @@ enum {
WRT160NV1,
WRT160NV3,
WRT300NV11,
+   WRT310NV1,
WRT350N,
WRT600N,
WRT600NV11,
@@ -379,6 +380,18 @@ static struct platform_t __initdata platforms[] = {
},
.platform_init = bcm57xx_init,
},
+   [WRT310NV1] = {
+   .name   = "Linksys WRT310N V1",
+   .buttons= {
+   { .name = "reset",  .gpio = 1 << 6 }, // "Reset" on 
back panel
+   { .name = "ses",.gpio = 1 << 8 }, // "Reserved" 
on top panel
+   },
+   .leds   = {
+   { .name = "power",  .gpio = 1 << 1, .polarity = 
NORMAL }, // Power LED
+   { .name = "ses_amber",  .gpio = 1 << 3, .polarity = 
REVERSE }, // "Security" Amber
+   { .name = "ses_blue",   .gpio = 1 << 9, .polarity = 
REVERSE }, // "Security" Blue
+   },
+   },
[WRT350N] = {
.name   = "Linksys WRT350N",
.buttons= {
@@ -1382,6 +1395,8 @@ static struct platform_t __init *platform_detect(void)
return &platforms[WRT160NV3];
case BCM47XX_BOARD_LINKSYS_WRT300NV11:
return &platforms[WRT300NV11];
+   case BCM47XX_BOARD_LINKSYS_WRT310NV1:
+   return &platforms[WRT310NV1];
case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
return &platforms[WRT54G3GV2_VF];
case BCM47XX_BOARD_LINKSYS_WRT610NV1:
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] kernel: Add support for ESMT F25L32PA with upstream submission

2013-09-08 Thread Flavio Silveira

Signed-off-by: Flavio Silveira 
---
 ...-mtd_m25p80_add_support_for_esmt_f25l32pa.patch |   37 
 1 file changed, 37 insertions(+)
 create mode 100644 
target/linux/generic/patches-3.10/063-mtd_m25p80_add_support_for_esmt_f25l32pa.patch

diff --git 
a/target/linux/generic/patches-3.10/063-mtd_m25p80_add_support_for_esmt_f25l32pa.patch
 
b/target/linux/generic/patches-3.10/063-mtd_m25p80_add_support_for_esmt_f25l32pa.patch
new file mode 100644
index 000..7d56bfe
--- /dev/null
+++ 
b/target/linux/generic/patches-3.10/063-mtd_m25p80_add_support_for_esmt_f25l32pa.patch
@@ -0,0 +1,37 @@
+From 7d75ef5f56dbc2bedb9a893eb9ecfd03c456338d Mon Sep 17 00:00:00 2001
+From: Flavio Silveira 
+Date: Thu, 29 Aug 2013 08:51:48 -0300
+Subject: [PATCH v2] mtd: m25p80: Add support for ESMT F25L32PA
+
+This flashchip is used in D-Link DIR-610 A1 router board 
+and maybe several others, yet is not kernel upstream.
+
+So add support for it according to datasheet [0], making it easier
+to support other boards using this flashchip in the future.
+
+Changelog v2:
+ - Better description
+ - Datasheet link at the bottom, similar to other patches.
+
+[0] http://www.esmt.com.tw/DB/manager/upload/F25L32PA.pdf 
+
+Signed-off-by: Flavio Silveira 
+---
+ drivers/mtd/devices/m25p80.c |3 +++
+ 1 file changed, 3 insertions(+)
+
+ http://patchwork.ozlabs.org/patch/272438/
+ http://lists.infradead.org/pipermail/linux-mtd/2013-September/048511.html
+
+--- a/drivers/mtd/devices/m25p80.c
 b/drivers/mtd/devices/m25p80.c
+@@ -731,6 +731,9 @@ static const struct spi_device_id m25p_i
+   { "en25q64", INFO(0x1c3017, 0, 64 * 1024, 128, SECT_4K) },
+   { "en25qh256", INFO(0x1c7019, 0, 64 * 1024, 512, 0) },
+ 
++  /* ESMT */
++  { "f25l32pa", INFO(0x8c2016, 0, 64 * 1024, 64, SECT_4K) },
++
+   /* Everspin */
+   { "mr25h256", CAT25_INFO(  32 * 1024, 1, 256, 2) },
+ 
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] DIR-610-A1 Support

2013-08-10 Thread Flavio Silveira
This is a preliminary patch for D-Link DIR-610 A1 router support.

Please review.

Still some work to do:

1- Wireless MAC Address is always 10:00:00:64:0F.

2- Ethernet LEDs are inversed, only port 1 is correct and I don't know why.

3- I didn't patch "upgrade/platform.sh" because I was unsure where to check for 
image magic.

4- I didn't test flashing directly from stock firmware as I'm waiting the fix 
for items above.

Signed-off-by: Flavio Silveira 
---
 target/linux/ramips/base-files/etc/diag.sh |2 +-
 .../etc/hotplug.d/firmware/10-rt2x00-eeprom|1 +
 .../ramips/base-files/etc/uci-defaults/01_leds |1 +
 .../ramips/base-files/etc/uci-defaults/02_network  |4 +-
 .../ramips/base-files/lib/preinit/06_set_iface_mac |3 +-
 target/linux/ramips/base-files/lib/ramips.sh   |3 +
 target/linux/ramips/dts/DIR-610-A1.dts |  100 
 target/linux/ramips/image/Makefile |3 +
 target/linux/ramips/rt305x/profiles/dlink.mk   |   11 ++-
 9 files changed, 124 insertions(+), 4 deletions(-)
 create mode 100644 target/linux/ramips/dts/DIR-610-A1.dts

diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index 6ecb133..c0fdc88 100755
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -27,7 +27,7 @@ get_status_led() {
d105)
status_led="d105:red:power"
;;
-   dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-615-h1 | dir-615-d | 
dir-620-a1| dir-620-d1)
+   dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-610-a1 | dir-615-h1 | 
dir-615-d | dir-620-a1| dir-620-d1)
status_led="d-link:green:status"
;;
dir-645)
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 9e9e09b..a80ea4f 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
@@ -68,6 +68,7 @@ case "$FIRMWARE" in
br6524n | \
carambola | \
d105 | \
+   dir-610-a1 | \
dir-615-h1 | \
dir-620-a1 | \
dir-620-d1 | \
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/01_leds 
b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
index 7f69231..cb8771d 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
@@ -74,6 +74,7 @@ case $board in
dir-620-d1)
set_wifi_led "d-link:green:wifi"
;;
+   dir-610-a1 |\
esr-9753)
set_wifi_led "rt2800pci-phy0::radio"
;;
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network 
b/target/linux/ramips/base-files/etc/uci-defaults/02_network
index ef13e36..2c4c1b3 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network
@@ -77,6 +77,7 @@ ramips_setup_interfaces()
ucidef_add_switch_vlan "switch0" "2" "0 6t"
;;
 
+   dir-610-a1 | \
dir-615-h1 | \
mzk-w300nh2)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
@@ -204,7 +205,8 @@ ramips_setup_macs()
 
dir-300-b1 |\
dir-300-b2 |\
-   dir-600-b1)
+   dir-600-b1 |\
+   dir-610-a1)
lan_mac=$(mtd_get_mac_binary devdata 16388)
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
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 a0d9b61..44cab3a 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
@@ -39,7 +39,8 @@ preinit_set_mac_address() {
asl26555 |\
dir-300-b1 |\
dir-300-b2 |\
-   dir-600-b1)
+   dir-600-b1 |\
+   dir-610-a1)
 mac=$(mtd_get_mac_binary devdata 16388)
 ifconfig eth0 hw ether $mac 2>/dev/null
 ;;
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 858a809..289852c 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -73,6 +73,9 @@ ramips_board_detect() {
*"DIR-600 B2")
name="dir-600-b2"
;;
+   *"DIR-610 A1")
+   name="dir-610-a1"
+   ;;
*"DIR-620 A1")
name="dir-620-a1"
;;
diff --git a/target/

[OpenWrt-Devel] [PATCH] DIR-610-A1 Support

2013-08-10 Thread Flavio Silveira

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