[OpenWrt-Devel] [RFC/RFT] mtd resetbc: Unify "Linksys" NOR/NAND variants; Add Logging and Error Return

2019-03-21 Thread Jeff Kletsky

In working with porting the dual-firmware, NAND-based Linksys EA8300
to OpenWrt, one of the puzzles was why it wouldn't "take" a change of
boot partition reliably. After digging into it some, I found that when
a previous Linksys device was ported to the ipq40xx platform, the
boot-counter reset was "hard-wired" to 16 bytes, rather than the write
size of the MTD partition. This was likely due to the device booting from
NOR (write size of 1), rather than NAND (typical write size of 2048)
as do most of the other Linksys devices.

As a result, the boot-counter reset failed.


Right now, the choice of action behind `mtd resetbc ` is
made on a platform-wide basis. This is questionable in general, as
what happens when a device with a different boot loader is ported to
one of the impacted architectures in package/system/mtd/src/Makefile ?

* Does the boot-counter reset function belong as an `mtd` operation?

* If so, how will future devices with different needs be accommodated?



Putting those questions aside, I've:


* Unified the "NOR" variant with the rest of the Linksys variants

* Added logging to indicate success and failure

* Provided a meaningful return value for scripting

* "Protected" the use of `mtd resetbc` in start-up scripts so that
  failure does not end the boot sequence


As this would have impact on more devices than just adding the EA8300,
I'm bringing it up now, rather than hiding it away in a device-specific
patch/PR.


I don't have the other impacted devices. I believe that with the
exception of the EA6350v3, all are NAND-based and this should be a
transparent change.

Testing would be greatly appreciated!

* ipq40xx
  * EA8350v3 (NOR boot)

* ipq806x
  * EA8500

* kirkwood
  * audi
  * viper

* mvebu
  * armada-385-linksys-caiman
  * armada-385-linksys-cobra
  * armada-385-linksys-rango
  * armada-385-linksys-shelby
  * armada-385-linksys-venom
  * armada-xp-linksys-mamba


Thanks!

Jeff


See also:





From aa142cb0e7b58e5c22c62be1e95325299e5acc92 Mon Sep 17 00:00:00 2001
From: Jeff Kletsky 
Date: Sat, 16 Mar 2019 16:52:02 -0700
Subject: [PATCH] mtd: Linksys: Add logging and NOR-detection to
 linksys_bootcount.c

---
 package/system/mtd/src/Makefile    |   2 +-
 package/system/mtd/src/linksys_bootcount.c | 113 

 package/system/mtd/src/linksys_bootcount_fix.c | 115 
-

 .../base-files/etc/init.d/zlinksys_recovery    |   2 +-
 .../ipq806x/base-files/etc/init.d/linksys_recovery |   2 +-
 .../base-files/etc/init.d/linksys_recovery |   2 +-
 .../mvebu/base-files/etc/init.d/linksys_recovery   |   2 +-
 7 files changed, 100 insertions(+), 138 deletions(-)
 delete mode 100644 package/system/mtd/src/linksys_bootcount_fix.c

diff --git a/package/system/mtd/src/Makefile 
b/package/system/mtd/src/Makefile

index 08a9fb295d..e469e23ef7 100644
--- a/package/system/mtd/src/Makefile
+++ b/package/system/mtd/src/Makefile
@@ -16,7 +16,7 @@ obj.ramips = $(obj.seama) $(obj.tpl) $(obj.wrg)
 obj.mvebu = linksys_bootcount.o
 obj.kirkwood = linksys_bootcount.o
 obj.ipq806x = linksys_bootcount.o
-obj.ipq40xx = linksys_bootcount_fix.o
+obj.ipq40xx = linksys_bootcount.o

 ifdef FIS_SUPPORT
   obj += fis.o
diff --git a/package/system/mtd/src/linksys_bootcount.c 
b/package/system/mtd/src/linksys_bootcount.c

index 500ede4972..9fb581ee02 100644
--- a/package/system/mtd/src/linksys_bootcount.c
+++ b/package/system/mtd/src/linksys_bootcount.c
@@ -18,6 +18,11 @@
  *
  */

+/*
+ * Portions Copyright (c) 2019, Jeff Kletsky
+ *
+ */
+
 #include 
 #include 
 #include 
@@ -29,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 

 #include 
 #include 
@@ -37,6 +43,30 @@

 #define BOOTCOUNT_MAGIC    0x20110811

+/*
+ * EA6350v3, and potentially other NOR-boot devices,
+ * use an offset increment of 16 between records,
+ * not mtd_info_user.writesize (often 1 on NOR devices).
+ */
+
+#define BC_OFFSET_INCREMENT_MIN 16
+
+
+
+#define DLOG_OPEN()
+
+#define DLOG_ERR(...) do {                           \
+        fprintf(stderr, "ERROR: " __VA_ARGS__); fprintf(stderr, "\n"); \
+    } while (0)
+
+#define DLOG_NOTICE(...) do {                        \
+        fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n");    \
+    } while (0)
+
+#define DLOG_DEBUG(...)
+
+
+
 struct bootcounter {
 uint32_t magic;
 uint32_t count;
@@ -50,25 +80,51 @@ int mtd_resetbc(const char *mtd)
 struct mtd_info_user mtd_info;
 struct bootcounter *curr = (struct bootcounter *)page;
 unsigned int i;
+    unsigned int bc_offset_increment;
 int last_count = 0;
 int num_bc;
 int fd;
 int ret;
+    int retval = 0;
+
+    DLOG_OPEN();

 fd = mtd_check_open(mtd);

 if (ioctl(fd, MEMGETINFO, _info) < 0) {
-        fprintf(stderr, "failed to get mtd info!\n");
-        return -1;
+        DLOG_ERR("Unable to obtain mtd_info for given partition name.");
+
+      

[OpenWrt-Devel] [PATCH] mac80211: Select better ch/VHT for sub-band radios

2019-03-21 Thread Jeff Kletsky
From: Jeff Kletsky 

Certain wireless devices have limitations on the channels
on which they can operate. For some of these devices,
the present default of ch. 36 (VHT80) is outside of the
capabilities of the device.

For 5 GHz, provide a default of the first non-disabled channel
returned by `iw phy $phy info`. For VHT-capable devices,
Select VHT20 if that channel may  not be "clear" for either
VHT40 or VHT80 due to either band edges or DFS restrictions.

Based on hostap src/common/hw_features_common.c

VHT80: 36, 52, 100, 116, 132, 149
VHT40: 44, 60, 108, 124, 140, 157, 165, 184, 192

Adding in band edges, DFS, and limited-use bands reduces this to:

VHT80: 36, 149
VHT40: 44, 157

Runtime-tested: TP-Link Archer C7v2, GL.iNet AR750S
Runtime-tested: Linksys EA8300 (QCA9888; ch. 100 and above only)

Signed-off-by: Jeff Kletsky 
---
 package/kernel/mac80211/files/lib/wifi/mac80211.sh | 42 ++
 1 file changed, 36 insertions(+), 6 deletions(-)
 mode change 100644 => 100755 package/kernel/mac80211/files/lib/wifi/mac80211.sh

diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh 
b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
old mode 100644
new mode 100755
index 511a9188db..368973eea4
--- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
@@ -59,8 +59,12 @@ check_mac80211_device() {
 }
 
 detect_mac80211() {
-   devidx=0
+   local iw_phy_info
+
config_load wireless
+
+   devidx=0
+
while :; do
config_get type "radio$devidx" type
[ -n "$type" ] || break
@@ -81,13 +85,39 @@ detect_mac80211() {
htmode=""
ht_capab=""
 
-   iw phy "$dev" info | grep -q 'Capabilities:' && htmode=HT20
+   iw_phy_info=$( iw phy "${dev}" info )
+
+   echo "${iw_phy_info}" | fgrep -q 'Capabilities:' && htmode=HT20
+
+   if echo "${iw_phy_info}" | egrep -q '(49|5[0-9])[0-9][0-9] MHz' 
; then
 
-   iw phy "$dev" info | grep -q '5180 MHz' && {
mode_band="a"
-   channel="36"
-   iw phy "$dev" info | grep -q 'VHT Capabilities' && 
htmode="VHT80"
-   }
+
+   channel=$( echo "${iw_phy_info}" | \
+   fgrep -v disabled | \
+   sed -Ene 's/^.+ (49|5[0-9])[0-9][0-9] MHz 
\[([1-9][0-9]{1,2})\].*$/\2/p' | \
+   head -n 1 )
+
+   if [ -z "${channel}" ] ; then
+   logger -p warn -t detect_mac80211 \
+   "No enabled channel found in `iw phy 
${dev} info`"
+   fi
+
+   if echo "${iw_phy_info}" | fgrep -q 'VHT Capabilities'
+   then
+   case "$channel" in
+   36 | 149 )
+   htmode="VHT80"
+   ;;
+   44 | 157 )
+   htmode="VHT40"
+   ;;
+   *)
+   htmode="VHT20"
+   ;;
+   esac
+   fi
+   fi  # 5 GHz
 
[ -n "$htmode" ] && ht_capab="set 
wireless.radio${devidx}.htmode=$htmode"
 
-- 
2.11.0


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


Re: [OpenWrt-Devel] [PATCH 2/2] mvebu: Add kmod-i2c-mux-pca954x

2019-03-21 Thread Tomasz Maciej Nowak
W dniu 21.03.2019 o 19:02, Hauke Mehrtens pisze:
> On 3/21/19 6:25 PM, Tomasz Maciej Nowak wrote:
>> Hi Hauke,
>>
>> W dniu 21.03.2019 o 17:57, Hauke Mehrtens pisze:
>>> This driver is needed for the I2C mux on the board.
>>
>> This symbol CONFIG_I2C_MUX_PCA954x is in 
>> target/linux/mvebu/cortexa72/config-default so it should be also deleted in 
>> this patch.
> 
> Thanks for spotting this, I had the kernel 4.19 patches already applied
> and they removed this kernel configuration option.
> 
> I think we can ignore this patch and we use the compiled in version.

On the contrary, when I checked now, this symbol got removed in the final 
kernel configuration, probably because CONFIG_I2C_MUX is not enabled.
So Your patch is still needed or new one needs to be created to enable 
CONFIG_I2C_MUX symbol and its dependencies.

Regards

-- 
TMN

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


[OpenWrt-Devel] [PATCH 6/7] mvebu: espressobin: add node for eMMC in dts

2019-03-21 Thread Tomasz Maciej Nowak
Some ESPRESSObin boards come with soldered eMMC flash, backport upstream
patches adding this device and add patch to sync sdhci nodes order with
U-Boot.

Signed-off-by: Tomasz Maciej Nowak 
---
 ...l-armada37xx-Add-emmc-sdio-pinctrl-d.patch |  40 +++
 ...l-armada-37xx-Enable-emmc-on-espress.patch |  49 
 ...da-3720-espressobin-correct-spi-node.patch |   2 +-
 ...x-re-arrange-SDHCI-controllers-order.patch | 105 ++
 4 files changed, 195 insertions(+), 1 deletion(-)
 create mode 100644 
target/linux/mvebu/patches-4.14/513-arm64-dts-marvell-armada37xx-Add-emmc-sdio-pinctrl-d.patch
 create mode 100644 
target/linux/mvebu/patches-4.14/514-arm64-dts-marvell-armada-37xx-Enable-emmc-on-espress.patch
 create mode 100644 
target/linux/mvebu/patches-4.14/522-arm64-dts-a37xx-re-arrange-SDHCI-controllers-order.patch

diff --git 
a/target/linux/mvebu/patches-4.14/513-arm64-dts-marvell-armada37xx-Add-emmc-sdio-pinctrl-d.patch
 
b/target/linux/mvebu/patches-4.14/513-arm64-dts-marvell-armada37xx-Add-emmc-sdio-pinctrl-d.patch
new file mode 100644
index 00..19702a61ed
--- /dev/null
+++ 
b/target/linux/mvebu/patches-4.14/513-arm64-dts-marvell-armada37xx-Add-emmc-sdio-pinctrl-d.patch
@@ -0,0 +1,40 @@
+From eefe328439642101774f0f5c4ea0dc6ba1cfb687 Mon Sep 17 00:00:00 2001
+From: Ding Tao 
+Date: Fri, 26 Oct 2018 11:50:27 +
+Subject: [PATCH] arm64: dts: marvell: armada37xx: Add emmc/sdio pinctrl
+ definition
+
+Add emmc/sdio pinctrl definition for marvell armada37xx SoCs.
+
+Signed-off-by: Ding Tao 
+Signed-off-by: Gregory CLEMENT 
+---
+ arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 10 ++
+ 1 file changed, 10 insertions(+)
+
+--- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
 b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
+@@ -218,6 +218,11 @@
+   groups = "uart2";
+   function = "uart";
+   };
++
++  mmc_pins: mmc-pins {
++  groups = "emmc_nb";
++  function = "emmc";
++  };
+   };
+ 
+   nb_pm: syscon@14000 {
+@@ -247,6 +252,11 @@
+   function = "mii";
+   };
+ 
++  sdio_pins: sdio-pins {
++  groups = "sdio_sb";
++  function = "sdio";
++  };
++
+   };
+ 
+   eth0: ethernet@3 {
diff --git 
a/target/linux/mvebu/patches-4.14/514-arm64-dts-marvell-armada-37xx-Enable-emmc-on-espress.patch
 
b/target/linux/mvebu/patches-4.14/514-arm64-dts-marvell-armada-37xx-Enable-emmc-on-espress.patch
new file mode 100644
index 00..26d090f050
--- /dev/null
+++ 
b/target/linux/mvebu/patches-4.14/514-arm64-dts-marvell-armada-37xx-Enable-emmc-on-espress.patch
@@ -0,0 +1,49 @@
+From 43ebc7c1b3ed8198b9acf3019eca16e722f7331c Mon Sep 17 00:00:00 2001
+From: Ding Tao 
+Date: Fri, 26 Oct 2018 11:50:28 +
+Subject: [PATCH] arm64: dts: marvell: armada-37xx: Enable emmc on espressobin
+
+The ESPRESSObin board has a emmc interface available on U11: declare it
+and let the bootloader enable it if the emmc is present.
+
+[gregory.clem...@bootlin.com: disable the emmc by default]
+Signed-off-by: Ding Tao 
+Signed-off-by: Gregory CLEMENT 
+---
+ .../dts/marvell/armada-3720-espressobin.dts   | 22 +++
+ 1 file changed, 22 insertions(+)
+
+--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
 b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
+@@ -93,9 +93,31 @@
+   cd-gpios = < 3 GPIO_ACTIVE_LOW>;
+   marvell,pad-type = "sd";
+   vqmmc-supply = <_sd_reg1>;
++
++  pinctrl-names = "default";
++  pinctrl-0 = <_pins>;
+   status = "okay";
+ };
+ 
++/* U11 */
++ {
++  non-removable;
++  bus-width = <8>;
++  mmc-ddr-1_8v;
++  mmc-hs400-1_8v;
++  marvell,xenon-emmc;
++  marvell,xenon-tun-count = <9>;
++  marvell,pad-type = "fixed-1-8v";
++
++  pinctrl-names = "default";
++  pinctrl-0 = <_pins>;
++/*
++ * This eMMC is not populated on all boards, so disable it by
++ * default and let the bootloader enable it, if it is present
++ */
++  status = "disabled";
++};
++
+  {
+   status = "okay";
+ 
diff --git 
a/target/linux/mvebu/patches-4.14/521-arm64-dts-armada-3720-espressobin-correct-spi-node.patch
 
b/target/linux/mvebu/patches-4.14/521-arm64-dts-armada-3720-espressobin-correct-spi-node.patch
index 1d2bdfca75..fc7cb2af1e 100644
--- 
a/target/linux/mvebu/patches-4.14/521-arm64-dts-armada-3720-espressobin-correct-spi-node.patch
+++ 
b/target/linux/mvebu/patches-4.14/521-arm64-dts-armada-3720-espressobin-correct-spi-node.patch
@@ -29,7 +29,7 @@ Signed-off-by: Tomasz Maciej Nowak 
 
 --- 

[OpenWrt-Devel] [PATCH 5/7] mvebu: sysupgrade: sdcard: keep user added partitons

2019-03-21 Thread Tomasz Maciej Nowak
Currently sysupgrade overwrites whole disk and destroys partitions added
by user. Sync the sysupgrade code with the one present in x86 target to
remedy this behaviour.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../mvebu/base-files/lib/upgrade/platform.sh  |  9 ++-
 .../mvebu/base-files/lib/upgrade/sdcard.sh| 74 +--
 target/linux/mvebu/cortexa53/target.mk|  2 +-
 target/linux/mvebu/cortexa72/target.mk|  2 +-
 target/linux/mvebu/image/cortex-a9.mk |  7 +-
 5 files changed, 83 insertions(+), 11 deletions(-)

diff --git a/target/linux/mvebu/base-files/lib/upgrade/platform.sh 
b/target/linux/mvebu/base-files/lib/upgrade/platform.sh
index e4ccf9d7f2..57b2f00a4c 100755
--- a/target/linux/mvebu/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mvebu/base-files/lib/upgrade/platform.sh
@@ -8,7 +8,14 @@ RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
 REQUIRE_IMAGE_METADATA=1
 
 platform_check_image() {
-   return 0
+   case "$(board_name)" in
+   
armada-385-turris-omnia|armada-388-clearfog-base|armada-388-clearfog-pro|globalscale,espressobin|marvell,armada8040-mcbin)
+   platform_check_image_sdcard "$ARGV"
+   ;;
+   *)
+   return 0
+   ;;
+   esac
 }
 
 platform_do_upgrade() {
diff --git a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh 
b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh
index 7aa91f463c..28fad31757 100644
--- a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh
+++ b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh
@@ -6,7 +6,7 @@ get_magic_at() {
 
 platform_check_image_sdcard() {
local file="$1"
-   local magic
+   local magic diskdev partdev diff
 
magic=$(get_magic_at "$file" 510)
[ "$magic" != "55aa" ] && {
@@ -14,18 +14,82 @@ platform_check_image_sdcard() {
return 1
}
 
-   return 0;
+   export_bootdevice && export_partdevice diskdev 0 || {
+   echo "Unable to determine upgrade device"
+   return 1
+   }
+
+   get_partitions "/dev/$diskdev" bootdisk
+
+   #extract the boot sector from the image
+   get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b 2>/dev/null
+
+   get_partitions /tmp/image.bs image
+
+   #compare tables
+   diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)"
+
+   rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image
+
+   if [ -n "$diff" ]; then
+   echo "Partition layout has changed. Full image will be written."
+   ask_bool 0 "Abort" && exit 1
+   return 0
+   fi
 }
 
 platform_do_upgrade_sdcard() {
local board=$(board_name)
-   local diskdev
+   local diskdev partdev diff
+
+   export_bootdevice && export_partdevice diskdev 0 || {
+   echo "Unable to determine upgrade device"
+   return 1
+   }
 
sync
-   if export_bootdevice && export_partdevice diskdev 0; then
-   get_image "$1" | dd of=/dev/$diskdev bs=2M conv=fsync
+
+   if [ "$SAVE_PARTITIONS" = "1" ]; then
+   get_partitions "/dev/$diskdev" bootdisk
+
+   #extract the boot sector from the image
+   get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b
+
+   get_partitions /tmp/image.bs image
+
+   #compare tables
+   diff="$(grep -F -x -v -f /tmp/partmap.bootdisk 
/tmp/partmap.image)"
+   else
+   diff=1
+   fi
+
+   if [ -n "$diff" ]; then
+   get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync
+
+   # Separate removal and addtion is necessary; otherwise, 
partition 1
+   # will be missing if it overlaps with the old partition 2
+   partx -d - "/dev/$diskdev"
+   partx -a - "/dev/$diskdev"
+
+   return 0
fi
 
+   #write uboot image
+   get_image "$@" | dd of="$diskdev" bs=512 skip=1 seek=1 count=2048 
conv=fsync
+   #iterate over each partition from the image and write it to the boot 
disk
+   while read part start size; do
+   if export_partdevice partdev $part; then
+   echo "Writing image to /dev/$partdev..."
+   get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M 
skip="$start" count="$size" conv=fsync
+   else
+   echo "Unable to find partition $part device, skipped."
+   fi
+   done < /tmp/partmap.image
+
+   #copy partition uuid
+   echo "Writing new UUID to /dev/$diskdev..."
+   get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 
conv=fsync
+
case "$board" in
armada-385-turris-omnia)
fw_setenv openwrt_bootargs 'earlyprintk console=ttyS0,115200 
root=/dev/mmcblk0p2 rootfstype=auto rootwait'
diff --git a/target/linux/mvebu/cortexa53/target.mk 

[OpenWrt-Devel] [PATCH 7/7] mvebu: espressobin: add u-boot environment

2019-03-21 Thread Tomasz Maciej Nowak
This commit adds U-Boot environment defaults which extend the
bootloader to automatically boot the ESPRESSObin board from other
connected mediums i.e. SATA disk or USB disk.
The assigned boot probe order is as follows:
1. USB (usb0), 2. SATA (scsi0), 3. µSD (mmc0), 4. eMMC (mmc1).
U-Boot will iterate through them utill it'll find on one of devices the
uEnv.txt file. If not found, it'll fall back to loading using boot.scr
(loading from boot.scr is compatible only with U-Boot version 2017.03 or
later). There is also self update mechanism implemented which will
trigger if the variable 'owrt_uenv_ver' is changed.
This commit also adds compatibility with newer U-Boot versions in which
kernel_addr and fdt_addr environment variables changed names to
kernel_addr_r and fdt_addr_r.

The bootloader environment preparation needs to be done for every new
deployment and for every board with U-Boot 2015.01 version.
1. Connect/insert boot device with OpenWrt,
2. Power on the board and enter U-Boot command line,
3. Execute following commands:
usb start
scsi scan
ext4load mmc 0:1 $loadaddr uEnv.txt || ext4load scsi 0:1 $loadaddr uEnv.txt 
|| ext4load usb 0:1 $loadaddr uEnv.txt
env import -t $loadaddr
env delete $old_or_temp_vars
saveenv
reset
4. Now board should automatically find boot medium with OpenWrt
   installation and boot it.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/mvebu/image/Makefile | 10 
 target/linux/mvebu/image/cortex-a53.mk|  2 +-
 .../image/globalscale-espressobin.bootscript  | 14 ---
 .../mvebu/image/globalscale-espressobin.uenv  | 25 +++
 4 files changed, 47 insertions(+), 4 deletions(-)
 create mode 100644 target/linux/mvebu/image/globalscale-espressobin.uenv

diff --git a/target/linux/mvebu/image/Makefile 
b/target/linux/mvebu/image/Makefile
index 88790777d9..126136dc6a 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -26,6 +26,15 @@ define Build/boot-scr
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d 
$@-new.bootscript $@-boot.scr
 endef
 
+define Build/uenv-txt
+   rm -f $@-uEnv.txt
+   sed \
+   -e 's#@ROOT@#$(SIGNATURE)#g' \
+   -e 's#@DTB@#$(DEVICE_DTS)#g' \
+   -e 's#@KERNEL@#$(KERNEL_NAME)#g' \
+   $(DEVICE_NAME).uenv > $@-uEnv.txt
+endef
+
 define Build/boot-img
rm -f $@.boot
mkfs.fat -C $@.boot $$(( $(CONFIG_TARGET_KERNEL_PARTSIZE) * 1024 ))
@@ -40,6 +49,7 @@ define Build/boot-img-ext4
$(foreach dts,$(DEVICE_DTS), $(CP) $(DTS_DIR)/$(dts).dtb $@.boot;)
$(CP) $(IMAGE_KERNEL) $@.boot/$(KERNEL_NAME)
-$(CP) $@-boot.scr $@.boot/boot.scr
+   -$(CP) $@-uEnv.txt $@.boot/uEnv.txt
make_ext4fs -J -l $(CONFIG_TARGET_KERNEL_PARTSIZE)M $@.bootimg $@.boot
 endef
 
diff --git a/target/linux/mvebu/image/cortex-a53.mk 
b/target/linux/mvebu/image/cortex-a53.mk
index dd6176100b..338c29c7f9 100644
--- a/target/linux/mvebu/image/cortex-a53.mk
+++ b/target/linux/mvebu/image/cortex-a53.mk
@@ -5,7 +5,7 @@ define Device/globalscale-espressobin
   KERNEL := kernel-bin
   DEVICE_TITLE := ESPRESSObin (Marvell Armada 3700 Community Board)
   IMAGES := sdcard.img.gz
-  IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | 
append-metadata
+  IMAGE/sdcard.img.gz := uenv-txt | boot-scr | boot-img-ext4 | sdcard-img-ext4 
| gzip | append-metadata
   DEVICE_DTS := armada-3720-espressobin
   DTS_DIR := $(DTS_DIR)/marvell
   SUPPORTED_DEVICES := globalscale,espressobin
diff --git a/target/linux/mvebu/image/globalscale-espressobin.bootscript 
b/target/linux/mvebu/image/globalscale-espressobin.bootscript
index 0d03ac8513..d2a9653613 100644
--- a/target/linux/mvebu/image/globalscale-espressobin.bootscript
+++ b/target/linux/mvebu/image/globalscale-espressobin.bootscript
@@ -1,10 +1,18 @@
+if test -z "${owrt_uenv_ver}"; then
+   load mmc 0:1 ${loadaddr} uEnv.txt
+   env import -t ${loadaddr}
+   env delete ${old_or_temp_vars}
+   saveenv
+   boot
+fi
+
 setenv bootargs "root=PARTUUID=@ROOT@-02 rw rootwait"
 
 if test -n "${console}"; then
setenv bootargs "${bootargs} ${console}"
 fi
 
-load mmc 0:1 ${fdt_addr} armada-3720-espressobin.dtb
-load mmc 0:1 ${kernel_addr} Image
+load mmc 0:1 ${fdt_addr}${fdt_addr_r} armada-3720-espressobin.dtb
+load mmc 0:1 ${kernel_addr}${kernel_addr_r} Image
 
-booti ${kernel_addr} - ${fdt_addr}
+booti ${kernel_addr}${kernel_addr_r} - ${fdt_addr}${fdt_addr_r}
diff --git a/target/linux/mvebu/image/globalscale-espressobin.uenv 
b/target/linux/mvebu/image/globalscale-espressobin.uenv
new file mode 100644
index 00..986db9884b
--- /dev/null
+++ b/target/linux/mvebu/image/globalscale-espressobin.uenv
@@ -0,0 +1,25 @@
+owrt_uenv_ver=1
+old_or_temp_vars=devnum devtype fileaddr filesize root uenv_ver 
old_or_temp_vars
+boot_a_script=ext4load ${devtype} ${devnum}:${distro_bootpart} ${loadaddr} 

[OpenWrt-Devel] [PATCH 4/7] mvebu: base-files: autodetect upgrade device

2019-03-21 Thread Tomasz Maciej Nowak
Since some boards could be also booted from other mediums than SD card,
lets make the upgrade block device autodetected.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../base-files/lib/preinit/79_move_config |  9 +
 .../mvebu/base-files/lib/upgrade/sdcard.sh| 19 +--
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/target/linux/mvebu/base-files/lib/preinit/79_move_config 
b/target/linux/mvebu/base-files/lib/preinit/79_move_config
index 73ddf09155..64c0cc0eea 100644
--- a/target/linux/mvebu/base-files/lib/preinit/79_move_config
+++ b/target/linux/mvebu/base-files/lib/preinit/79_move_config
@@ -1,12 +1,13 @@
 #!/bin/sh
 # Copyright (C) 2015 OpenWrt.org
 
-BOOTPART=/dev/mmcblk0p1
-
 . /lib/functions.sh
+. /lib/upgrade/common.sh
 
 move_config() {
-   if [ -b $BOOTPART ]; then
+   local partdev
+
+   if export_bootdevice && export_partdevice partdev 1; then
case $(board_name) in
turris-omnia)
insmod nls_cp437
@@ -16,7 +17,7 @@ move_config() {
;;
esac
mkdir -p /boot
-   mount -o rw,noatime $BOOTPART /boot
+   mount -o rw,noatime "/dev/$partdev" /boot
[ -f /boot/sysupgrade.tgz ] && mv -f /boot/sysupgrade.tgz /
umount /boot
fi
diff --git a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh 
b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh
index a05df834ba..7aa91f463c 100644
--- a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh
+++ b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh
@@ -19,9 +19,12 @@ platform_check_image_sdcard() {
 
 platform_do_upgrade_sdcard() {
local board=$(board_name)
+   local diskdev
 
sync
-   get_image "$1" | dd of=/dev/mmcblk0 bs=2M conv=fsync
+   if export_bootdevice && export_partdevice diskdev 0; then
+   get_image "$1" | dd of=/dev/$diskdev bs=2M conv=fsync
+   fi
 
case "$board" in
armada-385-turris-omnia)
@@ -36,9 +39,13 @@ platform_do_upgrade_sdcard() {
 }
 
 platform_copy_config_sdcard() {
-   mkdir -p /boot
-   [ -f /boot/kernel.img ] || mount -o rw,noatime /dev/mmcblk0p1 /boot
-   cp -af "$CONF_TAR" /boot/
-   sync
-   umount /boot
+   local partdev
+
+   if export_partdevice partdev 1; then
+   mkdir -p /boot
+   [ -f /boot/kernel.img ] || mount -o rw,noatime /dev/$partdev 
/boot
+   cp -af "$CONF_TAR" /boot/
+   sync
+   umount /boot
+   fi
 }
-- 
2.21.0


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


[OpenWrt-Devel] [PATCH 2/7] mvebu: use ext4 for clearfog image bootfs

2019-03-21 Thread Tomasz Maciej Nowak
This will allow to drop additional packages and in result shrink image
size.

Cc: Jonas Gorski 
Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/mvebu/image/cortex-a9.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/mvebu/image/cortex-a9.mk 
b/target/linux/mvebu/image/cortex-a9.mk
index 79c3bc7bdb..610ce36cd7 100644
--- a/target/linux/mvebu/image/cortex-a9.mk
+++ b/target/linux/mvebu/image/cortex-a9.mk
@@ -128,7 +128,7 @@ define Device/armada-388-clearfog-pro
   DEVICE_TITLE := SolidRun ClearFog Pro
   DEVICE_PACKAGES := mkf2fs e2fsprogs swconfig kmod-fs-vfat kmod-nls-cp437 
kmod-nls-iso8859-1
   IMAGES := sdcard.img.gz
-  IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip | 
append-metadata
+  IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | 
append-metadata
   DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base
   SUPPORTED_DEVICES := armada-388-clearfog-pro armada-388-clearfog
   UBOOT := clearfog-u-boot-spl.kwb
@@ -141,7 +141,7 @@ define Device/armada-388-clearfog-base
   DEVICE_TITLE := SolidRun ClearFog Base
   DEVICE_PACKAGES := mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 
kmod-nls-iso8859-1
   IMAGES := sdcard.img.gz
-  IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip | 
append-metadata
+  IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | 
append-metadata
   DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base
   UBOOT := clearfog-u-boot-spl.kwb
 endef
-- 
2.21.0


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


[OpenWrt-Devel] [PATCH 1/7] mvebu: make bootfs size for sdcard image configurable

2019-03-21 Thread Tomasz Maciej Nowak
Let's take this oportunity to implement boot-part and rootfs-part feature
flags.

Signed-off-by: Tomasz Maciej Nowak 
---
 config/Config-images.in   |  2 +-
 target/linux/mvebu/Makefile   |  2 +-
 target/linux/mvebu/image/Makefile | 16 ++--
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/config/Config-images.in b/config/Config-images.in
index 6610601d55..9daaf74915 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -272,7 +272,7 @@ menu "Target Images"
 
config TARGET_ROOTFS_PARTSIZE
int "Root filesystem partition size (in MB)"
-   depends on GRUB_IMAGES || USES_ROOTFS_PART || 
TARGET_ROOTFS_EXT4FS || TARGET_mvebu || TARGET_omap || TARGET_rb532 || 
TARGET_sunxi || TARGET_uml
+   depends on GRUB_IMAGES || USES_ROOTFS_PART || 
TARGET_ROOTFS_EXT4FS || TARGET_omap || TARGET_rb532 || TARGET_sunxi || 
TARGET_uml
default 256
help
  Select the root filesystem partition size.
diff --git a/target/linux/mvebu/Makefile b/target/linux/mvebu/Makefile
index ee76c0b776..a920f6db7d 100644
--- a/target/linux/mvebu/Makefile
+++ b/target/linux/mvebu/Makefile
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 BOARD:=mvebu
 BOARDNAME:=Marvell EBU Armada
-FEATURES:=fpu usb pci pcie gpio nand squashfs ramdisk
+FEATURES:=fpu usb pci pcie gpio nand squashfs ramdisk boot-part rootfs-part
 SUBTARGETS:=cortexa9 cortexa53 cortexa72
 MAINTAINER:=Imre Kaloz 
 
diff --git a/target/linux/mvebu/image/Makefile 
b/target/linux/mvebu/image/Makefile
index be01623e86..88790777d9 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -19,12 +19,6 @@ define Build/dtb
$(call Image/BuildDTB,$(DTS_DIR)/$(DEVICE_DTS).dts,$@.dtb)
 endef
 
-# SD-Card Images:
-# these values are optimized for a 4GB labeled sdcard that actually holds 
7744512 sectors of 512 byte
-# MBR:2048 sectors
-# Partition 1:   32768 sectors
-# Partition 2:   98304 sectors (configurable)
-
 define Build/boot-scr
rm -f $@-boot.scr
sed -e 's#@ROOT@#$(SIGNATURE)#g' \
@@ -34,7 +28,7 @@ endef
 
 define Build/boot-img
rm -f $@.boot
-   mkfs.fat -C $@.boot 16384
+   mkfs.fat -C $@.boot $$(( $(CONFIG_TARGET_KERNEL_PARTSIZE) * 1024 ))
$(foreach dts,$(DEVICE_DTS), mcopy -i $@.boot $(DTS_DIR)/$(dts).dtb 
::$(dts).dtb;)
mcopy -i $@.boot $(IMAGE_KERNEL) ::$(KERNEL_NAME)
-mcopy -i $@.boot $@-boot.scr ::boot.scr
@@ -46,26 +40,28 @@ define Build/boot-img-ext4
$(foreach dts,$(DEVICE_DTS), $(CP) $(DTS_DIR)/$(dts).dtb $@.boot;)
$(CP) $(IMAGE_KERNEL) $@.boot/$(KERNEL_NAME)
-$(CP) $@-boot.scr $@.boot/boot.scr
-   make_ext4fs -J -l 16384K $@.bootimg $@.boot
+   make_ext4fs -J -l $(CONFIG_TARGET_KERNEL_PARTSIZE)M $@.bootimg $@.boot
 endef
 
 define Build/sdcard-img
if [ -n "$(UBOOT)" ]; then UBOOT="$(STAGING_DIR_IMAGE)/$(UBOOT)"; fi; \
+   BOOTFS_SIZE=$$(( $(CONFIG_TARGET_KERNEL_PARTSIZE) * 1024 * 2 )); \
ROOTFS_SIZE=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2 )); \
SIGNATURE="$(SIGNATURE)" \
./gen_mvebu_sdcard_img.sh $@ \
$$UBOOT \
-   c 32768 $@.boot \
+   c $$BOOTFS_SIZE $@.boot \
83 $$ROOTFS_SIZE $(IMAGE_ROOTFS)
 endef
 
 define Build/sdcard-img-ext4
if [ -n "$(UBOOT)" ]; then UBOOT="$(STAGING_DIR_IMAGE)/$(UBOOT)"; fi; \
+   BOOTFS_SIZE=$$(( $(CONFIG_TARGET_KERNEL_PARTSIZE) * 1024 * 2 )); \
ROOTFS_SIZE=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2 )); \
SIGNATURE="$(SIGNATURE)" \
./gen_mvebu_sdcard_img.sh $@ \
$$UBOOT \
-   83 32768 $@.bootimg \
+   83 $$BOOTFS_SIZE $@.bootimg \
83 $$ROOTFS_SIZE $(IMAGE_ROOTFS)
 endef
 
-- 
2.21.0


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


[OpenWrt-Devel] [PATCH 3/7] mvebu: shrink amount of packages and reorganize them

2019-03-21 Thread Tomasz Maciej Nowak
Since most of devices using SD card image to boot, use ext4 as boot
files system we can drop fat fs related packages. Also move packages
which are added repeatedly across subtargets to their default packages,
with droping the ones that are enabled in target kernel configugation.

Signed-off-by: Tomasz Maciej Nowak 
---
 .../mvebu/base-files/lib/preinit/79_move_config| 14 ++
 target/linux/mvebu/cortexa53/target.mk |  1 +
 target/linux/mvebu/cortexa72/target.mk |  1 +
 target/linux/mvebu/image/cortex-a53.mk |  2 --
 target/linux/mvebu/image/cortex-a72.mk |  3 ---
 target/linux/mvebu/image/cortex-a9.mk  |  4 ++--
 6 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/target/linux/mvebu/base-files/lib/preinit/79_move_config 
b/target/linux/mvebu/base-files/lib/preinit/79_move_config
index 1735ad8849..73ddf09155 100644
--- a/target/linux/mvebu/base-files/lib/preinit/79_move_config
+++ b/target/linux/mvebu/base-files/lib/preinit/79_move_config
@@ -3,12 +3,18 @@
 
 BOOTPART=/dev/mmcblk0p1
 
+. /lib/functions.sh
+
 move_config() {
if [ -b $BOOTPART ]; then
-   insmod nls_cp437
-   insmod nls_iso8859-1
-   insmod fat
-   insmod vfat
+   case $(board_name) in
+   turris-omnia)
+   insmod nls_cp437
+   insmod nls_iso8859-1
+   insmod fat
+   insmod vfat
+   ;;
+   esac
mkdir -p /boot
mount -o rw,noatime $BOOTPART /boot
[ -f /boot/sysupgrade.tgz ] && mv -f /boot/sysupgrade.tgz /
diff --git a/target/linux/mvebu/cortexa53/target.mk 
b/target/linux/mvebu/cortexa53/target.mk
index acc18d3454..d420fd9f59 100644
--- a/target/linux/mvebu/cortexa53/target.mk
+++ b/target/linux/mvebu/cortexa53/target.mk
@@ -11,5 +11,6 @@ ARCH:=aarch64
 BOARDNAME:=Marvell Armada 3700LP (ARM64)
 CPU_TYPE:=cortex-a53
 FEATURES+=ext4
+DEFAULT_PACKAGES+=e2fsprogs ethtool mkf2fs
 
 KERNELNAME:=Image dtbs
diff --git a/target/linux/mvebu/cortexa72/target.mk 
b/target/linux/mvebu/cortexa72/target.mk
index 670c402a56..a9384f3fa6 100644
--- a/target/linux/mvebu/cortexa72/target.mk
+++ b/target/linux/mvebu/cortexa72/target.mk
@@ -11,5 +11,6 @@ ARCH:=aarch64
 BOARDNAME:=Marvell Armada 7k/8k (ARM64)
 CPU_TYPE:=cortex-a72
 FEATURES+=ext4
+DEFAULT_PACKAGES+=e2fsprogs ethtool mkf2fs
 
 KERNELNAME:=Image dtbs
diff --git a/target/linux/mvebu/image/cortex-a53.mk 
b/target/linux/mvebu/image/cortex-a53.mk
index 89c3363448..dd6176100b 100644
--- a/target/linux/mvebu/image/cortex-a53.mk
+++ b/target/linux/mvebu/image/cortex-a53.mk
@@ -4,7 +4,6 @@ define Device/globalscale-espressobin
   KERNEL_NAME := Image
   KERNEL := kernel-bin
   DEVICE_TITLE := ESPRESSObin (Marvell Armada 3700 Community Board)
-  DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-usb2 kmod-usb3 
kmod-usb-storage
   IMAGES := sdcard.img.gz
   IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | 
append-metadata
   DEVICE_DTS := armada-3720-espressobin
@@ -17,7 +16,6 @@ define Device/armada-3720-db
   KERNEL_NAME := Image
   KERNEL := kernel-bin
   DEVICE_TITLE := Marvell Armada 3720 Development Board DB-88F3720-DDR3
-  DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-usb2 kmod-usb3 
kmod-usb-storage
   IMAGES := sdcard.img.gz
   IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | 
append-metadata
   DEVICE_DTS := armada-3720-db
diff --git a/target/linux/mvebu/image/cortex-a72.mk 
b/target/linux/mvebu/image/cortex-a72.mk
index ac5b80233b..38099fdd19 100644
--- a/target/linux/mvebu/image/cortex-a72.mk
+++ b/target/linux/mvebu/image/cortex-a72.mk
@@ -4,7 +4,6 @@ define Device/armada-macchiatobin
   KERNEL_NAME := Image
   KERNEL := kernel-bin
   DEVICE_TITLE := MACCHIATObin (SolidRun Armada 8040 Community Board)
-  DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-mmc
   IMAGES := sdcard.img.gz
   IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | 
append-metadata
   DEVICE_DTS := armada-8040-mcbin
@@ -17,7 +16,6 @@ define Device/armada-8040-db
   KERNEL_NAME := Image
   KERNEL := kernel-bin
   DEVICE_TITLE := Marvell Armada 8040 DB board
-  DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-mmc
   IMAGES := sdcard.img.gz
   IMAGE/sdcard.img.gz := boot-img-ext4 | sdcard-img-ext4 | gzip | 
append-metadata
   DEVICE_DTS := armada-8040-db
@@ -30,7 +28,6 @@ define Device/armada-7040-db
   KERNEL_NAME := Image
   KERNEL := kernel-bin
   DEVICE_TITLE := Marvell Armada 7040 DB board
-  DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-mmc
   IMAGES := sdcard.img.gz
   IMAGE/sdcard.img.gz := boot-img-ext4 | sdcard-img-ext4 | gzip | 
append-metadata
   DEVICE_DTS := armada-7040-db
diff --git a/target/linux/mvebu/image/cortex-a9.mk 

[OpenWrt-Devel] mvebu: SD card image and other improvements

2019-03-21 Thread Tomasz Maciej Nowak
This series includes more or less dependent/related commits, so I decided
to send them in one bulk.

In few points what this series is about:

1. Align features of SD card image with other targets using block boot
   devices, commits:
   "mvebu: make bootfs size for sdcard image configurable"
   "mvebu: base-files: autodetect upgrade device"
   "mvebu: sysupgrade: sdcard: keep user added partitons".

2. Move another device to usage of ext4 formated boot partition:
   "mvebu: use ext4 for clearfog image bootfs"

3. Packages clean-up of devices relying ond SD card image to boot:
   "mvebu: shrink amount of packages and reorganize them"

4. Activate possibility of booting ESPRESSObin from USB, SATA disks or
   eMMC flash, this still needs manual intervention, similar one as when
   the device got introduced, commits:
   "mvebu: espressobin: add node for eMMC in dts"
   "mvebu: espressobin: add u-boot environment"

If sending this as one series is not acceptable, please speak up,
I'll send them in separate, one at a time.

Tomasz Maciej Nowak (7):
  mvebu: make bootfs size for sdcard image configurable
  mvebu: use ext4 for clearfog image bootfs
  mvebu: shrink amount of packages and reorganize them
  mvebu: base-files: autodetect upgrade device
  mvebu: sysupgrade: sdcard: keep user added partitons
  mvebu: espressobin: add node for eMMC in dts
  mvebu: espressobin: add u-boot environment

 config/Config-images.in   |   2 +-
 target/linux/mvebu/Makefile   |   2 +-
 .../base-files/lib/preinit/79_move_config |  21 ++--
 .../mvebu/base-files/lib/upgrade/platform.sh  |   9 +-
 .../mvebu/base-files/lib/upgrade/sdcard.sh|  87 +--
 target/linux/mvebu/cortexa53/target.mk|   1 +
 target/linux/mvebu/cortexa72/target.mk|   1 +
 target/linux/mvebu/image/Makefile |  26 +++--
 target/linux/mvebu/image/cortex-a53.mk|   4 +-
 target/linux/mvebu/image/cortex-a72.mk|   3 -
 target/linux/mvebu/image/cortex-a9.mk |  11 +-
 .../image/globalscale-espressobin.bootscript  |  14 ++-
 .../mvebu/image/globalscale-espressobin.uenv  |  25 +
 ...l-armada37xx-Add-emmc-sdio-pinctrl-d.patch |  40 +++
 ...l-armada-37xx-Enable-emmc-on-espress.patch |  49 
 ...da-3720-espressobin-correct-spi-node.patch |   2 +-
 ...x-re-arrange-SDHCI-controllers-order.patch | 105 ++
 17 files changed, 359 insertions(+), 43 deletions(-)
 create mode 100644 target/linux/mvebu/image/globalscale-espressobin.uenv
 create mode 100644 
target/linux/mvebu/patches-4.14/513-arm64-dts-marvell-armada37xx-Add-emmc-sdio-pinctrl-d.patch
 create mode 100644 
target/linux/mvebu/patches-4.14/514-arm64-dts-marvell-armada-37xx-Enable-emmc-on-espress.patch
 create mode 100644 
target/linux/mvebu/patches-4.14/522-arm64-dts-a37xx-re-arrange-SDHCI-controllers-order.patch

-- 
2.21.0


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


[OpenWrt-Devel] [PATCH 4/4] linux: Add kmod-sched-act-vlan

2019-03-21 Thread Hauke Mehrtens
This allows to configure rules to push or pop vlan headers.

Signed-off-by: Hauke Mehrtens 
---
 package/kernel/linux/modules/netsupport.mk | 16 
 1 file changed, 16 insertions(+)

diff --git a/package/kernel/linux/modules/netsupport.mk 
b/package/kernel/linux/modules/netsupport.mk
index 870ee41..08aee05 100644
--- a/package/kernel/linux/modules/netsupport.mk
+++ b/package/kernel/linux/modules/netsupport.mk
@@ -773,6 +773,22 @@ endef
 $(eval $(call KernelPackage,sched-flower))
 
 
+define KernelPackage/sched-act-vlan
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=Traffic VLAN manipulation
+  DEPENDS:=+kmod-sched-core
+  KCONFIG:=CONFIG_NET_ACT_VLAN
+  FILES:=$(LINUX_DIR)/net/sched/act_vlan.ko
+  AUTOLOAD:=$(call AutoProbe, act_vlan)
+endef
+
+define KernelPackage/sched-act-vlan/description
+ Allows to configure rules to push or pop vlan headers.
+endef
+
+$(eval $(call KernelPackage,sched-act-vlan))
+
+
 define KernelPackage/sched-mqprio
   SUBMENU:=$(NETWORK_SUPPORT_MENU)
   TITLE:=Multi-queue priority scheduler (MQPRIO)
-- 
2.10.1


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


[OpenWrt-Devel] [PATCH 3/4] linux: Add kmod-sched-flower

2019-03-21 Thread Hauke Mehrtens
This allows to classify packets based on a configurable combination
of packet keys and masks.

Signed-off-by: Hauke Mehrtens 
---
 package/kernel/linux/modules/netsupport.mk | 16 
 1 file changed, 16 insertions(+)

diff --git a/package/kernel/linux/modules/netsupport.mk 
b/package/kernel/linux/modules/netsupport.mk
index 220c2d4..870ee41 100644
--- a/package/kernel/linux/modules/netsupport.mk
+++ b/package/kernel/linux/modules/netsupport.mk
@@ -757,6 +757,22 @@ endef
 $(eval $(call KernelPackage,sched-core))
 
 
+define KernelPackage/sched-flower
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=Flower traffic classifier
+  DEPENDS:=+kmod-sched-core
+  KCONFIG:=CONFIG_NET_CLS_FLOWER
+  FILES:=$(LINUX_DIR)/net/sched/cls_flower.ko
+  AUTOLOAD:=$(call AutoProbe, cls_flower)
+endef
+
+define KernelPackage/sched-flower/description
+ Allows to classify packets based on a configurable combination of packet keys 
and masks.
+endef
+
+$(eval $(call KernelPackage,sched-flower))
+
+
 define KernelPackage/sched-mqprio
   SUBMENU:=$(NETWORK_SUPPORT_MENU)
   TITLE:=Multi-queue priority scheduler (MQPRIO)
-- 
2.10.1


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


[OpenWrt-Devel] [PATCH 2/4] linux: Add kmod-sched-mqprio

2019-03-21 Thread Hauke Mehrtens
This adds Multi-queue priority scheduler (MQPRIO).

Signed-off-by: Hauke Mehrtens 
---
 package/kernel/linux/modules/netsupport.mk | 16 
 1 file changed, 16 insertions(+)

diff --git a/package/kernel/linux/modules/netsupport.mk 
b/package/kernel/linux/modules/netsupport.mk
index 003603f..220c2d4 100644
--- a/package/kernel/linux/modules/netsupport.mk
+++ b/package/kernel/linux/modules/netsupport.mk
@@ -757,6 +757,22 @@ endef
 $(eval $(call KernelPackage,sched-core))
 
 
+define KernelPackage/sched-mqprio
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=Multi-queue priority scheduler (MQPRIO)
+  DEPENDS:=+kmod-sched-core
+  KCONFIG:=CONFIG_NET_SCH_MQPRIO
+  FILES:=$(LINUX_DIR)/net/sched/sch_mqprio.ko
+  AUTOLOAD:=$(call AutoProbe, sch_mqprio)
+endef
+
+define KernelPackage/sched-mqprio/description
+  This scheduler allows QOS to be offloaded on NICs that have support for 
offloading QOS schedulers.
+endef
+
+$(eval $(call KernelPackage,sched-mqprio))
+
+
 define KernelPackage/sched-connmark
   SUBMENU:=$(NETWORK_SUPPORT_MENU)
   TITLE:=Traffic shaper conntrack mark support
-- 
2.10.1


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


[OpenWrt-Devel] [PATCH 1/4] linux: Add kmod-crxypto-xcbc

2019-03-21 Thread Hauke Mehrtens
This can be used for IPsec.

Signed-off-by: Hauke Mehrtens 
---
 package/kernel/linux/modules/crypto.mk | 12 
 1 file changed, 12 insertions(+)

diff --git a/package/kernel/linux/modules/crypto.mk 
b/package/kernel/linux/modules/crypto.mk
index d70eb92..1add16e 100644
--- a/package/kernel/linux/modules/crypto.mk
+++ b/package/kernel/linux/modules/crypto.mk
@@ -226,6 +226,18 @@ endef
 $(eval $(call KernelPackage,crypto-gcm))
 
 
+define KernelPackage/crypto-xcbc
+  TITLE:=XCBC CryptoAPI module
+  DEPENDS:=+kmod-crypto-hash +kmod-crypto-manager
+  KCONFIG:=CONFIG_CRYPTO_XCBC
+  FILES:=$(LINUX_DIR)/crypto/xcbc.ko
+  AUTOLOAD:=$(call AutoLoad,09,xcbc)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-xcbc))
+
+
 define KernelPackage/crypto-gf128
   TITLE:=GF(2^128) multiplication functions CryptoAPI module
   KCONFIG:=CONFIG_CRYPTO_GF128MUL
-- 
2.10.1


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


Re: [OpenWrt-Devel] [PATCH 2/2] mvebu: Add kmod-i2c-mux-pca954x

2019-03-21 Thread Hauke Mehrtens
On 3/21/19 6:25 PM, Tomasz Maciej Nowak wrote:
> Hi Hauke,
> 
> W dniu 21.03.2019 o 17:57, Hauke Mehrtens pisze:
>> This driver is needed for the I2C mux on the board.
> 
> This symbol CONFIG_I2C_MUX_PCA954x is in 
> target/linux/mvebu/cortexa72/config-default so it should be also deleted in 
> this patch.

Thanks for spotting this, I had the kernel 4.19 patches already applied
and they removed this kernel configuration option.

I think we can ignore this patch and we use the compiled in version.

>> Signed-off-by: Hauke Mehrtens 
>> ---
>>  target/linux/mvebu/image/cortex-a72.mk | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/target/linux/mvebu/image/cortex-a72.mk 
>> b/target/linux/mvebu/image/cortex-a72.mk
>> index ac5b802..df0ace1 100644
>> --- a/target/linux/mvebu/image/cortex-a72.mk
>> +++ b/target/linux/mvebu/image/cortex-a72.mk
>> @@ -4,7 +4,7 @@ define Device/armada-macchiatobin
>>KERNEL_NAME := Image
>>KERNEL := kernel-bin
>>DEVICE_TITLE := MACCHIATObin (SolidRun Armada 8040 Community Board)
>> -  DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-mmc
>> +  DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-mmc 
>> kmod-i2c-core kmod-i2c-mux kmod-i2c-mux-pca954x
>>IMAGES := sdcard.img.gz
>>IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip 
>> | append-metadata
>>DEVICE_DTS := armada-8040-mcbin
>>
> 
> Regards
> 


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


Re: [OpenWrt-Devel] [PATCH 2/2] mvebu: Add kmod-i2c-mux-pca954x

2019-03-21 Thread Tomasz Maciej Nowak
Hi Hauke,

W dniu 21.03.2019 o 17:57, Hauke Mehrtens pisze:
> This driver is needed for the I2C mux on the board.

This symbol CONFIG_I2C_MUX_PCA954x is in 
target/linux/mvebu/cortexa72/config-default so it should be also deleted in 
this patch.

> 
> Signed-off-by: Hauke Mehrtens 
> ---
>  target/linux/mvebu/image/cortex-a72.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/linux/mvebu/image/cortex-a72.mk 
> b/target/linux/mvebu/image/cortex-a72.mk
> index ac5b802..df0ace1 100644
> --- a/target/linux/mvebu/image/cortex-a72.mk
> +++ b/target/linux/mvebu/image/cortex-a72.mk
> @@ -4,7 +4,7 @@ define Device/armada-macchiatobin
>KERNEL_NAME := Image
>KERNEL := kernel-bin
>DEVICE_TITLE := MACCHIATObin (SolidRun Armada 8040 Community Board)
> -  DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-mmc
> +  DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-mmc 
> kmod-i2c-core kmod-i2c-mux kmod-i2c-mux-pca954x
>IMAGES := sdcard.img.gz
>IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | 
> append-metadata
>DEVICE_DTS := armada-8040-mcbin
> 

Regards

-- 
TMN

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


[OpenWrt-Devel] [PATCH v2 1/2] base-files: add leds migration

2019-03-21 Thread Tomasz Maciej Nowak
Currently leds migration scripts in ar71xx and lantiq share a lot of
logic and introducing leds migration to another target would mean
copying this code, again. Therefore add common logic to library in
base-files package.

Suggested-by: Petr Štetiar 
Signed-off-by: Petr Štetiar 
Signed-off-by: Tomasz Maciej Nowak 
---
Changes in v2 to:
"base-files: add leds migration"
As OpenWrt is close to branch new stable version I removed and postponed
the ar71xx and lantiq target migration to not introduce new bugs.

 .../files/lib/functions/migrations.sh | 39 +++
 1 file changed, 39 insertions(+)
 create mode 100644 package/base-files/files/lib/functions/migrations.sh

diff --git a/package/base-files/files/lib/functions/migrations.sh 
b/package/base-files/files/lib/functions/migrations.sh
new file mode 100644
index 00..b180a0242f
--- /dev/null
+++ b/package/base-files/files/lib/functions/migrations.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+. /lib/functions.sh
+
+migrate_led_sysfs() {
+   local cfg="$1"; shift
+   local tuples="$@"
+   local sysfs
+   local name
+
+   config_get sysfs ${cfg} sysfs
+   config_get name ${cfg} name
+
+   [ -z "${sysfs}" ] && return
+
+   for tuple in ${tuples}; do
+   local old=${tuple%=*}
+   local new=${tuple#*=}
+   local new_sysfs
+
+   new_sysfs=$(echo ${sysfs} | sed "s/${old}/${new}/")
+
+   [ "${new_sysfs}" = "${sysfs}" ] && continue
+
+   uci set system.${cfg}.sysfs="${new_sysfs}"
+
+   logger -t led-migration "sysfs option of LED \"${name}\" 
updated to ${new_sysfs}"
+   done;
+}
+
+migrate_leds() {
+   config_load system
+   config_foreach migrate_led_sysfs led "$@"
+}
+
+migrations_apply() {
+   local realm="$1"
+   [ -n "$(uci changes ${realm})" ] && uci -q commit ${realm}
+}
-- 
2.21.0


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


[OpenWrt-Devel] [PATCH v2 2/2] ath79: engenius epg5000: add leds migration script

2019-03-21 Thread Tomasz Maciej Nowak
With transition from ar71xx to ath79 some of devices change their naming
of LEDs. When upgrading from ar71xx target images this will require the
user to adjust previously working configuration. This commit adds
migration script which can be used to rename old names to new ones.
With this previously working configuration will be automatically
adjusted, wihtout user intervention.

This commit adds migration case for EnGenius EPG5000, the wireless LEDs
names have changed from epg5000:blue:wlan2-g and epg5000:blue:wlan-5g to
epg5000:blue:wlan2g and epg5000:blue:wlan5g.

Signed-off-by: Tomasz Maciej Nowak 
---
No changes.

 .../base-files/etc/uci-defaults/04_led_migration | 16 
 1 file changed, 16 insertions(+)
 create mode 100644 
target/linux/ath79/base-files/etc/uci-defaults/04_led_migration

diff --git a/target/linux/ath79/base-files/etc/uci-defaults/04_led_migration 
b/target/linux/ath79/base-files/etc/uci-defaults/04_led_migration
new file mode 100644
index 00..2ca87ccb34
--- /dev/null
+++ b/target/linux/ath79/base-files/etc/uci-defaults/04_led_migration
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. /lib/functions/migrations.sh
+
+board=$(board_name)
+
+case "$board" in
+engenius,epg5000)
+   migrate_leds ":wlan-2g=:wlan2g" ":wlan-5g=:wlan5g"
+   ;;
+esac
+
+migrations_apply system
+
+exit 0
-- 
2.21.0


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


[OpenWrt-Devel] [PATCH 2/2] mvebu: Add kmod-i2c-mux-pca954x

2019-03-21 Thread Hauke Mehrtens
This driver is needed for the I2C mux on the board.

Signed-off-by: Hauke Mehrtens 
---
 target/linux/mvebu/image/cortex-a72.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/mvebu/image/cortex-a72.mk 
b/target/linux/mvebu/image/cortex-a72.mk
index ac5b802..df0ace1 100644
--- a/target/linux/mvebu/image/cortex-a72.mk
+++ b/target/linux/mvebu/image/cortex-a72.mk
@@ -4,7 +4,7 @@ define Device/armada-macchiatobin
   KERNEL_NAME := Image
   KERNEL := kernel-bin
   DEVICE_TITLE := MACCHIATObin (SolidRun Armada 8040 Community Board)
-  DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-mmc
+  DEVICE_PACKAGES := e2fsprogs ethtool mkf2fs kmod-fs-vfat kmod-mmc 
kmod-i2c-core kmod-i2c-mux kmod-i2c-mux-pca954x
   IMAGES := sdcard.img.gz
   IMAGE/sdcard.img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | 
append-metadata
   DEVICE_DTS := armada-8040-mcbin
-- 
2.10.1


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


[OpenWrt-Devel] [PATCH 1/2] mvebu: Fix typo in MACCHIATOBin detection

2019-03-21 Thread Hauke Mehrtens
The name in the device tree file is written with two C.

Signed-off-by: Hauke Mehrtens 
---
 target/linux/mvebu/base-files/lib/mvebu.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/mvebu/base-files/lib/mvebu.sh 
b/target/linux/mvebu/base-files/lib/mvebu.sh
index 5a0d7b2..cfe880b 100755
--- a/target/linux/mvebu/base-files/lib/mvebu.sh
+++ b/target/linux/mvebu/base-files/lib/mvebu.sh
@@ -23,7 +23,7 @@ mvebu_board_detect() {
*"Marvell Armada 3720 Development Board DB-88F3720-DDR3")
name="marvell,armada-3720-db"
;;
-   *"Marvell 8040 MACHIATOBin")
+   *"Marvell 8040 MACCHIATOBin")
name="marvell,armada8040-mcbin"
;;
*"Marvell Armada 8040 DB board")
-- 
2.10.1


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


[OpenWrt-Devel] [PATCH v2] ath79: add support for OCEDO Ursus

2019-03-21 Thread markus . scheck1
From: Markus Scheck 

SOC:   Qualcomm Atheros QCA9558
RAM:   128MB
FLASH: 16MB (Macronix MX25L12845EMI-10G)
WLAN1: QCA9558 2.4GHz 802.11bgn 3SS
WLAN2: QCA9880 5GHz 802.11ac 3SS
LED:   Power, LAN1, LAN2, 2.4GHz, 5GHz
Serial:Next to SPI Flash,
   Pinout is 3V3 - GND - TX - RX (Square Pin is 3V3)
   The Serial setting is 115200-8-N-1

INSTALLATION:

1. Serve an OpenWrt ramdisk image named "ursus.bin".
   Set your IP-address to 192.168.100.8/24.
2. Connect to the serial. Power up the device and interrupt
   the boot process.
3. Set the correct bootcmd with
   > setenv bootcmd run bootcmd_1
   > saveenv
4. Run
   > tftpboot 0x8100 ursus.bin
   > bootm 0x8100
5. Wait for OpenWrt to boot up.
6. Transfer OpenWrt sysupdate image and flash via sysupgrade.

Signed-off-by: Markus Scheck 
---
 .../ath79/base-files/etc/board.d/02_network   |   3 +-
 .../etc/hotplug.d/firmware/11-ath10k-caldata  |   3 +-
 .../linux/ath79/dts/qca9558_ocedo_ursus.dts   | 148 ++
 target/linux/ath79/image/generic.mk   |   9 ++
 4 files changed, 161 insertions(+), 2 deletions(-)
 create mode 100644 target/linux/ath79/dts/qca9558_ocedo_ursus.dts

diff --git a/target/linux/ath79/base-files/etc/board.d/02_network 
b/target/linux/ath79/base-files/etc/board.d/02_network
index 62318ee232..69b5c265b4 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -65,7 +65,8 @@ ath79_setup_interfaces()
"0@eth0" "1:lan:1" "3:lan:4" "4:lan:3" "5:lan:2" "2:wan"
;;
devolo,dvl1200e|\
-   devolo,dvl1750e)
+   devolo,dvl1750e|\
+   ocedo,ursus)
ucidef_set_interface_lan "eth0 eth1"
;;
dlink,dir-825-b1)
diff --git 
a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 8651c97099..661008da8f 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -119,7 +119,8 @@ case "$FIRMWARE" in
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac_crc $(mtd_get_mac_text board_data 2176)
;;
-   ocedo,koala)
+   ocedo,koala|\
+   ocedo,ursus)
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(mtd_get_mac_binary art 12)
;;
diff --git a/target/linux/ath79/dts/qca9558_ocedo_ursus.dts 
b/target/linux/ath79/dts/qca9558_ocedo_ursus.dts
new file mode 100644
index 00..ddd6e3047e
--- /dev/null
+++ b/target/linux/ath79/dts/qca9558_ocedo_ursus.dts
@@ -0,0 +1,148 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include 
+#include 
+
+#include "qca9557.dtsi"
+
+/ {
+   compatible = "ocedo,ursus", "qca,qca9557";
+   model = "OCEDO Ursus";
+
+   chosen {
+   bootargs = "console=ttyS0,115200n8";
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+
+   wifi2 {
+   label = "ursus:green:wlan2";
+   gpios = < 14 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy1tpt";
+   };
+
+   wifi5 {
+   label = "ursus:green:wlan5";
+   gpios = < 15 GPIO_ACTIVE_LOW>;
+   linux,default-trigger = "phy0tpt";
+   };
+
+   };
+
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   clocks = <>;
+};
+
+ {
+   status = "okay";
+   num-cs = <1>;
+
+   flash@0 {
+   compatible = "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <2500>;
+
+   partitions {
+   compatible = "fixed-partitions";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   uboot: partition@0 {
+   label = "u-boot";
+   reg = <0x00 0x04>;
+   read-only;
+   };
+
+   partition@4 {
+   label = "u-boot-env";
+   reg = <0x04 0x01>;
+   };
+
+   partition@5 {
+   compatible = "denx,uimage";
+   label = "firmware";
+   reg = <0x05 0x74>;
+   };
+
+   partition@79 {
+   label = "vendor";
+   reg = <0x79 0x74>;
+   read-only;
+   };
+
+   partition@ed {
+   label = "data";
+ 

Re: [OpenWrt-Devel] Welcome to the "openwrt-devel" mailing list (Digest mode)

2019-03-21 Thread IBN5100-ixa
subcribe openwrt-devel___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ramips: add Netgear EX6150

2019-03-21 Thread David Bauer
SoC:   MediaTek MT7621
RAM:   64M (Winbond W9751G6KB-25)
FLASH: 16MB (Macronix MX25L12835F)
WiFi:  MediaTek MT7662E bgn 2SS
WiFi:  MediaTek MT7662E nac 2SS
BTN:   ON/OFF - Reset - WPS - AP/Extender toggle
LED:- Arrow Right (blue)
- Arrow Left (blue)
- WiFi 1 (red/green)
- WiFi 2 (red/green)
- Power (green/amber)
- WPS (Green)
UART:  UART is present as Pads on the backside of the PCB. They are
   located on the other side of the Ethernet port.
   3.3V - GND - TX - RX / 57600-8N1
   3.3V is the nearest one to the antenna connectors

Installation

Update the factory image via the Netgear web-interfaces (by default:
192.168.1.250/24).

You can also use the factory image with the nmrpflash tool.
For more information see https://github.com/jclehner/nmrpflash

Signed-off-by: David Bauer 
---
 .../ramips/base-files/etc/board.d/01_leds |   4 +
 .../ramips/base-files/etc/board.d/02_network  |   1 +
 target/linux/ramips/dts/EX6150.dts| 245 ++
 target/linux/ramips/image/mt7621.mk   |  11 +
 4 files changed, 261 insertions(+)
 create mode 100644 target/linux/ramips/dts/EX6150.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 9cca231ab6..1aaab994c1 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -264,6 +264,10 @@ mtc,wr1201)
 mzk-ex750np)
set_wifi_led "$boardname:red:wifi"
;;
+netgear,ex6150)
+   ucidef_set_led_wlan "wlan2g" "WiFi 2.4GHz" "$boardname:green:router" 
"phy1tpt"
+   ucidef_set_led_wlan "wlan5g" "WiFi 5GHz" "$boardname:green:client" 
"phy0tpt"
+   ;;
 netgear,r6120)
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" 
"0x0f"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" 
"0x10"
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 890efa0d93..568ad97c73 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -368,6 +368,7 @@ ramips_setup_interfaces()
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5:wan" "6@eth0"
;;
+   netgear,ex6150|\
re350-v1)
ucidef_add_switch "switch0" \
"0:lan" "6@eth0"
diff --git a/target/linux/ramips/dts/EX6150.dts 
b/target/linux/ramips/dts/EX6150.dts
new file mode 100644
index 00..540fa513b8
--- /dev/null
+++ b/target/linux/ramips/dts/EX6150.dts
@@ -0,0 +1,245 @@
+/dts-v1/;
+
+#include "mt7621.dtsi"
+
+#include 
+#include 
+
+/ {
+   compatible = "netgear,ex6150", "mediatek,mt7621-soc";
+   model = "Netgear EX6150";
+
+   aliases {
+   led-boot = _green;
+   led-failsafe = _amber;
+   led-running = _green;
+   led-upgrade = _amber;
+   };
+
+   memory@0 {
+   device_type = "memory";
+   reg = <0x0 0x400>;
+   };
+
+   chosen {
+   bootargs = "console=ttyS0,57600";
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   power_amber: power_amber {
+   label = "ex6150:amber:power";
+   gpios = < 15 GPIO_ACTIVE_LOW>;
+   };
+
+   power_green: power_green {
+   label = "ex6150:green:power";
+   gpios = < 13 GPIO_ACTIVE_LOW>;
+   };
+
+   wps {
+   label = "ex6150:green:wps";
+   gpios = < 16 GPIO_ACTIVE_LOW>;
+   };
+
+   rightarrow {
+   label = "ex6150:blue:rightarrow";
+   gpios = < 28 GPIO_ACTIVE_LOW>;
+   };
+
+   leftarrow {
+   label = "ex6150:blue:leftarrow";
+   gpios = < 31 GPIO_ACTIVE_LOW>;
+   };
+
+   router_green {
+   label = "ex6150:green:router";
+   gpios = < 29 GPIO_ACTIVE_LOW>;
+   };
+
+   router_red {
+   label = "ex6150:red:router";
+   gpios = < 30 GPIO_ACTIVE_LOW>;
+   };
+
+   client_green {
+   label = "ex6150:green:client";
+   gpios = < 1 GPIO_ACTIVE_LOW>;
+   };
+
+   client_red {
+   label = "ex6150:red:client";
+   gpios = < 0 GPIO_ACTIVE_LOW>;
+   };
+   };
+
+   keys {
+   compatible = "gpio-keys-polled";
+   poll-interval = <20>;
+
+   wps {
+   label = "wps";
+  

Re: [OpenWrt-Devel] [PATCH] ramips: Add support for ZBT WE826-E

2019-03-21 Thread Kristian Evensen
Hi,

On Thu, Mar 21, 2019 at 2:23 PM Bjørn Mork  wrote:
>
> Kristian Evensen  writes:
>
> > - 2x SIM card slots (full size)
>
> Really?  Am I the only one who remember credit card sized SIMs? :-)
>
> They were the only kind we had when GSM was introduced around here in
> 1991/1992.  See for example the description of the GSM version of the
> MicroTAC Classic:
> https://en.wikipedia.org/wiki/Motorola_MicroTAC#MicroTAC_Classic
>
> OK, I am old.  I know.

Hehe, I was not aware of credit-card sized SIMs :) I see now that
correct term is "mini-SIM", will update if there will be a v2 of the
patch. Thanks for letting me know.

BR,
Kristian

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


Re: [OpenWrt-Devel] [PATCH] ramips: Add support for ZBT WE826-E

2019-03-21 Thread Bjørn Mork
Kristian Evensen  writes:

> - 2x SIM card slots (full size)

Really?  Am I the only one who remember credit card sized SIMs? :-)

They were the only kind we had when GSM was introduced around here in
1991/1992.  See for example the description of the GSM version of the
MicroTAC Classic:
https://en.wikipedia.org/wiki/Motorola_MicroTAC#MicroTAC_Classic

OK, I am old.  I know.



Bjørn

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


[OpenWrt-Devel] [PATCH] ramips: Add support for ZBT WE826-E

2019-03-21 Thread Kristian Evensen
ZBT WE826-E is a dual-SIM version of the ZBT WE826. The router has the
following specifications:

- MT7620A (580 MHz)
- 128MB RAM
- 32MB of flash (SPI NOR)
- 5x 10/100Mbps Ethernet (MT7620A built-in switch)
- 1x microSD slot
- 1x miniPCIe slot (only USB2.0 bus)
- 2x SIM card slots (full size)
- 1x USB2.0 port
- 1x 2.4GHz wifi (rt2800)
- 10x LEDs (4 GPIO-controlled)
- 1x reset button

The following have been tested and working:
- Ethernet switch
- wifi
- miniPCIe slot
- USB port
- microSD slot
- sysupgrade
- reset button

Installation:

The router ships with an older version of OpenWRT, but with a broken web
user interface. In order to install the image, you need to SSH into the
router and run sysupgrade. The default address of the router is
192.168.1.1, user is root and password admin. Once you are in, run the
following command:

sysupgrade -n -F openwrt-ramips-mt7620-zbt-we826-e-squashfs-sysupgrade.bin

Recovery:

The router ships with a web-based recovery system. If you need to
recover the router, keep the reset button pressed during boot and access
192.168.1.1 in your browser when your machine obtains an IP address.
Upload the firmware to start the recovery process.

How to swap SIMs:

In order to switch which SIM is used, you need to do the following:

- Turn off the modem by running the following command:
echo 0 > /sys/class/gpio/power_mpcie/value

- Write either 0 or 1 to /sys/class/gpio/sim_switch/value. After
boot/reboot, the router will always use SIM 0. You can check which SIM
slot is currently used by reading from the file mentioned in the first
sentence.

- Turn on the modem again by running the following command:
echo 1 > /sys/class/gpio/power_mpcie/value

Signed-off-by: Kristian Evensen 
---
 .../ramips/base-files/etc/board.d/01_leds |   3 +
 .../ramips/base-files/etc/board.d/02_network  |   1 +
 target/linux/ramips/base-files/lib/ramips.sh  |   3 +
 target/linux/ramips/dts/ZBT-WE826-E.dts   | 101 ++
 target/linux/ramips/image/mt7620.mk   |   8 ++
 5 files changed, 116 insertions(+)
 create mode 100644 target/linux/ramips/dts/ZBT-WE826-E.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 9cca231ab6..ebfc1e360b 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -451,6 +451,9 @@ zbt-we826-16M|\
 zbt-we826-32M)
set_wifi_led "zbt-we826:green:wifi"
;;
+zbt-we826-e)
+   set_wifi_led "zbt-we826-e:red:wifi"
+   ;;
 zbtlink,zbt-we1226)
set_wifi_led "$boardname:green:wlan"
ucidef_set_led_switch "lan1" "LAN1" "$boardname:green:lan1" "switch0" 
"0x01"
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 890efa0d93..702f781e15 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -135,6 +135,7 @@ ramips_setup_interfaces()
zbtlink,zbt-we3526|\
zbt-we826-16M|\
zbt-we826-32M|\
+   zbt-we826-e|\
zbt-wg2626|\
zbt-wg3526-16M|\
zbt-wg3526-32M|\
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index db93710ba7..b1e11f97b7 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -679,6 +679,9 @@ ramips_board_detect() {
*"ZBT-WE826 (32M)")
name="zbt-we826-32M"
;;
+   *"ZBT-WE826-E")
+   name="zbt-we826-e"
+   ;;
*"ZBT-WG2626")
name="zbt-wg2626"
;;
diff --git a/target/linux/ramips/dts/ZBT-WE826-E.dts 
b/target/linux/ramips/dts/ZBT-WE826-E.dts
new file mode 100644
index 00..a57aeb4823
--- /dev/null
+++ b/target/linux/ramips/dts/ZBT-WE826-E.dts
@@ -0,0 +1,101 @@
+/dts-v1/;
+
+#include "ZBT-WE826.dtsi"
+
+/ {
+   compatible = "zbtlink,zbt-we826-e", "zbtlink,zbt-we826", 
"ralink,mt7620a-soc";
+   model = "ZBT-WE826-E";
+
+   gpio-export {
+   compatible = "gpio-export";
+   #size-cells = <0>;
+
+   sim_switch {
+   gpio-export,name = "sim_switch";
+   gpio-export,output = <1>;
+   gpios = < 13 GPIO_ACTIVE_LOW>;
+   };
+
+   power_mpcie {
+   gpio-export,name = "power_mpcie";
+   gpio-export,output = <1>;
+   gpios = < 14 GPIO_ACTIVE_HIGH>;
+   };
+   };
+
+   /delete-node/ leds;
+
+   leds {
+   compatible = "gpio-leds";
+
+   led_power: gsm {
+   label = "zbt-we826-e:blue:gsm";
+   gpios = < 9 GPIO_ACTIVE_LOW>;
+   };
+
+   signal {
+   label = 

Re: [OpenWrt-Devel] OpenWrt 19.03 plans

2019-03-21 Thread Jo-Philipp Wich
Hi,

> Is there any kind of "official" roadmap/checklist available what "needs"
> to be done?

not that I am aware of, but from the top of my head:

- make sure all targets are ported properly to 4.14
- disable all devices which cannot cannot handle the increased kernel
  size anymore
- drop all targets which are not ported to 4.14
- fix important open issues in the tracker

~ Jo



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


Re: [OpenWrt-Devel] About 802.11s mesh on IPQ4019, ath10k-ct and ct-firmware

2019-03-21 Thread Kalle Valo
Sven Eckelmann  writes:

> On Saturday, 16 March 2019 13:18:48 CET Xuebing Wang wrote:
> [...]
>> 1)  Firmware inside QSDK (QCA closed source?) for AP-DK04.1-C1 based 
>> routers.
>> 2)  Firmware from kvalo/linux-firmware
>> 
>> Are these "2 lines" of firmware essentially the same?
>
> They should at least be quite similar. Maybe Kalle knows more about
> it.

I don't know what firmware QSDK has and if it's tested with ath10k. My
recommendation is to take ath10k firmware images from linux-firmware as
they are tested with ath10k.

-- 
Kalle Valo

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


Re: [OpenWrt-Devel] Meson/Ninja build system

2019-03-21 Thread Daniel Engberg

On 2019-03-18 14:10, Petr Štetiar wrote:

Daniel Engberg  [2019-03-18 13:55:07]:

Hi,

Having a look at https://www.python.org/dev/peps/pep-0537/#lifespan it 
seems

like a good idea to stick with 3.7?


it's a PITA to demand versions which are not packaged in current 
versions of LTS
Linux distros. Since Meson is a build system generator, I hope, that 
it's
going to work with any Python 3 version, but can't find any details 
about

Meson's Python version requirements.

-- ynezz


Some progress on this topic, 3.15 is pretty much the minimum version 
that's
required if we're going to move to Python 3 despite having not having it 
in all

available LTS releases (Debian 8 and RHEL 7 falls under this category).

If anyone is interested the discussion is more or less continued here:
https://github.com/openwrt/openwrt/pull/1937

Best regards,
Daniel

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


Re: [OpenWrt-Devel] OpenWrt 19.03 plans

2019-03-21 Thread Daniel Engberg

Hi,

Is there any kind of "official" roadmap/checklist available what "needs" 
to be done?


Best regards,
Daniel

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