Re: [OpenWrt-Devel] [PATCH] oxnas: add some default packages of router

2015-11-21 Thread John Crispin
Hi,

On 07/11/2015 21:12, Shonn Lu wrote:
> Signed-off-by: Shonn Lu 
> ---
>  target/linux/oxnas/Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/target/linux/oxnas/Makefile b/target/linux/oxnas/Makefile
> index 32bcab8..87b9489 100644
> --- a/target/linux/oxnas/Makefile
> +++ b/target/linux/oxnas/Makefile
> @@ -22,7 +22,8 @@ include $(INCLUDE_DIR)/target.mk
>  DEFAULT_PACKAGES += \
>   kmod-ata-core kmod-ata-oxnas-sata kmod-button-hotplug \
>   kmod-input-gpio-keys-polled kmod-leds-gpio kmod-usb2-oxnas \
> - uboot-envtools uboot-oxnas-ox820
> + uboot-envtools uboot-oxnas-ox820 \
> + dnsmasq iptables ip6tables ppp ppp-mod-pppoe kmod-nf-nathelper firewall 
> odhcpd odhcp6c

unfortunatley we cant merge this. if you look further up in this file
you will see this line

DEVICE_TYPE:=nas

it overrides the default router package selection and only selects nas
defaults. adding the router packages back this way would be the wrong
approach.

John

>  
>  KERNELNAME:=zImage dtbs
>  
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v2] [ramips] mt7621: add support for netis WF-2881‏

2015-11-21 Thread John Crispin
Hi,

the patch does not apply. is this against trunk or CC ?

John

On 14/11/2015 15:32, YounJaeRho wrote:
> netis WF-2881 is an MT7621AT based router with MT7602EN, MT7612EN.
> It has 128MB DDR3, 128MB SLC NAND FLASH, 5-port Gbps switch and 1x USB 3.0.
> The following patch adds support for this device.
> 
> Tested and working:
> * ethernet
> * both WiFi radios
> * USB 3.0
> * buttons (reset button)
> * ethernet switch and USB diag LEDs
> * UART
> * GPIOs
> 
> 
> Signed-off-by: YounJae Rho 
> ---
> Violation of alphabet ordering, indentation, naming, etc from previous 
> version are resolved.
> Thanks Piotr Dymacz.
> 
> 
>  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/WF-2881.dts| 123 
> +
>  target/linux/ramips/image/Makefile |   6 +-
>  target/linux/ramips/mt7621/config-3.18 |   4 +-
>  target/linux/ramips/mt7621/profiles/netis.mk   |  18 +++
>  9 files changed, 157 insertions(+), 3 deletions(-)
>  create mode 100644 target/linux/ramips/dts/WF-2881.dts
>  create mode 100644 target/linux/ramips/mt7621/profiles/netis.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 c75a993..f9f8e3e 100755
> --- a/target/linux/ramips/base-files/etc/board.d/01_leds
> +++ b/target/linux/ramips/base-files/etc/board.d/01_leds
> @@ -44,7 +44,8 @@ air3gii)
>  all0239-3g|\
>  hw550-3g|\
>  mofi3500-3gn|\
> -sap-g3200u3)
> +sap-g3200u3|\
> +wf-2881)
>   set_usb_led "$board:green:usb"
>   ;;
>  all0256n)
> 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 0732796..d3f8121 100755
> --- a/target/linux/ramips/base-files/etc/board.d/02_network
> +++ b/target/linux/ramips/base-files/etc/board.d/02_network
> @@ -78,6 +78,7 @@ ramips_setup_interfaces()
>   oy-0001|\
>   pbr-m1|\
>   sap-g3200u3|\
> + wf-2881|\
>   whr-300hp2|\
>   whr-600d|\
>   wsr-1166|\
> diff --git a/target/linux/ramips/base-files/etc/diag.sh 
> b/target/linux/ramips/base-files/etc/diag.sh
> index 5376759..7d16f2c 100644
> --- a/target/linux/ramips/base-files/etc/diag.sh
> +++ b/target/linux/ramips/base-files/etc/diag.sh
> @@ -150,6 +150,7 @@ get_status_led() {
>   tew-692gr|\
>   ur-326n4g|\
>   ur-336un|\
> + wf-2881|\
>   wr512-3gn)
>   status_led="$board:green:wps"
>   ;;
> diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
> b/target/linux/ramips/base-files/lib/ramips.sh
> index 340bc4c..5ee494e 100755
> --- a/target/linux/ramips/base-files/lib/ramips.sh
> +++ b/target/linux/ramips/base-files/lib/ramips.sh
> @@ -373,6 +373,9 @@ ramips_board_detect() {
>   *"WCR-150GN")
>   name="wcr-150gn"
>   ;;
> + *"WF-2881")
> + name="wf-2881"
> + ;;
>   *"WHR-1166D")
>   name="whr-1166d"
>   ;;
> diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
> b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> index d3d9df3..687642f 100755
> --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> @@ -107,6 +107,7 @@ platform_check_image() {
>   w150m|\
>   w306r-v20|\
>   w502u|\
> + wf-2881|\
>   whr-1166d|\
>   whr-300hp2|\
>   whr-600d|\
> diff --git a/target/linux/ramips/dts/WF-2881.dts 
> b/target/linux/ramips/dts/WF-2881.dts
> new file mode 100644
> index 000..ba4a29b
> --- /dev/null
> +++ b/target/linux/ramips/dts/WF-2881.dts
> @@ -0,0 +1,123 @@
> +/dts-v1/;
> +
> +/include/ "mt7621.dtsi"
> +
> +/ {
> + compatible = "mediatek,mt7621-eval-board", "mediatek,mt7621-soc";
> + model = "NETIS WF-2881";
> +
> + memory@0 {
> + device_type = "memory";
> + reg = <0x0 0x800>;
> + };
> +
> + palmbus@1E00 {
> + spi@b00 {
> + status="disabled";
> + };
> + };
> +
> + chosen {
> + bootargs = "console=ttyS0,57600";
> + };
> +
> + nand@1e003000 {
> + compatible = "mtk,mt7621-nand";
> + bank-width = <2>;
> + reg = <0x1e003000 0x800
> + 0x1e003800 0x800>;
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + partition@0 {
> + label = "u-boot";
> + reg = <0x0 0x3>;
> + read-only;
> + };
> +
> + partition@3 {
> + label = 

Re: [OpenWrt-Devel] [RFC] A patch for mt7621 nand controler. Revision 2.

2015-11-21 Thread John Crispin
Hi,

ugly patch to make an ugly driver work. i am sure you had a lot of fun
debugging this one. thanks !

John

On 13/11/2015 08:55, Kirill Berezin wrote:
> Hello,
> 
> It turned out that mtk_nand driver uses some sophisticated accounting
> and a general nand code must be patched.
> 
> This patch adds required read and erase calls to a general nand code. I
> used a  code  for re6500 released by Linksys as a reference.
> 
> All required operations (erase, write and read) are usable. However I
> found that jffs2 filesystem can be created only on top of a ubi volume.
> I tried  to create jffs2 directly on mtd device but pages with clean
> markers are became uncorrectable.
> 
> This patch also includes changes that I sent earlier.
> 
> Best regards,
> Kirill.
> 
> Signed-off-by: Kirill Berezin (fyi...@gmail.com )
> 
> 
> 
> 
> 
> ___
> 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] [PATCH v2] lantiq: add phy led config support over devicetree bindings

2015-11-21 Thread John Crispin
On 21/11/2015 20:09, Florian Eckert wrote:
> Hallo,
> 
> if you mean "CONFIG_OF_MDIO"? I have added this define because if we
> have no "openfirmware" a dummy function will be called. Or do you mean
> the whole patch?
> 
> Regards
> 
> Flo


ah i misread it and did not see the OF_ part. fine in this case

John



> 
> Am 21.11.2015 6:55 nachm. schrieb "John Crispin"  >:
>>
>> Hi
>>
>> 1 comment inline
>>
>> On 09/11/2015 13:44, Florian Eckert wrote:
>> > This patch adds the posibility to config the led behaviour of the
> lantiq phys
>> > over the devicetree bindings.It patches the
> 0023-NET-PHY-adds-driver-for-lantiq-PHY11G
>> > for 3.18 and 4.1. I have also added a register description overview for
>> > applicable values. This goes to the documentation folder in the
> linux kernel.
>> >
>> > Signed-off-by: Florian Eckert  >
>> > ---
>> >
>> > v2 add Signed-off-by marker
>> >
>> >  ...023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch | 268
> -
>> >  ...023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch | 268
> -
>> >  2 files changed, 534 insertions(+), 2 deletions(-)
>> >  mode change 100644 => 100755
> target/linux/lantiq/patches-3.18/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
>> >
>> > diff --git
> a/target/linux/lantiq/patches-3.18/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
> b/target/linux/lantiq/patches-3.18/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
>> > old mode 100644
>> > new mode 100755
>> > index 6d1805f..55db4c7
>> > ---
> a/target/linux/lantiq/patches-3.18/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
>> > +++
> b/target/linux/lantiq/patches-3.18/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
>> > @@ -37,7 +37,7 @@ Signed-off-by: John Crispin  >
>> >   obj-$(CONFIG_AT803X_PHY)+= at803x.o
>> >  --- /dev/null
>> >  +++ b/drivers/net/phy/lantiq.c
>> > -@@ -0,0 +1,231 @@
>> > +@@ -0,0 +1,278 @@
>> >  +/*
>> >  + *   This program is free software; you can redistribute it and/or
> modify
>> >  + *   it under the terms of the GNU General Public License as
> published by
>> > @@ -58,6 +58,7 @@ Signed-off-by: John Crispin  >
>> >  +
>> >  +#include 
>> >  +#include 
>> > ++#include 
>> >  +
>> >  +#define MII_MMDCTRL 0x0d
>> >  +#define MII_MMDDATA 0x0e
>> > @@ -104,6 +105,50 @@ Signed-off-by: John Crispin  >
>> >  +return 0;
>> >  +}
>> >  +
>> > ++#if IS_ENABLED(CONFIG_OF_MDIO)
>>
>> we are inside a phy driver here that we talk to using a mdio bus. are
>> you sure this is required ?
>>
>> John
>>
>> > ++static int vr9_gphy_of_reg_init(struct phy_device *phydev)
>> > ++{
>> > ++u32 tmp;
>> > ++
>> > ++/* store the led values if one was passed by the devicetree */
>> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,ledch",
> ))
>> > ++vr9_gphy_mmd_write(phydev, 0x1e0, tmp);
>> > ++
>> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,ledcl",
> ))
>> > ++vr9_gphy_mmd_write(phydev, 0x1e1, tmp);
>> > ++
>> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led0h",
> ))
>> > ++vr9_gphy_mmd_write(phydev, 0x1e2, tmp);
>> > ++
>> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led0l",
> ))
>> > ++vr9_gphy_mmd_write(phydev, 0x1e3, tmp);
>> > ++
>> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led1h",
> ))
>> > ++vr9_gphy_mmd_write(phydev, 0x1e4, tmp);
>> > ++
>> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led1l",
> ))
>> > ++vr9_gphy_mmd_write(phydev, 0x1e5, tmp);
>> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led2h",
> ))
>> > ++vr9_gphy_mmd_write(phydev, 0x1e6, tmp);
>> > ++
>> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led2l",
> ))
>> > ++vr9_gphy_mmd_write(phydev, 0x1e7, tmp);
>> > ++
>> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led3h",
> ))
>> > ++vr9_gphy_mmd_write(phydev, 0x1e8, tmp);
>> > ++
>> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led3l",
> ))
>> > ++vr9_gphy_mmd_write(phydev, 0x1e9, tmp);
>> > ++
>> > ++return 0;
>> > ++}
>> > ++#else
>> > ++static int vr9_gphy_of_reg_init(struct phy_device *phydev)
>> > ++{
>> > ++return 0;
>> > ++}
>> > ++#endif /* CONFIG_OF_MDIO */
>> > ++
>> >  +static int vr9_gphy_config_init(struct phy_device *phydev)
>> >  +{
>> >  +int err;
>> > @@ -129,6 +174,8 @@ Signed-off-by: John Crispin  >
>> >  +vr9_gphy_mmd_write(phydev, 0x1e8, 0x40);
>> >  +vr9_gphy_mmd_write(phydev, 0x1e9, 0x20);
>> >  +
>> > ++vr9_gphy_of_reg_init(phydev);
>> > ++
>> >  +

Re: [OpenWrt-Devel] [PATCH] lantiq: spi-max-frequency

2015-11-21 Thread John Crispin
On 21/11/2015 20:05, Daniel Gimpelevich wrote:
> On Sat, 2015-11-21 at 10:27 -0800, Daniel Gimpelevich wrote:
>> On Sat, 2015-11-21 at 19:15 +0100, John Crispin wrote:
>>> Hi,
>>>
>>> common, you know how to send a patch and put a SoB under it. i've seen
>>> you do it lots of times ;)
>>>
>>> John
>>
>> Yes, but it just doesn't feel right for me to do when the patch is
>> essentially from Joerg and not from me.
>>
> 
> Are there any other DTS files to which this would apply?
> 

grep for spi-gpio in the dts folder
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] API documentation of ubus

2015-11-21 Thread Pratik Prajapati
Thanks Javier.

Till now I have referred ubus only, but now I can start reading procd,
uhttpd, netifd to have more understanding.

On Sat, Nov 21, 2015 at 5:38 PM, Javier Domingo Cansino  wrote:

> The only documentation you have from ubus is
> https://wiki.openwrt.org/doc/techref/ubus
>
> Apart from that, you can read procd, rpcd, uhttpd, netifd and ubus itself
> to see how to use it. I had plans on further documenting it but still
> didn't have time. You are welcome to further document it.
>
> On Sat, Nov 21, 2015 at 11:53 AM Pratik Prajapati <
> pratik.prajapat...@gmail.com> wrote:
>
>> Gentle Reminder
>>
>> On Fri, Nov 20, 2015 at 6:29 PM, Pratik Prajapati <
>> pratik.prajapat...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Is there any API documentation of ubus available?
>>>
>>> If yes, where can i found those?
>>>
>>>
>> ___
>> 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] [PATCH v2] ar71xx: Add support for Wallys DR344

2015-11-21 Thread John Crispin
Hi,

1 comment inline

On 08/11/2015 10:46, Philippe DUCHEIN wrote:
> This patch is for Wallys DR344 support under OpenWRT
> 
> Signed-off-by: Philippe DUCHEIN 
> 
> —
> 
> diff -Nru a/target/linux/ar71xx/base-files/etc/diag.sh 
> b/target/linux/ar71xx/base-files/etc/diag.sh
> --- a/target/linux/ar71xx/base-files/etc/diag.sh  2015-10-27 
> 18:57:41.368735097 +0100
> +++ b/target/linux/ar71xx/base-files/etc/diag.sh  2015-10-29 
> 12:05:58.995324966 +0100
> @@ -92,6 +92,9 @@
>   dlan-pro-1200-ac)
>   status_led="devolo:status:wlan"
>   ;;
> + dr344)
> + status_led="dr344:green:status"
> + ;;
>   dragino2)
>   status_led="dragino2:red:system"
>   ;;
> diff -Nru a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
> b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network  
> 2015-10-27 18:57:41.363735040 +0100
> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network  
> 2015-10-29 12:05:58.995324966 +0100
> @@ -17,6 +17,7 @@
>  case "$board" in
>  all0315n |\
>  all0258n |\
> +dr344 |\
>  ja76pf2|\
>  rocket-m-ti |\
>  ubnt-unifi-outdoor)
> diff -Nru a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh2015-10-27 
> 18:57:41.341734786 +0100
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh2015-10-29 
> 12:05:58.996324978 +0100
> @@ -456,6 +456,9 @@
>   *"dLAN pro 1200+ WiFi ac")
>   name="dlan-pro-1200-ac"
>   ;;
> + *DR344)
> + name="dr344"
> + ;;
>   *"Dragino v2")
>   name="dragino2"
>   ;;
> diff -Nru a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh  2015-10-27 
> 18:57:41.329734649 +0100
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh  2015-10-29 
> 12:06:23.597611781 +0100
> @@ -183,6 +183,7 @@
>   ap96 | \
>   bxu2000n-2-a1 | \
>   db120 | \
> + dr344 | \
>   f9k1115v2 |\
>   hornet-ub | \
>   mr12 | \
> diff -Nru a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
> --- a/target/linux/ar71xx/config-4.1  2015-10-27 18:57:41.379735223 +0100
> +++ b/target/linux/ar71xx/config-4.1  2015-10-29 12:05:58.996324978 +0100
> @@ -64,6 +64,7 @@
>  CONFIG_ATH79_MACH_DIR_825_C1=y
>  CONFIG_ATH79_MACH_DLAN_PRO_1200_AC=y
>  CONFIG_ATH79_MACH_DLAN_PRO_500_WP=y
> +CONFIG_ATH79_MACH_DR344=y
>  CONFIG_ATH79_MACH_DRAGINO2=y
>  CONFIG_ATH79_MACH_EAP300V2=y
>  CONFIG_ATH79_MACH_EAP7660D=y
> diff -Nru a/target/linux/ar71xx/generic/profiles/wallys.mk 
> b/target/linux/ar71xx/generic/profiles/wallys.mk
> --- a/target/linux/ar71xx/generic/profiles/wallys.mk  1970-01-01 
> 01:00:00.0 +0100
> +++ b/target/linux/ar71xx/generic/profiles/wallys.mk  2015-10-29 
> 12:05:58.996324978 +0100
> @@ -0,0 +1,17 @@
> +#
> +# Copyright (C) 2015 Philippe DUCHEIN 
> +# Copyright (C) 2009 OpenWrt.org
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +define Profile/DR344
> + NAME:=Wallys DR344
> +endef
> +
> +define Profile/DR344/Description
> + Package set optimized for the Wallys DR344 board.
> +endef
> +
> +$(eval $(call Profile,DR344))
> +
> diff -Nru a/target/linux/ar71xx/image/Makefile 
> b/target/linux/ar71xx/image/Makefile
> --- a/target/linux/ar71xx/image/Makefile  2015-10-27 18:57:41.248733718 
> +0100
> +++ b/target/linux/ar71xx/image/Makefile  2015-10-29 12:05:58.997324990 
> +0100
> @@ -1457,6 +1457,7 @@
>  
> whrhpg300n_mtdlayout=mtdparts=spi0.0:248k(u-boot)ro,8k(u-boot-env)ro,3712k(firmware),64k(art)ro
>  
> wlr8100_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),14080k(rootfs),192k(unknown)ro,64k(art)ro,384k(unknown2)ro,15488k@0x4(firmware)
>  
> wpj344_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
> +dr344_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x5(firmware)
>  
> wpj531_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
>  
> wpj558_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
>  
> wndap360_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1728k(kernel),6016k(rootfs),64k(nvram)ro,64k(art)ro,7744k@0x5(firmware)
> @@ -2293,6 +2294,7 @@
>  $(eval $(call 
> SingleProfile,AthLzma,64k,TUBE2H16M,tube2h-16M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
>  $(eval $(call 
> SingleProfile,AthLzma,64k,WLR8100,wlr8100,WLR8100,ttyS0,115200,$$(wlr8100_mtdlayout),KRuImage))
>  $(eval $(call 
> 

Re: [OpenWrt-Devel] [PATCH] [packages] add mt-st package to write to tape devices

2015-11-21 Thread John Crispin
Hi

this really belongs into the feed. please submit a PR via github.

John

On 10/11/2015 12:44, Giuseppe Magnotta wrote:
> Add mt-st package in order to write to tape devices
> 
> Signed-off-by: Giuseppe Magnotta  >
> 
> diff --git a/package/utils/mt-st/Makefile b/package/utils/mt-st/Makefile
> new file mode 100644
> index 000..ad93f23
> --- /dev/null
> +++ b/package/utils/mt-st/Makefile
> @@ -0,0 +1,49 @@
> +#
> +# Copyright (C) 2015 OpenWrt.org
> +#
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +include $(TOPDIR)/rules.mk 
> +
> +PKG_NAME:=mt-st
> +PKG_VERSION:=1.1
> +PKG_RELEASE:=1
> +
> +PKG_SOURCE_SUBDIR:=$(PKG_NAME)
> +PKG_SOURCE_VERSION:=$(PKG_VERSION)
> +PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
> +PKG_SOURCE_URL:=http://ftp.ibiblio.org/pub/Linux/system/backup/
> +PKG_MD5SUM:=fdd5f5ec673c9f630a102ceff7612774
> +
> +include $(INCLUDE_DIR)/package.mk 
> +
> +define Package/mt-st
> +  SECTION:=utils
> +  CATEGORY:=Utilities
> +  TITLE:=Magnetic tape control tools for Linux SCSI tapes
> +  URL:=http://ftp.ibiblio.org/pub/Linux/system/backup/
> +  MAINTAINER:=Giuseppe Magnotta  >
> +endef
> +
> +define Package/mt-st/description
> +Includes a mt-like program supporting additional commands using ioctls
> +specific to  the Linux SCSI tape driver (up to kernel 2.6.26), and
> the program
> +stinit to define the SCSI tape devices in system startup scripts.
> +endef
> +
> +define Build/Compile
> +$(MAKE) -C $(PKG_BUILD_DIR) \
> +LDFLAGS="$(TARGET_LDFLAGS)" \
> +CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
> +CC="$(TARGET_CC)"
> +endef
> +
> +define Package/mt-st/install
> +$(INSTALL_DIR) $(1)/usr/bin
> +$(INSTALL_BIN) $(PKG_BUILD_DIR)/mt $(1)/usr/bin/
> +$(INSTALL_BIN) $(PKG_BUILD_DIR)/stinit $(1)/usr/bin/
> +endef
> +
> +$(eval $(call BuildPackage,mt-st))
> 
> 
> ___
> 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] [PATCH v2] lantiq: add phy led config support over devicetree bindings

2015-11-21 Thread Florian Eckert
Hallo,

if you mean "CONFIG_OF_MDIO"? I have added this define because if we have
no "openfirmware" a dummy function will be called. Or do you mean the whole
patch?

Regards

Flo

Am 21.11.2015 6:55 nachm. schrieb "John Crispin" :
>
> Hi
>
> 1 comment inline
>
> On 09/11/2015 13:44, Florian Eckert wrote:
> > This patch adds the posibility to config the led behaviour of the
lantiq phys
> > over the devicetree bindings.It patches the
0023-NET-PHY-adds-driver-for-lantiq-PHY11G
> > for 3.18 and 4.1. I have also added a register description overview for
> > applicable values. This goes to the documentation folder in the linux
kernel.
> >
> > Signed-off-by: Florian Eckert 
> > ---
> >
> > v2 add Signed-off-by marker
> >
> >  ...023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch | 268
-
> >  ...023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch | 268
-
> >  2 files changed, 534 insertions(+), 2 deletions(-)
> >  mode change 100644 => 100755
target/linux/lantiq/patches-3.18/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
> >
> > diff --git
a/target/linux/lantiq/patches-3.18/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
b/target/linux/lantiq/patches-3.18/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
> > old mode 100644
> > new mode 100755
> > index 6d1805f..55db4c7
> > ---
a/target/linux/lantiq/patches-3.18/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
> > +++
b/target/linux/lantiq/patches-3.18/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
> > @@ -37,7 +37,7 @@ Signed-off-by: John Crispin 
> >   obj-$(CONFIG_AT803X_PHY)+= at803x.o
> >  --- /dev/null
> >  +++ b/drivers/net/phy/lantiq.c
> > -@@ -0,0 +1,231 @@
> > +@@ -0,0 +1,278 @@
> >  +/*
> >  + *   This program is free software; you can redistribute it and/or
modify
> >  + *   it under the terms of the GNU General Public License as
published by
> > @@ -58,6 +58,7 @@ Signed-off-by: John Crispin 
> >  +
> >  +#include 
> >  +#include 
> > ++#include 
> >  +
> >  +#define MII_MMDCTRL 0x0d
> >  +#define MII_MMDDATA 0x0e
> > @@ -104,6 +105,50 @@ Signed-off-by: John Crispin 
> >  +return 0;
> >  +}
> >  +
> > ++#if IS_ENABLED(CONFIG_OF_MDIO)
>
> we are inside a phy driver here that we talk to using a mdio bus. are
> you sure this is required ?
>
> John
>
> > ++static int vr9_gphy_of_reg_init(struct phy_device *phydev)
> > ++{
> > ++u32 tmp;
> > ++
> > ++/* store the led values if one was passed by the devicetree */
> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,ledch",
))
> > ++vr9_gphy_mmd_write(phydev, 0x1e0, tmp);
> > ++
> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,ledcl",
))
> > ++vr9_gphy_mmd_write(phydev, 0x1e1, tmp);
> > ++
> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led0h",
))
> > ++vr9_gphy_mmd_write(phydev, 0x1e2, tmp);
> > ++
> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led0l",
))
> > ++vr9_gphy_mmd_write(phydev, 0x1e3, tmp);
> > ++
> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led1h",
))
> > ++vr9_gphy_mmd_write(phydev, 0x1e4, tmp);
> > ++
> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led1l",
))
> > ++vr9_gphy_mmd_write(phydev, 0x1e5, tmp);
> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led2h",
))
> > ++vr9_gphy_mmd_write(phydev, 0x1e6, tmp);
> > ++
> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led2l",
))
> > ++vr9_gphy_mmd_write(phydev, 0x1e7, tmp);
> > ++
> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led3h",
))
> > ++vr9_gphy_mmd_write(phydev, 0x1e8, tmp);
> > ++
> > ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led3l",
))
> > ++vr9_gphy_mmd_write(phydev, 0x1e9, tmp);
> > ++
> > ++return 0;
> > ++}
> > ++#else
> > ++static int vr9_gphy_of_reg_init(struct phy_device *phydev)
> > ++{
> > ++return 0;
> > ++}
> > ++#endif /* CONFIG_OF_MDIO */
> > ++
> >  +static int vr9_gphy_config_init(struct phy_device *phydev)
> >  +{
> >  +int err;
> > @@ -129,6 +174,8 @@ Signed-off-by: John Crispin 
> >  +vr9_gphy_mmd_write(phydev, 0x1e8, 0x40);
> >  +vr9_gphy_mmd_write(phydev, 0x1e9, 0x20);
> >  +
> > ++vr9_gphy_of_reg_init(phydev);
> > ++
> >  +return 0;
> >  +}
> >  +
> > @@ -269,3 +316,222 @@ Signed-off-by: John Crispin 
> >  +MODULE_DESCRIPTION("Lantiq PHY drivers");
> >  +MODULE_AUTHOR("Daniel Schwierzeck ");
> >  +MODULE_LICENSE("GPL");
> > +--- /dev/null
> >  b/Documentation/devicetree/bindings/phy/phy-lanitq.txt
> > +@@ -0,0 +1,216 @@
> > ++Lanitq PHY binding
> > ++
> > ++
> > ++This devicetree binding controls the 

Re: [OpenWrt-Devel] [PATCH 2/3] ar71xx: add GL-AR300 support V2

2015-11-21 Thread John Crispin
Hi,

1 comment inline


On 17/11/2015 04:37, alzhao wrote:
> Add support for GL-AR300 for latest trunk. Tested and works well.
> 
> Signed-off-by: Alzhao
> ---
>  .../ar71xx/base-files/etc/uci-defaults/01_leds |   4 +
>  .../ar71xx/base-files/etc/uci-defaults/02_network  |   6 ++
>  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
>  .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
>  target/linux/ar71xx/config-4.1 |   1 +
>  .../ar71xx/files/arch/mips/ath79/mach-gl-ar300.c   | 106 
> +
>  target/linux/ar71xx/generic/profiles/gli.mk|  11 +++
>  target/linux/ar71xx/image/Makefile |   9 ++
>  .../patches-4.1/912-MIPS-ath79-add-gl_ar300.patch  |  39 
>  9 files changed, 180 insertions(+)
>  create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
>  create mode 100644 
> target/linux/ar71xx/patches-4.1/912-MIPS-ath79-add-gl_ar300.patch
> 
> diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
> b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
> index 25f9d13..5da1ef4 100644
> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
> @@ -215,6 +215,10 @@ gl-ar150)
>   ucidef_set_led_wlan "wlan" "WLAN" "gl_ar150:wlan" "phy0tpt"
>   ;;
>  
> +gl-ar300)
> + ucidef_set_led_wlan "wlan" "WLAN" "gl_ar300:wlan" "phy0tpt"
> + ;;
> +
>  gl-inet)
>   ucidef_set_led_netdev "lan" "LAN" "gl-connect:green:lan" "eth1"
>   ucidef_set_led_wlan "wlan" "WLAN" "gl-connect:red:wlan" "phy0tpt"
> diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
> b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> index 2ba1fbd..628d710 100644
> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> @@ -408,6 +408,12 @@ wpe72)
>   ucidef_set_interfaces_lan_wan "eth1" "eth0"
>   ;;
>  
> +gl-ar300)
> + ucidef_set_interfaces_lan_wan "eth1" "eth0"
> + ucidef_add_switch "switch0" "1" "1"
> + ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
> + ;;
> +
>  wpj344)
>   ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
>   ucidef_add_switch "switch0" "1" "1"
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index 9848906..a64d005 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -481,6 +481,9 @@ ar71xx_board_detect() {
>   *"GL AR150")
>  name="gl-ar150"
>  ;;
> + *"GL AR300")
> + name="gl-ar300"
> + ;;
>   *"EnGenius EPG5000")
>   name="epg5000"
>   ;;
> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> index 8ea11b4..f06919f 100755
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -220,6 +220,7 @@ platform_check_image() {
>   ew-dorin | \
>   ew-dorin-router | \
>   gl-ar150 | \
> + gl-ar300 | \
>   hiwifi-hc6361 | \
>   hornet-ub-x2 | \
>   mzk-w04nu | \
> diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
> index 72b47eb..019d6d6 100644
> --- a/target/linux/ar71xx/config-4.1
> +++ b/target/linux/ar71xx/config-4.1
> @@ -76,6 +76,7 @@ CONFIG_ATH79_MACH_ESR900=y
>  CONFIG_ATH79_MACH_EW_DORIN=y
>  CONFIG_ATH79_MACH_F9K1115V2=y
>  CONFIG_ATH79_MACH_GL_AR150=y
> +CONFIG_ATH79_MACH_GL_AR300=y
>  CONFIG_ATH79_MACH_GL_INET=y
>  CONFIG_ATH79_MACH_GS_MINIBOX_V1=y
>  CONFIG_ATH79_MACH_GS_OOLITE=y
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c 
> b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
> new file mode 100644
> index 000..565267e
> --- /dev/null
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300.c
> @@ -0,0 +1,106 @@
> +/*
> + *  Domino board support
> + *
> + *  Copyright (C) 2011 dongyuqi <729650...@qq.com>
> + *  Copyright (C) 2011-2012 Gabor Juhos 
> + *  Copyright (C) 2013 alzhao 
> + *  Copyright (C) 2014 Michel Stempin 
> + *
> + *  This program is free software; you can redistribute it and/or modify it
> + *  under the terms of the GNU General Public License version 2 as published
> + *  by the Free Software Foundation.
> +*/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "common.h"
> +#include "dev-eth.h"
> +#include "dev-gpio-buttons.h"
> +#include "dev-leds-gpio.h"
> +#include "dev-m25p80.h"
> +#include "dev-usb.h"
> +#include "dev-wmac.h"
> +#include "machtypes.h"
> +
> +#define GL_AR300_GPIO_LED_WLAN   13
> +#define GL_AR300_GPIO_LED_WAN14
> +#define GL_AR300_GPIO_BTN_RESET 

Re: [OpenWrt-Devel] [PATCH] [001/001] TL-WR710N: create image for v2.1

2015-11-21 Thread John Crispin
Hi,

the patch is unfortunately line wrapped and whitespace broken. try
sending the patch using "git send-email"

John

On 17/11/2015 20:41, Norbert Wegener wrote:
> This patch just extends target/linux/ar71xx/image/Makefile to build
> images also for version 2.1 of TL-WR710N
> 
> diff --git a/target/linux/ar71xx/image/Makefile
> b/target/linux/ar71xx/image/Makefile
> index 013a215..da2e7d4 100644
> --- a/target/linux/ar71xx/image/Makefile
> +++ b/target/linux/ar71xx/image/Makefile
> @@ -476,6 +476,15 @@ define Device/tl-wr710n-v2
>  CONSOLE := ttyATH0,115200
>  endef
>  
> +define Device/tl-wr710n-v2.1
> +$(Device/tplink-8mlzma)
> +BOARDNAME := TL-WR710N
> +DEVICE_PROFILE := TLWR710
> +TPLINK_HWID := 0x0712
> +TPLINK_HWREV := 0x0002
> +CONSOLE := ttyATH0,115200
> +endef
> +
>  define Device/tl-wr720n-v3
>  $(Device/tplink-4mlzma)
>  BOARDNAME := TL-WR720N-v3
> @@ -491,7 +500,7 @@ define Device/tl-wr720n-v4
>  TPLINK_HWID := 0x07200104
>  CONSOLE := ttyATH0,115200
>  endef
> -TARGET_DEVICES += tl-wr703n-v1 tl-wr710n-v1 tl-wr710n-v2 tl-wr720n-v3
> tl-wr720n-v4
> +TARGET_DEVICES += tl-wr703n-v1 tl-wr710n-v1 tl-wr710n-v2 tl-wr710n-v2.1
> tl-wr720n-v3 tl-wr720n-v4
>  
>  define Device/tl-wr74:0n-v4
>  $(Device/tplink-4mlzma)
> 
> Signed off by: Norbert Wegener 
> 
> 
> 
> ___
> 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] [PATCH] ramips: add support for Youku YK1

2015-11-21 Thread John Crispin
Hi

1 comment inline

On 08/11/2015 07:08, Shonn Lu wrote:
> Signed-off-by: Shonn Lu 
> ---
>  target/linux/ramips/base-files/etc/board.d/01_leds |   5 +
>  .../linux/ramips/base-files/etc/board.d/02_network |   1 +
>  target/linux/ramips/base-files/lib/ramips.sh   |   3 +
>  .../ramips/base-files/lib/upgrade/platform.sh  |   1 +
>  target/linux/ramips/dts/Youku-YK1.dts  | 127 
> +
>  target/linux/ramips/image/Makefile |   2 +
>  6 files changed, 139 insertions(+)
>  create mode 100644 target/linux/ramips/dts/Youku-YK1.dts
> 
> 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 545bd70..bc86bd3 100755
> --- a/target/linux/ramips/base-files/etc/board.d/01_leds
> +++ b/target/linux/ramips/base-files/etc/board.d/01_leds
> @@ -261,6 +261,11 @@ case $board in
>   zte-q7)
>   set_wifi_led "zte:blue:status"
>   ;;
> + yk1)
> + ucidef_set_led_default "power" "power" "youku:blue:power" "1"
> + set_wifi_led "youku:blue:air"
> + set_usb_led "youku:blue:usb"
> + ;;
>  esac
>  
>  board_config_flush
> 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 19ef3f7..3c87971 100755
> --- a/target/linux/ramips/base-files/etc/board.d/02_network
> +++ b/target/linux/ramips/base-files/etc/board.d/02_network
> @@ -145,6 +145,7 @@ ramips_setup_interfaces()
>   wsr-1166 | \
>   wt1520 | \
>   xiaomi-miwifi-mini |\
> + yk1 |\
>   y1)
>   ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
>   ucidef_add_switch "switch0" "1" "1"
> diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
> b/target/linux/ramips/base-files/lib/ramips.sh
> index a9a6664..bdd6d4e 100755
> --- a/target/linux/ramips/base-files/lib/ramips.sh
> +++ b/target/linux/ramips/base-files/lib/ramips.sh
> @@ -409,6 +409,9 @@ ramips_board_detect() {
>   *"ZTE Q7")
>   name="zte-q7"
>   ;;
> + *"Youku YK1")
> + name="yk1"
> + ;;
>   *"Lenovo Y1")
>   name="y1"

the patch applies to a trunk prior to our cleanup. the patch wont apply
because of this. please rebase it on current trunk and resend

John


>   ;;
> diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
> b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> index 11fee85..66fcd04 100755
> --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> @@ -127,6 +127,7 @@ platform_check_image() {
>   y1 |\
>   y1s |\
>   zte-q7 |\
> + yk1 |\
>   zbt-wa05)
>   [ "$magic" != "27051956" ] && {
>   echo "Invalid image type."
> diff --git a/target/linux/ramips/dts/Youku-YK1.dts 
> b/target/linux/ramips/dts/Youku-YK1.dts
> new file mode 100644
> index 000..10662d3
> --- /dev/null
> +++ b/target/linux/ramips/dts/Youku-YK1.dts
> @@ -0,0 +1,127 @@
> +/dts-v1/;
> +
> +/include/ "mt7620a.dtsi"
> +
> +/ {
> + compatible = "Youku-YK1", "ralink,mt7620a-soc";
> + model = "Youku YK1";
> +
> + palmbus@1000 {
> +
> + gpio0: gpio@600 {
> + status = "okay";
> + };
> +
> + 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 = "w25q256";
> + reg = <0 0>;
> + linux,modalias = "m25p80", "w25q256";
> + spi-max-frequency = <1000>;
> +
> + partition@0 {
> + label = "u-boot";
> + reg = <0x0 0x3>;
> + read-only;
> + };
> +
> + partition@3 {
> + label = "u-boot-env";
> + reg = <0x3 0x1>;
> + read-only;
> + };
> +
> + factory: partition@4 {
> + label = "factory";
> + reg = <0x4 0x1>;
> + read-only;
> + };
> +
> +

Re: [OpenWrt-Devel] [PATCH v2] ar71xx: Add support for Wallys DR344

2015-11-21 Thread Philippe DUCHEIN
Hi John,
Sorry for convenience
I suppressed it



This patch is for Wallys DR344 support under OpenWRT. It’s release 2.1
ChangeLog: suppress suppress blank line insert into 
target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile

Signed-off-by: Philippe DUCHEIN >

---

diff -Nru a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
--- a/target/linux/ar71xx/base-files/etc/diag.sh2015-10-27 
18:57:41.368735097 +0100
+++ b/target/linux/ar71xx/base-files/etc/diag.sh2015-10-29 
12:05:58.995324966 +0100
@@ -92,6 +92,9 @@
dlan-pro-1200-ac)
status_led="devolo:status:wlan"
;;
+   dr344)
+   status_led="dr344:green:status"
+   ;;
dragino2)
status_led="dragino2:red:system"
;;
diff -Nru a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
2015-10-27 18:57:41.363735040 +0100
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
2015-10-29 12:05:58.995324966 +0100
@@ -17,6 +17,7 @@
 case "$board" in
 all0315n |\
 all0258n |\
+dr344 |\
 ja76pf2|\
 rocket-m-ti |\
 ubnt-unifi-outdoor)
diff -Nru a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh  2015-10-27 
18:57:41.341734786 +0100
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh  2015-10-29 
12:05:58.996324978 +0100
@@ -456,6 +456,9 @@
*"dLAN pro 1200+ WiFi ac")
name="dlan-pro-1200-ac"
;;
+   *DR344)
+   name="dr344"
+   ;;
*"Dragino v2")
name="dragino2"
;;
diff -Nru a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh2015-10-27 
18:57:41.329734649 +0100
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh2015-10-29 
12:06:23.597611781 +0100
@@ -183,6 +183,7 @@
ap96 | \
bxu2000n-2-a1 | \
db120 | \
+   dr344 | \
f9k1115v2 |\
hornet-ub | \
mr12 | \
diff -Nru a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
--- a/target/linux/ar71xx/config-4.12015-10-27 18:57:41.379735223 +0100
+++ b/target/linux/ar71xx/config-4.12015-10-29 12:05:58.996324978 +0100
@@ -64,6 +64,7 @@
 CONFIG_ATH79_MACH_DIR_825_C1=y
 CONFIG_ATH79_MACH_DLAN_PRO_1200_AC=y
 CONFIG_ATH79_MACH_DLAN_PRO_500_WP=y
+CONFIG_ATH79_MACH_DR344=y
 CONFIG_ATH79_MACH_DRAGINO2=y
 CONFIG_ATH79_MACH_EAP300V2=y
 CONFIG_ATH79_MACH_EAP7660D=y
diff -Nru a/target/linux/ar71xx/generic/profiles/wallys.mk 
b/target/linux/ar71xx/generic/profiles/wallys.mk
--- a/target/linux/ar71xx/generic/profiles/wallys.mk1970-01-01 
01:00:00.0 +0100
+++ b/target/linux/ar71xx/generic/profiles/wallys.mk2015-10-29 
12:05:58.996324978 +0100
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2015 Philippe DUCHEIN 
+# Copyright (C) 2009 OpenWrt.org
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/DR344
+   NAME:=Wallys DR344
+endef
+
+define Profile/DR344/Description
+   Package set optimized for the Wallys DR344 board.
+endef
+
+$(eval $(call Profile,DR344))
+
diff -Nru a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
--- a/target/linux/ar71xx/image/Makefile2015-10-27 18:57:41.248733718 
+0100
+++ b/target/linux/ar71xx/image/Makefile2015-10-29 12:05:58.997324990 
+0100
@@ -1457,6 +1457,7 @@
 
whrhpg300n_mtdlayout=mtdparts=spi0.0:248k(u-boot)ro,8k(u-boot-env)ro,3712k(firmware),64k(art)ro
 
wlr8100_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),14080k(rootfs),192k(unknown)ro,64k(art)ro,384k(unknown2)ro,15488k@0x4(firmware)
 wpj344_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
+dr344_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x5(firmware)
 wpj531_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
 wpj558_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
 
wndap360_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1728k(kernel),6016k(rootfs),64k(nvram)ro,64k(art)ro,7744k@0x5(firmware)
@@ -2293,6 +2294,7 @@
 $(eval $(call 
SingleProfile,AthLzma,64k,TUBE2H16M,tube2h-16M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
 $(eval $(call 
SingleProfile,AthLzma,64k,WLR8100,wlr8100,WLR8100,ttyS0,115200,$$(wlr8100_mtdlayout),KRuImage))
 $(eval $(call 

Re: [OpenWrt-Devel] [PATCH] lantiq: spi-max-frequency

2015-11-21 Thread Daniel Gimpelevich
On Sat, 2015-11-21 at 19:15 +0100, John Crispin wrote:
> Hi,
> 
> common, you know how to send a patch and put a SoB under it. i've seen
> you do it lots of times ;)
> 
> John

Yes, but it just doesn't feel right for me to do when the patch is
essentially from Joerg and not from me.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/3] ar71xx: add GL-AR150 support V2

2015-11-21 Thread John Crispin
Hi

comment 1 inline

On 17/11/2015 04:37, alzhao wrote:
> Added GL-AR150 support to latest trunk. Tested and works good.
> 
> Signed-off-by: Alzhao
> ---
>  .../ar71xx/base-files/etc/uci-defaults/01_leds |   4 +
>  .../ar71xx/base-files/etc/uci-defaults/02_network  |   1 +
>  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
>  .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
>  target/linux/ar71xx/config-4.1 |   1 +
>  .../ar71xx/files/arch/mips/ath79/mach-gl-ar150.c   | 125 
> +
>  target/linux/ar71xx/generic/profiles/gl-connect.mk |  17 ---
>  target/linux/ar71xx/generic/profiles/gli.mk|  27 +
>  target/linux/ar71xx/image/Makefile |   8 ++
>  .../patches-4.1/911-MIPS-ath79-add-gl_ar150.patch  |  39 +++
>  10 files changed, 209 insertions(+), 17 deletions(-)
>  create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
>  delete mode 100644 target/linux/ar71xx/generic/profiles/gl-connect.mk
>  create mode 100644 target/linux/ar71xx/generic/profiles/gli.mk
>  create mode 100644 
> target/linux/ar71xx/patches-4.1/911-MIPS-ath79-add-gl_ar150.patch
> 
> diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
> b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
> index 39f472a..25f9d13 100644
> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
> @@ -211,6 +211,10 @@ dlan-pro-1200-ac)
>   ucidef_set_led_trigger_gpio "plcr" "dLAN" "devolo:error:dlan" "16" "0"
>   ;;
>  
> +gl-ar150)
> + ucidef_set_led_wlan "wlan" "WLAN" "gl_ar150:wlan" "phy0tpt"
> + ;;
> +
>  gl-inet)
>   ucidef_set_led_netdev "lan" "LAN" "gl-connect:green:lan" "eth1"
>   ucidef_set_led_wlan "wlan" "WLAN" "gl-connect:red:wlan" "phy0tpt"
> diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
> b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> index 2765adb..2ba1fbd 100644
> --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> @@ -396,6 +396,7 @@ dir-505-a1)
>  alfa-ap96 |\
>  alfa-nx |\
>  ap83 |\
> +gl-ar150 |\
>  gl-inet |\
>  jwap003 |\
>  pb42 |\
> diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> index 0e92ee7..9848906 100755
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> @@ -478,6 +478,9 @@ ar71xx_board_detect() {
>   name="gl-inet"
>   gl_inet_board_detect
>   ;;
> + *"GL AR150")
> +name="gl-ar150"
> +;;

it looks like the indenting is wrong here. please fix and resend the patch

John



>   *"EnGenius EPG5000")
>   name="epg5000"
>   ;;
> diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> index b97c076..8ea11b4 100755
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> @@ -219,6 +219,7 @@ platform_check_image() {
>   esr900 | \
>   ew-dorin | \
>   ew-dorin-router | \
> + gl-ar150 | \
>   hiwifi-hc6361 | \
>   hornet-ub-x2 | \
>   mzk-w04nu | \
> diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
> index 08e252d..72b47eb 100644
> --- a/target/linux/ar71xx/config-4.1
> +++ b/target/linux/ar71xx/config-4.1
> @@ -75,6 +75,7 @@ CONFIG_ATH79_MACH_ESR1750=y
>  CONFIG_ATH79_MACH_ESR900=y
>  CONFIG_ATH79_MACH_EW_DORIN=y
>  CONFIG_ATH79_MACH_F9K1115V2=y
> +CONFIG_ATH79_MACH_GL_AR150=y
>  CONFIG_ATH79_MACH_GL_INET=y
>  CONFIG_ATH79_MACH_GS_MINIBOX_V1=y
>  CONFIG_ATH79_MACH_GS_OOLITE=y
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c 
> b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
> new file mode 100644
> index 000..310182c
> --- /dev/null
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c
> @@ -0,0 +1,125 @@
> +/*
> + *  GL_ar150 board support
> + *
> + *  Copyright (C) 2011 dongyuqi <729650...@qq.com>
> + *  Copyright (C) 2011-2012 Gabor Juhos 
> + *  Copyright (C) 2013 alzhao 
> + *  Copyright (C) 2014 Michel Stempin 
> + *
> + *  This program is free software; you can redistribute it and/or modify it
> + *  under the terms of the GNU General Public License version 2 as published
> + *  by the Free Software Foundation.
> +*/
> +
> +#include 
> +
> +#include 
> +
> +#include "dev-eth.h"
> +#include "dev-gpio-buttons.h"
> +#include "dev-leds-gpio.h"
> +#include "dev-m25p80.h"
> +#include "dev-usb.h"
> +#include "dev-wmac.h"
> +#include "machtypes.h"
> +
> +#define GL_AR150_GPIO_LED_WLAN  0
> +#define GL_AR150_GPIO_LED_LAN

Re: [OpenWrt-Devel] [PATCH v2 5/6] brcm2708: add device detection and use it for network, leds and preinit

2015-11-21 Thread Álvaro Fernández Rojas

Sure, I will rework this as soon as I can.

Regards,
Álvaro.

El 21/11/2015 a las 9:45, John Crispin escribió:

Hi,

do you have time to rework this code to make use of the new board
detection layer ? i am currently starting to convert all targets to it.
would be a shame if we add this ode just to replace it again in a few weeks.

John

On 19/11/2015 19:18, Álvaro Fernández Rojas wrote:

Signed-off-by: Álvaro Fernández Rojas 
---
v2: device tree model needs Rev to avoid detecting a B+ as a B model

  target/linux/brcm2708/base-files.mk|  3 ++
  target/linux/brcm2708/base-files/etc/diag.sh   | 12 ++-
  .../base-files/etc/uci-defaults/02_network | 12 +--
  target/linux/brcm2708/base-files/lib/brcm2708.sh   | 41 ++
  .../lib/preinit/03_preinit_do_brcm2708.sh  | 10 ++
  .../lib/preinit/05_set_preinit_iface_brcm2708  | 18 ++
  target/linux/brcm2708/bcm2708/config-4.1   |  2 +-
  target/linux/brcm2708/bcm2709/config-4.1   |  2 +-
  8 files changed, 95 insertions(+), 5 deletions(-)
  create mode 100644 target/linux/brcm2708/base-files.mk
  create mode 100644 target/linux/brcm2708/base-files/lib/brcm2708.sh
  create mode 100644 
target/linux/brcm2708/base-files/lib/preinit/03_preinit_do_brcm2708.sh
  create mode 100644 
target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708

diff --git a/target/linux/brcm2708/base-files.mk 
b/target/linux/brcm2708/base-files.mk
new file mode 100644
index 000..fdd2c71
--- /dev/null
+++ b/target/linux/brcm2708/base-files.mk
@@ -0,0 +1,3 @@
+define Package/base-files/install-target
+   rm -f $(1)/etc/config/network
+endef
diff --git a/target/linux/brcm2708/base-files/etc/diag.sh 
b/target/linux/brcm2708/base-files/etc/diag.sh
index 55e68b1..3a8dc86 100644
--- a/target/linux/brcm2708/base-files/etc/diag.sh
+++ b/target/linux/brcm2708/base-files/etc/diag.sh
@@ -4,9 +4,19 @@
  #
  
  . /lib/functions/leds.sh

+. /lib/brcm2708.sh
  
  set_state() {

-   status_led="led0"
+   case "$(brcm2708_board_name)" in
+   rpi-b |\
+   rpi-cm)
+   status_led="led0"
+   ;;
+   rpi-b-plus |\
+   rpi-2-b)
+   status_led="led1"
+   ;;
+   esac
  
  	case "$1" in

preinit)
diff --git a/target/linux/brcm2708/base-files/etc/uci-defaults/02_network 
b/target/linux/brcm2708/base-files/etc/uci-defaults/02_network
index e7e35c5..1bb05b6 100644
--- a/target/linux/brcm2708/base-files/etc/uci-defaults/02_network
+++ b/target/linux/brcm2708/base-files/etc/uci-defaults/02_network
@@ -1,14 +1,22 @@
  #!/bin/sh
-# Copyright (C) 2014 OpenWrt.org
+# Copyright (C) 2014-2015 OpenWrt.org
  
  [ -e /etc/config/network ] && exit 0
  
  touch /etc/config/network
  
  . /lib/functions/uci-defaults.sh

+. /lib/brcm2708.sh
  
  ucidef_set_interface_loopback

-ucidef_set_interface_lan "eth0"
+
+case "$(brcm2708_board_name)" in
+rpi-b |\
+rpi-b-plus |\
+rpi-2-b)
+   ucidef_set_interface_lan "eth0"
+   ;;
+esac
  
  uci commit network
  
diff --git a/target/linux/brcm2708/base-files/lib/brcm2708.sh b/target/linux/brcm2708/base-files/lib/brcm2708.sh

new file mode 100644
index 000..7d6e458
--- /dev/null
+++ b/target/linux/brcm2708/base-files/lib/brcm2708.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+# Copyright (C) 2015 OpenWrt.org
+
+ifname=""
+
+brcm2708_detect() {
+   local board_name model
+
+   model=$(cat /proc/device-tree/model)
+   case "$model" in
+   "Raspberry Pi Model B Rev"*)
+   board_name="rpi-b"
+   ;;
+   "Raspberry Pi Model B+ Rev"*)
+   board_name="rpi-b-plus"
+   ;;
+   "Raspberry Pi Compute Module Rev"*)
+   board_name="rpi-cm"
+   ;;
+   "Raspberry Pi 2 Model B Rev"*)
+   board_name="rpi-2-b"
+   ;;
+   *)
+   board_name="unknown"
+   ;;
+   esac
+
+   [ -e "/tmp/sysinfo" ] || mkdir -p "/tmp/sysinfo"
+
+   echo "$board_name" > /tmp/sysinfo/board_name
+   echo "$model" > /tmp/sysinfo/model
+}
+
+brcm2708_board_name() {
+   local name
+
+   [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
+   [ -n "$name" ] || name="unknown"
+
+   echo $name
+}
diff --git 
a/target/linux/brcm2708/base-files/lib/preinit/03_preinit_do_brcm2708.sh 
b/target/linux/brcm2708/base-files/lib/preinit/03_preinit_do_brcm2708.sh
new file mode 100644
index 000..2943648
--- /dev/null
+++ b/target/linux/brcm2708/base-files/lib/preinit/03_preinit_do_brcm2708.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+# Copyright (C) 2015 OpenWrt.org
+
+do_brcm2708() {
+   . /lib/brcm2708.sh
+
+   brcm2708_detect
+}
+
+boot_hook_add preinit_main do_brcm2708
diff --git 
a/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708 
b/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708
new file 

Re: [OpenWrt-Devel] [PATCH v2] lantiq: add phy led config support over devicetree bindings

2015-11-21 Thread John Crispin
Hi

1 comment inline

On 09/11/2015 13:44, Florian Eckert wrote:
> This patch adds the posibility to config the led behaviour of the lantiq phys 
> over the devicetree bindings.It patches the 
> 0023-NET-PHY-adds-driver-for-lantiq-PHY11G
> for 3.18 and 4.1. I have also added a register description overview for 
> applicable values. This goes to the documentation folder in the linux kernel.
> 
> Signed-off-by: Florian Eckert 
> ---
> 
> v2 add Signed-off-by marker
> 
>  ...023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch | 268 
> -
>  ...023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch | 268 
> -
>  2 files changed, 534 insertions(+), 2 deletions(-)
>  mode change 100644 => 100755 
> target/linux/lantiq/patches-3.18/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
> 
> diff --git 
> a/target/linux/lantiq/patches-3.18/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
>  
> b/target/linux/lantiq/patches-3.18/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
> old mode 100644
> new mode 100755
> index 6d1805f..55db4c7
> --- 
> a/target/linux/lantiq/patches-3.18/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
> +++ 
> b/target/linux/lantiq/patches-3.18/0023-NET-PHY-adds-driver-for-lantiq-PHY11G.patch
> @@ -37,7 +37,7 @@ Signed-off-by: John Crispin 
>   obj-$(CONFIG_AT803X_PHY)+= at803x.o
>  --- /dev/null
>  +++ b/drivers/net/phy/lantiq.c
> -@@ -0,0 +1,231 @@
> +@@ -0,0 +1,278 @@
>  +/*
>  + *   This program is free software; you can redistribute it and/or modify
>  + *   it under the terms of the GNU General Public License as published by
> @@ -58,6 +58,7 @@ Signed-off-by: John Crispin 
>  +
>  +#include 
>  +#include 
> ++#include 
>  +
>  +#define MII_MMDCTRL 0x0d
>  +#define MII_MMDDATA 0x0e
> @@ -104,6 +105,50 @@ Signed-off-by: John Crispin 
>  +return 0;
>  +}
>  +
> ++#if IS_ENABLED(CONFIG_OF_MDIO)

we are inside a phy driver here that we talk to using a mdio bus. are
you sure this is required ?

John

> ++static int vr9_gphy_of_reg_init(struct phy_device *phydev)
> ++{
> ++u32 tmp;
> ++
> ++/* store the led values if one was passed by the devicetree */
> ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,ledch", ))
> ++vr9_gphy_mmd_write(phydev, 0x1e0, tmp);
> ++
> ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,ledcl", ))
> ++vr9_gphy_mmd_write(phydev, 0x1e1, tmp);
> ++
> ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led0h", ))
> ++vr9_gphy_mmd_write(phydev, 0x1e2, tmp);
> ++
> ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led0l", ))
> ++vr9_gphy_mmd_write(phydev, 0x1e3, tmp);
> ++
> ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led1h", ))
> ++vr9_gphy_mmd_write(phydev, 0x1e4, tmp);
> ++
> ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led1l", ))
> ++vr9_gphy_mmd_write(phydev, 0x1e5, tmp);
> ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led2h", ))
> ++vr9_gphy_mmd_write(phydev, 0x1e6, tmp);
> ++
> ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led2l", ))
> ++vr9_gphy_mmd_write(phydev, 0x1e7, tmp);
> ++
> ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led3h", ))
> ++vr9_gphy_mmd_write(phydev, 0x1e8, tmp);
> ++
> ++if (!of_property_read_u32(phydev->dev.of_node, "lantiq,led3l", ))
> ++vr9_gphy_mmd_write(phydev, 0x1e9, tmp);
> ++
> ++return 0;
> ++}
> ++#else
> ++static int vr9_gphy_of_reg_init(struct phy_device *phydev)
> ++{
> ++return 0;
> ++}
> ++#endif /* CONFIG_OF_MDIO */
> ++
>  +static int vr9_gphy_config_init(struct phy_device *phydev)
>  +{
>  +int err;
> @@ -129,6 +174,8 @@ Signed-off-by: John Crispin 
>  +vr9_gphy_mmd_write(phydev, 0x1e8, 0x40);
>  +vr9_gphy_mmd_write(phydev, 0x1e9, 0x20);
>  +
> ++vr9_gphy_of_reg_init(phydev);
> ++
>  +return 0;
>  +}
>  +
> @@ -269,3 +316,222 @@ Signed-off-by: John Crispin 
>  +MODULE_DESCRIPTION("Lantiq PHY drivers");
>  +MODULE_AUTHOR("Daniel Schwierzeck ");
>  +MODULE_LICENSE("GPL");
> +--- /dev/null
>  b/Documentation/devicetree/bindings/phy/phy-lanitq.txt
> +@@ -0,0 +1,216 @@
> ++Lanitq PHY binding
> ++
> ++
> ++This devicetree binding controls the lantiq ethernet phys led functionality.
> ++
> ++Example:
> ++mdio@0 {
> ++#address-cells = <1>;
> ++#size-cells = <0>;
> ++compatible = "lantiq,xrx200-mdio";
> ++phy5: ethernet-phy@5 {
> ++reg = <0x1>;
> ++compatible = "lantiq,phy11g", 
> "ethernet-phy-ieee802.3-c22";
> ++};
> ++phy11: ethernet-phy@11 {
> ++reg 

Re: [OpenWrt-Devel] [PATCH] lantiq: spi-max-frequency

2015-11-21 Thread John Crispin
Hi,

common, you know how to send a patch and put a SoB under it. i've seen
you do it lots of times ;)

John

On 09/11/2015 20:36, Daniel Gimpelevich wrote:
> On Thu, 2015-02-26 at 16:02 +0100, Joerg Jungermann wrote:
>> Hi,
>>
>> I have here multiple TD-W8970 with Annex A and Annex B.
>>
>>> m25p80@0 {
>>> #address-cells = <1>;
>>> #size-cells = <1>;
>>> compatible = "s25fl129p0";
>>> reg = <0 0>;
>>> linux,modalias = "m25p80", "mx25l3205d";
>>> spi-max-frequency = <100>;
>>
>> I increased spi-max-frequency = <5000>.
>> According to the datasheets I found that is maximum frequency.
>>
>> With my 3 models (2x A, 1x B) these settings work with BB (kernel
>> 3.10) well.
>> I have not yet tested 3.18.
>> I benchmarked boot up times from spi-flash with my build.
>> I could lower bootup times (from uboot to init-completed) from 2m01s
>> to 1m18s.
>>
>> I suggest backporting this increase of the spi freq to BB.
>>
>> best regards
> 
> Index: target/linux/lantiq/dts/DGN3500.dtsi
> ===
> --- a/target/linux/lantiq/dts/DGN3500.dtsi(revision 47278)
> +++ b/target/linux/lantiq/dts/DGN3500.dtsi(working copy)
> @@ -85,7 +85,7 @@
>   compatible = "s25fl129p0";
>   reg = <0 0>;
>   linux,modalias = "m25p80", "mx25l3205d";
> - spi-max-frequency = <100>;
> + spi-max-frequency = <5000>;
>  
>   partition@0 {
>   reg = <0x0 0x1>;
> Index: target/linux/lantiq/dts/TDW89X0.dtsi
> ===
> --- a/target/linux/lantiq/dts/TDW89X0.dtsi(revision 47278)
> +++ b/target/linux/lantiq/dts/TDW89X0.dtsi(working copy)
> @@ -160,7 +160,7 @@
>   compatible = "en25q64", "m25p80";
>   reg = <0 0>;
>   linux,modalias = "en25q64";
> - spi-max-frequency = <100>;
> + spi-max-frequency = <5000>;
>  
>   partition@0 {
>   reg = <0x0 0x2>;
> ___
> 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] [PATCH] lantiq: spi-max-frequency

2015-11-21 Thread Daniel Gimpelevich
On Sat, 2015-11-21 at 10:27 -0800, Daniel Gimpelevich wrote:
> On Sat, 2015-11-21 at 19:15 +0100, John Crispin wrote:
> > Hi,
> > 
> > common, you know how to send a patch and put a SoB under it. i've seen
> > you do it lots of times ;)
> > 
> > John
> 
> Yes, but it just doesn't feel right for me to do when the patch is
> essentially from Joerg and not from me.
> 

Are there any other DTS files to which this would apply?
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Quagga 0.99.23 CISCO EIGRP support

2015-11-21 Thread John Crispin
Hi,

package is hosted on github and not part of the core. please send a PR
via using github.

John

On 09/11/2015 03:28, Lucian Cristian wrote:
> On 04.11.2015 22:35, Lucian Cristian wrote:
>>
>> based on git: https://github.com/janovic/Quagga-EIGRP
>> tested with opennhrp (gre tunnels, no ipsec) and seems to work "as is
>> per developer's readme"
>> the git is based on 0.99.23 should I try to backport it to the current
>> openwrt quagga version ?
>>
>> Regards
>>
>> Lucian
>>
>>
>> ___
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> backported to 0.99.22.4
> 
> Regards
> 
> 
> ___
> 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] Fix Busybox “uname -o”

2015-11-21 Thread Mark Mentovai
Since r47288, “uname -o” shows “n”. It used to be “GNU/Linux”.

root@gw1 sh# uname -a
Linux gw1.nyc 4.1.11 #1 Sat Nov 21 12:50:41 EST 2015 mips n
root@gw1 sh# uname -o
n

It looks like a recent change in Busybox uname made “uname -o”
configurable:
http://git.busybox.net/busybox/commit?id=64ed5f0d3c5eefbb208d4a334654834c78be2cbd
.

In build_dir/target-mips_34kc_musl-1.1.11/busybox-1.24.1/.config, I see

CONFIG_UNAME_OSNAME="n"

Probably relevant, I use CONFIG_BUSYBOX_CUSTOM=y.

OpenWrt’s busybox/config/coreutils/Config.in needs to mirror Busybox’ own
coreutils/Config.src. Likely, all of OpenWrt’s busybox Config.in files need
to be updated in this way after a Busybox update.

Signed-off-by: Mark Mentovai 

diff --git a/package/utils/busybox/config/coreutils/Config.in
b/package/utils/busybox/config/coreutils/Config.in
index f50823f012de..e25da6519f2b 100644
--- a/package/utils/busybox/config/coreutils/Config.in
+++ b/package/utils/busybox/config/coreutils/Config.in
@@ -829,6 +829,14 @@ config BUSYBOX_CONFIG_UNAME
  help
   uname is used to print system information.

+config BUSYBOX_CONFIG_UNAME_OSNAME
+ string "Operating system name"
+ default "GNU/Linux"
+ depends on BUSYBOX_CONFIG_UNAME
+ help
+  Sets the operating system name reported by uname -o.  The
+  default is "GNU/Linux".
+
 config BUSYBOX_CONFIG_UNEXPAND
  bool "unexpand"
  default BUSYBOX_DEFAULT_UNEXPAND
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] 回复:[PATCH] ramips: reset m25p80 when shutdown

2015-11-21 Thread Daniel Golle
On Sat, Nov 21, 2015 at 09:41:25PM +0100, John Crispin wrote:
> Hi,
> 
> one more request
> 
> On 16/11/2015 18:03, 未命名 wrote:
> > Instead of use the set_4byte function in spi-nor.c, I use this patch
> > for simplest modification. In fact, set_4byte also send 0xe9 command to
> > the spi flash.

Using set_4byte also already contains the logic to check which vendor-
specific 4-byte mode to use (EN4B/EX4B or via explicite read4/write4
commands). Surely, having spi-nor provide a generic shutdown functions
using set_4byte and then using that in m25p80 is less simple than
implementing the work-around only in m25p80...


> > 
> > Signed-off-by: Shonn Lu 
> > ---
> >  .../0064-reset-m25p80-when-shutdown.patch  | 27
> > ++
> >  1 file changed, 27 insertions(+)
> >  create mode 100644
> > target/linux/ramips/patches-3.18/0064-reset-m25p80-when-shutdown.patch
> > 
> > diff --git
> > a/target/linux/ramips/patches-3.18/0064-reset-m25p80-when-shutdown.patch
> > b/target/linux/ramips/patches-3.18/0064-reset-m25p80-when-shutdown.patch
> > new file mode 100644
> > index 000..aca758d
> > --- /dev/null
> > +++ b/target/linux/ramips/patches-3.18/0064-reset-m25p80-when-shutdown.patch
> > @@ -0,0 +1,27 @@
> > +--- a/drivers/mtd/devices/m25p80.c
> >  b/drivers/mtd/devices/m25p80.c
> > +@@ -322,6 +322,16 @@
> > + {
> > + struct m25p *flash = spi_get_drvdata(spi);
> > +
> > ++ if ((>spi_nor)->addr_width > 3) {
> > ++ printk(KERN_INFO "m25p80: exit 4-byte address mode\n");
> > ++ flash->command[0] = SPINOR_OP_EX4B;  // exit 4-byte address mode: 0xe9
> > ++ spi_write(flash->spi, flash->command, 1);
> > ++ flash->command[0] = 0x66;  // enable reset
> > ++ spi_write(flash->spi, flash->command, 1); 
> > ++ flash->command[0] = 0x99;  // reset
> > ++ spi_write(flash->spi, flash->command, 1);

Are you sure the reset is actually needed?
When I tested on some Rt5350 boards, SPINOR_OP_EX4B (0xE9) did the job
and no subsequent reset was needed.

> 
> this needs to be indented with tabs
> 
>   John
> 


Cheers


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


[OpenWrt-Devel] RE?? ??????[PATCH]ramips: reset m25p80 when shutdown

2015-11-21 Thread ??????
Reset the flash is not absolutely necessary, this command should reset all the 
register, but some flash donot exit 4byte address mode with it.Of cause, 
SPINOR_OP_EX4B is already sufficient to resolve the soft reboot problem, I want 
to reset every register not only the address mode bit.Well, I will export a 
function from spi-nor.c and call it.

Cheers
Shonn
------
??: "Daniel Golle"
: 2015??11??22?? 09:26:02
??: "John Crispin";
: 
"openwrt-devel";"??";
: Re: [OpenWrt-Devel]  ??[PATCH]ramips: reset m25p80 when shutdown


On Sat, Nov 21, 2015 at 09:41:25PM +0100, John Crispin wrote:
> Hi,
> 
> one more request
> 
> On 16/11/2015 18:03, ?? wrote:
> > Instead of use the set_4byte function in spi-nor.c, I use this patch
> > for simplest modification. In fact, set_4byte also send 0xe9 command to
> > the spi flash.

Using set_4byte also already contains the logic to check which vendor-
specific 4-byte mode to use (EN4B/EX4B or via explicite read4/write4
commands). Surely, having spi-nor provide a generic shutdown functions
using set_4byte and then using that in m25p80 is less simple than
implementing the work-around only in m25p80...


> > 
> > Signed-off-by: Shonn Lu 
> > ---
> >  .../0064-reset-m25p80-when-shutdown.patch  | 27
> > ++
> >  1 file changed, 27 insertions(+)
> >  create mode 100644
> > target/linux/ramips/patches-3.18/0064-reset-m25p80-when-shutdown.patch
> > 
> > diff --git
> > a/target/linux/ramips/patches-3.18/0064-reset-m25p80-when-shutdown.patch
> > b/target/linux/ramips/patches-3.18/0064-reset-m25p80-when-shutdown.patch
> > new file mode 100644
> > index 000..aca758d
> > --- /dev/null
> > +++ b/target/linux/ramips/patches-3.18/0064-reset-m25p80-when-shutdown.patch
> > @@ -0,0 +1,27 @@
> > +--- a/drivers/mtd/devices/m25p80.c
> >  b/drivers/mtd/devices/m25p80.c
> > +@@ -322,6 +322,16 @@
> > + {
> > + struct m25p *flash = spi_get_drvdata(spi);
> > +
> > ++ if ((>spi_nor)->addr_width > 3) {
> > ++ printk(KERN_INFO "m25p80: exit 4-byte address mode\n");
> > ++ flash->command[0] = SPINOR_OP_EX4B;  // exit 4-byte address mode: 0xe9
> > ++ spi_write(flash->spi, flash->command, 1);
> > ++ flash->command[0] = 0x66;  // enable reset
> > ++ spi_write(flash->spi, flash->command, 1); 
> > ++ flash->command[0] = 0x99;  // reset
> > ++ spi_write(flash->spi, flash->command, 1);

Are you sure the reset is actually needed?
When I tested on some Rt5350 boards, SPINOR_OP_EX4B (0xE9) did the job
and no subsequent reset was needed.

> 
> this needs to be indented with tabs
> 
> John
> 


Cheers


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


Re: [OpenWrt-Devel] [PATCH] lantiq: spi-max-frequency

2015-11-21 Thread Daniel Gimpelevich
On Sat, 2015-11-21 at 20:19 +0100, John Crispin wrote:
> 
> On 21/11/2015 20:17, Daniel Gimpelevich wrote:
> > On Sat, 2015-11-21 at 20:15 +0100, John Crispin wrote:
> >> On 21/11/2015 20:05, Daniel Gimpelevich wrote:
> >>> On Sat, 2015-11-21 at 10:27 -0800, Daniel Gimpelevich wrote:
>  On Sat, 2015-11-21 at 19:15 +0100, John Crispin wrote:
> > Hi,
> >
> > common, you know how to send a patch and put a SoB under it. i've seen
> > you do it lots of times ;)
> >
> > John
> 
>  Yes, but it just doesn't feel right for me to do when the patch is
>  essentially from Joerg and not from me.
> 
> >>>
> >>> Are there any other DTS files to which this would apply?
> >>>
> >>
> >> grep for spi-gpio in the dts folder
> > 
> > Do all three of those use the same chip?
> 
> probably not
> 
> 
> > 

I ask because Joerg mentioned some sort of datasheet. I only know that
he tried the patch with BB on the TP-Link and it worked, and I tried it
with DD on the Netgear and it worked. I never got CC to work properly
with or without it. Any chance you can test on the FritzBox before a
resubmit?
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH procd 2/2] ujail: rework file dependencies detection (use ldd)

2015-11-21 Thread Paul Fertser
Hello,

John Crispin  writes:
> // is c++
>
> /* this is the c version */

Strictly speaking, // is a valid way to add one-line comments since C99.

-- 
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercer...@gmail.com
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v5 5/5] ar71xx: add support for Cisco's MR18

2015-11-21 Thread John Crispin
Hi

comments inline



On 22/09/2015 19:08, Chris R Blake wrote:
> From: Chris R Blake 
> 
> This patch adds support for Cisco's MR18.
> Detailed instructions for the flashing the device can
> be found in the OpenWrt forum thread:
> 
> 
> Signed-off-by: Chris R Blake 
> ---
>  package/base-files/files/lib/functions/system.sh   |  17 ++

this file

>  target/linux/ar71xx/base-files/etc/diag.sh |   3 +
>  .../etc/hotplug.d/firmware/10-ath9k-eeprom |  38 ++-

and this one need to go into a separate patch file as they dont directly
relate to the subject of this patch

John

>  .../ar71xx/base-files/etc/uci-defaults/01_leds |   4 +
>  .../ar71xx/base-files/etc/uci-defaults/02_network  |   1 +
>  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
>  .../base-files/lib/preinit/05_set_iface_mac_ar71xx |   4 +
>  .../ar71xx/base-files/lib/upgrade/merakinand.sh| 137 +++
>  .../ar71xx/base-files/lib/upgrade/platform.sh  |   7 +
>  target/linux/ar71xx/config-4.1 |   1 +
>  .../linux/ar71xx/files/arch/mips/ath79/mach-mr18.c | 254 
> +
>  target/linux/ar71xx/image/Makefile |  34 +++
>  target/linux/ar71xx/nand/config-default|   1 +
>  target/linux/ar71xx/nand/profiles/meraki.mk|  17 ++
>  .../817-MIPS-ath79-add-meraki-mr18-support.patch   |  41 
>  15 files changed, 561 insertions(+), 1 deletion(-)
>  create mode 100644 target/linux/ar71xx/base-files/lib/upgrade/merakinand.sh
>  create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-mr18.c
>  create mode 100644 target/linux/ar71xx/nand/profiles/meraki.mk
>  create mode 100644 
> target/linux/ar71xx/patches-4.1/817-MIPS-ath79-add-meraki-mr18-support.patch
> 
> diff --git a/package/base-files/files/lib/functions/system.sh 
> b/package/base-files/files/lib/functions/system.sh
> index 8d75a5a..928a429 100644
> --- a/package/base-files/files/lib/functions/system.sh
> +++ b/package/base-files/files/lib/functions/system.sh
> @@ -41,6 +41,23 @@ mtd_get_mac_binary() {
>   dd bs=1 skip=$offset count=6 if=$part 2>/dev/null | hexdump -v -n 6 -e 
> '5/1 "%02x:" 1/1 "%02x"'
>  }
>  
> +mtd_get_mac_binary_ubi() {
> + local mtdname="$1"
> + local offset="$2"
> +
> + . /lib/upgrade/nand.sh
> +
> + local ubidev=$( nand_find_ubi $CI_UBIPART )
> + local part="$( nand_find_volume $ubidev $1 )"
> +
> + if [ -z "$part" ]; then
> + echo "mtd_get_mac_binary: ubi partition $mtdname not found!" >&2
> + return
> + fi
> +
> + dd bs=1 skip=$offset count=6 if=/dev/$part 2>/dev/null | hexdump -v -n 
> 6 -e '5/1 "%02x:" 1/1 "%02x"'
> +}
> +
>  mtd_get_part_size() {
>   local part_name=$1
>   local first dev size erasesize name
> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
> b/target/linux/ar71xx/base-files/etc/diag.sh
> index cfba6b4..d6cc23f 100644
> --- a/target/linux/ar71xx/base-files/etc/diag.sh
> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
> @@ -144,6 +144,9 @@ get_status_led() {
>   mr16)
>   status_led="mr16:green:power"
>   ;;
> + mr18)
> + status_led="mr18:green:tricolor0"
> + ;;
>   mr600)
>   status_led="mr600:orange:power"
>   ;;
> diff --git 
> a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom 
> b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
> index b5f0588..bfab8bb 100644
> --- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
> +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
> @@ -9,11 +9,14 @@ ath9k_eeprom_extract() {
>   local part=$1
>   local offset=$2
>   local count=$3
> + local ubidev=$( nand_find_ubi $CI_UBIPART )
>   local mtd
>  
>   mtd=$(find_mtd_chardev $part)
>   [ -n "$mtd" ] || \
> - ath9k_eeprom_die "no mtd device found for partition $part"
> + mtd="/dev/$(nand_find_volume $ubidev $part)"
> + [ -n "$mtd" ] || \
> + ath9k_eeprom_die "no mtd device found for partition 
> $part"
>  
>   dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 
> 2>/dev/null || \
>   ath9k_eeprom_die "failed to extract from $mtd"
> @@ -32,12 +35,21 @@ ath9k_patch_firmware_mac() {
>  . /lib/ar71xx.sh
>  . /lib/functions.sh
>  . /lib/functions/system.sh
> +. /lib/upgrade/nand.sh
>  
>  board=$(ar71xx_board_name)
>  
>  case "$FIRMWARE" in
>  "soc_wmac.eeprom")
>   case $board in
> + mr18)
> + if [ -n "$(nand_find_volume ubi0 caldata)" ]; then
> + ath9k_eeprom_extract "caldata" 4096 2048
> + else
> + ath9k_eeprom_extract "odm-caldata" 4096 2048
> + fi
> + ath9k_patch_firmware_mac 

Re: [OpenWrt-Devel] [PATCH v5 4/5] ar71xx: add LED driver NU801

2015-11-21 Thread John Crispin
Hi,

1 comment inline

On 22/09/2015 19:07, Chris R Blake wrote:
> From: Chris R Blake 
> 
> The MR18 uses a 3-channel 16-bit PWM Constant Current Driver
> for its status LED.
> 
> Signed-off-by: Chris R Blake 
> ---
>  package/base-files/files/etc/init.d/led|   2 +-
>  .../linux/ar71xx/files/drivers/leds/leds-nu801.c   | 396 
> +
>  .../linux/ar71xx/files/include/linux/leds-nu801.h  |  38 ++
>  target/linux/ar71xx/modules.mk |  16 +
>  .../818-MIPS-ath79-add-nu801-led-driver.patch  |  26 ++
>  5 files changed, 477 insertions(+), 1 deletion(-)
>  create mode 100644 target/linux/ar71xx/files/drivers/leds/leds-nu801.c
>  create mode 100644 target/linux/ar71xx/files/include/linux/leds-nu801.h
>  create mode 100644 
> target/linux/ar71xx/patches-4.1/818-MIPS-ath79-add-nu801-led-driver.patch
> 
> diff --git a/package/base-files/files/etc/init.d/led 
> b/package/base-files/files/etc/init.d/led
> index 3f45732..84cd028 100755
> --- a/package/base-files/files/etc/init.d/led
> +++ b/package/base-files/files/etc/init.d/led
> @@ -44,7 +44,7 @@ load_led() {
>   ret="$?"
>  
>   [ $default = 1 ] &&
> - echo 1 >/sys/class/leds/${sysfs}/brightness
> + cat /sys/class/leds/${sysfs}/max_brightness > 
> /sys/class/leds/${sysfs}/brightness
>  
>   [ $ret = 0 ] || {
>   echo >&2 "Skipping trigger '$trigger' for led '$name' 
> due to missing kernel module"

this is a nice corner case i never considered before. however this part
of the patch need to go into its own patch file as it modifies a
different part of openwrt.

John


> diff --git a/target/linux/ar71xx/files/drivers/leds/leds-nu801.c 
> b/target/linux/ar71xx/files/drivers/leds/leds-nu801.c
> new file mode 100644
> index 000..0dfc015
> --- /dev/null
> +++ b/target/linux/ar71xx/files/drivers/leds/leds-nu801.c
> @@ -0,0 +1,396 @@
> +/*
> + * LED driver for NU801
> + *
> + * Kevin Paul Herbert
> + * Copyright (c) 2012, Meraki, Inc.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +
> +#define MAX_NAME_LENGTH 24
> +#define NUM_COLORS 3
> +
> +static const char * const led_nu801_colors[] = { "blue", "green", "red" };
> +
> +struct led_nu801_led_data {
> + struct led_classdev cdev;
> + struct led_nu801_data *controller;
> + enum led_brightness level;
> + char name[MAX_NAME_LENGTH];
> +};
> +
> +struct led_nu801_data {
> + unsigned cki;
> + unsigned sdi;
> + int lei;
> + struct delayed_work work;
> + struct led_nu801_led_data *led_chain;
> + int num_leds;
> + const char *device_name;
> + const char *name;
> + u32 ndelay;
> + atomic_t pending;
> +};
> +
> +static void led_nu801_work(struct work_struct *work)
> +{
> + struct led_nu801_data   *controller =
> + container_of(work, struct led_nu801_data, work.work);
> + struct led_nu801_led_data *led;
> + u16 bit;
> + u16 brightness;
> + int index;
> +
> + for (index = 0; index < controller->num_leds; index++) {
> + led = >led_chain[index];
> + brightness = led->level << 8; /* To do: gamma correction */
> + for (bit = 0x8000; bit; bit = bit >> 1) {
> + gpio_set_value(controller->sdi,
> +(brightness & bit) != 0);
> + gpio_set_value(controller->cki, 1);
> + if (unlikely(((index == (controller->num_leds - 1)) &&
> +   (bit == 1) &&
> +   (controller->lei < 0 {
> + udelay(600);
> + } else {
> + ndelay(controller->ndelay);
> + }
> + gpio_set_value(controller->cki, 0);
> + ndelay(controller->ndelay);
> + }
> + }
> + if (controller->lei >= 0) {
> + gpio_set_value(controller->lei, 1);
> + ndelay(controller->ndelay);
> + gpio_set_value(controller->lei, 0);
> + }
> + atomic_set(>pending, 1);
> +}
> +
> +static void led_nu801_set(struct led_classdev *led_cdev,
> +   enum led_brightness value)
> +{
> + struct led_nu801_led_data *led_dat =
> + container_of(led_cdev, struct led_nu801_led_data, cdev);
> + struct led_nu801_data *controller = led_dat->controller;
> +
> + if (led_dat->level != value) {
> + led_dat->level = value;
> + if (atomic_dec_and_test(>pending))
> +

Re: [OpenWrt-Devel] [PATCH v2] ar71xx: Add support for Wallys DR344

2015-11-21 Thread John Crispin
Hi,

Applying: ar71xx: Add support for Wallys DR344
fatal: sha1 information is lacking or useless
(target/linux/ar71xx/base-files/etc/diag.sh).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 ar71xx: Add support for Wallys DR344
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
applying 547222 FAILED

which tree are you basing this on ?

John

On 21/11/2015 19:56, Philippe DUCHEIN wrote:
> Hi John,
> Sorry for convenience
> I suppressed it
> 
> 
> 
> This patch is for Wallys DR344 support under OpenWRT. It’s release 2.1
> ChangeLog: suppress suppress blank line insert
> into target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
> 
> Signed-off-by: Philippe DUCHEIN  >
> 
> ---
> 
> diff -Nru a/target/linux/ar71xx/base-files/etc/diag.sh
> b/target/linux/ar71xx/base-files/etc/diag.sh
> --- a/target/linux/ar71xx/base-files/etc/diag.sh2015-10-27
> 18:57:41.368735097 +0100
> +++ b/target/linux/ar71xx/base-files/etc/diag.sh2015-10-29
> 12:05:58.995324966 +0100
> @@ -92,6 +92,9 @@
>  dlan-pro-1200-ac)
>  status_led="devolo:status:wlan"
>  ;;
> +dr344)
> +status_led="dr344:green:status"
> +;;
>  dragino2)
>  status_led="dragino2:red:system"
>  ;;
> diff -Nru a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> ---
> a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network2015-10-27
> 18:57:41.363735040 +0100
> +++
> b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network2015-10-29
> 12:05:58.995324966 +0100
> @@ -17,6 +17,7 @@
>  case "$board" in
>  all0315n |\
>  all0258n |\
> +dr344 |\
>  ja76pf2|\
>  rocket-m-ti |\
>  ubnt-unifi-outdoor)
> diff -Nru a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh2015-10-27
> 18:57:41.341734786 +0100
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh2015-10-29
> 12:05:58.996324978 +0100
> @@ -456,6 +456,9 @@
>  *"dLAN pro 1200+ WiFi ac")
>  name="dlan-pro-1200-ac"
>  ;;
> +*DR344)
> +name="dr344"
> +;;
>  *"Dragino v2")
>  name="dragino2"
>  ;;
> diff -Nru a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh2015-10-27
> 18:57:41.329734649 +0100
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh2015-10-29
> 12:06:23.597611781 +0100
> @@ -183,6 +183,7 @@
>  ap96 | \
>  bxu2000n-2-a1 | \
>  db120 | \
> +dr344 | \
>  f9k1115v2 |\
>  hornet-ub | \
>  mr12 | \
> diff -Nru a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
> --- a/target/linux/ar71xx/config-4.12015-10-27 18:57:41.379735223 +0100
> +++ b/target/linux/ar71xx/config-4.12015-10-29 12:05:58.996324978 +0100
> @@ -64,6 +64,7 @@
>  CONFIG_ATH79_MACH_DIR_825_C1=y
>  CONFIG_ATH79_MACH_DLAN_PRO_1200_AC=y
>  CONFIG_ATH79_MACH_DLAN_PRO_500_WP=y
> +CONFIG_ATH79_MACH_DR344=y
>  CONFIG_ATH79_MACH_DRAGINO2=y
>  CONFIG_ATH79_MACH_EAP300V2=y
>  CONFIG_ATH79_MACH_EAP7660D=y
> diff -Nru a/target/linux/ar71xx/generic/profiles/wallys.mk
> b/target/linux/ar71xx/generic/profiles/wallys.mk
> --- a/target/linux/ar71xx/generic/profiles/wallys.mk1970-01-01
> 01:00:00.0 +0100
> +++ b/target/linux/ar71xx/generic/profiles/wallys.mk2015-10-29
> 12:05:58.996324978 +0100
> @@ -0,0 +1,17 @@
> +#
> +# Copyright (C) 2015 Philippe DUCHEIN  >
> +# Copyright (C) 2009 OpenWrt.org 
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +define Profile/DR344
> +NAME:=Wallys DR344
> +endef
> +
> +define Profile/DR344/Description
> +Package set optimized for the Wallys DR344 board.
> +endef
> +
> +$(eval $(call Profile,DR344))
> +
> diff -Nru a/target/linux/ar71xx/image/Makefile
> b/target/linux/ar71xx/image/Makefile
> --- a/target/linux/ar71xx/image/Makefile2015-10-27 18:57:41.248733718 +0100
> +++ b/target/linux/ar71xx/image/Makefile2015-10-29 12:05:58.997324990 +0100
> @@ -1457,6 +1457,7 @@
>  
> whrhpg300n_mtdlayout=mtdparts=spi0.0:248k(u-boot)ro,8k(u-boot-env)ro,3712k(firmware),64k(art)ro
>  
> wlr8100_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),14080k(rootfs),192k(unknown)ro,64k(art)ro,384k(unknown2)ro,15488k@0x4(firmware)
>  
> wpj344_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
> +dr344_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x5(firmware)
>  
> 

Re: [OpenWrt-Devel] [PATCH] Fix Busybox “uname -o”

2015-11-21 Thread Mark Mentovai

John Crispin wrote:

patch does not apply to current trunk


Sorry, the tabs got swallowed. I re-sent it.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] lantiq: spi-max-frequency

2015-11-21 Thread Daniel Gimpelevich
On Sat, 2015-11-21 at 20:15 +0100, John Crispin wrote:
> On 21/11/2015 20:05, Daniel Gimpelevich wrote:
> > On Sat, 2015-11-21 at 10:27 -0800, Daniel Gimpelevich wrote:
> >> On Sat, 2015-11-21 at 19:15 +0100, John Crispin wrote:
> >>> Hi,
> >>>
> >>> common, you know how to send a patch and put a SoB under it. i've seen
> >>> you do it lots of times ;)
> >>>
> >>> John
> >>
> >> Yes, but it just doesn't feel right for me to do when the patch is
> >> essentially from Joerg and not from me.
> >>
> > 
> > Are there any other DTS files to which this would apply?
> > 
> 
> grep for spi-gpio in the dts folder

Do all three of those use the same chip?
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v5 2/5] ar71xx: add support for qca955x sgmii/serdes calibration

2015-11-21 Thread John Crispin
Hi,

same as on 1/5 the registers are not set in the right part of the code

John

On 22/09/2015 18:49, Chris R Blake wrote:
> From: Chris R Blake 
> 
> This patch is to add support for sgmii/serdes calibration from
> within the OpenWRT environment. This is needed on boards that
> do not use u-boot or do not have a pre-init process that runs
> calibration.
> 
> Signed-off-by: Chris R Blake 
> ---
>  ...S-ath79-add-qca955x-mac-sgmii-calibration.patch | 82 
> ++
>  1 file changed, 82 insertions(+)
>  create mode 100644 
> target/linux/ar71xx/patches-4.1/743-MIPS-ath79-add-qca955x-mac-sgmii-calibration.patch
> 
> diff --git 
> a/target/linux/ar71xx/patches-4.1/743-MIPS-ath79-add-qca955x-mac-sgmii-calibration.patch
>  
> b/target/linux/ar71xx/patches-4.1/743-MIPS-ath79-add-qca955x-mac-sgmii-calibration.patch
> new file mode 100644
> index 000..eb7c5de
> --- /dev/null
> +++ 
> b/target/linux/ar71xx/patches-4.1/743-MIPS-ath79-add-qca955x-mac-sgmii-calibration.patch
> @@ -0,0 +1,82 @@
> +--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h 2015-08-05 
> 12:58:15.580496899 +0200
>  b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h 2015-08-05 
> 13:52:32.590857293 +0200
> +@@ -360,6 +360,7 @@
> + #define QCA955X_PLL_CLK_CTRL_REG0x08
> + #define QCA955X_PLL_ETH_XMII_CONTROL_REG0x28
> + #define QCA955X_PLL_ETH_SGMII_CONTROL_REG   0x48
> ++#define QCA955X_PLL_ETH_SGMII_SERDES_REG0x4c
> +
> + #define QCA955X_PLL_CPU_CONFIG_NFRAC_SHIFT  0
> + #define QCA955X_PLL_CPU_CONFIG_NFRAC_MASK   0x3f
> +@@ -392,6 +393,10 @@
> + #define QCA955X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL BIT(21)
> + #define QCA955X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL BIT(24)
> +
> ++#define QCA955X_PLL_ETH_SGMII_SERDES_LOCK_DETECTBIT(2)
> ++#define QCA955X_PLL_ETH_SGMII_SERDES_PLL_REFCLK BIT(1)
> ++#define QCA955X_PLL_ETH_SGMII_SERDES_EN_PLL BIT(0)
> ++
> + #define QCA956X_PLL_CPU_CONFIG_REG  0x00
> + #define QCA956X_PLL_CPU_CONFIG1_REG 0x04
> + #define QCA956X_PLL_DDR_CONFIG_REG  0x08
> +@@ -1104,5 +1109,11 @@
> + #define QCA955X_ETH_CFG_RDV_DELAY   BIT(16)
> + #define QCA955X_ETH_CFG_RDV_DELAY_MASK  0x3
> + #define QCA955X_ETH_CFG_RDV_DELAY_SHIFT 16
> ++
> ++#define QCA955X_GMAC_REG_SGMII_SERDES   0x0018
> ++#define QCA955X_SGMII_SERDES_RES_CALIBRATIONBIT(23)
> ++#define QCA955X_SGMII_SERDES_RES_CALIBRATION_MASK   0xf
> ++#define QCA955X_SGMII_SERDES_RES_CALIBRATION_SHIFT  23
> ++#define QCA955X_SGMII_SERDES_LOCK_DETECT_STATUS BIT(15)
> +
> + #endif /* __ASM_MACH_AR71XX_REGS_H */
> +--- a/arch/mips/ath79/dev-eth.c  2015-08-05 14:17:25.757504251 +0200
>  b/arch/mips/ath79/dev-eth.c  2015-08-05 14:09:54.716333554 +0200
> +@@ -849,6 +849,37 @@ void __init ath79_setup_qca955x_eth_rx_d
> + iounmap(base);
> + }
> +
> ++void __init ath79_setup_qca955x_eth_serdes_cal(unsigned int sgmii_value)
> ++{
> ++void __iomem *ethbase, *pllbase;
> ++u32 t;
> ++
> ++ethbase = ioremap_nocache(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE);
> ++pllbase = ioremap_nocache(AR71XX_PLL_BASE, AR71XX_PLL_SIZE);
> ++
> ++/* To Check the locking of the SGMII PLL */
> ++t = __raw_readl(ethbase + QCA955X_GMAC_REG_SGMII_SERDES);
> ++t &= ~(QCA955X_SGMII_SERDES_RES_CALIBRATION_MASK <<
> ++   QCA955X_SGMII_SERDES_RES_CALIBRATION_SHIFT);
> ++t |= (sgmii_value & QCA955X_SGMII_SERDES_RES_CALIBRATION_MASK) <<
> ++ QCA955X_SGMII_SERDES_RES_CALIBRATION_SHIFT;
> ++__raw_writel(t, ethbase + QCA955X_GMAC_REG_SGMII_SERDES);
> ++
> ++__raw_writel(QCA955X_PLL_ETH_SGMII_SERDES_LOCK_DETECT |
> ++ QCA955X_PLL_ETH_SGMII_SERDES_PLL_REFCLK |
> ++ QCA955X_PLL_ETH_SGMII_SERDES_EN_PLL,
> ++ pllbase + QCA955X_PLL_ETH_SGMII_SERDES_REG);
> ++
> ++ath79_device_reset_clear(QCA955X_RESET_SGMII_ANALOG);
> ++ath79_device_reset_clear(QCA955X_RESET_SGMII);
> ++
> ++while (!(__raw_readl(ethbase + QCA955X_GMAC_REG_SGMII_SERDES) &
> ++QCA955X_SGMII_SERDES_LOCK_DETECT_STATUS));
> ++
> ++iounmap(ethbase);
> ++iounmap(pllbase);
> ++}
> ++
> + static int ath79_eth_instance __initdata;
> + void __init ath79_register_eth(unsigned int id)
> + {
> +--- a/arch/mips/ath79/dev-eth.h  2015-08-05 14:17:25.757504251 +0200
>  b/arch/mips/ath79/dev-eth.h  2015-08-05 13:58:20.292866210 +0200
> +@@ -50,5 +50,6 @@ void ath79_setup_ar934x_eth_cfg(u32 mask
> + void ath79_setup_ar934x_eth_rx_delay(unsigned int rxd, unsigned int rxdv);
> + void ath79_setup_qca955x_eth_cfg(u32 mask);
> + void ath79_setup_qca955x_eth_rx_delay(unsigned int rxd, unsigned int rxdv);
> ++void ath79_setup_qca955x_eth_serdes_cal(unsigned int sgmii_value);
> +
> + #endif /* _ATH79_DEV_ETH_H */
> 
___
openwrt-devel mailing list

Re: [OpenWrt-Devel] [PATCH] kernel/generic: 3.18, 4.y: Add support for Quectel EC20 Mini PCIe module

2015-11-21 Thread John Crispin
Thanks, i dropped the 4.0 part as we dont have that in trunk anymore

John

On 11/11/2015 14:18, Petr Štetiar wrote:
> * both patches (qcserial/qmi_wwan) were submitted upstream[1,2]
> * build tested on 3.18 and 4.1
> * run tested on imx6 platform with 4.1
> 
> 1. http://article.gmane.org/gmane.linux.usb.general/132998
> 2. http://article.gmane.org/gmane.linux.usb.general/133113
> 
> Signed-off-by: Petr Štetiar 
> ---
>  ...l-Add-support-for-Quectel-EC20-Mini-PCIe-.patch |  119 
> 
>  ...n-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch |  101 +
>  ...l-Add-support-for-Quectel-EC20-Mini-PCIe-.patch |  119 
> 
>  ...n-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch |  101 +
>  ...l-Add-support-for-Quectel-EC20-Mini-PCIe-.patch |  119 
> 
>  ...n-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch |  101 +
>  ...l-Add-support-for-Quectel-EC20-Mini-PCIe-.patch |  119 
> 
>  ...n-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch |  101 +
>  8 files changed, 880 insertions(+)
>  create mode 100644 
> target/linux/generic/patches-3.18/192-USB-qcserial-Add-support-for-Quectel-EC20-Mini-PCIe-.patch
>  create mode 100644 
> target/linux/generic/patches-3.18/193-USB-qmi_wwan-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch
>  create mode 100644 
> target/linux/generic/patches-4.0/192-USB-qcserial-Add-support-for-Quectel-EC20-Mini-PCIe-.patch
>  create mode 100644 
> target/linux/generic/patches-4.0/193-USB-qmi_wwan-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch
>  create mode 100644 
> target/linux/generic/patches-4.1/192-USB-qcserial-Add-support-for-Quectel-EC20-Mini-PCIe-.patch
>  create mode 100644 
> target/linux/generic/patches-4.1/193-USB-qmi_wwan-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch
>  create mode 100644 
> target/linux/generic/patches-4.3/192-USB-qcserial-Add-support-for-Quectel-EC20-Mini-PCIe-.patch
>  create mode 100644 
> target/linux/generic/patches-4.3/193-USB-qmi_wwan-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch
> 
> diff --git 
> a/target/linux/generic/patches-3.18/192-USB-qcserial-Add-support-for-Quectel-EC20-Mini-PCIe-.patch
>  
> b/target/linux/generic/patches-3.18/192-USB-qcserial-Add-support-for-Quectel-EC20-Mini-PCIe-.patch
> new file mode 100644
> index 000..f56941c
> --- /dev/null
> +++ 
> b/target/linux/generic/patches-3.18/192-USB-qcserial-Add-support-for-Quectel-EC20-Mini-PCIe-.patch
> @@ -0,0 +1,119 @@
> +From 128524b9db3e4f4245226852bee771bd03db75be Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Petr=20=C5=A0tetiar?= 
> +Date: Tue, 3 Nov 2015 11:01:42 +0100
> +Subject: [PATCH 1/2] USB: qcserial: Add support for Quectel EC20 Mini PCIe
> + module
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +It seems like this device has same vendor and product IDs as G2K
> +devices, but it has different number of interfaces(4 vs 5) and also
> +different interface layout which makes it currently unusable:
> +
> + usbcore: registered new interface driver qcserial
> + usbserial: USB Serial support registered for Qualcomm USB modem
> + usb 2-1.2: unknown number of interfaces: 5
> +
> +lsusb output:
> +
> + Bus 002 Device 003: ID 05c6:9215 Qualcomm, Inc. Acer Gobi 2000 Wireless
> + Device Descriptor:
> +   bLength18
> +   bDescriptorType 1
> +   bcdUSB   2.00
> +   bDeviceClass0 (Defined at Interface level)
> +   bDeviceSubClass 0
> +   bDeviceProtocol 0
> +   bMaxPacketSize064
> +   idVendor   0x05c6 Qualcomm, Inc.
> +   idProduct  0x9215 Acer Gobi 2000 Wireless Modem
> +   bcdDevice2.32
> +   iManufacturer   1 Quectel
> +   iProduct2 Quectel LTE Module
> +   iSerial 0
> +   bNumConfigurations  1
> +   Configuration Descriptor:
> + bLength 9
> + bDescriptorType 2
> + wTotalLength  209
> + bNumInterfaces  5
> + bConfigurationValue 1
> + iConfiguration  0
> + bmAttributes 0xa0
> +   (Bus Powered)
> +   Remote Wakeup
> + MaxPower  500mA
> +
> +Signed-off-by: Petr Štetiar 
> +---
> + drivers/usb/serial/qcserial.c |   39 +++
> + 1 file changed, 39 insertions(+)
> +
> +diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
> +index ebcec8c..d462132 100644
> +--- a/drivers/usb/serial/qcserial.c
>  b/drivers/usb/serial/qcserial.c
> +@@ -22,6 +22,8 @@
> + #define DRIVER_AUTHOR "Qualcomm Inc"
> + #define DRIVER_DESC "Qualcomm USB Serial driver"
> + 
> ++#define QUECTEL_EC20_IDPRODUCT 0x9215
> ++
> + /* standard device layouts supported by this 

[OpenWrt-Devel] [PATCH] busybox: Update config for 1.24.1

2015-11-21 Thread Mark Mentovai

r47288 updated to Busybox 1.24.1 but did not update the configuration.

The configuration is updated by running

cd config
../convert_menuconfig.pl .../build_dir/target-*/busybox-1.24.1
cd ..
./convert_defaults.pl < .../build_dir/target-*/busybox-1.24.1/.config > \
Config-defaults.in

Signed-off-by: Mark Mentovai 
---
 package/utils/busybox/Config-defaults.in  | 159 +++---
 package/utils/busybox/config/archival/Config.in   |  10 ++
 package/utils/busybox/config/coreutils/Config.in  | 116 +++--
 package/utils/busybox/config/miscutils/Config.in  |  36 +
 package/utils/busybox/config/networking/Config.in | 135 +++-
 package/utils/busybox/config/selinux/Config.in|   2 +-
 package/utils/busybox/config/util-linux/Config.in | 189 --
 7 files changed, 412 insertions(+), 235 deletions(-)

diff --git a/package/utils/busybox/Config-defaults.in 
b/package/utils/busybox/Config-defaults.in
index 2689b4f71aeb..75c59760c3b6 100644
--- a/package/utils/busybox/Config-defaults.in
+++ b/package/utils/busybox/Config-defaults.in
@@ -361,6 +361,9 @@ config BUSYBOX_DEFAULT_FEATURE_GZIP_LONG_OPTIONS
 config BUSYBOX_DEFAULT_GZIP_FAST
int
default 0
+config BUSYBOX_DEFAULT_FEATURE_GZIP_LEVELS
+   bool
+   default n
 config BUSYBOX_DEFAULT_LZOP
bool
default n
@@ -430,6 +433,21 @@ config BUSYBOX_DEFAULT_FEATURE_DATE_NANO
 config BUSYBOX_DEFAULT_FEATURE_DATE_COMPAT
bool
default n
+config BUSYBOX_DEFAULT_DD
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_DD_SIGNAL_HANDLING
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_DD_THIRD_STATUS_LINE
+   bool
+   default n
+config BUSYBOX_DEFAULT_FEATURE_DD_IBS_OBS
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_DD_STATUS
+   bool
+   default n
 config BUSYBOX_DEFAULT_HOSTID
bool
default n
@@ -442,6 +460,12 @@ config BUSYBOX_DEFAULT_GROUPS
 config BUSYBOX_DEFAULT_SHUF
bool
default n
+config BUSYBOX_DEFAULT_SYNC
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_SYNC_FANCY
+   bool
+   default n
 config BUSYBOX_DEFAULT_TEST
bool
default y
@@ -466,6 +490,9 @@ config BUSYBOX_DEFAULT_FEATURE_TR_CLASSES
 config BUSYBOX_DEFAULT_FEATURE_TR_EQUIV
bool
default n
+config BUSYBOX_DEFAULT_TRUNCATE
+   bool
+   default n
 config BUSYBOX_DEFAULT_UNLINK
bool
default n
@@ -514,18 +541,6 @@ config BUSYBOX_DEFAULT_FEATURE_CP_LONG_OPTIONS
 config BUSYBOX_DEFAULT_CUT
bool
default y
-config BUSYBOX_DEFAULT_DD
-   bool
-   default y
-config BUSYBOX_DEFAULT_FEATURE_DD_SIGNAL_HANDLING
-   bool
-   default y
-config BUSYBOX_DEFAULT_FEATURE_DD_THIRD_STATUS_LINE
-   bool
-   default n
-config BUSYBOX_DEFAULT_FEATURE_DD_IBS_OBS
-   bool
-   default y
 config BUSYBOX_DEFAULT_DF
bool
default y
@@ -730,9 +745,6 @@ config BUSYBOX_DEFAULT_STTY
 config BUSYBOX_DEFAULT_SUM
bool
default n
-config BUSYBOX_DEFAULT_SYNC
-   bool
-   default y
 config BUSYBOX_DEFAULT_TAC
bool
default n
@@ -757,6 +769,9 @@ config BUSYBOX_DEFAULT_TTY
 config BUSYBOX_DEFAULT_UNAME
bool
default y
+config BUSYBOX_DEFAULT_UNAME_OSNAME
+   string
+   default "GNU/Linux"
 config BUSYBOX_DEFAULT_UNEXPAND
bool
default n
@@ -1348,9 +1363,42 @@ config BUSYBOX_DEFAULT_FEATURE_MDEV_EXEC
 config BUSYBOX_DEFAULT_FEATURE_MDEV_LOAD_FIRMWARE
bool
default n
+config BUSYBOX_DEFAULT_MOUNT
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_FAKE
+   bool
+   default n
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_VERBOSE
+   bool
+   default n
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_HELPERS
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_LABEL
+   bool
+   default n
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_NFS
+   bool
+   default n
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_CIFS
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_FLAGS
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_FSTAB
+   bool
+   default y
+config BUSYBOX_DEFAULT_FEATURE_MOUNT_OTHERTAB
+   bool
+   default n
 config BUSYBOX_DEFAULT_REV
bool
default n
+config BUSYBOX_DEFAULT_UEVENT
+   bool
+   default n
 config BUSYBOX_DEFAULT_ACPID
bool
default n
@@ -1486,33 +1534,6 @@ config BUSYBOX_DEFAULT_FEATURE_MKSWAP_UUID
 config BUSYBOX_DEFAULT_MORE
bool
default n
-config BUSYBOX_DEFAULT_MOUNT
-   bool
-   default y
-config BUSYBOX_DEFAULT_FEATURE_MOUNT_FAKE
-   bool
-   default n
-config BUSYBOX_DEFAULT_FEATURE_MOUNT_VERBOSE
-   bool
-   default n
-config BUSYBOX_DEFAULT_FEATURE_MOUNT_HELPERS
-   bool
-   default y
-config 

Re: [OpenWrt-Devel] [PATCH procd 2/2] ujail: rework file dependencies detection (use ldd)

2015-11-21 Thread John Crispin


On 21/11/2015 20:50, Paul Fertser wrote:
> Hello,
> 
> John Crispin  writes:
>> // is c++
>>
>> /* this is the c version */
> 
> Strictly speaking, // is a valid way to add one-line comments since C99.
> 

ok, let me be more precise. the code style of procd forbids this ;)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Fix Busybox “uname -o”

2015-11-21 Thread John Crispin
Hi,

patch does not apply to current trunk

John

On 21/11/2015 19:34, Mark Mentovai wrote:
> Since r47288, “uname -o” shows “n”. It used to be “GNU/Linux”.
> 
> root@gw1 sh# uname -a
> Linux gw1.nyc 4.1.11 #1 Sat Nov 21 12:50:41 EST 2015 mips n
> root@gw1 sh# uname -o
> n
> 
> It looks like a recent change in Busybox uname made “uname -o”
> configurable: 
> http://git.busybox.net/busybox/commit?id=64ed5f0d3c5eefbb208d4a334654834c78be2cbd.
> 
> In build_dir/target-mips_34kc_musl-1.1.11/busybox-1.24.1/.config, I see
> 
> CONFIG_UNAME_OSNAME="n"
> 
> Probably relevant, I use CONFIG_BUSYBOX_CUSTOM=y.
> 
> OpenWrt’s busybox/config/coreutils/Config.in needs to mirror Busybox’
> own coreutils/Config.src. Likely, all of OpenWrt’s busybox Config.in
> files need to be updated in this way after a Busybox update.
> 
> Signed-off-by: Mark Mentovai >
> 
> diff --git a/package/utils/busybox/config/coreutils/Config.in
> b/package/utils/busybox/config/coreutils/Config.in
> index f50823f012de..e25da6519f2b 100644
> --- a/package/utils/busybox/config/coreutils/Config.in
> +++ b/package/utils/busybox/config/coreutils/Config.in
> @@ -829,6 +829,14 @@ config BUSYBOX_CONFIG_UNAME
>  help
>   uname is used to print system information.
>  
> +config BUSYBOX_CONFIG_UNAME_OSNAME
> +string "Operating system name"
> +default "GNU/Linux"
> +depends on BUSYBOX_CONFIG_UNAME
> +help
> + Sets the operating system name reported by uname -o.  The
> + default is "GNU/Linux".
> +
>  config BUSYBOX_CONFIG_UNEXPAND
>  bool "unexpand"
>  default BUSYBOX_DEFAULT_UNEXPAND
> 
> 
> ___
> 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] [PATCH] [001/001] TL-WR710N: create image for v2.1

2015-11-21 Thread Norbert Wegener
As git send-email seems to be broken here - permanently "Unable to
initialize SMTP properly" , the patch as attachment.

Norbert

On 21.11.2015 18:38, John Crispin wrote:
> Hi,
>
> the patch is unfortunately line wrapped and whitespace broken. try
> sending the patch using "git send-email"
>
>   John
>
> On 17/11/2015 20:41, Norbert Wegener wrote:
>> This patch just extends target/linux/ar71xx/image/Makefile to build
>> images also for version 2.1 of TL-WR710N
>>
>> diff --git a/target/linux/ar71xx/image/Makefile
>> b/target/linux/ar71xx/image/Makefile
>> index 013a215..da2e7d4 100644
>> --- a/target/linux/ar71xx/image/Makefile
>> +++ b/target/linux/ar71xx/image/Makefile
>> @@ -476,6 +476,15 @@ define Device/tl-wr710n-v2
>>  CONSOLE := ttyATH0,115200
>>  endef
>>  
>> +define Device/tl-wr710n-v2.1
>> +$(Device/tplink-8mlzma)
>> +BOARDNAME := TL-WR710N
>> +DEVICE_PROFILE := TLWR710
>> +TPLINK_HWID := 0x0712
>> +TPLINK_HWREV := 0x0002
>> +CONSOLE := ttyATH0,115200
>> +endef
>> +
>>  define Device/tl-wr720n-v3
>>  $(Device/tplink-4mlzma)
>>  BOARDNAME := TL-WR720N-v3
>> @@ -491,7 +500,7 @@ define Device/tl-wr720n-v4
>>  TPLINK_HWID := 0x07200104
>>  CONSOLE := ttyATH0,115200
>>  endef
>> -TARGET_DEVICES += tl-wr703n-v1 tl-wr710n-v1 tl-wr710n-v2 tl-wr720n-v3
>> tl-wr720n-v4
>> +TARGET_DEVICES += tl-wr703n-v1 tl-wr710n-v1 tl-wr710n-v2 tl-wr710n-v2.1
>> tl-wr720n-v3 tl-wr720n-v4
>>  
>>  define Device/tl-wr74:0n-v4
>>  $(Device/tplink-4mlzma)
>>
>> Signed off by: Norbert Wegener 
>>
>>
>>
>> ___
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>



diff.sig
Description: PGP signature


signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] Fix Busybox “uname -o”

2015-11-21 Thread Mark Mentovai

Since r47288, “uname -o” shows “n”. It used to be “GNU/Linux”.

root at gw1 sh# uname -a
Linux gw1.nyc 4.1.11 #1 Sat Nov 21 12:50:41 EST 2015 mips n
root at gw1 sh# uname -o
n

It looks like a recent change in Busybox uname made “uname -o” 
configurable: 
http://git.busybox.net/busybox/commit?id=64ed5f0d3c5eefbb208d4a334654834c78be2cbd.


In build_dir/target-mips_34kc_musl-1.1.11/busybox-1.24.1/.config, I see

CONFIG_UNAME_OSNAME="n"

Probably relevant, I use CONFIG_BUSYBOX_CUSTOM=y.

OpenWrt’s busybox/config/coreutils/Config.in needs to mirror Busybox’ own 
coreutils/Config.src. Likely, all of OpenWrt’s busybox Config.in files 
need to be updated in this way after a Busybox update.


Signed-off-by: Mark Mentovai 

diff --git a/package/utils/busybox/config/coreutils/Config.in 
b/package/utils/busybox/config/coreutils/Config.in
index f50823f012de..e25da6519f2b 100644
--- a/package/utils/busybox/config/coreutils/Config.in
+++ b/package/utils/busybox/config/coreutils/Config.in
@@ -829,6 +829,14 @@ config BUSYBOX_CONFIG_UNAME
help
  uname is used to print system information.

+config BUSYBOX_CONFIG_UNAME_OSNAME
+   string "Operating system name"
+   default "GNU/Linux"
+   depends on BUSYBOX_CONFIG_UNAME
+   help
+ Sets the operating system name reported by uname -o.  The
+ default is "GNU/Linux".
+
 config BUSYBOX_CONFIG_UNEXPAND
bool "unexpand"
default BUSYBOX_DEFAULT_UNEXPAND___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v3 5/6] brcm2708: add device detection and use it for network, leds and preinit

2015-11-21 Thread Álvaro Fernández Rojas
Signed-off-by: Álvaro Fernández Rojas 
---
v3: use new board detection layer
v2: device tree model needs Rev to avoid detecting a B+ as a B model

 target/linux/brcm2708/base-files.mk|  3 ++
 .../brcm2708/base-files/etc/board.d/02_network | 25 +
 target/linux/brcm2708/base-files/etc/diag.sh   | 12 ++-
 .../base-files/etc/uci-defaults/02_network | 15 
 target/linux/brcm2708/base-files/lib/brcm2708.sh   | 41 ++
 .../lib/preinit/03_preinit_do_brcm2708.sh  | 10 ++
 .../lib/preinit/05_set_preinit_iface_brcm2708  | 18 ++
 target/linux/brcm2708/bcm2708/config-4.1   |  2 +-
 target/linux/brcm2708/bcm2709/config-4.1   |  2 +-
 9 files changed, 110 insertions(+), 18 deletions(-)
 create mode 100644 target/linux/brcm2708/base-files.mk
 create mode 100755 target/linux/brcm2708/base-files/etc/board.d/02_network
 delete mode 100644 target/linux/brcm2708/base-files/etc/uci-defaults/02_network
 create mode 100644 target/linux/brcm2708/base-files/lib/brcm2708.sh
 create mode 100644 
target/linux/brcm2708/base-files/lib/preinit/03_preinit_do_brcm2708.sh
 create mode 100644 
target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708

diff --git a/target/linux/brcm2708/base-files.mk 
b/target/linux/brcm2708/base-files.mk
new file mode 100644
index 000..fdd2c71
--- /dev/null
+++ b/target/linux/brcm2708/base-files.mk
@@ -0,0 +1,3 @@
+define Package/base-files/install-target
+   rm -f $(1)/etc/config/network
+endef
diff --git a/target/linux/brcm2708/base-files/etc/board.d/02_network 
b/target/linux/brcm2708/base-files/etc/board.d/02_network
new file mode 100755
index 000..e85eb11
--- /dev/null
+++ b/target/linux/brcm2708/base-files/etc/board.d/02_network
@@ -0,0 +1,25 @@
+#!/bin/sh
+# Copyright (C) 2014-2015 OpenWrt.org
+
+. /lib/functions/uci-defaults-new.sh
+. /lib/brcm2708.sh
+. /lib/functions.sh
+. /lib/functions/system.sh
+
+board_config_update
+
+ucidef_set_interface_loopback
+
+board=$(brcm2708_board_name)
+
+case "$board" in
+rpi-b |\
+rpi-b-plus |\
+rpi-2-b)
+   ucidef_set_interface_lan "eth0"
+   ;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/brcm2708/base-files/etc/diag.sh 
b/target/linux/brcm2708/base-files/etc/diag.sh
index 55e68b1..3a8dc86 100644
--- a/target/linux/brcm2708/base-files/etc/diag.sh
+++ b/target/linux/brcm2708/base-files/etc/diag.sh
@@ -4,9 +4,19 @@
 #
 
 . /lib/functions/leds.sh
+. /lib/brcm2708.sh
 
 set_state() {
-   status_led="led0"
+   case "$(brcm2708_board_name)" in
+   rpi-b |\
+   rpi-cm)
+   status_led="led0"
+   ;;
+   rpi-b-plus |\
+   rpi-2-b)
+   status_led="led1"
+   ;;
+   esac
 
case "$1" in
preinit)
diff --git a/target/linux/brcm2708/base-files/etc/uci-defaults/02_network 
b/target/linux/brcm2708/base-files/etc/uci-defaults/02_network
deleted file mode 100644
index e7e35c5..000
--- a/target/linux/brcm2708/base-files/etc/uci-defaults/02_network
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2014 OpenWrt.org
-
-[ -e /etc/config/network ] && exit 0
-
-touch /etc/config/network
-
-. /lib/functions/uci-defaults.sh
-
-ucidef_set_interface_loopback
-ucidef_set_interface_lan "eth0"
-
-uci commit network
-
-exit 0
diff --git a/target/linux/brcm2708/base-files/lib/brcm2708.sh 
b/target/linux/brcm2708/base-files/lib/brcm2708.sh
new file mode 100644
index 000..13c1aa9
--- /dev/null
+++ b/target/linux/brcm2708/base-files/lib/brcm2708.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+# Copyright (C) 2015 OpenWrt.org
+
+ifname=""
+
+brcm2708_detect() {
+   local board_name model
+
+   model=$(cat /proc/device-tree/model)
+   case "$model" in
+   "Raspberry Pi Model B Rev"*)
+   board_name="rpi-b"
+   ;;
+   "Raspberry Pi Model B+ Rev"*)
+   board_name="rpi-b-plus"
+   ;;
+   "Raspberry Pi Compute Module Rev"*)
+   board_name="rpi-cm"
+   ;;
+   "Raspberry Pi 2 Model B Rev"*)
+   board_name="rpi-2-b"
+   ;;
+   *)
+   board_name="unknown"
+   ;;
+   esac
+
+   [ -e "/tmp/sysinfo" ] || mkdir -p "/tmp/sysinfo"
+
+   echo "$board_name" > /tmp/sysinfo/board_name
+   echo "$model" > /tmp/sysinfo/model
+}
+
+brcm2708_board_name() {
+   local name
+
+   [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
+   [ -n "$name" ] || name="unknown"
+
+   echo $name
+}
diff --git 
a/target/linux/brcm2708/base-files/lib/preinit/03_preinit_do_brcm2708.sh 
b/target/linux/brcm2708/base-files/lib/preinit/03_preinit_do_brcm2708.sh
new file mode 100644
index 000..2943648
--- /dev/null
+++ b/target/linux/brcm2708/base-files/lib/preinit/03_preinit_do_brcm2708.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+# Copyright (C) 2015 OpenWrt.org
+
+do_brcm2708() 

Re: [OpenWrt-Devel] [PATCH] lantiq: spi-max-frequency

2015-11-21 Thread John Crispin


On 21/11/2015 20:17, Daniel Gimpelevich wrote:
> On Sat, 2015-11-21 at 20:15 +0100, John Crispin wrote:
>> On 21/11/2015 20:05, Daniel Gimpelevich wrote:
>>> On Sat, 2015-11-21 at 10:27 -0800, Daniel Gimpelevich wrote:
 On Sat, 2015-11-21 at 19:15 +0100, John Crispin wrote:
> Hi,
>
> common, you know how to send a patch and put a SoB under it. i've seen
> you do it lots of times ;)
>
> John

 Yes, but it just doesn't feel right for me to do when the patch is
 essentially from Joerg and not from me.

>>>
>>> Are there any other DTS files to which this would apply?
>>>
>>
>> grep for spi-gpio in the dts folder
> 
> Do all three of those use the same chip?

probably not


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


Re: [OpenWrt-Devel] [PATCH] ramips:Allow funcs in multiple groups in pinctrl-rt2880.c for UARTF pin sharing

2015-11-21 Thread John Crispin
Hi,

i had a closer look at the code. what you want to do instead of adding 2
dummy muxes is to modify

static int rt2880_pmx_group_enable(struct pinctrl_dev *pctrldev,

and change this part

/* mark the pins as gpio */
for (i = 0; i < p->groups[group].func[0].pin_count; i++)
p->gpio[p->groups[group].func[0].pins[i]] = 1;

to not use [0] but the real mux which will enable the upper 4 gpio for
gpio usage.

John

On 03/11/2015 13:26, Noble Pepper wrote:
> 
> Signed-off-by: Noble Pepper 
> ---
> Existing pinctrl-rt2880.c code only kept track of one pin group that
> functions other than gpio may use. Functions in rt305x.c had differing
> numbers of pins which caused rt2880_get_group_pins() to sometimes return
> incorrect pins. Example: when trying to use "gpio uartf" function pins
> 7-14 instead of 7-10 may be claimed for uartf preventing using gpio on
> pins 11-14. Usage of groups and functions added to rt305x.c is shown in
> VOCORE.dtsi. 
> 
> 
>>  target/linux/ramips/dts/VOCORE.dtsi| 40 -
>>  ...ralink-allow-functions-on-multiple-groups.patch | 98 
>> ++
>>  2 files changed, 119 insertions(+), 19 deletions(-)
>>  create mode 100644 
>> target/linux/ramips/patches-3.18/0031-pinctrl-ralink-allow-functions-on-multiple-groups.patch
>>
>> diff --git a/target/linux/ramips/dts/VOCORE.dtsi 
>> b/target/linux/ramips/dts/VOCORE.dtsi
>> index ff031fa..a5a213f 100644
>> --- a/target/linux/ramips/dts/VOCORE.dtsi
>> +++ b/target/linux/ramips/dts/VOCORE.dtsi
>> @@ -1,3 +1,10 @@
>> +/ {
>> +palmbus@1000 {
>> +uartlite@c00 {
>> +status = "okay";
>> +};
>> +};
>> +};
>>  /include/ "rt5350.dtsi"
>>  
>>  / {
>> @@ -5,6 +12,9 @@
>>  model = "VoCore";
>>  
>>  palmbus@1000 {
>> +uart@500 {
>> +status = "okay";
>> +};
>>  gpio1: gpio@660 {
>>  status = "okay";
>>  };
>> @@ -25,9 +35,15 @@
>>  };
>>  
>>  pinctrl {
>> +uartf_pins: uartf {
>> +uartf {
>> +ralink,group = "uartf_low";
>> +ralink,function = "gpio uartf";
>> +};
>> +};
>>  state_default: pinctrl0 {
>>  gpio {
>> -ralink,group = "jtag", "uartf", "led";
>> +ralink,group = "jtag", "led", "uartf_high";
>>  ralink,function = "gpio";
>>  };
>>  };
>> @@ -64,25 +80,11 @@
>>  };
>>  
>>  /* UARTF */
>> -gpio7 {
>> -/* UARTF_RTS_N */
>> -gpio-export,name = "gpio7";
>> +gpio11 {
>> +/* uartf_dtr_n */
>> +gpio-export,name = "gpio11";
>>  gpio-export,direction_may_change = <1>;
>> -gpios = < 7 0>;
>> -};
>> -
>> -gpio8 {
>> -/* UARTF_TXD */
>> -gpio-export,name = "gpio8";
>> -gpio-export,direction_may_change = <1>;
>> -gpios = < 8 0>;
>> -};
>> -
>> -gpio9 {
>> -/* UARTF_CTS_N */
>> -gpio-export,name = "gpio9";
>> -gpio-export,direction_may_change = <1>;
>> -gpios = < 9 0>;
>> +gpios = < 11 0>;
>>  };
>>  
>>  gpio12 {
>> diff --git 
>> a/target/linux/ramips/patches-3.18/0031-pinctrl-ralink-allow-functions-on-multiple-groups.patch
>>  
>> b/target/linux/ramips/patches-3.18/0031-pinctrl-ralink-allow-functions-on-multiple-groups.patch
>> new file mode 100644
>> index 000..1eab406
>> --- /dev/null
>> +++ 
>> b/target/linux/ramips/patches-3.18/0031-pinctrl-ralink-allow-functions-on-multiple-groups.patch
>> @@ -0,0 +1,98 @@
>> +diff -Naur a/arch/mips/include/asm/mach-ralink/pinmux.h 
>> b/arch/mips/include/asm/mach-ralink/pinmux.h
>> +--- a/arch/mips/include/asm/mach-ralink/pinmux.h2015-11-02 
>> 05:32:57.227437903 -0600
>>  b/arch/mips/include/asm/mach-ralink/pinmux.h2015-11-03 
>> 02:50:33.128049900 -0600
>> +@@ -31,6 +31,7 @@
>> +int *pins;
>> + 
>> +int *groups;
>> ++   int **group_names;
>> +int group_count;
>> + 
>> +int enabled;
>> +diff -Naur a/arch/mips/ralink/rt305x.c b/arch/mips/ralink/rt305x.c
>> +--- a/arch/mips/ralink/rt305x.c 2015-11-02 05:33:44.932237317 -0600
>>  b/arch/mips/ralink/rt305x.c 2015-11-03 02:49:49.255271419 -0600
>> +@@ -23,6 +23,22 @@
>> + 
>> + static struct rt2880_pmx_func i2c_func[] =  { FUNC("i2c", 0, 1, 2) };
>> + static struct rt2880_pmx_func spi_func[] = { FUNC("spi", 0, 3, 4) };
>> ++static struct rt2880_pmx_func uartf_low_func[] = {
>> ++  

Re: [OpenWrt-Devel] [PATCH v5 1/5] ar71xx: add eth rx delay for qca955x platforms

2015-11-21 Thread John Crispin
Hi,

sorry to jump in this late at a V5 but i have a few concerns. see inline

On 22/09/2015 18:49, Chris R Blake wrote:
> From: Chris R Blake 
> 
> This patch is to add support for qca955x_eth_rx_delay
> to work with the qca955x SoC.
> 
> Signed-off-by: Chris R Blake 
> ---
>  ...42-MIPS-ath79-add-qca955x-mac-tx-rx-delay.patch | 58 
> ++
>  1 file changed, 58 insertions(+)
>  create mode 100644 
> target/linux/ar71xx/patches-4.1/742-MIPS-ath79-add-qca955x-mac-tx-rx-delay.patch
> 
> diff --git 
> a/target/linux/ar71xx/patches-4.1/742-MIPS-ath79-add-qca955x-mac-tx-rx-delay.patch
>  
> b/target/linux/ar71xx/patches-4.1/742-MIPS-ath79-add-qca955x-mac-tx-rx-delay.patch
> new file mode 100644
> index 000..75e216e
> --- /dev/null
> +++ 
> b/target/linux/ar71xx/patches-4.1/742-MIPS-ath79-add-qca955x-mac-tx-rx-delay.patch
> @@ -0,0 +1,58 @@
> +--- a/arch/mips/ath79/dev-eth.c
>  b/arch/mips/ath79/dev-eth.c
> +@@ -823,6 +825,32 @@
> + iounmap(base);
> + }
> +
> ++void __init ath79_setup_qca955x_eth_rx_delay(unsigned int rxd,
> ++  unsigned int rxdv)
> ++{
> ++void __iomem *base;
> ++u32 t;
> ++
> ++rxd &= QCA955X_ETH_CFG_RXD_DELAY_MASK;
> ++rxdv &= QCA955X_ETH_CFG_RDV_DELAY_MASK;
> ++
> ++base = ioremap(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE);
> ++
> ++t = __raw_readl(base + QCA955X_GMAC_REG_ETH_CFG);
> ++
> ++t &= ~(QCA955X_ETH_CFG_RXD_DELAY_MASK << 
> QCA955X_ETH_CFG_RXD_DELAY_SHIFT |
> ++   QCA955X_ETH_CFG_RDV_DELAY_MASK << 
> QCA955X_ETH_CFG_RDV_DELAY_SHIFT);
> ++
> ++t |= (rxd << QCA955X_ETH_CFG_RXD_DELAY_SHIFT |
> ++  rxdv << QCA955X_ETH_CFG_RDV_DELAY_SHIFT);
> ++
> ++__raw_writel(t, base + QCA955X_GMAC_REG_ETH_CFG);
> ++/* flush write */
> ++__raw_readl(base + QCA955X_GMAC_REG_ETH_CFG);
> ++
> ++iounmap(base);

this is a pretty ugly way of doing it. the register is also modified at
a different place which is also not optimal. the register is part of the
ethernet macs io range so this magic setting should be applied inside
the the actual driver. could you make such a change ?

John

> ++}
> ++
> + static int ath79_eth_instance __initdata;
> + void __init ath79_register_eth(unsigned int id)
> + {
> +--- a/arch/mips/ath79/dev-eth.h
>  b/arch/mips/ath79/dev-eth.h
> +@@ -49,5 +49,6 @@
> + void ath79_setup_ar934x_eth_cfg(u32 mask);
> + void ath79_setup_ar934x_eth_rx_delay(unsigned int rxd, unsigned int rxdv);
> + void ath79_setup_qca955x_eth_cfg(u32 mask);
> ++void ath79_setup_qca955x_eth_rx_delay(unsigned int rxd, unsigned int rxdv);
> +
> + #endif /* _ATH79_DEV_ETH_H */
> +--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
>  b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
> +@@ -1098,5 +1098,11 @@
> +
> + #define QCA955X_ETH_CFG_RGMII_ENBIT(0)
> + #define QCA955X_ETH_CFG_GE0_SGMII   BIT(6)
> ++#define QCA955X_ETH_CFG_RXD_DELAY   BIT(14)
> ++#define QCA955X_ETH_CFG_RXD_DELAY_MASK  0x3
> ++#define QCA955X_ETH_CFG_RXD_DELAY_SHIFT 14
> ++#define QCA955X_ETH_CFG_RDV_DELAY   BIT(16)
> ++#define QCA955X_ETH_CFG_RDV_DELAY_MASK  0x3
> ++#define QCA955X_ETH_CFG_RDV_DELAY_SHIFT 16
> +
> + #endif /* __ASM_MACH_AR71XX_REGS_H */
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] 回复:[PATCH] ramips: reset m25p80 when shutdown

2015-11-21 Thread John Crispin
Hi,

one more request

On 16/11/2015 18:03, 未命名 wrote:
> Instead of use the set_4byte function in spi-nor.c, I use this patch
> for simplest modification. In fact, set_4byte also send 0xe9 command to
> the spi flash.
> 
> Signed-off-by: Shonn Lu 
> ---
>  .../0064-reset-m25p80-when-shutdown.patch  | 27
> ++
>  1 file changed, 27 insertions(+)
>  create mode 100644
> target/linux/ramips/patches-3.18/0064-reset-m25p80-when-shutdown.patch
> 
> diff --git
> a/target/linux/ramips/patches-3.18/0064-reset-m25p80-when-shutdown.patch
> b/target/linux/ramips/patches-3.18/0064-reset-m25p80-when-shutdown.patch
> new file mode 100644
> index 000..aca758d
> --- /dev/null
> +++ b/target/linux/ramips/patches-3.18/0064-reset-m25p80-when-shutdown.patch
> @@ -0,0 +1,27 @@
> +--- a/drivers/mtd/devices/m25p80.c
>  b/drivers/mtd/devices/m25p80.c
> +@@ -322,6 +322,16 @@
> + {
> + struct m25p *flash = spi_get_drvdata(spi);
> +
> ++ if ((>spi_nor)->addr_width > 3) {
> ++ printk(KERN_INFO "m25p80: exit 4-byte address mode\n");
> ++ flash->command[0] = SPINOR_OP_EX4B;  // exit 4-byte address mode: 0xe9
> ++ spi_write(flash->spi, flash->command, 1);
> ++ flash->command[0] = 0x66;  // enable reset
> ++ spi_write(flash->spi, flash->command, 1); 
> ++ flash->command[0] = 0x99;  // reset
> ++ spi_write(flash->spi, flash->command, 1);

this needs to be indented with tabs

John

> ++ }
> ++
> + /* Clean up MTD stuff. */
> + return mtd_device_unregister(>mtd);
> + }
> +@@ -385,6 +395,7 @@
> + .id_table = m25p_ids,
> + .probe = m25p_probe,
> + .remove = m25p_remove,
> ++ .shutdown = m25p_remove, // add shutdown method to reset spi flash
> +
> + /* REVISIT: many of these chips have deep power-down modes, which
> + * should clearly be entered on suspend() to minimize power use.
> -- 
> 1.9.1
> 
> 
> ___
> 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] [PATCH v2] Fix Busybox “uname -o”

2015-11-21 Thread Mark Mentovai

I wrote:
OpenWrt’s busybox/config/coreutils/Config.in needs to mirror Busybox’ own 
coreutils/Config.src. Likely, all of OpenWrt’s busybox Config.in files need 
to be updated in this way after a Busybox update.


I posted this as an alternative, more complete patch, under the title 
[PATCH] busybox: Update config for 1.24.1.___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH v2 5/6] brcm2708: add device detection and use it for network, leds and preinit

2015-11-21 Thread John Crispin
Hi,

do you have time to rework this code to make use of the new board
detection layer ? i am currently starting to convert all targets to it.
would be a shame if we add this ode just to replace it again in a few weeks.

John

On 19/11/2015 19:18, Álvaro Fernández Rojas wrote:
> Signed-off-by: Álvaro Fernández Rojas 
> ---
> v2: device tree model needs Rev to avoid detecting a B+ as a B model
> 
>  target/linux/brcm2708/base-files.mk|  3 ++
>  target/linux/brcm2708/base-files/etc/diag.sh   | 12 ++-
>  .../base-files/etc/uci-defaults/02_network | 12 +--
>  target/linux/brcm2708/base-files/lib/brcm2708.sh   | 41 
> ++
>  .../lib/preinit/03_preinit_do_brcm2708.sh  | 10 ++
>  .../lib/preinit/05_set_preinit_iface_brcm2708  | 18 ++
>  target/linux/brcm2708/bcm2708/config-4.1   |  2 +-
>  target/linux/brcm2708/bcm2709/config-4.1   |  2 +-
>  8 files changed, 95 insertions(+), 5 deletions(-)
>  create mode 100644 target/linux/brcm2708/base-files.mk
>  create mode 100644 target/linux/brcm2708/base-files/lib/brcm2708.sh
>  create mode 100644 
> target/linux/brcm2708/base-files/lib/preinit/03_preinit_do_brcm2708.sh
>  create mode 100644 
> target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708
> 
> diff --git a/target/linux/brcm2708/base-files.mk 
> b/target/linux/brcm2708/base-files.mk
> new file mode 100644
> index 000..fdd2c71
> --- /dev/null
> +++ b/target/linux/brcm2708/base-files.mk
> @@ -0,0 +1,3 @@
> +define Package/base-files/install-target
> + rm -f $(1)/etc/config/network
> +endef
> diff --git a/target/linux/brcm2708/base-files/etc/diag.sh 
> b/target/linux/brcm2708/base-files/etc/diag.sh
> index 55e68b1..3a8dc86 100644
> --- a/target/linux/brcm2708/base-files/etc/diag.sh
> +++ b/target/linux/brcm2708/base-files/etc/diag.sh
> @@ -4,9 +4,19 @@
>  #
>  
>  . /lib/functions/leds.sh
> +. /lib/brcm2708.sh
>  
>  set_state() {
> - status_led="led0"
> + case "$(brcm2708_board_name)" in
> + rpi-b |\
> + rpi-cm)
> + status_led="led0"
> + ;;
> + rpi-b-plus |\
> + rpi-2-b)
> + status_led="led1"
> + ;;
> + esac
>  
>   case "$1" in
>   preinit)
> diff --git a/target/linux/brcm2708/base-files/etc/uci-defaults/02_network 
> b/target/linux/brcm2708/base-files/etc/uci-defaults/02_network
> index e7e35c5..1bb05b6 100644
> --- a/target/linux/brcm2708/base-files/etc/uci-defaults/02_network
> +++ b/target/linux/brcm2708/base-files/etc/uci-defaults/02_network
> @@ -1,14 +1,22 @@
>  #!/bin/sh
> -# Copyright (C) 2014 OpenWrt.org
> +# Copyright (C) 2014-2015 OpenWrt.org
>  
>  [ -e /etc/config/network ] && exit 0
>  
>  touch /etc/config/network
>  
>  . /lib/functions/uci-defaults.sh
> +. /lib/brcm2708.sh
>  
>  ucidef_set_interface_loopback
> -ucidef_set_interface_lan "eth0"
> +
> +case "$(brcm2708_board_name)" in
> +rpi-b |\
> +rpi-b-plus |\
> +rpi-2-b)
> + ucidef_set_interface_lan "eth0"
> + ;;
> +esac
>  
>  uci commit network
>  
> diff --git a/target/linux/brcm2708/base-files/lib/brcm2708.sh 
> b/target/linux/brcm2708/base-files/lib/brcm2708.sh
> new file mode 100644
> index 000..7d6e458
> --- /dev/null
> +++ b/target/linux/brcm2708/base-files/lib/brcm2708.sh
> @@ -0,0 +1,41 @@
> +#!/bin/sh
> +# Copyright (C) 2015 OpenWrt.org
> +
> +ifname=""
> +
> +brcm2708_detect() {
> + local board_name model
> +
> + model=$(cat /proc/device-tree/model)
> + case "$model" in
> + "Raspberry Pi Model B Rev"*)
> + board_name="rpi-b"
> + ;;
> + "Raspberry Pi Model B+ Rev"*)
> + board_name="rpi-b-plus"
> + ;;
> + "Raspberry Pi Compute Module Rev"*)
> + board_name="rpi-cm"
> + ;;
> + "Raspberry Pi 2 Model B Rev"*)
> + board_name="rpi-2-b"
> + ;;
> + *)
> + board_name="unknown"
> + ;;
> + esac
> +
> + [ -e "/tmp/sysinfo" ] || mkdir -p "/tmp/sysinfo"
> +
> + echo "$board_name" > /tmp/sysinfo/board_name
> + echo "$model" > /tmp/sysinfo/model
> +}
> +
> +brcm2708_board_name() {
> + local name
> +
> + [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
> + [ -n "$name" ] || name="unknown"
> +
> + echo $name
> +}
> diff --git 
> a/target/linux/brcm2708/base-files/lib/preinit/03_preinit_do_brcm2708.sh 
> b/target/linux/brcm2708/base-files/lib/preinit/03_preinit_do_brcm2708.sh
> new file mode 100644
> index 000..2943648
> --- /dev/null
> +++ b/target/linux/brcm2708/base-files/lib/preinit/03_preinit_do_brcm2708.sh
> @@ -0,0 +1,10 @@
> +#!/bin/sh
> +# Copyright (C) 2015 OpenWrt.org
> +
> +do_brcm2708() {
> + . /lib/brcm2708.sh
> +
> + brcm2708_detect
> +}
> +
> +boot_hook_add preinit_main do_brcm2708
> diff --git 
> a/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708 
> 

Re: [OpenWrt-Devel] API documentation of ubus

2015-11-21 Thread Pratik Prajapati
Gentle Reminder

On Fri, Nov 20, 2015 at 6:29 PM, Pratik Prajapati <
pratik.prajapat...@gmail.com> wrote:

> Hi,
>
> Is there any API documentation of ubus available?
>
> If yes, where can i found those?
>
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Add support for Huawei WS880

2015-11-21 Thread John Crispin
Hi,

can you please resend the patch with a proper prefix. in this case
"bcm53xx:"

John


On 20/11/2015 14:06, Prototik wrote:
> ---
>  target/linux/bcm53xx/image/Makefile|  14 +++
>  .../910-ARM-BCM5301X-Add-DT-for-Huawei-WS880.patch | 115 
> +
>  .../910-ARM-BCM5301X-Add-DT-for-Huawei-WS880.patch | 115 
> +
>  3 files changed, 244 insertions(+)
>  create mode 100644 
> target/linux/bcm53xx/patches-4.1/910-ARM-BCM5301X-Add-DT-for-Huawei-WS880.patch
>  create mode 100644 
> target/linux/bcm53xx/patches-4.3/910-ARM-BCM5301X-Add-DT-for-Huawei-WS880.patch
> 
> diff --git a/target/linux/bcm53xx/image/Makefile 
> b/target/linux/bcm53xx/image/Makefile
> index c9987dd..2b46988 100644
> --- a/target/linux/bcm53xx/image/Makefile
> +++ b/target/linux/bcm53xx/image/Makefile
> @@ -133,6 +133,19 @@ define Device/smartrg-sr400ac
>IMAGE/trx := trx-serial
>  endef
>  
> +define Device/huawei
> +  IMAGES := trx
> +  IMAGE/trx := trx-nand | asus-trx
> +endef
> +
> +define HuaweiDevice
> +  define Device/huawei-$(1)
> + $$(Device/huawei)
> + PRODUCTID := $(2)
> +  endef
> +  TARGET_DEVICES += huawei-$(1)
> +endef
> +
>  TARGET_DEVICES += \
>   buffalo-wzr-1750dhp buffalo-wzr-600dhp2 buffalo-wzr-900dhp \
>   buffalo-wxr-1900dhp \
> @@ -145,5 +158,6 @@ $(eval $(call AsusDevice,rt-ac87u,RT-AC87U))
>  $(eval $(call AsusDevice,rt-n18u,RT-N18U))
>  $(eval $(call LinksysDevice,ea6300-v1))
>  $(eval $(call NetgearDevice,r7000,U12H270T00_NETGEAR))
> +$(eval $(call HuaweiDevice,ws880,WS880))
>  
>  $(eval $(call BuildImage))
> diff --git 
> a/target/linux/bcm53xx/patches-4.1/910-ARM-BCM5301X-Add-DT-for-Huawei-WS880.patch
>  
> b/target/linux/bcm53xx/patches-4.1/910-ARM-BCM5301X-Add-DT-for-Huawei-WS880.patch
> new file mode 100644
> index 000..1a73e64
> --- /dev/null
> +++ 
> b/target/linux/bcm53xx/patches-4.1/910-ARM-BCM5301X-Add-DT-for-Huawei-WS880.patch
> @@ -0,0 +1,115 @@
> +From: Sergey Shatunov 
> +Subject: [PATCH] ARM: BCM5301X: Add DT for Huawei WS880
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +Signed-off-by: Sergey Shatunov 
> +---
> +--- a/arch/arm/boot/dts/Makefile
>  b/arch/arm/boot/dts/Makefile
> +@@ -59,6 +59,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
> + bcm4708-asus-rt-ac56u.dtb \
> + bcm4708-asus-rt-ac68u.dtb \
> + bcm4708-buffalo-wzr-1750dhp.dtb \
> ++bcm4708-huawei-ws880.dtb \
> + bcm4708-linksys-ea6300-v1.dtb \
> + bcm4708-luxul-xwc-1000.dtb \
> + bcm4708-netgear-r6250.dtb \
> +--- /dev/null
>  b/arch/arm/boot/dts/bcm4708-huawei-ws880.dts
> +@@ -0,0 +1,94 @@
> ++/*
> ++ * Broadcom BCM470X / BCM5301X ARM platform code.
> ++ * DTS for Huawei WS880
> ++ *
> ++ * Copyright (C) 2015 Sergey Shatunov 
> ++ *
> ++ * Licensed under the GNU/GPL. See COPYING for details.
> ++ */
> ++
> ++/dts-v1/;
> ++
> ++#include "bcm4708.dtsi"
> ++#include "bcm5301x-nand-cs0-bch8.dtsi"
> ++
> ++/ {
> ++compatible = "huawei,ws880", "brcm,bcm4708";
> ++model = "Huawei WS880 (BCM4708)";
> ++
> ++chosen {
> ++bootargs = "console=ttyS0,115200";
> ++};
> ++
> ++memory {
> ++reg = <0x 0x0800>;
> ++};
> ++
> ++leds {
> ++compatible = "gpio-leds";
> ++
> ++wlan {
> ++label = "bcm53xx:white:wlan";
> ++gpios = < 0 GPIO_ACTIVE_LOW>;
> ++linux,default-trigger = "default-on";
> ++};
> ++
> ++lan {
> ++label = "bcm53xx:white:lan";
> ++gpios = < 1 GPIO_ACTIVE_LOW>;
> ++linux,default-trigger = "default-on";
> ++};
> ++
> ++wps {
> ++label = "bcm53xx:white:wps";
> ++gpios = < 6 GPIO_ACTIVE_LOW>;
> ++linux,default-trigger = "default-on";
> ++};
> ++
> ++internet {
> ++label = "bcm53xx:white:internet";
> ++gpios = < 12 GPIO_ACTIVE_HIGH>;
> ++linux,default-trigger = "default-on";
> ++};
> ++
> ++usb {
> ++label = "bcm53xx:white:usb";
> ++gpios = < 14 GPIO_ACTIVE_LOW>;
> ++linux,default-trigger = "default-on";
> ++};
> ++};
> ++
> ++gpio-keys {
> ++compatible = "gpio-keys";
> ++#address-cells = <1>;
> ++#size-cells = <0>;
> ++
> ++restart {
> ++label = "Reset";
> ++linux,code = ;
> ++gpios = < 2 GPIO_ACTIVE_LOW>;
> ++};
> ++
> ++wps {
> ++label = "WPS";
> ++linux,code = ;
> ++gpios = < 3 GPIO_ACTIVE_LOW>;
> ++};
> ++
> ++power {
> ++  

Re: [OpenWrt-Devel] API documentation of ubus

2015-11-21 Thread Javier Domingo Cansino
The only documentation you have from ubus is
https://wiki.openwrt.org/doc/techref/ubus

Apart from that, you can read procd, rpcd, uhttpd, netifd and ubus itself
to see how to use it. I had plans on further documenting it but still
didn't have time. You are welcome to further document it.

On Sat, Nov 21, 2015 at 11:53 AM Pratik Prajapati <
pratik.prajapat...@gmail.com> wrote:

> Gentle Reminder
>
> On Fri, Nov 20, 2015 at 6:29 PM, Pratik Prajapati <
> pratik.prajapat...@gmail.com> wrote:
>
>> Hi,
>>
>> Is there any API documentation of ubus available?
>>
>> If yes, where can i found those?
>>
>>
> ___
> 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] [PATCH procd 2/2] ujail: rework file dependencies detection (use ldd)

2015-11-21 Thread Etienne Champetier
Hi,

first sorry, i've forgot to add the ticket reference
https://dev.openwrt.org/ticket/20785

also full disclore, I'm only writing C for OpenWrt
so is there a compilation flag to disable C++,
or can you be more specific on what C++ ism i'm using ?

2015-11-21 9:08 GMT+01:00 John Crispin :

>
>
> On 21/11/2015 00:05, Etienne CHAMPETIER wrote:
> > Using ldd (via popen()) is a hack, but it's simpler (and working)
>
> indeed
>
> > we have 3 libc and many archs, too many ways to resolve .so
> where does it break ?
>
>
> > Current code:
> > -do not parse the intepreter (PT_INTERP) part of the elf
> why should it ?
>


here is the output of "objdump -x -s" on /bin/cat (subtarget x86_64 / DD)

> Dynamic Section:
>   NEEDED   libgcc_s.so.1
>   NEEDED   libc.so
> Contents of section .interp:
>  /lib/ld-musl-x86_64.so.1
>
> and the output of ldd /bin/cat

> root@OpenWrt:/# ldd /bin/cat
> /lib/ld-musl-x86_64.so.1 (0x7fbe78583000)
> libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x7fbe78371000)
> libc.so => /lib/ld-musl-x86_64.so.1 (0x7fbe78583000)
>

if you run "ujail -d1 -p -- /bin/cat /proc/self/mounts"
the execve() call fail with "ENOENT (No such file or directory)"

now if you add "/lib/ld-musl-x86_64.so.1" to the jail (-r), and you remove
symlink
from /lib64 to /lib, it works

the good question is why does it fails with musl/DD and work with uclibc/CC
and glibc?


> > -do not get the library path priority right (/lib64 is before /lib,
> > musl take the libs in /lib even on 64bits images)
>
> libc dependent and not procd depended
>

ujail has to resolve the same libs as the libc does,
so it depends on the libc, but it's still a ujail problem
that was my main motivation to use ldd


> > -do not handle RPATH
> >
> > This patch:
> > -use ldd to detect ELF dependencies
> > -add support for shell script
>
> elaborate that please
>

if the file start with #!, add the exec and it dependencies to the jail


>
>
> > uClibc ldd doesn't work with shared lib, thus this patch break
> > seccomp with uClibc
>
> so after you patch we can never again update procd in CC ?
>

yes

i will try to improve the current elf parsing code,
but i'm afraid that it will break depending on the arch and ...


>
> John
>
> >
> > Signed-off-by: Etienne CHAMPETIER 
> > ---
> >  CMakeLists.txt |   2 +-
> >  jail/deps.c| 198 
> >  jail/deps.h|  23 
> >  jail/elf.c | 355
> -
> >  jail/elf.h |  38 --
> >  jail/jail.c| 138 +++---
> >  jail/jail.h|  18 +++
> >  7 files changed, 284 insertions(+), 488 deletions(-)
> >  create mode 100644 jail/deps.c
> >  create mode 100644 jail/deps.h
> >  delete mode 100644 jail/elf.c
> >  delete mode 100644 jail/elf.h
> >  create mode 100644 jail/jail.h
> >
> > diff --git a/CMakeLists.txt b/CMakeLists.txt
> > index d749c25..8e3f7ea 100644
> > --- a/CMakeLists.txt
> > +++ b/CMakeLists.txt
> > @@ -87,7 +87,7 @@ ADD_DEPENDENCIES(preload-seccomp syscall-names-h)
> >  endif()
> >
> >  IF(JAIL_SUPPORT)
> > -ADD_EXECUTABLE(ujail jail/jail.c jail/elf.c jail/capabilities.c)
> > +ADD_EXECUTABLE(ujail jail/jail.c jail/deps.c jail/capabilities.c)
> >  TARGET_LINK_LIBRARIES(ujail ubox blobmsg_json)
> >  INSTALL(TARGETS ujail
> >   RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
> > diff --git a/jail/deps.c b/jail/deps.c
> > new file mode 100644
> > index 000..0141cef
> > --- /dev/null
> > +++ b/jail/deps.c
> > @@ -0,0 +1,198 @@
> > +/*
> > + * Copyright (C) 2015 John Crispin 
> > + * Copyright (C) 2015 Etienne Champetier 
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU Lesser General Public License version
> 2.1
> > + * as published by the Free Software Foundation
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + */
> > +
> > +#define _GNU_SOURCE
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#include 
> > +#include 
> > +
> > +#include "deps.h"
> > +#include "log.h"
> > +#include "jail.h"
> > +
> > +struct mount {
> > +struct avl_node avl;
> > +const char *path;
> > +int readonly;
> > +int error;
> > +};
> > +
> > +struct avl_tree mounts;
> > +
> > +static int add_mount(const char *path, int readonly, int error)
> > +{
> > + if (avl_find(, path))
> > + return 1;
> > +
> > + struct mount *m;
> > + m = calloc(1, sizeof(struct mount));
> > + 

Re: [OpenWrt-Devel] [PATCH procd 2/2] ujail: rework file dependencies detection (use ldd)

2015-11-21 Thread John Crispin


On 21/11/2015 12:06, Etienne Champetier wrote:
> Hi,
> 
> first sorry, i've forgot to add the ticket reference
> https://dev.openwrt.org/ticket/20785
> 
> also full disclore, I'm only writing C for OpenWrt
> so is there a compilation flag to disable C++,
> or can you be more specific on what C++ ism i'm using ?

// is c++

/* this is the c version */

void foo() should be replaced with static void foo(void)

i am a bit suprised that procd compiled without warning for you. i'll
verify the compiler flags later today

John

> 
> 2015-11-21 9:08 GMT+01:00 John Crispin  >:
> 
> 
> 
> On 21/11/2015 00:05, Etienne CHAMPETIER wrote:
> > Using ldd (via popen()) is a hack, but it's simpler (and working)
> 
> indeed
> 
> > we have 3 libc and many archs, too many ways to resolve .so
> where does it break ?
> 
> 
> > Current code:
> > -do not parse the intepreter (PT_INTERP) part of the elf
> why should it ?
> 
> 
> 
> here is the output of "objdump -x -s" on /bin/cat (subtarget x86_64 / DD)
> 
> Dynamic Section:
>   NEEDED   libgcc_s.so.1
>   NEEDED   libc.so
> Contents of section .interp:
>  /lib/ld-musl-x86_64.so.1
> 
> and the output of ldd /bin/cat
> 
> root@OpenWrt:/# ldd /bin/cat
> /lib/ld-musl-x86_64.so.1 (0x7fbe78583000)
> libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x7fbe78371000)
> libc.so => /lib/ld-musl-x86_64.so.1 (0x7fbe78583000)
> 
> 
> if you run "ujail -d1 -p -- /bin/cat /proc/self/mounts"
> the execve() call fail with "ENOENT (No such file or directory)"
> 
> now if you add "/lib/ld-musl-x86_64.so.1" to the jail (-r), and you
> remove symlink
> from /lib64 to /lib, it works
> 
> the good question is why does it fails with musl/DD and work with
> uclibc/CC and glibc?
> 
> 
> > -do not get the library path priority right (/lib64 is before /lib,
> > musl take the libs in /lib even on 64bits images)
> 
> libc dependent and not procd depended
> 
> 
> ujail has to resolve the same libs as the libc does,
> so it depends on the libc, but it's still a ujail problem
> that was my main motivation to use ldd
> 
> 
> > -do not handle RPATH
> >
> > This patch:
> > -use ldd to detect ELF dependencies
> > -add support for shell script
> 
> elaborate that please
> 
> 
> if the file start with #!, add the exec and it dependencies to the jail
>  
> 
> 
> 
> > uClibc ldd doesn't work with shared lib, thus this patch break
> > seccomp with uClibc
> 
> so after you patch we can never again update procd in CC ?
> 
> 
> yes
> 
> i will try to improve the current elf parsing code,
> but i'm afraid that it will break depending on the arch and ...
>  
> 
> 
> John
> 
> >
> > Signed-off-by: Etienne CHAMPETIER  >
> > ---
> >  CMakeLists.txt |   2 +-
> >  jail/deps.c| 198 
> >  jail/deps.h|  23 
> >  jail/elf.c | 355
> -
> >  jail/elf.h |  38 --
> >  jail/jail.c| 138 +++---
> >  jail/jail.h|  18 +++
> >  7 files changed, 284 insertions(+), 488 deletions(-)
> >  create mode 100644 jail/deps.c
> >  create mode 100644 jail/deps.h
> >  delete mode 100644 jail/elf.c
> >  delete mode 100644 jail/elf.h
> >  create mode 100644 jail/jail.h
> >
> > diff --git a/CMakeLists.txt b/CMakeLists.txt
> > index d749c25..8e3f7ea 100644
> > --- a/CMakeLists.txt
> > +++ b/CMakeLists.txt
> > @@ -87,7 +87,7 @@ ADD_DEPENDENCIES(preload-seccomp syscall-names-h)
> >  endif()
> >
> >  IF(JAIL_SUPPORT)
> > -ADD_EXECUTABLE(ujail jail/jail.c jail/elf.c jail/capabilities.c)
> > +ADD_EXECUTABLE(ujail jail/jail.c jail/deps.c jail/capabilities.c)
> >  TARGET_LINK_LIBRARIES(ujail ubox blobmsg_json)
> >  INSTALL(TARGETS ujail
> >   RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
> > diff --git a/jail/deps.c b/jail/deps.c
> > new file mode 100644
> > index 000..0141cef
> > --- /dev/null
> > +++ b/jail/deps.c
> > @@ -0,0 +1,198 @@
> > +/*
> > + * Copyright (C) 2015 John Crispin  >
> > + * Copyright (C) 2015 Etienne Champetier
> >
> > + *
> > + * This program is free software; you can redistribute it and/or
> modify
> > + * it under the terms of the GNU Lesser General Public License
> version 2.1
> > + * as published by the Free Software Foundation
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR 

Re: [OpenWrt-Devel] [PATCH procd 2/2] ujail: rework file dependencies detection (use ldd)

2015-11-21 Thread John Crispin
Hi,

can you please convert this to c code ? we dont like c++ patterns

John

On 21/11/2015 00:05, Etienne CHAMPETIER wrote:
> Using ldd (via popen()) is a hack, but it's simpler (and working)
> we have 3 libc and many archs, too many ways to resolve .so
> 
> Current code:
> -do not parse the intepreter (PT_INTERP) part of the elf
> -do not get the library path priority right (/lib64 is before /lib,
> musl take the libs in /lib even on 64bits images)
> -do not handle RPATH
> 
> This patch:
> -use ldd to detect ELF dependencies
> -add support for shell script
> 
> uClibc ldd doesn't work with shared lib, thus this patch break
> seccomp with uClibc
> 
> Signed-off-by: Etienne CHAMPETIER 
> ---
>  CMakeLists.txt |   2 +-
>  jail/deps.c| 198 
>  jail/deps.h|  23 
>  jail/elf.c | 355 
> -
>  jail/elf.h |  38 --
>  jail/jail.c| 138 +++---
>  jail/jail.h|  18 +++
>  7 files changed, 284 insertions(+), 488 deletions(-)
>  create mode 100644 jail/deps.c
>  create mode 100644 jail/deps.h
>  delete mode 100644 jail/elf.c
>  delete mode 100644 jail/elf.h
>  create mode 100644 jail/jail.h
> 
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index d749c25..8e3f7ea 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -87,7 +87,7 @@ ADD_DEPENDENCIES(preload-seccomp syscall-names-h)
>  endif()
>  
>  IF(JAIL_SUPPORT)
> -ADD_EXECUTABLE(ujail jail/jail.c jail/elf.c jail/capabilities.c)
> +ADD_EXECUTABLE(ujail jail/jail.c jail/deps.c jail/capabilities.c)
>  TARGET_LINK_LIBRARIES(ujail ubox blobmsg_json)
>  INSTALL(TARGETS ujail
>   RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
> diff --git a/jail/deps.c b/jail/deps.c
> new file mode 100644
> index 000..0141cef
> --- /dev/null
> +++ b/jail/deps.c
> @@ -0,0 +1,198 @@
> +/*
> + * Copyright (C) 2015 John Crispin 
> + * Copyright (C) 2015 Etienne Champetier 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 2.1
> + * as published by the Free Software Foundation
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#define _GNU_SOURCE
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +
> +#include "deps.h"
> +#include "log.h"
> +#include "jail.h"
> +
> +struct mount {
> +struct avl_node avl;
> +const char *path;
> +int readonly;
> +int error;
> +};
> +
> +struct avl_tree mounts;
> +
> +static int add_mount(const char *path, int readonly, int error)
> +{
> + if (avl_find(, path))
> + return 1;
> +
> + struct mount *m;
> + m = calloc(1, sizeof(struct mount));
> + assert(m != NULL);
> + m->avl.key = m->path = strdup(path);
> + m->readonly = readonly;
> + m->error = error;
> +
> + avl_insert(, >avl);
> + DEBUG("adding mount %s ro(%d) err(%d)\n", m->path, m->readonly, 
> m->error != 0);
> + return 0;
> +}
> +
> +int add_mount_if_exists(const char *path, int readonly, int error) {
> + struct stat s;
> + if (stat(path, ) == -1) {
> + DEBUG("%s doesn't exist\n", path);
> + return -1;
> + }
> + return add_mount(path, readonly, error);
> +}
> +
> +int mount_all(const char *jailroot) {
> + struct mount *m;
> + avl_for_each_element(, m, avl)
> + if (mount_bind(jailroot, m->path, m->readonly, m->error))
> + return -1;
> +
> + return 0;
> +}
> +
> +void mount_list_init() {
> + avl_init(, avl_strcmp, false, NULL);
> +}
> +
> +//we already read 2 char from f (#!)
> +static int add_script_deps(FILE *f, const char *path, int readonly, int 
> error)
> +{
> + char buf[PATH_MAX];
> + int i = 0;
> + int c;
> + while ((c = fgetc(f)) != EOF) {
> + if (i == 0 && c != '/')
> + continue;
> + if (c <= 0x20 || c > 0x7e)
> + break;
> + buf[i] = c;
> + i++;
> + if (i >= sizeof(buf)) {
> + ERROR("script interpretor too long (%s)\n", path);
> + return -1;
> + }
> + }
> + buf[i] = '\0';
> + return add_path_and_deps(buf, readonly, error);
> +}
> +
> +static int add_elf_deps(const char *path, int readonly, int error)
> +{
> + char buf[PATH_MAX];
> + int nb = snprintf(buf, sizeof(buf), "ldd %s", path);
> + assert(nb >= 0);
> +
> + FILE *f = popen(buf, 

Re: [OpenWrt-Devel] [PATCH procd 2/2] ujail: rework file dependencies detection (use ldd)

2015-11-21 Thread John Crispin


On 21/11/2015 00:05, Etienne CHAMPETIER wrote:
> Using ldd (via popen()) is a hack, but it's simpler (and working)

indeed

> we have 3 libc and many archs, too many ways to resolve .so
where does it break ?


> Current code:
> -do not parse the intepreter (PT_INTERP) part of the elf
why should it ?

> -do not get the library path priority right (/lib64 is before /lib,
> musl take the libs in /lib even on 64bits images)

libc dependent and not procd depended

> -do not handle RPATH
> 
> This patch:
> -use ldd to detect ELF dependencies
> -add support for shell script

elaborate that please


> uClibc ldd doesn't work with shared lib, thus this patch break
> seccomp with uClibc

so after you patch we can never again update procd in CC ?

John

> 
> Signed-off-by: Etienne CHAMPETIER 
> ---
>  CMakeLists.txt |   2 +-
>  jail/deps.c| 198 
>  jail/deps.h|  23 
>  jail/elf.c | 355 
> -
>  jail/elf.h |  38 --
>  jail/jail.c| 138 +++---
>  jail/jail.h|  18 +++
>  7 files changed, 284 insertions(+), 488 deletions(-)
>  create mode 100644 jail/deps.c
>  create mode 100644 jail/deps.h
>  delete mode 100644 jail/elf.c
>  delete mode 100644 jail/elf.h
>  create mode 100644 jail/jail.h
> 
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index d749c25..8e3f7ea 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -87,7 +87,7 @@ ADD_DEPENDENCIES(preload-seccomp syscall-names-h)
>  endif()
>  
>  IF(JAIL_SUPPORT)
> -ADD_EXECUTABLE(ujail jail/jail.c jail/elf.c jail/capabilities.c)
> +ADD_EXECUTABLE(ujail jail/jail.c jail/deps.c jail/capabilities.c)
>  TARGET_LINK_LIBRARIES(ujail ubox blobmsg_json)
>  INSTALL(TARGETS ujail
>   RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
> diff --git a/jail/deps.c b/jail/deps.c
> new file mode 100644
> index 000..0141cef
> --- /dev/null
> +++ b/jail/deps.c
> @@ -0,0 +1,198 @@
> +/*
> + * Copyright (C) 2015 John Crispin 
> + * Copyright (C) 2015 Etienne Champetier 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License version 2.1
> + * as published by the Free Software Foundation
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#define _GNU_SOURCE
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +
> +#include "deps.h"
> +#include "log.h"
> +#include "jail.h"
> +
> +struct mount {
> +struct avl_node avl;
> +const char *path;
> +int readonly;
> +int error;
> +};
> +
> +struct avl_tree mounts;
> +
> +static int add_mount(const char *path, int readonly, int error)
> +{
> + if (avl_find(, path))
> + return 1;
> +
> + struct mount *m;
> + m = calloc(1, sizeof(struct mount));
> + assert(m != NULL);
> + m->avl.key = m->path = strdup(path);
> + m->readonly = readonly;
> + m->error = error;
> +
> + avl_insert(, >avl);
> + DEBUG("adding mount %s ro(%d) err(%d)\n", m->path, m->readonly, 
> m->error != 0);
> + return 0;
> +}
> +
> +int add_mount_if_exists(const char *path, int readonly, int error) {
> + struct stat s;
> + if (stat(path, ) == -1) {
> + DEBUG("%s doesn't exist\n", path);
> + return -1;
> + }
> + return add_mount(path, readonly, error);
> +}
> +
> +int mount_all(const char *jailroot) {
> + struct mount *m;
> + avl_for_each_element(, m, avl)
> + if (mount_bind(jailroot, m->path, m->readonly, m->error))
> + return -1;
> +
> + return 0;
> +}
> +
> +void mount_list_init() {
> + avl_init(, avl_strcmp, false, NULL);
> +}
> +
> +//we already read 2 char from f (#!)
> +static int add_script_deps(FILE *f, const char *path, int readonly, int 
> error)
> +{
> + char buf[PATH_MAX];
> + int i = 0;
> + int c;
> + while ((c = fgetc(f)) != EOF) {
> + if (i == 0 && c != '/')
> + continue;
> + if (c <= 0x20 || c > 0x7e)
> + break;
> + buf[i] = c;
> + i++;
> + if (i >= sizeof(buf)) {
> + ERROR("script interpretor too long (%s)\n", path);
> + return -1;
> + }
> + }
> + buf[i] = '\0';
> + return add_path_and_deps(buf, readonly, error);
> +}
> +
> +static int add_elf_deps(const char *path, int readonly, int error)
> +{
> + char buf[PATH_MAX];
> + int nb =