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

2015-11-13 Thread YounJaeRho
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 --- 
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 |   3 +
 target/linux/ramips/base-files/lib/ramips.sh   |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ramips/dts/WF-2881.dts| 129 +
 target/linux/ramips/image/Makefile |   6 +-
 target/linux/ramips/mt7621/config-3.18 |   7 +-
 target/linux/ramips/mt7621/profiles/wf-2881.mk |  18 +++
 9 files changed, 168 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/ramips/dts/WF-2881.dts
 create mode 100644 target/linux/ramips/mt7621/profiles/wf-2881.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..7d2b284 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -264,6 +264,9 @@ zbt-wr8305rt)
 zte-q7)
set_wifi_led "$board:blue:status"
;;
+wf-2881)
+   set_usb_led "netis:green: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 0732796..543512a 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -83,6 +83,7 @@ ramips_setup_interfaces()
wsr-1166|\
wsr-600|\
wt1520|\
+   wf-2881|\
y1)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
ucidef_add_switch "switch0" "1" "1"
diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index 5376759..bf4fec0 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -174,6 +174,9 @@ get_status_led() {
wsr-600)
status_led="$board:orange:diag"
;;
+   wf-2881)
+   status_led="netis:green:wps"
+   ;;
esac
 }
 
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 340bc4c..0273527 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -277,6 +277,9 @@ ramips_board_detect() {
*"NCS601W")
name="ncs601w"
;;
+   *"NETIS WF-2881")
+   name="wf-2881"
+   ;;
*"NW718")
name="nw718"
;;
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..b31aeee
--- /dev/null
+++ b/target/linux/ramips/dts/WF-2881.dts
@@ -0,0 +1,129 @@
+/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 {
+   pinctrl-names = "default";
+   pinctrl-0 = <&state_default>;
+   };
+   };
+
+   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 = "u-boot-env";
+   reg = <0x3 0x1000>;
+   read-only;
+   };
+
+   partition@8 {
+   label 

[OpenWrt-Devel] [PATCH] [ramips] mt7621: fix nand driver

2015-11-13 Thread YounJaeRho
This patch fix mt7621 nand driver for linux-3.18 kernel.mt7621 share PIN 
between NAND,SDXC,SPI.so you should pinctrl in dts file that only one of them 
is used at a time.
SQUASH supportJFFS2 support (no hardware ECC support which is disabled by 
`CONFIG_TARGET_ROOTFS_JFFS2` )

Signed-off-by: YounJae Rho -- 
a/drivers/mtd/nand/mtk_nand.c
+++ b/drivers/mtd/nand/mtk_nand.c
@@ -42,6 +42,9 @@
 #include "bmt.h"
 #include "partition.h"
 
+#define NAND_MAX_OOBSIZE   640
+#define NAND_MAX_PAGESIZE  8192
+
 unsigned int CFG_BLOCKSIZE;
 
 static int shift_on_bbt = 0;
@@ -1422,9 +1425,7 @@ mtk_nand_erase_hw(struct mtd_info *mtd,
 {
struct nand_chip *chip = (struct nand_chip *)mtd->priv;
 
-   chip->erase_cmd(mtd, page);
-
-   return chip->waitfunc(mtd, chip);
+   return chip->erase(mtd, chip);
 }
 
 static int
@@ -2092,7 +2093,11 @@ mtk_nand_probe(struct platform_device *p
 
// For BMT, we need to revise driver architecture
nand_chip->write_page = mtk_nand_write_page;
+   #if defined(CONFIG_TARGET_ROOTFS_JFFS2)
+   nand_chip->ecc.write_oob = NULL;
+   #else
nand_chip->ecc.write_oob = mtk_nand_write_oob;
+   #endif
nand_chip->block_markbad = mtk_nand_block_markbad;   // need to add 
nand_get_device()/nand_release_device().
//  nand_chip->erase = mtk_nand_erase;  
//nand_chip->read_page = mtk_nand_read_page;
@@ -2175,7 +2180,7 @@ mtk_nand_probe(struct platform_device *p
nand_chip->pagemask = (nand_chip->chipsize >> nand_chip->page_shift) - 
1;
nand_chip->phys_erase_shift = ffs(mtd->erasesize) - 1;
nand_chip->chip_shift = ffs(nand_chip->chipsize) - 
1;//0x1C;//ffs(nand_chip->chipsize) - 1;
-   nand_chip->oob_poi = nand_chip->buffers->databuf + mtd->writesize;
+   nand_chip->oob_poi = NULL;
nand_chip->badblockpos = 0;
 
if (devinfo.pagesize == 4096)

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


Re: [OpenWrt-Devel] [PATCH 5/9] ar71xx: PowerCloud CR3000 image generation

2015-11-13 Thread Morandin Fabio
Hello.

 

I have a Powercloud CR3000 and I want to delete the original firmware to
flash firmware without cloud , but I don't know how to do.

Can you please provide me with the operating instructions?

 

Thank.

 

Fabio.

 

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


[OpenWrt-Devel] [PATCH v5] linux: add support of Synopsys ARC770-based boards

2015-11-13 Thread Alexey Brodkin
This patch introduces support of new boards with ARC cores.

 [1] Synopsys SDP board
 This is a new-generation development board from Synopsys that
 consists of base-board and CPU tile-board (which might have a real
 ASIC or FPGA with CPU image).
 It sports a lot of DesignWare peripherals like GMAC, USB, SPI, I2C
 etc and is intended to be used for early development of ARC-based
 products.

 [2] nSIM
 This is a virtual board implemented in Synopsys proprietary
 software simulator (even though available for free for open source
 community). This board has only serial port as a peripheral and so
 it is meant to be used for runtime testing which is especially
 useful during bring-up of new tools and platforms.
 What's also important ARC cores are very configurable so there're
 many variations of options like cache sizes, their line lengths,
 additional hardware blocks like multipliers, dividers etc. And this
 board could be used to make sure built software still runs on
 different HW configurations.

Cc: Felix Fietkau 
Cc: Jo-Philipp Wich 
Cc: Jonas Gorski 
Signed-off-by: Alexey Brodkin 
---
Changes compared to v4:
 * Removed DTS variable from profile descriptions in
   target/linux/arc770/generic/profiles/0x-yyy
 * Reworked board type detection in base-files/lib/arc.sh
   Now looking for a full match of "compatible" property.

Changes compared to v3:
 * Accomodate new KERNEL_INITRAMFS_NAME variable for building .elfs
 * Add and use "model" property in device tree description
 * Remove extra console from kernel command line
 * Use new buildsystem for resulting images
 * Nuked ARC-specific inittab, use default one instead
 * Linux kernel config is passed through "make kernel_oldconfig"
 * eth0 is now LAN instead of WAN

Changes compared to v2:
 * Fixed copyright dates
 * Cleaned-up init scripts

Changes compared to v1:
 * Switched to SoC-centered design. Now instead of common ARC700
   support we claim support of boards based on ARC770D.
   This allows to use the same one build of kernel binary for both
   boards.
 * Implemented run-time scripts that parse Device Tree compatible
   tag and according to it do configuration of serial port and network.
 * Implemented ability to patch in built Linux kernel external .dtb
 * Linux kernel switched from 4.1 to 4.3
 * Rebased on current master

 include/kernel.mk  |   2 +
 target/linux/arc770/Makefile   |  26 +++
 target/linux/arc770/base-files.mk  |   3 +
 .../arc770/base-files/etc/uci-defaults/02_network  |  23 +++
 target/linux/arc770/base-files/lib/arc.sh  |  50 +
 .../base-files/lib/preinit/01_preinit_arc.sh   |   9 +
 target/linux/arc770/config-4.3 | 179 
 target/linux/arc770/dts/axc001.dtsi| 100 +
 target/linux/arc770/dts/axs101.dts |  22 ++
 target/linux/arc770/dts/axs10x_mb.dtsi | 224 +
 target/linux/arc770/dts/nsim_700.dts   |  71 +++
 target/linux/arc770/dts/skeleton.dtsi  |  37 
 target/linux/arc770/generic/profiles/00-default.mk |  16 ++
 target/linux/arc770/generic/profiles/01-minimal.mk |  15 ++
 target/linux/arc770/generic/profiles/02-axs101.mk  |  16 ++
 .../linux/arc770/generic/profiles/03-nsim_700.mk   |  15 ++
 target/linux/arc770/generic/target.mk  |   8 +
 target/linux/arc770/image/Makefile |  40 
 ...openwrt-arc-remove-dependency-on-DEVTMPFS.patch |  36 
 .../0002-openwrt-arc-add-OWRTDTB-section.patch |  91 +
 20 files changed, 983 insertions(+)
 create mode 100644 target/linux/arc770/Makefile
 create mode 100644 target/linux/arc770/base-files.mk
 create mode 100644 target/linux/arc770/base-files/etc/uci-defaults/02_network
 create mode 100644 target/linux/arc770/base-files/lib/arc.sh
 create mode 100644 target/linux/arc770/base-files/lib/preinit/01_preinit_arc.sh
 create mode 100644 target/linux/arc770/config-4.3
 create mode 100644 target/linux/arc770/dts/axc001.dtsi
 create mode 100644 target/linux/arc770/dts/axs101.dts
 create mode 100644 target/linux/arc770/dts/axs10x_mb.dtsi
 create mode 100644 target/linux/arc770/dts/nsim_700.dts
 create mode 100644 target/linux/arc770/dts/skeleton.dtsi
 create mode 100644 target/linux/arc770/generic/profiles/00-default.mk
 create mode 100644 target/linux/arc770/generic/profiles/01-minimal.mk
 create mode 100644 target/linux/arc770/generic/profiles/02-axs101.mk
 create mode 100644 target/linux/arc770/generic/profiles/03-nsim_700.mk
 create mode 100644 target/linux/arc770/generic/target.mk
 create mode 100644 target/linux/arc770/image/Makefile
 create mode 100644 
target/linux/arc770/patches-4.3/0001-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
 create mode 100644 
target/linux/arc770/patches-4.3/0002-openwrt-arc-add-OWRTDTB-section.patch

diff --git a/include/kernel.mk b/in

[OpenWrt-Devel] [PATCH] CC: brcm2708: Add sysupgrade support for Raspberry Pi

2015-11-13 Thread Bruno Randolf
Also create .gz images if configured to do so.

This is equivalent, but different to what we have in trunk, as the image
creation has been rewritten there.

Signed-off-by: Bruno Randolf 
---
 .../brcm2708/base-files/lib/preinit/79_move_config | 18 ++
 .../linux/brcm2708/base-files/lib/upgrade/platform.sh  | 17 +
 target/linux/brcm2708/image/Makefile   |  3 +++
 3 files changed, 38 insertions(+)
 create mode 100644 target/linux/brcm2708/base-files/lib/preinit/79_move_config
 create mode 100644 target/linux/brcm2708/base-files/lib/upgrade/platform.sh

diff --git a/target/linux/brcm2708/base-files/lib/preinit/79_move_config 
b/target/linux/brcm2708/base-files/lib/preinit/79_move_config
new file mode 100644
index 000..7bcea7b
--- /dev/null
+++ b/target/linux/brcm2708/base-files/lib/preinit/79_move_config
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Copyright (C) 2015 OpenWrt.org
+
+BOOTPART=/dev/mmcblk0p1
+
+move_config() {
+   if [ -b $BOOTPART ]; then
+   insmod nls_cp437
+   insmod nls_iso8859-1
+   insmod fat
+   insmod vfat
+   mount -t vfat -o rw,noatime $BOOTPART /mnt
+   [ -f /mnt/sysupgrade.tgz ] && mv -f /mnt/sysupgrade.tgz /
+   umount /mnt
+   fi
+}
+
+boot_hook_add preinit_mount_root move_config
diff --git a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh 
b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
new file mode 100644
index 000..3e1ee00
--- /dev/null
+++ b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
@@ -0,0 +1,17 @@
+platform_check_image() {
+   # i know no way to verify the image
+   return 0;
+}
+
+platform_do_upgrade() {
+   sync
+   get_image "$1" | dd of=/dev/mmcblk0 bs=2M conv=fsync
+   sleep 1
+}
+
+platform_copy_config() {
+   mount -t vfat -o rw,noatime /dev/mmcblk0p1 /mnt
+   cp -af "$CONF_TAR" /mnt/
+   sync
+   umount /mnt
+}
diff --git a/target/linux/brcm2708/image/Makefile 
b/target/linux/brcm2708/image/Makefile
index e70bdd0..633ed88 100644
--- a/target/linux/brcm2708/image/Makefile
+++ b/target/linux/brcm2708/image/Makefile
@@ -28,6 +28,9 @@ define Image/Build/RaspberryPi
mcopy -i $(KDIR)/boot.img $(KDIR)/Image ::kernel.img  # Copy OpenWrt 
built kernel
./gen_rpi_sdcard_img.sh $(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img 
$(KDIR)/boot.img $(KDIR)/root.$(1) \
$(CONFIG_BRCM2708_SD_BOOT_PARTSIZE) 
$(CONFIG_TARGET_ROOTFS_PARTSIZE)
+  ifneq ($(CONFIG_TARGET_IMAGES_GZIP),)
+   gzip -9n -c $(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img > 
$(BIN_DIR)/$(IMG_PREFIX)-sdcard-vfat-$(1).img.gz
+  endif
 endef
 
 define Image/Build
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [CC 15.05] polarssl: Security update (CVE-2015-5291)

2015-11-13 Thread jow
The polarssl package has been rebuilt and was uploaded to the Chaos
Calmer 15.05 repository due to a reported security issue.


VERSION

1.3.12-1 => 1.3.14-1


CHANGELOG

[Sun, 18 Oct 2015 21:48:32 + ed8b245]

Update to version 1.3.14

This fixes CVE-2015-5291 and some other smaller security issues.

[Thu, 15 Oct 2015 22:12:13 + cef3ed6]

Remove trailing whitespaces


CHANGES

 package/libs/polarssl/Makefile|6 +-
 .../polarssl/patches/100-disable_sslv3.patch  |2 +-
 .../polarssl/patches/200-reduce_config.patch  |   50 -
 3 files changed, 29 insertions(+), 29 deletions(-)


REFERENCES

 * https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-5291
 * 
http://git.openwrt.org/?p=15.05/openwrt.git;a=commit;h=cef3ed688e2e7a8521ad386b64849258087f4f9c
 * 
http://git.openwrt.org/?p=15.05/openwrt.git;a=commit;h=ed8b2452a211dc09c85e73f252d8922ee7e2efd0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [CC 15.05] unzip: Security update (2 CVEs)

2015-11-13 Thread jow
The unzip package has been rebuilt and was uploaded to the Chaos Calmer
15.05 repository due to multiple security issues.


VERSION

6.0-2 => 6.0-3


CHANGELOG

[Sun, 1 Nov 2015 16:21:56 +0100 8a70dde]

Patch CVE-2015-7696, CVE-2015-7697 and integer underflow


CHANGES

 utils/unzip/Makefile  |2 +-
 .../005-CVE-2015-7696-heap-overflow.patch |   21 +
 .../006-CVE-2015-7697-infinite-loop.patch |   15 
 ...007-integer-underflow-csiz_decrypted.patch |   21 +
 4 files changed, 58 insertions(+), 1 deletion(-)


REFERENCES

 * https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-7696
 * https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-7697
 * 
https://github.com/openwrt/packages/commit/8a70ddefc782fd955080a6eba2cfc2578d057c6e
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Job opening in Berlin: OpenWRT Developer (m/f)

2015-11-13 Thread Leon Heuser
Hello!

We want to focus even more on public customer WiFi in the future and are
looking for a new developer for our WiFi hotspot systems.

If you love WiFi, OpenWRT and networks and like to tinker with new
technologies, we would like to get to know you. You can find more info
about the job opening on our website:
https://beschuetzerbox.de/wlan-linux-openwrt-entwickler/

If you are just a student looking for an internship or student trainee
position, get in touch with us too.

PS: I hope it's alright I posted in this list.


Best regards,
Leon Heuser
___

*Beschützerbox GmbH*
Katzbachstr. 34
10965 Berlin

Tel.: 030-692 066 258
Fax: 030-692 066 259
E-Mail: l...@beschuetzerbox.de

Internet: www.beschuetzerbox.de 

Geschäftsführer: Leon Heuser
Registergericht: Amtsgericht Charlottenburg
Registernummer: HRB 163551
Steuernummer:  29/103/06327
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/2] imx6: kernel: Add support for Toradex Apalis modules

2015-11-13 Thread Petr Štetiar
Tim Harvey  [2015-11-11 06:28:09]:

> Hi Petr,

Hi,

> I expect those patches to be merged perhaps this week and I think
> you'll find it very easy to use the example of the Wandboard device
> there to create a device for your board that includes APALIS_DTS.

good, thanks. I'll wait for a merge and then rework my patchset.

> The OpenWrt tradition is to add a patch to add yoru dtb's to the
> Makefile (as you have done with archarm/boot/dts/Makefile but to put
> 'added' files into target/linux/imx6/files-4.1/

Ok, noted.

> Also, I would recommend first posting your dts patches to the arm-linux
> maillist first to have them reviewed fully by the experts there before
> adding them to OpenWrt. The benefit other than being reviewed by the proper
> group is that they will also get mainlined and make future maintenance of
> the imx6 target much simpler.

Well, it was my plan to mainline it later, once I'll finish tasks with higher
priorities, but it seems, that it would be better to get it mainlined first.

> I don't know what tree this was cherry-picked from - its certainly not
> mainline linux as there is no IMX6 EP support there.

That cherry picked reference is another branch in Toradex's kernel tree[1].

> Can you explain a bit more what is going on here? Are you saying that
> reset_gpio goes to a switch and a different reset_ep_gpio goes to the
> PCIe device behind the switch?

Yes, exactly.

The Apalis Evaluation Board features the ExpressLane PEX 8605-AB 4-Lane,
4-Port PCI Express Gen2 Switch from PLX. It is used to connect the standard
PCIe interface on the Apalis Module to 2 PCIe x1 connectors and a mini PCIe
slot.

But I don't have this Eval board, I'm using Ixora board where there's only one
Mini PCIe slot, so I can use just reset-gpio and get rid of this patch. I'll
fix it in v2.

Thanks.

1. 
https://git.toradex.com/cgit/linux-toradex.git/commit/?id=94a60e7f645965b1e422e4e80aa8ccb9e0ec845c

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