Re: [OpenWrt-Devel] [PATCH v2] mvebu: set WRT1900AC WAN interface MAC address

2015-02-23 Thread Imre Kaloz
On Sun, 22 Feb 2015 15:17:14 +0100, Claudio Leite lei...@staticky.com  
wrote:



Toggles the LA bit on the WAN interface.

Signed-off-by: Claudio Leite lei...@staticky.com


Merged in 44508.


Thanks,

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


Re: [OpenWrt-Devel] [PATCH 2/2] mvebu: set default WRT1900AC switch config

2015-02-23 Thread Imre Kaloz
On Sun, 22 Feb 2015 02:20:21 +0100, Claudio Leite lei...@staticky.com  
wrote:



This sets 'enable_vlan' and thus uses 802.1q
VLANs, but without tagging on either interface.

Signed-off-by: Claudio Leite lei...@staticky.com


Committed as 44509.


Thanks,

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


[OpenWrt-Devel] [PATCH 1/3] b53: add b53_mac_array_to_u64() utility function

2015-02-23 Thread Alexandru Ardelean
From: Alexandru Ardelean ardeleana...@gmail.com

Converts an MAC array of u8 to a u64 value.

Signed-off-by: Alexandru Ardelean ardeleana...@gmail.com
---
 target/linux/generic/files/drivers/net/phy/b53/b53_regs.h | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h 
b/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h
index ba50915..4379c58 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h
@@ -20,6 +20,16 @@
 #ifndef __B53_REGS_H
 #define __B53_REGS_H
 
+/* Utility function for converting u8 arrays into u64 values to be written 
with b53_write */
+static inline u64 b53_mac_array_to_u64(const u8 *u8_arr) {
+   u64 mac = (*(const u64 *)u8_arr);
+#ifdef __BIG_ENDIAN
+   return (mac  16);
+#else
+   return (mac  16);
+#endif
+}
+
 /* Management Port (SMP) Page offsets */
 #define B53_CTRL_PAGE  0x00 /* Control */
 #define B53_STAT_PAGE  0x01 /* Status */
-- 
2.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/3] b53: implement port mirroring feature

2015-02-23 Thread Alexandru Ardelean
From: Alexandru Ardelean ardeleana...@gmail.com

This has been implemented on a BCM53128 chip.
May very likely work on BCM53125 which is a 4 port variant.
No idea on what other chips it works, but since this is hidden
behind a config flag, others are free to try it out themselves.

We consider this a debugging feature of the B53 hardware, since
you'd normally not need to mirror traffic from ports to a single
capture port, unless debugging or doing some port snooping.

Because the feature is a bit complex in hardware, string parsing
is used to make this a bit more comfortable when setting it
from user space.

To enable/disable port mirroring (or capture):
   swconfig dev switch0 set port_capture on [or off]
   swconfig dev switch0 set apply

Before calling 'set apply', the current port capture configuration
can be read, before applying it to the registers.
   swconfig dev switch0 get port_capture

The output will be:
  Mirror Capture: On
Capture Port: 8
Block Not Mirrored Traffic: No
  Incoming Filter:
Address Filter: None
Mirrored Ports: None
  Outgoing Filter:
Address Filter: None
Mirrored Ports: None

The 'off' parameter takes no arguments.

The 'on' parameter takes these arguments:
   swconfig dev switch0 set port_capture \
   on cap_port 8 \
block_not_mirrored \
in_filter:(da XX:XX:XX:XX:XX:XX ports 1ff div 3) \
out_filter:(sa YY:YY:YY:YY:YY:YY ports 0ff div 4) \

Above is an example of how this would be called.
Backslashes mean that the command should be a single line.
The parsing is stupid simple, so quotes, cases  spaces are important.
 - cap_port - the port on which to forward all the captured traffic
 - block_not_mirrored - block the traffic that is not mirrored
 - in_filter/out_filter - filters for incoming/outgoing traffic capture
  default is for no filters, and no mirrored ports
   - da (or sa) - but not both; filter by MAC address; not specifying it
  should capture all packets
   - ports - bitmask port list, which ports to capture traffic
   - div - capture every Nth packet; default (0) captures all

Once mirrored ports are set, traffic will be forwarded to the
capture port based on filter parameters.

Signed-off-by: Alexandru Ardelean ardeleana...@gmail.com
---
 .../generic/files/drivers/net/phy/b53/Kconfig  |  13 +
 .../generic/files/drivers/net/phy/b53/b53_common.c | 292 +
 .../generic/files/drivers/net/phy/b53/b53_priv.h   |  25 ++
 .../generic/files/drivers/net/phy/b53/b53_regs.h   |  24 ++
 4 files changed, 354 insertions(+)

diff --git a/target/linux/generic/files/drivers/net/phy/b53/Kconfig 
b/target/linux/generic/files/drivers/net/phy/b53/Kconfig
index 67e053e..545814a 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/Kconfig
+++ b/target/linux/generic/files/drivers/net/phy/b53/Kconfig
@@ -35,3 +35,16 @@ config B53_SRAB_DRIVER
 
 config B53_PHY_FIXUP
bool
+   depends on B53
+
+config B53_HW_DEBUG_FEATURES
+   depends on B53
+   bool B53 hw debug features
+   default n
+   help
+ Various features that are supported by the switch chip and are
+ not needed for normal functioning of the switch chip. 
+ They could come in handy for debugging 
+ So far they've been tested on BCM53128, and should work on BCM53125
+ since that's a 4 port variant.
+
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..bdd4006 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
@@ -404,6 +404,70 @@ static void b53_enable_ports(struct b53_device *dev)
}
 }
 
+#ifdef CONFIG_B53_HW_DEBUG_FEATURES
+static void b53_enable_port_capture_filter(struct b53_device *dev,
+   struct b53_port_capture_filter *flt, u32 reg_off)
+{
+   u16 flt_ctrl;
+
+   b53_read16(dev, B53_MGMT_PAGE, B53_MIRROR_CTRL_FILTER(reg_off), 
flt_ctrl);
+
+   flt_ctrl = ~(B53_MIRROR_FILTER_BY_DA | B53_MIRROR_FILTER_BY_SA);
+   if (flt  (flt-mode == B53_CAPTURE_BY_DA))
+   flt_ctrl |= B53_MIRROR_FILTER_BY_DA;
+   else if (flt  (flt-mode == B53_CAPTURE_BY_SA))
+   flt_ctrl |= B53_MIRROR_FILTER_BY_SA;
+
+   if (flt_ctrl  (B53_MIRROR_FILTER_BY_DA | B53_MIRROR_FILTER_BY_SA))
+   b53_write48(dev, B53_MGMT_PAGE, B53_MIRROR_MAC_ADDR(reg_off),
+   b53_mac_array_to_u64(flt-mac));
+
+   if (flt  flt-nth) {
+   b53_write16(dev, B53_MGMT_PAGE, B53_MIRROR_DIVIDER(reg_off),
+   B53_MIRROR_DIVIDER_VALUE(flt-divider));
+   flt_ctrl |= B53_MIRROR_DIV_EN;
+   } else
+   flt_ctrl = ~B53_MIRROR_DIV_EN;
+
+   flt_ctrl = ~0x1ff;
+   if (flt)
+   flt_ctrl |= B53_MIRROR_PORTS_MASK(flt-ports_mask);
+
+   

[OpenWrt-Devel] [PATCH 3/3] b53: implement ARL Table read/write operations

2015-02-23 Thread Alexandru Ardelean
From: Alexandru Ardelean ardeleana...@gmail.com

This has been implemented on a BCM53128 chip.
May very likely work on BCM53125 which is a 4 port variant.
No idea on what other chips it works, but since this is hidden
behind a config flag, others are free to try it out themselves.

Read/Write operations for the ARL table.
To use it:
   swconfig dev switch0 set arl rd XX:XX:XX:XX:XX:XX vid 
   swconfig dev switch0 get arl

Output should be:
  ARL Operation: Read
MAC: XX:XX:XX:XX:XX:XX
VLAN ID: 
Valid: 1
Age: 1
Static: 0
Port(s): 001

Reading/Writing the ARL table is a bit complex of an operation,
so string parsing is used.
The idea is that this uses swconfig 'set' prepare a r/w operation
and swconfig 'get' to execute an operation.
Not the most elegant approach, but it works fairly well for a
debugging operation using b53 hardware.

There are 3 op codes: rd, wr and cl. 'cl' clears any previous rd/wr.
This parsing is stupid simple, so any spaces, cases and quotes matter.
If a operation failed, the output will be 'failed' and the kernel
log can be consulted. The kernel log can also be consulted for
various messages that may have been printed during a r/w operation.

For 'rd' and 'wr' ops
 - if VLAN not enabled, only the MAC address is required
 - if VLAN is enabled, both MAC and VLAN ID are required

Commands:
 - swconfig dev switch0 set arl cl - clear any prev op; no 'get' call required
 - swconfig dev switch0 set arl rd MAC VID - the call 'get',
 if output is 'failed' check kernel log
 - swconfig dev switch0 set arl rd MAC VID \
   [static 0/1] [age 0/1] [valid 0/1] [ports NNN]

The write operation takes parameters, static, age and valid, which
are bits that can be set/modified in the ARL table.

The ports must field is dependant on the type of MAC.
 - for unicat MACs, ports is a port number
 - for multicast MACs, ports is a bitmask for ports on which to forward
This is the same meaning when reading MAC/VID entries.

Signed-off-by: Alexandru Ardelean ardeleana...@gmail.com
---
 .../generic/files/drivers/net/phy/b53/b53_common.c | 278 +
 .../generic/files/drivers/net/phy/b53/b53_priv.h   |  20 ++
 .../generic/files/drivers/net/phy/b53/b53_regs.h   |  28 +++
 3 files changed, 326 insertions(+)

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 bdd4006..ab7604a 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
@@ -464,6 +464,155 @@ out:
b53_write16(dev, B53_MGMT_PAGE, B53_MIRROR_CTRL, port_mirror_ctrl);
 }
 
+static int b53_wait_arl_table_rw_done(struct b53_device *dev)
+{
+   u8 i;
+
+   for (i = 0; i  10; i++) {
+   u8 arl_rw_ctrl;
+   b53_read8(dev, B53_ARLIO_PAGE, B53_ARLTBL_RW_CTRL, 
arl_rw_ctrl);
+
+   if (!(arl_rw_ctrl  B53_ARLTBL_DONE))
+   return 0;
+
+   mdelay(1);
+   }
+   return -EINVAL;
+}
+
+static int b53_read_arl_table_entry(struct b53_device *dev,
+   u64 mac_match, u16 vid_match, u32 *arl_entry, u8 *idx)
+{
+   u8 i;
+
+   if (b53_wait_arl_table_rw_done(dev))
+   return -EINVAL;
+
+   for (i = 0; i = 3; i++) {
+   u64 mv;
+   u32 en;
+   u8 *m = (u8 *)mv;
+
+   b53_read64(dev, B53_ARLIO_PAGE, B53_ARLTBL_MAC_VID_ENTRY(i), 
mv);
+   b53_read32(dev, B53_ARLIO_PAGE, B53_ARLTBL_DATA_ENTRY(i), en);
+   pr_info(ARL Entry(%u) %08x MAC/VID: %02x:%02x 
%02x:%02x:%02x:%02x:%02x:%02x\n,
+   i, en, m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7]);
+   if (!(en  B53_ARLTBL_VALID))
+   continue;
+   if (B53_ARLTBL_MACADDR(mv) != mac_match)
+   continue;
+   if (dev-enable_vlan  (B53_ARLTBL_VID_GET(mv) != vid_match))
+   continue;
+   *idx = i;
+   *arl_entry = en;
+   return 0;
+   }
+
+   return -EINVAL;
+}
+
+static inline void b53_arl_entry_to_arl_ops(struct b53_arl_ops *ops, u32 
arl_entry)
+{
+   ops-age_set = 0;
+   ops-valid_set = 0;
+   ops-static_set = 0;
+   ops-ports_set = 0;
+   ops-valid = !!(arl_entry  B53_ARLTBL_VALID);
+   ops-static_ = !!(arl_entry  B53_ARLTBL_STATIC);
+   ops-age = !!(arl_entry  B53_ARLTBL_AGE);
+   ops-ports = (arl_entry  0x1ff);
+}
+
+static inline void b53_arl_ops_to_arl_entry(struct b53_arl_ops *ops, u32 
*arl_entry)
+{
+   if (ops-valid_set)
+   *arl_entry = (ops-valid) ? (*arl_entry | B53_ARLTBL_VALID) :
+   (*arl_entry  ~B53_ARLTBL_VALID);
+   if (ops-static_set)
+   *arl_entry = (ops-static_) ? (*arl_entry | B53_ARLTBL_STATIC) :
+ 

[OpenWrt-Devel] [PATCH] kernel.mk: handle major version dynamically

2015-02-23 Thread Rafał Miłecki
We can't simply hardcode v3.x directory name.

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
 include/kernel.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/kernel.mk b/include/kernel.mk
index e21d53a..eb3e07a 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -52,7 +52,8 @@ else
   LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.xz
   TESTING:=$(if $(findstring -rc,$(LINUX_VERSION)),/testing,)
   ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call 
qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
-  LINUX_SITE:=@KERNEL/linux/kernel/v3.x$(TESTING)
+  VER_DIR:=v$(word 1,$(subst ., ,$(LINUX_VERSION))).x
+  LINUX_SITE:=@KERNEL/linux/kernel/$(VER_DIR)$(TESTING)
   endif
 
   ifneq ($(TARGET_BUILD),1)
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] (no subject)

2015-02-23 Thread marvie melliza
https://lists.openwrt.org/cgi-bin/mailman/confirm/openwrt-devel/20d2b3e1caa737fae52aa05e7568d63432844198
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 3/3] b53: implement ARL Table read/write operations

2015-02-23 Thread Alexandru Ardelean
I just realized that this patchset would have looked nicer if I would have
put it in a b53_hwdbg.c [or something similar] file.

On Mon, Feb 23, 2015 at 4:41 PM, Alexandru Ardelean ardeleana...@gmail.com
wrote:

 From: Alexandru Ardelean ardeleana...@gmail.com

 This has been implemented on a BCM53128 chip.
 May very likely work on BCM53125 which is a 4 port variant.
 No idea on what other chips it works, but since this is hidden
 behind a config flag, others are free to try it out themselves.

 Read/Write operations for the ARL table.
 To use it:
swconfig dev switch0 set arl rd XX:XX:XX:XX:XX:XX vid 
swconfig dev switch0 get arl

 Output should be:
   ARL Operation: Read
 MAC: XX:XX:XX:XX:XX:XX
 VLAN ID: 
 Valid: 1
 Age: 1
 Static: 0
 Port(s): 001

 Reading/Writing the ARL table is a bit complex of an operation,
 so string parsing is used.
 The idea is that this uses swconfig 'set' prepare a r/w operation
 and swconfig 'get' to execute an operation.
 Not the most elegant approach, but it works fairly well for a
 debugging operation using b53 hardware.

 There are 3 op codes: rd, wr and cl. 'cl' clears any previous rd/wr.
 This parsing is stupid simple, so any spaces, cases and quotes matter.
 If a operation failed, the output will be 'failed' and the kernel
 log can be consulted. The kernel log can also be consulted for
 various messages that may have been printed during a r/w operation.

 For 'rd' and 'wr' ops
  - if VLAN not enabled, only the MAC address is required
  - if VLAN is enabled, both MAC and VLAN ID are required

 Commands:
  - swconfig dev switch0 set arl cl - clear any prev op; no 'get' call
 required
  - swconfig dev switch0 set arl rd MAC VID - the call 'get',
  if output is 'failed' check kernel log
  - swconfig dev switch0 set arl rd MAC VID \
[static 0/1] [age 0/1] [valid 0/1] [ports NNN]

 The write operation takes parameters, static, age and valid, which
 are bits that can be set/modified in the ARL table.

 The ports must field is dependant on the type of MAC.
  - for unicat MACs, ports is a port number
  - for multicast MACs, ports is a bitmask for ports on which to forward
 This is the same meaning when reading MAC/VID entries.

 Signed-off-by: Alexandru Ardelean ardeleana...@gmail.com
 ---
  .../generic/files/drivers/net/phy/b53/b53_common.c | 278
 +
  .../generic/files/drivers/net/phy/b53/b53_priv.h   |  20 ++
  .../generic/files/drivers/net/phy/b53/b53_regs.h   |  28 +++
  3 files changed, 326 insertions(+)

 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 bdd4006..ab7604a 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
 @@ -464,6 +464,155 @@ out:
 b53_write16(dev, B53_MGMT_PAGE, B53_MIRROR_CTRL, port_mirror_ctrl);
  }

 +static int b53_wait_arl_table_rw_done(struct b53_device *dev)
 +{
 +   u8 i;
 +
 +   for (i = 0; i  10; i++) {
 +   u8 arl_rw_ctrl;
 +   b53_read8(dev, B53_ARLIO_PAGE, B53_ARLTBL_RW_CTRL,
 arl_rw_ctrl);
 +
 +   if (!(arl_rw_ctrl  B53_ARLTBL_DONE))
 +   return 0;
 +
 +   mdelay(1);
 +   }
 +   return -EINVAL;
 +}
 +
 +static int b53_read_arl_table_entry(struct b53_device *dev,
 +   u64 mac_match, u16 vid_match, u32 *arl_entry, u8
 *idx)
 +{
 +   u8 i;
 +
 +   if (b53_wait_arl_table_rw_done(dev))
 +   return -EINVAL;
 +
 +   for (i = 0; i = 3; i++) {
 +   u64 mv;
 +   u32 en;
 +   u8 *m = (u8 *)mv;
 +
 +   b53_read64(dev, B53_ARLIO_PAGE,
 B53_ARLTBL_MAC_VID_ENTRY(i), mv);
 +   b53_read32(dev, B53_ARLIO_PAGE, B53_ARLTBL_DATA_ENTRY(i),
 en);
 +   pr_info(ARL Entry(%u) %08x MAC/VID: %02x:%02x
 %02x:%02x:%02x:%02x:%02x:%02x\n,
 +   i, en, m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7]);
 +   if (!(en  B53_ARLTBL_VALID))
 +   continue;
 +   if (B53_ARLTBL_MACADDR(mv) != mac_match)
 +   continue;
 +   if (dev-enable_vlan  (B53_ARLTBL_VID_GET(mv) !=
 vid_match))
 +   continue;
 +   *idx = i;
 +   *arl_entry = en;
 +   return 0;
 +   }
 +
 +   return -EINVAL;
 +}
 +
 +static inline void b53_arl_entry_to_arl_ops(struct b53_arl_ops *ops, u32
 arl_entry)
 +{
 +   ops-age_set = 0;
 +   ops-valid_set = 0;
 +   ops-static_set = 0;
 +   ops-ports_set = 0;
 +   ops-valid = !!(arl_entry  B53_ARLTBL_VALID);
 +   ops-static_ = !!(arl_entry  B53_ARLTBL_STATIC);
 +   ops-age = !!(arl_entry  B53_ARLTBL_AGE);
 +   ops-ports = (arl_entry  0x1ff);
 +}
 +
 +static inline void b53_arl_ops_to_arl_entry(struct b53_arl_ops *ops, u32
 *arl_entry)
 +{
 +   

Re: [OpenWrt-Devel] Maintaining apcupsd-package

2015-02-23 Thread Ted Hess

Kevin -

In addition to what Alex said, be sure to read and comply with 
CONTRIBUTING.md at:

https://github.com/openwrt/packages/blob/master/CONTRIBUTING.md

Thanks for your interest,
/ted

-Original Message- 
Date: Mon, 23 Feb 2015 08:57:18 +0200

From: Alexandru Ardelean ardeleana...@gmail.com
To: kolbr...@dolphin-it.de
Cc: OpenWrt Development List openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] Maintaining apcupsd-package
Message-ID:
CA+U=DsqbRH079SwwD1eez4WJ7k63MbgUb5WnXEG=jcps7hd...@mail.gmail.com
Content-Type: text/plain; charset=utf-8

Hello,

The current packages repo is on Github and the apcupsd package is already
there (since 2 days ago apparently).
The link:
https://github.com/openwrt/packages/tree/master/net/apcupsd

You can do pull requests to the package repo (and review them with the
maintainer) if you want some specifics.

Cheers
Alex


On Mon, Feb 23, 2015 at 3:03 AM, kolbr...@dolphin-it.de wrote:


Good morning to all openwrt-devs,

I would like to update and maintain the apcupsd-package. The current
version is outdated. My company is building device firmwares based on this
and other packages, so we want to join Openwrt and help keeping things
going.

Thanks and with best regards,
Kevin
___
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


[OpenWrt-Devel] [PATCH 3/3][RESEND] b53: implement ARL Table read/write operations

2015-02-23 Thread Alexandru Ardelean
From: Alexandru Ardelean ardeleana...@gmail.com

Read/Write operations for the ARL table.
To use it:
   swconfig dev switch0 set arl rd XX:XX:XX:XX:XX:XX vid 
   swconfig dev switch0 get arl

Output should be:
  ARL Operation: Read
MAC: XX:XX:XX:XX:XX:XX
VLAN ID: 
Valid: 1
Age: 1
Static: 0
Port(s): 001

Reading/Writing the ARL table is a bit complex of an operation,
so string parsing is used.
The idea is that this uses swconfig 'set' prepare a r/w operation
and swconfig 'get' to execute an operation.
Not the most elegant approach, but it works fairly well for a
debugging operation using b53 hardware.

There are 3 op codes: rd, wr and cl. 'cl' clears any previous rd/wr.
This parsing is stupid simple, so any spaces, cases and quotes matter.
If a operation failed, the output will be 'failed' and the kernel
log can be consulted. The kernel log can also be consulted for
various messages that may have been printed during a r/w operation.

For 'rd' and 'wr' ops
 - if VLAN not enabled, only the MAC address is required
 - if VLAN is enabled, both MAC and VLAN ID are required

Commands:
 - swconfig dev switch0 set arl cl - clear any prev op; no 'get' call required
 - swconfig dev switch0 set arl rd MAC VID - the call 'get',
 if output is 'failed' check kernel log
 - swconfig dev switch0 set arl rd MAC VID \
   [static 0/1] [age 0/1] [valid 0/1] [ports NNN]

The write operation takes parameters, static, age and valid, which
are bits that can be set/modified in the ARL table.

The ports must field is dependant on the type of MAC.
 - for unicat MACs, ports is a port number
 - for multicast MACs, ports is a bitmask for ports on which to forward
This is the same meaning when reading MAC/VID entries.

Signed-off-by: Alexandru Ardelean ardeleana...@gmail.com
---
 .../generic/files/drivers/net/phy/b53/b53_common.c | 278 +
 .../generic/files/drivers/net/phy/b53/b53_priv.h   |  20 ++
 .../generic/files/drivers/net/phy/b53/b53_regs.h   |  28 +++
 3 files changed, 326 insertions(+)

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 4abc8c3..fd1e78a 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
@@ -464,6 +464,155 @@ out:
b53_write16(dev, B53_MGMT_PAGE, B53_MIRROR_CTRL, port_mirror_ctrl);
 }
 
+static int b53_wait_arl_table_rw_done(struct b53_device *dev)
+{
+   u8 i;
+
+   for (i = 0; i  10; i++) {
+   u8 arl_rw_ctrl;
+   b53_read8(dev, B53_ARLIO_PAGE, B53_ARLTBL_RW_CTRL, 
arl_rw_ctrl);
+
+   if (!(arl_rw_ctrl  B53_ARLTBL_DONE))
+   return 0;
+
+   mdelay(1);
+   }
+   return -EINVAL;
+}
+
+static int b53_read_arl_table_entry(struct b53_device *dev,
+   u64 mac_match, u16 vid_match, u32 *arl_entry, u8 *idx)
+{
+   u8 i;
+
+   if (b53_wait_arl_table_rw_done(dev))
+   return -EINVAL;
+
+   for (i = 0; i = 3; i++) {
+   u64 mv;
+   u32 en;
+   u8 *m = (u8 *)mv;
+
+   b53_read64(dev, B53_ARLIO_PAGE, B53_ARLTBL_MAC_VID_ENTRY(i), 
mv);
+   b53_read32(dev, B53_ARLIO_PAGE, B53_ARLTBL_DATA_ENTRY(i), en);
+   pr_info(ARL Entry(%u) %08x MAC/VID: %02x:%02x 
%02x:%02x:%02x:%02x:%02x:%02x\n,
+   i, en, m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7]);
+   if (!(en  B53_ARLTBL_VALID))
+   continue;
+   if (B53_ARLTBL_MACADDR(mv) != mac_match)
+   continue;
+   if (dev-enable_vlan  (B53_ARLTBL_VID_GET(mv) != vid_match))
+   continue;
+   *idx = i;
+   *arl_entry = en;
+   return 0;
+   }
+
+   return -EINVAL;
+}
+
+static inline void b53_arl_entry_to_arl_ops(struct b53_arl_ops *ops, u32 
arl_entry)
+{
+   ops-age_set = 0;
+   ops-valid_set = 0;
+   ops-static_set = 0;
+   ops-ports_set = 0;
+   ops-valid = !!(arl_entry  B53_ARLTBL_VALID);
+   ops-static_ = !!(arl_entry  B53_ARLTBL_STATIC);
+   ops-age = !!(arl_entry  B53_ARLTBL_AGE);
+   ops-ports = (arl_entry  0x1ff);
+}
+
+static inline void b53_arl_ops_to_arl_entry(struct b53_arl_ops *ops, u32 
*arl_entry)
+{
+   if (ops-valid_set)
+   *arl_entry = (ops-valid) ? (*arl_entry | B53_ARLTBL_VALID) :
+   (*arl_entry  ~B53_ARLTBL_VALID);
+   if (ops-static_set)
+   *arl_entry = (ops-static_) ? (*arl_entry | B53_ARLTBL_STATIC) :
+ (*arl_entry  ~B53_ARLTBL_STATIC);
+   if (ops-age_set)
+   *arl_entry = (ops-age) ? (*arl_entry | B53_ARLTBL_AGE) :
+ (*arl_entry  ~B53_ARLTBL_AGE);
+   if (ops-ports_set) {
+  

[OpenWrt-Devel] [PATCH] mpc85xx: add 3.19 support

2015-02-23 Thread Heiner Kallweit
It took very little to make the TL-WDR4900 work under 3.19:
- config is the same as for 3.18
- only patch 210 had to be refreshed, the other patches are
  the same as for 3.18
- in /etc/config/wireless the path options need to be prefixed
  with platform/ ('platform/ffe09000.pci/...')

Signed-off-by: Heiner Kallweit hkallwe...@gmail.com
---
 target/linux/mpc85xx/config-3.19   | 297 ++
 ...erpc-85xx-add-gpio-keys-to-of-match-table.patch |  10 +
 .../patches-3.19/100-fix_mpc8568e_mds.patch|  32 ++
 .../mpc85xx/patches-3.19/110-fix_mpc8548_cds.patch |  40 ++
 .../120-mpc8548_cds_i8259_noirq_init.patch |  23 +
 .../130-mpc8548_cds_disable_i8259_irq.patch|  13 +
 .../140-powerpc-85xx-tl-wdr4900-v1-support.patch   | 615 +
 .../142-add-mpic-timer-clock-frequency.patch   |  48 ++
 .../150-powerpc-85xx-fix-etsec-ranges.patch|  30 +
 ...210-spi-fsl-espi-preallocate-local-buffer.patch | 154 ++
 10 files changed, 1262 insertions(+)
 create mode 100644 target/linux/mpc85xx/config-3.19
 create mode 100644 
target/linux/mpc85xx/patches-3.19/001-powerpc-85xx-add-gpio-keys-to-of-match-table.patch
 create mode 100644 target/linux/mpc85xx/patches-3.19/100-fix_mpc8568e_mds.patch
 create mode 100644 target/linux/mpc85xx/patches-3.19/110-fix_mpc8548_cds.patch
 create mode 100644 
target/linux/mpc85xx/patches-3.19/120-mpc8548_cds_i8259_noirq_init.patch
 create mode 100644 
target/linux/mpc85xx/patches-3.19/130-mpc8548_cds_disable_i8259_irq.patch
 create mode 100644 
target/linux/mpc85xx/patches-3.19/140-powerpc-85xx-tl-wdr4900-v1-support.patch
 create mode 100644 
target/linux/mpc85xx/patches-3.19/142-add-mpic-timer-clock-frequency.patch
 create mode 100644 
target/linux/mpc85xx/patches-3.19/150-powerpc-85xx-fix-etsec-ranges.patch
 create mode 100644 
target/linux/mpc85xx/patches-3.19/210-spi-fsl-espi-preallocate-local-buffer.patch

diff --git a/target/linux/mpc85xx/config-3.19 b/target/linux/mpc85xx/config-3.19
new file mode 100644
index 000..9535301
--- /dev/null
+++ b/target/linux/mpc85xx/config-3.19
@@ -0,0 +1,297 @@
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_ADVANCED_OPTIONS is not set
+CONFIG_AR8216_PHY=y
+CONFIG_AR8216_PHY_LEDS=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
+CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_ARCH_HAS_SG_CHAIN=y
+CONFIG_ARCH_HAS_WALK_MEMORY=y
+CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
+# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
+# CONFIG_ARCH_RANDOM is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
+CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
+CONFIG_ARCH_SUPPORTS_UPROBES=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_USE_BUILTIN_BSWAP=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+CONFIG_AUDIT_ARCH=y
+CONFIG_BOOKE=y
+CONFIG_BOUNCE=y
+# CONFIG_BSC9131_RDB is not set
+# CONFIG_BSC9132_QDS is not set
+# CONFIG_C293_PCIE is not set
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CMDLINE=console=ttyS0,115200
+CONFIG_CMDLINE_BOOL=y
+# CONFIG_CORENET_GENERIC is not set
+# CONFIG_CPM2 is not set
+CONFIG_CPU_BIG_ENDIAN=y
+# CONFIG_CPU_LITTLE_ENDIAN is not set
+# CONFIG_CRYPTO_SHA1_PPC is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEFAULT_UIMAGE=y
+CONFIG_DEVKMEM=y
+CONFIG_DNOTIFY=y
+CONFIG_DTC=y
+# CONFIG_E200 is not set
+CONFIG_E500=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_ENABLE_MUST_CHECK=y
+# CONFIG_EPAPR_BOOT is not set
+CONFIG_ETHERNET_PACKET_MANGLE=y
+CONFIG_FSL_BOOKE=y
+CONFIG_FSL_EMB_PERFMON=y
+CONFIG_FSL_LBC=y
+CONFIG_FSL_PCI=y
+CONFIG_FSL_PQ_MDIO=y
+CONFIG_FSL_SOC=y
+CONFIG_FSL_SOC_BOOKE=y
+CONFIG_FSL_ULI1575=y
+CONFIG_GENERIC_ATOMIC64=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+# CONFIG_GENERIC_CSUM is not set
+CONFIG_GENERIC_IO=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_STRNCPY_FROM_USER=y
+CONFIG_GENERIC_STRNLEN_USER=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_GENERIC_TIME_VSYSCALL_OLD=y
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_GE_FPGA is not set
+# CONFIG_GE_IMP3A is not set
+CONFIG_GIANFAR=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_DEVRES=y
+CONFIG_GPIO_MPC8XXX=y
+CONFIG_GPIO_SYSFS=y
+# CONFIG_HAMRADIO is not set
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT_MAP=y
+CONFIG_HAS_RAPIDIO=y
+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
+CONFIG_HAVE_ARCH_AUDITSYSCALL=y
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_DMA_ATTRS=y

Re: [OpenWrt-Devel] lantiq v3.18

2015-02-23 Thread John Crispin
could you also show me the bootlog on 3.14 please

On 22/02/2015 20:40, Roger Pueyo Centelles wrote:
 Sure.
 
 U-Boot 2013.10-openwrt5-00014-g0b78b5c-dirty (Mar 11 2014 - 22:56:27) 
 arv7519rw
 
 Board: Lantiq ARV7519RW VRX200 Family Board
 SoC:   Lantiq VRX288 v1.1
 CPU:   500 MHz
 IO:250 MHz
 BUS:   250 MHz
 BOOT:  NOR
 DRAM:  128 MiB
 Flash: 32 MiB
 In:serial
 Out:   serial
 Err:   serial
 Net:   ltq-eth
 Hit any key to stop autoboot:  0
 ## Booting kernel from Legacy Image at b008 ...
Image Name:   MIPS OpenWrt Linux-3.18.7
Created:  2015-02-22  11:56:23 UTC
Image Type:   MIPS Linux Kernel Image (lzma compressed)
Data Size:1546993 Bytes = 1.5 MiB
Load Address: 80002000
Entry Point:  80002000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
 
 Starting kernel ...
 
 [0.00] Linux version 3.18.7 (lordroger@xeon) (gcc version
 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r44507) ) #1 Sun Feb 22 12:56:14
 CET 2015
 [0.00] SoC: VR9 rev 1.1
 [0.00] bootconsole [early0] enabled
 [0.00] CPU0 revision is: 00019555 (MIPS 34Kc)
 [0.00] MIPS: machine is ARV7519RW22 - Astoria Networks 
 ARV7519RW22-A-LT
 [0.00] Determined physical RAM map:
 [0.00]  memory: 0800 @  (usable)
 [0.00] Initrd not found or empty - disabling initrd
 [0.00] Zone ranges:
 [0.00]   Normal   [mem 0x-0x07ff]
 [0.00] Movable zone start for each node
 [0.00] Early memory node ranges
 [0.00]   node   0: [mem 0x-0x07ff]
 [0.00] Initmem setup node 0 [mem 0x-0x07ff]
 [0.00] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
 [0.00] Primary data cache 32kB, 4-way, VIPT, cache aliases,
 linesize 32 bytes
 [0.00] Built 1 zonelists in Zone order, mobility grouping on.
 Total pages: 32512
 [0.00] Kernel command line: console=ttyLTQ0,115200 init=/etc/preinit
 [0.00] PID hash table entries: 512 (order: -1, 2048 bytes)
 [0.00] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
 [0.00] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
 [0.00] Writing ErrCtl register=00044751
 [0.00] Readback ErrCtl register=00044751
 [0.00] Memory: 125044K/131072K available (3312K kernel code,
 147K rwdata, 932K rodata, 196K init, 205K bss, 6028K reserved)
 [0.00] NR_IRQS:256
 [0.00] CPU Clock: 500MHz
 [0.00] Calibrating delay loop... 332.54 BogoMIPS (lpj=665088)
 [0.032000] pid_max: default: 32768 minimum: 301
 [0.036000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
 [0.04] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 
 bytes)
 [0.044000] pinctrl core: initialized pinctrl subsystem
 [0.048000] NET: Registered protocol family 16
 [0.056000] pinctrl-xway 1e100b10.pinmux: Init done
 [0.06] dma-xway 1e104100.dma: Init done - hw rev: 7, ports: 7,
 channels: 28
 [0.064000] dcdc-xrx200 1f106a00.dcdc: Core Voltage : 1016 mV
 [0.088000] usbcore: registered new interface driver usbfs
 [0.092000] usbcore: registered new interface driver hub
 [0.096000] usbcore: registered new device driver usb
 [0.10] Switched to clocksource MIPS
 [0.104000] NET: Registered protocol family 2
 [0.108000] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
 [0.116000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
 [0.124000] TCP: Hash tables configured (established 1024 bind 1024)
 [0.128000] TCP: reno registered
 [0.132000] UDP hash table entries: 256 (order: 0, 4096 bytes)
 [0.136000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
 [0.144000] NET: Registered protocol family 1
 [0.148000] gptu: totally 6 16-bit timers/counters
 [0.152000] gptu: misc_register on minor 63
 [0.156000] gptu: succeeded to request irq 126
 [0.164000] gptu: succeeded to request irq 127
 [0.168000] gptu: succeeded to request irq 128
 [0.172000] gptu: succeeded to request irq 129
 [0.176000] gptu: succeeded to request irq 130
 [0.18] gptu: succeeded to request irq 131
 [0.184000] phy-xrx200 gphy-xrx200: requesting lantiq/vr9_phy22f_a1x.bin
 [0.192000] phy-xrx200 gphy-xrx200: booting GPHY0 firmware at 790
 [0.20] phy-xrx200 gphy-xrx200: booting GPHY1 firmware at 790
 [0.308000] futex hash table entries: 256 (order: -1, 3072 bytes)
 [0.316000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
 [0.32] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME)
 (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
 [0.332000] msgmni has been set to 244
 [0.336000] io scheduler noop registered
 [0.34] io scheduler deadline registered (default)
 [0.344000] 1e100c00.serial: ttyLTQ0 at MMIO 0x1e100c00 (irq = 112,
 base_baud = 0) is a lantiq,asc
 [

Re: [OpenWrt-Devel] Status of Siemens Gigaset 604 IL (IL)

2015-02-23 Thread Genghis Khan
Hello Ben,

I will do as you wish. Since I am new to this, I guess that my first
messages, in regard to installation, would annoy rather than being
useful to most of you.

 Sent: Monday, February 23, 2015 at 6:45 PM
 From: Ben Mulvihill ben.mulvih...@gmail.com
 To: Genghis Khan genghisk...@gmx.ca
 Cc: Daniel Golle dan...@makrotopia.org, openwrt-devel@lists.openwrt.org
 Subject: Re: [OpenWrt-Devel] Status of Siemens Gigaset 604 IL (IL)

 
  How would you like to continue this discussion? (by Email, privately,
  or in forum)
 
 Having contributed to Home Hub 2B support, I'd be interested in 
 following this discussion. So can you keep it public if possible?
 If I can make any useful suggestions I will, although I don't 
 promise to be a great help.
 
 Thanks,
 
 Ben
 
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/4] ipq806x: enable GMAC support in DTS

2015-02-23 Thread Mathieu Olivari
This adds the GMAC entries in the ipq806x dtsi file as well as in the
ap148 specific dts file.

This also adds the MDIO change as well.

Signed-off-by: Mathieu Olivari math...@codeaurora.org
---
 .../ipq806x/patches/700-add-gmac-dts-suport.patch  | 172 +
 1 file changed, 172 insertions(+)
 create mode 100644 target/linux/ipq806x/patches/700-add-gmac-dts-suport.patch

diff --git a/target/linux/ipq806x/patches/700-add-gmac-dts-suport.patch 
b/target/linux/ipq806x/patches/700-add-gmac-dts-suport.patch
new file mode 100644
index 000..89ebe66
--- /dev/null
+++ b/target/linux/ipq806x/patches/700-add-gmac-dts-suport.patch
@@ -0,0 +1,172 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -18,8 +18,15 @@
+   bootargs = console=ttyMSM0,115200 root=/dev/mtdblock12 
rootfstype=squashfs,jffs2;
+   };
+ 
++  aliases {
++  mdio-gpio0 = mdio0;
++  };
++
+   soc {
+   pinmux@80 {
++  pinctrl-0 = mdio0_pins rgmii2_pins;
++  pinctrl-names = default;
++
+   i2c4_pins: i2c4_pinmux {
+   pins = gpio12, gpio13;
+   function = gsbi4;
+@@ -34,6 +41,25 @@
+   bias-none;
+   };
+   };
++
++  mdio0_pins: mdio0_pins {
++  mux {
++  pins = gpio0, gpio1;
++  function = gpio;
++  drive-strength = 8;
++  bias-disable;
++  };
++  };
++
++  rgmii2_pins: rgmii2_pins {
++  mux {
++  pins = gpio27, gpio28, gpio29, 
gpio30, gpio31, gpio32,
++ gpio51, gpio52, gpio59, 
gpio60, gpio61, gpio62 ;
++  function = rgmii2;
++  drive-strength = 8;
++  bias-disable;
++  };
++  };
+   };
+ 
+   gsbi@1630 {
+@@ -72,6 +98,7 @@
+   #size-cells = 1;
+   spi-max-frequency = 5000;
+   reg = 0;
++  m25p,fast-read;
+ 
+   partition@0 {
+   label = 0:SBL1;
+@@ -148,5 +175,66 @@
+   sata@2900 {
+   status = ok;
+   };
++
++  mdio0: mdio {
++  compatible = virtual,mdio-gpio;
++  #address-cells = 1;
++  #size-cells = 0;
++  gpios = qcom_pinmux 1 0 qcom_pinmux 0 0;
++
++  phy0: ethernet-phy@0 {
++  device_type = ethernet-phy;
++  reg = 0;
++  qca,ar8327-initvals = 
++  0x4 0x760   /* PAD0_MODE */
++  0x8 0x100   /* PAD5_MODE */
++  0xc 0x80/* PAD6_MODE */
++  0x000e4 0xaa545 /* MAC_POWER_SEL */
++  0x000e0 0xc74164de  /* SGMII_CTRL */
++  0x0007c 0x4e/* PORT0_STATUS */
++  0x00094 0x4e/* PORT6_STATUS */
++  ;
++  };
++
++  phy4: ethernet-phy@4 {
++  device_type = ethernet-phy;
++  reg = 4;
++  };
++  };
++
++  nss-gmac-common {
++  reg = 0x0300 0x 0x1bb0 0x 
0x0090 0x4000;
++  reg-names = nss_reg_base , qsgmii_reg_base, 
clk_ctl_base;
++  };
++
++  gmac1: ethernet@3720 {
++  status = ok;
++  phy-mode = rgmii;
++  qcom,id = 1;
++  qcom,phy_mdio_addr = 4;
++  qcom,poll_required = 1;
++  qcom,rgmii_delay = 0;
++  qcom,emulation = 0;
++  qcom,forced_speed = 1000;
++  qcom,forced_duplex = 1;
++  qcom,socver = 0;
++  local-mac-address = [];
++  mdiobus = mdio0;
++  };
++
++  gmac2: ethernet@3740 {
++  

[OpenWrt-Devel] I can't receive mail anymore

2015-02-23 Thread Farid Farid
Dear Admin,
I used to get mail from openwrt-devel list but  I can't receive them any more.
I enabled my account to receive the mail.
I appreciate if you enable my account.
My e-mail address is : farid21...@yahoo.com

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


[OpenWrt-Devel] [PATCH 4/4] ipq806x: initialize the network on AP148

2015-02-23 Thread Mathieu Olivari
Signed-off-by: Mathieu Olivari math...@codeaurora.org
---
 .../ipq806x/base-files/etc/uci-defaults/network| 32 ++
 1 file changed, 32 insertions(+)
 create mode 100755 target/linux/ipq806x/base-files/etc/uci-defaults/network

diff --git a/target/linux/ipq806x/base-files/etc/uci-defaults/network 
b/target/linux/ipq806x/base-files/etc/uci-defaults/network
new file mode 100755
index 000..34e9fe4
--- /dev/null
+++ b/target/linux/ipq806x/base-files/etc/uci-defaults/network
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# Copyright (c) 2015 The Linux Foundation. All rights reserved.
+# Copyright (C) 2011 OpenWrt.org
+#
+
+[ -e /etc/config/network ]  exit 0
+
+touch /etc/config/network
+
+. /lib/functions/uci-defaults.sh
+. /lib/ipq806x.sh
+
+ucidef_set_interface_loopback
+
+board=$(ipq806x_board_name)
+
+case $board in
+ap148)
+   ucidef_set_interfaces_lan_wan eth1 eth0
+   ucidef_add_switch switch0 1 1
+   ucidef_add_switch_vlan switch0 1 6 1 2 3 4
+   ucidef_add_switch_vlan switch0 2 0 5
+   ;;
+*)
+   echo Unsupported hardware. Network interfaces not intialized
+   ;;
+esac
+
+uci commit network
+
+exit 0
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/4] ipq806x: enable ar8xxx switch family support

2015-02-23 Thread Mathieu Olivari
Signed-off-by: Mathieu Olivari math...@codeaurora.org
---
 target/linux/ipq806x/config-3.18 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 7cda416..51f2de7 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -3,6 +3,7 @@ CONFIG_ALIGNMENT_TRAP=y
 # CONFIG_APM_EMULATION is not set
 CONFIG_APQ_GCC_8084=y
 CONFIG_APQ_MMCC_8084=y
+CONFIG_AR8216_PHY=y
 CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
 CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
 CONFIG_ARCH_HAS_SG_CHAIN=y
@@ -103,7 +104,9 @@ CONFIG_DTC=y
 # CONFIG_DW_DMAC_PCI is not set
 CONFIG_DYNAMIC_DEBUG=y
 # CONFIG_EMAC_ROCKCHIP is not set
+CONFIG_ETHERNET_PACKET_MANGLE=y
 CONFIG_FREEZER=y
+CONFIG_FW_LOADER_USER_HELPER=y
 CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_CLOCKEVENTS=y
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/4] kernel: add qca-nss-gmac as a new module

2015-02-23 Thread Mathieu Olivari
This driver is used on IPQ806x to instanciate  drive the ethernet
interfaces.

Signed-off-by: Mathieu Olivari math...@codeaurora.org
---
 package/kernel/qca-nss-gmac/Makefile | 50 
 1 file changed, 50 insertions(+)
 create mode 100644 package/kernel/qca-nss-gmac/Makefile

diff --git a/package/kernel/qca-nss-gmac/Makefile 
b/package/kernel/qca-nss-gmac/Makefile
new file mode 100644
index 000..d994770
--- /dev/null
+++ b/package/kernel/qca-nss-gmac/Makefile
@@ -0,0 +1,50 @@
+#
+# Copyright (c) 2015 The Linux Foundation. All rights reserved.
+#
+
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=qca-nss-gmac
+PKG_VERSION:=20150210
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=git://codeaurora.org/quic/qsdk/oss/lklm/nss-gmac
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=969aab0aff40a3a5afe70d0f00e783b1c57aaea6
+
+PKG_LICENSE:=ISC
+
+include $(INCLUDE_DIR)/package.mk
+
+define KernelPackage/qca-nss-gmac
+  SECTION:=kernel
+  CATEGORY:=Kernel modules
+  SUBMENU:=Network Devices
+  DEPENDS:=@TARGET_ipq806x
+  TITLE:=Kernel driver for NSS gmac
+  FILES:=$(PKG_BUILD_DIR)/ipq806x/qca-nss-gmac.ko
+  AUTOLOAD:=$(call AutoProbe,qca-nss-gmac)
+endef
+
+define KernelPackage/qca-nss-gmac/Description
+This package contains a NSS driver for QCA chipset
+endef
+
+EXTRA_CFLAGS+= \
+   -DCONFIG_NSS_DEBUG_LEVEL=4 \
+   -I$(PKG_BUILD_DIR)/nss_hal/include \
+   -I$(PKG_BUILD_DIR)/nss_hal/$(BOARD)
+
+define Build/Compile
+   $(MAKE) -C $(LINUX_DIR) \
+   CROSS_COMPILE=$(TARGET_CROSS) \
+   ARCH=$(LINUX_KARCH) \
+   SUBDIRS=$(PKG_BUILD_DIR) \
+   EXTRA_CFLAGS=$(EXTRA_CFLAGS) \
+   modules
+endef
+
+$(eval $(call KernelPackage,qca-nss-gmac))
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/4] ipq806x: Add ethernet support

2015-02-23 Thread Mathieu Olivari
These 4 changes add ethernet support to IPQ806x. It's using the driver
available on codeaurora.org and updates the corresponding DT information.
Same driver has also been posted to LKML:
https://lkml.org/lkml/2015/1/8/534

Its needs rework for kernel.org upstream acceptance.

Mathieu Olivari (4):
  ipq806x: enable ar8xxx switch family support
  ipq806x: enable GMAC support in DTS
  kernel: add qca-nss-gmac as a new module
  ipq806x: initialize the network on AP148

 package/kernel/qca-nss-gmac/Makefile   |  50 ++
 .../ipq806x/base-files/etc/uci-defaults/network|  32 
 target/linux/ipq806x/config-3.18   |   3 +
 .../ipq806x/patches/700-add-gmac-dts-suport.patch  | 172 +
 4 files changed, 257 insertions(+)
 create mode 100644 package/kernel/qca-nss-gmac/Makefile
 create mode 100755 target/linux/ipq806x/base-files/etc/uci-defaults/network
 create mode 100644 target/linux/ipq806x/patches/700-add-gmac-dts-suport.patch

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


Re: [OpenWrt-Devel] [PATCH] comgt: add hso support

2015-02-23 Thread John Crispin
Hi,

some comments inline

On 22/02/2015 10:19, Cezary Jackiewicz wrote:
 Add HSO support to comgt. This is work of Kyklas (see 
 https://dev.openwrt.org/ticket/6995), tested with Option GTM382.
 
 Signed-off-by: Cezary Jackiewicz cezary.jackiew...@gmail.com
 ---
 
 diff --git a/package/network/utils/comgt/Makefile 
 b/package/network/utils/comgt/Makefile
 index 8fcf54e..1e12b68 100644
 --- a/package/network/utils/comgt/Makefile
 +++ b/package/network/utils/comgt/Makefile
 @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
  
  PKG_NAME:=comgt
  PKG_VERSION:=0.32
 -PKG_RELEASE:=25
 +PKG_RELEASE:=26
  
  PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
  PKG_SOURCE_URL:=@SF/comgt
 @@ -47,6 +47,12 @@ $(call Package/comgt/Default)
DEPENDS:=+comgt
  endef
  
 +define Package/comgt-hso
 +$(call Package/comgt/Default)
 +  TITLE+=HSO Support
 +  DEPENDS:=+comgt +kmod-usb-net +kmod-usb-net-hso
 +endef
 +
  define Package/comgt/description
   comgt is a scripting language interpreter useful for establishing 
   communications on serial lines and through PCMCIA modems as well as GPRS 
 @@ -101,6 +107,17 @@ define Package/comgt-ncm/install
   $(INSTALL_BIN) ./files/ncm.sh $(1)/lib/netifd/proto/ncm.sh
  endef
  
 +define Package/comgt-hso/install
 +$(INSTALL_DIR) $(1)/etc/chatscripts
 +$(INSTALL_DATA) ./files/hso.chat $(1)/etc/chatscripts/hso.chat
 +$(INSTALL_DATA) ./files/hsohup.chat $(1)/etc/chatscripts/hsohup.chat
 +$(INSTALL_DIR) $(1)/etc/gcom
 +$(INSTALL_DATA) ./files/setuser.gcom $(1)/etc/gcom/setuser.gcom
 +$(INSTALL_DIR) $(1)/lib/netifd/proto
 +$(INSTALL_BIN) ./files/hso.sh $(1)/lib/netifd/proto/hso.sh
 +endef
 +
  $(eval $(call BuildPackage,comgt))
  $(eval $(call BuildPackage,comgt-directip))
  $(eval $(call BuildPackage,comgt-ncm))
 +$(eval $(call BuildPackage,comgt-hso))
 diff --git a/package/network/utils/comgt/files/hso.chat 
 b/package/network/utils/comgt/files/hso.chat
 new file mode 100644
 index 000..cb87d5a
 --- /dev/null
 +++ b/package/network/utils/comgt/files/hso.chat
 @@ -0,0 +1,13 @@
 +ABORT   BUSY
 +ABORT   'NO CARRIER'
 +ABORT   ERROR
 +REPORT  CONNECT
 +TIMEOUT 10
 +   ATZ
 +OK   'AT+CGDCONT=2,IP,$USE_APN'
 +SAY  Service Mode $MODE
 +TIMEOUT 30
 +OK   AT_OPSYS=$MODE,2
 +OK   AT_OWANCALL=2,1,0
 +OK   \d\d\d\d\d\dAT_OWANDATA=2
 +OK   
 diff --git a/package/network/utils/comgt/files/hso.sh 
 b/package/network/utils/comgt/files/hso.sh
 new file mode 100644
 index 000..5f10420
 --- /dev/null
 +++ b/package/network/utils/comgt/files/hso.sh
 @@ -0,0 +1,135 @@
 +#!/bin/sh
 +INCLUDE_ONLY=1
 +
 +. ../netifd-proto.sh
 +init_proto $@
 +
 +proto_hso_init_config() {
 +
 + no_device=1
 + available=1
 +
 + proto_config_add_string device
 + proto_config_add_string maxwait
 + proto_config_add_string apn
 + proto_config_add_string pincode
 + proto_config_add_int mtu
 + proto_config_add_string username
 + proto_config_add_string password
 + proto_config_add_string ifname
 +}
 +
 +
 +proto_hso_setup() {
 +
 + local iface=$1
 + local chat=/etc/chatscripts/hso.chat
 +
 + json_get_var device device
 + json_get_var maxwait maxwait
 + maxwait=${maxwait:-20}
 + while [ ! -e $device -a $maxwait -gt 0 ];do # wait for driver loading 
 to catch up
 + maxwait=$(($maxwait - 1))


This bit is correct with the maxwait logic, but below ...

 + sleep 1
 + done
 +
 + json_get_var apn apn
 + json_get_var pincode pincode
 + json_get_var mtu mtu
 + json_get_var service service
 + json_get_var username username
 + json_get_var password password
 + json_get_type ifnametype ifname
 +
 + if [ $ifnametype = array ]
 + then
 + json_select ifname
 + json_get_var ifname 1
 + json_select ..
 + fi
 +
 + if [ $ifnametype = string ]
 + then
 + json_get_var ifname ifname
 + fi
 +
 + # set pin if configured
 + if [ ! -z $pincode ]
 + then
 + PINCODE=$pincode gcom -d $device -s /etc/gcom/setpin.gcom 
 || {
 + echo $iface (hso): Failed to set the PIN code.
 + proto_notify_error $iface PIN_FAILED
 + return 1
 + }
 + fi
 +
 + # set username and password if configured
 + if [ -n $username -a -n $password ]
 + then
 + USER=$username PASS=$password gcom -d $device -s 
 /etc/gcom/setuser.gcom || {
 + echo $iface (hso): Failed to set username and 
 password.
 + proto_notify_error $iface AUTH_FAILED
 + return 1
 + }
 + fi
 +
 + case $service in
 + umts_only) service_mode=1;;
 + gprs_only) service_mode=0;;
 + *) service_mode=3;;
 + esac
 +
 + local pip counter
 + local outputfile=/tmp/hsoout.$$
 + while [ -z $pip -a $counter != --- ]
 + do

there is a weird way to solve 

[OpenWrt-Devel] [PATCH] ipq806x: fix spi read issues observed with SMP enabled

2015-02-23 Thread Mathieu Olivari
This change is fixing the issues observed when booting from NOR flash
with SMP enabled.

Error logs below:
building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of
xref (0 dead, 0 orphan) found.
m25p80 spi32766.0: SPI transfer failed: -110
spi_master spi32766: failed to transfer one message from queue
jffs2: Write of 873 bytes at 0x019001e8 failed. returned 0, retlen 792

Patch is cherry-picked from here:
https://www.codeaurora.org/cgit/quic/qsdk/oss/kernel/linux-msm/commit/drivers/spi/spi-qup.c?h=coconut_20140924id=4faba89e3ffbb1c5f6232651375b9b3212b50f02

More details in the patch file.

Signed-off-by: Mathieu Olivari math...@codeaurora.org
---
 .../003-spi-qup-Ensure-done-detection.patch| 56 ++
 1 file changed, 56 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches/003-spi-qup-Ensure-done-detection.patch

diff --git 
a/target/linux/ipq806x/patches/003-spi-qup-Ensure-done-detection.patch 
b/target/linux/ipq806x/patches/003-spi-qup-Ensure-done-detection.patch
new file mode 100644
index 000..7052227
--- /dev/null
+++ b/target/linux/ipq806x/patches/003-spi-qup-Ensure-done-detection.patch
@@ -0,0 +1,56 @@
+From 4faba89e3ffbb1c5f6232651375b9b3212b50f02 Mon Sep 17 00:00:00 2001
+From: Andy Gross agr...@codeaurora.org
+Date: Thu, 15 Jan 2015 17:56:02 -0800
+Subject: [PATCH] spi: qup: Ensure done detection
+
+This patch fixes an issue where a SPI transaction has completed, but the done
+condition is missed.  This occurs because at the time of interrupt the
+MAX_INPUT_DONE_FLAG is not asserted.  However, in the process of reading blocks
+of data from the FIFO, the last portion of data comes in.
+
+The opflags read at the beginning of the irq handler no longer matches the
+current opflag state.  To get around this condition, the block read function
+should update the opflags so that done detection is correct after the return.
+
+Change-Id: If109e0eeb432f96000d765c4b34dbb2269f8093f
+Signed-off-by: Andy Gross agr...@codeaurora.org
+---
+ drivers/spi/spi-qup.c | 12 +++-
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+--- a/drivers/spi/spi-qup.c
 b/drivers/spi/spi-qup.c
+@@ -298,7 +298,7 @@ static void spi_qup_fifo_write(struct sp
+ }
+ 
+ static void spi_qup_block_read(struct spi_qup *controller,
+-  struct spi_transfer *xfer)
++  struct spi_transfer *xfer, u32 *opflags)
+ {
+   u32 data;
+   u32 reads_per_blk = controller-in_blk_sz  2;
+@@ -327,10 +327,12 @@ static void spi_qup_block_read(struct sp
+ 
+   /*
+* Due to extra stickiness of the QUP_OP_IN_SERVICE_FLAG during block
+-   * reads, it has to be cleared again at the very end
++   * reads, it has to be cleared again at the very end.  However, be sure
++   * to refresh opflags value because MAX_INPUT_DONE_FLAG may now be
++   * present and this is used to determine if transaction is complete
+*/
+-  if (readl_relaxed(controller-base + QUP_OPERATIONAL) 
+-  QUP_OP_MAX_INPUT_DONE_FLAG)
++  *opflags = readl_relaxed(controller-base + QUP_OPERATIONAL);
++  if (*opflags  QUP_OP_MAX_INPUT_DONE_FLAG)
+   writel_relaxed(QUP_OP_IN_SERVICE_FLAG,
+   controller-base + QUP_OPERATIONAL);
+ 
+@@ -633,7 +635,7 @@ static irqreturn_t spi_qup_qup_irq(int i
+   if (!controller-use_dma) {
+   if (opflags  QUP_OP_IN_SERVICE_FLAG) {
+   if (opflags  QUP_OP_IN_BLOCK_READ_REQ)
+-  spi_qup_block_read(controller, xfer);
++  spi_qup_block_read(controller, xfer, opflags);
+   else
+   spi_qup_fifo_read(controller, xfer);
+   }
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel