Re: [OpenWrt-Devel] [PATCH v2] ramips: add support for ELECOM WRH-300CR

2016-04-12 Thread Naoki FUKAUMI
hi,

On Tue, Apr 12, 2016 at 6:20 PM, FUKAUMI Naoki  wrote:
> diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
> b/target/linux/ramips/base-files/etc/board.d/02_network
> index 4b65d36..2863b88 100755
> --- a/target/linux/ramips/base-files/etc/board.d/02_network
> +++ b/target/linux/ramips/base-files/etc/board.d/02_network
> @@ -162,7 +162,8 @@ ramips_setup_interfaces()
> d105|\
> hpm|\
> na930|\
> -   wli-tx4-ag300n)
> +   wli-tx4-ag300n|\
> +   wrh-300cr)
> ucidef_set_interface_lan "eth0"
> ;;
> e1700|\

I want to change this part as like as follows,

+   wrh-300cr)
+   ucidef_add_switch "switch0"
+   ucidef_add_switch_attr "switch0" "enable" "false"
+   ucidef_set_interface_lan "eth0"
+   ;;

/etc/config/network is fine with this change,

config switch
option name 'switch0'
option reset '1'
option enable_vlan '0'

but, mysteriously, following LED settings are gone from /etc/config/system :(

config led 'led_wifi_led'
option name 'wifi'
option sysfs 'wrh-300cr:green:wlan'
option trigger 'netdev'
option mode 'link tx rx'
option dev 'wlan0'

config led 'led_lan'
option name 'lan'
option sysfs 'wrh-300cr:green:ethernet'
option trigger 'netdev'
option mode 'link tx rx'
option dev 'eth0'

I'm very sure that LED settings are fine without this change.
(i.e. v2 is fine for LED)

any idea?



I made backported patch for 15.05 too. following lines work fine.

+   wrh-300cr)
+   ucidef_add_switch "switch0" "1" "0"
+   ucidef_set_interface_lan "eth0"
+   ;;

this change is required for 15.05 because switch0 vlan is enabled by
default in 15.05.

on _current_ trunk, switch0 vlan is disabled, so I can give up this
change. but I'm not sure it will never be changed.



by the way, in https://dev.openwrt.org/changeset/47720, why

 ucidef_add_switch "switch0" "1" "0"

is converted into

 ucidef_add_switch_attr "switch0" "reset" "false"

?

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


[OpenWrt-Devel] [PATCH] lantiq: use new image build process for some images

2016-04-12 Thread Hauke Mehrtens
This adds for some easy images the new build process.

This was only tested on some TP-Link devices, please test.

Signed-off-by: Hauke Mehrtens 
---
 target/linux/lantiq/image/Makefile | 185 +++--
 1 file changed, 95 insertions(+), 90 deletions(-)

diff --git a/target/linux/lantiq/image/Makefile 
b/target/linux/lantiq/image/Makefile
index c3cb48a..d863a91 100644
--- a/target/linux/lantiq/image/Makefile
+++ b/target/linux/lantiq/image/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2010-2012 OpenWrt.org
+# Copyright (C) 2010-2016 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -10,6 +10,9 @@
 
 JFFS2_BLOCKSIZE = 64k 128k 256k
 
+KERNEL_LOADADDR = 0x80002000
+KERNEL_ENTRY = 0x80a0
+
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
 
@@ -269,81 +272,103 @@ endif
 endef
 
 
-ifeq ($(CONFIG_TARGET_lantiq_falcon),y)
-
-Image/BuildKernel/Profile/EASY98000NOR=$(call 
Image/BuildKernel/Template,EASY98000NOR)
-Image/Build/Profile/EASY98000NOR=$(call Image/Build/$(1),$(1),EASY98000NOR)
-
-Image/BuildKernel/Profile/EASY98000SFLASH=$(call 
Image/BuildKernel/Template,EASY98000SFLASH)
-Image/Build/Profile/EASY98000SFLASH=$(call 
Image/Build/$(1),$(1),EASY98000SFLASH)
-
-endif
-
-
-ifeq ($(CONFIG_TARGET_lantiq_ase),y)
-
-Image/BuildKernel/Profile/DGN1000B=$(call Image/BuildKernel/Template,DGN1000B)
-Image/Build/Profile/DGN1000B=$(call Image/Build/$(1),$(1),DGN1000B)
-
-endif
-
+### Kernel scripts ###
+define Build/append-dtb
+   $(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb)
+   cat $@.dtb >> $@
+endef
 
-ifeq ($(CONFIG_TARGET_lantiq_xway),y)
+define Build/tplink-fw
+   mktplinkfw2 -c -B $(BOARD_ID) -s \
+   -k $@ -o $@.new
+   mv $@.new $@
+endef
 
-# Danube
-Image/BuildKernel/Profile/BTHOMEHUBV2B=$(call 
Image/BuildKernel/Template,BTHOMEHUBV2B)
-Image/Build/Profile/BTHOMEHUBV2B=$(call Image/BuildNAND/$(1),$(1),BTHOMEHUBV2B)
+define Build/mktplinkfw2
+   mktplinkfw2 -B $(BOARD_ID) -s -a 0x4 -j \
+   -k $(word 1,$^) -r $(word 2,$^) \
+   -o $@
+endef
 
-Image/BuildKernel/Profile/EASY50712=$(call 
Image/BuildKernel/Template,EASY50712)
-Image/Build/Profile/EASY50712=$(call Image/Build/$(1),$(1),EASY50712)
 
-Image/BuildKernel/Profile/ACMP252=$(call Image/BuildKernel/Template,ACMP252)
-Image/Build/Profile/ACMP252=$(call Image/Build/$(1),$(1),ACMP252)
+# Shared device definition: applies to every defined device
+define Device/Default
+  PROFILES = Default $$(DEVICE_PROFILE)
+  KERNEL_DEPENDS = $$(wildcard ../dts/$$(DEVICE_DTS).dts)
+  KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs
+  KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
+  KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
+  FILESYSTEMS := squashfs
+  DEVICE_PROFILE :=
+  DEVICE_DTS :=
+endef
+DEVICE_VARS += BOARD_ID DEVICE_PROFILE DEVICE_DTS
 
-Image/BuildKernel/Profile/ARV4510PW=$(call 
Image/BuildKernel/Template,ARV4510PW)
-Image/Build/Profile/ARV4510PW=$(call Image/Build/$(1),$(1),ARV4510PW)
+define Device/lantiqTpLink
+  KERNEL := kernel-bin | append-dtb | lzma
+  KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | tplink-fw
+  IMAGES := tplink
+  IMAGE/tplink := mktplinkfw2
+endef
 
-Image/BuildKernel/Profile/ARV4525PW=$(call 
Image/BuildKernel/Template,ARV4525PW)
-Image/Build/Profile/ARV4525PW=$(call Image/Build/$(1),$(1),ARV4525PW)
+define lantiqTpLink
+  define Device/$(1)
+$$(Device/lantiqTpLink)
+DEVICE_PROFILE := $(1)
+DEVICE_DTS := $(1)
+BOARD_ID := $(2)
+  endef
+  TARGET_DEVICES += $(1)
+endef
 
-Image/BuildKernel/Profile/ARV7525PW=$(call 
Image/BuildKernel/Template,ARV7525PW)
-Image/Build/Profile/ARV7525PW=$(call Image/Build/$(1),$(1),ARV7525PW)
+define lantiqImage
+  define Device/$(1)
+$$(Device/lantiqImage)
+DEVICE_PROFILE := $(1)
+DEVICE_DTS := $(1)
+  endef
+  TARGET_DEVICES += $(1)
+endef
 
-Image/BuildKernel/Profile/ARV4518PWR01=$(call 
Image/BuildKernel/Template,ARV4518PWR01)
-Image/Build/Profile/ARV4518PWR01=$(call Image/Build/$(1),$(1),ARV4518PWR01)
 
-Image/BuildKernel/Profile/ARV4518PWR01A=$(call 
Image/BuildKernel/Template,ARV4518PWR01A)
-Image/Build/Profile/ARV4518PWR01A=$(call Image/Build/$(1),$(1),ARV4518PWR01A)
+ifeq ($(CONFIG_TARGET_lantiq_falcon),y)
 
-Image/BuildKernel/Profile/ARV4519PW=$(call 
Image/BuildKernel/Template,ARV4519PW)
-Image/Build/Profile/ARV4519PW=$(call Image/Build/$(1),$(1),ARV4519PW)
+$(eval $(call lantiqImage,EASY98000NOR))
+$(eval $(call lantiqImage,EASY98000SFLASH))
 
-Image/BuildKernel/Profile/ARV4520PW=$(call 
Image/BuildKernel/Template,ARV4520PW)
-Image/Build/Profile/ARV4520PW=$(call Image/Build/$(1),$(1),ARV4520PW)
+endif
 
-Image/BuildKernel/Profile/ARV452CQW=$(call 
Image/BuildKernel/Template,ARV452CQW)
-Image/Build/Profile/ARV452CQW=$(call Image/Build/$(1),$(1),ARV452CQW)
 
-Image/BuildKernel/Profile/ARV7510PW22=$(call 
Image/BuildKernel/Template,ARV7510PW22)

Re: [OpenWrt-Devel] rsync mirror of download.openwrt.org ?

2016-04-12 Thread Daniel Petre

On 04/12/2016 06:33 PM, Jo-Philipp Wich wrote:

Hi Dape,

you need to ask Kaloz to setup rsync access for you I guess.


Not sure i have his e-mail at hand but would be cool if he can white 
list 62.231.75.130 so i can start rsync already and get back tomorrow 
with the url details for the mirror offered.


Thanks!



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


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


Re: [OpenWrt-Devel] rsync mirror of download.openwrt.org ?

2016-04-12 Thread Jo-Philipp Wich
Hi Dape,

you need to ask Kaloz to setup rsync access for you I guess.

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


Re: [OpenWrt-Devel] rsync mirror of download.openwrt.org ?

2016-04-12 Thread Daniel Petre

On 04/12/2016 06:13 PM, Jo-Philipp Wich wrote:

Hi Daniel,

the entire downloads.openwrt.org is around 720GB while the 15.05.1
release is 36GB in total.


Thanks for replying. I see i have like 800 GB left on mirrors.linux.ro 
but i can find more space soon. Is there official openwrt mirroring 
instructions or it is just up to me how i download all the files?


Thanks!



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


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


[OpenWrt-Devel] [PATCH 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

Re: [OpenWrt-Devel] rsync mirror of download.openwrt.org ?

2016-04-12 Thread Jo-Philipp Wich
Hi Daniel,

the entire downloads.openwrt.org is around 720GB while the 15.05.1
release is 36GB in total.

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


[OpenWrt-Devel] [PATCH] remove .git files from images

2016-04-12 Thread joerg jungermann
If you have your ./files/ directory stored in a git repository,
the .git will be included into images using precious space.
This patch removes .git directories before packing images.

Signed-off-by: Joerg Jungermann 

diff --git a/package/Makefile b/package/Makefile
index c97e2c1..e0bd75b 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -123,6 +123,7 @@ $(curdir)/install: $(TMP_DIR)/.build 
$(curdir)/system/opkg/host/install
$(if $(SOURCE_DATE_EPOCH),sed -i "s/Installed-Time: .*/Installed-Time: 
$(SOURCE_DATE_EPOCH)/" $(TARGET_DIR)/usr/lib/opkg/status)
@-find $(TARGET_DIR) -name CVS   | $(XARGS) rm -rf
@-find $(TARGET_DIR) -name .svn  | $(XARGS) rm -rf
+   @-find $(TARGET_DIR) -name .git  | $(XARGS) rm -rf
@-find $(TARGET_DIR) -name '.#*' | $(XARGS) rm -f
rm -f $(TARGET_DIR)/usr/lib/opkg/info/*.postinst*
rm -f $(TARGET_DIR)/usr/lib/opkg/info/*.prerm*

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


Re: [OpenWrt-Devel] [RFC relayd 1/2] relayd: add ipv6 support

2016-04-12 Thread Michal Kazior
On 11 April 2016 at 17:13, Bjørn Mork  wrote:
> Michal Kazior  writes:
>
>> This adds basic IPv6 support framework. Things
>> like, e.g. DHCPv6 will not work (yeT) though
>> because link-local support requires additional
>> changes (including kernel).
>
> Could the DHCPv6 support be implemented as an LDRA instead? Ref
> https://tools.ietf.org/html/rfc6221

I guess it could but I didn't really consider it because my use case
involves link-local anyway. If link-local routing works you don't need
any extra logic to get DHCPv6 working.


Michał
___
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 Planex CS-QR10

2016-04-12 Thread YuheiOKAWA
CS-QR10 is MT7620A based IP Camera.

the camera and sound does not work with kernel 4.4.
 - camera chip is sn9c291.
 - sound chip is wm8960.

Signed-off-by: YuheiOKAWA 
---
 target/linux/ramips/base-files/etc/board.d/01_leds |   3 +-
 .../linux/ramips/base-files/etc/board.d/02_network |   1 +
 target/linux/ramips/base-files/etc/diag.sh |   1 +
 target/linux/ramips/base-files/lib/ramips.sh   |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ramips/dts/CS-QR10.dts| 163 +
 target/linux/ramips/image/mt7620.mk|   2 +
 target/linux/ramips/mt7620/profiles/planex.mk  |  19 +++
 8 files changed, 192 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ramips/dts/CS-QR10.dts
 create mode 100644 target/linux/ramips/mt7620/profiles/planex.mk

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds 
b/target/linux/ramips/base-files/etc/board.d/01_leds
index 5816e60..e319f36 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -30,7 +30,8 @@ br-6475nd|\
 mzk-w300nh2)
set_wifi_led "$board:amber:wlan"
;;
-a5-v11)
+a5-v11|\
+cs-qr10)
ucidef_set_led_default "power" "POWER" "$board:red:power" "1"
;;
 ai-br100)
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
b/target/linux/ramips/base-files/etc/board.d/02_network
index 4b65d36..416b13c 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -159,6 +159,7 @@ ramips_setup_interfaces()
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "9@eth0"
;;
+   cs-qr10|\
d105|\
hpm|\
na930|\
diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index daa7fb1..233d15c 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -32,6 +32,7 @@ get_status_led() {
status_led="$board:green:power"
;;
a5-v11|\
+   cs-qr10|\
d105|\
dcs-930l-b1|\
ex2700|\
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 5f1df7b..2df2591 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -88,6 +88,9 @@ ramips_board_detect() {
*"CF-WR800N")
name="cf-wr800n"
;;
+   *"CS-QR10")
+   name="cs-qr10"
+   ;;
*"CY-SWR1100")
name="cy-swr1100"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index c329dce..af7fb12 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -34,6 +34,7 @@ platform_check_image() {
broadway|\
carambola|\
cf-wr800n|\
+   cs-qr10|\
d105|\
dap-1350|\
db-wrt01|\
diff --git a/target/linux/ramips/dts/CS-QR10.dts 
b/target/linux/ramips/dts/CS-QR10.dts
new file mode 100644
index 000..08299e3
--- /dev/null
+++ b/target/linux/ramips/dts/CS-QR10.dts
@@ -0,0 +1,163 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+   compatible = "ralink,mt7620a-soc";
+   model = "Planex CS-QR10";
+
+   palmbus@1000 {
+   gpio0: gpio@600 {
+   status = "okay";
+   };
+
+   gpio1: gpio@638 {
+   status = "okay";
+   };
+
+   gpio2: gpio@660 {
+   status = "okay";
+   };
+
+   gpio3: gpio@688 {
+   status = "okay";
+   };
+
+   i2c@900 {
+   status = "okay";
+   };
+
+   i2s: i2s@a00 {
+   status = "okay";
+   pinctrl-names = "default";
+   pinctrl-0 = <&pcm_i2s_pins>;
+   };
+
+   spi@b00 {
+   status = "okay";
+
+   m25p80@0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "jedec,spi-nor";
+   reg = <0 0>;
+   linux,modalias = "m25p80", "mx25l6405d";
+   spi-max-frequency = <1000>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x0 0x3>;
+   read-only;
+   };
+
+   partitio

Re: [OpenWrt-Devel] mt76 wifi module on mt7688 board, no interface

2016-04-12 Thread Adam Kent
Hi Baptiste

Which board exactly? You may need to add the "wmac" definition to the
relevant dts file. Have a look in
target/linux/ramips/dts/.dts and make sure there's
this:

wmac@1030 {
status = "okay";
};

- Adam

On Tue, Apr 12, 2016 at 6:27 PM, Baptiste Clenet  wrote:
> Hi,
>
> I flashed the current tree on mt7688 board and no interface showed up
> for wifi. Should I do something? I would like to try the mt76 wifi
> driver on this board. (I added it with in menuconfig)
>
> Cheers,
>
> --
> Baptiste
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] ramips: add support for ELECOM WRH-300CR

2016-04-12 Thread FUKAUMI Naoki
ELECOM WRH-300CR is MT7620N based very small Wi-Fi router with 64MiB
DDR2 SDRAM, 16MiB SPI Flash, one fast ethernet port, and (internal but
easy-to-access) UART.

it also has internal USB hub and USB card reader which provide one USB
port, one SD card slot, and one microSD card slot.

Signed-off-by: YuheiOKAWA 
Signed-off-by: FUKAUMI Naoki 
---

Changes in v2:
- explain this product a little :)
- add an empty line in WRH-300CR.dts (cosmetic, no functional change)

 target/linux/ramips/base-files/etc/board.d/01_leds |   4 +
 .../linux/ramips/base-files/etc/board.d/02_network |   3 +-
 target/linux/ramips/base-files/etc/diag.sh |   3 +-
 target/linux/ramips/base-files/lib/ramips.sh   |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ramips/dts/WRH-300CR.dts  | 127 +
 target/linux/ramips/image/mt7620.mk|  15 +++
 target/linux/ramips/mt7620/profiles/elecom.mk  |  18 +++
 8 files changed, 172 insertions(+), 2 deletions(-)
 create mode 100644 target/linux/ramips/dts/WRH-300CR.dts
 create mode 100644 target/linux/ramips/mt7620/profiles/elecom.mk

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds 
b/target/linux/ramips/base-files/etc/board.d/01_leds
index 5816e60..0ba26d2 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -264,6 +264,10 @@ whr-600d)
 wnce2001)
set_wifi_led "$board:green:wlan"
;;
+wrh-300cr)
+   set_wifi_led "$board:green:wlan"
+   ucidef_set_led_netdev "lan" "lan" "$board:green:ethernet" "eth0"
+   ;;
 wt3020)
ucidef_set_led_default "power" "power" "$board:blue:power" "0"
;;
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
b/target/linux/ramips/base-files/etc/board.d/02_network
index 4b65d36..2863b88 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -162,7 +162,8 @@ ramips_setup_interfaces()
d105|\
hpm|\
na930|\
-   wli-tx4-ag300n)
+   wli-tx4-ag300n|\
+   wrh-300cr)
ucidef_set_interface_lan "eth0"
;;
e1700|\
diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index daa7fb1..31d9646 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -73,7 +73,8 @@ get_status_led() {
status_led="$board:green:run"
;;
awapn2403|\
-   dir-645)
+   dir-645|\
+   wrh-300cr)
status_led="$board:green:wps"
;;
cf-wr800n|\
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 5f1df7b..459de6f 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -460,6 +460,9 @@ ramips_board_detect() {
*"WR6202")
name="wr6202"
;;
+   *"WRH-300CR")
+   name="wrh-300cr"
+   ;;
*"WRTNODE")
name="wrtnode"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index c329dce..6e287d4 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -135,6 +135,7 @@ platform_check_image() {
wnce2001|\
wr512-3gn|\
wr6202|\
+   wrh-300cr|\
wrtnode|\
wrtnode2r |\
wrtnode2p |\
diff --git a/target/linux/ramips/dts/WRH-300CR.dts 
b/target/linux/ramips/dts/WRH-300CR.dts
new file mode 100644
index 000..79962e9
--- /dev/null
+++ b/target/linux/ramips/dts/WRH-300CR.dts
@@ -0,0 +1,127 @@
+/dts-v1/;
+
+/include/ "mt7620n.dtsi"
+
+/ {
+   compatible = "elecom,wrh-300cr", "ralink,mt7620n-soc";
+   model = "ELECOM WRH-300CR";
+
+   palmbus@1000 {
+   gpio1: gpio@638 {
+   status = "okay";
+   };
+
+   gpio2: gpio@660 {
+   status = "okay";
+   };
+
+   gpio3: gpio@688 {
+   status = "okay";
+   };
+
+   spi@b00 {
+   status = "okay";
+
+   m25p80@0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "jedec,spi-nor";
+   reg = <0 0>;
+   linux,modalias = "m25p80", "mx25l12805d";
+   spi-max-frequency = <1000>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x0 0x3>;
+   

[OpenWrt-Devel] [PATCH v2 2/3] [rpcd] file: handle return output of b64_decode

2016-04-12 Thread Luka Perkov
Solve this compile warning:

file.c:300:16: error: comparison of unsigned expression < 0 is always false 
[-Werror,-Wtautological-compare]
if (data_len < 0)

Signed-off-by: Luka Perkov 
---

v1 -> v2:

Chage int to ssize_t.

---
 file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/file.c b/file.c
index 91a55a1..6ddde32 100644
--- a/file.c
+++ b/file.c
@@ -271,7 +271,7 @@ rpc_file_write(struct ubus_context *ctx, struct ubus_object 
*obj,
mode_t prev_mode, mode = 0666;
int fd, rv = 0;
void *data = NULL;
-   size_t data_len = 0;
+   ssize_t data_len = 0;
 
blobmsg_parse(rpc_file_rw_policy, __RPC_F_RW_MAX, tb,
  blob_data(msg), blob_len(msg));
-- 
2.8.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] mt76 wifi module on mt7688 board, no interface

2016-04-12 Thread Baptiste Clenet
Hi,

I flashed the current tree on mt7688 board and no interface showed up
for wifi. Should I do something? I would like to try the mt76 wifi
driver on this board. (I added it with in menuconfig)

Cheers,

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


[OpenWrt-Devel] [PATCHv2] ar71xx: Add support for the OMYlink OMY-G1

2016-04-12 Thread L. D. Pinney
https://wiki.openwrt.org/toh/omylink/omy-g1

http://www.omylink.com/

Signed-off-by: L. D. Pinney 

---

v2 corrects the Device name in Subject

 target/linux/ar71xx/base-files/etc/board.d/01_leds|   5 +++
 target/linux/ar71xx/base-files/etc/board.d/02_network |   1 +
 target/linux/ar71xx/base-files/etc/diag.sh|   3 ++
 target/linux/ar71xx/base-files/lib/ar71xx.sh  |   3 ++
 target/linux/ar71xx/base-files/lib/upgrade/platform.sh|   1 +
 target/linux/ar71xx/config-4.1|   1 +
 target/linux/ar71xx/config-4.4|   1 +
 target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt |  10 ++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile|   1 +
 target/linux/ar71xx/files/arch/mips/ath79/mach-omy-g1.c   | 123 
++
 target/linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/generic/profiles/omy.mk   |  10 ++
 target/linux/ar71xx/image/Makefile|   9 -
 tools/firmware-utils/src/mktplinkfw.c |   1 +
 14 files changed, 169 insertions(+), 1 deletion(-)

diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds 
b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index b2469bf..4546107 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -398,6 +398,11 @@ om5p-ac)
ucidef_set_led_netdev "port1" "port1" "om5pac:blue:lan" "eth0"
ucidef_set_led_netdev "port2" "port2" "om5pac:blue:wan" "eth1"
;;
+omy-g1)
+   ucidef_set_led_wlan "wlan" "WLAN" "omy:green:wlan" "phy0tpt"
+   ucidef_set_led_netdev "wan" "WAN" "omy:green:wan" "eth0"
+   ucidef_set_led_netdev "lan" "LAN" "omy:green:lan" "eth1"
+   ;;
 
 omy-x1)
ucidef_set_led_default "power" "POWER" "omy:green:power" "1"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index 8fdfa07..7724a08 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -220,6 +220,7 @@ tl-wr941nd)
;;
 
 dir-615-i1 |\
+omy-g1 |\
 r6100 |\
 smart-300 |\
 tl-mr3420-v2 |\
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index 1f9bd3f..77fa398 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -218,6 +218,9 @@ get_status_led() {
om5p-acv2)
status_led="om5pac:blue:power"
;;
+   omy-g1)
+   status_led="omy:green:wlan"
+   ;;
omy-x1)
status_led="omy:green:power"
;;
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 3d4541e..0c9dddc 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -123,6 +123,9 @@ tplink_board_detect() {
"007260"*)
model="TellStick ZNet Lite"
;;
+   "066601"*)
+   model="OMYlink OMY-G1"
+   ;;
"066602"*)
model="OMYlink OMY-X1"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index d44ece5..5334600 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -340,6 +340,7 @@ platform_check_image() {
gl-inet | \
mc-mac1200r | \
minibox-v1 |\
+   omy-g1 |\
omy-x1 |\
onion-omega | \
oolite | \
diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index fa98643..40cf453 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -111,6 +111,7 @@ CONFIG_ATH79_MACH_OM2P=y
 CONFIG_ATH79_MACH_OM5P=y
 CONFIG_ATH79_MACH_OM5P_AC=y
 CONFIG_ATH79_MACH_OM5P_ACv2=y
+CONFIG_ATH79_MACH_OMY_G1=y
 CONFIG_ATH79_MACH_OMY_X1=y
 CONFIG_ATH79_MACH_ONION_OMEGA=y
 CONFIG_ATH79_MACH_PB42=y
diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index ec04c28..860b1e1 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -114,6 +114,7 @@ CONFIG_ATH79_MACH_OM2P=y
 CONFIG_ATH79_MACH_OM5P=y
 CONFIG_ATH79_MACH_OM5P_AC=y
 CONFIG_ATH79_MACH_OM5P_ACv2=y
+CONFIG_ATH79_MACH_OMY_G1=y
 CONFIG_ATH79_MACH_OMY_X1=y
 CONFIG_ATH79_MACH_ONION_OMEGA=y
 CONFIG_ATH79_MACH_PB42=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt 
b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index 8c77645..e6879a9 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -89