Re: [OpenWrt-Devel] Support for USB LTE modems Samsung GT-B3730 / GT-B3710 / GT-B3740

2014-01-24 Thread Matti Laakso
 Hi there!

 I'd like to use a Samsung GT-B3740 USB LTE modem together with OpenWRT.

 I assume that the modem isn't supported yet by OpenWRT because it requires
 the kalmia kernel module which I couldn't find in the OpenWRT sources.

 The kalmia driver can be found here:
 https://github.com/mkotsbak/Samsung-GT-B3730-linux-driver
 It was written based on reverse engineering efforts of the Samsung driver
 for Windows.

 It looks like the kalmia driver is part of the Linux kernel since version
 3.0. It uses the WWAN subsystem to establish a connection.

 If you think the modem should already be supported, how should I test this
 / which OpenWRT version should I use? I have a TP-Link TL-WR1043ND
 available to get the modem up and running.

 If it isn't supported yet: Can you please help me to add support for it to
 OpenWRT?

 Please tell me if this isn't the right mailing list to discuss such things.

 Thank you!
 Michael

To get it to build just add a declaration to

trunk/package/kernel/linux/modules/usb.mk

like this:

define KernelPackage/usb-net-kalmia
  TITLE:=Samsung Kalmia based LTE USB modem
  KCONFIG:=CONFIG_USB_NET_KALMIA
  FILES:=$(LINUX_DIR)/drivers/net/usb/kalmia.ko
  AUTOLOAD:=$(call AutoProbe,kalmia)
  $(call AddDepends/usb-net)
endef

define KernelPackage/usb-net-kalmia/description
 Kernel support for Samsung Kalmia based LTE USB modem
endef

$(eval $(call KernelPackage,usb-net-kalmia))

Then you probably need to send some AT commands to the modem through a
/dev/ttyUSB-node and use dhcp as protocol for the interface.

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


[OpenWrt-Devel] [PATCH] DGN3500 (all known variants) factory image building support

2014-01-24 Thread Marco Antonio Mauro
This patch adds factory image building so as to allow an OpenWRT
install through the standard firmware update system.

It is an heavily modified version of a package I found on the OpenWRT
forum with a couple fixes -- in the checksum appending code -- and
features added -- mainly the generation of all the different image
variants to support all known models directly, atm variants are
AnnexA-WW, AnnexA-NA and AnnexB-DE/GR.

The images generated can probably be also used with the firmware
recovery tool that is allegedly included in the CD bundled with the
routers as they have the exact same format (btw if someone knows where
to find this tool or has it somewhere it'd be really appreciated if I
could get a copy to test it). The same tool should also be able to
revert to the standard Netgear firmware in case it's needed.

Testing for all three supported variants would be appreciated.

Signed-off-by: Marco Antonio Mauro marcu...@gmail.com
---

diff --git a/target/linux/lantiq/dts/DGN3500.dtsi
b/target/linux/lantiq/dts/DGN3500.dtsi
index e77d823..46a0e0c 100644
--- a/target/linux/lantiq/dts/DGN3500.dtsi
+++ b/target/linux/lantiq/dts/DGN3500.dtsi
@@ -2,7 +2,7 @@

 / {
  chosen {
- bootargs = console=ttyLTQ0,115200 init=/etc/preinit;
+ bootargs = root=/dev/mtdblock5 console=ttyLTQ0,115200 init=/etc/preinit;
  };

  memory@0 {
diff --git a/target/linux/lantiq/image/Makefile
b/target/linux/lantiq/image/Makefile
index 0945888..a05de72 100644
--- a/target/linux/lantiq/image/Makefile
+++ b/target/linux/lantiq/image/Makefile
@@ -12,6 +12,7 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk

 JFFS2_BLOCKSIZE = 64k 128k 256k
+DGN3500_SKERNEL = 0x5

 LOADER_MAKE := $(NO_TRACE_MAKE) -C lzma-loader KDIR=$(KDIR)

@@ -82,6 +83,41 @@ define Image/Build/squashfs
  $(if $(3),$(call
MkBrnImage,$(3),$(4),$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(3)-brnImage,$(2),$(1),$(5)))
 endef

+define Image/BuildDGN3500/squashfs
+ dd if=/dev/zero of=$(BIN_DIR)/$(IMG_PREFIX)-pad bs=327680 count=1
+ cat $(BIN_DIR)/$(IMG_PREFIX)-pad $(KDIR)/uImage-$(2)
$(KDIR)/root.$(1) 
$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.image
+ rm -r $(BIN_DIR)/$(IMG_PREFIX)-pad
+ cat $(KDIR)/uImage-$(2) $(KDIR)/root.$(1) 
$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-sysupgrade.image
+ dd if=/dev/zero ibs=16M count=1 | tr \000 \377 
$(BIN_DIR)/$(IMG_PREFIX)-pwf
+ cp $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.image
$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadNA.image
+ dgn3500sum $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadNA.image
$(DGN3500_SKERNEL) NA
+ $(call 
prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadNA.image)
+ cp $(BIN_DIR)/$(IMG_PREFIX)-pwf
$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-NA.image
+ dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadNA.image
of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-NA.image conv=notrunc
+ rm -r $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadNA.image
+ mv $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.image
$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadWW.image
+ dgn3500sum $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadWW.image
$(DGN3500_SKERNEL) WW
+ $(call 
prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadWW.image)
+ mv $(BIN_DIR)/$(IMG_PREFIX)-pwf
$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-WW.image
+ dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadWW.image
of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-WW.image conv=notrunc
+ rm -r $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadWW.image
+ $(call 
prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-sysupgrade.image)
+endef
+
+define Image/BuildDGN3500B/squashfs
+ dd if=/dev/zero of=$(BIN_DIR)/$(IMG_PREFIX)-pad bs=327680 count=1
+ cat $(BIN_DIR)/$(IMG_PREFIX)-pad $(KDIR)/uImage-$(2)
$(KDIR)/root.$(1) 
$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.image
+ rm -r $(BIN_DIR)/$(IMG_PREFIX)-pad
+ cat $(KDIR)/uImage-$(2) $(KDIR)/root.$(1) 
$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-sysupgrade.image
+ dd if=/dev/zero ibs=16M count=1 | tr \000 \377 
$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory.image
+ dgn3500sum $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.image
$(DGN3500_SKERNEL) DE
+ $(call 
prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.image)
+ dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.image
of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory.image conv=notrunc
+ rm -r $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.image
+ $(call 
prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-sysupgrade.image)
+endef
+
+
 define Image/BuildTPLink/squashfs
  mktplinkfw2 -B $(3) -s -a 0x4 -j \
  -k $(KDIR)/vmlinux-$(2).lzma -r $(KDIR)/root.$(1) \
@@ -242,10 +278,10 @@ Image/Build/Profile/GIGASX76X=$(call
Image/Build/$(1),$(1),GIGASX76X)

 # AR9
 Image/BuildKernel/Profile/DGN3500=$(call Image/BuildKernel/Template,DGN3500)
-Image/Build/Profile/DGN3500=$(call Image/Build/$(1),$(1),DGN3500)
+Image/Build/Profile/DGN3500=$(call 

[OpenWrt-Devel] [PATCH 2/2] hostapd: Fix 80211w setup with netifd

2014-01-24 Thread Helmut Schaa

Signed-off-by: Helmut Schaa helmut.sc...@googlemail.com
---
 package/network/services/hostapd/files/netifd.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/files/netifd.sh 
b/package/network/services/hostapd/files/netifd.sh
index 43cc99b..c8518b4 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -295,7 +295,7 @@ hostapd_set_bss_options() {
[ $auth_cache = 0 ]  append bss_conf 
disable_pmksa_caching=1 $N
 
# RSN - allow management frame protection
-   json_get_var ieee80211w
+   json_get_var ieee80211w ieee80211w
case $ieee80211w in
[012])
json_get_vars ieee80211w_max_timeout 
ieee80211w_retry_timeout
-- 
1.8.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] hostapd: Fix basic_rate setup with netifd

2014-01-24 Thread Helmut Schaa

Signed-off-by: Helmut Schaa helmut.sc...@googlemail.com
---
 package/network/services/hostapd/files/netifd.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/network/services/hostapd/files/netifd.sh 
b/package/network/services/hostapd/files/netifd.sh
index 930755f..43cc99b 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -69,6 +69,7 @@ hostapd_prepare_device_config() {
[ -n $hwmode ]  append base_cfg hw_mode=$hwmode $N
 
local brlist= br
+   json_get_values basic_rate_list basic_rate
for br in $basic_rate_list; do
hostapd_add_rate brlist $br
done
-- 
1.8.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] procd: reboot sometimes hangs

2014-01-24 Thread Helmut Schaa
Hi John,

On Wed, Jan 15, 2014 at 5:39 PM, John Crispin j...@phrozen.org wrote:

 On 15/01/2014 17:12, Helmut Schaa wrote:
 On Wed, Jan 15, 2014 at 4:57 PM, Helmut Schaa
 helmut.sc...@googlemail.com wrote:
 On Wed, Jan 15, 2014 at 2:57 PM, John Crispin j...@phrozen.org wrote:
 Hi

 i had a look at this last night and have the same fix in my local tree
 already. i need to think about it to see if it is enough, however seeing
 that you came up with the same fix tells me it must be correct :)
 However, it makes my procd crash :(
 Fixed by the libubox patch I've sent two minutes ago.
 Helmut
 __

 Hi Helmut,

 just saw it, hope i have time after dinner to fix it tonight ...

Any update on this? I'm running procd with the proposed change without
problems so far ...

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


[OpenWrt-Devel] [PATCH 1/4] b53: Add BCM53128 switch support

2014-01-24 Thread Helmut Schaa

Signed-off-by: Helmut Schaa helmut.sc...@googlemail.com
---
 .../linux/generic/files/drivers/net/phy/b53/b53_common.c   | 14 ++
 target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c  |  2 +-
 target/linux/generic/files/drivers/net/phy/b53/b53_priv.h  |  4 +++-
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c 
b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
index f6a5418..72b08e1 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
@@ -1130,6 +1130,19 @@ static const struct b53_chip_data b53_switch_chips[] = {
.sw_ops = b53_switch_ops,
},
{
+   .chip_id = BCM53128_DEVICE_ID,
+   .dev_name = BCM53128,
+   .alias = bcm53128,
+   .vlans = 4096,
+   .enabled_ports = 0x1ff,
+   .cpu_port = B53_CPU_PORT,
+   .vta_regs = B53_VTA_REGS,
+   .duplex_reg = B53_DUPLEX_STAT_GE,
+   .jumbo_pm_reg = B53_JUMBO_PORT_MASK,
+   .jumbo_size_reg = B53_JUMBO_MAX_SIZE,
+   .sw_ops = b53_switch_ops,
+   },
+   {
.chip_id = BCM63XX_DEVICE_ID,
.dev_name = BCM63xx,
.alias = bcm63xx,
@@ -1363,6 +1376,7 @@ int b53_switch_detect(struct b53_device *dev)
switch (id32) {
case BCM53115_DEVICE_ID:
case BCM53125_DEVICE_ID:
+   case BCM53128_DEVICE_ID:
case BCM53010_DEVICE_ID:
case BCM53011_DEVICE_ID:
case BCM53012_DEVICE_ID:
diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c 
b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
index cacf32b..3c25f0e 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
@@ -357,7 +357,7 @@ static struct phy_driver b53_phy_driver_id1 = {
},
 };
 
-/* BCM53125 */
+/* BCM53125, BCM53128 */
 static struct phy_driver b53_phy_driver_id2 = {
.phy_id = 0x03625c00,
.name   = Broadcom B53 (2),
diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_priv.h 
b/target/linux/generic/files/drivers/net/phy/b53/b53_priv.h
index d9881a1..ce5b530 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_priv.h
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_priv.h
@@ -46,6 +46,7 @@ enum {
BCM5398_DEVICE_ID = 0x98,
BCM53115_DEVICE_ID = 0x53115,
BCM53125_DEVICE_ID = 0x53125,
+   BCM53128_DEVICE_ID = 0x53128,
BCM63XX_DEVICE_ID = 0x6300,
BCM53010_DEVICE_ID = 0x53010,
BCM53011_DEVICE_ID = 0x53011,
@@ -137,7 +138,8 @@ static inline int is539x(struct b53_device *dev)
 static inline int is531x5(struct b53_device *dev)
 {
return dev-chip_id == BCM53115_DEVICE_ID ||
-   dev-chip_id == BCM53125_DEVICE_ID;
+   dev-chip_id == BCM53125_DEVICE_ID ||
+   dev-chip_id == BCM53128_DEVICE_ID;
 }
 
 static inline int is63xx(struct b53_device *dev)
-- 
1.8.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/4] b53: Use phy_drivers_register to register multiple phy drivers at once

2014-01-24 Thread Helmut Schaa

Signed-off-by: Helmut Schaa helmut.sc...@googlemail.com
---
 .../generic/files/drivers/net/phy/b53/b53_mdio.c   | 44 ++
 1 file changed, 12 insertions(+), 32 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c 
b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
index 3c25f0e..b86ea1a 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
@@ -341,8 +341,9 @@ static int b53_phy_read_status(struct phy_device *phydev)
return 0;
 }
 
-/* BCM5325, BCM539x */
-static struct phy_driver b53_phy_driver_id1 = {
+static struct phy_driver b53_phy_drivers[] = {
+{
+   /* BCM5325, BCM539x */
.phy_id = 0x0143bc00,
.name   = Broadcom B53 (1),
.phy_id_mask= 0x1c00,
@@ -355,10 +356,8 @@ static struct phy_driver b53_phy_driver_id1 = {
.driver = {
.owner = THIS_MODULE,
},
-};
-
-/* BCM53125, BCM53128 */
-static struct phy_driver b53_phy_driver_id2 = {
+}, {
+   /* BCM53125, BCM53128 */
.phy_id = 0x03625c00,
.name   = Broadcom B53 (2),
.phy_id_mask= 0x1c00,
@@ -371,10 +370,8 @@ static struct phy_driver b53_phy_driver_id2 = {
.driver = {
.owner = THIS_MODULE,
},
-};
-
-/* BCM5365 */
-static struct phy_driver b53_phy_driver_id3 = {
+}, {
+   /* BCM5365 */
.phy_id = 0x00406000,
.name   = Broadcom B53 (3),
.phy_id_mask= 0x1c00,
@@ -387,35 +384,18 @@ static struct phy_driver b53_phy_driver_id3 = {
.driver = {
.owner = THIS_MODULE,
},
-};
+} };
+
 
 int __init b53_phy_driver_register(void)
 {
-   int ret;
-
-   ret = phy_driver_register(b53_phy_driver_id1);
-   if (ret)
-   return ret;
-
-   ret = phy_driver_register(b53_phy_driver_id2);
-   if (ret)
-   goto err1;
-
-   ret = phy_driver_register(b53_phy_driver_id3);
-   if (!ret)
-   return 0;
-
-   phy_driver_unregister(b53_phy_driver_id2);
-err1:
-   phy_driver_unregister(b53_phy_driver_id1);
-   return ret;
+   return phy_drivers_register(b53_phy_drivers,
+   ARRAY_SIZE(b53_phy_drivers));
 }
 
 void __exit b53_phy_driver_unregister(void)
 {
-   phy_driver_unregister(b53_phy_driver_id3);
-   phy_driver_unregister(b53_phy_driver_id2);
-   phy_driver_unregister(b53_phy_driver_id1);
+   phy_drivers_unregister(b53_phy_drivers, ARRAY_SIZE(b53_phy_drivers));
 }
 
 module_init(b53_phy_driver_register);
-- 
1.8.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/4] b53: Make b53_switch_init static

2014-01-24 Thread Helmut Schaa

Signed-off-by: Helmut Schaa helmut.sc...@googlemail.com
---
 target/linux/generic/files/drivers/net/phy/b53/b53_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c 
b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
index 72b08e1..b82bc93 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
@@ -1222,7 +1222,7 @@ static const struct b53_chip_data b53_switch_chips[] = {
},
 };
 
-int b53_switch_init(struct b53_device *dev)
+static int b53_switch_init(struct b53_device *dev)
 {
struct switch_dev *sw_dev = dev-sw_dev;
unsigned i;
-- 
1.8.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/4] b53: mdio: Avoid re-registering the same switch device

2014-01-24 Thread Helmut Schaa
When setting the associated interface down and up again a new
switch device will be registered due to b53_phy_config_init
doing the necessary allocations and registrations.

Instead, register the switch device already in b53_phy_probe.

Signed-off-by: Helmut Schaa helmut.sc...@googlemail.com
---
 .../generic/files/drivers/net/phy/b53/b53_common.c |  2 +-
 .../generic/files/drivers/net/phy/b53/b53_mdio.c   | 40 --
 .../generic/files/drivers/net/phy/b53/b53_priv.h   |  2 ++
 3 files changed, 17 insertions(+), 27 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c 
b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
index b82bc93..37f520d 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
@@ -478,7 +478,7 @@ static void b53_switch_reset_gpio(struct b53_device *dev)
dev-current_page = 0xff;
 }
 
-static int b53_switch_reset(struct b53_device *dev)
+int b53_switch_reset(struct b53_device *dev)
 {
u8 mgmt;
 
diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c 
b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
index b86ea1a..e626217 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
@@ -253,56 +253,44 @@ static struct b53_io_ops b53_mdio_ops = {
 
 static int b53_phy_probe(struct phy_device *phydev)
 {
-   struct b53_device dev;
+   struct b53_device *dev;
int ret;
 
/* allow the generic phy driver to take over */
if (phydev-addr != B53_PSEUDO_PHY  phydev-addr != 0)
return -ENODEV;
 
-   dev.current_page = 0xff;
-   dev.priv = phydev-bus;
-   dev.ops = b53_mdio_ops;
-   dev.pdata = NULL;
-   mutex_init(dev.reg_mutex);
+   dev = b53_switch_alloc(phydev-dev, b53_mdio_ops, phydev-bus);
+   if (!dev)
+   return -ENOMEM;
 
-   ret = b53_switch_detect(dev);
-   if (ret)
+   dev-current_page = 0xff;
+
+   ret = b53_switch_register(dev);
+   if (ret) {
+   kfree(dev);
return ret;
+   }
 
-   if (is5325(dev) || is5365(dev))
+   if (is5325(dev) || is5365(dev))
phydev-supported = SUPPORTED_100baseT_Full;
else
phydev-supported = SUPPORTED_1000baseT_Full;
 
phydev-advertising = phydev-supported;
+   phydev-priv = dev;
 
return 0;
 }
 
 static int b53_phy_config_init(struct phy_device *phydev)
 {
-   struct b53_device *dev;
-   int ret;
+   struct b53_device *dev = phydev-priv;
 
-   dev = b53_switch_alloc(phydev-dev, b53_mdio_ops, phydev-bus);
-   if (!dev)
-   return -ENOMEM;
-
-   /* we don't use page 0xff, so force a page set */
-   dev-current_page = 0xff;
/* force the ethX as alias */
dev-sw_dev.alias = phydev-attached_dev-name;
 
-   ret = b53_switch_register(dev);
-   if (ret) {
-   dev_err(dev-dev, failed to register switch: %i\n, ret);
-   return ret;
-   }
-
-   phydev-priv = dev;
-
-   return 0;
+   return b53_switch_reset(dev);
 }
 
 static void b53_phy_remove(struct phy_device *phydev)
diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_priv.h 
b/target/linux/generic/files/drivers/net/phy/b53/b53_priv.h
index ce5b530..75b86dc 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_priv.h
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_priv.h
@@ -180,6 +180,8 @@ int b53_switch_detect(struct b53_device *dev);
 
 int b53_switch_register(struct b53_device *dev);
 
+int b53_switch_reset(struct b53_device *dev);
+
 static inline void b53_switch_remove(struct b53_device *dev)
 {
unregister_switch(dev-sw_dev);
-- 
1.8.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] procd: reboot sometimes hangs

2014-01-24 Thread John Crispin

On 24/01/2014 12:45, Helmut Schaa wrote:
 Hi John,

 On Wed, Jan 15, 2014 at 5:39 PM, John Crispin j...@phrozen.org wrote:
 On 15/01/2014 17:12, Helmut Schaa wrote:
 On Wed, Jan 15, 2014 at 4:57 PM, Helmut Schaa
 helmut.sc...@googlemail.com wrote:
 On Wed, Jan 15, 2014 at 2:57 PM, John Crispin j...@phrozen.org wrote:
 Hi

 i had a look at this last night and have the same fix in my local tree
 already. i need to think about it to see if it is enough, however seeing
 that you came up with the same fix tells me it must be correct :)
 However, it makes my procd crash :(
 Fixed by the libubox patch I've sent two minutes ago.
 Helmut
 __
 Hi Helmut,

 just saw it, hope i have time after dinner to fix it tonight ...
 Any update on this? I'm running procd with the proposed change without
 problems so far ...

 Thanks,
 Helmut
Hi Helmut,

i had to help out with the linux-mips 3.14 release which ate all my time
the last 2 weeks. the chore is still on my list, just not got round to
looking into it yet ...

John




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

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


Re: [OpenWrt-Devel] procd: reboot sometimes hangs

2014-01-24 Thread Helmut Schaa
On Fri, Jan 24, 2014 at 1:27 PM, John Crispin j...@phrozen.org wrote:

 On 24/01/2014 12:45, Helmut Schaa wrote:
 Hi John,

 On Wed, Jan 15, 2014 at 5:39 PM, John Crispin j...@phrozen.org wrote:
 On 15/01/2014 17:12, Helmut Schaa wrote:
 On Wed, Jan 15, 2014 at 4:57 PM, Helmut Schaa
 helmut.sc...@googlemail.com wrote:
 On Wed, Jan 15, 2014 at 2:57 PM, John Crispin j...@phrozen.org wrote:
 Hi

 i had a look at this last night and have the same fix in my local tree
 already. i need to think about it to see if it is enough, however seeing
 that you came up with the same fix tells me it must be correct :)
 However, it makes my procd crash :(
 Fixed by the libubox patch I've sent two minutes ago.
 Helmut
 __
 Hi Helmut,

 just saw it, hope i have time after dinner to fix it tonight ...
 Any update on this? I'm running procd with the proposed change without
 problems so far ...

 Thanks,
 Helmut
 Hi Helmut,

 i had to help out with the linux-mips 3.14 release which ate all my time
 the last 2 weeks. the chore is still on my list, just not got round to
 looking into it yet ...

Ok, no worries. Take your time :D
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Support for USB LTE modems Samsung GT-B3730 / GT-B3710 / GT-B3740

2014-01-24 Thread Stefan Monnier
 I'd like to use a Samsung GT-B3740 USB LTE modem together with OpenWRT.
 To get it to build just add a declaration to

Another option is to compile it directly into your kernel, via

   make kernel_menuconfig


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


[OpenWrt-Devel] Buildbot not working for various snapshots?

2014-01-24 Thread Aaron Z
Looks like snapshots for the adm5120, ar71xx and adm5120 branches were last 
built on 19 Jan 2014...

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


Re: [OpenWrt-Devel] Buildbot not working for various snapshots?

2014-01-24 Thread Hannu Nyman
 Looks like snapshots for the adm5120, ar71xx and adm5120 branches were 
last built on 19 Jan 2014...


ar71xx is being uploaded at this moment, based on r39382...
Builds failed for a few days, but got fixed by 39369(?)
See http://buildbot.openwrt.org:8010/builders/ar71xx

The same is probably true for the other mentioned builds, too.
___
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 MikroTik RB951Ui-2HnD

2014-01-24 Thread Matthew Reeve
I noticed that the patch at http://patchwork.openwrt.org/patch/4017/ for adding 
support for the MikroTik RouterBOARD 951Ui-2HnD had been abandoned because it 
wasn't generated and sent to the mailing list correctly and doesn't apply as a 
result.  I have cleaned up this patch.

When testing this on real hardware, I also noticed that wireless didn't work, 
so this patch fixes that as well.

This patch applies cleanly to SVN 39392.

Signed-off-by: Matthew Reeve mre...@tenxnetworks.com


--- target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c  2014-01-24 
14:15:19.656352285 -0700
+++ target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c  2014-01-24 
16:10:23.387390723 -0700
@@ -24,2 +24,3 @@
 #include linux/spi/flash.h
+#include linux/rle.h
 #include linux/routerboot.h
@@ -38,2 +39,3 @@
 #include routerboot.h
+#include dev-leds-gpio.h
 
@@ -41,2 +43,6 @@
 
+#define RB951UI_HARD_CFG_OFFSET0xc000
+#define RB951UI_HARD_CFG_SIZE  0x1000
+#define RB951UI_ART_SIZE   0x1
+
 static struct mtd_partition rb95x_nand_partitions[] = {
@@ -79,2 +85,34 @@ static struct ar8327_platform_data rb95x
 
+static struct gpio_led rb951ui_leds_gpio[] __initdata = {
+   {
+   .name   = rb951ui:wlan,
+   .gpio   = 11,
+   .active_low = 1,
+   }, {
+   .name   = rb951ui:act,
+   .gpio   = 3,
+   .active_low = 1,
+   }, {
+   .name   = rb951ui:lan:port1,
+   .gpio   = 13,
+   .active_low = 1,
+   }, {
+   .name   = rb951ui:lan:port2,
+   .gpio   = 12,
+   .active_low = 1,
+   }, {
+   .name   = rb951ui:lan:port3,
+   .gpio   = 4,
+   .active_low = 1,
+   }, {
+   .name   = rb951ui:lan:port4,
+   .gpio   = 21,
+   .active_low = 1,
+   }, {
+   .name   = rb951ui:lan:port5,
+   .gpio   = 21,
+   .active_low = 1,
+   }
+};
+
 static struct mdio_board_info rb95x_mdio0_info[] = {
@@ -102,2 +140,36 @@ void __init rb95x_wlan_init(void)
 
+void __init rb951ui_wlan_init(void)
+{
+   u8 *hard_cfg = (u8 *) KSEG1ADDR(0x1f00 + RB951UI_HARD_CFG_OFFSET);
+   u16 tag_len;
+   u8 *tag;
+   char *art_buf;
+   u8 wlan_mac[ETH_ALEN];
+   int err;
+
+   err = routerboot_find_tag(hard_cfg, RB951UI_HARD_CFG_SIZE, 
RB_ID_WLAN_DATA,
+ tag, tag_len);
+   if (err) {
+   pr_err(no calibration data found\n);
+   return;
+   }
+
+   art_buf = kmalloc(RB951UI_ART_SIZE, GFP_KERNEL);
+   if (art_buf == NULL) {
+   pr_err(no memory for calibration data\n);
+   return;
+   }
+
+   err = rle_decode((char *) tag, tag_len, art_buf, RB951UI_ART_SIZE,
+NULL, NULL);
+   if (err) {
+   pr_err(unable to decode calibration data\n);
+   kfree(art_buf);
+   }
+
+   ath79_init_mac(wlan_mac, ath79_mac_base, 11);
+   ath79_register_wmac(art_buf + 0x1000, wlan_mac);
+
+}
+
 static void rb95x_nand_select_chip(int chip_no)
@@ -187 +259,40 @@ MIPS_MACHINE(ATH79_MACH_RB_951G, 951G,
 rb951g_setup);
+
+static void __init rb951ui_setup(void)
+{
+   rb95x_nand_init();
+
+   ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_ONLY_MODE);
+
+   ath79_register_mdio(1, 0x0);
+
+   ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
+   ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, 1);
+
+   ath79_switch_data.phy4_mii_en = 1;
+   ath79_switch_data.phy_poll_mask = BIT(4);
+   ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
+   ath79_eth0_data.phy_mask = BIT(4);
+   ath79_eth0_data.mii_bus_dev = ath79_mdio1_device.dev;
+   ath79_register_eth(0);
+
+   ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
+   ath79_register_eth(1);
+
+   gpio_request_one(20,
+   GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_CHANGEABLE,
+   USB power);
+
+   gpio_request_one(2,
+   GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_CHANGEABLE,
+   POE power);
+
+   rb951ui_wlan_init();
+   ath79_register_usb();
+
+   ath79_register_leds_gpio(-1, ARRAY_SIZE(rb951ui_leds_gpio),
+   rb951ui_leds_gpio);
+}
+
+MIPS_MACHINE(ATH79_MACH_RB_951U, 951HnD, MikroTik RouterBOARD 951Ui-2HnD,
+   rb951ui_setup);
--- 
target/linux/ar71xx/patches-3.10/704-MIPS-ath79-add-RB951Ui-2HnD-support.patch  
2013-12-19 07:41:25.0 -0700
+++ 
target/linux/ar71xx/patches-3.10/704-MIPS-ath79-add-RB951Ui-2HnD-support.patch  
2014-01-24 16:09:40.595215422 -0700
@@ -0,0 +1,6 @@
+--- a/arch/mips/ath79/machtypes.h  2014-01-24 14:18:10.070102654 

[OpenWrt-Devel] [PATCH] ar71xx: Add support for Mikrotik Groove 52HPn

2014-01-24 Thread David Hutchison
Support for the Mikrotik Groove 52HPn. GPIO 17 appears to be the
buzzer. GPIO 14 is a test point to the right of the ethernet port.
Everything works except UART, I can receive output from the groove but
when i try to transmit keystrokes it seems to struggle on receiving
them. I'm guessing there is another driver attempting to use the UART
pins? Perhaps they need to be disabled to get proper UART usage? I'm
also not sure how to unlock the bottom 2 LED's from the hardware. It
appears that the second to last LED is ethernet link, and the last LED
is ethernet netdev. Everything else seems to work networking,
wireless, etc.

Signed-off-by: Davey Hutchison dhutchi...@bluemesh.net

--- target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c
2013-12-16 18:08:51.0 +
+++ target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c
2014-01-25 04:40:49.0 +
@@ -174,3 +174,49 @@
 }

 MIPS_MACHINE_NONAME(ATH79_MACH_RB_711GR100, 711Gr100, rb711gr100_setup);
+
+static struct gpio_led rbgroove_leds_gpio[] __initdata = {
+   {
+   .name   = rbgroove:wlan:1,
+   .gpio   = 0,
+   .active_low = 0,
+   }, {
+   .name   = rbgroove:wlan:2,
+   .gpio   = 1,
+   .active_low = 0,
+   }, {
+   .name   = rbgroove:wlan:3,
+   .gpio   = 2,
+   .active_low = 0,
+   }
+};
+
+static void __init rbgroove_setup(void)
+{
+   const struct rb_info *info;
+
+   info = rb_init_info((void *) KSEG1ADDR(0x1f00), 0x1);
+   if (!info)
+  return;
+
+   rb711gr100_init_partitions(info);
+
+   ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_MII_GMAC0);
+
+   ath79_register_mdio(0, 0x0);
+
+   ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
+   ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
+   ath79_eth0_data.phy_mask = BIT(0);
+
+   ath79_register_eth(0);
+   rb711gr100_wlan_init();
+
+   platform_device_register_simple(rb91x-nand, -1, NULL, 0);
+
+   ath79_register_leds_gpio(-1, ARRAY_SIZE(rbgroove_leds_gpio),
+rbgroove_leds_gpio);
+}
+
+MIPS_MACHINE(ATH79_MACH_RB_GROOVE, groove-52, MikroTik 52HPn,
+   rbgroove_setup);
--- target/linux/ar71xx/patches-3.10/703-MIPS-ath79-add-RB91x-support.patch
 2013-12-16 18:08:51.0 +
+++ target/linux/ar71xx/patches-3.10/703-MIPS-ath79-add-RB91x-support.patch
 2014-01-25 05:02:47.0 +
@@ -5,6 +5,7 @@
ATH79_MACH_RB_493,  /* Mikrotik RouterBOARD 493/493AH */
ATH79_MACH_RB_493G, /* Mikrotik RouterBOARD 493G */
 +  ATH79_MACH_RB_711GR100, /* Mikrotik RouterBOARD
911/912 boards */
++  ATH79_MACH_RB_GROOVE,   /* Mikrotik Groove 52HPn */
ATH79_MACH_RB_750,  /* MikroTik RouterBOARD 750 */
ATH79_MACH_RB_750G_R3,  /* MikroTik RouterBOARD 750GL */
ATH79_MACH_RB_751,  /* MikroTik RouterBOARD 751 */
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel