Re: [LEDE-DEV] ar71xx: Add userspace support for Mikrotik rb-2011iLS

2018-04-26 Thread John Crispin



On 16/04/18 01:25, Simon Paterson wrote:

Kernel support already present.
Patch adds userspace for the 'iLS' suffix model of the RB2011 family.
Enables correct initial switch settings, sysupgrade, etc.

https://mikrotik.com/product/RB2011iLS-IN

Signed-off-by: Simon Paterson 


Hi Simon,

patch looks good, however it is whitespace mangled. either you 
copy it or your mail client chewed it up. please use "git 
send-email" and resend it.


    John


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 cf24e465a3..906c4b715f 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -616,6 +616,7 @@ rb-962uigs-5hact2hnt)
  ucidef_set_led_timer "user" "USER/SFP" "rb:green:user" "1000" "1000"
  ;;
  rb-2011il|\
+rb-2011ils|\
  rb-2011l|\
  rb-2011uas|\
  rb-2011uas-2hnd|\
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 dfe97e8133..cbbcf53946 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -315,12 +315,14 @@ ar71xx_setup_interfaces()
  ;;
  db120|\
  rb-2011il|\
+    rb-2011ils|\
  rb-2011l|\
  rb-2011uas|\
  rb-2011uas-2hnd|\
  rb-2011uias|\
  rb-2011uias-2hnd)
      case "$board" in
+        rb-2011ils|\
      rb-2011uas*|\
      rb-2011uias|\
      rb-2011uias-2hnd)
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh
b/target/linux/ar71xx/base-files/etc/diag.sh
index 797c30f8a5..19dd4c2a13 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -335,6 +335,7 @@ get_status_led() {
      status_led="$board:green:wan"
      ;;
  rb-2011il|\
+    rb-2011ils|\
  rb-2011l|\
  rb-2011uas|\
  rb-2011uas-2hnd)
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 29fdde40a0..0388fb6dc9 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
@@ -86,6 +86,7 @@ rb-450)
  
  db120|\

  rb-2011il|\
+rb-2011ils|\
  rb-2011l|\
  rb-2011uas-2hnd)
  migrate_switch_name "eth0" "switch0"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 7249cb6151..95314a2881 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -944,6 +944,9 @@ ar71xx_board_detect() {
  *"RouterBOARD 2011iL")
      name="rb-2011il"
      ;;
+    *"RouterBOARD 2011iLS")
+        name="rb-2011ils"
+        ;;
  *"RouterBOARD 2011L")
      name="rb-2011l"
      ;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 376984a14a..702d97a8ed 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -550,6 +550,7 @@ platform_check_image() {
  rb-951ui-2hnd|\
  rb-2011l|\
  rb-2011il|\
+    rb-2011ils|\
  rb-2011uas|\
  rb-2011uas-2hnd|\
  rb-2011uias|\
@@ -843,6 +844,7 @@ platform_do_upgrade() {
  rb-951g-2hnd|\
  rb-951ui-2hnd|\
  rb-2011il|\
+    rb-2011ils|\
  rb-2011l|\
  rb-2011uas|\
  rb-2011uas-2hnd|\


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



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


Re: [LEDE-DEV] [PATCH v2] dropbear: automatically add firewall rules based on the config

2018-04-26 Thread John Crispin



On 18/04/18 15:49, Pierre Lebleu wrote:

An extra option (AllowedClientIPs:list) is available to allow
specific clients to use this service.

Hi,

description fails to mention the FW rules being added.


v2: do not create the firewall data if there is no valid interface.


this v2 info needs to go below the tear line

one more comment inline ...



Signed-off-by: Pierre Lebleu 
---
  .../network/services/dropbear/files/dropbear.init  | 49 --
  1 file changed, 46 insertions(+), 3 deletions(-)

diff --git a/package/network/services/dropbear/files/dropbear.init 
b/package/network/services/dropbear/files/dropbear.init
index 2225113..38cb674 100755
--- a/package/network/services/dropbear/files/dropbear.init
+++ b/package/network/services/dropbear/files/dropbear.init
@@ -43,15 +43,41 @@ validate_section_dropbear()
'IdleTimeout:uinteger:0' \
'MaxAuthTries:uinteger:3' \
'RecvWindowSize:uinteger:0' \
+   'AllowedClientIPs:list(ipaddr)' \
'mdns:bool:1'
  }
  
+add_fw_rules()

+{
+   local intf="$1"
+   local port="$2"
+   local client="$3"
+
+   [ -z "${intf}" ] && return
+   local zone=$(fw3 -q network "${intf}")
+   [ -z "${zone}" ] && return
+
+   json_add_array firewall
+
+   json_add_object ""
+   json_add_string type rule
+   json_add_string src "${zone}"
+   json_add_string proto tcp
+   json_add_string dest_port "${port}"
+   [ -n "${client}" ] && json_add_string src_ip "${client}"



I have to admit that i am not sure if this is a good approach. the rule 
should not be added for anything but the explictly allowed IPS


    John


+   json_add_string target ACCEPT
+   json_close_object
+
+   json_close_array
+}
+
  dropbear_instance()
  {
local PasswordAuth enable Interface GatewayPorts \
RootPasswordAuth RootLogin rsakeyfile \
BannerFile Port SSHKeepAlive IdleTimeout \
-   MaxAuthTries RecvWindowSize mdns ipaddrs
+   MaxAuthTries RecvWindowSize AllowedClientIPs \
+   mdns ipaddrs
  
  	validate_section_dropbear "${1}" || {

echo "validation failed"
@@ -69,7 +95,8 @@ dropbear_instance()
PIDCOUNT="$(( ${PIDCOUNT} + 1))"
local pid_file="/var/run/${NAME}.${PIDCOUNT}.pid"
  
-	procd_open_instance

+   procd_open_instance "${1}"
+
procd_set_param command "$PROG" -F -P "$pid_file"
[ "${PasswordAuth}" -eq 0 ] && procd_append_param command -s
[ "${GatewayPorts}" -eq 1 ] && procd_append_param command -a
@@ -83,8 +110,20 @@ dropbear_instance()
[ "${MaxAuthTries}" -ne 0 ] && procd_append_param command -T 
"${MaxAuthTries}"
[ "${RecvWindowSize}" -gt 0 -a "${RecvWindowSize}" -le 1048576 ] && \
procd_append_param command -W "${RecvWindowSize}"
-   [ "${mdns}" -ne 0 ] && procd_add_mdns "ssh" "tcp" "$Port" 
"daemon=dropbear"
procd_set_param respawn
+
+   procd_open_data
+
+   [ "${mdns}" -ne 0 ] && {
+   json_add_object "mdns"
+   procd_add_mdns_service "ssh" "tcp" "$Port" "daemon=dropbear"
+   json_close_object
+   }
+
+   add_fw_rules "${Interface}" "${Port}" "${AllowedClientIPs}"
+
+   procd_close_data
+
procd_close_instance
  }
  
@@ -130,6 +169,10 @@ start_service()

config_foreach dropbear_instance dropbear
  }
  
+service_started() {

+   procd_set_config_changed firewall
+}
+
  service_triggers()
  {
local interfaces



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


Re: [LEDE-DEV] [PATCH] u-boot: Switch to HTTP for downloads

2018-04-26 Thread John Crispin



On 19/04/18 22:36, Rosen Penev wrote:

The first mirror is dead and the second is FTP, which can be unreliable at 
times.

Tested on Ubuntu 16.04 WSL.

Signed-off-by: Rosen Penev 
---
  package/boot/uboot-envtools/Makefile | 4 +---
  package/boot/uboot-xburst/Makefile   | 4 +---
  2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/package/boot/uboot-envtools/Makefile 
b/package/boot/uboot-envtools/Makefile
index c8eafbe..5f3584d 100644
--- a/package/boot/uboot-envtools/Makefile
+++ b/package/boot/uboot-envtools/Makefile
@@ -14,9 +14,7 @@ PKG_RELEASE:=1
  
  PKG_BUILD_DIR:=$(BUILD_DIR)/u-boot-$(PKG_VERSION)

  PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=\
-   http://mirror2.openwrt.org/sources \


dont drop mirror2 please just switch it to https
    John


-   ftp://ftp.denx.de/pub/u-boot
+PKG_SOURCE_URL:=http://ftp.denx.de/pub/u-boot
  PKG_HASH:=7e7477534409d5368eb1371ffde6820f0f79780a1a1f676161c48442cb303dfd
  
  PKG_BUILD_DEPENDS:=fstools

diff --git a/package/boot/uboot-xburst/Makefile 
b/package/boot/uboot-xburst/Makefile
index 413289a..20138e0 100644
--- a/package/boot/uboot-xburst/Makefile
+++ b/package/boot/uboot-xburst/Makefile
@@ -14,9 +14,7 @@ PKG_RELEASE:=1
  
  PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)

  PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:= \
-   http://mirror2.openwrt.org/sources \
-   ftp://ftp.denx.de/pub/u-boot
+PKG_SOURCE_URL:=http://ftp.denx.de/pub/u-boot
  PKG_HASH:=6d094cafa7ecea8b671fbdcd21130b6a4f5744fc47dd263e101ed5d3629dffd4
  PKG_TARGETS:=bin
  



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


Re: [LEDE-DEV] [PATCH 2/2] firmware-utils: mkdapimg2: Fix a few issues discovered by clang

2018-04-26 Thread John Crispin


On 23/04/18 01:22, Rosen Penev wrote:

I used clang -Weverything and fixed most of the warnings displayed.


this is an explanation of what you did and not what the patch does

    John


Signed-off-by: Rosen Penev 
---
  tools/firmware-utils/src/mkdapimg2.c | 20 +---
  1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/tools/firmware-utils/src/mkdapimg2.c 
b/tools/firmware-utils/src/mkdapimg2.c
index 59c9f00..89febbc 100644
--- a/tools/firmware-utils/src/mkdapimg2.c
+++ b/tools/firmware-utils/src/mkdapimg2.c
@@ -58,7 +58,7 @@
  #define MAX_FW_VER_LEN16
  #define MAX_REG_LEN   8
  
-struct img_hdr_struct {

+static struct img_hdr_struct {
uint32_t hdr_len;
uint32_t checksum;
uint32_t total_size;
@@ -68,17 +68,17 @@ struct img_hdr_struct {
char fw_reg[MAX_REG_LEN];
  } imghdr ;
  
-char *progname;

+static char *progname;
  
-void

+static void
  perrexit(int code, char *msg)
  {
fprintf(stderr, "%s: %s: %s\n", progname, msg, strerror(errno));
exit(code);
  }
  
-void

-usage()
+static void
+usage(void)
  {
fprintf(stderr, "usage: %s -s signature [-v version] [-r region] [-k uImage part size] 
-i  -o \n", progname);
exit(1);
@@ -92,7 +92,7 @@ main(int ac, char *av[])
char region[MAX_REG_LEN];
int kernel = 0;
  
-	FILE *ifile, *ofile;

+   FILE *ifile = NULL, *ofile = NULL;
int c;
  
  	uint32_t cksum;

@@ -138,7 +138,7 @@ main(int ac, char *av[])
strncpy(region, optarg, MAX_REG_LEN);
break;
case 'k':
-   kernel = strtoul(optarg, , 0);
+   kernel = strtol(optarg, , 0);
if(ptr[0] == 'k'){
kernel *= 1000;
}
@@ -156,10 +156,8 @@ main(int ac, char *av[])
}
}
  
-	if (signature[0] == 0 || ifile == NULL || ofile == NULL) {

+   if (signature[0] == 0 || ifile == NULL || ofile == NULL)
usage();
-   exit(1);
-   }
  
  	for (bcnt = 0, cksum = 0 ; (c = fgetc(ifile)) != EOF ; bcnt++)

cksum += c & 0xff;
@@ -178,7 +176,7 @@ main(int ac, char *av[])
strncpy(imghdr.fw_ver, version, MAX_FW_VER_LEN);
strncpy(imghdr.fw_reg, region, MAX_REG_LEN);
  
-	if (fwrite(, sizeof(imghdr), 1, ofile) < 0)

+   if (fwrite(, sizeof(imghdr), 1, ofile) != 1)
perrexit(2, "fwrite header on output");
  
  	while ((c = fgetc(ifile)) != EOF) {



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


[LEDE-DEV] [PATCH] kernel: Fix data corruption on some mips devices.

2018-04-26 Thread Rosen Penev
This is mainly a bug fix for multi-core MIPS systems where L1 caches besides 
the primary do not get flushed.

The most obvious problem is data corruption on SATA and USB devices where read 
requests are typically larger than the cacheline size.

This may also fix ar71xx systems that suffer from similar data corruption but I 
have not tested if it does.

Signed-off-by: Rosen Penev 
---
 ...ata-corruption-related-to-cache-coherence.patch | 92 ++
 1 file changed, 92 insertions(+)
 create mode 100755 
target/linux/generic/pending-4.14/103-MIPS-c-r4k-fix-data-corruption-related-to-cache-coherence.patch

diff --git 
a/target/linux/generic/pending-4.14/103-MIPS-c-r4k-fix-data-corruption-related-to-cache-coherence.patch
 
b/target/linux/generic/pending-4.14/103-MIPS-c-r4k-fix-data-corruption-related-to-cache-coherence.patch
new file mode 100755
index 000..3cfbd2c
--- /dev/null
+++ 
b/target/linux/generic/pending-4.14/103-MIPS-c-r4k-fix-data-corruption-related-to-cache-coherence.patch
@@ -0,0 +1,92 @@
+From patchwork Thu Apr 26 23:28:34 2018
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2] MIPS: c-r4k: fix data corruption related to cache coherence.
+X-Patchwork-Submitter: NeilBrown 
+X-Patchwork-Id: 19259
+Message-Id: <87vacdlf8d@notabene.neil.brown.name>
+To: James Hogan 
+Cc: Ralf Baechle ,
+ Paul Burton , linux-m...@linux-mips.org,
+ linux-ker...@vger.kernel.org
+Date: Fri, 27 Apr 2018 09:28:34 +1000
+From: NeilBrown 
+List-Id: linux-mips 
+
+When DMA will be performed to a MIPS32 1004K CPS, the
+L1-cache for the range needs to be flushed and invalidated
+first.
+The code currently takes one of two approaches.
+1/ If the range is less than the size of the dcache, then
+   HIT type requests flush/invalidate cache lines for the
+   particular addresses.  HIT-type requests a globalised
+   by the CPS so this is safe on SMP.
+
+2/ If the range is larger than the size of dcache, then
+   INDEX type requests flush/invalidate the whole cache.
+   INDEX type requests affect the local cache only. CPS
+   does not propagate them in any way.  So this invalidation
+   is not safe on SMP CPS systems.
+
+Data corruption due to '2' can quite easily be demonstrated by
+repeatedly "echo 3 > /proc/sys/vm/drop_caches" and then sha1sum
+a file that is several times the size of available memory.
+Dropping caches means that large contiguous extents (large than
+dcache) are more likely.
+
+This was not a problem before Linux-4.8 because option 2 was
+never used if CONFIG_MIPS_CPS was defined.  The commit
+which removed that apparently didn't appreciate the full
+consequence of the change.
+
+We could, in theory, globalize the INDEX based flush by sending an IPI
+to other cores.  These cache invalidation routines can be called with
+interrupts disabled and synchronous IPI require interrupts to be
+enabled.  Asynchronous IPI may not trigger writeback soon enough.
+So we cannot use IPI in practice.
+
+We can already test is IPI would be needed for an INDEX operation
+with r4k_op_needs_ipi(R4K_INDEX).  If this is True then we mustn't try
+the INDEX approach as we cannot use IPI.  If this is False (e.g. when
+there is only one core and hence one L1 cache) then it is safe to
+use the INDEX approach without IPI.
+
+This patch avoids options 2 if r4k_op_needs_ipi(R4K_INDEX), and so
+eliminates the corruption.
+
+Fixes: c00ab4896ed5 ("MIPS: Remove cpu_has_safe_index_cacheops")
+Cc: sta...@vger.kernel.org # v4.8+
+Signed-off-by: NeilBrown 
+---
+ arch/mips/mm/c-r4k.c | 9 ++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
+index 6f534b209971..e12dfa48b478 100644
+--- a/arch/mips/mm/c-r4k.c
 b/arch/mips/mm/c-r4k.c
+@@ -851,9 +851,12 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, 
unsigned long size)
+   /*
+* Either no secondary cache or the available caches don't have the
+* subset property so we have to flush the primary caches
+-   * explicitly
++   * explicitly.
++   * If we would need IPI to perform an INDEX-type operation, then
++   * we have to use the HIT-type alternative as IPI cannot be used
++   * here due to interrupts possibly being disabled.
+*/
+-  if (size >= dcache_size) {
++  if (!r4k_op_needs_ipi(R4K_INDEX) && size >= dcache_size) {
+   r4k_blast_dcache();
+   } else {
+   R4600_HIT_CACHEOP_WAR_IMPL;
+@@ -890,7 +893,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned 
long size)
+   return;
+   }
+ 
+-  if (size >= dcache_size) {
++  if (!r4k_op_needs_ipi(R4K_INDEX) && size >= dcache_size) {
+   r4k_blast_dcache();
+   } else {
+   R4600_HIT_CACHEOP_WAR_IMPL;
-- 
2.7.4



Re: [LEDE-DEV] [openwrt/openwrt] ar71xx: Ubiquiti Airmax M: add relocate-kernel to invalidate cache

2018-04-26 Thread Etienne Champetier
2018-04-26 13:10 GMT-07:00 Matthias Schiffer :
> On 04/26/2018 09:22 PM, Etienne Champetier wrote:
>> Hi Matthias,
>>
>> 2018-04-26 11:43 GMT-07:00 LEDE Commits :
>>> neoraider pushed a commit to openwrt/openwrt.git, branch lede-17.01:
>>> https://git.lede-project.org/eed9d40133fe6468cc253d0345c7d7332d2aaa7c
>>>
>>> commit eed9d40133fe6468cc253d0345c7d7332d2aaa7c
>>> Author: Matthias Schiffer 
>>> AuthorDate: Thu Apr 26 20:04:48 2018 +0200
>>>
>>> ar71xx: Ubiquiti Airmax M: add relocate-kernel to invalidate cache
>>>
>>> Some Ubiquiti U-boot versions, in particular the "U-Boot 1.1.4.2-s956
>>> (Jun 10 2015 - 10:54:50)" found with AirOS 5.6, do not correctly flush 
>>> the
>>> caches for the whole kernel address range after decompressing the kernel
>>> image, leading to hard to debug boot failures, depending on kernel 
>>> version
>>> and configuration.
>>>
>>> As a workaround, prepend the relocate-kernels loader, which will 
>>> invalidate
>>> the caches after moving the kernel to the correct load address.
>>
>> So if I understand correctly,
>> with this commit I don't need to downgrade my bullet M to v.5.5.10
>> (U-Boot 1.1.4.2-s594 (Dec  5 2012 - 15:23:07))
>> and I can just downgrade to v.5.6.x (U-Boot 1.1.4.2-s956 (Jun 10 2015
>> - 10:54:50)) and maybe even the firsts 6.0.X (without the signed
>> image)
>>
>> mtdparts differences between the 2 uboot version:
>> https://community.ubnt.com/t5/airOS-SDK-Custom-Development/5-6-2-TFTP-ERROR/m-p/1310208/highlight/true#M2354
>
> AFAIK, both AirOS 5.5 and 5.6 use the same flash layout. The mtdparts with
> the EEPROM at 0x0073 (also described in
> https://wiki.openwrt.org/toh/ubiquiti/airmaxm ) is bogus and was not
> directly caused by the newer Uboot or AirOS, but by installing "broken"
> OpenWrt images (everything before [1]) from AirOS 5.6; the commit message
> of [1] contains further details. Certain Uboot versions coming with 5.6
> also did not unlock the flash chip, leading to unwritable flash on OpenWrt
> (fixed in [2]).
>
> The cache invalidation issue recently appeared after the update to kernel
> 4.4.120 in lede-17.01, but I'm not sure if the OpenWrt/LEDE default kernel
> configuration is affected.
>
> With these 3 fixes, installing OpenWrt from AirOS 5.6 should work fine; I
> don't know about 6.0. It seems that I never backported [2] to lede-17.01
> because it requires 2 other patches on kernel 4.4, but we have a downstream
> patch for that in Gluon [3].

Ok, so as of today, if I want to install 17.01, because [2] is not
backported I need to flash 5.5.10 first (old uboot)
If I install master 5.6.X should be fine

I just bought a bullet M for testing / to play with,
if you have any commands in mind that you want me to run on different
AirOS versions, just tell me

Thanks for the explanation
Etienne

>
> Regards,
> Matthias
>
>
> [1]
> https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=076d58d3440f382c536ea8874f58b0df23c263bc
> [2]
> https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=1abb5c6db11bd8a3c79b9e24ac4511985fe39ea4
> [3]
> https://raw.githubusercontent.com/freifunk-gluon/gluon/563f351b78924bb12c2db49f63baa4db86c2c16b/patches/lede/0027-generic-mtd-backport-unlock-support-and-asserted-fixes-for-certain-Winbond-Spansion-flash-chips.patch
>
>
>
>
>>
>> Thanks
>> Etienne
>>
>

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


Re: [LEDE-DEV] [openwrt/openwrt] ar71xx: Ubiquiti Airmax M: add relocate-kernel to invalidate cache

2018-04-26 Thread Matthias Schiffer
On 04/26/2018 09:22 PM, Etienne Champetier wrote:
> Hi Matthias,
> 
> 2018-04-26 11:43 GMT-07:00 LEDE Commits :
>> neoraider pushed a commit to openwrt/openwrt.git, branch lede-17.01:
>> https://git.lede-project.org/eed9d40133fe6468cc253d0345c7d7332d2aaa7c
>>
>> commit eed9d40133fe6468cc253d0345c7d7332d2aaa7c
>> Author: Matthias Schiffer 
>> AuthorDate: Thu Apr 26 20:04:48 2018 +0200
>>
>> ar71xx: Ubiquiti Airmax M: add relocate-kernel to invalidate cache
>>
>> Some Ubiquiti U-boot versions, in particular the "U-Boot 1.1.4.2-s956
>> (Jun 10 2015 - 10:54:50)" found with AirOS 5.6, do not correctly flush 
>> the
>> caches for the whole kernel address range after decompressing the kernel
>> image, leading to hard to debug boot failures, depending on kernel 
>> version
>> and configuration.
>>
>> As a workaround, prepend the relocate-kernels loader, which will 
>> invalidate
>> the caches after moving the kernel to the correct load address.
> 
> So if I understand correctly,
> with this commit I don't need to downgrade my bullet M to v.5.5.10
> (U-Boot 1.1.4.2-s594 (Dec  5 2012 - 15:23:07))
> and I can just downgrade to v.5.6.x (U-Boot 1.1.4.2-s956 (Jun 10 2015
> - 10:54:50)) and maybe even the firsts 6.0.X (without the signed
> image)
> 
> mtdparts differences between the 2 uboot version:
> https://community.ubnt.com/t5/airOS-SDK-Custom-Development/5-6-2-TFTP-ERROR/m-p/1310208/highlight/true#M2354

AFAIK, both AirOS 5.5 and 5.6 use the same flash layout. The mtdparts with
the EEPROM at 0x0073 (also described in
https://wiki.openwrt.org/toh/ubiquiti/airmaxm ) is bogus and was not
directly caused by the newer Uboot or AirOS, but by installing "broken"
OpenWrt images (everything before [1]) from AirOS 5.6; the commit message
of [1] contains further details. Certain Uboot versions coming with 5.6
also did not unlock the flash chip, leading to unwritable flash on OpenWrt
(fixed in [2]).

The cache invalidation issue recently appeared after the update to kernel
4.4.120 in lede-17.01, but I'm not sure if the OpenWrt/LEDE default kernel
configuration is affected.

With these 3 fixes, installing OpenWrt from AirOS 5.6 should work fine; I
don't know about 6.0. It seems that I never backported [2] to lede-17.01
because it requires 2 other patches on kernel 4.4, but we have a downstream
patch for that in Gluon [3].

Regards,
Matthias


[1]
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=076d58d3440f382c536ea8874f58b0df23c263bc
[2]
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=1abb5c6db11bd8a3c79b9e24ac4511985fe39ea4
[3]
https://raw.githubusercontent.com/freifunk-gluon/gluon/563f351b78924bb12c2db49f63baa4db86c2c16b/patches/lede/0027-generic-mtd-backport-unlock-support-and-asserted-fixes-for-certain-Winbond-Spansion-flash-chips.patch




> 
> Thanks
> Etienne
> 



signature.asc
Description: OpenPGP digital signature
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [openwrt/openwrt] ar71xx: Ubiquiti Airmax M: add relocate-kernel to invalidate cache

2018-04-26 Thread Etienne Champetier
Hi Matthias,

2018-04-26 11:43 GMT-07:00 LEDE Commits :
> neoraider pushed a commit to openwrt/openwrt.git, branch lede-17.01:
> https://git.lede-project.org/eed9d40133fe6468cc253d0345c7d7332d2aaa7c
>
> commit eed9d40133fe6468cc253d0345c7d7332d2aaa7c
> Author: Matthias Schiffer 
> AuthorDate: Thu Apr 26 20:04:48 2018 +0200
>
> ar71xx: Ubiquiti Airmax M: add relocate-kernel to invalidate cache
>
> Some Ubiquiti U-boot versions, in particular the "U-Boot 1.1.4.2-s956
> (Jun 10 2015 - 10:54:50)" found with AirOS 5.6, do not correctly flush the
> caches for the whole kernel address range after decompressing the kernel
> image, leading to hard to debug boot failures, depending on kernel version
> and configuration.
>
> As a workaround, prepend the relocate-kernels loader, which will 
> invalidate
> the caches after moving the kernel to the correct load address.

So if I understand correctly,
with this commit I don't need to downgrade my bullet M to v.5.5.10
(U-Boot 1.1.4.2-s594 (Dec  5 2012 - 15:23:07))
and I can just downgrade to v.5.6.x (U-Boot 1.1.4.2-s956 (Jun 10 2015
- 10:54:50)) and maybe even the firsts 6.0.X (without the signed
image)

mtdparts differences between the 2 uboot version:
https://community.ubnt.com/t5/airOS-SDK-Custom-Development/5-6-2-TFTP-ERROR/m-p/1310208/highlight/true#M2354

Thanks
Etienne

>
> Reported-by: Andreas Ziegler 
> Signed-off-by: Matthias Schiffer 
> ---
>  target/linux/ar71xx/image/ubnt.mk | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/target/linux/ar71xx/image/ubnt.mk 
> b/target/linux/ar71xx/image/ubnt.mk
> index 65ed708..899d5d0 100644
> --- a/target/linux/ar71xx/image/ubnt.mk
> +++ b/target/linux/ar71xx/image/ubnt.mk
> @@ -47,6 +47,7 @@ define Device/ubnt-xm
>UBNT_TYPE := XM
>UBNT_BOARD := XM
>UBNT_CHIP := ar7240
> +  KERNEL := kernel-bin | patch-cmdline | relocate-kernel | lzma | uImage lzma
>IMAGES := sysupgrade.bin factory.bin
>IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage-split
>IMAGE/sysupgrade.bin = append-kernel | pad-to (BLOCKSIZE) | 
> append-rootfs | pad-rootfs | check-size (IMAGE_SIZE)
>
> ___
> lede-commits mailing list
> lede-comm...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-commits

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


Re: [LEDE-DEV] custom files not working?

2018-04-26 Thread Hannu Nyman

Custom files work quite normally for me.
Just compiled and flashed r6763-746c590882, and I can see my custom files 
quite normally in /etc.


At the first glance I do not see any obvious mistake in your workflow.


Koen Vandeputte kirjoitti 26.4.2018 klo 16:58:

Hi All,

I'm checking this functionality:

https://openwrt.org/docs/guide-developer/build-system/use-buildsystem#custom_files 




steps done:

- clone openwrt master repo  (~/openwrt )
- make menuconfig & select target
- add custom files:
--> ~/openwrt/files/etc/test.txt  (containing some random bytes)
--> ~/openwrt/files/root/test2.txt  (containing some random bytes)
- make
- flash image cleanly to device (tested both JTAG & tftp load image via 
u-boot)



After booting,  I'm not seeing the 2 files I've added.

Am I doing something wrong here?


Thanks,

Koen





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


Re: [LEDE-DEV] [PATCH 1/2] x86: add amd microcode entries to grub config

2018-04-26 Thread Stijn Segers
Op di, 24 apr 2018 om 10:18 , schreef Tomasz Maciej Nowak 
:

W dniu 24.04.2018 o 22:00, Stijn Segers pisze:
[snip]


  I'm not sure what's going wrong here, I'm on a clean master tree 
but your first patch does not apply:


  $ git am 1.patch
  Applying: x86: add amd microcode entries to grub config
  error: patch failed: 
target/linux/x86/base-files/lib/preinit/02_load_x86_ucode:1
  error: 
target/linux/x86/base-files/lib/preinit/02_load_x86_ucode: patch 
does not apply

  error: patch failed: target/linux/x86/image/grub-iso.cfg:10
  error: target/linux/x86/image/grub-iso.cfg: patch does not apply
  error: patch failed: target/linux/x86/image/grub.cfg:10
  error: target/linux/x86/image/grub.cfg: patch does not apply
  Patch failed at 0001 x86: add amd microcode entries to grub 
config

  $ ./scripts/getver.sh
  r6755-d089a5d773



 Hi.

 I did wrongly spell myself out instead of "This series needs to be 
applied on top of 'intel-microcode: load as early as possible' 
series." it should be: "This series needs to be applied after 
'intel-microcode: load as early as possible' series.". Sorry about 
it.


 Nope - turns out I was too quick, my apologies :-(. I merely looked 
at your first mail that actually had a patch for AMD and not at the 
one preceding it (which stated I needed to apply the Intel series 
first). Applied cleanly. How do I check whether it's functional? I 
grepped dmesg for AMD or ucode, but nothing shows. Logread doesn't 
work at all (but I reckon that's unrelated).


You should grep -i for "microcode", it should say something like: 
"microcode updated early ..." probably on first line in kernel log.


Strange thing is that logread doesn't work, but I don't know what's 
causing this.


Hi Thomas,

I just booted OpenWrt off my USB stick, grepping for microcode returned 
this:


[2.038790] microcode: CPU0: patch_level=0x08001129
[2.043782] microcode: CPU1: patch_level=0x08001129
[2.114395] microcode: CPU2: patch_level=0x08001129
[2.119391] microcode: CPU3: patch_level=0x08001129
[2.124390] microcode: CPU4: patch_level=0x08001129
[2.129382] microcode: CPU5: patch_level=0x08001129
[2.134512] microcode: CPU6: patch_level=0x08001129
[2.139498] microcode: CPU7: patch_level=0x08001129
[2.144491] microcode: Microcode Update Driver: v2.2.

Does that help you any? Tested on a Ryzen 1800X.

I reckon logread not working might have to do with my using the 
combined-ext4 image, /tmp is kinda broken as well.


Cheers

Stijn





 Dmesg does say full retpoline support has been enabled, but unless 
I'm mistaken that was a compiler feature, not something that could 
be solved with microcode alone>

 Cheers

 Stijn






  Second does apply cleanly.

  Cheers

  Stijn


[snip]

--
TMN

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



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


Re: [LEDE-DEV] [PATCH] kernel: bump 4.14 to 4.14.37

2018-04-26 Thread Stijn Segers
Op do, 26 apr 2018 om 6:20 , schreef Koen Vandeputte 
:

Refreshed all patches

Compile-tested on: cns3xxx, imx6
Runtime-tested on: cns3xxx, imx6


Compile-tested on: ramips/mt7621, x86/64
Run-tested on: ramips/mt7621, x86/64



Signed-off-by: Koen Vandeputte 

Tested-by: Stijn Segers 


---
 include/kernel-version.mk
 | 4 ++--
 .../backport-4.14/336-netfilter-exit_net-cleanup-check-added.patch   
 | 2 +-
 .../pending-4.14/610-netfilter_match_bypass_default_checks.patch 
 | 2 +-

 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 8d0a62347cbf..cf84e31f7b0f 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -5,12 +5,12 @@ LINUX_RELEASE?=1
 LINUX_VERSION-3.18 = .71
 LINUX_VERSION-4.4 = .121
 LINUX_VERSION-4.9 = .96
-LINUX_VERSION-4.14 = .36
+LINUX_VERSION-4.14 = .37

 LINUX_KERNEL_HASH-3.18.71 = 
5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
 LINUX_KERNEL_HASH-4.4.121 = 
44a88268b5088dc326b30c9b9133ac35a9a200b636b7268d08f32abeae6ca729
 LINUX_KERNEL_HASH-4.9.96 = 
826f596eb5197f8b17304649c2990dd7b766f5c79076cae79f4261c40cea877f
-LINUX_KERNEL_HASH-4.14.36 = 
cae24404d7b5812a331cbbc430b3ab75ca0f76eb16803528cbffbc42e768bc43
+LINUX_KERNEL_HASH-4.14.37 = 
8197e7ed3620713e412905430a7bf93e2048384042ffba189a66f0eeb6908e92


 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst 
https://,,$(1
 sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst 
.,_,$(subst -,_,$(subst /,_,$(1)))
diff --git 
a/target/linux/generic/backport-4.14/336-netfilter-exit_net-cleanup-check-added.patch 
b/target/linux/generic/backport-4.14/336-netfilter-exit_net-cleanup-check-added.patch

index 92d7942d8684..d930751d415f 100644
--- 
a/target/linux/generic/backport-4.14/336-netfilter-exit_net-cleanup-check-added.patch
+++ 
b/target/linux/generic/backport-4.14/336-netfilter-exit_net-cleanup-check-added.patch
@@ -80,7 +80,7 @@ Signed-off-by: Pablo Neira Ayuso 

  static void nfnl_queue_net_exit_batch(struct list_head 
*net_exit_list)

 --- a/net/netfilter/x_tables.c
 +++ b/net/netfilter/x_tables.c
-@@ -1754,8 +1754,17 @@ static int __net_init xt_net_init(struct
+@@ -1785,8 +1785,17 @@ static int __net_init xt_net_init(struct
return 0;
  }

diff --git 
a/target/linux/generic/pending-4.14/610-netfilter_match_bypass_default_checks.patch 
b/target/linux/generic/pending-4.14/610-netfilter_match_bypass_default_checks.patch

index ec269b6cd880..36118796094d 100644
--- 
a/target/linux/generic/pending-4.14/610-netfilter_match_bypass_default_checks.patch
+++ 
b/target/linux/generic/pending-4.14/610-netfilter_match_bypass_default_checks.patch

@@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau 
for (i = sizeof(struct ipt_entry);
 i < e->target_offset;
 i += m->u.match_size) {
-@@ -1224,12 +1261,15 @@ compat_copy_entry_to_user(struct ipt_ent
+@@ -1226,12 +1263,15 @@ compat_copy_entry_to_user(struct ipt_ent
compat_uint_t origsize;
const struct xt_entry_match *ematch;
int ret = 0;
--
2.7.4


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



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


[LEDE-DEV] [PATCH] kernel: bump 4.14 to 4.14.37

2018-04-26 Thread Koen Vandeputte
Refreshed all patches

Compile-tested on: cns3xxx, imx6
Runtime-tested on: cns3xxx, imx6

Signed-off-by: Koen Vandeputte 
---
 include/kernel-version.mk | 4 ++--
 .../backport-4.14/336-netfilter-exit_net-cleanup-check-added.patch| 2 +-
 .../pending-4.14/610-netfilter_match_bypass_default_checks.patch  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 8d0a62347cbf..cf84e31f7b0f 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -5,12 +5,12 @@ LINUX_RELEASE?=1
 LINUX_VERSION-3.18 = .71
 LINUX_VERSION-4.4 = .121
 LINUX_VERSION-4.9 = .96
-LINUX_VERSION-4.14 = .36
+LINUX_VERSION-4.14 = .37
 
 LINUX_KERNEL_HASH-3.18.71 = 
5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
 LINUX_KERNEL_HASH-4.4.121 = 
44a88268b5088dc326b30c9b9133ac35a9a200b636b7268d08f32abeae6ca729
 LINUX_KERNEL_HASH-4.9.96 = 
826f596eb5197f8b17304649c2990dd7b766f5c79076cae79f4261c40cea877f
-LINUX_KERNEL_HASH-4.14.36 = 
cae24404d7b5812a331cbbc430b3ab75ca0f76eb16803528cbffbc42e768bc43
+LINUX_KERNEL_HASH-4.14.37 = 
8197e7ed3620713e412905430a7bf93e2048384042ffba189a66f0eeb6908e92
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1
 sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst 
-,_,$(subst /,_,$(1)))
diff --git 
a/target/linux/generic/backport-4.14/336-netfilter-exit_net-cleanup-check-added.patch
 
b/target/linux/generic/backport-4.14/336-netfilter-exit_net-cleanup-check-added.patch
index 92d7942d8684..d930751d415f 100644
--- 
a/target/linux/generic/backport-4.14/336-netfilter-exit_net-cleanup-check-added.patch
+++ 
b/target/linux/generic/backport-4.14/336-netfilter-exit_net-cleanup-check-added.patch
@@ -80,7 +80,7 @@ Signed-off-by: Pablo Neira Ayuso 
  static void nfnl_queue_net_exit_batch(struct list_head *net_exit_list)
 --- a/net/netfilter/x_tables.c
 +++ b/net/netfilter/x_tables.c
-@@ -1754,8 +1754,17 @@ static int __net_init xt_net_init(struct
+@@ -1785,8 +1785,17 @@ static int __net_init xt_net_init(struct
return 0;
  }
  
diff --git 
a/target/linux/generic/pending-4.14/610-netfilter_match_bypass_default_checks.patch
 
b/target/linux/generic/pending-4.14/610-netfilter_match_bypass_default_checks.patch
index ec269b6cd880..36118796094d 100644
--- 
a/target/linux/generic/pending-4.14/610-netfilter_match_bypass_default_checks.patch
+++ 
b/target/linux/generic/pending-4.14/610-netfilter_match_bypass_default_checks.patch
@@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau 
for (i = sizeof(struct ipt_entry);
 i < e->target_offset;
 i += m->u.match_size) {
-@@ -1224,12 +1261,15 @@ compat_copy_entry_to_user(struct ipt_ent
+@@ -1226,12 +1263,15 @@ compat_copy_entry_to_user(struct ipt_ent
compat_uint_t origsize;
const struct xt_entry_match *ematch;
int ret = 0;
-- 
2.7.4


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


[LEDE-DEV] [PATCH] brcm2708: Add support for raspberry pi 3 b+.

2018-04-26 Thread Christo Nedev
From: Christo Nedev 

Signed-off-by: Christo Nedev 
---
 .../brcm2708/base-files/etc/board.d/02_network |   3 +-
 .../lib/preinit/05_set_preinit_iface_brcm2708  |   1 +
 target/linux/brcm2708/bcm2709/config-4.9   |   1 +
 target/linux/brcm2708/bcm2710/config-4.9   |   1 +
 target/linux/brcm2708/image/Makefile   |  12 +-
 .../950-1002-bcm2708-raspberry-pi-3-b-plus.patch   | 298 +
 6 files changed, 309 insertions(+), 7 deletions(-)
 create mode 100644 
target/linux/brcm2708/patches-4.9/950-1002-bcm2708-raspberry-pi-3-b-plus.patch

diff --git a/target/linux/brcm2708/base-files/etc/board.d/02_network 
b/target/linux/brcm2708/base-files/etc/board.d/02_network
index a9c947b65a..c8449bb78f 100755
--- a/target/linux/brcm2708/base-files/etc/board.d/02_network
+++ b/target/linux/brcm2708/base-files/etc/board.d/02_network
@@ -15,7 +15,8 @@ raspberrypi,model-b |\
 raspberrypi,model-b-plus |\
 raspberrypi,model-b-rev2 |\
 raspberrypi,2-model-b |\
-raspberrypi,3-model-b)
+raspberrypi,3-model-b |\
+raspberrypi,3-model-b-plus)
ucidef_set_interface_lan "eth0"
;;
 
diff --git 
a/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708 
b/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708
index 76eb5905e8..3a5c198fc6 100644
--- a/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708
+++ b/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708
@@ -8,6 +8,7 @@ set_preinit_iface() {
case "$(board_name)" in
raspberrypi,2-model-b |\
raspberrypi,3-model-b |\
+   raspberrypi,3-model-b-plus |\
raspberrypi,model-b |\
raspberrypi,model-b-plus |\
raspberrypi,model-b-rev2)
diff --git a/target/linux/brcm2708/bcm2709/config-4.9 
b/target/linux/brcm2708/bcm2709/config-4.9
index 71884a5fa1..1134f0d113 100644
--- a/target/linux/brcm2708/bcm2709/config-4.9
+++ b/target/linux/brcm2708/bcm2709/config-4.9
@@ -398,6 +398,7 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 CONFIG_USB_COMMON=y
 CONFIG_USB_DWCOTG=y
 # CONFIG_USB_EHCI_HCD is not set
+CONFIG_USB_LAN78XX=y
 CONFIG_USB_NET_DRIVERS=y
 CONFIG_USB_NET_SMSC95XX=y
 CONFIG_USB_STORAGE=y
diff --git a/target/linux/brcm2708/bcm2710/config-4.9 
b/target/linux/brcm2708/bcm2710/config-4.9
index d402f4b573..b7a5ccf3db 100644
--- a/target/linux/brcm2708/bcm2710/config-4.9
+++ b/target/linux/brcm2708/bcm2710/config-4.9
@@ -416,6 +416,7 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 CONFIG_USB_COMMON=y
 CONFIG_USB_DWCOTG=y
 # CONFIG_USB_EHCI_HCD is not set
+CONFIG_USB_LAN78XX=y
 CONFIG_USB_NET_DRIVERS=y
 CONFIG_USB_NET_SMSC95XX=y
 CONFIG_USB_STORAGE=y
diff --git a/target/linux/brcm2708/image/Makefile 
b/target/linux/brcm2708/image/Makefile
index 9ea9a07a9d..691212de9f 100644
--- a/target/linux/brcm2708/image/Makefile
+++ b/target/linux/brcm2708/image/Makefile
@@ -64,9 +64,9 @@ ifeq ($(SUBTARGET),bcm2708)
 endif
 
 define Device/rpi-2
-  DEVICE_TITLE := Raspberry Pi 2B/3B/3CM
-  DEVICE_DTS := bcm2709-rpi-2-b bcm2710-rpi-3-b bcm2710-rpi-cm3
-  SUPPORTED_DEVICES := rpi-2-b rpi-3-b rpi-cm raspberrypi,2-model-b 
raspberrypi,3-model-b raspberrypi,compute-module-3
+  DEVICE_TITLE := Raspberry Pi 2B/3B/3B+/3CM
+  DEVICE_DTS := bcm2709-rpi-2-b bcm2710-rpi-3-b bcm2710-rpi-3-b-plus 
bcm2710-rpi-cm3
+  SUPPORTED_DEVICES := rpi-2-b rpi-3-b rpi-3-b-plus rpi-cm 
raspberrypi,2-model-b raspberrypi,3-model-b raspberrypi,3-model-b-plus 
raspberrypi,compute-module-3
 endef
 ifeq ($(SUBTARGET),bcm2709)
   TARGET_DEVICES += rpi-2
@@ -74,9 +74,9 @@ endif
 
 define Device/rpi-3
   KERNEL_IMG := kernel8.img
-  DEVICE_TITLE := Raspberry Pi 3B (64 bit)
-  DEVICE_DTS := broadcom/bcm2710-rpi-3-b
-  SUPPORTED_DEVICES := rpi-3-b raspberrypi,3-model-b
+  DEVICE_TITLE := Raspberry Pi 3B/3B+
+  DEVICE_DTS := broadcom/bcm2710-rpi-3-b broadcom/bcm2710-rpi-3-b-plus
+  SUPPORTED_DEVICES := rpi-3-b rpi-3-b-plus raspberrypi,3-model-b 
raspberrypi,3-model-b-plus
 endef
 ifeq ($(SUBTARGET),bcm2710)
   TARGET_DEVICES += rpi-3
diff --git 
a/target/linux/brcm2708/patches-4.9/950-1002-bcm2708-raspberry-pi-3-b-plus.patch
 
b/target/linux/brcm2708/patches-4.9/950-1002-bcm2708-raspberry-pi-3-b-plus.patch
new file mode 100644
index 00..5eb129fda7
--- /dev/null
+++ 
b/target/linux/brcm2708/patches-4.9/950-1002-bcm2708-raspberry-pi-3-b-plus.patch
@@ -0,0 +1,298 @@
+--- a/arch/arm/boot/dts/Makefile
 b/arch/arm/boot/dts/Makefile
+@@ -7,6 +7,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \
+   bcm2708-rpi-0-w.dtb \
+   bcm2709-rpi-2-b.dtb \
+   bcm2710-rpi-3-b.dtb \
++  bcm2710-rpi-3-b-plus.dtb \
+   bcm2710-rpi-cm3.dtb
+ 
+ dtb-$(CONFIG_ARCH_ALPINE) += \
+--- /dev/null
 b/arch/arm/boot/dts/bcm2710-rpi-3-b-plus.dts
+@@ -0,0 +1,220 @@
++/dts-v1/;
++
++#include "bcm2710.dtsi"
++#include "bcm283x-rpi-lan7515.dtsi"
++
++/ {
++  compatible = "raspberrypi,3-model-b-plus", "brcm,bcm2837", 
"brcm,bcm2836";
++  

[LEDE-DEV] custom files not working?

2018-04-26 Thread Koen Vandeputte

Hi All,

I'm checking this functionality:

https://openwrt.org/docs/guide-developer/build-system/use-buildsystem#custom_files


steps done:

- clone openwrt master repo  (~/openwrt )
- make menuconfig & select target
- add custom files:
--> ~/openwrt/files/etc/test.txt  (containing some random bytes)
--> ~/openwrt/files/root/test2.txt  (containing some random bytes)
- make
- flash image cleanly to device (tested both JTAG & tftp load image via 
u-boot)



After booting,  I'm not seeing the 2 files I've added.

Am I doing something wrong here?


Thanks,

Koen

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


[LEDE-DEV] help on adding a slightly different router

2018-04-26 Thread davidea
hi people, i'm moving my first step on the source code side, im' not a 
coder, then sorry if i make some big mistake !!


i have a router MqMaker WITI board , this router is supported in the 
tree but only in the 256mb ram flavour , but my version is the 512 mb 
flavour


following this guide i change the code

https://openwrt.org/docs/guide-developer/adding_new_device

basing my work on this source

 https://git.openwrt.org/openwrt/openwrt.git

but without success ,when i boot via tftp i  obtain a kernal panic ...


here the file fist , that i've changed

 grep -lri witi ./
./linux/ramips/base-files/etc/board.d/02_network
./linux/ramips/base-files/etc/diag.sh
./linux/ramips/base-files/lib/ramips.sh
./linux/ramips/base-files/lib/upgrade/platform.sh
./linux/ramips/base-files/sbin/fixup-mac-address
./linux/ramips/dts/WITI.dts
./linux/ramips/dts/WITI512.dts
./linux/ramips/image/mt7621.mk


and here the diff


+++ ./witi/target/linux/ramips/base-files/etc/diag.sh   2018-04-24 
08:33:36.448378665 +
--- ./openwrt/target/linux/ramips/base-files/etc/diag.sh 2018-04-26 
08:07:28.99123 +

@@ -280,7 +280,6 @@
    ;;
    w306r-v20|\
    witi|\
+   witi512|\
    zbt-wr8305rt)
    status_led="$boardname:green:sys"
    ;;


+++ ./witi/target/linux/ramips/base-files/etc/diag.sh   2018-04-24 
08:33:36.448378665 +
--- ./openwrt/target/linux/ramips/base-files/etc/diag.sh 2018-04-26 
08:07:28.99123 +

@@ -280,7 +280,6 @@
    ;;
    w306r-v20|\
    witi|\
+   witi512|\
    zbt-wr8305rt)
    status_led="$boardname:green:sys"
    ;;

+++ ./witi/target/linux/ramips/base-files/lib/ramips.sh 2018-04-24 
08:34:29.507527711 +
--- ./openwrt/target/linux/ramips/base-files/lib/ramips.sh 2018-04-26 
08:07:28.996222067 +

@@ -580,9 +580,6 @@
    *"WiTi")
 name="witi"
    ;;
+   *"WiTi-512")
+    name="witi-512"
+   ;;
    *"WIZARD 8800")
    name="wizard8800"
    ;;



--- ./openwrt/target/linux/ramips/base-files/lib/upgrade/platform.sh 
2018-04-26 08:07:28.996222067 +
+++ ./witi/target/linux/ramips/base-files/lib/upgrade/platform.sh 
2018-04-24 08:34:54.147140864 +

@@ -173,6 +173,7 @@
    widora,neo-16m|\
    widora,neo-32m|\
    witi|\
+   witi512|\
    wizfi630a|\
    wl-330n|\
    wl-330n3g|\

--- ./openwrt/target/linux/ramips/base-files/sbin/fixup-mac-address 
2018-04-26 08:07:28.996222067 +
+++ ./witi/target/linux/ramips/base-files/sbin/fixup-mac-address 
2018-04-24 08:36:16.185887196 +

@@ -17,6 +17,15 @@
    echo "Unsupported board"
    exit 1
    ;;
+
+   witi512)
+   partname=factory
+   offset=$((0xe000))
+   ;;
+   *)
+   echo "Unsupported board"
+   exit 1
+   ;;
 esac

 while [ -n "$1" ]; do


--- ./openwrt/target/linux/ramips/dts/WITI.dts  2018-04-26 
08:07:29.004221953 +
+++ ./witi/target/linux/ramips/dts/WITI512.dts  2018-04-24 
08:21:24.814159470 +

@@ -7,11 +7,11 @@

 / {
    compatible = "mqmaker,witi", "mediatek,mt7621-soc";
-   model = "MQmaker WiTi";
+   model = "MQmaker WiTi (512)";

    memory@0 {
    device_type = "memory";
-   reg = <0x0 0x1000>;
+   reg = <0x0 0x2000>;
    };

    chosen {



--- ./openwrt/target/linux/ramips/image/mt7621.mk   2018-04-26 
08:07:29.012221838 +
+++ ./witi/target/linux/ramips/image/mt7621.mk  2018-04-24 
08:40:45.574063959 +

@@ -320,6 +320,16 @@
 endef
 TARGET_DEVICES += witi

+define Device/witi512
+  DTS := WITI512
+  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+  DEVICE_TITLE := MQmaker WiTi 512
+  DEVICE_PACKAGES := \
+   kmod-ata-core kmod-ata-ahci kmod-mt76x2 kmod-sdhci-mt7620 
kmod-usb3 \

+   kmod-usb-ledtrig-usbport wpad-mini
+endef
+TARGET_DEVICES += witi512
+
 define Device/wndr3700v5
   DTS := WNDR3700V5
   IMAGE_SIZE := $(ralink_default_fw_size_16M)




and here the boot log


https://pastebin.com/n78TAhmr

how i can fix it ? where i must put my eyes on ?


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