[OpenWrt-Devel] [PATCH] brcm63xx: add Observa VH4032N support

2016-05-05 Thread dani
Add support for the Observa VH4032N router.

It's a BCM6368 based board with 128MB RAM, 32MB flash.
Equiped with an onboard USB hub. This hub has the RST#
pin wired to the GPIO27 pin. For pulling the chip out of reset,
we use ephy_reset since there isn't specific code for this
function in the USB driver.

The board has also switch LEDs, but they don't work as it 
happens with other bcm6368 boards. The GPIO pinmux
still needs to be fixed for these hw controlled switch LEDs.

Signed-off-by: Daniel Gonzalez 
diff -urN ./target/linux/brcm63xx/profiles/observa.mk 
./target/linux/brcm63xx/profiles/observa.mk
--- ./target/linux/brcm63xx/profiles/observa.mk 1970-01-01 01:00:00.0 
+0100
+++ ./target/linux/brcm63xx/profiles/observa.mk 2016-04-20 21:13:56.680702590 
+0200
@@ -0,0 +1,9 @@
+define Profile/VH4032N
+  NAME:=Observa Telecom VH4032N 
+  PACKAGES:=kmod-b43 kmod-usb-core kmod-usb-ohci kmod-usb2 wpad-mini
+endef
+define Profile/VH4032N/Description
+   Package set for the Observa Telecom VH4032N
+endef
+$(eval $(call Profile,VH4032N))
+
diff -urN ./target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc 
./target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
--- ./target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc  
2016-04-20 14:23:53.371339556 +0200
+++ ./target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc  
2016-04-20 19:41:14.853717064 +0200
@@ -30,6 +30,7 @@
spw303v |\
v2110 |\
v2500v_bb |\
+   vh4032n |\
vr-3025u |\
vr-3025un |\
vr-3026e |\
diff -urN ./target/linux/brcm63xx/base-files/etc/board.d/02_network 
./target/linux/brcm63xx/base-files/etc/board.d/02_network
--- ./target/linux/brcm63xx/base-files/etc/board.d/02_network   2016-04-20 
14:23:53.371339556 +0200
+++ ./target/linux/brcm63xx/base-files/etc/board.d/02_network   2016-04-20 
19:41:14.853717064 +0200
@@ -90,6 +90,7 @@
 hg655b |\
 p870hw-51a_v2 |\
 r5010un_v2 |\
+vh4032n |\
 vr-3025un |\
 vr-3025u |\
 vr-3026e)
diff -urN ./target/linux/brcm63xx/base-files/etc/diag.sh 
./target/linux/brcm63xx/base-files/etc/diag.sh
--- ./target/linux/brcm63xx/base-files/etc/diag.sh  2016-04-20 
14:23:53.371339556 +0200
+++ ./target/linux/brcm63xx/base-files/etc/diag.sh  2016-04-20 
19:30:24.628933412 +0200
@@ -30,6 +30,9 @@
bcm96348gw-11)
status_led="96348GW-11:green:power"
;;
+   vh4032n)
+   status_led="VH4032N:red:power"
+   ;;
spw303v)
status_led="spw303v:green:power+adsl"
;;
diff -urN ./target/linux/brcm63xx/base-files/lib/brcm63xx.sh 
./target/linux/brcm63xx/base-files/lib/brcm63xx.sh
--- ./target/linux/brcm63xx/base-files/lib/brcm63xx.sh  2016-04-20 
14:23:53.371339556 +0200
+++ ./target/linux/brcm63xx/base-files/lib/brcm63xx.sh  2016-04-20 
20:53:21.196234734 +0200
@@ -186,6 +186,9 @@
"NuCom R5010UN v2")
board_name="r5010un_v2"
;;
+   "Observa VH4032N")
+   board_name="vh4032n"
+   ;;
"Pirelli A226G")
board_name="a226g"
;;
diff -urN ./target/linux/brcm63xx/dts/vh4032n.dts 
./target/linux/brcm63xx/dts/vh4032n.dts
--- ./target/linux/brcm63xx/dts/vh4032n.dts 1970-01-01 01:00:00.0 
+0100
+++ ./target/linux/brcm63xx/dts/vh4032n.dts 2016-04-20 20:21:35.905231536 
+0200
@@ -0,0 +1,89 @@
+/dts-v1/;
+
+#include "bcm6368.dtsi"
+
+#include 
+
+/ {
+   model = "Observa VH4032N";
+   compatible = "observa,vh4032n", "brcm,bcm6368";
+
+   gpio-keys-polled {
+   compatible = "gpio-keys-polled";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   poll-interval = <20>;
+   debounce-interval = <60>;
+
+   reset {
+   label = "reset";
+   gpios = <&gpio1 2 1>;
+   linux,code = ;
+   };
+   wps {
+   label = "wps";
+   gpios = <&gpio1 3 1>;
+   linux,code = ;
+   };
+   };
+
+   gpio-leds {
+   compatible = "gpio-leds";
+
+   dsl_blue {
+   label = "VH4032N:blue:dsl";
+   gpios = <&gpio0 2 1>;
+   };
+   dsl_red {
+   label = "VH4032N:red:dsl";
+   gpios = <&gpio0 5 1>;
+   };
+   hspa_blue {
+   label = "VH4032N:blue:hspa";
+   gpios = <&gpio0 11 1>;
+   };
+   hspa_red {
+   label = "VH4032N:red:hspa";
+   gpios = <&gpio0 12 1>;
+   };
+   power_blue {
+   label = "VH4032N:blue:power";
+   gpios = <&gpio0 22 0>;
+   };
+   power_red {
+

[OpenWrt-Devel] [PATCH v2] brcm63xx: implement gpio to irq

2016-04-12 Thread dani
Implement "to_irq" in the GPIO driver.

Some GPIOs in bcm63xx have IRQs. They are known in this target
as external IRQs. This patch just adds the function "to_irq" for allowing to
use the generic GPIO lib function gpio_to_irq(). This function just
returns the IRQ number at the GPIO line.

Signed-off-by: Daniel Gonzalez 
---
change in v2:
Use a reverse table to get the IRQs later with a loop.
Use ngpios instead label to know if we are in the 2nd gpio chip

There wasn't anything wrong with the v1 patch. This one is a bit more
sophisticated, and it might help if we wanted to integrate DTS stuff.
---
diff --git 
a/target/linux/brcm63xx/patches-4.1/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
 
b/target/linux/brcm63xx/patches-4.1/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
index f80818d..b4468c9 100644
--- 
a/target/linux/brcm63xx/patches-4.1/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
+++ 
b/target/linux/brcm63xx/patches-4.1/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
@@ -40,7 +40,7 @@ Signed-off-by: Jonas Gorski 
  obj-$(CONFIG_GPIO_CS5535) += gpio-cs5535.o
 --- /dev/null
 +++ b/drivers/gpio/gpio-bcm63xx.c
-@@ -0,0 +1,122 @@
+@@ -0,0 +1,178 @@
 +/*
 + * Driver for BCM63XX memory-mapped GPIO controllers, based on
 + * Generic driver for memory-mapped GPIO controllers.
@@ -75,6 +75,58 @@ Signed-off-by: Jonas Gorski 
 +#include 
 +#include 
 +
++#include 
++
++static int bcm63xx_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
++{
++  unsigned int i;
++  int irq2gpio[6] = { -1, -1, -1, -1, -1, -1 };
++
++  switch (bcm63xx_get_cpu_id()) {
++  case BCM6328_CPU_ID:
++  irq2gpio[0] = 23;
++  irq2gpio[1] = 24;
++  irq2gpio[2] = 15;
++  irq2gpio[3] = 12;
++  break;
++  case BCM6348_CPU_ID:
++  case BCM63268_CPU_ID:
++  if (chip->ngpio < 32)
++  {
++  irq2gpio[0] = 0;
++  irq2gpio[1] = 1;
++  irq2gpio[2] = 2;
++  irq2gpio[3] = 3;
++  }
++  else
++  return -EINVAL;
++  break;
++  case BCM6358_CPU_ID:
++  case BCM6368_CPU_ID:
++  if (chip->ngpio < 32)
++  {
++  irq2gpio[0] = 2;
++  irq2gpio[1] = 3;
++  irq2gpio[2] = 4;
++  irq2gpio[3] = 5;
++  irq2gpio[4] = 0;
++  irq2gpio[5] = 1;
++  }
++  else
++  return -EINVAL;
++  break;
++  default:
++  return -EINVAL;
++  }
++
++  for (i = 0; i < 6; i++) {
++  if (irq2gpio[i] == gpio)
++  return i + IRQ_EXTERNAL_BASE;
++  }
++
++  return -EINVAL;
++}
++
 +static int bcm63xx_gpio_probe(struct platform_device *pdev)
 +{
 +  struct device *dev = &pdev->dev;
@@ -85,6 +137,7 @@ Signed-off-by: Jonas Gorski 
 +  int err;
 +  struct bgpio_chip *bgc;
 +  struct bgpio_pdata *pdata = dev_get_platdata(dev);
++  struct gpio_chip *chip;
 +
 +  dirout_r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 +  dat_r = platform_get_resource(pdev, IORESOURCE_MEM, 1);
@@ -131,8 +184,11 @@ Signed-off-by: Jonas Gorski 
 +  if (pdata->ngpio > 0)
 +  bgc->gc.ngpio = pdata->ngpio;
 +  }
++  
++  chip = &bgc->gc;
++  chip->to_irq = bcm63xx_gpio_to_irq;
 +
-+  return gpiochip_add(&bgc->gc);
++  return gpiochip_add(chip);
 +}
 +
 +static int bcm63xx_gpio_remove(struct platform_device *pdev)
@@ -163,3 +219,14 @@ Signed-off-by: Jonas Gorski 
 +MODULE_DESCRIPTION("Driver for BCM63XX memory-mapped GPIO controllers");
 +MODULE_AUTHOR("Jonas Gorski ");
 +MODULE_LICENSE("GPL");
+--- a/arch/mips/include/asm/mach-bcm63xx/gpio.h
 b/arch/mips/include/asm/mach-bcm63xx/gpio.h
+@@ -3,7 +3,7 @@
+ 
+ #include 
+ 
+-#define gpio_to_irq(gpio) -1
++#define gpio_to_irq __gpio_to_irq
+ 
+ #define gpio_get_value __gpio_get_value
+ #define gpio_set_value __gpio_set_value
diff --git 
a/target/linux/brcm63xx/patches-4.4/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
 
b/target/linux/brcm63xx/patches-4.4/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
index 92b0e71..d914f0b 100644
--- 
a/target/linux/brcm63xx/patches-4.4/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
+++ 
b/target/linux/brcm63xx/patches-4.4/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
@@ -40,7 +40,7 @@ Signed-off-by: Jonas Gorski 
  obj-$(CONFIG_GPIO_CLPS711X)   += gpio-clps711x.o
 --- /dev/null
 +++ b/drivers/gpio/gpio-bcm63xx.c
-@@ -0,0 +1,122 @@
+@@ -0,0 +1,178 @@
 +/*
 + * Driver for BCM63XX memory-mapped GPIO controllers, based on
 + * Generic driver for memory-mapped GPIO controllers.
@@ -75,6 +75,58 @@ Signed-off-by: Jonas Gorski 
 +#include 
 +#include 
 +
++#include 
++
++static int bcm63xx_gpio_to_irq(stru

[OpenWrt-Devel] [PATCH] brcm63xx: fix external IRQs

2016-04-11 Thread dani
External IRQs are currently broken, fix the BCM6345_EXT_IRQ driver.

Since the adoption of the new driver irq-bcm6345-ext, in Chaos Calmer,
external IRQs don't work. It seems there were some minor errors at the initial
development of the driver.

This patch fixes the ticket https://dev.openwrt.org/ticket/21613

Signed-off-by: Daniel Gonzalez 
diff --git 
a/target/linux/brcm63xx/patches-4.1/321-irqchip-add-support-for-bcm6345-style-external-inter.patch
 
b/target/linux/brcm63xx/patches-4.1/321-irqchip-add-support-for-bcm6345-style-external-inter.patch
index 5ee5ee2..4dd5130 100644
--- 
a/target/linux/brcm63xx/patches-4.1/321-irqchip-add-support-for-bcm6345-style-external-inter.patch
+++ 
b/target/linux/brcm63xx/patches-4.1/321-irqchip-add-support-for-bcm6345-style-external-inter.patch
@@ -148,7 +148,7 @@ Signed-off-by: Jonas Gorski 
 +
 +  raw_spin_lock(&priv->lock);
 +  reg = __raw_readl(priv->reg);
-+  reg |= hwirq << (EXTIRQ_CFG_CLEAR * priv->shift);
++  reg |= 1 << (hwirq + EXTIRQ_CFG_CLEAR * priv->shift);
 +  __raw_writel(reg, priv->reg);
 +  raw_spin_unlock(&priv->lock);
 +}
@@ -161,7 +161,7 @@ Signed-off-by: Jonas Gorski 
 +
 +  raw_spin_lock(&priv->lock);
 +  reg = __raw_readl(priv->reg);
-+  reg &= ~(hwirq << (EXTIRQ_CFG_MASK * priv->shift));
++  reg &= ~(1 << (hwirq + EXTIRQ_CFG_MASK * priv->shift));
 +  __raw_writel(reg, priv->reg);
 +  raw_spin_unlock(&priv->lock);
 +}
@@ -174,7 +174,7 @@ Signed-off-by: Jonas Gorski 
 +
 +  raw_spin_lock(&priv->lock);
 +  reg = __raw_readl(priv->reg);
-+  reg |= hwirq << (EXTIRQ_CFG_MASK * priv->shift);
++  reg |= 1 << (hwirq + EXTIRQ_CFG_MASK * priv->shift);
 +  __raw_writel(reg, priv->reg);
 +  raw_spin_unlock(&priv->lock);
 +}
@@ -222,17 +222,17 @@ Signed-off-by: Jonas Gorski 
 +  reg = __raw_readl(priv->reg);
 +
 +  if (levelsense)
-+  reg |= hwirq << (EXTIRQ_CFG_LEVELSENSE * priv->shift);
++  reg |= 1 << (hwirq + EXTIRQ_CFG_LEVELSENSE * priv->shift);
 +  else
-+  reg &= ~(hwirq << (EXTIRQ_CFG_LEVELSENSE * priv->shift));
++  reg &= ~(1 << (hwirq + EXTIRQ_CFG_LEVELSENSE * priv->shift));
 +  if (sense)
-+  reg |= hwirq << (EXTIRQ_CFG_SENSE * priv->shift);
++  reg |= 1 << (hwirq + EXTIRQ_CFG_SENSE * priv->shift);
 +  else
-+  reg &= ~(hwirq << (EXTIRQ_CFG_SENSE * priv->shift));
++  reg &= ~(1 << (hwirq + EXTIRQ_CFG_SENSE * priv->shift));
 +  if (bothedge)
-+  reg |= hwirq << (EXTIRQ_CFG_BOTHEDGE * priv->shift);
++  reg |= 1 << (hwirq + EXTIRQ_CFG_BOTHEDGE * priv->shift);
 +  else
-+  reg &= ~(hwirq << (EXTIRQ_CFG_BOTHEDGE * priv->shift));
++  reg &= ~(1 << (hwirq + EXTIRQ_CFG_BOTHEDGE * priv->shift));
 +
 +  __raw_writel(reg, priv->reg);
 +  raw_spin_unlock(&priv->lock);
diff --git 
a/target/linux/brcm63xx/patches-4.4/321-irqchip-add-support-for-bcm6345-style-external-inter.patch
 
b/target/linux/brcm63xx/patches-4.4/321-irqchip-add-support-for-bcm6345-style-external-inter.patch
index 4f4d7bd..2526456 100644
--- 
a/target/linux/brcm63xx/patches-4.4/321-irqchip-add-support-for-bcm6345-style-external-inter.patch
+++ 
b/target/linux/brcm63xx/patches-4.4/321-irqchip-add-support-for-bcm6345-style-external-inter.patch
@@ -148,7 +148,7 @@ Signed-off-by: Jonas Gorski 
 +
 +  raw_spin_lock(&priv->lock);
 +  reg = __raw_readl(priv->reg);
-+  reg |= hwirq << (EXTIRQ_CFG_CLEAR * priv->shift);
++  reg |= 1 << (hwirq + EXTIRQ_CFG_CLEAR * priv->shift);
 +  __raw_writel(reg, priv->reg);
 +  raw_spin_unlock(&priv->lock);
 +}
@@ -161,7 +161,7 @@ Signed-off-by: Jonas Gorski 
 +
 +  raw_spin_lock(&priv->lock);
 +  reg = __raw_readl(priv->reg);
-+  reg &= ~(hwirq << (EXTIRQ_CFG_MASK * priv->shift));
++  reg &= ~(1 << (hwirq + EXTIRQ_CFG_MASK * priv->shift));
 +  __raw_writel(reg, priv->reg);
 +  raw_spin_unlock(&priv->lock);
 +}
@@ -174,7 +174,7 @@ Signed-off-by: Jonas Gorski 
 +
 +  raw_spin_lock(&priv->lock);
 +  reg = __raw_readl(priv->reg);
-+  reg |= hwirq << (EXTIRQ_CFG_MASK * priv->shift);
++  reg |= 1 << (hwirq + EXTIRQ_CFG_MASK * priv->shift);
 +  __raw_writel(reg, priv->reg);
 +  raw_spin_unlock(&priv->lock);
 +}
@@ -222,17 +222,17 @@ Signed-off-by: Jonas Gorski 
 +  reg = __raw_readl(priv->reg);
 +
 +  if (levelsense)
-+  reg |= hwirq << (EXTIRQ_CFG_LEVELSENSE * priv->shift);
++  reg |= 1 << (hwirq + EXTIRQ_CFG_LEVELSENSE * priv->shift);
 +  else
-+  reg &= ~(hwirq << (EXTIRQ_CFG_LEVELSENSE * priv->shift));
++  reg &= ~(1 << (hwirq + EXTIRQ_CFG_LEVELSENSE * priv->shift));
 +  if (sense)
-+  reg |= hwirq << (EXTIRQ_CFG_SENSE * priv->shift);
++  reg |= 1 << (hwirq + EXTIRQ_CFG_SENSE * priv->shift);
 +  else
-+  reg &= ~(hwirq << (EXTIRQ_CFG_SENSE * priv

[OpenWrt-Devel] [PATCH] brcm63xx: implement gpio to irq

2016-03-28 Thread dani
Implement "to_irq" in the GPIO driver.

Some GPIOs in bcm63xx have IRQs. They are known in this target
as external IRQs. This patch just adds the function "to_irq" for allowing to
use the generic GPIO lib function gpio_to_irq(). This function just
returns the IRQ number at the GPIO line.

Signed-off-by: Daniel Gonzalez 
diff --git 
a/target/linux/brcm63xx/patches-4.1/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
 
b/target/linux/brcm63xx/patches-4.1/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
index f80818d..4beed21 100644
--- 
a/target/linux/brcm63xx/patches-4.1/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
+++ 
b/target/linux/brcm63xx/patches-4.1/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch
@@ -40,7 +40,7 @@ Signed-off-by: Jonas Gorski 
  obj-$(CONFIG_GPIO_CS5535) += gpio-cs5535.o
 --- /dev/null
 +++ b/drivers/gpio/gpio-bcm63xx.c
-@@ -0,0 +1,122 @@
+@@ -0,0 +1,189 @@
 +/*
 + * Driver for BCM63XX memory-mapped GPIO controllers, based on
 + * Generic driver for memory-mapped GPIO controllers.
@@ -75,6 +75,69 @@ Signed-off-by: Jonas Gorski 
 +#include 
 +#include 
 +
++#include 
++
++static int bcm63xx_gpio_to_irq(struct gpio_chip *chip, unsigned gpio) 
++{
++  switch (bcm63xx_get_cpu_id()) {
++  case BCM6328_CPU_ID:
++  switch(gpio) {
++  case 12:
++  return IRQ_EXT_3;
++  case 15:
++  return IRQ_EXT_2;
++  case 23:
++  return IRQ_EXT_0;
++  case 24:
++  return IRQ_EXT_1;
++  default:
++  return -EINVAL;
++  }
++
++  case BCM6348_CPU_ID:
++  case BCM63268_CPU_ID:
++  if (!strcmp(chip->label, "bcm63xx-gpio.1"))
++  switch(gpio) {
++  case 0:
++  return IRQ_EXT_0;
++  case 1:
++  return IRQ_EXT_1;
++  case 2:
++  return IRQ_EXT_2;
++  case 3:
++  return IRQ_EXT_3;
++  default:
++  return -EINVAL;
++  }
++  else
++  return -EINVAL;
++
++  case BCM6358_CPU_ID:
++  case BCM6368_CPU_ID:
++  if (!strcmp(chip->label, "bcm63xx-gpio.1"))
++  switch(gpio) {
++  case 0:
++  return IRQ_EXT_4;
++  case 1:
++  return IRQ_EXT_5;
++  case 2:
++  return IRQ_EXT_0;
++  case 3:
++  return IRQ_EXT_1;
++  case 4:
++  return IRQ_EXT_2;
++  case 5:
++  return IRQ_EXT_3;
++  default:
++  return -EINVAL;
++  }
++  else
++  return -EINVAL;
++  default:
++  return -EINVAL;
++  }
++}
++
 +static int bcm63xx_gpio_probe(struct platform_device *pdev)
 +{
 +  struct device *dev = &pdev->dev;
@@ -85,6 +148,7 @@ Signed-off-by: Jonas Gorski 
 +  int err;
 +  struct bgpio_chip *bgc;
 +  struct bgpio_pdata *pdata = dev_get_platdata(dev);
++  struct gpio_chip *chip;
 +
 +  dirout_r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 +  dat_r = platform_get_resource(pdev, IORESOURCE_MEM, 1);
@@ -131,8 +195,11 @@ Signed-off-by: Jonas Gorski 
 +  if (pdata->ngpio > 0)
 +  bgc->gc.ngpio = pdata->ngpio;
 +  }
++  
++  chip = &bgc->gc;
++  chip->to_irq = bcm63xx_gpio_to_irq;
 +
-+  return gpiochip_add(&bgc->gc);
++  return gpiochip_add(chip);
 +}
 +
 +static int bcm63xx_gpio_remove(struct platform_device *pdev)
@@ -163,3 +230,24 @@ Signed-off-by: Jonas Gorski 
 +MODULE_DESCRIPTION("Driver for BCM63XX memory-mapped GPIO controllers");
 +MODULE_AUTHOR("Jonas Gorski ");
 +MODULE_LICENSE("GPL");
+--- a/arch/mips/include/asm/mach-bcm63xx/gpio.h
 b/arch/mips/include/asm/mach-bcm63xx/gpio.h
+@@ -3,7 +3,7 @@
+ 
+ #include 
+ 
+-#define gpio_to_irq(gpio) -1
++#define gpio_to_irq __gpio_to_irq
+ 
+ #define gpio_get_value __gpio_get_value
+ #define gpio_set_value __gpio_set_value
+--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_irq.h
 b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_irq.h
+@@ -11,5 +11,7 @@
+ #define IRQ_EXT_1 (IRQ_EXTERNAL_BASE + 1)
+ #define IRQ_EXT_2 (IRQ_EXTERNAL_BASE + 2)
+ #define IRQ_EXT_3 (IRQ_EXTERNAL_BASE + 3)
++#define IRQ_EXT_4 (IRQ_EXTERNAL_BASE + 4)
++#define IRQ_EXT_5 (IRQ_EXTERNAL_BASE + 5)
+ 
+ #endif /* ! BCM63XX_IRQ_H_ */
diff --git 
a/target/linux/brcm63

[OpenWrt-Devel] [PATCH] brcm63xx: fix Livebox1 support

2016-03-06 Thread dani
Livebox firmware is totally broken, fix it and make specific firmware
for the DV4210 model.

- Added relocate stuff to allow boot the kernel
- Fix RAM firmware
- Rename dts file, now specific for the DV4210 model
- Fix leds in the dts file
- Add status led
- Set button 1 as failsafe button
- Disable dts flash detection, because physmap dts stuff seems to be 
broken for detecting Redboot partitions
- Set eth0 as the LAN port, for coherence and comfortability.
- Add led triggers
- Make board data in the kernel file specific for DV4210. Add also DV4410
for future use or reference

Signed-off-by: Daniel Gonzalez 
diff --git a/target/linux/brcm63xx/base-files/etc/board.d/01_leds 
b/target/linux/brcm63xx/base-files/etc/board.d/01_leds
index 8339254..209ebb9 100755
--- a/target/linux/brcm63xx/base-files/etc/board.d/01_leds
+++ b/target/linux/brcm63xx/base-files/etc/board.d/01_leds
@@ -51,6 +51,11 @@ homehub2a)
ucidef_set_led_usbdev "usb1" "USB1" "HOMEHUB2A:blue:phone" "1-1"
ucidef_set_led_usbdev "usb2" "USB2" "HOMEHUB2A:green:phone" "2-1"
;;
+livebox1)
+   ucidef_set_led_netdev "lan" "LAN" "Livebox1:red:traffic" "eth0"
+   ucidef_set_led_netdev "wan" "WAN" "Livebox1:red:adsl" "eth1"
+   ucidef_set_led_netdev "wlan0" "WIFI" "Livebox1:red:wifi" "wlan0"
+   ;;
 r5010un_v2)
ucidef_set_led_usbdev "usb" "USB" "R5010UNv2:green:usb" "1-1"
;;
diff --git a/target/linux/brcm63xx/base-files/etc/board.d/02_network 
b/target/linux/brcm63xx/base-files/etc/board.d/02_network
index f96da08..ffab119 100755
--- a/target/linux/brcm63xx/base-files/etc/board.d/02_network
+++ b/target/linux/brcm63xx/base-files/etc/board.d/02_network
@@ -128,6 +128,10 @@ bcm963268bu_p300)
"0:lan" "3:lan" "4:lan" "5:lan" "6:lan" "7:lan" "8t@eth0"
;;
 
+livebox1)
+   ucidef_set_interfaces_lan_wan "eth0" "eth1"
+   ;;
+
 *)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh 
b/target/linux/brcm63xx/base-files/etc/diag.sh
index b864964..2dd668d 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -99,6 +99,9 @@ set_state() {
hg655b)
status_led="HW65x:green:power"
;;
+   livebox1)
+   status_led="Livebox1:red:adsl-fail-power"
+   ;;
p870hw-51a_v2)
status_led="P870HW-51a:green:power"
;;
diff --git a/target/linux/brcm63xx/dts/livebox-blue-5g.dts 
b/target/linux/brcm63xx/dts/livebox-blue-5g.dts
deleted file mode 100644
index bc3d403..000
--- a/target/linux/brcm63xx/dts/livebox-blue-5g.dts
+++ /dev/null
@@ -1,68 +0,0 @@
-/dts-v1/;
-
-#include "bcm6348.dtsi"
-
-#include 
-
-/ {
-   model = "Inventel Livebox 1";
-   compatible = "inventel,livebox-blue-5g", "brcm,bcm6348";
-
-   gpio-keys-polled {
-   compatible = "gpio-keys-polled";
-   #address-cells = <1>;
-   #size-cells = <0>;
-
-   poll-interval = <20>;
-   debounce-interval = <60>;
-
-   button1 {
-   label = "BTN_1";
-   gpios = <&gpio1 4 1>;
-   linux,code = ;
-   };
-
-   button2 {
-   label = "BTN_2";
-   gpios = <&gpio0 7 1>;
-   linux,code = ;
-   };
-   };
-
-   gpio-leds {
-   compatible = "gpio-leds";
-
-   red_adsl_fail {
-   label = "Livebox-blue-5g:red:adsl-fail";
-   gpios = <&gpio0 0 0>;
-   default-state = "on";
-   };
-
-   red_adsl {
-   label = "Livebox-blue-5g:red:adsl-fail";
-   gpios = <&gpio0 1 0>;
-   };
-
-   red_traffic {
-   label = "Livebox-blue-5g:red:adsl-fail";
-   gpios = <&gpio0 2 0>;
-   };
-
-   red_phone {
-   label = "Livebox-blue-5g:red:adsl-fail";
-   gpios = <&gpio0 3 0>;
-   };
-
-   red_wifi {
-   label = "Livebox-blue-5g:red:adsl-fail";
-   gpios = <&gpio0 4 0>;
-   };
-   };
-};
-
-&pflash {
-   reg = <0x1e40 0x80>;
-   status = "ok";
-
-   linux,part-probe = "redboot";
-};
diff --git a/target/linux/brcm63xx/dts/livebox-dv4210.dts 
b/target/linux/brcm63xx/dts/livebox-dv4210.dts
new file mode 100644
index 000..b4570ca
--- /dev/null
+++ b/target/linux/brcm63xx/dts/livebox-dv4210.dts
@@ -0,0 +1,68 @@
+/dts-v1/;
+
+#include "bcm6348.dtsi"
+
+#include 
+
+/ {
+   model = "Inventel Livebox 1";
+   compatible = "inventel,livebox-dv4210", "brcm,bcm6348";
+
+   gpio-keys-polled {
+   compatible = "gpio-keys-polle

Re: [OpenWrt-Devel] [PATCH] brcm63xx: Let the CFE partition in HG556a to be writeable

2016-03-02 Thread dani
I agree, it would be much better to do the job without touching CFE. In
fact after
changing those bits in CFE to boot always the core0 as the main thread, if
one wants
to return to the OEM firmware it turns out that the board hangs when
loading VoIP
stuff. Probably VoIP stuff is hardcoded in some way that wants the core0
for exclusive
use.

BTW, shouldn't be easier to do the job into the kernel rather than the
lzma-loader?.
And without worrying which boards are affected, just do it for all BCM6358
boards (if
they booted the core1 as the main thread). I can't imagine any user wanting
to run
Openwrt with half icache.

Regards.

2016-01-18 14:15 GMT+01:00 Jonas Gorski :

> Hi,
>
> On Wed, Dec 2, 2015 at 9:37 PM, dani  wrote:
> > In the HG556a router the partition mtd0, where CFE lives, is read only.
> > This patch allows this partition to be writeable.
> >
> > The BCM6358 SoC has two cores, but they are not identical. The second
> core has
> > half icache.
> > core0: icache=32kB
> > core1: icache=16kB
> >
> > As default the HG556a uses the second core as the main one (configured
> by CFE).
> > Since currently there isn't SMP support for using both cores, we want to
> use the
> > one with the best performance.
> >
> > For using the core0 as the main one, we need to write some bytes at the
> offset
> > 0x014 of mtd0 (CFE). Therefore we need the mtd0 partition to be
> writeable.
> >
> > After setting the core0 as the main one, the performance can increase up
> to
> > +20% (tested). The performance gain isn't marginal.
> >
> > For setting the core0 as the main one in an easy way I wrote a very
> simple utility:
> > https://wiki.openwrt.org/_media/media/huawei/tp0set.tar.gz
> > It can switch from core0 to core1 or vice versa in OpenWrt writing
> proper bytes
> > into bcm6358 CFE (fully tested in the HG556a, no bricks).
>
> To be honest, I'm not very comfortable with making the CFE partition
> writable, and rather add code to lzma-loader that switches back to
> thread 0, then add lzma-loader for the affected devices.
>
>
> Jonas
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] brcm63xx: fix CT-536p/CT-5621T support

2016-02-11 Thread dani
Fix support for the Comtrend  CT-536p, CT-5361 and CT-5621T routers support.

Currently the firmware is broken for these routers, because there is a missing
bar in the code at the DTS file. The power led also has a typo. This causes the
router boots without ethernet connectivity.

Fixed and and also renamed the DTS file to keep coherence with names.

Signed-off-by: Daniel Gonzalez 
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh 
b/target/linux/brcm63xx/base-files/etc/diag.sh
index b864964..8b433d8 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -58,7 +58,7 @@ set_state() {
cpva642)
status_led="CPVA642:green:power:"
;;
-   ct536_ct5621)
+   ct-536p_5621t)
status_led="CT536_CT5621:green:power"
;;
cvg834g)
diff --git a/target/linux/brcm63xx/dts/ct-536plus.dts 
b/target/linux/brcm63xx/dts/ct-536plus.dts
new file mode 100644
index 000..e0bb5e3
--- /dev/null
+++ b/target/linux/brcm63xx/dts/ct-536plus.dts
@@ -0,0 +1,38 @@
+/dts-v1/;
+
+#include "bcm6348.dtsi"
+
+#include 
+
+/ {
+   model = "Comtrend CT-536+/CT-5621T";
+   compatible = "comtrend,ct-536+", "brcm,bcm6348";
+
+   gpio-keys-polled {
+   compatible = "gpio-keys-polled";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   poll-interval = <20>;
+   debounce-interval = <60>;
+
+   reset {
+   label = "reset";
+   gpios = <&gpio1 1 1>;
+   linux,code = ;
+   };
+   };
+
+   gpio-leds {
+   compatible = "gpio-leds";
+
+   power_green {
+   label = "CT536_CT5621:green:power";
+   gpios = <&gpio0 0 1>;
+   default-state = "on";
+   };
+   adsl_fail_green {
+   label = "CT536_CT5621:green:adsl-fail";
+   gpios = <&gpio0 2 1>;
+   };
+   };
+};
diff --git a/target/linux/brcm63xx/dts/ct536plus.dts 
b/target/linux/brcm63xx/dts/ct536plus.dts
deleted file mode 100644
index c05068a..000
--- a/target/linux/brcm63xx/dts/ct536plus.dts
+++ /dev/null
@@ -1,38 +0,0 @@
-/dts-v1/;
-
-#include "bcm6348.dtsi"
-
-#include 
-
-/ {
-   model = "Comtrend CT-536+/CT-5621T";
-   compatible = "comtrend,ct536+", "brcm,bcm6348";
-
-   gpio-keys-polled {
-   compatible = "gpio-keys-polled";
-   #address-cells = <1>;
-   #size-cells = <0>;
-   poll-interval = <20>;
-   debounce-interval = <60>;
-
-   reset {
-   label = "reset";
-   gpios = <&gpio1 1 1>;
-   linux,code = ;
-   };
-   };
-
-   gpio-leds {
-   compatible = "gpio-leds";
-
-   power_green {
-   label = "CT536_CT5621:green:power";
-   gpios = <&gpio0 0 1>;
-   default-state = "on";
-   };
-   adsl_fail_green {
-   label = "CT536_CT5621:green:adsl-fail";
-   gpios = <&gpio0 2 1>;
-   };
-   };
-};
diff --git a/target/linux/brcm63xx/image/Makefile 
b/target/linux/brcm63xx/image/Makefile
index e00b6fb..e5f2670 100644
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -527,7 +527,7 @@ $(eval $(call 
bcm63xxCfe,AR5381u,AR-5381u,ar-5381u,96328A-1241N,6328,--pad 8))
 # Comtrend AR-5387un
 $(eval $(call bcm63xxCfe,AR5387un,AR-5387un,ar-5387un,96328A-1441N1,6328,--pad 
8))
 # Comtrend 536, 5621
-$(eval $(call bcm63xxCfe,CT536_CT5621,CT536_CT5621,ct536plus,96348GW-11,6348))
+$(eval $(call bcm63xxCfe,CT536_CT5621,CT536_CT5621,ct-536plus,96348GW-11,6348))
 # Comtrend CT-5365
 $(eval $(call bcm63xxCfe,CT5365,CT-5365,ct-5365,96348A-122,6348))
 # Comtrend CT-6373
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] brcm63xx: fix HG556a C button

2016-01-26 Thread dani
One button of the HG556a-C has the wrong GPIO pin defined in the dts file,
fix it

Probably as it happened with leds previously, the buttons were copied from
the A, B versions of this router, but nobody checked it. The "help" button 
has the GPIO pin 36 not the pin 8.

Signed-off-by: Daniel Gonzalez 
diff --git a/target/linux/brcm63xx/dts/hg556a-c.dts 
b/target/linux/brcm63xx/dts/hg556a-c.dts
index 9798091..5a1856d 100644
--- a/target/linux/brcm63xx/dts/hg556a-c.dts
+++ b/target/linux/brcm63xx/dts/hg556a-c.dts
@@ -17,7 +17,7 @@
 
help {
label = "help";
-   gpios = <&gpio0 8 1>;
+   gpios = <&gpio1 4 1>;
linux,code = ;
};
wlan {
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] brcm63xx: fix gpio ephy-reset

2016-01-18 Thread dani
Thanks Jonas. Tested and working OK. It would be nice if the patch is also
backported to Chaos Calmer revision.

Regards.

2016-01-18 14:16 GMT+01:00 Jonas Gorski :

> Hi,
>
> On 12 December 2015 at 14:10, dani  wrote:
> > Currently ephy-reset, which uses a GPIO for enabling external ethernet
> phys, is broken.
> > This patch fix the problem.
> >
> > This problem causes in boards with external phys with a reset pin
> connected to gpio, are
> > initialized without lan interfaces.
> >
> > The line
> > ephy_reset.table[0].chip_label = gpio_chip_labels[hw_gpio / 32];
> > always returns bcm63xx-gpio.1. As a result of this, reset pins connected
> to gpios <32
> > will return messages "gpio X out of range", and ethernet fails to
> initialize.
> >
> > The array *gpio_chip_labels[] should be initialized with different names
> for each element,
> > otherwise sprintf will copy the label of the gpio chip for both elements
> at the same time.
> > And the name of both elements of the array will be the same.
> >
> > Using a different name on the second array element solves the problem.
> > Signed-off-by: Daniel Gonzalez 
>
> I added a slightly different approach in r48303, can you verify it
> works for you?
>
>
> Jonas
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] brcm63xx: Question about external IRQs

2015-12-19 Thread dani
I have no idea if external IRQs are currenlty used for any purpose in bcm63xx,
buy they seem to be broken.

Some GPIOs in bcm63xx are shared with those external IRQs. Usually those GPIOs
in bcm63xx are wired to some buttons, but not all.

Since I know the matching between external IRQs and GPIOs, I used this code 
for checking if the external IRQs really work, just by pressing the button.

/***/
static irqreturn_t gpio_interrupt(int irq, void *dev_id)
{
printk("my IRQ triggered\n");
return IRQ_HANDLED;
}
 
int bcm63xx_button_init(void)
{
int ret, irq;
 
printk("TEST IRQ (GPIO-button)\n");
irq = IRQ_EXT_1;
ret = request_irq(irq, gpio_interrupt, 0, "bcm63xx_extIRQ", NULL);
if (ret) {
printk(KERN_ERR "bcm63xx-extIRQ: failed to register irq 
%d\n",irq);
return ret;
}
printk("Mapped IRQ %d\n", irq );
 
return 0;
}
 
arch_initcall(bcm63xx_button_init);
/***/

in the kernel code at setup.c. 
In Attitude adjustment, it worked printing messages on the console:

my IRQ triggered
my IRQ triggered

every time I press the button connected to GPIO35 in a BCM6368 board. It also 
worked with
BCM6348.

But with latest trunk, or Chaos Calmer nothing happens spite of using exactly 
the same snippet 
code, and the kernel doesn't complain about anything related to IRQs. This time 
I only checked it
in BCM6368 (the same board I previously used with AA).

Are external IRQs broken?, did anyone check if they work?

I also noticed bcm63xx_irq.h has defined only 4 external IRQs, but some SoCs 
like BCM6368 or BCM63168
have 6.

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


[OpenWrt-Devel] [PATCH] CC: brcm63xx: backport fix gpio ephy-reset

2015-12-12 Thread dani
ephy-reset, which uses a GPIO for enabling external ethernet phys, is broken. 
This patch fix the problem. 

This problem causes in boards with external phys with a reset pin connected to 
gpio, are
initialized without lan interfaces. 

The line 
ephy_reset.table[0].chip_label = gpio_chip_labels[hw_gpio / 32];
always returns bcm63xx-gpio.1. As a result of this, reset pins connected to 
gpios <32
will return messages "gpio X out of range", and ethernet fails to initialize.

The array *gpio_chip_labels[] should be initialized with different names for 
each element, 
otherwise sprintf will copy the label of the gpio chip for both elements at the 
same time. 
And the name of both elements of the array will be the same.

Using a different name on the second array element solves the problem.
Signed-off-by: Daniel Gonzalez 
diff --git 
a/target/linux/brcm63xx/patches-3.18/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch
 
b/target/linux/brcm63xx/patches-3.18/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch
index 30f6ba5..40d3f3f 100644
--- 
a/target/linux/brcm63xx/patches-3.18/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch
+++ 
b/target/linux/brcm63xx/patches-3.18/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch
@@ -61,7 +61,7 @@ Signed-off-by: Jonas Gorski 
 +/* for registering lookups; make them large enough to hold OF names */
 +static char *gpio_chip_labels[] = {
 +  ".gpio-controller",
-+  ".gpio-controller",
++  ".gpio-controller",
 +};
 +
  static void __init bcm63xx_gpio_init_one(int id, int dir, int data, int ngpio)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] brcm63xx: fix gpio ephy-reset

2015-12-12 Thread dani
Currently ephy-reset, which uses a GPIO for enabling external ethernet phys, is 
broken. 
This patch fix the problem.

This problem causes in boards with external phys with a reset pin connected to 
gpio, are
initialized without lan interfaces. 

The line 
ephy_reset.table[0].chip_label = gpio_chip_labels[hw_gpio / 32];
always returns bcm63xx-gpio.1. As a result of this, reset pins connected to 
gpios <32
will return messages "gpio X out of range", and ethernet fails to initialize.

The array *gpio_chip_labels[] should be initialized with different names for 
each element, 
otherwise sprintf will copy the label of the gpio chip for both elements at the 
same time. 
And the name of both elements of the array will be the same.

Using a different name on the second array element solves the problem.
Signed-off-by: Daniel Gonzalez 
diff --git 
a/target/linux/brcm63xx/patches-4.1/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch
 
b/target/linux/brcm63xx/patches-4.1/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch
index 0cbb4f5..28ff40b 100644
--- 
a/target/linux/brcm63xx/patches-4.1/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch
+++ 
b/target/linux/brcm63xx/patches-4.1/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch
@@ -61,7 +61,7 @@ Signed-off-by: Jonas Gorski 
 +/* for registering lookups; make them large enough to hold OF names */
 +static char *gpio_chip_labels[] = {
 +  ".gpio-controller",
-+  ".gpio-controller",
++  ".gpio-controller",
 +};
 +
  static void __init bcm63xx_gpio_init_one(int id, int dir, int data, int ngpio)
diff --git 
a/target/linux/brcm63xx/patches-4.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch
 
b/target/linux/brcm63xx/patches-4.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch
index bd5f5e8..e4224a6 100644
--- 
a/target/linux/brcm63xx/patches-4.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch
+++ 
b/target/linux/brcm63xx/patches-4.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch
@@ -61,7 +61,7 @@ Signed-off-by: Jonas Gorski 
 +/* for registering lookups; make them large enough to hold OF names */
 +static char *gpio_chip_labels[] = {
 +  ".gpio-controller",
-+  ".gpio-controller",
++  ".gpio-controller",
 +};
 +
  static void __init bcm63xx_gpio_init_one(int id, int dir, int data, int ngpio)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] brcm63xx: Let the CFE partition in HG556a to be writeable

2015-12-02 Thread dani
In the HG556a router the partition mtd0, where CFE lives, is read only.
This patch allows this partition to be writeable.

The BCM6358 SoC has two cores, but they are not identical. The second core has 
half icache. 
core0: icache=32kB
core1: icache=16kB

As default the HG556a uses the second core as the main one (configured by CFE).
Since currently there isn't SMP support for using both cores, we want to use 
the 
one with the best performance.

For using the core0 as the main one, we need to write some bytes at the offset
0x014 of mtd0 (CFE). Therefore we need the mtd0 partition to be writeable.

After setting the core0 as the main one, the performance can increase up to
+20% (tested). The performance gain isn't marginal.

For setting the core0 as the main one in an easy way I wrote a very simple 
utility:
https://wiki.openwrt.org/_media/media/huawei/tp0set.tar.gz
It can switch from core0 to core1 or vice versa in OpenWrt writing proper bytes
into bcm6358 CFE (fully tested in the HG556a, no bricks).

Signed-off-by: Daniel Gonzalez 
diff --git a/target/linux/brcm63xx/dts/hg556a-a.dts 
b/target/linux/brcm63xx/dts/hg556a-a.dts
index 98e0a83..1b007c7 100644
--- a/target/linux/brcm63xx/dts/hg556a-a.dts
+++ b/target/linux/brcm63xx/dts/hg556a-a.dts
@@ -105,7 +105,6 @@
cfe@0 {
label = "CFE";
reg = <0x00 0x02>;
-   read-only;
};
 
linux@2 {
diff --git a/target/linux/brcm63xx/dts/hg556a-b.dts 
b/target/linux/brcm63xx/dts/hg556a-b.dts
index 8a19856..950fd17 100644
--- a/target/linux/brcm63xx/dts/hg556a-b.dts
+++ b/target/linux/brcm63xx/dts/hg556a-b.dts
@@ -105,7 +105,6 @@
cfe@0 {
label = "CFE";
reg = <0x00 0x02>;
-   read-only;
};
 
linux@2 {
diff --git a/target/linux/brcm63xx/dts/hg556a-c.dts 
b/target/linux/brcm63xx/dts/hg556a-c.dts
index 9798091..f6b635d 100644
--- a/target/linux/brcm63xx/dts/hg556a-c.dts
+++ b/target/linux/brcm63xx/dts/hg556a-c.dts
@@ -100,7 +100,6 @@
cfe@0 {
label = "CFE";
reg = <0x00 0x02>;
-   read-only;
};
 
linux@2 {
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3] brcm63xx: Add NuCom R5010UNv2 support

2015-12-01 Thread dani
This patch adds support for the NuCom R5010UNv2.

It's a BCM6328 based board. It has an onboard BCM43217 wifi chip. For this
wifi chip looks like the brcmsmac driver isn't still supported, b43 drivers are 
used
for the profile of the router.

It's worth mentioning this board was affected by a bug solved with
https://dev.openwrt.org/changeset/46707

Tested-by: Angel Fontan 
Signed-off-by: Daniel Gonzalez 
---
change in v2:
usb led trigger was wrong
added 8 MB padding to the image generator because its CFE has double image 
protection
added colors naming to the leds in dts file to meet the same layout of other 
boards
change in v3:
replaced board ID by device name of leds in dts and other files
---
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh 
b/target/linux/brcm63xx/base-files/etc/diag.sh
index 7826fad..c0fb31e 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -102,6 +102,9 @@ set_state() {
p870hw-51a_v2)
status_led="P870HW-51a:green:power"
;;
+   r5010un_v2)
+   status_led="R5010UNv2:green:power"
+   ;;
rta770bw)
status_led="RTA770BW:green:diag"
;;
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
index bdb3dad..34d5c51 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
@@ -46,6 +46,9 @@ homehub2a)
ucidef_set_led_usbdev "usb1" "USB1" "HOMEHUB2A:blue:phone" "1-1"
ucidef_set_led_usbdev "usb2" "USB2" "HOMEHUB2A:green:phone" "2-1"
;;
+r5010un_v2)
+   ucidef_set_led_usbdev "usb" "USB" "R5010UNv2:green:usb" "1-1"
+   ;;
 esac
 
 ucidef_commit_leds
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
index 129514b..70f18cb 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
@@ -94,6 +94,7 @@ fast2504n |\
 fast2704v2 |\
 hg655b |\
 p870hw-51a_v2 |\
+r5010un_v2 |\
 vr-3025un |\
 vr-3025u |\
 vr-3026e)
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
index f307a4c..bc9ae21 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
@@ -23,6 +23,7 @@ case "$(brcm63xx_board_name)" in
dsl-274xb-f |\
magic |\
p870hw-51a_v2 |\
+   r5010un_v2 |\
rta770bw |\
rta770w |\
spw303v |\
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh 
b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 1a97c86..7dc57fd 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -180,6 +180,9 @@ brcm63xx_dt_detect() {
"Netgear DGND3700v1/DGND3800B")
board_name="dgnd3700v1_dgnd3800b"
;;
+   "NuCom R5010UN v2")
+   board_name="r5010un_v2"
+   ;;
"Pirelli A226G")
board_name="a226g"
;;
diff --git a/target/linux/brcm63xx/dts/r5010unv2.dts 
b/target/linux/brcm63xx/dts/r5010unv2.dts
new file mode 100644
index 000..8c83483
--- /dev/null
+++ b/target/linux/brcm63xx/dts/r5010unv2.dts
@@ -0,0 +1,64 @@
+/dts-v1/;
+
+#include "bcm6328.dtsi"
+
+#include 
+
+/ {
+   model = "NuCom R5010UN v2";
+   compatible = "nucom,r5010unv2", "brcm,bcm6328";
+   
+   gpio-keys-polled {
+   compatible = "gpio-keys-polled";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   poll-interval = <20>;
+   debounce-interval = <60>;
+
+   reset {
+   label = "reset";
+   gpios = <&gpio0 23 1>;
+   linux,code = ;
+   };
+   wps {
+   label = "wps";
+   gpios = <&gpio0 24 1>;
+   linux,code = ;
+   };
+   };
+
+   gpio-leds {
+   compatible = "gpio-leds";
+
+   inet_green {
+   label = "R5010UNv2:green:inet";
+   gpios = <&gpio0 1 1>;
+   };
+   inet_fail_red {
+   label = "R5010UNv2:red:inet-fail";
+   gpios = <&gpio0 2 1>;
+   };
+   dsl_red {
+   label = "R5010UNv2:green:dsl";
+   gpios = <&gpio0 3 1>;
+   };
+   power_green {
+   label = "R5010UNv2:green:power";
+   gpios = <&gpio0 4 1>;
+   default-state = "on";
+

[OpenWrt-Devel] [PATCH v2] brcm63xx: Add NuCom R5010UNv2 support

2015-12-01 Thread dani
This patch adds support for the NuCom R5010UNv2.

It's a BCM6328 based board. It has an onboard BCM43217 wifi chip. For this
wifi chip looks like the brcmsmac driver isn't still supported, b43 drivers are 
used
for the profile of the router.

It's worth mentioning this board was affected by a bug solved with
https://dev.openwrt.org/changeset/46707

Tested-by: Angel Fontan 
Signed-off-by: Daniel Gonzalez 
---
change in v2:
usb led trigger was wrong
added 8 MB padding to the image generator because its CFE has double image 
protection
added colors naming to the leds in dts file to meet the same layout of other 
boards
---
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh 
b/target/linux/brcm63xx/base-files/etc/diag.sh
index 7826fad..c0fb31e 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -102,6 +102,9 @@ set_state() {
p870hw-51a_v2)
status_led="P870HW-51a:green:power"
;;
+   r5010un_v2)
+   status_led="96328ang:green:power"
+   ;;
rta770bw)
status_led="RTA770BW:green:diag"
;;
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
index bdb3dad..34d5c51 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
@@ -46,6 +46,9 @@ homehub2a)
ucidef_set_led_usbdev "usb1" "USB1" "HOMEHUB2A:blue:phone" "1-1"
ucidef_set_led_usbdev "usb2" "USB2" "HOMEHUB2A:green:phone" "2-1"
;;
+r5010un_v2)
+   ucidef_set_led_usbdev "usb" "USB" "96328ang:green:usb" "1-1"
+   ;;
 esac
 
 ucidef_commit_leds
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
index 129514b..70f18cb 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
@@ -94,6 +94,7 @@ fast2504n |\
 fast2704v2 |\
 hg655b |\
 p870hw-51a_v2 |\
+r5010un_v2 |\
 vr-3025un |\
 vr-3025u |\
 vr-3026e)
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
index f307a4c..bc9ae21 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
@@ -23,6 +23,7 @@ case "$(brcm63xx_board_name)" in
dsl-274xb-f |\
magic |\
p870hw-51a_v2 |\
+   r5010un_v2 |\
rta770bw |\
rta770w |\
spw303v |\
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh 
b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 1a97c86..7dc57fd 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -180,6 +180,9 @@ brcm63xx_dt_detect() {
"Netgear DGND3700v1/DGND3800B")
board_name="dgnd3700v1_dgnd3800b"
;;
+   "NuCom R5010UN v2")
+   board_name="r5010un_v2"
+   ;;
"Pirelli A226G")
board_name="a226g"
;;
diff --git a/target/linux/brcm63xx/dts/r5010unv2.dts 
b/target/linux/brcm63xx/dts/r5010unv2.dts
new file mode 100644
index 000..8c83483
--- /dev/null
+++ b/target/linux/brcm63xx/dts/r5010unv2.dts
@@ -0,0 +1,64 @@
+/dts-v1/;
+
+#include "bcm6328.dtsi"
+
+#include 
+
+/ {
+   model = "NuCom R5010UN v2";
+   compatible = "nucom,r5010unv2", "brcm,bcm6328";
+   
+   gpio-keys-polled {
+   compatible = "gpio-keys-polled";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   poll-interval = <20>;
+   debounce-interval = <60>;
+
+   reset {
+   label = "reset";
+   gpios = <&gpio0 23 1>;
+   linux,code = ;
+   };
+   wps {
+   label = "wps";
+   gpios = <&gpio0 24 1>;
+   linux,code = ;
+   };
+   };
+
+   gpio-leds {
+   compatible = "gpio-leds";
+
+   inet_green {
+   label = "96328ang:green:inet";
+   gpios = <&gpio0 1 1>;
+   };
+   inet_fail_red {
+   label = "96328ang:red:inet-fail";
+   gpios = <&gpio0 2 1>;
+   };
+   dsl_red {
+   label = "96328ang:green:dsl";
+   gpios = <&gpio0 3 1>;
+   };
+   power_green {
+   label = "96328ang:green:power";
+   gpios = <&gpio0 4 1>;
+   default-state = "on";
+   };
+   power_fail_red {
+   label = "

[OpenWrt-Devel] [PATCH v2] brcm63xx: Add NuCom R5010UNv2 support

2015-11-30 Thread dani
This patch adds support for the NuCom R5010UNv2.

It's a BCM6328 based board. It has an onboard BCM43217 wifi chip. For this
wifi chip looks like the brcmsmac driver isn't still supported, b43 drivers are 
used
for the profile of the router.

It's worth mentioning this board was affected by a bug solved with
https://dev.openwrt.org/changeset/46707

Tested-by: Angel Fontan 
Signed-off-by: Daniel Gonzalez 
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh 
b/target/linux/brcm63xx/base-files/etc/diag.sh
index 7826fad..c0fb31e 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -102,6 +102,9 @@ set_state() {
p870hw-51a_v2)
status_led="P870HW-51a:green:power"
;;
+   r5010un_v2)
+   status_led="96328ang:green:power"
+   ;;
rta770bw)
status_led="RTA770BW:green:diag"
;;
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
index bdb3dad..34d5c51 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
@@ -46,6 +46,9 @@ homehub2a)
ucidef_set_led_usbdev "usb1" "USB1" "HOMEHUB2A:blue:phone" "1-1"
ucidef_set_led_usbdev "usb2" "USB2" "HOMEHUB2A:green:phone" "2-1"
;;
+r5010un_v2)
+   ucidef_set_led_usbdev "usb" "USB" "96328ang:green:usb" "1-1"
+   ;;
 esac
 
 ucidef_commit_leds
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
index 129514b..70f18cb 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
@@ -94,6 +94,7 @@ fast2504n |\
 fast2704v2 |\
 hg655b |\
 p870hw-51a_v2 |\
+r5010un_v2 |\
 vr-3025un |\
 vr-3025u |\
 vr-3026e)
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
index f307a4c..bc9ae21 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
@@ -23,6 +23,7 @@ case "$(brcm63xx_board_name)" in
dsl-274xb-f |\
magic |\
p870hw-51a_v2 |\
+   r5010un_v2 |\
rta770bw |\
rta770w |\
spw303v |\
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh 
b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 1a97c86..7dc57fd 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -180,6 +180,9 @@ brcm63xx_dt_detect() {
"Netgear DGND3700v1/DGND3800B")
board_name="dgnd3700v1_dgnd3800b"
;;
+   "NuCom R5010UN v2")
+   board_name="r5010un_v2"
+   ;;
"Pirelli A226G")
board_name="a226g"
;;
diff --git a/target/linux/brcm63xx/dts/r5010unv2.dts 
b/target/linux/brcm63xx/dts/r5010unv2.dts
new file mode 100644
index 000..8c83483
--- /dev/null
+++ b/target/linux/brcm63xx/dts/r5010unv2.dts
@@ -0,0 +1,64 @@
+/dts-v1/;
+
+#include "bcm6328.dtsi"
+
+#include 
+
+/ {
+   model = "NuCom R5010UN v2";
+   compatible = "nucom,r5010unv2", "brcm,bcm6328";
+   
+   gpio-keys-polled {
+   compatible = "gpio-keys-polled";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   poll-interval = <20>;
+   debounce-interval = <60>;
+
+   reset {
+   label = "reset";
+   gpios = <&gpio0 23 1>;
+   linux,code = ;
+   };
+   wps {
+   label = "wps";
+   gpios = <&gpio0 24 1>;
+   linux,code = ;
+   };
+   };
+
+   gpio-leds {
+   compatible = "gpio-leds";
+
+   inet_green {
+   label = "96328ang:green:inet";
+   gpios = <&gpio0 1 1>;
+   };
+   inet_fail_red {
+   label = "96328ang:red:inet-fail";
+   gpios = <&gpio0 2 1>;
+   };
+   dsl_red {
+   label = "96328ang:green:dsl";
+   gpios = <&gpio0 3 1>;
+   };
+   power_green {
+   label = "96328ang:green:power";
+   gpios = <&gpio0 4 1>;
+   default-state = "on";
+   };
+   power_fail_red {
+   label = "96328ang:red:power-fail";
+   gpios = <&gpio0 5 1>;
+   };
+   wps_green {
+   label = "96328ang:green:wps";
+   gpios = <&gpio0 10 1>;

[OpenWrt-Devel] [PATCH] brcm63xx: Add NuCom R5010UNv2 support

2015-11-27 Thread dani
This patch adds support for the NuCom R5010UNv2.

It's a BCM6328 based board. It has an onboard BCM43217 wifi chip. For this
wifi chip looks like the brcmsmac driver isn't still supported, b43 drivers are 
used
for the profile of the router.

It's worth mentioning this board was affected by a bug solved with
https://dev.openwrt.org/changeset/46707

Signed-off-by: Daniel Gonzalez 
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh 
b/target/linux/brcm63xx/base-files/etc/diag.sh
index 7826fad..c0fb31e 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -102,6 +102,9 @@ set_state() {
p870hw-51a_v2)
status_led="P870HW-51a:green:power"
;;
+   r5010un_v2)
+   status_led="96328ang:green:power"
+   ;;
rta770bw)
status_led="RTA770BW:green:diag"
;;
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
index bdb3dad..34d5c51 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
@@ -46,6 +46,9 @@ homehub2a)
ucidef_set_led_usbdev "usb1" "USB1" "HOMEHUB2A:blue:phone" "1-1"
ucidef_set_led_usbdev "usb2" "USB2" "HOMEHUB2A:green:phone" "2-1"
;;
+r5010un_v2)
+   ucidef_set_led_usbdev "usb" "USB" "96328ang:green:usb" "1-2"
+   ;;
 esac
 
 ucidef_commit_leds
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
index 129514b..70f18cb 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
@@ -94,6 +94,7 @@ fast2504n |\
 fast2704v2 |\
 hg655b |\
 p870hw-51a_v2 |\
+r5010un_v2 |\
 vr-3025un |\
 vr-3025u |\
 vr-3026e)
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
index f307a4c..bc9ae21 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/09_fix_crc
@@ -23,6 +23,7 @@ case "$(brcm63xx_board_name)" in
dsl-274xb-f |\
magic |\
p870hw-51a_v2 |\
+   r5010un_v2 |\
rta770bw |\
rta770w |\
spw303v |\
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh 
b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 1a97c86..7dc57fd 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -180,6 +180,9 @@ brcm63xx_dt_detect() {
"Netgear DGND3700v1/DGND3800B")
board_name="dgnd3700v1_dgnd3800b"
;;
+   "NuCom R5010UN v2")
+   board_name="r5010un_v2"
+   ;;
"Pirelli A226G")
board_name="a226g"
;;
diff --git a/target/linux/brcm63xx/dts/r5010unv2.dts 
b/target/linux/brcm63xx/dts/r5010unv2.dts
new file mode 100644
index 000..8c83483
--- /dev/null
+++ b/target/linux/brcm63xx/dts/r5010unv2.dts
@@ -0,0 +1,64 @@
+/dts-v1/;
+
+#include "bcm6328.dtsi"
+
+#include 
+
+/ {
+   model = "NuCom R5010UN v2";
+   compatible = "nucom,r5010unv2", "brcm,bcm6328";
+   
+   gpio-keys-polled {
+   compatible = "gpio-keys-polled";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   poll-interval = <20>;
+   debounce-interval = <60>;
+
+   reset {
+   label = "reset";
+   gpios = <&gpio0 23 1>;
+   linux,code = ;
+   };
+   wps {
+   label = "wps";
+   gpios = <&gpio0 24 1>;
+   linux,code = ;
+   };
+   };
+
+   gpio-leds {
+   compatible = "gpio-leds";
+
+   inet {
+   label = "96328ang:green:inet";
+   gpios = <&gpio0 1 1>;
+   };
+   inet_fail {
+   label = "96328ang:red:inet-fail";
+   gpios = <&gpio0 2 1>;
+   };
+   dsl {
+   label = "96328ang:green:dsl";
+   gpios = <&gpio0 3 1>;
+   };
+   power {
+   label = "96328ang:green:power";
+   gpios = <&gpio0 4 1>;
+   default-state = "on";
+   };
+   power_fail {
+   label = "96328ang:red:power-fail";
+   gpios = <&gpio0 5 1>;
+   };
+   wps {
+   label = "96328ang:green:wps";
+   gpios = <&gpio0 10 1>;
+   };
+   usb {
+ 

[OpenWrt-Devel] [PATCH] brcm63xx: Add Huawei HG655b support

2015-05-09 Thread dani
This patch adds support for the Huawei HG655b.

Nothing much special in this router, it's just another BCM6368 with
a Ralink RT3062 wifi chip and the calibration data embedded in the 
main flash chip at offset 0x7c. There is also configuration data
used by the OEM firmware before the cal_data partition, this area is
protected by the board_data partition in this patch.

Signed-off-by: Daniel Gonzalez 
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh 
b/target/linux/brcm63xx/base-files/etc/diag.sh
index 03d98b9..c330674 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -89,6 +89,9 @@ set_state() {
hg520)
status_led="HW520:green:net"
;;
+   hg655b)
+   status_led="HW65x:green:power"
+   ;;
p870hw-51a_v2)
status_led="P870HW-51a:green:power"
;;
diff --git 
a/target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom 
b/target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
index 9a324ea..4347485 100644
--- a/target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
+++ b/target/linux/brcm63xx/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
@@ -34,6 +34,9 @@ case "$FIRMWARE" in
hg556a_c)
rt2x00_eeprom_extract "cal_data" 130560 512
;;
+   hg655b)
+   rt2x00_eeprom_extract "cal_data" 0 512
+   ;;
*)
rt2x00_eeprom_die "board $board is not supported yet"
;;
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
index 58404a1..b964bdb 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
@@ -34,6 +34,9 @@ hg556a_*)
ucidef_set_led_netdev "lan" "LAN" "HW556:red:dsl" "eth0"
ucidef_set_led_usbdev "usb" "USB" "HW556:red:hspa" "1-2"
;;
+hg655b)
+   ucidef_set_led_usbdev "usb" "USB" "HW65x:green:usb" "1-2"
+   ;;
 homehub2a)
ucidef_set_led_netdev "lan" "LAN" "HOMEHUB2A:blue:broadband" "eth0.1"
ucidef_set_led_netdev "wlan0" "WIFI" "HOMEHUB2A:green:wireless" "wlan0"
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
index 814e100..e5880eb 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
@@ -92,6 +92,7 @@ dsl-274xb-f |\
 dsl-275xb-d |\
 fast2504n |\
 fast2704v2 |\
+hg655b |\
 p870hw-51a_v2 |\
 vr-3025un |\
 vr-3025u)
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh 
b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 5cb390f..0eb9a75 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -156,6 +156,9 @@ brcm63xx_dt_detect() {
"Huawei EchoLife HG556a (version C)")
board_name="hg556a_c"
;;
+   "Huawei HG655b")
+   board_name="hg655b"
+   ;;
"Inteno VG50")
board_name="vg50"
;;
diff --git a/target/linux/brcm63xx/image/Makefile 
b/target/linux/brcm63xx/image/Makefile
index e98011d..0d8ce53 100755
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -360,6 +360,8 @@ $(eval $(call 
ImageDTB,CFEDTB,HG553,HG553,hg553,HW553,6358,--rsa-signature "Echo
 $(eval $(call 
ImageDTB,CFEDTB,HG556a_AB,HG556a_A,hg556a-a,HW556,6358,--rsa-signature 
"EchoLife_HG556a" --image-offset 0x2 --block-size 0x1 --tag-version 8))
 $(eval $(call 
ImageDTB,CFEDTB,HG556a_AB,HG556a_B,hg556a-b,HW556,6358,--rsa-signature 
"EchoLife_HG556a" --image-offset 0x2 --block-size 0x2 --tag-version 8))
 $(eval $(call 
ImageDTB,CFEDTB,HG556a_C,HG556a_C,hg556a-c,HW556,6358,--rsa-signature 
"EchoLife_HG556a" --image-offset 0x2 --block-size 0x2 --tag-version 8))
+# Huawei HG655b
+$(eval $(call ImageDTB,CFEDTB,HG655b,HG655b,hg655b,HW65x,6368,--image-offset 
0x2 --tag-version 7 --pad 4))
 # Inteno VG50
 $(eval $(call ImageDTB,Dummy,VG50,vg50,vg50,VW6339GU,63268))
 # Inventel Livebox 1
diff --git a/target/linux/brcm63xx/profiles/huawei.mk 
b/target/linux/brcm63xx/profiles/huawei.mk
index 594389e..a6764b7 100644
--- a/target/linux/brcm63xx/profiles/huawei.mk
+++ b/target/linux/brcm63xx/profiles/huawei.mk
@@ -43,3 +43,13 @@ define Profile/HG556a_C/Description
   Package set optimized for Huawei HG556a version C (Ralink).
 endef
 $(eval $(call Profile,HG556a_C))
+
+define Profile/HG655b
+  NAME:=Huawei HG655b
+  PACKAGES:=kmod-rt2800-pci wpad-mini \
+   kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+define Profile/HG655b/Description
+  Package set optimized for Huawei HG655b, HG655d.
+endef
+$(eval $(call Profile

[OpenWrt-Devel] [PATCH] brcm63xx: Add BT Home Hub 2A support.

2015-03-20 Thread dani
Support for the BT HomeHub 2.0 Type A. 

This router was manufactured by Thomson, and it's BCM6358 based. 
The leds are controled by two chained HC594, all working ok. The BCM5325
switch has the RESET# pin wired to the GPIO15, but currently there is no
way to tell the b53 driver how to get this gpio number in brcm63xx,
therefore swconfig won't use it when performing a switch reset.

The patch was tested with several firmwares, and all except unsupported
stuff (i.e xDSL) works pretty well.


Tested-by: Tahir 
Signed-off-by: Daniel Gonzalez 
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh 
b/target/linux/brcm63xx/base-files/etc/diag.sh
index 928c02b..03d98b9 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -72,6 +72,10 @@ set_state() {
fast2704v2)
status_led="F@ST2704V2:green:power"
;;
+   homehub2a)
+   status_led="HOMEHUB2A:green:upgrading"
+   status_led2="HOMEHUB2A:blue:upgrading"
+   ;;
gw6200)
status_led="GW6200:green:line1"
status_led2="GW6200:green:tel"
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
index c9bf2f4..58404a1 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
@@ -34,6 +34,12 @@ hg556a_*)
ucidef_set_led_netdev "lan" "LAN" "HW556:red:dsl" "eth0"
ucidef_set_led_usbdev "usb" "USB" "HW556:red:hspa" "1-2"
;;
+homehub2a)
+   ucidef_set_led_netdev "lan" "LAN" "HOMEHUB2A:blue:broadband" "eth0.1"
+   ucidef_set_led_netdev "wlan0" "WIFI" "HOMEHUB2A:green:wireless" "wlan0"
+   ucidef_set_led_usbdev "usb1" "USB1" "HOMEHUB2A:blue:phone" "1-1"
+   ucidef_set_led_usbdev "usb2" "USB2" "HOMEHUB2A:green:phone" "2-1"
+   ;;
 esac
 
 ucidef_commit_leds
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
index df4e293..814e100 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
@@ -66,7 +66,8 @@ v2500v_bb)
 
 dsl-274xb-c |\
 hg553 |\
-hg556a_*)
+hg556a_* |\
+homehub2a)
ucidef_set_interface_lan "eth0.1"
ucidef_add_switch "eth0" "1" "1"
ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5t"
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh 
b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 2c18762..9c8a612 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -60,6 +60,9 @@ brcm63xx_dt_detect() {
"Broadcom BCM96368MVWG reference board")
board_name="bcm96368mvwg"
;;
+   "BT Home Hub 2.0 Type A")
+   board_name="homehub2a"
+   ;;
"BT Voyager V2500V")
board_name="v2500v"
;;
diff --git a/target/linux/brcm63xx/image/Makefile 
b/target/linux/brcm63xx/image/Makefile
index 3fb9b1c..662b779 100755
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -258,6 +258,8 @@ $(eval $(call 
ImageDTB,CFEDTB,RG100A,RG100A,rg100a,96358VW2,6358,--block-size 0x
 $(eval $(call ImageDTB,CFEDTB,AR1004G,AR1004G,ar1004g,96348GW-10,6348))
 # Belkin F5D7633
 $(eval $(call 
ImageDTB,CFEDTB,F5D7633,F5D7633,f5d7633,96348GW-10,6348,--block-size 0x2 
--image-offset 0x2))
+# BT Home Hub 2.0 A
+$(eval $(call 
ImageDTB,CFEDTB,BTHOMEHUB2A,HomeHub2A,homehub2a,HOMEHUB2A,6358,--image-offset 
0x2 --block-size 0x2))
 # BT Voyager V2500V, V2500V_SIP_CLUB, V2500V_AA
 $(eval $(call 
ImageDTB,CFEDTB,BTV2500V,BTV2500V,v2500v-bb,V2500V_BB,6348,--layoutver 5))
 # Comtrend AR-5381u
diff --git a/target/linux/brcm63xx/profiles/bt.mk 
b/target/linux/brcm63xx/profiles/bt.mk
index 0863752..3ca8fe1 100644
--- a/target/linux/brcm63xx/profiles/bt.mk
+++ b/target/linux/brcm63xx/profiles/bt.mk
@@ -5,6 +5,16 @@
 # See /LICENSE for more information.
 #
 
+define Profile/BTHOMEHUB2A
+  NAME:=BT Home Hub 2A
+  PACKAGES:=kmod-b43 wpad-mini \
+   kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+define Profile/BTHOMEHUB2A/Description
+  Package set optimized for BTHOMEHUB2A.
+endef
+$(eval $(call Profile,BTHOMEHUB2A))
+
 define Profile/BTV2500V
   NAME:=BT Voyager V2500V
   PACKAGES:=kmod-b43 wpad-mini
diff --git a/target/linux/brcm63xx/dts/homehub2a.dts 
b/target/linux/brcm63xx/dts/homehub2a.dts
new file mode 100644
index 000..28de528
--- /dev/null
+++ b/target/linux/brcm63xx/dts/homehub2a.dts
@@ -0,0 +1,140 @@
+/dts-v1/;
+
+/include/ "bcm6358.dtsi"
+
+/ {
+   model = "BT Home Hub 2.0 Type A";
+   compatible = "thomson,homehub2a", "brcm,bcm6358";
+
+   spi-gpio {
+   #address-cells = <1>;
+   #size-cells 

Re: [OpenWrt-Devel] [PATCH][bcm63xx]: Add DGND3700 v1 / DGND3800B support

2015-02-28 Thread dani
Ok, patch updated with latest changes in trunk, and suggestions.

About SPROM fixups, I misundertsood its purpouse. Deleted since it's not 
required.

Signed-off-by: Daniel Gonzalez 
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
index 854b3b2..69d797e 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
@@ -14,6 +14,14 @@ case "$board_name" in
 96328dg2x2)
ucidef_set_led_usbdev "usb" "USB" "A4001N:green:usb" "1-1"
;;
+DGND3700v1_3800B)
+   ucidef_set_led_netdev "lan" "LAN" "DGND3700v1_3800B:green:lan" "eth0.1"
+   ucidef_set_led_netdev "wan" "WAN" "DGND3700v1_3800B:green:inet" "eth0.2"
+   ucidef_set_led_netdev "wlan0" "WIFI2G" "DGND3700v1_3800B:green:wifi2g" 
"wlan0"
+   ucidef_set_led_netdev "wlan1" "WIFI5G" "DGND3700v1_3800B:blue:wifi5g" 
"wlan1"
+   ucidef_set_led_usbdev "usb1" "USB1" "DGND3700v1_3800B:green:usb-back" 
"1-1"
+   ucidef_set_led_usbdev "usb2" "USB2" "DGND3700v1_3800B:green:usb-front" 
"1-2"
+   ;;
 'F@ST2704V2')
ucidef_set_led_usbdev "usb" "USB" "F@ST2704V2:green:usb" "1-1"
;;
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
index 709a1c8..6b9736a 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
@@ -108,6 +108,13 @@ P870HW-51a_v2)
ucidef_add_switch_vlan "eth0" "2" "4 5t"
;;
 
+DGND3700v1_3800B)
+   ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+   ucidef_add_switch "eth0" "1" "1"
+   ucidef_add_switch_vlan "eth0" "1" "1 2 3 4 8t"
+   ucidef_add_switch_vlan "eth0" "2" "0 8t"
+   ;;
+
 NB6)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
ucidef_add_switch "switch0" "1" "1"
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh 
b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 58ce71e..53dd759 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -111,6 +111,13 @@ brcm63xx_detect() {
brcm63xx_has_reset_button="true"
ifname=eth0
;;
+
+   DGND3700v1_3800B)
+   status_led="DGND3700v1_3800B:green:power"
+   brcm63xx_has_reset_button="true"
+   ifname="eth0"
+   ;;
+
"F@ST2504n")
status_led="fast2504n:green:ok"
brcm63xx_has_reset_button="true"
diff --git a/target/linux/brcm63xx/image/Makefile 
b/target/linux/brcm63xx/image/Makefile
index dd16355..3fb9b1c 100755
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -111,6 +111,12 @@ define Image/Build/HCSDTB
--output_file=$(BIN_DIR)/openwrt-$(2)-$(1).bin
 endef
 
+define Image/Build/ChkDTB
+   # Generate Netgear factory image
+   $(STAGING_DIR_HOST)/bin/mkchkimg -o 
$(BIN_DIR)/openwrt-$(2)-$(1)-factory.chk \
+   -k $(BIN_DIR)/openwrt-$(4)-$(1)-cfe.bin -b $(5) -r $(6)
+endef
+
 define Build/Clean
$(MAKE) -C lzma-loader clean
 endef
@@ -303,6 +309,12 @@ $(eval $(call 
ImageDTB,RedBootDTB,Livebox,livebox,livebox-blue-5g))
 $(eval $(call ImageDTB,HCSDTB,CVG834G,,cvg834g,a020,0001,0022,vmlinux-cvg834g))
 # Netgear DG834GT/PN
 $(eval $(call ImageDTB,CFEDTB,DG834GTPN,DG834GT_PN,dg834gtpn,96348GW-10,6348))
+# Netgear DGND3700 v1 / DGND3800B
+$(eval $(call 
ImageDTB,CFEDTB,DGND3700v1_3800B,DGND3700v1_3800B,dgnd3700v1,96368MVWG,6368,--image-offset
 0x2 --block-size 0x2))
+#Netgear DGND3700 v1 factory firmware
+$(eval $(call 
ImageDTB,ChkDTB,DGND3700v1_3800B,DGND3700v1,,DGND3700v1_3800B,U12L144T01_NETGEAR_NEWLED,1))
+#Netgear DGND3800B factory firmware
+$(eval $(call 
ImageDTB,ChkDTB,DGND3700v1_3800B,DGND3800B,,DGND3700v1_3800B,U12L144T11_NETGEAR_NEWLED,1))
 # Pirelli Alice Gate VoIP 2 Plus Wi-Fi AGPF-S0
 $(eval $(call ImageDTB,CFEDTB,AGPF_S0,AGV2+W,agpf-s0,AGPF-S0,6358,--block-size 
0x2 --image-offset 0x2 --signature2 IMAGE --tag-version 8))
 # Pirelli A226G
diff --git a/target/linux/brcm63xx/profiles/netgear.mk 
b/target/linux/brcm63xx/profiles/netgear.mk
index 75ddab5..20224a2 100644
--- a/target/linux/brcm63xx/profiles/netgear.mk
+++ b/target/linux/brcm63xx/profiles/netgear.mk
@@ -12,7 +12,6 @@ endef
 define Profile/CVG834G/Description
   Package set optimized for CVG834G.
 endef
-
 $(eval $(call Profile,CVG834G))
 
 define Profile/DG834GTPN
@@ -23,3 +22,13 @@ define Profile/DG834GTPN/Description
   Package set optimized for DG834GT/PN.
 endef
 $(eval $(call Profile,DG834GTPN))
+
+define Profile/DGND3700v1_3800B
+  NAME:=Netgear DGND3700 v1 / DGND3800B
+  PACKAGES:=kmod-b43 wpad-mini \
+   kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+define Profile/DGND3700v1_3800B/Description
+  Packag

[OpenWrt-Devel] [PATCH][bcm63xx]: Add DGND3700 v1 / DGND3800B support

2015-02-20 Thread dani
This adds support for the Netgear DGND3700 v1 and DGND3800B. 

DGND3700 v1 and DGND3800B are exactly the same router, only one difference,
the factory firmware. This patch produces two factory firmwares for each 
router. 
The miniPCI card have two radios, I included sprom fixups bor both spite wifi 
works
ok without it.

The router includes an onboard NAND flash for extra storage. NAND is currently
not supported in bcm63xx, so no code added for this part. The NOR flash (32MB)
is enough for storing an openwrt firmware.

Signed-off-by: Daniel Gonzalez 
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
index 854b3b2..69d797e 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
@@ -14,6 +14,14 @@ case "$board_name" in
 96328dg2x2)
ucidef_set_led_usbdev "usb" "USB" "A4001N:green:usb" "1-1"
;;
+DGND3700v1_3800B)
+   ucidef_set_led_netdev "lan" "LAN" "DGND3700v1_3800B:green:lan" "eth0.1"
+   ucidef_set_led_netdev "wan" "WAN" "DGND3700v1_3800B:green:inet" "eth0.2"
+   ucidef_set_led_netdev "wlan0" "WIFI2G" "DGND3700v1_3800B:green:wifi2g" 
"wlan0"
+   ucidef_set_led_netdev "wlan1" "WIFI5G" "DGND3700v1_3800B:blue:wifi5g" 
"wlan1"
+   ucidef_set_led_usbdev "usb1" "USB1" "DGND3700v1_3800B:green:usb-back" 
"1-1"
+   ucidef_set_led_usbdev "usb2" "USB2" "DGND3700v1_3800B:green:usb-front" 
"1-2"
+   ;;
 'F@ST2704V2')
ucidef_set_led_usbdev "usb" "USB" "F@ST2704V2:green:usb" "1-1"
;;
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network 
b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
index 709a1c8..6b9736a 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
@@ -108,6 +108,13 @@ P870HW-51a_v2)
ucidef_add_switch_vlan "eth0" "2" "4 5t"
;;
 
+DGND3700v1_3800B)
+   ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+   ucidef_add_switch "eth0" "1" "1"
+   ucidef_add_switch_vlan "eth0" "1" "1 2 3 4 8t"
+   ucidef_add_switch_vlan "eth0" "2" "0 8t"
+   ;;
+
 NB6)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
ucidef_add_switch "switch0" "1" "1"
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh 
b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 58ce71e..53dd759 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -111,6 +111,13 @@ brcm63xx_detect() {
brcm63xx_has_reset_button="true"
ifname=eth0
;;
+
+   DGND3700v1_3800B)
+   status_led="DGND3700v1_3800B:green:power"
+   brcm63xx_has_reset_button="true"
+   ifname="eth0"
+   ;;
+
"F@ST2504n")
status_led="fast2504n:green:ok"
brcm63xx_has_reset_button="true"
diff --git a/target/linux/brcm63xx/image/Makefile 
b/target/linux/brcm63xx/image/Makefile
index fd1e157..4520f06 100755
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -105,6 +105,11 @@ define Image/Build/HCS
--output_file=$(BIN_DIR)/openwrt-$(2)-$(1).bin
 endef
 
+define Image/Build/Chk
+   $(STAGING_DIR_HOST)/bin/mkchkimg -o 
$(BIN_DIR)/openwrt-$(5)-$(1)-factory.chk \
+   -k $(BIN_DIR)/openwrt-$(2)-$(1)-cfe.bin -b $(3) -r $(4)
+endef
+
 define Build/Clean
$(MAKE) -C lzma-loader clean
 endef
@@ -209,6 +214,11 @@ define Image/Build
# build dtb image list
$(foreach image,$(TARGET_$(PROFILE)_IMAGES),$(call 
Image/Build/$(image),$(1)))
 
+   #Netgear DGND3700 v1 factory firmware
+   $(call 
Image/Build/Chk,$(1),DGND3700v1_3800B,U12L144T01_NETGEAR_NEWLED,1,DGND3700v1)
+   #Netgear DGND3800B factory firmware
+   $(call 
Image/Build/Chk,$(1),DGND3700v1_3800B,U12L144T11_NETGEAR_NEWLED,1,DGND3800B)
+
   ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
$(call Image/Build/Initramfs)
   endif
@@ -298,6 +308,8 @@ $(eval $(call 
ImageDTB,CFEDTB,HG556a_AB,hg556a-b,HW556,6358,HG556a_B,--rsa-signa
 $(eval $(call 
ImageDTB,CFEDTB,HG556a_C,hg556a-c,HW556,6358,HG556a_C,--rsa-signature 
"EchoLife_HG556a" --image-offset 0x2 --block-size 0x2 --tag-version 8))
 # Netgear DG834GT/PN
 $(eval $(call ImageDTB,CFEDTB,DG834GTPN,dg834gtpn,96348GW-10,6348,DG834GT_PN))
+# Netgear DGND3700 v1 / DGND3800B
+$(eval $(call 
ImageDTB,CFEDTB,DGND3700v1_3800B,dgnd3700v1,96368MVWG,6368,DGND3700v1_3800B,--image-offset
 0x2 --block-size 0x2))
 # Pirelli Alice Gate VoIP 2 Plus Wi-Fi AGPF-S0
 $(eval $(call ImageDTB,CFEDTB,AGPF_S0,agpf-s0,AGPF-S0,6358,AGV2+W,--block-size 
0x2 --image-offset 0x2 --signature2 IMAGE --tag-version 8))
 # Pirelli A226G
diff --git a/target/linux/brcm63xx/profiles/netgear.mk 
b/target/linux/brcm63xx/profiles/

[OpenWrt-Devel] [PATCH][bcm63xx]: fix Livebox 1 support

2014-05-18 Thread dani
The Livebox 1 support is currently broken. Fixed with this patch

Fixes:
- Redboot partitioning broken: fixed
- Replaced custom ephy reset with platform code
- USB code breaks the building process: fixed
- Led colors
- Removed unneded EHCI code since bcm6348 only has OHCI

Signed-off-by: Daniel Gonzalez 
Index: target/linux/brcm63xx/patches-3.10/400-bcm963xx_flashmap.patch
===
--- target/linux/brcm63xx/patches-3.10/400-bcm963xx_flashmap.patch  
(revision 40774)
+++ target/linux/brcm63xx/patches-3.10/400-bcm963xx_flashmap.patch  
(working copy)
@@ -40,7 +40,7 @@
 +  } else {
 +  for (i = 0; i < numslots; i++) {
 +  if (!strncmp(buf[i].name, "RedBoot", 8)) {
-+  fis_origin = ((buf[i].flash_base & 
(master->size << 1)) - 1);
++  fis_origin = (buf[i].flash_base & (master->size 
<< 1) - 1);
 +  }
 +  }
 +  }
Index: target/linux/brcm63xx/patches-3.10/513-board_livebox.patch
===
--- target/linux/brcm63xx/patches-3.10/513-board_livebox.patch  (revision 40774)
+++ target/linux/brcm63xx/patches-3.10/513-board_livebox.patch  (working copy)
@@ -18,7 +18,7 @@
 +obj-$(CONFIG_BOARD_LIVEBOX)   += board_livebox.o
 --- /dev/null
 +++ b/arch/mips/bcm63xx/boards/board_livebox.c
-@@ -0,0 +1,369 @@
+@@ -0,0 +1,371 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
 + * License.  See the file "COPYING" in the main directory of this archive
@@ -78,7 +78,6 @@
 +  .has_phy= 1,
 +  .use_internal_phy   = 1,
 +  },
-+
 +  .enet1 = {
 +.has_phy  = 1,
 +.phy_id   = 31,
@@ -89,7 +88,7 @@
 +
 +  .has_dsp= 0, /*TODO some Liveboxes have dsp*/
 +  .dsp = {
-+  .gpio_rst   = 6, /*FIXME eth1 shares gpio6 with 
dsp?*/
++  .gpio_rst   = 6,
 +  .gpio_int   = 35,
 +  .cs = 2,
 +  .ext_irq= 2,
@@ -97,25 +96,25 @@
 +
 +  .leds = {
 +  {
-+  .name   = "Livebox-blue-5g::adsl-fail",
++  .name   = "Livebox-blue-5g:red:adsl-fail",
 +  .gpio   = 0,
 +  .active_low = 0,
 +  .default_trigger = "default-on",
 +  },
 +  {
-+  .name   = "Livebox-blue-5g::adsl",
++  .name   = "Livebox-blue-5g:red:adsl",
 +  .gpio   = 1,
 +  },
 +  {
-+  .name   = "Livebox-blue-5g::traffic",
++  .name   = "Livebox-blue-5g:red:traffic",
 +  .gpio   = 2,
 +  },
 +  {
-+  .name   = "Livebox-blue-5g::phone",
++  .name   = "Livebox-blue-5g:red:phone",
 +  .gpio   = 3,
 +  },
 +  {
-+  .name   = "Livebox-blue-5g::wifi",
++  .name   = "Livebox-blue-5g:red:wifi",
 +  .gpio   = 4,
 +  },
 +  },
@@ -139,6 +138,9 @@
 +  },
 +
 +  },
++
++  .ephy_reset_gpio= 6,
++  .ephy_reset_gpio_flags  = GPIOF_INIT_HIGH,
 +};
 +#endif
 +
@@ -248,10 +250,6 @@
 +  if (BCMCPU_IS_6348())
 +  val |= GPIO_MODE_6348_G3_EXT_MII |
 +  GPIO_MODE_6348_G0_EXT_MII;
-+  printk(KERN_INFO PFX "resetting gpio6 for eth1...\n");
-+  gpio_request(6, "dsp_eth_rst");
-+  gpio_direction_output(6, 0);
-+  gpio_set_value(6, 1);
 +  }
 +
 +  bcm_gpio_writel(val, GPIO_MODE_REG);
@@ -317,8 +315,9 @@
 +int __init board_register_devices(void)
 +{
 +  u32 val;
++  int button_count = 0;
 +  int led_count = 0;
-+  int button_count = 0;
++  int usbh_ports = 0;
 +
 +  if (board.has_uart0)
 +  bcm63xx_uart_register(0);
@@ -337,11 +336,8 @@
 +  !board_get_mac_address(board.enet1.mac_addr))
 +  bcm63xx_enet_register(1, &board.enet1);
 +
-+  if (board.has_ehci0)
-+  bcm63xx_ehci_register();
-+
 +  if (board.has_ohci0)
-+  bcm63xx_ohci_register();
++  bcm63xx_ohci_register(usbh_ports);
 +
 +  if (board.has_dsp)
 +  bcm63xx_dsp_register(&board.dsp);
@@ -370,11 +366,17 @@
 +  while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name)
 +  led_count++;
 +
-+

[OpenWrt-Devel] [PATCH][bcm63xx]: CPVA502+ board fixes

2014-04-23 Thread dani
Some fixes for Telsey CPVA502+ bcm6348 routers:
- reset the external PHY (eth1) with proper platform code, not using a led 
definiton
- eth1 is an external phy, not a switch, deleted forced link speed
- fixed led color

Patch made for 3.14 kernel patches.
 
Signed-off-by: Daniel Gonzalez 
Index: target/linux/brcm63xx/patches-3.14/519_board_CPVA502plus.patch
===
--- target/linux/brcm63xx/patches-3.14/519_board_CPVA502plus.patch  
(revision 40563)
+++ target/linux/brcm63xx/patches-3.14/519_board_CPVA502plus.patch  
(working copy)
@@ -1,6 +1,6 @@
 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -1153,6 +1153,46 @@ static struct board_info __initdata boar
+@@ -1153,6 +1153,42 @@ static struct board_info __initdata boar
},
},
  };
@@ -21,8 +21,6 @@
 +  .enet1 = {
 +  .has_phy= 1,
 +  .phy_id = 0,
-+  .force_speed_100= 1,
-+  .force_duplex_full  = 1,
 +  },
 +
 +  .leds = {
@@ -32,22 +30,20 @@
 +  .active_low = 1,
 +  },
 +  {
-+  .name   = "CPVA502+:green:link",
++  .name   = "CPVA502+:amber:link",
 +  .gpio   = 5,
 +  .active_low = 1,
 +  },
-+  {
-+  .name   = "CPVA502+:green:feth1", /* FIXME:does 
gpio4 enable eth1 phy? */
-+  .gpio   = 4,
-+  .active_low = 1,
-+  },
 +  },
++
++  .ephy_reset_gpio= 4,
++  .ephy_reset_gpio_flags  = GPIOF_INIT_HIGH,
 +};
 +
  #endif
  
  /*
-@@ -2234,6 +2274,7 @@ static const struct board_info __initcon
+@@ -2234,6 +2270,7 @@ static const struct board_info __initcon
&board_V2110,
&board_ct536_ct5621,
&board_96348A_122,
Index: 
target/linux/brcm63xx/patches-3.14/520-bcm63xx-add-support-for-96368MVWG-board.patch
===
--- 
target/linux/brcm63xx/patches-3.14/520-bcm63xx-add-support-for-96368MVWG-board.patch
(revision 40563)
+++ 
target/linux/brcm63xx/patches-3.14/520-bcm63xx-add-support-for-96368MVWG-board.patch
(working copy)
@@ -10,7 +10,7 @@
 
 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -2238,6 +2238,85 @@ static struct board_info __initdata boar
+@@ -2234,6 +2234,85 @@ static struct board_info __initdata boar
  #endif
  
  /*
@@ -96,7 +96,7 @@
   * all boards
   */
  static const struct board_info __initconst *bcm963xx_boards[] = {
-@@ -2292,6 +2371,10 @@ static const struct board_info __initcon
+@@ -2288,6 +2367,10 @@ static const struct board_info __initcon
&board_HW553,
&board_spw303v,
  #endif
@@ -107,7 +107,7 @@
  };
  
  /*
-@@ -2473,12 +2556,25 @@ void __init board_prom_init(void)
+@@ -2469,12 +2552,25 @@ void __init board_prom_init(void)
bcm63xx_pci_enabled = 1;
if (BCMCPU_IS_6348())
val |= GPIO_MODE_6348_G2_PCI;
Index: 
target/linux/brcm63xx/patches-3.14/521-bcm63xx-add-support-for-96368MVNgr-board.patch
===
--- 
target/linux/brcm63xx/patches-3.14/521-bcm63xx-add-support-for-96368MVNgr-board.patch
   (revision 40563)
+++ 
target/linux/brcm63xx/patches-3.14/521-bcm63xx-add-support-for-96368MVNgr-board.patch
   (working copy)
@@ -9,7 +9,7 @@
 
 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -2314,6 +2314,72 @@ static struct board_info __initdata boar
+@@ -2310,6 +2310,72 @@ static struct board_info __initdata boar
.has_ohci0 = 1,
.has_ehci0 = 1,
  };
@@ -82,7 +82,7 @@
  #endif
  
  /*
-@@ -2374,6 +2440,7 @@ static const struct board_info __initcon
+@@ -2370,6 +2436,7 @@ static const struct board_info __initcon
  
  #ifdef CONFIG_BCM63XX_CPU_6368
&board_96368mvwg,
Index: 
target/linux/brcm63xx/patches-3.14/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch
===
--- 
target/linux/brcm63xx/patches-3.14/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch
 (revision 40563)
+++ 
target/linux/brcm63xx/patches-3.14/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch
 (working copy)
@@ -86,7 +86,7 @@
  #endif
  
  /*
-@@ -2423,6 +2493,7 @@ static const struct board_info __initcon
+@@ -2419,6 +2489,7 @@ static const struct board_info __initcon
  #endif
  #ifdef CONFIG_BCM63XX_CPU_6328
&board_96328avng,
Index: target/linux/brcm63xx/patches-3.14/524-board_dsl_274xb_rev_f.patch
===
--- target/linux/brcm63xx/patch

[OpenWrt-Devel] [PATCH][bcm63xx]: add Livebox 1 firmware image generation

2014-04-22 Thread dani
Currently there isn't images ready for flashing liveboxes boards. This patch 
adds a 
script and the code to call it in the  bcm63xx images builder makefile  to 
generate the
livebox 1 firmware.

I removed some lines to avoid generating unneded files in the bin/ dir for this 
board.
And added code to generate a squashed rootfs aligned to 64 kB since the current 
one in the /bin dir is 128 kB aligned and doesn't work. Still no sysupgrade 
support 
for this board. Upgrading from within openwrt can be done writing with mtd the 
kernel, 
and then the 64k aligned rootfs.

Regards

Signed-off-by: Daniel Gonzalez 
Index: target/linux/brcm63xx/image/Makefile
===
--- target/linux/brcm63xx/image/Makefile(revision 40555)
+++ target/linux/brcm63xx/image/Makefile(working copy)
@@ -89,11 +89,15 @@
 endef
 
 define Image/Build/RedBoot
-   cp $(KDIR)/vmlinux.elf $(BIN_DIR)/openwrt-$(1)-vmlinux.elf
gzip -9 -c $(KDIR)/vmlinux > $(KDIR)/vmlinux.bin.gz
-   $(STAGING_DIR_HOST)/bin/lzma e $(KDIR)/vmlinux $(KDIR)/vmlinux.bin.l7
-   dd if=$(KDIR)/vmlinux.bin.l7 of=$(BIN_DIR)/openwrt-$(1)-vmlinux.lzma 
bs=65536 conv=sync
dd if=$(KDIR)/vmlinux.bin.gz of=$(BIN_DIR)/openwrt-$(1)-vmlinux.gz 
bs=65536 conv=sync
+   dd if=$(KDIR)/root.squashfs of="$(BIN_DIR)/openwrt-$(1)-root.squashfs" 
bs=64k conv=sync
+   echo -ne \\xDE\\xAD\\xC0\\xDE >> "$(BIN_DIR)/openwrt-$(1)-root.squashfs"
+   # Generate the scripted image
+   -sh $(TOPDIR)/scripts/livebox1-image.sh \
+   "$(BIN_DIR)/openwrt-$(1)-vmlinux.gz" \
+   "$(BIN_DIR)/openwrt-$(1)-root.squashfs" \
+   "$(BIN_DIR)/openwrt-$(1)-redboot.bin"
 endef
 
 define Image/Build/SPW303V
Index: scripts/livebox1-image.sh
===
--- scripts/livebox1-image.sh   (revision 0)
+++ scripts/livebox1-image.sh   (working copy)
@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+# Livebox 1 (bcm6348) scripted image generator for RedBoot.
+#
+# The image consists of three parts:
+#  script : with the commands used by RedBoot for autoflashing: 4096 byes
+#  kernel : aligned to 64 kB
+#  rootfs : aligned to 64 kB with deadc0de appended
+
+[ -f "$1" -a -f "$2" ] || {
+   echo "Usage: $0   [output file]"
+   exit 1
+}
+
+# Calculate addresses and lenghts of Redboot partitions
+kernlength=`printf "%#x\n" $(stat -c "%s" $1)`
+rootfladdr=`printf '%#x\n' $[0xBE43+$kernlength]`
+rootlength=`printf '%#x\n' $[0xBEBF-$rootfladdr]`
+rootdatalength=`printf "%#x\n" $(stat -c "%s" $2)`
+# Calculate the offset in RAM for rootfs
+offset2=`printf '%#x\n' $[0x1000+$kernlength]`
+
+# Create script image header required by Redboot for auto flashing via tftp
+echo "fis init -f
+
+fconfig boot_script true
+fconfig boot_script_data
+fis load -b 0x8001 -d kernel
+exec -c \"noinitrd\" 0x8001
+
+
+fconfig boot_script_timeout 20
+
+fis create -o 0x1000 -f 0xBE43 -l $kernlength kernel
+
+fis create -o $offset2 -s $rootdatalength -f $rootfladdr -l $rootlength rootfs
+
+reset" > redbootscript.tmp
+
+# pad the script to end in 0x1000 RAM offset where kernel data starts
+dd if=redbootscript.tmp of=redbootscriptpad.tmp bs=4096 conv=sync
+
+# create the image
+cat redbootscriptpad.tmp $1 $2 > $3
+
+# Clean up.
+rm redbootscript.tmp redbootscriptpad.tmp

Property changes on: scripts/livebox1-image.sh
___
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH][ramips]: add support for SMCWBR14S-N3

2014-03-17 Thread dani
This patch adds support for a new rt3052 board, SMC SMCWBR14S-N3

- Only two GPIO leds, one has no label, I labeled it as "extra"
- 4 ethernet LAN, 1 ethernet WAN
- No USB port, but the pads are visible at the board ready for soldering.
- Two GPIO buttons, WPS and reset.

I'm new to this platform and it isn't clear to me the purpose of the factory 
partition, I suppose it 
has some data for the wifi calibration?, well this is mine:

: | 52 30 01 01  00 22 2D 8C  DC 9A FF FF  FF FF FF FF | 
R0..."-.Ü.ÿÿ
:0010 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:0020 | FF FF FF FF  FF FF FF FF  00 22 2D 8C  DC 98 00 22 | 
."-.Ü.."
:0030 | 2D 8C DC 99  22 08 34 12  FF FF 1E 01  55 77 A8 AA | 
-.Ü.".4.ÿÿ..Uw¨ª
:0040 | 8C 88 FF FF  0A 00 00 00  00 00 00 00  00 00 FF FF | 
..ÿÿ..ÿÿ
:0050 | FF FF 11 11  11 11 10 10  10 10 11 11  11 11 11 11 | 
ÿÿ..
:0060 | 1E 1E 1E 1E  1E 1E 1E 1E  1C 1C 1C 1C  1C 1C FF F7 | 
..ÿ÷
:0070 | E0 A0 80 44  28 10 FF 01  FF FF FF FF  FF FF FF FF | à 
.D(.ÿ.
:0080 | FF FF FF FF  FF FF FF FF  52 30 31 00  45 55 FF FF | 
R01.EUÿÿ
:0090 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:00A0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:00B0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:00C0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:00D0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF 66 66 | 
ÿÿff
:00E0 | CC AA 88 66  CC AA 88 66  CC AA 88 66  CC AA 88 66 | 
̪.f̪.f̪.f̪.f
:00F0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:0100 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:0110 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:0120 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:0130 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:0140 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:0150 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:0160 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:0170 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:0180 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:0190 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:01A0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:01B0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:01C0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:01D0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:01E0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 

:01F0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | 


I tested the patch with latest trunk flashed via uBoot, all working ok. Wifi 
works, but when active the router
becomes stunned with high CPU loads. I assume this is caused by the lack of RAM 
(only 16 MB).

Bootlogs
http://wiki.openwrt.org/toh/smc/smcwbr14s-n3#bootlogs

Signed-off-by: Daniel Gonzalez 

Index: target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
===
--- target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom  
(revision 39930)
+++ target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom  
(working copy)
@@ -96,6 +96,7 @@
rt-n15 | \
rt-n56u | \
sl-r7205 | \
+   smcwbr14s-n3 | \
v11st-fe | \
v22rw-2x2 | \
w306r-v20 | \
Index: target/linux/ramips/base-files/etc/uci-defaults/02_network
===
--- target/linux/ramips/base-files/etc/uci-defaults/02_network  (revision 39930)
+++ target/linux/ramips/base-files/etc/uci-defaults/02_network  (working copy)
@@ -96,6 +96,7 @@
f5d8235-v2 | \
hg255d | \
rt-n14u | \
+   smcwbr14s-n3 | \
wrtnode | \
ur-326n4g)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
Index: target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
===
--- target/linux/ramips/base-files/lib/preinit/06_set_iface_mac (revision 39930)
+++ target/linux/ramips/base-files/lib/preinit/06_set_iface_mac (working copy)
@@ -34,6 +34,7 @@
dir-320-b1 | \
psr-680w |\
rt-n56u |\
+   smcwbr14s-n3 |\
sl-r7205)
mac=$(mtd_get_mac_binary factory 4)
mac=$(macaddr_setbit_la "$mac")
Index: target/linux/ramips/base-files/lib/ramips.sh
=

[OpenWrt-Devel] arecord intermittent behavior

2014-03-10 Thread dani
Ok, I didn't imagine better title for this curious bug, don't think this is an 
arecord problem, it might be
a deeper problem in Openwrt.

Scenario: USB sound card installed in a MIPS BE router (bcm63xx), using OHCI 
module, alsa-utils installed. Let's make
some recordings with arecord.

arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test01.wav  <-- good
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test02.wav  <-- bad
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test03.wav  <-- bad
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test04.wav  <-- bad
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test05.wav  <-- good
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test06.wav  <-- bad
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test07.wav  <-- bad
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test08.wav  <-- bad
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test09.wav  <-- good
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test10.wav  <-- bad
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test11.wav  <-- bad
..

As you can see, there is a pattern, after exactly 4 recordings it seems the 
audio card, or maybe unknown stuff
at the system returns to a sane state where arecord can make a good job.

I tested it dozen times, always with the same pattern: 1 good recording, 3 bad

I suspected it might be an endianess problem, and decided to do the same in a 
LE device, this time bcm47xx,
an asus wl500g-premium v1, using UHCI module for the usb audiostick.

arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test01.wav  <-- good
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test02.wav  <-- bad
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test03.wav  <-- good
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test04.wav  <-- bad
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test05.wav  <-- good
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test06.wav  <-- bad
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test07.wav  <-- good
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test08.wav  <-- bad
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test09.wav  <-- good
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test10.wav  <-- bad
arecord -q -d 1 -r44100 -f S16_LE -c1 -t wav test11.wav  <-- good

The problem persists, but this time the pattern changed to 1 good, 1 bad 
recording

In both cases I used the same last trunk revisions. But I noticed this problem 
is present long time ago in 
OpenWrt.

It didn't happen in my x86 PC, and never found people complaining about this 
problem in x86 PCs
where arecord is commonly used.

Ok, I don't pretend to use arecord for anything. The problem is other apps are 
affected by this bug. I use
LIRC (audio_alsa) connected to the microphone input to send IR commands with a 
remote, and sometimes works
others don't. This was reported elsewhere by other people. So arecord is 
revealing a problem in OpenWrt.

If you want to see how does look a bad or good recording, link:
https://drive.google.com/folderview?id=0B-EMoBe-_OdBOXdPdTBaQTVOc00&usp=sharing
They are button press with an IR remote.

So, I have a simple question:
What's going on?
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] mcs814x: enable POSIX file locking - AA backport fix

2014-02-10 Thread dani
This is a critical fix for a correct system behavior, just backport it to AA. 

It was already fixed in trunk revisions:
https://dev.openwrt.org/changeset/37745

It should be also fixed in 12.09. Several stuff is broken without this fix.
Regards.

Signed-off-by: Daniel Gonzalez 

Index: target/linux/mcs814x/config-default
===
--- target/linux/mcs814x/config-default (revision 39559)
+++ target/linux/mcs814x/config-default (working copy)
@@ -52,7 +52,6 @@
 CONFIG_DTC=y
 CONFIG_EARLY_PRINTK=y
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
-# CONFIG_FILE_LOCKING is not set
 CONFIG_FIQ=y
 CONFIG_FRAME_POINTER=y
 CONFIG_GENERIC_ATOMIC64=y
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] bcm63xx: decrease bcm6348 SPI FIFO size

2014-02-02 Thread dani
Decrease the SPI FIFO size in BMC6348 boards to avoid random reads/writes.

The parameter BCM63XX_SPI_MAX_PREPEND is causing the SPI driver exceeds the 
hardware capabilities when reading transfer lengths over 58 bytes. Decreasing 
the SPI fifo size exactly  the BCM63XX_SPI_MAX_PREPEND lenght solves the 
problem.

I noticed it when I connected an external SPI flash memory to my old livebox1, 
the flash memory was correctly recognized as another mtd device with its 
partition, and everything seemed to be going well. When using dd, with block 
sizes <=58 all reads went fine, but over 58 all the reads were totally random. 
I know the SPI driver is far from being perfect, but I think It's a good idea 
to fix this if someone decides to use the BCM6348 SPI interface in his board.

With this patch the random reads never happens, when you exceed the limit it 
returns the error
unable to do transfers larger than FIFO size (%i > %i)
As done before the patch. It seems the driver still needs further work.


Signed-off-by: Daniel Gonzalez 

Index: 
target/linux/brcm63xx/patches-3.10/351-bcm6348-decrease_fifo_size_to_fix_random_reads.patch
===
--- 
target/linux/brcm63xx/patches-3.10/351-bcm6348-decrease_fifo_size_to_fix_random_reads.patch
 (revision 0)
+++ 
target/linux/brcm63xx/patches-3.10/351-bcm6348-decrease_fifo_size_to_fix_random_reads.patch
 (working copy)
@@ -0,0 +1,20 @@
+--- a/arch/mips/bcm63xx/dev-spi.c
 b/arch/mips/bcm63xx/dev-spi.c
+@@ -18,6 +18,8 @@
+ #include 
+ #include 
+ 
++#define BCM63XX_SPI_MAX_PREPEND   15
++
+ /*
+  * register offsets
+  */
+@@ -79,7 +81,7 @@
+ 
+   if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) {
+   spi_resources[0].end += BCM_6348_RSET_SPI_SIZE - 1;
+-  spi_pdata.fifo_size = SPI_6348_MSG_DATA_SIZE;
++  spi_pdata.fifo_size = SPI_6348_MSG_DATA_SIZE - 
BCM63XX_SPI_MAX_PREPEND;
+   spi_pdata.msg_type_shift = SPI_6348_MSG_TYPE_SHIFT;
+   spi_pdata.msg_ctl_width = SPI_6348_MSG_CTL_WIDTH;
+   }
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] bcm63xx: fix MIPS_L1_CACHE_SHIFT at the kernel config (trunk)

2014-01-08 Thread dani
Currently the parameter MIPS_L1_CACHE_SHIFT defaults to 5 , but should be 4.

MIPS_L1_CACHE_SHIFT = 5 matches to a cache linesize of 32 bytes, but BCM63xx 
SoCs use cores with
16 bytes linesize and therefore should be MIPS_L1_CACHE_SHIFT = 4.
This parameter is used by the compiler for some alignment in vmlinux.lds and by 
the SLAB allocator.

Signed-off-by: Daniel Gonzalez 

Index: 
target/linux/brcm63xx/patches-3.10/121-MIPS-BCM63XX-MIPS_L1_CACHE_SHIFT.patch
===
--- 
target/linux/brcm63xx/patches-3.10/121-MIPS-BCM63XX-MIPS_L1_CACHE_SHIFT.patch   
(revision 0)
+++ 
target/linux/brcm63xx/patches-3.10/121-MIPS-BCM63XX-MIPS_L1_CACHE_SHIFT.patch   
(working copy)
@@ -0,0 +1,11 @@
+--- a/arch/mips/Kconfig
 b/arch/mips/Kconfig
+@@ -1164,7 +1164,7 @@
+ 
+ config MIPS_L1_CACHE_SHIFT
+   int
+-  default "4" if MACH_DECSTATION || MIKROTIK_RB532 || PMC_MSP4200_EVAL || 
SOC_RT288X
++  default "4" if BCM63XX || MACH_DECSTATION || MIKROTIK_RB532 || 
PMC_MSP4200_EVAL || SOC_RT288X 
+   default "6" if MIPS_CPU_SCACHE
+   default "7" if SGI_IP22 || SGI_IP27 || SGI_IP28 || SNI_RM || 
CPU_CAVIUM_OCTEON
+   default "5"
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] bcm63xx: don't build CRAMFS

2013-05-03 Thread dani
Don't build the CRAMFS file system module in the kernel, and save some bytes.

No bcm63xx board needs this obsolete file system, neither those ones using 
the Redboot bootloader (liveboxes). Thus, there is no need to build it, since 
it has 
been replaced long time ago by squashfs.


Signed-off-by: Daniel Gonzalez 

Index: target/linux/brcm63xx/config-3.8
===
--- target/linux/brcm63xx/config-3.8(revision 36535)
+++ target/linux/brcm63xx/config-3.8(working copy)
@@ -36,7 +36,6 @@
 CONFIG_CPU_R4K_FPU=y
 CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
 CONFIG_CPU_SUPPORTS_HIGHMEM=y
-CONFIG_CRAMFS=y
 CONFIG_CSRC_R4K=y
 CONFIG_DECOMPRESS_LZMA=y
 CONFIG_DMA_NONCOHERENT=y

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


Re: [OpenWrt-Devel] [PATCH] bcm63xx: fix/enable livebox minipci (BB)

2013-04-23 Thread dani
Patch updated to apply on 3.8 kernel too.

Signed-off-by: Daniel Gonzalez 

Index: target/linux/brcm63xx/patches-3.7/513-board_livebox.patch
===
--- target/linux/brcm63xx/patches-3.7/513-board_livebox.patch   (revision 36407)
+++ target/linux/brcm63xx/patches-3.7/513-board_livebox.patch   (working copy)
@@ -18,7 +18,7 @@
 +obj-$(CONFIG_BOARD_LIVEBOX)   += board_livebox.o
 --- /dev/null
 +++ b/arch/mips/bcm63xx/boards/board_livebox.c
-@@ -0,0 +1,368 @@
+@@ -0,0 +1,369 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
 + * License.  See the file "COPYING" in the main directory of this archive
@@ -228,6 +228,7 @@
 +
 +#ifdef CONFIG_PCI
 +  if (board.has_pci) {
++  bcm63xx_pci_enabled = 1;
 +  if (BCMCPU_IS_6348())
 +  val |= GPIO_MODE_6348_G2_PCI;
 +  }
Index: target/linux/brcm63xx/patches-3.8/513-board_livebox.patch
===
--- target/linux/brcm63xx/patches-3.8/513-board_livebox.patch   (revision 36407)
+++ target/linux/brcm63xx/patches-3.8/513-board_livebox.patch   (working copy)
@@ -18,7 +18,7 @@
 +obj-$(CONFIG_BOARD_LIVEBOX)   += board_livebox.o
 --- /dev/null
 +++ b/arch/mips/bcm63xx/boards/board_livebox.c
-@@ -0,0 +1,368 @@
+@@ -0,0 +1,369 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
 + * License.  See the file "COPYING" in the main directory of this archive
@@ -228,6 +228,7 @@
 +
 +#ifdef CONFIG_PCI
 +  if (board.has_pci) {
++  bcm63xx_pci_enabled = 1;
 +  if (BCMCPU_IS_6348())
 +  val |= GPIO_MODE_6348_G2_PCI;
 +  }

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


[OpenWrt-Devel] [PATCH] bcm63xx: fix/enable livebox minipci (BB)

2013-04-23 Thread dani
2013/4/23 Jonas Gorski 
>
> On Wed, Apr 17, 2013 at 5:52 PM, danitool  wrote:
> > Enable the livebox-1 minipci, otherwise, the board won't detect
> > any device connected on it (included wifi cards).
> >
> > I've made a patch against current AA svn. I didn't notice this issue
> > earlier since I'm currently using CFE on this board. It's just a missed
> > line.
>
> Is this also broken/missing on BB? If yes, please fix it there first.

Yes it is. Here the patch for BB:

Signed-off-by: Daniel Gonzalez 

Index: target/linux/brcm63xx/patches-3.7/513-board_livebox.patch
===
--- target/linux/brcm63xx/patches-3.7/513-board_livebox.patch   (revision 36405)
+++ target/linux/brcm63xx/patches-3.7/513-board_livebox.patch   (working copy)
@@ -18,7 +18,7 @@
 +obj-$(CONFIG_BOARD_LIVEBOX)   += board_livebox.o
 --- /dev/null
 +++ b/arch/mips/bcm63xx/boards/board_livebox.c
-@@ -0,0 +1,368 @@
+@@ -0,0 +1,369 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General Public
 + * License.  See the file "COPYING" in the main directory of this archive
@@ -228,6 +228,7 @@
 +
 +#ifdef CONFIG_PCI
 +  if (board.has_pci) {
++  bcm63xx_pci_enabled = 1;
 +  if (BCMCPU_IS_6348())
 +  val |= GPIO_MODE_6348_G2_PCI;
 +  }

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


[OpenWrt-Devel] [PATCH] [lantiq] AA: Fix ARV4518PW wifi

2013-04-13 Thread dani
This patch corrects an issue with the wifi for the ARV4518PW in
Attitude Adjustment that involves the PCI bus configuration in this
board.

I'm trying to guess if gmail webinterface is really able to send clean
patches. Sorry for the disturbances.

Signed-off-by: Jose Vazquez Fernandez  gmail.com>
Index: target/linux/lantiq/files/arch/mips/lantiq/xway/mach-arv.c
===
--- target/linux/lantiq/files/arch/mips/lantiq/xway/mach-arv.c  (revision: 
36330)
+++ target/linux/lantiq/files/arch/mips/lantiq/xway/mach-arv.c  (copia
de trabajo)
@@ -529,7 +529,7 @@
ltq_register_gpio_keys_polled(-1, LTQ_KEYS_POLL_INTERVAL,
ARRAY_SIZE(arv4518pw_gpio_keys), 
arv4518pw_gpio_keys);
arv_load_nor(0x40);
-   ltq_pci_data.gpio = PCI_GNT2 | PCI_REQ2;
+   // ltq_pci_data.gpio = PCI_GNT2 | PCI_REQ2;
ltq_register_pci(

Re: [OpenWrt-Devel] [PATCH] bcm63xx: HW553 buttons and net patch

2012-10-27 Thread dani
Again this patch tested against current AA. I didn't include refresh patches.

The patch is in the attachment. It seems gmail decided to add some
spaces in the previous plain text patches I sent.

Regards.


hw553.patch
Description: Binary data
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] HW553: buttons and net patch

2012-10-08 Thread dani
- Added the buttons for this bcm6358 board.
- The internal phy is unused in this board, deleted.

Index: target/linux/brcm63xx/patches-3.3/board_HW553_buttons_net.patch
===
--- target/linux/brcm63xx/patches-3.3/board_HW553_buttons_net.patch 
(revisión:
0)
+++ target/linux/brcm63xx/patches-3.3/board_HW553_buttons_net.patch (copia
de trabajo)
@@ -0,0 +1,43 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
 b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -2500,15 +2500,9 @@
+
+   .has_uart0  = 1,
+
+-  .has_enet0  = 1,
+   .has_enet1  = 1,
+   .has_pci= 1,
+
+-  .enet0 = {
+-  .has_phy= 1,
+-  .use_internal_phy   = 1,
+-  },
+-
+   .enet1 = {
+   .force_speed_100= 1,
+   .force_duplex_full  = 1,
+@@ -2566,6 +2560,24 @@
+   .active_low = 1,
+   },
+   },
++  .buttons = {
++  {
++  .desc   = "reset",
++  .gpio   = 37,
++  .type   = EV_KEY,
++  .code   = KEY_RESTART,
++  .active_low = 1,
++  .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
++  },
++  {
++  .desc   = "wps",
++  .gpio   = 9,
++  .type   = EV_KEY,
++  .code   = KEY_WPS_BUTTON,
++  .active_low = 1,
++  .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
++  },
++  },
+ };
+
+  /* T-Home Speedport W 303V Typ B */
Index: target/linux/brcm63xx/base-files/lib/brcm63xx.sh
===
--- target/linux/brcm63xx/base-files/lib/brcm63xx.sh(revisión: 33652)
+++ target/linux/brcm63xx/base-files/lib/brcm63xx.sh(copia de trabajo)
@@ -82,6 +82,11 @@
brcm63xx_has_reset_button="true"
ifname=eth0
;;
+   HW553)
+   status_led="HW553:red:power"
+   brcm63xx_has_reset_button="true"
+   ifname=eth0
+   ;;
NB6)
brcm63xx_has_reset_button="true"
ifname=eth0
Index: target/linux/brcm63xx/base-files/etc/uci-defaults/network
===
--- target/linux/brcm63xx/base-files/etc/uci-defaults/network   (revisión: 
33652)
+++ target/linux/brcm63xx/base-files/etc/uci-defaults/network   (copia de 
trabajo)
@@ -19,6 +19,7 @@
 96348A-122 |\
 96358-502V |\
 CT6373-1 |\
+HW553 |\
 AW4339U |\
 CPVA642 |\
 CT536_CT5621 |\
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] mmc_spi on bcm6348 board

2012-09-27 Thread dani
z max --> 0
[2.724000] mmc_spi spi0.0: Setting clock register to 01 (hz 0)
[2.724000] mmc_spi spi0.0: txrx: tx 8093ef00, rx 8093ef00, len 9
[2.724000] mmc_spi spi0.0: Setting clock register to 01 (hz 0)
[2.724000] mmc_spi spi0.0: txrx: tx 8093de00, rx 8093ef00, len 1
[2.724000] mmc_spi spi0.0: Setting clock register to 01 (hz 0)
[2.724000] mmc_spi spi0.0: txrx: tx 8093de00, rx 8093ef00, len 1
[2.724000] mmc_spi spi0.0: bcm63xx_spi_setup, mode 0, 8 bits/w, 0 nsec/bit
[2.728000] mmc_spi spi0.0: setup mode 0, 8 bits/w, 40 Hz max --> 0
[2.728000] mmc0: error -14 whilst initialising MMC card

At least now it doesn't complain about "mmc_spi spi0.0:
bcm63xx_spi_check_transfer, unsupported"

I still don't know if something missing in the code or just a problem
of hardware (should I add pullup resistors?).

Regards


2012/9/27 Florian Fainelli :
> On Wednesday 26 September 2012 22:35:00 dani wrote:
>> Ok, I started again with a clean kernel. These are exactly the changes I've
> made
>>
>>
>> --- board_livebox 1.c 2012-09-26 21:25:19.0 +0200
>> +++ board_livebox.c   2012-09-26 22:13:01.095795124 +0200
>> @@ -17,6 +17,7 @@
>>  #include 
>>  #include 
>>  #include 
>> + #include 
>>  #include 
>>  #include 
>>  #include 
>> @@ -43,6 +44,19 @@
>>  /*
>>   * known 6348 boards
>>   */
>> +static struct mmc_spi_platform_data blue5g_mmc_spi_pdata = {
>> + .detect_delay = 1000,
>> +};
>> +
>> +static struct spi_board_info blue5g_spi_devices[] = {
>> + {
>> + .modalias = "mmc_spi",
>> + .max_speed_hz = 2000,
>> + .bus_num = 0,
>> + .platform_data = &blue5g_mmc_spi_pdata
>> + }
>> +};
>> +
>>  #ifdef CONFIG_BCM63XX_CPU_6348
>>  static struct board_info __initdata board_livebox_blue5g = {
>>   .name   = "Livebox-blue-5g",
>> @@ -118,6 +132,8 @@
>>   },
>>
>>   },
>> + .spis = blue5g_spi_devices,
>> + .num_spis = ARRAY_SIZE(blue5g_spi_devices),
>>  };
>>  #endif
>>
>>
>> I've enabled also
>> <*> Broadcom BCM63xx SPI controller
>> in the kernel since the BCM63XX HS SPI controller driver seem to be
>> for SoC > bcm6348
>> And
>> <*> MMC block device driver
>> (8) Number of minors per block device
>> [*] Use bounce buffer for simple hosts
>> <*> MMC/SD/SDIO over SPI
>> Also some related debug stuff.
>>
>> This is again the dmesg (more verbose):
>>
>> root@OpenWrt:/# dmesg |grep 'spi\|mmc'
>> [ 0.50] bcm63xx-spi bcm63xx-spi: registered master spi0
>> [ 0.50] spi spi0.0: bcm63xx_spi_setup, mode 0, 8 bits/w, 0 nsec/bit
>> [ 0.50] spi spi0.0: setup mode 0, 8 bits/w, 2000 Hz max --> 0
>> [ 0.504000] bcm63xx-spi bcm63xx-spi: registered child spi0.0
>> [ 0.504000] bcm63xx-spi bcm63xx-spi: at 0xfffe0c00 (irq 9, FIFOs size 63)
> v0.1.2
>> [ 0.584000] mmc_spi spi0.0: bcm63xx_spi_setup, mode 0, 8 bits/w, 0 nsec/bit
>> [ 0.584000] mmc_spi spi0.0: setup mode 0, 8 bits/w, 2000 Hz max --> 0
>> [ 0.584000] mmc_spi spi0.0: ASSUMING 3.2-3.4 V slot power
>> [ 0.592000] mmc0: clock 0Hz busmode 0 powermode 0 cs 0 Vdd 0 width 0 timing
> 0
>> [ 0.592000] mmc_spi spi0.0: SD/MMC host mmc0, no DMA, no WP, no poweroff
>> [ 0.60] mmc0: mmc_rescan_try_freq: trying to init card at 40 Hz
>> [ 0.608000] mmc0: clock 0Hz busmode 2 powermode 1 cs 1 Vdd 21 width 0 timing
> 0
>> [ 0.608000] mmc_spi spi0.0: mmc_spi: power up (21)
>> [ 0.636000] mmc0: clock 40Hz busmode 2 powermode 2 cs 1 Vdd 21
>> width 0 timing 0
>> [ 0.64] mmc_spi spi0.0: mmc_spi: power on (21)
>> [ 0.64] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
>> bits_per_word=0
>> [ 0.652000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
>> bits_per_word=0
>> [ 0.66] mmc_spi spi0.0: setup: unsupported mode bits 4
>> [ 0.664000] mmc_spi spi0.0: can't change chip-select polarity
>> [ 0.672000] mmc_spi spi0.0: bcm63xx_spi_setup, mode 0, 8 bits/w, 0 nsec/bit
>> [ 0.672000] mmc_spi spi0.0: setup mode 0, 8 bits/w, 40 Hz max --> 0
>> [ 0.672000] mmc_spi spi0.0: mmc_spi: clock to 40 Hz, 0
>> [ 0.696000] mmc0: starting CMD52 arg 0c00 flags 0195
>> [ 0.696000] mmc_spi spi0.0: mmc_spi: CMD52, resp R2/R5
>> [ 0.696000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
>> bits_per_word=0
>> [ 0.724000] mmc_spi spi0.0: ... write returned -22
>> [ 0.724000] mmc0: req done (CM

Re: [OpenWrt-Devel] mmc_spi on bcm6348 board

2012-09-26 Thread dani
i0.0: ... write returned -22
[ 1.028000] mmc0: req failed (CMD5): -22, retrying...
[ 1.028000] mmc_spi spi0.0: mmc_spi: CMD5, resp R3/R4/R7
[ 1.028000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 1.036000] mmc_spi spi0.0: ... write returned -22
[ 1.036000] mmc0: req done (CMD5): -22:    
[ 1.036000] mmc0: starting CMD55 arg  flags 00f5
[ 1.036000] mmc_spi spi0.0: mmc_spi: CMD55, resp R1
[ 1.036000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 1.044000] mmc_spi spi0.0: ... write returned -22
[ 1.044000] mmc0: req done (CMD55): -22:    
[ 1.044000] mmc0: starting CMD55 arg  flags 00f5
[ 1.044000] mmc_spi spi0.0: mmc_spi: CMD55, resp R1
[ 1.044000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 1.052000] mmc_spi spi0.0: ... write returned -22
[ 1.052000] mmc0: req done (CMD55): -22:    
[ 1.052000] mmc0: starting CMD55 arg  flags 00f5
[ 1.052000] mmc_spi spi0.0: mmc_spi: CMD55, resp R1
[ 1.052000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 1.06] mmc_spi spi0.0: ... write returned -22
[ 1.06] mmc0: req done (CMD55): -22:    
[ 1.06] mmc0: starting CMD55 arg  flags 00f5
[ 1.06] mmc_spi spi0.0: mmc_spi: CMD55, resp R1
[ 1.06] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 1.068000] mmc_spi spi0.0: ... write returned -22
[ 1.068000] mmc0: req done (CMD55): -22:    
[ 1.068000] mmc0: starting CMD1 arg  flags 00e1
[ 1.068000] mmc_spi spi0.0: mmc_spi: CMD1, resp R1
[ 1.068000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 1.08] mmc_spi spi0.0: ... write returned -22
[ 1.08] mmc0: req done (CMD1): -22:    
[ 1.08] mmc0: clock 0Hz busmode 2 powermode 0 cs 1 Vdd 0 width 0 timing 0
[ 1.08] mmc_spi spi0.0: mmc_spi: power off (0)


Did anybody ever used the bcm6348 spi interface in these boards?. I
think nobody really tested it.

I'm afraid the SPI controler Openwrt code is broken for bcm6348.






2012/9/26 Florian Fainelli 
>
> Hello,
>
> On Wednesday 26 September 2012 14:41:51 dani wrote:
> > Hi, I'm trying to make a micro sd card work connected to a bcm6348 board
> > (livebox 1) SPI pins. I guessed the platform file of my device should be
> > modified in order to make the kernel comunicate with the mmc_spi and
> > recognice the microsd card.
> >
> > I added this code in my platform data file (board_livebox.c):
> >
> -
> > static struct mmc_spi_platform_data blue5g_mmc_spi_pdata = {
> > .detect_delay = 1000,
> > };
> >
> > static struct bcm63xx_spi_pdata mmc_spi_chip_info = {
> > .msg_ctl_width = 8,
> > .msg_type_shift = 6,
> > .num_chipselect = 1,
> > };
> >
> > static struct spi_board_info blue5g_spi_devices[] = {
> > {
> > .modalias = "mmc_spi",
> > .max_speed_hz = 2000,
> > .bus_num = 0,
> > .controller_data = &mmc_spi_chip_info,
>
> I do not think this belongs here. dev-spi.c already takes care of properly
> registering the SPI controller with the appropriate msg_ctl_width and
> msg_type_shift.
>
> > .platform_data = &blue5g_mmc_spi_pdata
> > }
> > };
> >
> > etc.
> >
> -
> >
> > I get this kernel messages when booting OpenWrt:
> >
> > root@OpenWrt:/# dmesg |grep spi
> > [ 0.50] bcm63xx-spi bcm63xx-spi: registered master spi0
> > [ 0.50] spi spi0.0: bcm63xx_spi_setup, mode 0, 8 bits/w, 0 nsec/bit
> > [ 0.50] spi spi0.0: setup mode 0, 8 bits/w, 2000 Hz max --> 0
> > [ 0.504000] bcm63xx-spi bcm63xx-spi: registered child spi0.0
> > [ 0.504000] bcm63xx-spi bcm63xx-spi: at 0xfffe0c00 (irq 9, FIFOs size 63)
> > v0.1.2
> > [ 0.58] mmc_spi spi0.0: bcm63xx_spi_setup, mode 0, 8 bits/w, 0 nsec/bit
> > [ 0.58] mmc_spi spi0.0: setup mode 0, 8 bits/w, 2000 Hz max --> 0
> > [ 0.58] mmc_spi spi0.0: ASSUMING 3.2-3.4 V slot power
> > [ 0.588000] mmc_spi spi0.0: SD/MMC host mmc0, no DMA, no WP, no poweroff
> > [ 0.628000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
> > bits_per_word=0
> > [ 0.664000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
> > bits_per_word=0
> > [ 0.672000] mmc_spi spi0.0: setup: unsupported mode bits 4
> > [ 0.68] mmc_spi spi0.0: can't c

[OpenWrt-Devel] mmc_spi on bcm6348 board

2012-09-26 Thread dani
Hi, I'm trying to make a micro sd card work connected to a bcm6348 board
(livebox 1) SPI pins. I guessed the platform file of my device should be
modified in order to make the kernel comunicate with the mmc_spi and
recognice the microsd card.

I added this code in my platform data file (board_livebox.c):
-
static struct mmc_spi_platform_data blue5g_mmc_spi_pdata = {
.detect_delay = 1000,
};

static struct bcm63xx_spi_pdata mmc_spi_chip_info = {
.msg_ctl_width = 8,
.msg_type_shift = 6,
.num_chipselect = 1,
};

static struct spi_board_info blue5g_spi_devices[] = {
{
.modalias = "mmc_spi",
.max_speed_hz = 2000,
.bus_num = 0,
.controller_data = &mmc_spi_chip_info,
.platform_data = &blue5g_mmc_spi_pdata
}
};

etc.
-

I get this kernel messages when booting OpenWrt:

root@OpenWrt:/# dmesg |grep spi
[ 0.50] bcm63xx-spi bcm63xx-spi: registered master spi0
[ 0.50] spi spi0.0: bcm63xx_spi_setup, mode 0, 8 bits/w, 0 nsec/bit
[ 0.50] spi spi0.0: setup mode 0, 8 bits/w, 2000 Hz max --> 0
[ 0.504000] bcm63xx-spi bcm63xx-spi: registered child spi0.0
[ 0.504000] bcm63xx-spi bcm63xx-spi: at 0xfffe0c00 (irq 9, FIFOs size 63)
v0.1.2
[ 0.58] mmc_spi spi0.0: bcm63xx_spi_setup, mode 0, 8 bits/w, 0 nsec/bit
[ 0.58] mmc_spi spi0.0: setup mode 0, 8 bits/w, 2000 Hz max --> 0
[ 0.58] mmc_spi spi0.0: ASSUMING 3.2-3.4 V slot power
[ 0.588000] mmc_spi spi0.0: SD/MMC host mmc0, no DMA, no WP, no poweroff
[ 0.628000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 0.664000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 0.672000] mmc_spi spi0.0: setup: unsupported mode bits 4
[ 0.68] mmc_spi spi0.0: can't change chip-select polarity
[ 0.684000] mmc_spi spi0.0: bcm63xx_spi_setup, mode 0, 8 bits/w, 0 nsec/bit
[ 0.684000] mmc_spi spi0.0: setup mode 0, 8 bits/w, 40 Hz max --> 0
[ 0.704000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 0.724000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 0.972000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 0.98] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 0.988000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 0.996000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 1.008000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 1.016000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 1.024000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 1.032000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 1.04] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 1.048000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0
[ 1.056000] mmc_spi spi0.0: bcm63xx_spi_check_transfer, unsupported
bits_per_word=0

I tried different values/variables in the previous code, but with almost
the same result always. Isn't the mmc_spi supported by this particular
SoC?. Any bug? or did I miss something?

I use a 8GB Kingston SDHC (Class 4) microSD which seems to be tested OK in
a RB433AH acordingly to:
http://wiki.mikrotik.com/wiki/Supported_Hardware#Memory_cards

The pins are soldered directly fom the card to CS, MOSI, MISO, CLK spi pins
at the SoC. No gpio used for CS.

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


Re: [OpenWrt-Devel] Strange behaviour in Wi-Fi link adaptation

2012-09-20 Thread Dani Camps
Hi Ben,

I do not know how the graph is computed, but my guess was that what the graph 
shows is the PHY rate that Wi-Fi would employ to transmit packets, not the 
throughput going through the network. If that is the case, 6Mbps was not due to 
the link being idle, but due to the link having a bad quality, but the RSSI 
shows that that was not the case, so the link adaptation algorithm was for some 
reason miss-estimating the quality of the link.

Cheers

Daniel



 De: Ben West 
Para: OpenWrt Development List  
Enviado: Miércoles 19 de septiembre de 2012 1:33
Asunto: Re: [OpenWrt-Devel] Strange behaviour in Wi-Fi link adaptation
 
You may get more consistent throughput graphs if the wireless link is
consistently moving a steady stream traffic.  I.e. do the periods of
low rates like 6Mbps correspond to times when the link was idle?

I run Backfire 10.03.01 on a bunch of Ubiquiti M5 gear, also using the
bundled ath9k driver, and I will routinely see low rates on those
specific links that are idle, with the busy links ramping up to
200Mbit/s at times if the RSSI is good enough.  (Also, I'm using HT
modes to get double channel width, and thus higher data rates.)

On Tue, Sep 18, 2012 at 3:55 PM, Dani Camps  wrote:
> Dear all,
>
> I have OpenWrt Backfire (10.03.1, r29592), with kernel 2.6.32.27 and as
> wireless drivers ath9k. My problem is that I have been observing very
> erratic behaviours in the wireless link. Please, look at the graphic
> attached, the output corresponds to the wireless real-time graphs in
> Openwrt. The upper part is the RSSI received in the wireless router (I
> presume), as you can see is fairly constant. The lower graph is the actual
> rate that the router uses to send packets to my laptop over Wi-Fi. It is
> completely shaky oscillating from 54Mbps down to 6Mbps.
>
> Has someone experienced similar problems? The reason may be due to an
> unstable link adaptation algorithm being used in ath9k, does any one know if
> it is possible to select a different algorithm? It could also be that the
> link between the router and my laptop is unstable, but I doubt that as the
> reverse direction seems very stable (upper graph).
>
> Any help is appreciated.
>
> Cheers
>
> Daniel
>
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>



-- 
Ben West
http://gowasabi.net
b...@gowasabi.net
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Strange behaviour in Wi-Fi link adaptation

2012-09-18 Thread Dani Camps

Dear all,

I have OpenWrt Backfire (10.03.1, r29592), with kernel 2.6.32.27 and as 
wireless drivers ath9k. My problem is that I have been observing very 
erratic behaviours in the wireless link. Please, look at the graphic 
attached, the output corresponds to the wireless real-time graphs in 
Openwrt. The upper part is the RSSI received in the wireless router (I 
presume), as you can see is fairly constant. The lower graph is the 
actual rate that the router uses to send packets to my laptop over 
Wi-Fi. It is completely shaky oscillating from 54Mbps down to 6Mbps.


Has someone experienced similar problems? The reason may be due to an 
unstable link adaptation algorithm being used in ath9k, does any one 
know if it is possible to select a different algorithm? It could also be 
that the link between the router and my laptop is unstable, but I doubt 
that as the reverse direction seems very stable (upper graph).


Any help is appreciated.

Cheers

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


[OpenWrt-Devel] [PATCH] hiawatha webserver 8.4

2012-06-12 Thread dani
hello, 
i tested this patch on a wr703n, added dep on polarssl and menuconfig options 
for CACHE, 
RPROXY, SSL, TOOLKIT and XSLT.
i appreciate if you guys can review it, thanks!

Signed-off-by: Daniel Petre 

---

Index: files/php-fcgi.conf
===
--- files/php-fcgi.conf (revision 0)
+++ files/php-fcgi.conf (revision 0)
@@ -0,0 +1,23 @@
+# PHP FastCGI configuration
+
+# Path to PID-file.
+# PidFile = 
+#
+PidFile = /var/run/php-fcgi.pid
+
+# Number of maximum requests per fork before respawning.
+# MaxRequests = 
+#
+MaxRequests = 100
+
+# Set environment variables for the FastCGI processes.
+# Setenv  = 
+#
+
+# PHP FastCGI servers to start.
+# Server = ;;;[:][;]
+#
+#Server = /usr/bin/php5-cgi ; 3 ; /var/lib/hiawatha/php-fcgi.sock ; www-data
+#Server = /usr/bin/php5-cgi ; 2 ; 127.0.0.1:2005 ; 1000:100,101
+#Server = /usr/bin/php5-cgi ; 3 ; 127.0.0.1:2005 ; www-data ; 
/etc/php5/cgi/php.ini
+#Server = /usr/chroot|usr/bin/php5-cgi ; 1 ; 127.0.0.1:2005 ; www-data
Index: files/hiawatha.init
===
--- files/hiawatha.init (revision 0)
+++ files/hiawatha.init (revision 0)
@@ -0,0 +1,17 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2011 OpenWrt.org
+
+SERVICE_USE_PID=1
+
+START=50
+
+start() {
+   mkdir -m 0755 -p /var/log/hiawatha
+   mkdir -m 0755 -p /var/lib/hiawatha
+service_start /usr/sbin/hiawatha -c /etc/hiawatha/
+}
+
+stop() {
+service_stop /usr/sbin/hiawatha
+}
+
Index: files/hiawatha.conf
===
--- files/hiawatha.conf (revision 0)
+++ files/hiawatha.conf (revision 0)
@@ -0,0 +1,107 @@
+# Hiawatha main configuration file
+#
+# GENERAL SETTINGS
+#
+#ServerId = www-data
+ConnectionsTotal = 150
+ConnectionsPerIP = 10
+LogFormat = common
+SystemLogfile = /var/log/hiawatha/system.log
+GarbageLogfile = /var/log/hiawatha/garbage.log
+ExploitLogfile = /var/log/hiawatha/exploit.log
+# BINDING SETTINGS
+# A binding is where a client can connect to.
+#
+Binding {
+   Port = 80
+#  Interface = 127.0.0.1
+#  MaxKeepAlive = 30
+#  TimeForRequest = 3,20
+}
+#
+#Binding {
+#  Port = 443
+#  Interface = ::1
+#  MaxKeepAlive = 30
+#  TimeForRequest = 3,20
+#  SSLcertFile = /etc/hiawatha/hiawatha.pem
+#}
+
+
+# BANNING SETTINGS
+# Deny service to clients who misbehave.
+#
+#BanOnGarbage = 300
+#BanOnMaxPerIP = 60
+#BanOnMaxReqSize = 300
+#KickOnBan = yes
+#RebanDuringBan = yes
+
+
+# COMMON GATEWAY INTERFACE (CGI) SETTINGS
+# These settings can be used to run CGI applications. Use the 'php-fcgi'
+# tool to start PHP as a FastCGI daemon.
+#
+#CGIhandler = /usr/bin/perl:pl
+#CGIhandler = /usr/bin/php-cgi:php
+#CGIhandler = /usr/bin/python:py
+#CGIhandler = /usr/bin/ruby:rb
+#CGIhandler = /usr/bin/ssi-cgi:shtml
+#CGIextension = cgi
+#
+#FastCGIserver {
+#  FastCGIid = PHP5
+#  ConnectTo = 127.0.0.1:2005
+#  Extension = php
+#}
+
+
+# URL TOOLKIT
+# This URL toolkit rule was made for the Banshee PHP framework, which
+# can be downloaded from http://www.hiawatha-webserver.org/banshee
+#
+#UrlToolkit {
+#  ToolkitID = banshee
+#  RequestURI isfile Return
+#  Match ^/(css|files|images|js|slimstat)($|/) Return
+#  Match ^/(favicon.ico|robots.txt|sitemap.xml)$ Return
+#  Match .*\?(.*) Rewrite /index.php?$1
+#  Match .* Rewrite /index.php
+#}
+
+# DEFAULT WEBSITE
+# It is wise to use your IP address as the hostname of the default website
+# and give it a blank webpage. By doing so, automated webscanners won't find
+# your possible vulnerable website.
+#
+Hostname = 127.0.0.1
+WebsiteRoot = /www
+StartFile = index.html
+AccessLogfile = /var/log/hiawatha/access.log
+ErrorLogfile = /var/log/hiawatha/error.log
+#ErrorHandler = 404:/error.cgi
+
+
+# VIRTUAL HOSTS
+# Use a VirtualHost section to declare the websites you want to host.
+#
+#VirtualHost {
+#  Hostname = www.my-domain.com
+#  WebsiteRoot = /var/www/my-domain/public
+#  StartFile = index.php
+#  AccessLogfile = /var/www/my-domain/log/access.log
+#  ErrorLogfile = /var/www/my-domain/log/error.log
+#  TimeForCGI = 5
+#  UseFastCGI = PHP5
+#  UseToolkit = banshee
+#}
+
+
+# DIRECTORY SETTINGS
+# You can specify some settings per directory.
+#
+#Directory {
+#  Path = /home/baduser
+#  ExecuteCGI = no
+#  UploadSpeed = 10,2
+#}
Index: files/mimetype.conf
===
--- files/mimetype.conf (revision 0)
+++ files/mimetype.conf (revision 0)
@@ -0,0 +1,91 @@
+# Application
+#
+application/json   json
+application/pdfpdf
+application/pkcs-crl   crl
+application/postscript ps ai eps
+application/vnd.google-earth.kml+xml   kml
+application/vnd.google-earth.kmz   kmz
+application/xmlxml x

[OpenWrt-Devel] r31489 default ipv6 route via dual stack pppoe..

2012-04-27 Thread dani
Hello,
So i have compiled latest trunk and adjusted network, radvd, dhcp6c and dhcp6s 
config files as i knew they worked just fine few months ago but i had the 
surprise to find default ipv6 route won' t come up..
I am using pppoe on a dual stack connection, i see that some ipv6 related 
scripts from /etc/ppp are gone..
Of course i am using netifd, perhaps there is a bug with ipv6 enabled pppoe?
Thanks.

Sent from my ASUS Pad
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Lost connection to OpenWRT router

2012-04-09 Thread Dani Camps

Dear all,

I have a Netgear WNDR3700v2 with OpenWRT. The problem is that I created 
a custom boot script as explained here 
(http://wiki.openwrt.org/doc/techref/initscripts) and after rebooting I 
was not able to connect to the router.


What the custom script contained was the following:

--
# Start fprobe to send NetFlow reports to ntop
fprobe -ibr-lan 192.168.1.22:2055

# Start QoS scripts (the script described here: 
http://www.campsmur.cat/dani_home_network.html)


# Start the openVPN server, configured according to here: 
http://wiki.openwrt.org/inbox/vpn.howto.

--

I do not recall at which priority in init.d this custom init script was 
executed but I did not intentionally set any high priority.


Now after rebooting the connection with the router is lost. However, I 
do know the MAC of the router (is in the label: Netgear_9b:7d:a6) and 
the interface to which this MAC belongs, and the IP that this router 
interface was supposed to have (192.168.1.1). So if I try to ping this 
IP from a laptop connected with Ethernet (with IP 192.168.1.230) to the 
router this is what happens:


--
No. TimeSource  Destination   
Protocol Length Info
2 24.567792   192.168.1.230 192.168.1.1   ICMP 
155Echo (ping) request  id=0x10eb, seq=1/256, ttl=64
3 24.576590   Netgear_9b:7d:a6  Broadcast ARP  
60 Who has 192.168.1.230?  Tell 192.168.1.1
4 24.576625   Sony_63:75:8e Netgear_9b:7d:a6  ARP  
42 192.168.1.230 is at f0:bf:97:63:75:8e
5 25.576600   Netgear_9b:7d:a6  Broadcast ARP  
60 Who has 192.168.1.230?  Tell 192.168.1.1
6 25.576608   192.168.1.230 192.168.1.1   ICMP 
155Echo (ping) request  id=0x10eb, seq=2/512, ttl=64

...
--

The laptop already has the MAC of the router in its ARP table, therefore 
issues the PING. Then the router hears this PING, but his arp table is 
empty and therefore sends an ARP request to find out to which MAC the 
laptop's IP belongs to. Then the laptop sends a reply to this ARP 
request, but the router ignores it and does not send the ICMP reply! 
This is not only an ICMP problem, it also happens if I try to ssh or to 
connect via the Web portal. Therefore, I have the feeling that the 
problem is with the ARP process in the router.


Anyone has any idea of how to connect to the router? Would it be 
possible to try to access using IPv6 (since there is no arp)? but I have 
no experience with that. Otherwise is it possible to flash a new 
firmware to the router without IP connectivity?


Best Regards

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


[OpenWrt-Devel] Error with action mark on tc add filter

2012-03-11 Thread Dani Camps

Dear all,

I want to redirect the incoming data to eth1 into ifb1 and at the same 
time mark it for further classification in the ifb device. I am using 
the following instruction:


# tc filter add dev eth1 parent : protocol ip prio 1 u32 match u32 0 
0 flowid 1:1 action ipt -j MARK --set-mark 10 action mirred egress 
redirect dev ifb1


However, I get the following error:

File not found
 failed to find target MARK

bad action parsing
parse_action: bad value (11:ipt)!
Illegal "action"

Anyone knows if I am missing any module? I have tried to insert all 
those that seemed relevant.


Otherwise, is there any other way to mark the packets before they are 
redirected to the ifb device? I have tried with iptables on the mangle 
table and forward chain, but it is not working. I have the feeling that 
packets are being redirected before iptables gets to mark them.


Any help is appreciated.

Best Regards

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


[OpenWrt-Devel] dir-825 squashfs factory image..?

2012-02-11 Thread dani
hello,
did a make clean and removed the files in trunk/bin/ar71xx a bit earlier,
 svn updated my trunk directory for dlink dir-825 and after make i notice there 
isnt
anymore a squashfs factory image, just two for jffs2 and squashfs each of:

backup-loader and sysupgrade images..

anything changed in image generation or any idea?

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


[OpenWrt-Devel] php5 update to 5.3.10

2012-02-06 Thread dani

hello,

dani@x60t ~/wr740n/trunk $ grep PKG_VERSION 
feeds/packages/lang/php5/Makefile

PKG_VERSION:=5.3.9

maybe the maintainer can help us with the latest update patch?

http://www.php.net/archive/2012.php#id2012-02-02-1

"Security Fixes in PHP 5.3.10:

Fixed arbitrary remote code execution vulnerability reported by Stefan 
Esser, CVE-2012-0830.

All users are strongly encouraged to upgrade to PHP 5.3.10."

thanks!

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


[OpenWrt-Devel] wide-dhcp6c, duid generation and pppoe-wan ifname..

2012-02-02 Thread dani
hello,
from my tests using wide-dhcp6 client over a ipv6 enabled pppoe link it seems 
the /etc/init.d/dhcp6c script will attempt to generate duid using "pppoe-wan" 
which ofcourse does not have a hw addr.

with trunk r30004 (and using netifd) it seems "config_get wan ifname" will 
always return pppoe-wan instead of eth1 but calling "uci get 
network.wan.ifname" will get the correct ifname..

what would be a better approach for all of us, users and devs, submitting a bug 
about the openwrt scripts behavior or a small patch for wide-dhcp ?

something like:

Index: dhcp6c.init 
=== 
--- dhcp6c.init (revision 30004) 
+++ dhcp6c.init (working copy) 
@@ -24,6 +24,12 @@ 
}

dhcp6c_write_duid() { 
+ 
+ if [ "$client_device" == "pppoe-wan" ]; then 
+ local client_device="`uci get network.$client_interface.ifname`" 
+ fi 
+ 
+ 
local mac="${1:-$(ifconfig "$client_device" | sed -ne 's/[[:space:]]*$//; 
s/.*HWaddr //p')}" 
local pat="[0-9A-F][0-9A-F]"
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel