[LEDE-DEV] iw / ath9k / mediatek / strange values for 'signal'

2016-10-21 Thread Bastian Bittorf
we use the signal reported from 'iw' for some actions
and I can see them beeing inconsistent or maybe even
wrong calculated (strange values are marked)

root@box:~ iw dev wlan0-1 station get 60:5b:b4:9a:e4:8b
Station 60:5b:b4:9a:e4:8b (on wlan0-1)
inactive time:  10 ms
rx bytes:   820080
rx packets: 6018
tx bytes:   13855366
tx packets: 9884
tx retries: 1696
tx failed:  0
*** signal: -4 [-59, -59, -54] dBm
signal avg: -53 [-57, -57, -52] dBm
tx bitrate: 58.5 MBit/s MCS 6
rx bitrate: 130.0 MBit/s MCS 15
expected throughput:30.120Mbps
authorized: yes
authenticated:  yes
preamble:   short
WMM/WME:yes
MFP:no
TDLS peer:  no
connected time: 161 seconds

root@box:~ iw dev wlan0-1 station get 60:5b:b4:9a:e4:8b
Station 60:5b:b4:9a:e4:8b (on wlan0-1)
inactive time:  70 ms
rx bytes:   1262941
rx packets: 8861
tx bytes:   19504789
tx packets: 14266
tx retries: 2572
tx failed:  0
*** signal: -95 [-58, -58, -53] dBm
signal avg: -55 [-56, -57, -52] dBm
tx bitrate: 78.0 MBit/s MCS 12
rx bitrate: 117.0 MBit/s MCS 14
expected throughput:35.613Mbps
authorized: yes
authenticated:  yes
preamble:   short
WMM/WME:yes
MFP:no
TDLS peer:  no
connected time: 292 seconds

root@box:~ iw dev wlan0-1 station get 60:5b:b4:9a:e4:8b
Station 60:5b:b4:9a:e4:8b (on wlan0-1)
inactive time:  20 ms
rx bytes:   2460373
rx packets: 9789
tx bytes:   19619950
tx packets: 14761
tx retries: 2599
tx failed:  0
*** signal: -20 [-59, -58, -53] dBm
signal avg: -85 [-57, -58, -53] dBm
tx bitrate: 117.0 MBit/s MCS 14
rx bitrate: 52.0 MBit/s MCS 11
expected throughput:42.296Mbps
authorized: yes
authenticated:  yes
preamble:   short
WMM/WME:yes
MFP:no
TDLS peer:  no
connected time: 313 seconds

beside these 3 shots, i can see also values for signal of:
"8" (positive!) and "-126"...

i can see this with different versions of OpenWRT and LEDE
and with ath9k and Mediathek. What can I do for debugging this
better? The connected station is *not* moving.

bye, bastian

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCHv2] ipq806x: add support for ZyXEL NBG6817

2016-10-21 Thread Andre Valentin
Hi!

Am 21.10.2016 um 17:26 schrieb Felix Fietkau:
>> I tried that but it is an EFI partition not an mtd partition. To my 
>> understanding,
>> only mtd partitons will be split into rootfs and rootfs_data on boot.
>> This does not hapen.  I need a way to tell the system that /dev/mmcblk0p1 is 
>> my overlay FS.
>> Is there a possibility that I can somehow tell fstools which fs to use for 
>> overlay. Or which
>> depencies are there for detecting that an device holds an fs for overlay?
> The overlay split is handled in user space by fstools. Try enabling loopback 
> device support in the kernel config

Thanks, that fixed the problem. Do you have a hint how to get this working in 
the sysupgrade process?
I'm currently trying losetup to recreate the volume like in the nand 
sysupgrage. Or am I on the wrong path?

Kind regards,

André




smime.p7s
Description: S/MIME Cryptographic Signature
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH V2 6/7] ar71xx: build relocate stub for generic and legacy images

2016-10-21 Thread Stijn Tintel
Signed-off-by: Stijn Tintel 
---
 target/linux/ar71xx/image/Makefile  | 5 -
 target/linux/ar71xx/image/legacy.mk | 6 --
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/target/linux/ar71xx/image/Makefile 
b/target/linux/ar71xx/image/Makefile
index 56e07d8..26e9558 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -79,8 +79,11 @@ define Build/loader-okli
 endef
 
 define Build/relocate-kernel
+   rm -rf $(KDIR)/relocate
+   $(CP) ../../generic/image/relocate $(KDIR)
+   $(MAKE) -C $(KDIR)/relocate KERNEL_ADDR=$(KERNEL_LOADADDR) 
CROSS_COMPILE=$(TARGET_CROSS)
( \
-   dd if=$(KDIR)/relocate.bin bs=32 conv=sync && \
+   dd if=$(KDIR)/relocate/loader.bin bs=32 conv=sync && \
perl -e '@s = stat("$@"); print pack("N", @s[7])' && \
cat "$@" \
) > "$@.new"
diff --git a/target/linux/ar71xx/image/legacy.mk 
b/target/linux/ar71xx/image/legacy.mk
index 14de229..58a65d4d 100644
--- a/target/linux/ar71xx/image/legacy.mk
+++ b/target/linux/ar71xx/image/legacy.mk
@@ -1101,12 +1101,6 @@ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
$(call Image/BuildLoader,generic,elf,,,-initramfs)
 endif
$(call Image/BuildLoader,generic,elf)
-
-   # Note: not only used for legacy images
-   rm -rf $(KDIR)/relocate
-   $(CP) ../../generic/image/relocate $(KDIR)
-   $(MAKE) -C $(KDIR)/relocate KERNEL_ADDR=$(KERNEL_LOADADDR) 
CROSS_COMPILE=$(TARGET_CROSS)
-   $(CP) $(KDIR)/relocate/loader.bin $(KDIR)/relocate.bin
 endef
 
 define Image/Prepare/Profile
-- 
2.7.3


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH V2 0/7] add support for D-Link DAP-2695 rev. A1

2016-10-21 Thread Stijn Tintel
On 21-10-16 18:34, Stijn Tintel wrote:
> This patch series adds support for D-Link DAP-2695 rev. A1.
>
>
FYI, this series is also available in my staging tree at
https://git.lede-project.org/?p=lede/stintel/staging.git;a=shortlog;h=refs/heads/dap-2695-a1

Stijn

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH V2 7/7] ar71xx: add support for D-Link DAP-2695 rev. A1

2016-10-21 Thread Stijn Tintel
Signed-off-by: Stijn Tintel 
---
 package/boot/uboot-envtools/files/ar71xx   |   1 +
 target/linux/ar71xx/base-files/etc/board.d/01_leds |   5 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |   3 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   4 +
 .../base-files/etc/uci-defaults/09_fix-checksum|   9 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |  13 ++
 target/linux/ar71xx/config-4.4 |   1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |   9 +
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../files/arch/mips/ath79/mach-dap-2695-a1.c   | 191 +
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/image/generic.mk   |  29 
 13 files changed, 270 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-dap-2695-a1.c

diff --git a/package/boot/uboot-envtools/files/ar71xx 
b/package/boot/uboot-envtools/files/ar71xx
index a075020..45f1f45 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -54,6 +54,7 @@ om2p-lc)
 dr531)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x1"
;;
+dap-2695-a1 | \
 wzr-hp-ag300h)
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1" "0x1"
;;
diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds 
b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index 5011af6..2a655cd 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -168,6 +168,11 @@ rb-2011uias-2hnd)
ucidef_set_led_switch "eth9" "ETH9" "rb:green:eth9" "switch1" "0x04"
ucidef_set_led_switch "eth10" "ETH10" "rb:green:eth10" "switch1" "0x02"
;;
+dap-2695-a1)
+   ucidef_set_led_default "power" "POWER" "d-link:green:power" "1"
+   ucidef_set_led_default "diag" "DIAG" "d-link:red:power" "0"
+   ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "d-link:green:wlan2g" 
"phy1tpt"
+   ;;
 dhp-1565-a1)
ucidef_set_led_switch "wan" "WAN" "d-link:green:planet" "switch0" "0x20"
;;
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index b7b91d0..c9cdd6e 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -229,6 +229,9 @@ ar71xx_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
;;
+   dap-2695-a1)
+   ucidef_add_switch "switch0" "0@eth0" "2:lan" "3:wan" "6@eth1"
+   ;;
db120|\
rb-2011l|\
rb-2011uas|\
diff --git 
a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index a0a111b..c700644 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -47,6 +47,10 @@ board=$(ar71xx_board_name)
 case "$FIRMWARE" in
 "ath10k/cal-pci-:00:00.0.bin")
case $board in
+   dap-2695-a1)
+   ath10kcal_extract "radiocfg" 20480 2116
+   ath10kcal_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac_a)
+   ;;
dlan-pro-1200-ac)
ath10kcal_extract "art" 20480 2116
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/09_fix-checksum 
b/target/linux/ar71xx/base-files/etc/uci-defaults/09_fix-checksum
index 1bfd525..057afe0 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/09_fix-checksum
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/09_fix-checksum
@@ -11,9 +11,18 @@ fixtrx() {
mtd -o 32 fixtrx firmware
 }
 
+fixwrgg() {
+   local kernel_size=$(sed -n 's/mtd[0-9]*: 
\([0-9a-f]*\).*"kernel".*/\1/p' /proc/mtd)
+
+   [ "$kernel_size" ] && mtd -c 0x$kernel_size fixwrgg firmware
+}
+
 case "$board" in
 mynet-rext |\
 wrt160nl)
fixtrx
;;
+dap-2695-a1)
+   fixwrgg
+   ;;
 esac
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 1492b50..1a2e324 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -508,6 +508,9 @@ ar71xx_board_detect() {
*CR5000)
name="cr5000"
;;
+   *"DAP-2695 rev. A1")
+   name="dap-2695-a1"
+   ;;
*"DB120 reference board")
name="db120"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 35e9bb4..aa258cc 100755
--- 

[LEDE-DEV] [PATCH V2 4/7] mtd: add fixwrgg command

2016-10-21 Thread Stijn Tintel
Based on fixseama.

Signed-off-by: Stijn Tintel 
---
 package/system/mtd/src/Makefile |   3 +-
 package/system/mtd/src/mtd.c|  28 +-
 package/system/mtd/src/mtd.h|   1 +
 package/system/mtd/src/wrgg.c   | 190 
 package/system/mtd/src/wrgg.h   |  20 +
 5 files changed, 239 insertions(+), 3 deletions(-)
 create mode 100644 package/system/mtd/src/wrgg.c
 create mode 100644 package/system/mtd/src/wrgg.h

diff --git a/package/system/mtd/src/Makefile b/package/system/mtd/src/Makefile
index 70c61e5..4e39a89 100644
--- a/package/system/mtd/src/Makefile
+++ b/package/system/mtd/src/Makefile
@@ -4,7 +4,8 @@ LDFLAGS += -lubox
 
 obj = mtd.o jffs2.o crc32.o md5.o
 obj.seama = seama.o md5.o
-obj.ar71xx = trx.o $(obj.seama)
+obj.wrgg = wrgg.o md5.o
+obj.ar71xx = trx.o $(obj.seama) $(obj.wrgg)
 obj.brcm = trx.o
 obj.brcm47xx = $(obj.brcm)
 obj.bcm53xx = $(obj.brcm) $(obj.seama)
diff --git a/package/system/mtd/src/mtd.c b/package/system/mtd/src/mtd.c
index 702ed3d..2f4aea2 100644
--- a/package/system/mtd/src/mtd.c
+++ b/package/system/mtd/src/mtd.c
@@ -54,6 +54,7 @@
 
 #define TRX_MAGIC  0x48445230  /* "HDR0" */
 #define SEAMA_MAGIC0x5ea3a417
+#define WRGG03_MAGIC   0x20080321
 
 #if !defined(__BYTE_ORDER)
 #error "Unknown byte order"
@@ -62,9 +63,11 @@
 #if __BYTE_ORDER == __BIG_ENDIAN
 #define cpu_to_be32(x) (x)
 #define be32_to_cpu(x) (x)
+#define le32_to_cpu(x) bswap_32(x)
 #elif __BYTE_ORDER == __LITTLE_ENDIAN
 #define cpu_to_be32(x) bswap_32(x)
 #define be32_to_cpu(x) bswap_32(x)
+#define le32_to_cpu(x)  (x)
 #else
 #error "Unsupported endianness"
 #endif
@@ -73,6 +76,7 @@ enum mtd_image_format {
MTD_IMAGE_FORMAT_UNKNOWN,
MTD_IMAGE_FORMAT_TRX,
MTD_IMAGE_FORMAT_SEAMA,
+   MTD_IMAGE_FORMAT_WRGG03,
 };
 
 static char *buf = NULL;
@@ -201,6 +205,8 @@ image_check(int imagefd, const char *mtd)
imageformat = MTD_IMAGE_FORMAT_TRX;
else if (be32_to_cpu(magic) == SEAMA_MAGIC)
imageformat = MTD_IMAGE_FORMAT_SEAMA;
+   else if (le32_to_cpu(magic) == WRGG03_MAGIC)
+   imageformat = MTD_IMAGE_FORMAT_WRGG03;
 
switch (imageformat) {
case MTD_IMAGE_FORMAT_TRX:
@@ -209,6 +215,8 @@ image_check(int imagefd, const char *mtd)
break;
case MTD_IMAGE_FORMAT_SEAMA:
break;
+   case MTD_IMAGE_FORMAT_WRGG03:
+   break;
default:
 #ifdef target_brcm
if (!strcmp(mtd, "firmware"))
@@ -677,6 +685,10 @@ resume:
if (mtd_fixseama)
mtd_fixseama(mtd, 0, 0);
break;
+   case MTD_IMAGE_FORMAT_WRGG03:
+   if (mtd_fixwrgg)
+   mtd_fixwrgg(mtd, 0, 0);
+   break;
default:
break;
}
@@ -722,6 +734,10 @@ static void usage(void)
fprintf(stderr,
"fixseamafix the checksum in a seama header on 
first boot\n");
}
+   if (mtd_fixwrgg) {
+   fprintf(stderr,
+   "fixwrgg fix the checksum in a wrgg header on 
first boot\n");
+   }
fprintf(stderr,
"Following options are available:\n"
"-q  quiet mode (once: no [w] on writing,\n"
@@ -739,9 +755,9 @@ static void usage(void)
fprintf(stderr,
"-o offset   offset of the image header in the 
partition(for fixtrx)\n");
}
-   if (mtd_fixtrx || mtd_fixseama) {
+   if (mtd_fixtrx || mtd_fixseama || mtd_fixwrgg) {
fprintf(stderr,
-   "-c datasize amount of data to be used for checksum 
calculation (for fixtrx / fixseama)\n");
+   "-c datasize amount of data to be used for checksum 
calculation (for fixtrx / fixseama / fixwrgg)\n");
}
fprintf(stderr,
 #ifdef FIS_SUPPORT
@@ -782,6 +798,7 @@ int main (int argc, char **argv)
CMD_JFFS2WRITE,
CMD_FIXTRX,
CMD_FIXSEAMA,
+   CMD_FIXWRGG,
CMD_VERIFY,
CMD_DUMP,
CMD_RESETBC,
@@ -896,6 +913,9 @@ int main (int argc, char **argv)
} else if (((strcmp(argv[0], "fixseama") == 0) && (argc == 2)) && 
mtd_fixseama) {
cmd = CMD_FIXSEAMA;
device = argv[1];
+   } else if (((strcmp(argv[0], "fixwrgg") == 0) && (argc == 2)) && 
mtd_fixwrgg) {
+   cmd = CMD_FIXWRGG;
+   device = argv[1];
} else if ((strcmp(argv[0], "verify") == 0) && (argc == 3)) {
cmd = CMD_VERIFY;
imagefile = argv[1];
@@ -992,6 +1012,10 @@ int main (int argc, char **argv)
if (mtd_fixseama)

[LEDE-DEV] [PATCH V2 0/7] add support for D-Link DAP-2695 rev. A1

2016-10-21 Thread Stijn Tintel
This patch series adds support for D-Link DAP-2695 rev. A1.

Both the factory and the sysupgrade can be used to flash the device from
the bootloader. When flashing via the web interface of the stock
firmware, only the factory image can be used.

With the stock firmware, this device is only usable as a dumb AP. With
LEDE, it is configured as a router by default. The LAN1(PoE) port is
configured as the LAN port, the LAN2 port is configured as the WAN port.

The only thing that doesn't work, is the 5GHz LED, as it does not seem
to be connected to any of the SoC's GPIOs.

The WRGG naming comes from the D-Link GPL code. The mkwrggimg utility
also works for the D-Link DAP-2553. For more info, see
https://forum.openwrt.org/viewtopic.php?id=52048

Changes since v1:
Remove physical address of the FSF from wrgg.c
Fix endianness detection on musl in mtd
Build relocate stub for generic and legacy images
Remove ucidef_set_interfaces_lan_wan

Stijn Tintel (7):
  firmware-utils: mkwrggimg: new tool for D-Link DAP-2695
  kernel: mtdsplit: add support for WRGG images
  mtd: fix endianness detection on musl
  mtd: add fixwrgg command
  ar71xx/base-files: rename 09_fix-trx-header 09_fix-checksum
  ar71xx: build relocate stub for generic and legacy images
  ar71xx: add support for D-Link DAP-2695 rev. A1

 package/boot/uboot-envtools/files/ar71xx   |   1 +
 package/system/mtd/src/Makefile|   3 +-
 package/system/mtd/src/mtd.c   |  29 ++-
 package/system/mtd/src/mtd.h   |   1 +
 package/system/mtd/src/seama.c |   1 +
 package/system/mtd/src/wrgg.c  | 190 ++
 package/system/mtd/src/wrgg.h  |  20 ++
 target/linux/ar71xx/base-files/etc/board.d/01_leds |   5 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |   3 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata   |   4 +
 .../base-files/etc/uci-defaults/09_fix-checksum|  28 ++
 .../base-files/etc/uci-defaults/09_fix-trx-header  |  19 --
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |  13 +
 target/linux/ar71xx/config-4.4 |   2 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |   9 +
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../files/arch/mips/ath79/mach-dap-2695-a1.c   | 191 ++
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/image/Makefile |   5 +-
 target/linux/ar71xx/image/generic.mk   |  29 +++
 target/linux/ar71xx/image/legacy.mk|   6 -
 target/linux/generic/config-3.18   |   1 +
 target/linux/generic/config-4.1|   1 +
 target/linux/generic/config-4.4|   1 +
 .../generic/files/drivers/mtd/mtdsplit/Kconfig |   5 +
 .../generic/files/drivers/mtd/mtdsplit/Makefile|   1 +
 .../files/drivers/mtd/mtdsplit/mtdsplit_wrgg.c | 109 
 tools/firmware-utils/Makefile  |   1 +
 tools/firmware-utils/src/mkwrggimg.c   | 282 +
 30 files changed, 936 insertions(+), 29 deletions(-)
 create mode 100644 package/system/mtd/src/wrgg.c
 create mode 100644 package/system/mtd/src/wrgg.h
 create mode 100644 
target/linux/ar71xx/base-files/etc/uci-defaults/09_fix-checksum
 delete mode 100644 
target/linux/ar71xx/base-files/etc/uci-defaults/09_fix-trx-header
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-dap-2695-a1.c
 create mode 100644 
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_wrgg.c
 create mode 100644 tools/firmware-utils/src/mkwrggimg.c

-- 
2.7.3


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH V2 2/7] kernel: mtdsplit: add support for WRGG images

2016-10-21 Thread Stijn Tintel
Support splitting WRGG images, found in some D-Link devices (e.g.
DAP-2695).

Signed-off-by: Stijn Tintel 
---
 target/linux/ar71xx/config-4.4 |   1 +
 target/linux/generic/config-3.18   |   1 +
 target/linux/generic/config-4.1|   1 +
 target/linux/generic/config-4.4|   1 +
 .../generic/files/drivers/mtd/mtdsplit/Kconfig |   5 +
 .../generic/files/drivers/mtd/mtdsplit/Makefile|   1 +
 .../files/drivers/mtd/mtdsplit/mtdsplit_wrgg.c | 109 +
 7 files changed, 119 insertions(+)
 create mode 100644 
target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_wrgg.c

diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index 77a5949..d6ed7b7 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -351,6 +351,7 @@ CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_LZMA_FW=y
 CONFIG_MTD_SPLIT_SEAMA_FW=y
 CONFIG_MTD_SPLIT_UIMAGE_FW=y
+CONFIG_MTD_SPLIT_WRGG_FW=y
 CONFIG_MTD_TPLINK_PARTS=y
 CONFIG_MYLOADER=y
 CONFIG_NEED_DMA_MAP_STATE=y
diff --git a/target/linux/generic/config-3.18 b/target/linux/generic/config-3.18
index 0ccd9ac..8b70c7d 100644
--- a/target/linux/generic/config-3.18
+++ b/target/linux/generic/config-3.18
@@ -2282,6 +2282,7 @@ CONFIG_MTD_SPLIT_SUPPORT=y
 # CONFIG_MTD_SPLIT_TRX_FW is not set
 # CONFIG_MTD_SPLIT_TPLINK_FW is not set
 # CONFIG_MTD_SPLIT_UIMAGE_FW is not set
+# CONFIG_MTD_SPLIT_WRGG_FW is not set
 # CONFIG_MTD_SST25L is not set
 # CONFIG_MTD_SWAP is not set
 # CONFIG_MTD_TESTS is not set
diff --git a/target/linux/generic/config-4.1 b/target/linux/generic/config-4.1
index fc7359e..68bd849 100644
--- a/target/linux/generic/config-4.1
+++ b/target/linux/generic/config-4.1
@@ -2375,6 +2375,7 @@ CONFIG_MTD_SPLIT_SUPPORT=y
 # CONFIG_MTD_SPLIT_TRX_FW is not set
 # CONFIG_MTD_SPLIT_TPLINK_FW is not set
 # CONFIG_MTD_SPLIT_UIMAGE_FW is not set
+# CONFIG_MTD_SPLIT_WRGG_FW is not set
 # CONFIG_MTD_SST25L is not set
 # CONFIG_MTD_SWAP is not set
 # CONFIG_MTD_TESTS is not set
diff --git a/target/linux/generic/config-4.4 b/target/linux/generic/config-4.4
index 687c183..32b291f 100644
--- a/target/linux/generic/config-4.4
+++ b/target/linux/generic/config-4.4
@@ -2365,6 +2365,7 @@ CONFIG_MTD_SPLIT_SUPPORT=y
 # CONFIG_MTD_SPLIT_TPLINK_FW is not set
 # CONFIG_MTD_SPLIT_TRX_FW is not set
 # CONFIG_MTD_SPLIT_UIMAGE_FW is not set
+# CONFIG_MTD_SPLIT_WRGG_FW is not set
 # CONFIG_MTD_SST25L is not set
 # CONFIG_MTD_SWAP is not set
 # CONFIG_MTD_TESTS is not set
diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/Kconfig 
b/target/linux/generic/files/drivers/mtd/mtdsplit/Kconfig
index 131a74f..7e653e7 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/Kconfig
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/Kconfig
@@ -25,6 +25,11 @@ config MTD_SPLIT_SEAMA_FW
depends on MTD_SPLIT_SUPPORT
select MTD_SPLIT
 
+config MTD_SPLIT_WRGG_FW
+   bool "WRGG firmware parser"
+   depends on MTD_SPLIT_SUPPORT
+   select MTD_SPLIT
+
 config MTD_SPLIT_UIMAGE_FW
bool "uImage based firmware partition parser"
depends on MTD_SPLIT_SUPPORT
diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/Makefile 
b/target/linux/generic/files/drivers/mtd/mtdsplit/Makefile
index acf799e..c843025 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/Makefile
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/Makefile
@@ -8,3 +8,4 @@ obj-$(CONFIG_MTD_SPLIT_TPLINK_FW) += mtdsplit_tplink.o
 obj-$(CONFIG_MTD_SPLIT_TRX_FW) += mtdsplit_trx.o
 obj-$(CONFIG_MTD_SPLIT_BRNIMAGE_FW) += mtdsplit_brnimage.o
 obj-$(CONFIG_MTD_SPLIT_EVA_FW) += mtdsplit_eva.o
+obj-$(CONFIG_MTD_SPLIT_WRGG_FW) += mtdsplit_wrgg.o
diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_wrgg.c 
b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_wrgg.c
new file mode 100644
index 000..c1fbccb
--- /dev/null
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_wrgg.c
@@ -0,0 +1,109 @@
+/*
+ *  Copyright (C) 2013 Gabor Juhos 
+ *  Copyright (C) 2014 Felix Fietkau 
+ *  Copyright (C) 2016 Stijn Tintel 
+ *
+ *  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 "mtdsplit.h"
+
+#define WRGG_NR_PARTS  2
+#define WRGG_MIN_ROOTFS_OFFS   0x8 /* 512KiB */
+#define WRGG03_MAGIC   0x20080321
+
+struct wrgg03_header {
+   charsignature[32];
+   uint32_tmagic1;
+   uint32_tmagic2;
+   charversion[16];
+   charmodel[16];
+   uint32_tflag[2];
+   uint32_treserve[2];
+   charbuildno[16];
+ 

[LEDE-DEV] [PATCH V2 1/7] firmware-utils: mkwrggimg: new tool for D-Link DAP-2695

2016-10-21 Thread Stijn Tintel
Based on mkwrgimg.c.

Signed-off-by: Stijn Tintel 
---
 tools/firmware-utils/Makefile|   1 +
 tools/firmware-utils/src/mkwrggimg.c | 282 +++
 2 files changed, 283 insertions(+)
 create mode 100644 tools/firmware-utils/src/mkwrggimg.c

diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile
index 803ada4..320d1db 100644
--- a/tools/firmware-utils/Makefile
+++ b/tools/firmware-utils/Makefile
@@ -57,6 +57,7 @@ define Host/Compile
$(call cc,buffalo-tag buffalo-lib, -Wall)
$(call cc,buffalo-tftp buffalo-lib, -Wall)
$(call cc,mkwrgimg md5, -Wall)
+   $(call cc,mkwrggimg md5, -Wall)
$(call cc,mkedimaximg)
$(call cc,mkbrncmdline)
$(call cc,mkbrnimg)
diff --git a/tools/firmware-utils/src/mkwrggimg.c 
b/tools/firmware-utils/src/mkwrggimg.c
new file mode 100644
index 000..a224b25
--- /dev/null
+++ b/tools/firmware-utils/src/mkwrggimg.c
@@ -0,0 +1,282 @@
+/*
+ *  Copyright (C) 2011 Gabor Juhos 
+ *  Copyright (C) 2016 Stijn Tintel 
+ *
+ *  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 "md5.h"
+
+#define ERR(fmt, ...) do { \
+   fflush(0); \
+   fprintf(stderr, "[%s] *** error: " fmt "\n", \
+   progname, ## __VA_ARGS__ ); \
+} while (0)
+
+#define ERRS(fmt, ...) do { \
+   int save = errno; \
+   fflush(0); \
+   fprintf(stderr, "[%s] *** error: " fmt ", %s\n", \
+   progname, ## __VA_ARGS__, strerror(save)); \
+} while (0)
+
+#define WRGG03_MAGIC   0x20080321
+
+struct wrgg03_header {
+   charsignature[32];
+   uint32_tmagic1;
+   uint32_tmagic2;
+   charversion[16];
+   charmodel[16];
+   uint32_tflag[2];
+   uint32_treserve[2];
+   charbuildno[16];
+   uint32_tsize;
+   uint32_toffset;
+   chardevname[32];
+   chardigest[16];
+} __attribute__ ((packed));
+
+static char *progname;
+static char *ifname;
+static char *ofname;
+static char *signature;
+static char *version;
+static char *model;
+static uint32_t flag = 0;
+static uint32_t reserve = 0;
+static char *buildno;
+static uint32_t offset;
+static char *devname;
+static int big_endian;
+
+void usage(int status)
+{
+   FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout;
+
+   fprintf(stream, "Usage: %s [OPTIONS...]\n", progname);
+   fprintf(stream,
+"\n"
+"Options:\n"
+"  -b  create image in big endian format\n"
+"  -B build number\n"
+"  -iread input from the file \n"
+"  -dset device name to \n"
+"  -m   model name\n"
+"  -owrite output to the file \n"
+"  -O  set offset to \n"
+"  -s set image signature to \n"
+"  -h  show this screen\n"
+   );
+
+   exit(status);
+}
+
+static void put_u32(void *data, uint32_t val, int swap)
+{
+   unsigned char *p = data;
+
+   if (swap) {
+   p[0] = (val >> 24) & 0xff;
+   p[1] = (val >> 16) & 0xff;
+   p[2] = (val >> 8) & 0xff;
+   p[3] = val & 0xff;
+   } else {
+   p[3] = (val >> 24) & 0xff;
+   p[2] = (val >> 16) & 0xff;
+   p[1] = (val >> 8) & 0xff;
+   p[0] = val & 0xff;
+   }
+}
+
+static void get_digest(struct wrgg03_header *header, char *data, int size)
+{
+   MD5_CTX ctx;
+
+   MD5_Init();
+
+   MD5_Update(, (char *)>offset, sizeof(header->offset));
+   MD5_Update(, (char *)>devname, sizeof(header->devname));
+   MD5_Update(, data, size);
+
+   MD5_Final(header->digest, );
+}
+
+int main(int argc, char *argv[])
+{
+   struct wrgg03_header *header;
+   char *buf;
+   struct stat st;
+   int buflen;
+   int err;
+   int res = EXIT_FAILURE;
+
+   FILE *outfile, *infile;
+
+   progname = basename(argv[0]);
+
+   while ( 1 ) {
+   int c;
+
+   c = getopt(argc, argv, "bd:i:m:o:s:v:B:O:h");
+   if (c == -1)
+   break;
+
+   switch (c) {
+   case 'b':
+   big_endian = 1;
+   break;
+   case 'B':
+   buildno = optarg;
+   break;
+   case 'd':
+   devname = optarg;
+   break;
+   case 'i':
+   ifname = optarg;
+   break;
+   case 'm':
+   model = optarg;
+   break;
+ 

Re: [LEDE-DEV] [PATCHv2] ipq806x: add support for ZyXEL NBG6817

2016-10-21 Thread Felix Fietkau


> On 21.10.2016, at 17:20, Andre Valentin  wrote:
> 
> Hi!
> 
> Am 21.10.2016 um 10:33 schrieb Felix Fietkau:
>>> I have switched rootfs now to squashfs, that ist working. But I have 
>>> problems with the overlayfs.
>>> It is on /dev/mmcblk0p1, but I do not understand how to tell the system to 
>>> use this partition. I cannot find a matching example.
>>> 
>>> What I did:
>>> 1) Added an fstab to the squassh image:
>>> config 'global'
>>>optionanon_swap'0'
>>>optionanon_mount'0'
>>>optionauto_swap'1'
>>>optionauto_mount'1'
>>>optiondelay_root'5'
>>>optioncheck_fs'0'
>>> 
>>> config 'mount'
>>>option device'/dev/mmcblk0p1'
>>>option enabled '1'
>>>option target '/overlay'
>>>option fstype 'ext4'
>>>option options 'rw,sync'
>>>option enabled_fsck 0
>>>option is_rootfs '1'
>>> 
>>> 2) label the ext4fs rootfs_data
>>> 3) added rootfs_data=/dev/mmcblk0p1 on kernel commandline.
>>> 
>>> But fstools does not mount it.
>>> Please help.
>> Don't put overlay mount stuff in the config. Make sure you have
>> e2fsprogs and mkf2fs enabled in your config and that the rootfs
>> partition is big enough to fit both the squashfs image and the overlay
>> filesystem.
> I tried that but it is an EFI partition not an mtd partition. To my 
> understanding,
> only mtd partitons will be split into rootfs and rootfs_data on boot.
> This does not hapen.  I need a way to tell the system that /dev/mmcblk0p1 is 
> my overlay FS.
> Is there a possibility that I can somehow tell fstools which fs to use for 
> overlay. Or which
> depencies are there for detecting that an device holds an fs for overlay?
The overlay split is handled in user space by fstools. Try enabling loopback 
device support in the kernel config

- Felix
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCHv2] ipq806x: add support for ZyXEL NBG6817

2016-10-21 Thread Andre Valentin
Hi!

Am 21.10.2016 um 10:33 schrieb Felix Fietkau:
>> I have switched rootfs now to squashfs, that ist working. But I have 
>> problems with the overlayfs.
>> It is on /dev/mmcblk0p1, but I do not understand how to tell the system to 
>> use this partition. I cannot find a matching example.
>>
>> What I did:
>> 1) Added an fstab to the squassh image:
>> config 'global'
>>  option  anon_swap   '0'
>>  option  anon_mount  '0'
>>  option  auto_swap   '1'
>>  option  auto_mount  '1'
>>  option  delay_root  '5'
>>  option  check_fs'0'
>>
>> config 'mount'
>>  option device   '/dev/mmcblk0p1'
>>  option enabled '1'
>>  option target '/overlay'
>>  option fstype 'ext4'
>>  option options 'rw,sync'
>>  option enabled_fsck 0
>>  option is_rootfs '1'
>>
>> 2) label the ext4fs rootfs_data
>> 3) added rootfs_data=/dev/mmcblk0p1 on kernel commandline.
>>
>> But fstools does not mount it.
>> Please help.
> Don't put overlay mount stuff in the config. Make sure you have
> e2fsprogs and mkf2fs enabled in your config and that the rootfs
> partition is big enough to fit both the squashfs image and the overlay
> filesystem.
I tried that but it is an EFI partition not an mtd partition. To my 
understanding,
only mtd partitons will be split into rootfs and rootfs_data on boot.
This does not hapen.  I need a way to tell the system that /dev/mmcblk0p1 is my 
overlay FS.
Is there a possibility that I can somehow tell fstools which fs to use for 
overlay. Or which
depencies are there for detecting that an device holds an fs for overlay?


Kind regards,

André





smime.p7s
Description: S/MIME Cryptographic Signature
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] sorry for the mail/patch spam

2016-10-21 Thread Alberto Bursi
sorry for the mail/patch spam, I just discovered that my Kwrite text 
editor shows correct indentation in the GUI while the actual file has a 
wrong indentation.
I had to fix that with nano.

-Alberto
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] fstools: added f2fs to block-mount, correct indentation

2016-10-21 Thread Alberto Bursi
added the code to recognize and operate the filesystem checker of f2fs

added f2fs to the filesystem whitelist of block so it can mount it on
/overlay at boot.

Signed-off-by: Alberto Bursi 
---
 block.c | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/block.c b/block.c
index 9de8343..f4b24bd 100644
--- a/block.c
+++ b/block.c
@@ -687,6 +687,7 @@ static void check_filesystem(struct probe_info *pr)
pid_t pid;
struct stat statbuf;
const char *e2fsck = "/usr/sbin/e2fsck";
+   const char *f2fsck = "/usr/sbin/fsck.f2fs";
const char *dosfsck = "/usr/sbin/dosfsck";
const char *ckfs;
 
@@ -696,6 +697,8 @@ static void check_filesystem(struct probe_info *pr)
 
if (!strncmp(pr->type, "vfat", 4)) {
ckfs = dosfsck;
+   } else if (!strncmp(pr->id->name, "f2fs", 4)) {
+   ckfs = f2fsck;
} else if (!strncmp(pr->type, "ext", 3)) {
ckfs = e2fsck;
} else {
@@ -710,8 +713,12 @@ static void check_filesystem(struct probe_info *pr)
 
pid = fork();
if (!pid) {
-   execl(ckfs, ckfs, "-p", pr->dev, NULL);
-   exit(-1);
+   if(!strncmp(pr->id->name, "f2fs", 4)) {
+   execl(ckfs, ckfs, "-f", pr->dev, NULL);
+   exit(-1);
+   } else
+   execl(ckfs, ckfs, "-p", pr->dev, NULL);
+   exit(-1);
} else if (pid > 0) {
int status;
 
@@ -1154,8 +1161,9 @@ static int mount_extroot(char *cfg)
}
if (pr) {
if (strncmp(pr->type, "ext", 3) &&
+strncmp(pr->id->name, "f2fs", 4) &&
strncmp(pr->type, "ubifs", 5)) {
-   ULOG_ERR("extroot: unsupported filesystem %s, try 
ext4\n", pr->type);
+   ULOG_ERR("extroot: unsupported filesystem %s, try ext4 
or f2fs\n", pr->type);
return -1;
}
 
-- 
2.6.6


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] bcm63xx and fxs is possible...

2016-10-21 Thread Alberto Bursi


On 10/21/2016 01:15 PM, Eddi De Pieri wrote:
> Hi,
>
> Here to raise your attention to https://github.com/pgid69/bcm63xx-phone 
> projet.
>
> That gui implemented fxs support for some device already supported by
> lede/openwrt.
>
> That module work correctly on my device, but to get it working on
> openwrt >12 and lede you need to disable CONFIG_SPI_BCM63XX=n  (or at
> least mate it to compile as module)
>
> please can you consider to add this project to the feeds?
>
> Regards
>
> Eddi
>

You can send PRs to the package feeds here 
https://github.com/openwrt/packages
or on the main LEDE git repo https://github.com/lede-project/source

You can send a patch here or a PR on Lede's github to build the spi 
driver as a module again or disable it outright if none really needs 
that driver anyway (I don't know), and also add these new packages in 
default packages for the devices you want.

If it makes sense it will get merged.

You might want to encourage the current package developer to do this, as 
he might have not noticed that there is LEDE too now.

-Albert

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] fstools: added f2fs to block-mount

2016-10-21 Thread Alberto Bursi
added the code to recognize and operate the filesystem checker of f2fs
added f2fs to the filesystem whitelist of block so it can mount it on
/overlay at boot.

Signed-off-by: Alberto Bursi 
---
 block.c | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/block.c b/block.c
index 9de8343..b88c45e 100644
--- a/block.c
+++ b/block.c
@@ -686,7 +686,8 @@ static void check_filesystem(struct probe_info *pr)
 {
pid_t pid;
struct stat statbuf;
-   const char *e2fsck = "/usr/sbin/e2fsck";
+const char *e2fsck = "/usr/sbin/e2fsck";
+const char *f2fsck = "/usr/sbin/fsck.f2fs";
const char *dosfsck = "/usr/sbin/dosfsck";
const char *ckfs;
 
@@ -696,6 +697,8 @@ static void check_filesystem(struct probe_info *pr)
 
if (!strncmp(pr->type, "vfat", 4)) {
ckfs = dosfsck;
+} else if (!strncmp(pr->id->name, "f2fs", 4)) {
+ckfs = f2fsck;
} else if (!strncmp(pr->type, "ext", 3)) {
ckfs = e2fsck;
} else {
@@ -710,8 +713,12 @@ static void check_filesystem(struct probe_info *pr)
 
pid = fork();
if (!pid) {
-   execl(ckfs, ckfs, "-p", pr->dev, NULL);
-   exit(-1);
+if(!strncmp(pr->id->name, "f2fs", 4)) {
+execl(ckfs, ckfs, "-f", pr->dev, NULL);
+exit(-1);
+} else
+execl(ckfs, ckfs, "-p", pr->dev, NULL);
+exit(-1);
} else if (pid > 0) {
int status;
 
@@ -1154,8 +1161,9 @@ static int mount_extroot(char *cfg)
}
if (pr) {
if (strncmp(pr->type, "ext", 3) &&
+strncmp(pr->id->name, "f2fs", 4) &&
strncmp(pr->type, "ubifs", 5)) {
-   ULOG_ERR("extroot: unsupported filesystem %s, try 
ext4\n", pr->type);
+   ULOG_ERR("extroot: unsupported filesystem %s, try ext4 
or f2fs\n", pr->type);
return -1;
}
 
-- 
2.6.6


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH 2/3 v2] ar71xx: add mac partition to the MR12/MR16

2016-10-21 Thread Chris Blake
On the stock Meraki Firmare for the MR12/MR16, a chunk of SPI space
after u-boot-env is used to store the boards Mac address. Sadly as this
was removed on any device already on OpenWRT/LEDE, moving forward a new,
64k partition named "mac" will be used to store the mac address for the
device (which is the minimum size). This allows users to properly set
the correct MAC, without editing the ART partition (which holds the same
MAC for all devices).

The reason the space is taken from kernel instead of rootfs is currently
kernels are only 1.3MB, so that way we can leave the current rootfs
space alone for users who fully utilize the available storage space.

Once this partition is added to a device, you can set your MAC doing the
following:

mtd erase mac
echo -n -e '\x00\x18\x0a\x33\x44\x55' > /dev/mtd5
sync && reboot

Where 00:18:0a:33:44:55 is your MAC address.

This was tested, and confirmed working on both the MR12 and MR16.

Signed-off-by: Chris Blake 
---
 .../linux/ar71xx/files/arch/mips/ath79/mach-mr12.c | 14 +++---
 .../linux/ar71xx/files/arch/mips/ath79/mach-mr16.c | 22 +++---
 target/linux/ar71xx/image/generic.mk   |  4 ++--
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr12.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr12.c
index 12c9a1c..dc880c5 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr12.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr12.c
@@ -42,8 +42,7 @@

 #define MR12_WAN_PHYMASKBIT(4)

-#define MR12_WMAC0_MAC_OFFSET   0x120c
-#define MR12_CALDATA0_OFFSET0x1000
+#define MR12_CALDATA0_OFFSET0x21000

 static struct gpio_led MR12_leds_gpio[] __initdata = {
{
@@ -90,8 +89,9 @@ static struct gpio_keys_button MR12_gpio_keys[] __initdata = {

 static void __init MR12_setup(void)
 {
-   u8 *mac = (u8 *) KSEG1ADDR(0xbfff);
-
+   u8 *mac = (u8 *) KSEG1ADDR(0xbffd);
+   u8 wlan_mac[ETH_ALEN];
+
ath79_register_mdio(0,0x0);

ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
@@ -107,9 +107,9 @@ static void __init MR12_setup(void)
ARRAY_SIZE(MR12_gpio_keys),
MR12_gpio_keys);

-   ap91_pci_init(mac + MR12_CALDATA0_OFFSET,
-   mac + MR12_WMAC0_MAC_OFFSET);
+   ath79_init_mac(wlan_mac, mac, 1);
+   ap91_pci_init(mac + MR12_CALDATA0_OFFSET, wlan_mac);

 }

-MIPS_MACHINE(ATH79_MACH_MR12, "MR12", "Meraki MR12", MR12_setup);
\ No newline at end of file
+MIPS_MACHINE(ATH79_MACH_MR12, "MR12", "Meraki MR12", MR12_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr16.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr16.c
index 9f08e3d..2897ee5 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr16.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr16.c
@@ -42,10 +42,8 @@

 #define MR16_WAN_PHYMASKBIT(0)

-#define MR16_WMAC0_MAC_OFFSET  0x120c
-#define MR16_WMAC1_MAC_OFFSET  0x520c
-#define MR16_CALDATA0_OFFSET   0x1000
-#define MR16_CALDATA1_OFFSET   0x5000
+#define MR16_CALDATA0_OFFSET   0x21000
+#define MR16_CALDATA1_OFFSET   0x25000

 static struct gpio_led MR16_leds_gpio[] __initdata = {
{
@@ -92,8 +90,10 @@ static struct gpio_keys_button MR16_gpio_keys[] __initdata = 
{

 static void __init MR16_setup(void)
 {
-   u8 *mac = (u8 *) KSEG1ADDR(0xbfff);
-
+   u8 *mac = (u8 *) KSEG1ADDR(0xbffd);
+   u8 wlan0_mac[ETH_ALEN];
+   u8 wlan1_mac[ETH_ALEN];
+
ath79_register_mdio(0,0x0);

ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
@@ -109,10 +109,10 @@ static void __init MR16_setup(void)
ARRAY_SIZE(MR16_gpio_keys),
MR16_gpio_keys);

-   ap94_pci_init(mac + MR16_CALDATA0_OFFSET,
-   mac + MR16_WMAC0_MAC_OFFSET,
-   mac + MR16_CALDATA1_OFFSET,
-   mac + MR16_WMAC1_MAC_OFFSET);
+   ath79_init_mac(wlan0_mac, mac, 1);
+   ath79_init_mac(wlan1_mac, mac, 2);
+   ap94_pci_init(mac + MR16_CALDATA0_OFFSET, wlan0_mac,
+   mac + MR16_CALDATA1_OFFSET, wlan1_mac);
 }

-MIPS_MACHINE(ATH79_MACH_MR16, "MR16", "Meraki MR16", MR16_setup);
\ No newline at end of file
+MIPS_MACHINE(ATH79_MACH_MR16, "MR16", "Meraki MR16", MR16_setup);
diff --git a/target/linux/ar71xx/image/generic.mk 
b/target/linux/ar71xx/image/generic.mk
index 04fed88..ee910af 100644
--- a/target/linux/ar71xx/image/generic.mk
+++ b/target/linux/ar71xx/image/generic.mk
@@ -102,7 +102,7 @@ define Device/mr12
   DEVICE_PACKAGES := kmod-spi-gpio
   BOARDNAME = MR12
   IMAGE_SIZE = 15744k
-  MTDPARTS = 
spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x8(firmware)
+  MTDPARTS = 

[LEDE-DEV] [PATCH 1/3 v2] ar71xx: Move MR12 & MR16 from legacy to generic

2016-10-21 Thread Chris Blake
This moves the Meraki MR12 and Meraki MR16 to the new generic target.
Tested and verified working on both devices.

Note that kernel/rootfs images are still generated. This is because they
are used for the inital flashing process due to the fun pace at which
UBoot erases/writes to SPI.

Signed-off-by: Chris Blake 
---
 target/linux/ar71xx/image/generic.mk| 26 ++
 target/linux/ar71xx/image/legacy-devices.mk | 12 
 target/linux/ar71xx/image/legacy.mk |  2 --
 3 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/target/linux/ar71xx/image/generic.mk 
b/target/linux/ar71xx/image/generic.mk
index 192f1a7..04fed88 100644
--- a/target/linux/ar71xx/image/generic.mk
+++ b/target/linux/ar71xx/image/generic.mk
@@ -97,6 +97,32 @@ define Device/gl-mifi
 endef
 TARGET_DEVICES += gl-mifi

+define Device/mr12
+  DEVICE_TITLE := Meraki MR12
+  DEVICE_PACKAGES := kmod-spi-gpio
+  BOARDNAME = MR12
+  IMAGE_SIZE = 15744k
+  MTDPARTS = 
spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x8(firmware)
+  IMAGE/kernel.bin = append-kernel
+  IMAGE/rootfs.bin = append-rootfs | pad-rootfs
+  IMAGE/sysupgrade.bin = append-rootfs | pad-rootfs | pad-to 13440k | 
append-kernel | check-size (IMAGE_SIZE)
+  IMAGES := kernel.bin rootfs.bin sysupgrade.bin
+endef
+TARGET_DEVICES += mr12
+
+define Device/mr16
+  DEVICE_TITLE := Meraki MR16
+  DEVICE_PACKAGES := kmod-spi-gpio
+  BOARDNAME = MR16
+  IMAGE_SIZE = 15744k
+  MTDPARTS = 
spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x8(firmware)
+  IMAGE/kernel.bin = append-kernel
+  IMAGE/rootfs.bin = append-rootfs | pad-rootfs
+  IMAGE/sysupgrade.bin = append-rootfs | pad-rootfs | pad-to 13440k | 
append-kernel | check-size (IMAGE_SIZE)
+  IMAGES := kernel.bin rootfs.bin sysupgrade.bin
+endef
+TARGET_DEVICES += mr16
+
 define Device/dr531
   DEVICE_TITLE := Wallys DR531
   DEVICE_PACKAGES := kmod-usb-core kmod-usb2
diff --git a/target/linux/ar71xx/image/legacy-devices.mk 
b/target/linux/ar71xx/image/legacy-devices.mk
index 2af7598..8522f9e 100644
--- a/target/linux/ar71xx/image/legacy-devices.mk
+++ b/target/linux/ar71xx/image/legacy-devices.mk
@@ -185,18 +185,6 @@ define LegacyDevice/HORNETUBx2
 endef
 LEGACY_DEVICES += HORNETUBx2

-define LegacyDevice/MR12
-  DEVICE_TITLE := Meraki MR12
-  DEVICE_PACKAGES := kmod-spi-gpio
-endef
-LEGACY_DEVICES += MR12
-
-define LegacyDevice/MR16
-  DEVICE_TITLE := Meraki MR16
-  DEVICE_PACKAGES := kmod-spi-gpio
-endef
-LEGACY_DEVICES += MR16
-
 define LegacyDevice/PB92
   DEVICE_TITLE := Atheros PB92 reference board
   DEVICE_PACKAGES := kmod-usb-core kmod-usb2
diff --git a/target/linux/ar71xx/image/legacy.mk 
b/target/linux/ar71xx/image/legacy.mk
index 14de229..5aff130 100644
--- a/target/linux/ar71xx/image/legacy.mk
+++ b/target/linux/ar71xx/image/legacy.mk
@@ -271,8 +271,6 @@ 
ew-dorin_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(fir
 
f9k1115v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),14464k(rootfs),1408k(kernel),64k(nvram)ro,64k(envram)ro,64k(art)ro,15872k@0x5(firmware)
 
dlrtdev_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,640k(certs),960k(unknown)ro,64k@0x7f(caldata_copy)
 
dlrtdev_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7168k(firmware),640k(certs),64k(caldata)ro,64k@0x66(caldata_orig),6208k@0x5(firmware_orig)
-mr12_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x8(firmware)
-mr16_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x8(firmware)
 
pb92_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2752k(rootfs),896k(kernel),64k(nvram),64k(art)ro,3648k@0x5(firmware)
 
planex_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),128k(art)ro
 
ubntxm_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
--
2.7.4

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH 3/3 v2] ar71xx: Remove switch config for the MR12/MR16

2016-10-21 Thread Chris Blake
These boards do not have a switch, so they should have never been added
to this file in the first place.

Signed-off-by: Chris Blake 
---
 .../ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration | 2 --
 1 file changed, 2 deletions(-)

diff --git 
a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration 
b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
index ee8f63b..c6b91b7 100644
--- 
a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
+++ 
b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
@@ -61,8 +61,6 @@ dir-615-c1|\
 dir-615-e1|\
 dir-615-e4|\
 ja76pf|\
-mr-12|\
-mr-16|\
 rb-750|\
 rb-751|\
 tew-632brp|\
--
2.7.4

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] bcm63xx and fxs is possible...

2016-10-21 Thread Eddi De Pieri
Hi,

Here to raise your attention to https://github.com/pgid69/bcm63xx-phone projet.

That gui implemented fxs support for some device already supported by
lede/openwrt.

That module work correctly on my device, but to get it working on
openwrt >12 and lede you need to disable CONFIG_SPI_BCM63XX=n  (or at
least mate it to compile as module)

please can you consider to add this project to the feeds?

Regards

Eddi

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] Add support for TP-Link WR802N v1

2016-10-21 Thread julius+lede
From: Julius Schulz-Zander 

This patch adds support solely for version 1 of the TP-Link WR802N.
It is based on Rick Pannen's patch posted on the OpenWrt devel list.

Signed-off-by: Julius Schulz-Zander 
---
 target/linux/ar71xx/base-files/etc/board.d/01_leds |  3 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |  1 +
 target/linux/ar71xx/base-files/etc/diag.sh |  1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |  6 ++
 .../ar71xx/base-files/lib/upgrade/platform.sh  |  1 +
 target/linux/ar71xx/config-4.4 |  1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  8 ++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |  1 +
 .../ar71xx/files/arch/mips/ath79/mach-tl-wr802n.c  | 98 ++
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |  1 +
 target/linux/ar71xx/image/tp-link.mk   | 10 +++
 target/linux/ar71xx/mikrotik/config-default|  1 +
 12 files changed, 132 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n.c

diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds 
b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index 5011af6..4c7560e 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -510,6 +510,9 @@ archer-c7)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:blue:wlan2g" "phy1tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "tp-link:blue:wlan5g" "phy0tpt"
;;
+tl-wr802n-v1)
+   ucidef_set_led_wlan "wlan" "WLAN" "tp-link:blue:system" "phy0tpt"
+   ;;
 tl-wr941nd-v6)
ucidef_set_led_netdev "wan" "WAN" "tp-link:blue:wan" "eth0"
ucidef_set_led_switch "lan1" "LAN1" "tp-link:blue:lan1" "switch0" "0x10"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index b7b91d0..076a41f 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -106,6 +106,7 @@ ar71xx_setup_interfaces()
tl-wa901nd-v3|\
tl-wa901nd-v4|\
tl-wr703n|\
+   tl-wr802n-v1|\
tube2h|\
unifiac-lite|\
wndap360|\
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index 7a40f44..7b5ae9d 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -348,6 +348,7 @@ get_status_led() {
tl-wr703n|\
tl-wr710n|\
tl-wr720n-v3|\
+   tl-wr802n-v1|\
tl-wr810n|\
tl-wr941nd-v6)
status_led="tp-link:blue:system"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 1492b50..ecd5060 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -217,6 +217,9 @@ tplink_board_detect() {
"080100"*)
model="TP-Link TL-WA801N/ND"
;;
+   "080200"*)
+   model="TP-Link TL-WR802N"
+   ;;
"083000"*)
model="TP-Link TL-WA830RE"
 
@@ -946,6 +949,9 @@ ar71xx_board_detect() {
*"TL-WA801ND v3")
name="tl-wa801nd-v3"
;;
+   *"TL-WR802N v1")
+   name="tl-wr802n-v1"
+   ;;
*TL-WA901ND)
name="tl-wa901nd"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 35e9bb4..07444d7 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -370,6 +370,7 @@ platform_check_image() {
tl-wr720n-v3|\
tl-wr741nd-v4|\
tl-wr741nd|\
+   tl-wr802n-v1|\
tl-wr810n|\
tl-wr841n-v11|\
tl-wr841n-v1|\
diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index 77a5949..928f716 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -169,6 +169,7 @@ CONFIG_ATH79_MACH_TL_WR703N=y
 CONFIG_ATH79_MACH_TL_WR720N_V3=y
 CONFIG_ATH79_MACH_TL_WR741ND=y
 CONFIG_ATH79_MACH_TL_WR741ND_V4=y
+CONFIG_ATH79_MACH_TL_WR802N_V1=y
 CONFIG_ATH79_MACH_TL_WR810N=y
 CONFIG_ATH79_MACH_TL_WR841N_V1=y
 CONFIG_ATH79_MACH_TL_WR841N_V8=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt 
b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index 7c171ee..351e860 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -1374,6 +1374,14 @@ config ATH79_MACH_TL_WR741ND_V4
select ATH79_DEV_USB
select ATH79_DEV_WMAC
 
+config ATH79_MACH_TL_WR802N_V1
+   bool "TP-LINK TL-WR802N v1 support"
+   select SOC_QCA953X
+  

Re: [LEDE-DEV] uqmi: re-enable autoconnect which was dropped without explanation

2016-10-21 Thread Petr Štetiar
Felix Fietkau  [2016-10-20 12:09:36]:

> On 2016-10-19 23:49, Petr Štetiar wrote:
> > 
> > How to fix it for both use cases, with and without autoconnect feature?
> > Introduce qmi_autoconnect config option?
>
> I think we probably need to introduce such an option as a temporary
> measure.

Ok, I'll do this. Is this variable name fine?

> The problem with not using autoconnect is that once the link is gone for a
> while, the link will be torn down and not re-established anymore. To deal
> with that properly, we need some code to monitor the link and try to
> re-establish the connection when it's gone.

Even when enabled and usable, this autoconnect feature is as reliable as the
modem firmware is.  I'm seeing a lot of problems with such modems(freezing,
unable to connect) and I generally do not trust them so I use some additional
checking via my custom wan-connection-keeper daemon/script which runs following
check in periodic intervals:

check_connection() {
local wan_iface=$(uci -q get 
wan-connection-keeper.core.wan_interface)
local check_timeout=$(uci -q get 
wan-connection-keeper.core.check_timeout)
local uci_check_url=$(uci -q get 
wan-connection-keeper.core.uci_check_url)
local url=$(uci -q get $uci_check_url)

[ -z "$url" ] && {
log_dbg "ERROR, check URL is empty"
return 1
}

[ -z "$wan_iface" ] && {
log_dbg "ERROR, WAN interface is empty"
return 1
}

[ -z $check_timeout ] && check_timeout=5

log_dbg "Checking URL: $url timeout: $check_timeout"
curl -s -m$check_timeout -H "User-Agent: $NAME v$VERSION" $url> 
/dev/null && {
log_dbg "Connection check OK!"
return 1
}

log_dbg "ERROR, connection failed, restarting $wan_iface"

echo oneshot > /sys/class/leds/reset-usb-hub2/trigger
echo none > /sys/class/leds/reset-usb-hub2/trigger

ifdown $wan_iface
ubus call network.interface.$wan_iface remove
pkill -9 uqmi
sleep 5
ifup $wan_iface

/etc/init.d/ugps restart # TODO: move somewhere else
 
return 0
}

How to make it more generic as you propose. Move it inside netifd?

config interface 'wan'
option connection_check '/path/to/checkscript'
option connection_check_interval 60

-- ynezz

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCHv2] ipq806x: add support for ZyXEL NBG6817

2016-10-21 Thread Felix Fietkau
On 2016-10-21 09:15, Andre Valentin wrote:
> Hi Felix!
> 
> Am 19.10.2016 um 21:43 schrieb Felix Fietkau:
> thanks for your comments. Please take a look:
>
> Am 18.10.2016 um 08:22 schrieb John Crispin:
>
>>> +++ b/target/linux/ipq806x/base-files/lib/preinit/04_set_mtd_ipq806x.sh
>>> @@ -0,0 +1,21 @@
>>> +#
>>> +# Copyright (C) 2009 OpenWrt.org
>>> +#
>>> +
>>> +. /lib/ipq806x.sh
>>> +. /lib/functions/system.sh
>>> +
>>> +preinit_assign_mtd2block() {
>>> +   case $(ipq806x_board_name) in
>>> +   nbg6817)
>>> +   echo "/dev/mmcblk0p2,64KiB,romd" > 
>>> /sys/module/block2mtd/parameters/block2mtd
>>> +   echo "/dev/mmcblk0p3,64KiB,header" > 
>>> /sys/module/block2mtd/parameters/block2mtd
>>> +   echo "/dev/mmcblk0p4,64KiB,kernel" > 
>>> /sys/module/block2mtd/parameters/block2mtd
>>> +   echo "/dev/mmcblk0p6,64KiB,header_1" > 
>>> /sys/module/block2mtd/parameters/block2mtd
>>> +   echo "/dev/mmcblk0p7,64KiB,kernel_1" > 
>>> /sys/module/block2mtd/parameters/block2mtd
>>> +   echo "/dev/mmcblk0p8,64KiB,rootfs_1" > 
>>> /sys/module/block2mtd/parameters/block2mtd
>>> +   ;;
>>> +   esac
>>> +}
>>> +
>>
>> can this not go into the commandline inside the devicetree ?
> I tried, but block2mtd accepts only one mapping in the command line.
>
> I will rework the patch the next days and send an update.
 Why do we need block2mtd at all for this target?
>>>
>>> The system uses an internal mmc for storage of root fs and other data. I 
>>> saw that the rb532 platform also uses block2mtd for this.
>>> With ubi on top of it, everything including sysupgrade worked nearly out of 
>>> the box. That's why I preferred to use existing parts.
>>> If you have another idea, please tell. For me it's my first mmc based 
>>> platform.
>> MMC is just a block device like any other. Please take a look at octeon,
>> mvebu or x86 as examples of how to do it without block2mtd.
> 
> I have switched rootfs now to squashfs, that ist working. But I have problems 
> with the overlayfs.
> It is on /dev/mmcblk0p1, but I do not understand how to tell the system to 
> use this partition. I cannot find a matching example.
> 
> What I did:
> 1) Added an fstab to the squassh image:
> config 'global'
>   option  anon_swap   '0'
>   option  anon_mount  '0'
>   option  auto_swap   '1'
>   option  auto_mount  '1'
>   option  delay_root  '5'
>   option  check_fs'0'
> 
> config 'mount'
>   option device   '/dev/mmcblk0p1'
>   option enabled '1'
>   option target '/overlay'
>   option fstype 'ext4'
>   option options 'rw,sync'
>   option enabled_fsck 0
>   option is_rootfs '1'
> 
> 2) label the ext4fs rootfs_data
> 3) added rootfs_data=/dev/mmcblk0p1 on kernel commandline.
> 
> But fstools does not mount it.
> Please help.
Don't put overlay mount stuff in the config. Make sure you have
e2fsprogs and mkf2fs enabled in your config and that the rootfs
partition is big enough to fit both the squashfs image and the overlay
filesystem.

- Felix

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] base-files: sysfixtime: Allow system time in local timezones

2016-10-21 Thread Petr Štetiar
Daniel Dickinson  [2016-10-20 16:47:09]:

> On Wed, 19 Oct 2016 22:05:43 +0200
> Petr Štetiar  wrote:
> 
> > Felix Fietkau  [2016-10-19 21:44:06]:
> > 
> > > I'd like to know why you need to use local time for the RTC, I think
> > > that's rather uncommon.  
> > 
> > You mean system time in local time, right? RTC should be in UTC and
> > in current sysftime isn't. Basically sysfixtime should be using
> > hwclock with -u parameter from the same beginning as the kernel
> > doesn't expect time in RTC to be in other timezone.
> > 
> > Believe it or not, I've some users which are used to have system time
> > on their desktop Linux machines in local timezone and they expect the
> > same from the Linux on embedded devices. It's hard, I know :-)
> 
> Have you ever looked at UCI config for /etc/config/system?  There is
> the option to set the system timezone there.  No need to hack hwclock.

I know, that I can't write meaningful commit messages, sorry for that. I'll
try to explain it again.

Please take a look at hwclock, you've to tell it via -u command line option,
that your RTC is keeping time in UTC, otherwise it will happily use whatever
time your system uses and your time is screwed (no time conversion happens).

I've following in the setup script:

  uci set system.@system[0].timezone='CET-1CEST,M3.5.0,M10.5.0/3'
  uci set system.@system[0].zonename='Europe/Prague'

I've this RTC setup:

  rtc-ds1307 3-006f: rtc core: registered mcp7941x as rtc0
  snvs_rtc 20cc000.snvs:snvs-rtc-lp: rtc core: registered 20cc000.snvs:snvs-r 
as rtc1

Then you can experience following (current time is 10:15am):

$ date
Fri Oct 21 10:15:07 CEST 2016

$ hwclock -r -f /dev/rtc0
Fri Oct 21 08:14:46 2016  0.00 seconds

$ hwclock -u -r -f /dev/rtc0
Fri Oct 21 10:14:46 2016  0.00 seconds

And after current borken sysfixtime:

$ /etc/init.d/sysfixtime stop

$ date
Fri Oct 21 10:15:25 CEST 2016

$ hwclock -r -f /dev/rtc0
Fri Oct 21 10:15:31 2016  0.00 seconds

Now you've time in your battery backed RTC in CEST timezone instead of UTC. Is
the problem more clear now?

Again, wbut ith my patched sysfixtime, using hwclock -u parameter:

$ /etc/init.d/sysfixtime stop

$ date
Fri Oct 21 10:15:53 CEST 2016

$ hwclock -r -f /dev/rtc0
Fri Oct 21 08:15:55 2016  0.00 seconds

-- ynezz

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] base-files: sysfixtime: Allow system time in local timezones

2016-10-21 Thread Petr Štetiar
Daniel Dickinson  [2016-10-20 16:49:48]:

Hi,

> I don't see wanting an embedded system to be like a desktop to be a
> reasonable justification.

we're talking here about quadcore i.MX6, 2GB RAM and Vivante GPU.  It's usable
as embedded desktop I would say.

> It doesn't serve any useful purpose that I can see.

As you can see, some people have different use cases.

> Also with there is daylight savings then when daylight savings kicks in
> you've got to change the clock which is *ugly* and waste of resources on an
> embedded device.

I've been using CEST timezone for system time (battery backed RTC in UTC) in
some OpenWRT based projects since 2014.  I'm not aware about any of such
problems and you of course doesn't need to change the clock. It's done
automagically for you.

commit 215c43acc5803e82e249458e9093dba62882ff5d
Author: Petr Štetiar 
Date:   Tue May 27 15:58:40 2014 +0200

base-files: Add hwclock init script

Signed-off-by: Petr Štetiar 

diff --git a/package/base-files/files/etc/init.d/hwclock 
b/package/base-files/files/etc/init.d/hwclock
new file mode 100755
index 000..07eef7e
--- /dev/null
+++ b/package/base-files/files/etc/init.d/hwclock
@@ -0,0 +1,15 @@
+#!/bin/sh /etc/rc.common
+
+START=13
+
+start() {
+   if [ -c /dev/rtc0 ]; then
+   hwclock -u -s -f /dev/rtc0
+   fi
+}
+
+stop() {
+   if [ -c /dev/rtc0 ] ; then
+   hwclock -u -w -f /dev/rtc0
+   fi
+}

-- ynezz

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev