[OpenWrt-Devel] [PATCH][packages]firewall3: optimize by loading conntrack modules on demand

2013-10-31 Thread Takayuki Kaiso
Now all the firewall modules are loaded at boot time regardless of the user's 
firewall configuration.
Then, performance overhead is so high for low cpu power boards (Ex. soekris 
net4826 with 266MHz)
by this approach and should be better to load modules on demand base. 

This patch allow us to unload unnecessary modules especially for conntrack 
related ones.  
It can decrease the overhead for the config which does not enable NAT, for 
instance.

Signed-off-by: Takayuki Kaiso 

---
package/firewall/files/firewall.init | 44 +
.../patches/010-remove-unnecessary-chain.patch | 101 +
2 files changed, 145 insertions(+)

diff --git a/package/firewall/files/firewall.init 
b/package/firewall/files/firewall.init
index 64e3a8c..6eda74f 100755
--- a/package/firewall/files/firewall.init
+++ b/package/firewall/files/firewall.init
@@ -2,24 +2,68 @@

START=19

+CONNTRACK_ZONES=
+CONNTRACK_MODS="nf_nat_irc nf_conntrack_irc nf_nat_ftp nf_conntrack_ftp 
ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4
nf_defrag_ipv4
+xt_conntrack"
+CONNTRACK_MODS_REVERSE=
+
+fw_zone_check_conntrack() {
+ config_get name $1 name
+ config_get_bool masq $1 masq "0"
+ config_get_bool conntrack $1 conntrack "0"
+ [ "$conntrack" = "1" -o "$masq" = "1" ] && append CONNTRACK_ZONES "$name"
+}
+
+load_conntrack_modules() {
+ for i in $CONNTRACK_MODS; do
+ CONNTRACK_MODS_REVERSE="$i $CONNTRACK_MODS_REVERSE"
+ done
+ for i in $CONNTRACK_MODS_REVERSE; do
+ insmod $i 2>/dev/null;
+ done
+}
+
+unload_conntrack_modules() {
+ for i in $CONNTRACK_MODS; do
+ rmmod $i 2>/dev/null;
+ done
+}
+
+update_firewall_modules() {
+ config_load firewall
+ config_foreach fw_zone_check_conntrack zone
+ if [ -n "$CONNTRACK_ZONES" ]; then
+ echo "loading conntrack modules"
+ load_conntrack_modules
+ else
+ echo "Unloading conntrack modules"
+ unload_conntrack_modules
+ fi
+}
+
boot() {
# Be silent on boot, firewall might be started by hotplug already,
# so don't complain in syslog.
fw3 -q start
+ update_firewall_modules
}

start() {
fw3 start
+ update_firewall_modules
}

stop() {
fw3 flush
+ update_firewall_modules
}

restart() {
fw3 restart
+ update_firewall_modules
}

reload() {
fw3 reload
+ update_firewall_modules
}
diff --git a/package/firewall/patches/010-remove-unnecessary-chain.patch 
b/package/firewall/patches/010-remove-unnecessary-chain.patch
new file mode 100644
index 000..a2991e9
--- /dev/null
+++ b/package/firewall/patches/010-remove-unnecessary-chain.patch
@@ -0,0 +1,101 @@
+--- a/defaults.c
 b/defaults.c
+@@ -138,6 +138,9 @@ fw3_print_default_chains(struct fw3_ipt_
+ if (handle->family == FW3_FAMILY_V6 && defs->disable_ipv6)
+ return;
+
++ if ((handle->table == FW3_TABLE_NAT && !state->enable_nat_table))
++ return;
++
+ if (handle->table == FW3_TABLE_FILTER)
+ {
+ fw3_ipt_set_policy(handle, "INPUT", policy(defs->policy_input));
+@@ -213,6 +216,9 @@ fw3_print_default_head_rules(struct fw3_
+ { 0, NULL },
+ };
+
++ if ((handle->table == FW3_TABLE_NAT && !state->enable_nat_table))
++ return;
++
+ for (tr = rules; tr->chain; tr++)
+ {
+ if (tr->table != handle->table)
+@@ -250,10 +256,13 @@ fw3_print_default_head_rules(struct fw3_
+
+ for (i = 0; i < ARRAY_SIZE(chains); i += 2)
+ {
+- r = fw3_ipt_rule_new(handle);
+- fw3_ipt_rule_extra(r, "-m conntrack --ctstate RELATED,ESTABLISHED");
+- fw3_ipt_rule_target(r, "ACCEPT");
+- fw3_ipt_rule_append(r, chains[i]);
++ if (state->enable_conntrack)
++ {
++ r = fw3_ipt_rule_new(handle);
++ fw3_ipt_rule_extra(r, "-m conntrack --ctstate RELATED,ESTABLISHED");
++ fw3_ipt_rule_target(r, "ACCEPT");
++ fw3_ipt_rule_append(r, chains[i]);
++ }
+
+ if (defs->drop_invalid)
+ {
+--- a/options.h
 b/options.h
+@@ -461,6 +461,8 @@ struct fw3_state
+
+ bool disable_ipsets;
+ bool statefile;
++ bool enable_nat_table;
++ bool enable_conntrack;
+ };
+
+ struct fw3_chain_spec {
+--- a/zones.c
 b/zones.c
+@@ -213,6 +213,13 @@ fw3_load_zones(struct fw3_state *state,
+ {
+ setbit(zone->flags[0], FW3_FLAG_SNAT);
+ zone->conntrack = true;
++ state->enable_nat_table = true;
++ state->enable_conntrack = true;
++ }
++
++ if (zone->conntrack)
++ {
++ state->enable_conntrack = true;
+ }
+
+ if (zone->custom_chains)
+@@ -256,6 +263,9 @@ print_zone_chain(struct fw3_ipt_handle *
+ if (!fw3_is_family(zone, handle->family))
+ return;
+
++ if ((handle->table == FW3_TABLE_NAT && !state->enable_nat_table))
++ return;
++
+ info(" * Zone '%s'", zone->name);
+
+ set(zone->flags, handle->family, handle->table);
+@@ -332,6 +342,9 @@ print_interface_rule(struct fw3_ipt_hand
+ "forward",
+ };
+
++ if ((handle->table == FW3_TABLE_NAT && !state->enable_nat_table))
++ return;
++
+ #define jump_target(t) \
+ ((t == FW3_FLAG_REJECT) ? "reject" : fw3_flag_names[t])
+
+--- a/main.c
 b/main.c
+@@ -50,6 +50,11 @@ build_state(bool runtime)
+ error("Out of memory");
+
+ memset(state, 0, sizeof(*state));
++
++ /* set default status */
++ state->enable_nat_table = false;
++ state->enable_conntrack = false;
++
+ state->uci = uci_

[OpenWrt-Devel] [PATCH 0/1] [package] lispmob 0.3.3

2013-10-31 Thread Vasileios Lakafosis
Dear all,
the recently submitted patch with subject "[PATCH 1/1] [package] lispmob
0.3.3" provides

- RLOC probing (user configurable)
- Experimental NAT traversal support
- Code refactorization to improve support of multihoming deployments with
IPv6 RLOCs
- Several bugfixes

As usual, the updated README file contains full updated documentation.
Specially, take a look at the new "NAT traversal" section.

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


[OpenWrt-Devel] [PATCH] [package] lispmob 0.3.3

2013-10-31 Thread Vasileios Lakafosis
Signed-off-by: Vasileios Lakafosis 
---
 net/lispmob/Makefile | 23 ---
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/net/lispmob/Makefile b/net/lispmob/Makefile
index ecc82d3..8c633e8 100644
--- a/net/lispmob/Makefile
+++ b/net/lispmob/Makefile
@@ -8,9 +8,9 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lispmob
-PKG_REV:=79d14028286c3f3a84283c461c85916a10dff4cb
+PKG_REV:=8ebe5ee4b39bd9ca47b1d4d005a292c031c05bd8
 PKG_VERSION:=0.3
-PKG_RELEASE:=1
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=git://github.com/LISPmob/lispmob.git
@@ -23,28 +23,29 @@ PKG_LICENSE_FILES:=LICENSE
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/lispd/default
+define Package/lispmob/default
   MAINTAINER:=Vasileios Lakafosis 
   URL:=http://lisp.cisco.com/
 endef
 
-define Package/lispd
+define Package/lispmob
   SECTION:=net
   CATEGORY:=Network
   TITLE:=Locator/ID separation protocol (using TUN)
   URL:=https://github.com/LISPmob
   DEPENDS:= +librt +libopenssl +confuse +kmod-tun +uci +kmod-ipv6
-  $(call Package/lispd/default)
+  $(call Package/lispmob/default)
 endef
 
-define Package/lispd/description
-  This packet provides support for the Locator-ID Seperation Protocol.
+define Package/lispmob/description
+  This packet provides support for the Locator-ID Separation Protocol.
 endef
 
-MAKE_FLAGS += \
-   platform=openwrt
+define Build/Compile
+   $(call Build/Compile/Default,platform=openwrt)
+endef
 
-define Package/lispd/install
+define Package/lispmob/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lispd/lispd $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/config
@@ -53,4 +54,4 @@ define Package/lispd/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/openWRT/openwrt.init.script 
$(1)/etc/init.d/lisp
 endef
 
-$(eval $(call BuildPackage,lispd))
+$(eval $(call BuildPackage,lispmob))
-- 
1.7.11.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [v2,2/4] button-hotplug: Add KEY_WLAN handling

2013-10-31 Thread Marcin Jurkowski
This extends button-hotplug to map KEY_WLAN to rfkill hotplug
events, enabling /etc/rc.button/rfkill script to work properly on
routers with KEY_WLAN buttons.
---
 package/kernel/button-hotplug/src/button-hotplug.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/kernel/button-hotplug/src/button-hotplug.c 
b/package/kernel/button-hotplug/src/button-hotplug.c
index 684a0c6..ece65b8 100644
--- a/package/kernel/button-hotplug/src/button-hotplug.c
+++ b/package/kernel/button-hotplug/src/button-hotplug.c
@@ -85,6 +85,9 @@ static struct bh_map button_map[] = {
BH_MAP(BTN_9,   "BTN_9"),
BH_MAP(KEY_RESTART, "reset"),
BH_MAP(KEY_POWER,   "power"),
+#ifdef KEY_WLAN
+   BH_MAP(KEY_WLAN,  "rfkill"),
+#endif /* KEY_WLAN */
 #ifdef KEY_WPS_BUTTON
BH_MAP(KEY_WPS_BUTTON,  "wps"),
 #endif /* KEY_WPS_BUTTON */
-- 
1.8.1.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [v3, 1/4] Add kernel support for Sagemcom F@ST2704V2 ADSL router

2013-10-31 Thread Marcin Jurkowski
This adds kernel support support for Sagemcom F@st 2704 wireless ADSL
router.
It's a BCM6328-based 802.11n wireless router with USB port and ADSL2+
modem equipped with 64 MiB RAM and 8 MiB flash.
---
 .../brcm63xx/patches-3.10/536-board_fast2704.patch | 133 +
 1 file changed, 133 insertions(+)
 create mode 100644 target/linux/brcm63xx/patches-3.10/536-board_fast2704.patch

diff --git a/target/linux/brcm63xx/patches-3.10/536-board_fast2704.patch 
b/target/linux/brcm63xx/patches-3.10/536-board_fast2704.patch
new file mode 100644
index 000..db34932
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.10/536-board_fast2704.patch
@@ -0,0 +1,133 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -1477,6 +1477,122 @@ static struct board_info __initdata boar
+   },
+ };
+ 
++static struct board_info __initdata board_FAST2704V2 = {
++  .name   = "F@ST2704V2",
++  .expected_cpu_id= 0x6328,
++
++  .has_uart0  = 1,
++  .has_pci= 1,
++  .has_ohci0  = 1,
++  .has_ehci0  = 1,
++  .has_usbd   = 1,
++
++  .has_enetsw = 1,
++
++  .enetsw = {
++  .used_ports = {
++  [0] = {
++  .used   = 1,
++  .phy_id = 1,
++  .name   = "Port 1",
++  },
++  [1] = {
++  .used   = 1,
++  .phy_id = 2,
++  .name   = "Port 2",
++  },
++  [2] = {
++  .used   = 1,
++  .phy_id = 3,
++  .name   = "Port 3",
++  },
++  [3] = {
++  .used   = 1,
++  .phy_id = 4,
++  .name   = "Port 4",
++  },
++  },
++  },
++
++  .leds = {
++  /* front LEDs */
++  {
++  .name   = "F@ST2704V2:green:power",
++  .gpio   = 4,
++  .active_low = 1,
++  .default_trigger= "default-on",
++  },
++  {
++  .name   = "F@ST2704V2:red:power",
++  .gpio   = 5,
++  .active_low = 1,
++  },
++  {
++  .name   = "F@ST2704V2:red:inet",
++  .gpio   = 2,
++  .active_low = 1,
++  },
++  {
++  .name   = "F@ST2704V2:green:dsl",
++  .gpio   = 3,
++  .active_low = 1,
++  },
++  {
++  .name   = "F@ST2704V2:green:inet",
++  .gpio   = 11,
++  .active_low = 1,
++  },
++  {
++  .name   = "F@ST2704V2:green:usb",
++  .gpio   = 1,
++  .active_low = 1,
++  },
++
++  /* side button LEDs */
++  {
++  .name   = "F@ST2704V2:green:wps",
++  .gpio   = 10,
++  .active_low = 1,
++  },
++
++  /* FIXME: can't control gpio0 line in "out" state, needs 
further investigation */
++  /*
++  {
++  .name   = "F@ST2704V2:green:rfkill",
++  .gpio   = 0,
++  .active_low = 1,
++  },
++  */
++
++  },
++  .buttons = {
++  {
++  .desc   = "reset",
++  .gpio   = 23,
++  .active_low = 1,
++  .type   = EV_KEY,
++  .code   = KEY_RESTART,
++  .debounce_interval  = 
BCM963XX_KEYS_DEBOUNCE_INTERVAL,
++  },
++  {
++  .desc   = "wps",
++  .gpio   = 24,
++  .active_low = 1,
++  .type   = EV_KEY,
++  .code   = KEY_WPS_BUTTON,
++  

[OpenWrt-Devel] RTSP server for h/264 USB camera

2013-10-31 Thread jonsm...@gmail.com
Is there a tiny RTSP server around somewhere that runs on OpenWRT?

-- 
Jon Smirl
jonsm...@gmail.com
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 4/4] kirkwood: Add userland support for Pogoplug E02

2013-10-31 Thread Luka Perkov
Hi Felix,

On Thu, Oct 31, 2013 at 11:11:56AM +0100, Felix Kaechele wrote:
> This patch adds the userland support for the Pogoplug E02 by Cloud
> Engines, Inc.
> 
> Signed-off-by: Felix Kaechele 
> ---
>  .../kirkwood/base-files/etc/uci-defaults/01_leds|  4 
>  .../kirkwood/base-files/etc/uci-defaults/02_network |  3 +++
>  target/linux/kirkwood/image/Makefile|  3 +++
>  target/linux/kirkwood/profiles/120-pogoplug.mk  | 21 
> +
>  4 files changed, 31 insertions(+)
>  create mode 100644 target/linux/kirkwood/profiles/120-pogoplug.mk

Applied in r38631. Thank you.

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


Re: [OpenWrt-Devel] [PATCH 3/4] kirkwood: add Pogoplug E02 Kernel support

2013-10-31 Thread Luka Perkov
Hi Felix,

On Thu, Oct 31, 2013 at 11:11:55AM +0100, Felix Kaechele wrote:
> This patch adds a DTS file for the Pogoplug E02 by Cloud Engines, Inc.
> 
> Signed-off-by: Felix Kaechele 
> ---
>  .../kirkwood/patches-3.10/120-pogoplug_e02.patch   | 130 
> +
>  1 file changed, 130 insertions(+)
>  create mode 100644 target/linux/kirkwood/patches-3.10/120-pogoplug_e02.patch

Applied in r38630. Thank you.

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


Re: [OpenWrt-Devel] [PATCH] kirkwood: fix some typos

2013-10-31 Thread Luka Perkov
On Thu, Oct 31, 2013 at 11:12:11AM +0100, Felix Kaechele wrote:
> This fixes a typo in the image/Makefile and the profile for the
> RaidSonic ICY BOX IB-NAS62x0 board.
> 
> Signed-off-by: Felix Kaechele 
> ---
>  target/linux/kirkwood/image/Makefile  | 2 +-

Applied with other changes in r38629. Thank you.

>  target/linux/kirkwood/profiles/110-nas.mk | 2 +-

This one is not a typo.

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


[OpenWrt-Devel] [PATCH] gianfar: Fix NAPI poll mechanism in GIANFAR ethernet driver

2013-10-31 Thread Thomas Huehn
This patch fixes the NAPI poll mechanism in the GIANFAR ethernet driver, which
was not properly working since Linus Kernel Version 3,8.
Therefore the workaround patch to downgrade the GIANFAR ethernet driver to
Kernelversion v3.8 is obsoete.
This patch was extensivly testes with different network loads and types of
traffic. There is quite a substantial user base that reports proper Ethernet
function with TPlink-4900. This patch is based on the fixes from GINAFAR
maintainer Claudiu Manoli.

Signed-off-by: Thomas Huehn 
---
 .../patches-3.10/900-fix_gianfar_napi_poll.patch   |  111 
 1 file changed, 111 insertions(+)
 create mode 100644 
target/linux/mpc85xx/patches-3.10/900-fix_gianfar_napi_poll.patch

diff --git a/target/linux/mpc85xx/patches-3.10/900-fix_gianfar_napi_poll.patch 
b/target/linux/mpc85xx/patches-3.10/900-fix_gianfar_napi_poll.patch
new file mode 100644
index 000..cf570c9
--- /dev/null
+++ b/target/linux/mpc85xx/patches-3.10/900-fix_gianfar_napi_poll.patch
@@ -0,0 +1,111 @@
+Index: linux-3.10.15/drivers/net/ethernet/freescale/gianfar.c
+===
+--- linux-3.10.15.orig/drivers/net/ethernet/freescale/gianfar.c
2013-10-05 16:13:21.0 +0200
 linux-3.10.15/drivers/net/ethernet/freescale/gianfar.c 2013-10-16 
13:44:36.469810517 +0200
+@@ -2835,7 +2835,7 @@
+   struct gfar_priv_rx_q *rx_queue = NULL;
+   int work_done = 0, work_done_per_q = 0;
+   int i, budget_per_q = 0;
+-  int has_tx_work;
++  int has_tx_work = 0;
+   unsigned long rstat_rxf;
+   int num_act_queues;
+ 
+@@ -2850,62 +2850,48 @@
+   if (num_act_queues)
+   budget_per_q = budget/num_act_queues;
+ 
+-  while (1) {
+-  has_tx_work = 0;
+-  for_each_set_bit(i, &gfargrp->tx_bit_map, priv->num_tx_queues) {
+-  tx_queue = priv->tx_queue[i];
+-  /* run Tx cleanup to completion */
+-  if (tx_queue->tx_skbuff[tx_queue->skb_dirtytx]) {
+-  gfar_clean_tx_ring(tx_queue);
+-  has_tx_work = 1;
+-  }
+-  }
+-
+-  for_each_set_bit(i, &gfargrp->rx_bit_map, priv->num_rx_queues) {
+-  /* skip queue if not active */
+-  if (!(rstat_rxf & (RSTAT_CLEAR_RXF0 >> i)))
+-  continue;
+-
+-  rx_queue = priv->rx_queue[i];
+-  work_done_per_q =
+-  gfar_clean_rx_ring(rx_queue, budget_per_q);
+-  work_done += work_done_per_q;
+-
+-  /* finished processing this queue */
+-  if (work_done_per_q < budget_per_q) {
+-  /* clear active queue hw indication */
+-  gfar_write(®s->rstat,
+- RSTAT_CLEAR_RXF0 >> i);
+-  rstat_rxf &= ~(RSTAT_CLEAR_RXF0 >> i);
+-  num_act_queues--;
+-
+-  if (!num_act_queues)
+-  break;
+-  /* recompute budget per Rx queue */
+-  budget_per_q =
+-  (budget - work_done) / num_act_queues;
+-  }
++  for_each_set_bit(i, &gfargrp->tx_bit_map, priv->num_tx_queues) {
++  tx_queue = priv->tx_queue[i];
++  /* run Tx cleanup to completion */
++  if (tx_queue->tx_skbuff[tx_queue->skb_dirtytx]) {
++  gfar_clean_tx_ring(tx_queue);
++  has_tx_work = 1;
+   }
++  }
+ 
+-  if (work_done >= budget)
+-  break;
++  for_each_set_bit(i, &gfargrp->rx_bit_map, priv->num_rx_queues) {
++  /* skip queue if not active */
++  if (!(rstat_rxf & (RSTAT_CLEAR_RXF0 >> i)))
++  continue;
++
++  rx_queue = priv->rx_queue[i];
++  work_done_per_q = gfar_clean_rx_ring(rx_queue, budget_per_q);
++  work_done += work_done_per_q;
++
++  /* finished processing this queue */
++  if (work_done_per_q < budget_per_q) {
++  /* clear active queue hw indication */
++  gfar_write(®s->rstat, RSTAT_CLEAR_RXF0 >> i);
++  num_act_queues--;
+ 
+-  if (!num_act_queues && !has_tx_work) {
++  if (!num_act_queues)
++  break;
++  }
++  }
+ 
+-  napi_complete(napi);
++  if (!num_act_queues && !has_tx_work) {
++  napi_complete(napi);
+ 
+-  /* Clear the halt bit in RSTAT */
+-  gfar_write(®s->rstat, gfargrp->rstat);
++

[OpenWrt-Devel] [PATCH 2/4] [package] uboot-envtools: add Pogoplug E02 support

2013-10-31 Thread Felix Kaechele
Add support for the Pogoplug E02 by Cloud Engines, Inc.

Signed-off-by: Felix Kaechele 
---
 package/boot/uboot-envtools/files/kirkwood | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/boot/uboot-envtools/files/kirkwood 
b/package/boot/uboot-envtools/files/kirkwood
index f665d2d..782a5a4 100644
--- a/package/boot/uboot-envtools/files/kirkwood
+++ b/package/boot/uboot-envtools/files/kirkwood
@@ -11,6 +11,9 @@ touch /etc/config/ubootenv
 . /lib/functions.sh
 
 case "`cat /proc/device-tree/model`" in
+"Cloud Engines Pogoplug E02")
+   ubootenv_add_uci_config "/dev/mtd0" "0xc" "0x2" "0x2"
+   ;;
 "RaidSonic ICY BOX IB-NAS62x0 (Rev B)")
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x2" "0x2"
;;
-- 
1.8.3.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] [package] uboot-kirkwood: fix pogo_e02 config

2013-10-31 Thread Felix Kaechele
Fixes the upstream config of the Pogoplug E02 in U-Boot.
This removes some unneeded config options, moves the env offset so that
the original env is kept intact and will not be overwritten as well as
changes the default env options to boot OpenWRT out of the box.

Signed-off-by: Felix Kaechele 
---
 .../patches/130-fix-pogo_e02-config.patch  | 48 ++
 1 file changed, 48 insertions(+)
 create mode 100644 
package/boot/uboot-kirkwood/patches/130-fix-pogo_e02-config.patch

diff --git a/package/boot/uboot-kirkwood/patches/130-fix-pogo_e02-config.patch 
b/package/boot/uboot-kirkwood/patches/130-fix-pogo_e02-config.patch
new file mode 100644
index 000..d8378fd
--- /dev/null
+++ b/package/boot/uboot-kirkwood/patches/130-fix-pogo_e02-config.patch
@@ -0,0 +1,48 @@
+--- a/include/configs/pogo_e02.h
 b/include/configs/pogo_e02.h
+@@ -32,7 +32,6 @@
+  * Commands configuration
+  */
+ #define CONFIG_SYS_NO_FLASH   /* Declare no flash (NOR/SPI) */
+-#define CONFIG_SYS_MVFS
+ #include 
+ #define CONFIG_CMD_DHCP
+ #define CONFIG_CMD_ENV
+@@ -62,23 +61,27 @@
+ #endif
+ 
+ #define CONFIG_ENV_SIZE   0x2 /* 128k */
+-#define CONFIG_ENV_OFFSET 0x6 /* env starts here */
++#define CONFIG_ENV_ADDR   0xC
++#define CONFIG_ENV_OFFSET 0xC /* env starts here */
+ 
+ /*
+  * Default environment variables
+  */
+ #define CONFIG_BOOTCOMMAND \
+-  "setenv bootargs $(bootargs_console); " \
+-  "run bootcmd_usb; " \
+-  "bootm 0x0080 0x0110"
++  "${x_bootcmd_kernel}; " \
++  "setenv bootargs ${x_bootargs} ${x_bootargs_root}; " \
++  "${x_bootcmd_usb}; bootm 0x80;"
++
++#define CONFIG_MTDPARTS \
++  "mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)\0"
+ 
+ #define CONFIG_EXTRA_ENV_SETTINGS \
+-  "mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage)," \
+-  "32M(rootfs),-(data)\0"\
+-  "mtdids=nand0=orion_nand\0"\
+-  "bootargs_console=console=ttyS0,115200\0" \
+-  "bootcmd_usb=usb start; ext2load usb 0:1 0x0080 /uImage; " \
+-  "ext2load usb 0:1 0x0110 /uInitrd\0"
++  "mtdids=nand0=orion_nand\0" \
++  "mtdparts="CONFIG_MTDPARTS \
++  "x_bootargs=console=ttyS0,115200\0" \
++  "x_bootcmd_kernel=nand read 0x80 0x10 0x40\0" \
++  "x_bootargs_root=root=/dev/mtdblock2 rw rootfstype=jffs2\0" \
++  "x_bootcmd_usb=usb start\0"
+ 
+ /*
+  * Ethernet Driver configuration
-- 
1.8.3.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] kirkwood: fix some typos

2013-10-31 Thread Felix Kaechele
This fixes a typo in the image/Makefile and the profile for the
RaidSonic ICY BOX IB-NAS62x0 board.

Signed-off-by: Felix Kaechele 
---
 target/linux/kirkwood/image/Makefile  | 2 +-
 target/linux/kirkwood/profiles/110-nas.mk | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/kirkwood/image/Makefile 
b/target/linux/kirkwood/image/Makefile
index 01a26b5..91b8f3b 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -44,7 +44,7 @@ define Image/BuildKernel/Template
$(CP) $(KDIR)/zImage-initramfs 
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs
cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> 
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs
$(call Image/BuildKernel/MkuImage, \
-   none, 0x8000, 0x8000,
+   none, 0x8000, 0x8000, \
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs, \
$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-uImage-initramfs \
)
diff --git a/target/linux/kirkwood/profiles/110-nas.mk 
b/target/linux/kirkwood/profiles/110-nas.mk
index 28b1802..402053e 100644
--- a/target/linux/kirkwood/profiles/110-nas.mk
+++ b/target/linux/kirkwood/profiles/110-nas.mk
@@ -17,7 +17,7 @@ define Profile/IB62X0/Description
  Package set compatible with RaidSonic ICY BOX IB-NAS62x0 board.
 endef
 
-IB62X0_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096 -U"
+IB62X0_UBIFS_OPTS:="-m 2048 -e 128KiB -c 4096 -U"
 IB62X0_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
 
 $(eval $(call Profile,IB62X0))
-- 
1.8.3.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/4] kirkwood: Add userland support for Pogoplug E02

2013-10-31 Thread Felix Kaechele
This patch adds the userland support for the Pogoplug E02 by Cloud
Engines, Inc.

Signed-off-by: Felix Kaechele 
---
 .../kirkwood/base-files/etc/uci-defaults/01_leds|  4 
 .../kirkwood/base-files/etc/uci-defaults/02_network |  3 +++
 target/linux/kirkwood/image/Makefile|  3 +++
 target/linux/kirkwood/profiles/120-pogoplug.mk  | 21 +
 4 files changed, 31 insertions(+)
 create mode 100644 target/linux/kirkwood/profiles/120-pogoplug.mk

diff --git a/target/linux/kirkwood/base-files/etc/uci-defaults/01_leds 
b/target/linux/kirkwood/base-files/etc/uci-defaults/01_leds
index 7e20188..5c34cd6 100644
--- a/target/linux/kirkwood/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/kirkwood/base-files/etc/uci-defaults/01_leds
@@ -10,6 +10,10 @@ case "`cat /proc/device-tree/model`" in
ucidef_set_led_netdev "eth0" "dockstar:orange:misc" "eth0"
ucidef_set_led_default "health" "dockstar:green:health" "1"
;;
+"Cloud Engines Pogoplug E02")
+   ucidef_set_led_default "health" "status:green:health" "1"
+   ucidef_set_led_default "fault" "status:orange:fault" "1"
+   ;;
 *)
;;
 esac
diff --git a/target/linux/kirkwood/base-files/etc/uci-defaults/02_network 
b/target/linux/kirkwood/base-files/etc/uci-defaults/02_network
index 42724ef..bf95f72 100644
--- a/target/linux/kirkwood/base-files/etc/uci-defaults/02_network
+++ b/target/linux/kirkwood/base-files/etc/uci-defaults/02_network
@@ -32,6 +32,9 @@ case "`cat /proc/device-tree/model`" in
 "RaidSonic ICY BOX IB-NAS62x0 (Rev B)")
set_lan_dhcp "eth0"
;;
+"Cloud Engines Pogoplug E02")
+   set_lan_dhcp "eth0"
+   ;;
 *)
ucidef_set_interface_lan "eth0"
;;
diff --git a/target/linux/kirkwood/image/Makefile 
b/target/linux/kirkwood/image/Makefile
index 94e7bb9..01a26b5 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -100,6 +100,9 @@ Image/InstallKernel/Template/Generic=$(call 
Image/InstallKernel/Template)
 Image/BuildKernel/Template/IB62X0=$(call Image/BuildKernel/Template,ib62x0)
 Image/InstallKernel/Template/IB62X0=$(call Image/InstallKernel/Template,ib62x0)
 
+Image/BuildKernel/Template/POGOE02=$(call Image/BuildKernel/Template,pogo_e02)
+Image/InstallKernel/Template/POGOE02=$(call 
Image/InstallKernel/Template,pogo_e02)
+
 define Image/BuildKernel
$(call Image/BuildKernel/Template/$(PROFILE))
 endef
diff --git a/target/linux/kirkwood/profiles/120-pogoplug.mk 
b/target/linux/kirkwood/profiles/120-pogoplug.mk
new file mode 100644
index 000..0f84249
--- /dev/null
+++ b/target/linux/kirkwood/profiles/120-pogoplug.mk
@@ -0,0 +1,21 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/POGOE02
+  NAME:=Cloud Engines Pogoplug E02
+  PACKAGES:= \
+   kmod-usb2 kmod-usb-storage uboot-envtools
+endef
+
+define Profile/POGOE02/Description
+ Package set compatible with Cloud Engines Pogoplug E02 board.
+endef
+
+POGOE02_UBIFS_OPTS:="-m 2048 -e 128KiB -c 4096 -U"
+POGOE02_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
+
+$(eval $(call Profile,POGOE02))
-- 
1.8.3.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] kirkwood: add Pogoplug E02 Kernel support

2013-10-31 Thread Felix Kaechele
This patch adds a DTS file for the Pogoplug E02 by Cloud Engines, Inc.

Signed-off-by: Felix Kaechele 
---
 .../kirkwood/patches-3.10/120-pogoplug_e02.patch   | 130 +
 1 file changed, 130 insertions(+)
 create mode 100644 target/linux/kirkwood/patches-3.10/120-pogoplug_e02.patch

diff --git a/target/linux/kirkwood/patches-3.10/120-pogoplug_e02.patch 
b/target/linux/kirkwood/patches-3.10/120-pogoplug_e02.patch
new file mode 100644
index 000..5cff4a3
--- /dev/null
+++ b/target/linux/kirkwood/patches-3.10/120-pogoplug_e02.patch
@@ -0,0 +1,130 @@
+--- /dev/null
 b/arch/arm/boot/dts/kirkwood-pogo_e02.dts
+@@ -0,0 +1,117 @@
++/dts-v1/;
++
++/include/ "kirkwood.dtsi"
++/include/ "kirkwood-6281.dtsi"
++
++/ {
++  model = "Cloud Engines Pogoplug E02";
++  compatible = "cloudengines,pogoe02", "marvell,kirkwood-88f6281", 
"marvell,kirkwood";
++
++  memory {
++  device_type = "memory";
++  reg = <0x 0x1000>;
++  };
++
++  chosen {
++  bootargs = "console=ttyS0,115200n8 earlyprintk";
++  };
++
++  ocp@f100 {
++  pinctrl: pinctrl@1 {
++
++  pinctrl-0 = < &pmx_usb_power_enable &pmx_led_orange
++&pmx_led_green >;
++  pinctrl-names = "default";
++
++  pmx_usb_power_enable: pmx-usb-power-enable {
++  marvell,pins = "mpp29";
++  marvell,function = "gpio";
++  };
++  pmx_led_green: pmx-led_green {
++  marvell,pins = "mpp48";
++  marvell,function = "gpio";
++  };
++  pmx_led_orange: pmx-led_orange {
++  marvell,pins = "mpp49";
++  marvell,function = "gpio";
++  };
++  };
++
++  serial@12000 {
++  status = "okay";
++  };
++
++  nand@300 {
++  status = "okay";
++
++  partition@0 {
++  label = "u-boot";
++  reg = <0x000 0x10>;
++  };
++
++  partition@10 {
++  label = "uImage";
++  reg = <0x010 0x40>;
++  };
++
++  partition@50 {
++  label = "rootfs";
++  reg = <0x050 0x200>;
++  };
++
++  partition@250 {
++  label = "data";
++  reg = <0x250 0x5b0>;
++  };
++  };
++  };
++
++  gpio-leds {
++  compatible = "gpio-leds";
++
++  health {
++  label = "status:green:health";
++  gpios = <&gpio1 16 1>;
++  linux,default-trigger = "default-on";
++  };
++  fault {
++  label = "status:orange:fault";
++  gpios = <&gpio1 17 1>;
++  };
++  };
++
++  regulators {
++  compatible = "simple-bus";
++  #address-cells = <1>;
++  #size-cells = <0>;
++
++  usb_power: regulator@1 {
++  compatible = "regulator-fixed";
++  reg = <1>;
++  regulator-name = "USB Power";
++  regulator-min-microvolt = <500>;
++  regulator-max-microvolt = <500>;
++  enable-active-high;
++  regulator-always-on;
++  regulator-boot-on;
++  gpio = <&gpio0 29 0>;
++  };
++  };
++};
++
++&mdio {
++  status = "okay";
++
++  ethphy0: ethernet-phy@0 {
++  device_type = "ethernet-phy";
++  reg = <0>;
++  };
++};
++
++ð0 {
++  status = "okay";
++
++  ethernet0-port@0 {
++  phy-handle = <ðphy0>;
++  };
++};
+--- a/arch/arm/boot/dts/Makefile
 b/arch/arm/boot/dts/Makefile
+@@ -86,6 +86,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-
+   kirkwood-ns2max.dtb \
+   kirkwood-ns2mini.dtb \
+   kirkwood-nsa310.dtb \
++  kirkwood-pogo_e02.dtb \
+   kirkwood-topkick.dtb \
+   kirkwood-ts219-6281.dtb \
+   kirkwood-ts219-6282.dtb \
-- 
1.8.3.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] kirkwood: Add support for the Pogoplug E02

2013-10-31 Thread Felix Kaechele
This adds u-boot/kernel/userspace support for the Pogoplug E02.
TODO: sysupgrade support.

Felix Kaechele (4):
  [package] uboot-kirkwood: fix pogo_e02 config
  [package] uboot-envtools: add Pogoplug E02 support
  kirkwood: add Pogoplug E02 Kernel support
  kirkwood: Add userland support for Pogoplug E02

 package/boot/uboot-envtools/files/kirkwood |   3 +
 .../patches/130-fix-pogo_e02-config.patch  |  48 
 .../kirkwood/base-files/etc/uci-defaults/01_leds   |   4 +
 .../base-files/etc/uci-defaults/02_network |   3 +
 target/linux/kirkwood/image/Makefile   |   3 +
 .../kirkwood/patches-3.10/120-pogoplug_e02.patch   | 130 +
 target/linux/kirkwood/profiles/120-pogoplug.mk |  21 
 7 files changed, 212 insertions(+)
 create mode 100644 
package/boot/uboot-kirkwood/patches/130-fix-pogo_e02-config.patch
 create mode 100644 target/linux/kirkwood/patches-3.10/120-pogoplug_e02.patch
 create mode 100644 target/linux/kirkwood/profiles/120-pogoplug.mk

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


[OpenWrt-Devel] [PATCH 2/2] [package] uboot-kirkwood: enable FDT support

2013-10-31 Thread Felix Kaechele
Enables Flattened Device Tree support in U-Boot for kirkwood.

Signed-off-by: Felix Kaechele 
---
 .../uboot-kirkwood/patches/120-enable-device-tree-support.patch  | 9 +
 1 file changed, 9 insertions(+)
 create mode 100644 
package/boot/uboot-kirkwood/patches/120-enable-device-tree-support.patch

diff --git 
a/package/boot/uboot-kirkwood/patches/120-enable-device-tree-support.patch 
b/package/boot/uboot-kirkwood/patches/120-enable-device-tree-support.patch
new file mode 100644
index 000..8ea8bf1
--- /dev/null
+++ b/package/boot/uboot-kirkwood/patches/120-enable-device-tree-support.patch
@@ -0,0 +1,9 @@
+--- a/include/configs/mv-common.h
 b/include/configs/mv-common.h
+@@ -152,4 +152,6 @@
+ #define CONFIG_LZO
+ #endif
+ 
++#define CONFIG_OF_LIBFDT
++
+ #endif /* _MV_COMMON_H */
-- 
1.8.3.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] [package] uboot-kirkwood: update to 2013.10

2013-10-31 Thread Felix Kaechele
This was tested on a Cloud Engines Pogoplug E02.

Signed-off-by: Felix Kaechele 
---
 package/boot/uboot-kirkwood/Makefile   | 10 +++---
 package/boot/uboot-kirkwood/patches/110-dockstar.patch |  4 ++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/package/boot/uboot-kirkwood/Makefile 
b/package/boot/uboot-kirkwood/Makefile
index 375d115..d8bf984 100644
--- a/package/boot/uboot-kirkwood/Makefile
+++ b/package/boot/uboot-kirkwood/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=u-boot
-PKG_VERSION:=2012.10
+PKG_VERSION:=2013.10
 PKG_RELEASE:=1
 
 
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
@@ -16,7 +16,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:= \
http://mirror2.openwrt.org/sources \
ftp://ftp.denx.de/pub/u-boot
-PKG_MD5SUM:=8655f63b1e5c4647295ac9ce44660be3
+PKG_MD5SUM:=a076a044b64371edc52f7e562b13f6b2
 PKG_TARGETS:=bin
 
 include $(INCLUDE_DIR)/package.mk
@@ -43,7 +43,11 @@ define uboot/ib62x0
   TITLE:=U-Boot for the RaidSonic ICY BOX NAS6210 and NAS6220
 endef
 
-UBOOTS:=sheevaplug dockstar iconnect ib62x0
+define uboot/pogo_e02
+  TITLE:=U-Boot for the Cloud Engines Pogoplug E02
+endef
+
+UBOOTS:=sheevaplug dockstar iconnect ib62x0 pogo_e02
 
 define Package/uboot/template
 define Package/uboot-kirkwood-$(1)
diff --git a/package/boot/uboot-kirkwood/patches/110-dockstar.patch 
b/package/boot/uboot-kirkwood/patches/110-dockstar.patch
index 4ff7e57..b3a6271 100644
--- a/package/boot/uboot-kirkwood/patches/110-dockstar.patch
+++ b/package/boot/uboot-kirkwood/patches/110-dockstar.patch
@@ -1,12 +1,12 @@
 --- a/include/configs/dockstar.h
 +++ b/include/configs/dockstar.h
-@@ -83,22 +83,19 @@
+@@ -67,22 +67,19 @@
   * Default environment variables
   */
  #define CONFIG_BOOTCOMMAND \
 -  "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \
 -  "ubi part root; " \
--  "ubifsmount root; " \
+-  "ubifsmount ubi:root; " \
 -  "ubifsload 0x80 ${kernel}; " \
 -  "ubifsload 0x110 ${initrd}; " \
 -  "bootm 0x80 0x110"
-- 
1.8.3.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/2] [package] uboot-kirkwood updates

2013-10-31 Thread Felix Kaechele
Update U-Boot to Version 2013.10 and enable FDT support.

Felix Kaechele (2):
  [package] uboot-kirkwood: update to 2013.10
  [package] uboot-kirkwood: enable FDT support

 package/boot/uboot-kirkwood/Makefile   | 10 +++---
 package/boot/uboot-kirkwood/patches/110-dockstar.patch |  4 ++--
 .../patches/120-enable-device-tree-support.patch   |  9 +
 3 files changed, 18 insertions(+), 5 deletions(-)
 create mode 100644 
package/boot/uboot-kirkwood/patches/120-enable-device-tree-support.patch

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