Re: OpenWrt One - celebrating 20 years of OpenWrt

2024-01-10 Thread Forest Crossman
On Tue, Jan 9, 2024 at 4:52 AM John Crispin  wrote:
>
---SNIP---
>
> * Why is there no USB 3.x host port on the device?
> - the USB 3.x and PCIe buses are shared in the selected SoC silicon,
> hence only a single High-Speed USB port is available

Perhaps you've already considered this, but it may be possible to
route the shared PCIe/USB 3 traces to both an M.2 slot and a USB 3
host port using a high-speed dual-channel differential 1:2/2:1
switch/mux. It wouldn't enable both interfaces to be used at the same
time, but it would make it possible to select which interface is
enabled using a GPIO pin. Then U-boot could either automatically
enable one port or the other depending on what devices it detects
(e.g., enable PCIe and disable USB 3 if a PCIe device is connected,
otherwise enable USB 3 and disable PCIe), or it could be statically
configurable via a U-boot environment variable.

From some quick searching, the switches/muxes that would enable this
cost less than $1 each in qty. 1000. For a <$100 product I understand that
may be too much of an increase to the BoM cost and PCB complexity, but
I think users would really appreciate being able to choose between
being able to add an M.2 SSD, WiFi card, or SATA controller and being
able to plug in a USB 3.x 2.5 GbE adapter, SSD/flash drive, WiFi
dongle, or 5G modem.

All the best,
Forest

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


[OpenWrt-Devel] [PATCH] iwinfo: add AR9580 with new subsystem device ID and QCA9880 with no subsystem vendor/device IDs

2014-09-25 Thread Forest Crossman
The AR9580 with the new ID can be found in the EnGenius ESR900 and the
QCA9880 without any subsystem IDs can be found in the EnGenius ESR1750.

Signed-off-by: Forest Crossman cyro...@gmail.com
---
 package/network/utils/iwinfo/src/hardware.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/network/utils/iwinfo/src/hardware.txt 
b/package/network/utils/iwinfo/src/hardware.txt
index 153ffeb..f1558b2 100644
--- a/package/network/utils/iwinfo/src/hardware.txt
+++ b/package/network/utils/iwinfo/src/hardware.txt
@@ -52,6 +52,8 @@
 0x168c 0x002a 0x168c 0xa0930  0  Atheros  AR9280
 0x168c 0x002b 0x168c 0xa0910  0  Atheros  AR9285
 0x168c 0x0033 0x168c 0xa1200  0  Atheros  AR9580
+0x168c 0x0033 0x168c 0xa1360  0  Atheros  AR9580
+0x168c 0x003c 0x 0x0  0  Qualcomm Atheros QCA9880
 0x1814 0x3050 0x1814 0x00050  0  RaLink   Rt3050
 0x1814 0x3052 0x1814 0x00080  0  RaLink   Rt3052
 0x1814 0x3352 0x1814 0x000c0  0  RaLink   Rt3352
-- 
1.9.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: add LED defaults for the EnGenius ESR1750

2014-09-25 Thread Forest Crossman
Signed-off-by: Forest Crossman cyro...@gmail.com
---
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds | 5 +
 1 file changed, 5 insertions(+)

diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index d104f40..275bf4a 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -123,6 +123,11 @@ esr900)
ucidef_set_led_wlan wlan5g WLAN 5 GHz engenius:blue:wlan-5g 
phy1tpt
;;
 
+esr1750)
+   ucidef_set_led_wlan wlan2g WLAN 2.4 GHz esr1750:blue:wlan-2g 
phy0tpt
+   ucidef_set_led_wlan wlan5g WLAN 5 GHz esr1750:blue:wlan-5g 
phy1tpt
+   ;;
+
 hiwifi-hc6361)
ucidef_set_led_netdev inet INET hiwifi:blue:internet eth1
ucidef_set_led_wlan wlan WLAN hiwifi:blue:wlan-2p4 phy0tpt
-- 
1.9.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: enable sysupgrade for the EnGenius ESR900

2014-08-20 Thread Forest Crossman
Signed-off-by: Forest Crossman cyro...@gmail.com
---
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index b5b2873..846954c 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -176,6 +176,7 @@ platform_check_image() {
dir-835-a1 | \
dragino2 | \
esr1750 | \
+   esr900 | \
ew-dorin | \
ew-dorin-router | \
hiwifi-hc6361 | \
-- 
1.9.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: use ETH_ALEN for consistency

2014-08-20 Thread Forest Crossman
Signed-off-by: Forest Crossman cyro...@gmail.com
---
 target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c
index ca36e36..aa2e7f7 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c
@@ -145,9 +145,9 @@ static void __init esr900_setup(void)
 {
const char *config = (char *) KSEG1ADDR(ESR900_CONFIG_ADDR);
u8 *art = (u8 *) KSEG1ADDR(ESR900_CALDATA_ADDR);
-   u8 lan_mac[6];
-   u8 wlan0_mac[6];
-   u8 wlan1_mac[6];
+   u8 lan_mac[ETH_ALEN];
+   u8 wlan0_mac[ETH_ALEN];
+   u8 wlan1_mac[ETH_ALEN];
 
if (ath79_nvram_parse_mac_addr(config, ESR900_CONFIG_SIZE,
   ethaddr=, lan_mac) == 0) {
-- 
1.9.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: make LED names for EnGenius routers follow convention

2014-08-20 Thread Forest Crossman
Signed-off-by: Forest Crossman cyro...@gmail.com
---
 target/linux/ar71xx/base-files/etc/diag.sh|  4 ++--
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds   |  8 
 target/linux/ar71xx/files/arch/mips/ath79/mach-eap300v2.c |  6 +++---
 target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c   | 10 +-
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index 1864b11..0401b93 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -63,7 +63,7 @@ get_status_led() {
status_led=d-link:amber:power
;;
eap300v2)
-   status_led=engenius:blue:power
+   status_led=eap300v2:blue:power
;;
eap7660d)
status_led=eap7660d:green:ds4
@@ -79,7 +79,7 @@ get_status_led() {
status_led=esr1750:amber:power
;;
esr900)
-   status_led=engenius:amber:power
+   status_led=esr900:amber:power
;;
hiwifi-hc6361)
status_led=hiwifi:blue:system
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index d104f40..4d0992d 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -66,8 +66,8 @@ db120)
;;
 
 eap300v2)
-   ucidef_set_led_netdev lan LAN engenius:blue:lan eth0
-   ucidef_set_led_wlan wlan WLAN engenius:blue:wlan phy0tpt
+   ucidef_set_led_netdev lan LAN eap300v2:blue:lan eth0
+   ucidef_set_led_wlan wlan WLAN eap300v2:blue:wlan phy0tpt
;;
 
 rb-750)
@@ -119,8 +119,8 @@ gl-inet)
;;
 
 esr900)
-   ucidef_set_led_wlan wlan2g WLAN 2.4 GHz engenius:blue:wlan-2g 
phy0tpt
-   ucidef_set_led_wlan wlan5g WLAN 5 GHz engenius:blue:wlan-5g 
phy1tpt
+   ucidef_set_led_wlan wlan2g WLAN 2.4 GHz esr900:blue:wlan-2g 
phy0tpt
+   ucidef_set_led_wlan wlan5g WLAN 5 GHz esr900:blue:wlan-5g 
phy1tpt
;;
 
 hiwifi-hc6361)
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-eap300v2.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-eap300v2.c
index ba577e2..0aaf8e9 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-eap300v2.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-eap300v2.c
@@ -35,15 +35,15 @@
 
 static struct gpio_led eap300v2_leds_gpio[] __initdata = {
{
-   .name   = engenius:blue:power,
+   .name   = eap300v2:blue:power,
.gpio   = EAP300V2_GPIO_LED_POWER,
.active_low = 1,
}, {
-   .name   = engenius:blue:lan,
+   .name   = eap300v2:blue:lan,
.gpio   = EAP300V2_GPIO_LED_LAN,
.active_low = 1,
}, {
-   .name   = engenius:blue:wlan,
+   .name   = eap300v2:blue:wlan,
.gpio   = EAP300V2_GPIO_LED_WLAN,
.active_low = 1,
}
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c
index ca36e36..88a80f9 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c
@@ -53,27 +53,27 @@
 
 static struct gpio_led esr900_leds_gpio[] __initdata = {
{
-   .name   = engenius:amber:power,
+   .name   = esr900:amber:power,
.gpio   = ESR900_GPIO_LED_POWER,
.active_low = 1,
},
{
-   .name   = engenius:blue:wlan-2g,
+   .name   = esr900:blue:wlan-2g,
.gpio   = ESR900_GPIO_LED_WLAN_2G,
.active_low = 1,
},
{
-   .name   = engenius:blue:wps,
+   .name   = esr900:blue:wps,
.gpio   = ESR900_GPIO_LED_WPS_BLUE,
.active_low = 1,
},
{
-   .name   = engenius:amber:wps,
+   .name   = esr900:amber:wps,
.gpio   = ESR900_GPIO_LED_WPS_AMBER,
.active_low = 1,
},
{
-   .name   = engenius:blue:wlan-5g,
+   .name   = esr900:blue:wlan-5g,
.gpio   = ESR900_GPIO_LED_WLAN_5G,
.active_low = 1,
}
-- 
1.9.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ar71xx: make LED names for EnGenius routers follow convention

2014-08-20 Thread Forest Crossman
[Resending because I forgot to reply-all]

That’s what I thought originally, but I asked Jon Suphammer why he used the 
model name instead of the manufacturer in his patch for the EnGenius ESR1750, 
he responded: 

 Hi Forest, 
 
 Vendors are not always consistent over time with what colour they use 
 for their LED's. Several factors could play in, like matching LED with 
 a tooling colour or just change of mind. 
 It would be more safe to bind the LED to specific device rather than vendor. 
 
 Best regards, 
 Jon 

I agree with him in that it would be better to identify LEDs by model instead 
of by brand since there is a more direct relationship between the LED and that 
model than the LED and the manufacturer. 

In the end, what the LED is called doesn’t really matter since it’s just an 
arbitrary string. At some point, though, I think we should document one 
convention to be used across all platforms and models. Or, even better, get rid 
of the brand/manufacturer identifier entirely and make it something simpler 
like wlan2g:blue, power:amber, wps:green, wps:red, etc. 

-- 
Forest Crossman

On August 20, 2014 at 9:24:28 PM, Yousong Zhou 
(yszhou4t...@gmail.com(mailto:yszhou4t...@gmail.com)) wrote:

 That’s what I thought originally, but I asked Jon Suphammer why he used the 
 model name instead of the manufacturer in his patch for the EnGenius ESR1750, 
 he responded:  
  
  Hi Forest,  
   
  Vendors are not always consistent over time with what colour they use  
  for their LED's. Several factors could play in, like matching LED with  
  a tooling colour or just change of mind.  
  It would be more safe to bind the LED to specific device rather than 
  vendor.  
   
  Best regards,  
  Jon  
  
 I agree with him in that it would be better to identify LEDs by model instead 
 of by brand since there is a more direct relationship between the LED and 
 that model than the LED and the manufacturer.  
  
 In the end, what the LED is called doesn’t really matter since it’s just an 
 arbitrary string. At some point, though, I think we should document one 
 convention to be used across all platforms and models. Or, even better, get 
 rid of the brand/manufacturer identifier entirely and make it something 
 simpler like “wlan2g:blue”, “power:amber”, “wps:green”, “wps:red”, etc.  
  
 --  
 Forest Crossman
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: build factory image for EnGenius ESR900 and ESR1750

2014-08-14 Thread Forest Crossman
Signed-off-by: Forest Crossman cyro...@gmail.com
---
 target/linux/ar71xx/image/Makefile | 27 +--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index ec69b0b..683c238 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -265,7 +265,7 @@ 
eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),1
 
db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x5(firmware)
 
cameo_ap94_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,1600k(unknown)ro,64k@0x7f(caldata_copy)
 
cameo_ap94_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7808k(firmware),64k(caldata)ro,64k@0x66(caldata_orig),6208k@0x5(firmware_orig)
-esr900_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,14656k(firmware),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro
+esr900_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k@0x4(firmware)
 
esr1750_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k@0x4(firmware)
 
ew-dorin_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),3712k(firmware),64k(art)
 
ew-dorin_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)
@@ -483,6 +483,27 @@ Image/Build/AthLzma/buildkernel=$(call 
MkuImageLzma,$(2),$(3) $(4))
 Image/Build/AthLzma=$(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
 Image/Build/AthLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
 
+
+define Image/Build/EnGenius
+   $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
+   $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
+   $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
+   $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if 
$(rootsize),$(rootsize),$(fwsize)))
+   if [ -e $(call sysupname,$(1),$(2)) ]; then \
+   dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
+   of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync; \
+   dd if=$(KDIR)/root.$(1) \
+   of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k 
conv=sync; \
+   mksenaofw -e $(call sysupname,$(1),$(2)) \
+   -o $(call imgname,$(1),$(2))-factory.dlf \
+   -r 0x101 -p $(7) -t 2; \
+   fi
+endef
+
+Image/Build/EnGenius/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
+Image/Build/EnGenius/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
+
+
 define MkuImageHiWiFi
# Field ih_name needs to start with tw150v1
mkimage -A mips -O linux -T kernel -a 0x8006 -C $(1) $(2) \
@@ -1055,7 +1076,6 @@ $(eval $(call 
SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,tt
 $(eval $(call 
SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call 
SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call 
SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
-$(eval $(call 
SingleProfile,AthLzma,64k,ESR1750,esr1750,ESR1750,ttyS0,115200,$$(esr1750_mtdlayout),KRuImage))
 $(eval $(call 
SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
 $(eval $(call 
SingleProfile,AthLzma,64k,EWDORINRT,ew-dorin-router,EW-DORIN-ROUTER,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
 $(eval $(call 
SingleProfile,AthLzma,64k,EWDORIN16M,ew-dorin-16M,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_16M),KRuImage,65536))
@@ -1094,6 +1114,9 @@ $(eval $(call 
SingleProfile,CameoAP94,64kraw,DIR825B1,dir-825-b1,DIR-825-B1,ttyS
 $(eval $(call 
SingleProfile,CameoAP94,64kraw,TEW673GRU,tew-673gru,TEW-673GRU,ttyS0,115200,$$(cameo_ap94_mtdlayout),$$(cameo_ap94_mtdlayout_fat),01AP94-AR7161-RT-080619-01,00AP94-AR7161-RT-080619-01))
 $(eval $(call 
SingleProfile,CameoAP94,64kraw,DLRTDEV01,dlrtdev01,DIR-825-B1,ttyS0,115200,$$(dlrtdev_mtdlayout),$$(dlrtdev_mtdlayout_fat),01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00))
 
+$(eval $(call 
SingleProfile,EnGenius,64k,ESR900,esr900,ESR900,ttyS0,115200,$$(esr900_mtdlayout),KRuImage,,0x4e))
+$(eval $(call 
SingleProfile,EnGenius,64k,ESR1750,esr1750,ESR1750,ttyS0,115200,$$(esr1750_mtdlayout),KRuImage,,0x61))
+
 $(eval $(call 
SingleProfile,HiWiFi,64k,HIWIFI_HC6361,hiwifi-hc6361,HiWiFi-HC6361,ttyATH0,115200,$$(hiwifi_hc6361_mtdlayout),KRuImage))
 
 $(eval $(call 
SingleProfile,MyLoader,64k,WP543_2M,wp543,,ttyS0,115200,0x20,2M))
-- 
1.9.2

[OpenWrt-Devel] [PATCH] firmware-utils: made mkdir615h1 work for all Senao-produced devices as mksenaofw and cleaned up some of its formatting

2014-08-01 Thread Forest Crossman
Signed-off-by: Forest Crossman cyro...@gmail.com
---
 target/linux/ramips/image/Makefile |  5 +-
 tools/firmware-utils/Makefile  |  2 +-
 .../src/{mkdir615h1.c = mksenaofw.c}  | 81 --
 3 files changed, 48 insertions(+), 40 deletions(-)
 rename tools/firmware-utils/src/{mkdir615h1.c = mksenaofw.c} (82%)

diff --git a/target/linux/ramips/image/Makefile 
b/target/linux/ramips/image/Makefile
index 6dfaee5..1fe62ee 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -377,8 +377,9 @@ Image/Build/Profile/DIR-620-D1=$(call 
BuildFirmware/Default8M/$(1),$(1),dir-620-
 
 define BuildFirmware/DIR615H1/squashfs
$(call BuildFirmware/Default4M/$(1),$(1),dir-615-h1,DIR-615-H1)
-   -mkdir615h1 -e $(call sysupname,$(1),dir-615-h1) \
-   -o $(call imgname,$(1),dir-615-h1)-factory.bin
+   -mksenaofw -e $(call sysupname,$(1),dir-615-h1) \
+   -o $(call imgname,$(1),dir-615-h1)-factory.bin \
+   -r 0x218 -p 0x30 -t 3
 endef
 BuildFirmware/DIR615H1/initramfs=$(call 
BuildFirmware/OF/initramfs,$(1),dir-615-h1,DIR-615-H1)
 Image/Build/Profile/DIR615H1=$(call BuildFirmware/DIR615H1/$(1),$(1))
diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile
index d5cfdaa..4bb53cb 100644
--- a/tools/firmware-utils/Makefile
+++ b/tools/firmware-utils/Makefile
@@ -21,7 +21,7 @@ define Host/Compile
$(call cc,trx)
$(call cc,motorola-bin)
$(call cc,dgfirmware)
-   $(call cc,mkdir615h1 md5)
+   $(call cc,mksenaofw md5)
$(call cc,trx2usr)
$(call cc,ptgen)
$(call cc,airlink)
diff --git a/tools/firmware-utils/src/mkdir615h1.c 
b/tools/firmware-utils/src/mksenaofw.c
similarity index 82%
rename from tools/firmware-utils/src/mkdir615h1.c
rename to tools/firmware-utils/src/mksenaofw.c
index d9fb35c..7ea58f5 100644
--- a/tools/firmware-utils/src/mkdir615h1.c
+++ b/tools/firmware-utils/src/mksenaofw.c
@@ -19,29 +19,28 @@
 #include unistd.h
 #include md5.h
 
-#define HDR_LEN0x60
-#define BUF_SIZE   0x200
-#define VERSION_SIZE   0x10
-#define MD5_SIZE   0x10
-#define PAD_SIZE   0x20
-#define DEFAULT_MAGIC  305419896
-#define DEFAULT_VERSION123
-#define DEFAULT_VENDOR_ID  536
-#define DEFAULT_HEAD_VALUE 0x0
-#define DEFAULT_BLOCK_SIZE 65535
-#define DEFAULT_PRODUCT_ID 48
-#define DEFAULT_FIRMWARE_TYPE  0x03
+#define HDR_LEN 0x60
+#define BUF_SIZE0x200
+#define VERSION_SIZE0x10
+#define MD5_SIZE0x10
+#define PAD_SIZE0x20
+
+#define DEFAULT_BLOCK_SIZE  65535
+
+#define DEFAULT_HEAD_VALUE  0x0
+#define DEFAULT_VERSION 123
+#define DEFAULT_MAGIC   0x12345678
 
 typedef struct {
uint32_t head;
uint32_t vendor_id;
uint32_t product_id;
-   uint8_t version[VERSION_SIZE];
+   uint8_t  version[VERSION_SIZE];
uint32_t firmware_type;
uint32_t filesize;
uint32_t zero;
-   uint8_t md5sum[MD5_SIZE];
-   uint8_t pad[PAD_SIZE];
+   uint8_t  md5sum[MD5_SIZE];
+   uint8_t  pad[PAD_SIZE];
uint32_t chksum;
uint32_t magic;
 } img_header;
@@ -56,16 +55,19 @@ typedef enum {
 } op_mode;
 
 static firmware_type FIRMWARE_TYPES[] = {
-   { 0x01, bootloader },
-   { 0x02, kernel },
-   { 0x03, kernelapp },
-   { 0x04, apps },
-   { 0x05, littleapps },
-   { 0x06, sounds },
-   { 0x07, userconfig },
-   { 0x0a, factoryapps },
-   { 0x0b, odmapps },
-   { 0x0c, langpack }
+   { 0x01, bootloader },
+   { 0x02, kernel },
+   { 0x03, kernelapp },
+   { 0x04, apps },
+   /* The types below this line vary by manufacturer */
+   { 0x05, littleapps (D-Link)/factoryapps (EnGenius) },
+   { 0x06, sounds (D-Link)/littleapps (EnGenius) },
+   { 0x07, userconfig (D-Link)/appdata (EnGenius) },
+   { 0x08, userconfig (EnGenius)},
+   { 0x09, odmapps (EnGenius)},
+   { 0x0a, factoryapps (D-Link) },
+   { 0x0b, odmapps (D-Link) },
+   { 0x0c, langpack (D-Link) }
 };
 
 static long get_file_size(const char *filename)
@@ -163,7 +165,7 @@ static int encode_image(const char *input_file_name,
}
 
if (md5_file(input_file_name, (uint8_t *) header-md5sum)  0) {
-   fprintf(stderr, Md5 failed on file %s\n, input_file_name);
+   fprintf(stderr, MD5 failed on file %s\n, input_file_name);
fclose(fp_input);
fclose(fp_output);
return -1;
@@ -211,7 +213,7 @@ static int encode_image(const char *input_file_name,
 int decode_image(const char *input_file_name, const char *output_file_name)
 {
img_header header;
-   char buf[512];
+   char

Re: [OpenWrt-Devel] [PATCH v2 0/3] ar71xx: add support for the EnGenius ESR900

2014-07-10 Thread Forest Crossman
Is there something blocking this from becoming accepted? I can see the
patches have been delegated to Gabor Juhos, but nothing has happened
with them for weeks. If I need to change something, please let me
know. Also, is it too late to add my name to the copyright message in
mach-esr900.c? Would that even be appropriate when I didn't write most
of the code? This is the first free software project I've contributed
to so I'm a little unsure of myself when it comes to what I should or
should not take credit for.

--
Forest Crossman


On Sun, Jun 22, 2014 at 4:20 PM, Forest Crossman cyro...@gmail.com wrote:
 Apparrently, Gmail likes to mangle patches if you send them from the web 
 interface. This patch series contains a slightly cleaned-up version of the 
 original patch.

 Forest Crossman (3):
   ar71xx: add kernel support for the EnGenius ESR900
   ar71xx: add board support for the EnGenius ESR900
   ar71xx: add user-space support for the EnGenius ESR900

  package/base-files/files/lib/functions/system.sh   |   1 +
  target/linux/ar71xx/base-files/etc/diag.sh |   3 +
  .../ar71xx/base-files/etc/uci-defaults/01_leds |   5 +
  .../ar71xx/base-files/etc/uci-defaults/02_network  |  10 +
  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
  target/linux/ar71xx/config-3.10|   1 +
  .../ar71xx/files/arch/mips/ath79/mach-esr900.c | 222 
 +
  target/linux/ar71xx/files/arch/mips/ath79/nvram.c  |  16 ++
  target/linux/ar71xx/generic/profiles/engenius.mk   |  16 ++
  target/linux/ar71xx/image/Makefile |   2 +
  .../610-MIPS-ath79-openwrt-machines.patch  |  18 +-
  11 files changed, 294 insertions(+), 3 deletions(-)
  create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c
  create mode 100644 target/linux/ar71xx/generic/profiles/engenius.mk

 --
 1.9.2

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


Re: [OpenWrt-Devel] [PATCH RESEND] firmware-utils/mkdir615h1: fix magic XOR calculation

2014-07-02 Thread Forest Crossman
Someone changed this patch's state to accepted, but I haven't seen it
appear in SVN yet. Is there something I still need to do? Or does it
just take a while for a patch to go from Accepted to Committed? I
ask because I have some more patches to add that will make this code
more efficient and generic because it actually applies to most if not
all Senao-produced boards.

--
Forest Crossman


On Sun, Jun 22, 2014 at 4:33 PM, Forest Crossman cyro...@gmail.com wrote:
 Signed-off-by: Forest Crossman cyro...@gmail.com
 ---
  tools/firmware-utils/src/mkdir615h1.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/tools/firmware-utils/src/mkdir615h1.c 
 b/tools/firmware-utils/src/mkdir615h1.c
 index 84692aa..d9fb35c 100644
 --- a/tools/firmware-utils/src/mkdir615h1.c
 +++ b/tools/firmware-utils/src/mkdir615h1.c
 @@ -199,7 +199,7 @@ static int encode_image(const char *input_file_name,
 }

 for (i = 0; i  bytes_read; i++)
 -   buf[i] ^= magic  i  60) + i)  7) - (i  
 60));
 +   buf[i] ^= magic  (i % 8)  0xff;
 fwrite(buf, bytes_read, 1, fp_output);
 }

 @@ -254,7 +254,7 @@ int decode_image(const char *input_file_name, const char 
 *output_file_name)

 bytes_read = fread(buf, 1, BUF_SIZE, fp_input);
 for (i = 0; i  bytes_read; i++)
 -   buf[i] ^= header.magic  i  60) + i)  7) - (i 
  60));
 +   buf[i] ^= header.magic  (i % 8)  0xff;

 /*
  * Handle padded source file
 --
 1.9.2

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


Re: [OpenWrt-Devel] [PATCH v2 1/3] ar71xx: add kernel support for the EnGenius ESR900

2014-06-24 Thread Forest Crossman
The MAC as it's stored the u-boot environment looks like
'ethaddr=XX:XX:XX:XX:XX:XX', so to get the other functions to parse
the MAC correctly, I had to get rid of the quotes before and after the
MAC. There might be a better way to do it, but this method didn't seem
too horrible. All this function does is loop through each char in the
string to check if it's a quotation mark. If it is, it skips over it
and puts the next char in the place the quote would go, effectively
doing a `tr -d '\'` on the MAC string. It then fills the rest of the
output array with null bytes before returning it. If the MAC string
doesn't have any quotes in it, it just returns the input string.

I suppose I could have just checked to make sure the first and last
chars were quotes and then returned the MAC string sans those chars,
but that didn't occur to me at the time I was writing that function.

--
Forest Crossman


On Tue, Jun 24, 2014 at 9:01 AM, John Crispin j...@phrozen.org wrote:
 Hi,

 On 22/06/2014 22:20, Forest Crossman wrote:
 diff --git a/target/linux/ar71xx/files/arch/mips/ath79/nvram.c
 b/target/linux/ar71xx/files/arch/mips/ath79/nvram.c index
 43911b8..41c3542 100644 ---
 a/target/linux/ar71xx/files/arch/mips/ath79/nvram.c +++
 b/target/linux/ar71xx/files/arch/mips/ath79/nvram.c @@ -16,6
 +16,21 @@

 #include nvram.h

 +char *ath79_nvram_sanitize_mac(char *input) +{ + int i,j; +  char
 *output=input; +  for (i = 0, j = 0; istrlen(input); i++,j++) +  {
 + if (input[i]!='\') +   output[j]=input[i]; +  
  else +  j--; +  }
 + output[j]=0; +  return output; +} + char
 *ath79_nvram_find_var(const char *name, const char *buf, unsigned
 buf_len) { unsigned len = strlen(name);

 this loop is a bit weird. ca you tell us in what way the mac is broken
 on your board ?

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


[OpenWrt-Devel] [PATCH v2 0/3] ar71xx: add support for the EnGenius ESR900

2014-06-22 Thread Forest Crossman
Apparrently, Gmail likes to mangle patches if you send them from the web 
interface. This patch series contains a slightly cleaned-up version of the 
original patch.

Forest Crossman (3):
  ar71xx: add kernel support for the EnGenius ESR900
  ar71xx: add board support for the EnGenius ESR900
  ar71xx: add user-space support for the EnGenius ESR900

 package/base-files/files/lib/functions/system.sh   |   1 +
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |   5 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |  10 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 target/linux/ar71xx/config-3.10|   1 +
 .../ar71xx/files/arch/mips/ath79/mach-esr900.c | 222 +
 target/linux/ar71xx/files/arch/mips/ath79/nvram.c  |  16 ++
 target/linux/ar71xx/generic/profiles/engenius.mk   |  16 ++
 target/linux/ar71xx/image/Makefile |   2 +
 .../610-MIPS-ath79-openwrt-machines.patch  |  18 +-
 11 files changed, 294 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c
 create mode 100644 target/linux/ar71xx/generic/profiles/engenius.mk

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


[OpenWrt-Devel] [PATCH v2 1/3] ar71xx: add kernel support for the EnGenius ESR900

2014-06-22 Thread Forest Crossman
Signed-off-by: Forest Crossman cyro...@gmail.com
---
 target/linux/ar71xx/config-3.10|   1 +
 .../ar71xx/files/arch/mips/ath79/mach-esr900.c | 222 +
 target/linux/ar71xx/files/arch/mips/ath79/nvram.c  |  16 ++
 .../610-MIPS-ath79-openwrt-machines.patch  |  18 +-
 4 files changed, 254 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c

diff --git a/target/linux/ar71xx/config-3.10 b/target/linux/ar71xx/config-3.10
index c294cd8..78d5359 100644
--- a/target/linux/ar71xx/config-3.10
+++ b/target/linux/ar71xx/config-3.10
@@ -47,6 +47,7 @@ CONFIG_ATH79_MACH_DIR_825_B1=y
 CONFIG_ATH79_MACH_DIR_825_C1=y
 CONFIG_ATH79_MACH_DRAGINO2=y
 CONFIG_ATH79_MACH_EAP7660D=y
+CONFIG_ATH79_MACH_ESR900=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_GS_OOLITE=y
 CONFIG_ATH79_MACH_HORNET_UB=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c
new file mode 100644
index 000..0ef3dd1
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c
@@ -0,0 +1,222 @@
+/*
+ *  EnGenius ESR900 board support
+ *
+ *  Copyright (C) 2008-2012 Gabor Juhos juh...@openwrt.org
+ *  Copyright (C) 2008 Imre Kaloz ka...@openwrt.org
+ *
+ *  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/platform_device.h
+#include linux/ar8216_platform.h
+
+#include asm/mach-ath79/ar71xx_regs.h
+
+#include common.h
+#include pci.h
+#include dev-ap9x-pci.h
+#include dev-gpio-buttons.h
+#include dev-eth.h
+#include dev-leds-gpio.h
+#include dev-m25p80.h
+#include dev-usb.h
+#include dev-wmac.h
+#include machtypes.h
+#include nvram.h
+
+#define ESR900_GPIO_LED_POWER   2
+#define ESR900_GPIO_LED_WLAN_2G 13
+#define ESR900_GPIO_LED_WPS_BLUE19
+#define ESR900_GPIO_LED_WPS_AMBER   22
+#define ESR900_GPIO_LED_WLAN_5G 23
+
+#define ESR900_GPIO_BTN_WPS 16
+#define ESR900_GPIO_BTN_RESET   17
+
+#define ESR900_KEYS_POLL_INTERVAL   20 /* msecs */
+#define ESR900_KEYS_DEBOUNCE_INTERVAL   (3 * ESR900_KEYS_POLL_INTERVAL)
+
+#define ESR900_CALDATA_ADDR 0x1fff
+#define ESR900_WMAC_CALDATA_OFFSET  0x1000
+#define ESR900_PCIE_CALDATA_OFFSET  0x5000
+
+#define ESR900_CONFIG_ADDR  0x1f03
+#define ESR900_CONFIG_SIZE  0x1
+
+#define ESR900_LAN_PHYMASK  BIT(0)
+#define ESR900_WAN_PHYMASK  BIT(5)
+#define ESR900_MDIO_MASK(~(ESR900_LAN_PHYMASK | 
ESR900_WAN_PHYMASK))
+
+static struct gpio_led esr900_leds_gpio[] __initdata = {
+   {
+   .name   = engenius:amber:power,
+   .gpio   = ESR900_GPIO_LED_POWER,
+   .active_low = 1,
+   },
+   {
+   .name   = engenius:blue:wlan-2g,
+   .gpio   = ESR900_GPIO_LED_WLAN_2G,
+   .active_low = 1,
+   },
+   {
+   .name   = engenius:blue:wps,
+   .gpio   = ESR900_GPIO_LED_WPS_BLUE,
+   .active_low = 1,
+   },
+   {
+   .name   = engenius:amber:wps,
+   .gpio   = ESR900_GPIO_LED_WPS_AMBER,
+   .active_low = 1,
+   },
+   {
+   .name   = engenius:blue:wlan-5g,
+   .gpio   = ESR900_GPIO_LED_WLAN_5G,
+   .active_low = 1,
+   }
+};
+
+static struct gpio_keys_button esr900_gpio_keys[] __initdata = {
+   {
+   .desc   = WPS button,
+   .type   = EV_KEY,
+   .code   = KEY_WPS_BUTTON,
+   .debounce_interval = ESR900_KEYS_DEBOUNCE_INTERVAL,
+   .gpio   = ESR900_GPIO_BTN_WPS,
+   .active_low = 1,
+   },
+   {
+   .desc   = Reset button,
+   .type   = EV_KEY,
+   .code   = KEY_RESTART,
+   .debounce_interval = ESR900_KEYS_DEBOUNCE_INTERVAL,
+   .gpio   = ESR900_GPIO_BTN_RESET,
+   .active_low = 1,
+   },
+};
+
+static struct ar8327_pad_cfg esr900_ar8327_pad0_cfg;
+static struct ar8327_pad_cfg esr900_ar8327_pad6_cfg;
+
+static struct ar8327_platform_data esr900_ar8327_data = {
+   .pad0_cfg = esr900_ar8327_pad0_cfg,
+   .pad6_cfg = esr900_ar8327_pad6_cfg,
+   .port0_cfg = {
+   .force_link = 1,
+   .speed = AR8327_PORT_SPEED_1000,
+   .duplex = 1,
+   .txpause = 1,
+   .rxpause = 1,
+   },
+   .port6_cfg = {
+   .force_link = 1,
+   .speed = AR8327_PORT_SPEED_1000,
+   .duplex = 1

[OpenWrt-Devel] [PATCH v2 2/3] ar71xx: add board support for the EnGenius ESR900

2014-06-22 Thread Forest Crossman
Signed-off-by: Forest Crossman cyro...@gmail.com
---
 target/linux/ar71xx/generic/profiles/engenius.mk | 16 
 target/linux/ar71xx/image/Makefile   |  2 ++
 2 files changed, 18 insertions(+)
 create mode 100644 target/linux/ar71xx/generic/profiles/engenius.mk

diff --git a/target/linux/ar71xx/generic/profiles/engenius.mk 
b/target/linux/ar71xx/generic/profiles/engenius.mk
new file mode 100644
index 000..343ced6
--- /dev/null
+++ b/target/linux/ar71xx/generic/profiles/engenius.mk
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2009-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+define Profile/ESR900
+NAME:=EnGenius ESR900
+PACKAGES:=kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev
+endef
+
+define Profile/ESR900/Description
+Package set optimized for the EnGenius ESR900
+endef
+
+$(eval $(call Profile,ESR900))
diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index d0ee363..303a84b 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -264,6 +264,7 @@ 
cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,
 
db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x5(firmware)
 
cameo_ap94_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,1600k(unknown)ro,64k@0x7f(caldata_copy)
 
cameo_ap94_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7808k(firmware),64k(caldata)ro,64k@0x66(caldata_orig),6208k@0x5(firmware_orig)
+esr900_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,14656k(firmware),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro
 
ew-dorin_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),3712k(firmware),64k(art)
 
ew-dorin_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)
 
dlrtdev_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,640k(certs),960k(unknown)ro,64k@0x7f(caldata_copy)
@@ -1032,6 +1033,7 @@ $(eval $(call 
SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,tt
 $(eval $(call 
SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call 
SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
 $(eval $(call 
SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
+$(eval $(call 
SingleProfile,AthLzma,64k,ESR900,esr900,ESR900,ttyS0,115200,$$(esr900_mtdlayout),KRuImage))
 $(eval $(call 
SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
 $(eval $(call 
SingleProfile,AthLzma,64k,EWDORINRT,ew-dorin-router,EW-DORIN-ROUTER,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
 $(eval $(call 
SingleProfile,AthLzma,64k,EWDORIN16M,ew-dorin-16M,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_16M),KRuImage,65536))
-- 
1.9.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 3/3] ar71xx: add user-space support for the EnGenius ESR900

2014-06-22 Thread Forest Crossman
Signed-off-by: Forest Crossman cyro...@gmail.com
---
 package/base-files/files/lib/functions/system.sh   |  1 +
 target/linux/ar71xx/base-files/etc/diag.sh |  3 +++
 target/linux/ar71xx/base-files/etc/uci-defaults/01_leds|  5 +
 target/linux/ar71xx/base-files/etc/uci-defaults/02_network | 10 ++
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |  3 +++
 5 files changed, 22 insertions(+)

diff --git a/package/base-files/files/lib/functions/system.sh 
b/package/base-files/files/lib/functions/system.sh
index a4c0f26..8d75a5a 100644
--- a/package/base-files/files/lib/functions/system.sh
+++ b/package/base-files/files/lib/functions/system.sh
@@ -82,6 +82,7 @@ macaddr_canonicalize()
local mac=$1
local canon=
 
+   mac=$(echo -n $mac | tr -d \)
[ ${#mac} -gt 17 ]  return
[ -n ${mac//[a-fA-F0-9\.: -]/} ]  return
 
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index d5063de..d0306bc 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -65,6 +65,9 @@ get_status_led() {
eap7660d)
status_led=eap7660d:green:ds4
;;
+   esr900)
+   status_led=engenius:amber:power
+   ;;
hiwifi-hc6361)
status_led=hiwifi:blue:system
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index fe5ff93..8265b00 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -103,6 +103,11 @@ dir-825-c1)
ucidef_set_led_wlan wlan2g WLAN 2.4 GHz d-link:blue:wlan2g 
phy0tpt
;;
 
+esr900)
+   ucidef_set_led_wlan wlan2g WLAN 2.4 GHz engenius:blue:wlan-2g 
phy0tpt
+   ucidef_set_led_wlan wlan5g WLAN 5 GHz engenius:blue:wlan-5g 
phy1tpt
+   ;;
+
 hiwifi-hc6361)
ucidef_set_led_default inet INET hiwifi:blue:internet 0
ucidef_set_led_wlan wlan WLAN hiwifi:blue:wlan-2p4 phy0tpt
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index a2b2762..4604bea 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -241,6 +241,16 @@ wndr4300)
[ -n $mac_wan ]  ucidef_set_interface_macaddr wan $mac_wan
;;
 
+esr900)
+   local mac
+   ucidef_set_interfaces_lan_wan eth0.1 eth0.2
+   ucidef_add_switch switch0 1 1
+   ucidef_add_switch_vlan switch0 1 0t 1 2 3 4
+   ucidef_add_switch_vlan switch0 2 0t 5
+   mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
+   [ -n $mac ]  ucidef_set_interface_macaddr wan $mac
+   ;;
+
 all0305 |\
 aw-nr580 |\
 bullet-m |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 6dd5e62..afac42a 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -307,6 +307,9 @@ ar71xx_board_detect() {
*EAP7660D)
name=eap7660d
;;
+   *EnGenius ESR900)
+   name=esr900
+   ;;
*JA76PF)
name=ja76pf
;;
-- 
1.9.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH RESEND] firmware-utils/mkdir615h1: fix magic XOR calculation

2014-06-22 Thread Forest Crossman
Signed-off-by: Forest Crossman cyro...@gmail.com
---
 tools/firmware-utils/src/mkdir615h1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/firmware-utils/src/mkdir615h1.c 
b/tools/firmware-utils/src/mkdir615h1.c
index 84692aa..d9fb35c 100644
--- a/tools/firmware-utils/src/mkdir615h1.c
+++ b/tools/firmware-utils/src/mkdir615h1.c
@@ -199,7 +199,7 @@ static int encode_image(const char *input_file_name,
}
 
for (i = 0; i  bytes_read; i++)
-   buf[i] ^= magic  i  60) + i)  7) - (i  60));
+   buf[i] ^= magic  (i % 8)  0xff;
fwrite(buf, bytes_read, 1, fp_output);
}
 
@@ -254,7 +254,7 @@ int decode_image(const char *input_file_name, const char 
*output_file_name)
 
bytes_read = fread(buf, 1, BUF_SIZE, fp_input);
for (i = 0; i  bytes_read; i++)
-   buf[i] ^= header.magic  i  60) + i)  7) - (i 
 60));
+   buf[i] ^= header.magic  (i % 8)  0xff;
 
/*
 * Handle padded source file
-- 
1.9.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] firmware-utils/mkdir615h1: fix magic XOR calculation

2014-06-21 Thread Forest Crossman
Signed-off-by: Forest Crossman cyro...@gmail.com
---
 tools/firmware-utils/src/mkdir615h1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/firmware-utils/src/mkdir615h1.c
b/tools/firmware-utils/src/mkdir615h1.c
index 84692aa..d9fb35c 100644
--- a/tools/firmware-utils/src/mkdir615h1.c
+++ b/tools/firmware-utils/src/mkdir615h1.c
@@ -199,7 +199,7 @@ static int encode_image(const char *input_file_name,
  }

  for (i = 0; i  bytes_read; i++)
- buf[i] ^= magic  i  60) + i)  7) - (i  60));
+ buf[i] ^= magic  (i % 8)  0xff;
  fwrite(buf, bytes_read, 1, fp_output);
  }

@@ -254,7 +254,7 @@ int decode_image(const char *input_file_name,
const char *output_file_name)

  bytes_read = fread(buf, 1, BUF_SIZE, fp_input);
  for (i = 0; i  bytes_read; i++)
- buf[i] ^= header.magic  i  60) + i)  7) - (i  60));
+ buf[i] ^= header.magic  (i % 8)  0xff;

  /*
  * Handle padded source file
-- 
1.9.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ar71xx: add support for the EnGenius ESR900

2014-06-20 Thread Forest Crossman
Signed-off-by: Forest Crossman cyro...@gmail.com
---
 package/base-files/files/lib/functions/system.sh   |   1 +
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |   5 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |  11 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 target/linux/ar71xx/config-3.10|   1 +
 .../ar71xx/files/arch/mips/ath79/mach-esr900.c | 232 +
 target/linux/ar71xx/files/arch/mips/ath79/nvram.c  |  16 ++
 target/linux/ar71xx/generic/profiles/engenius.mk   |  16 ++
 target/linux/ar71xx/image/Makefile |   2 +
 .../610-MIPS-ath79-openwrt-machines.patch  |  18 +-
 11 files changed, 305 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c
 create mode 100644 target/linux/ar71xx/generic/profiles/engenius.mk

diff --git a/package/base-files/files/lib/functions/system.sh
b/package/base-files/files/lib/functions/system.sh
index a4c0f26..8d75a5a 100644
--- a/package/base-files/files/lib/functions/system.sh
+++ b/package/base-files/files/lib/functions/system.sh
@@ -82,6 +82,7 @@ macaddr_canonicalize()
  local mac=$1
  local canon=

+ mac=$(echo -n $mac | tr -d \)
  [ ${#mac} -gt 17 ]  return
  [ -n ${mac//[a-fA-F0-9\.: -]/} ]  return

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh
b/target/linux/ar71xx/base-files/etc/diag.sh
index d5063de..81e4eff 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -238,6 +238,9 @@ get_status_led() {
  wlr8100)
  status_led=sitecom:amber:status
  ;;
+ esr900)
+ status_led=engenius:amber:power
+ ;;
  esac
 }

diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index fe5ff93..8265b00 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -103,6 +103,11 @@ dir-825-c1)
  ucidef_set_led_wlan wlan2g WLAN 2.4 GHz d-link:blue:wlan2g phy0tpt
  ;;

+esr900)
+ ucidef_set_led_wlan wlan2g WLAN 2.4 GHz engenius:blue:wlan-2g phy0tpt
+ ucidef_set_led_wlan wlan5g WLAN 5 GHz engenius:blue:wlan-5g phy1tpt
+ ;;
+
 hiwifi-hc6361)
  ucidef_set_led_default inet INET hiwifi:blue:internet 0
  ucidef_set_led_wlan wlan WLAN hiwifi:blue:wlan-2p4 phy0tpt
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index a2b2762..08bd1c8 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -378,6 +378,17 @@ wndr3700)
  uci set network.@switch_port[-1].led='2'
  ;;

+esr900)
+ local wan_mac
+ local lan_mac
+ ucidef_set_interfaces_lan_wan eth0.1 eth0.2
+ ucidef_add_switch switch0 1 1
+ ucidef_add_switch_vlan switch0 1 0t 1 2 3 4
+ ucidef_add_switch_vlan switch0 2 0t 5
+ wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
+ [ -n $wan_mac ]  ucidef_set_interface_macaddr wan $wan_mac
+ ;;
+
 *)
  ucidef_set_interfaces_lan_wan eth0 eth1
  ;;
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 6dd5e62..e346f97 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -676,6 +676,9 @@ ar71xx_board_detect() {
  *HiWiFi HC6361)
  name=hiwifi-hc6361
  ;;
+ *EnGenius ESR900)
+ name=esr900
+ ;;
  esac

  case $machine in
diff --git a/target/linux/ar71xx/config-3.10 b/target/linux/ar71xx/config-3.10
index c294cd8..78d5359 100644
--- a/target/linux/ar71xx/config-3.10
+++ b/target/linux/ar71xx/config-3.10
@@ -47,6 +47,7 @@ CONFIG_ATH79_MACH_DIR_825_B1=y
 CONFIG_ATH79_MACH_DIR_825_C1=y
 CONFIG_ATH79_MACH_DRAGINO2=y
 CONFIG_ATH79_MACH_EAP7660D=y
+CONFIG_ATH79_MACH_ESR900=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_GS_OOLITE=y
 CONFIG_ATH79_MACH_HORNET_UB=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c
b/target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c
new file mode 100644
index 000..64e590a
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-esr900.c
@@ -0,0 +1,232 @@
+/*
+ * EnGenius ESR900 board support
+ *
+ * Based on the Qualcomm Atheros AP135/AP136 reference board support code
+ * Copyright (c) 2012 Qualcomm Atheros
+ * Copyright (c) 2012-2013 Gabor Juhos juh...@openwrt.org
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL