From f705008d7e6967dbdba040e97b2b77360d9c7eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 4 Aug 2021 12:30:38 +0200 Subject: [PATCH 01/53] firmware-utils: replace GPL 2.0 boilerplate/reference with SPDX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This uses "GPL-2.0-only" header for files identified using scancode license scanner with 100% score as GPL 2.0. Signed-off-by: Rafał Miłecki Reviewed-by: Linus Walleij Acked-by: Stijn Tintel --- tools/firmware-utils/src/add_header.c | 14 +------------- tools/firmware-utils/src/buffalo-enc.c | 6 +----- tools/firmware-utils/src/buffalo-lib.c | 6 +----- tools/firmware-utils/src/buffalo-lib.h | 6 +----- tools/firmware-utils/src/buffalo-tag.c | 6 +----- tools/firmware-utils/src/buffalo-tftp.c | 6 +----- tools/firmware-utils/src/dns313-header.c | 2 +- tools/firmware-utils/src/edimax_fw_header.c | 6 +----- tools/firmware-utils/src/fix-u-media-header.c | 6 +----- tools/firmware-utils/src/mkbrncmdline.c | 14 +------------- tools/firmware-utils/src/mkbrnimg.c | 14 +------------- tools/firmware-utils/src/mkbuffaloimg.c | 6 +----- tools/firmware-utils/src/mkcameofw.c | 6 +----- tools/firmware-utils/src/mkcasfw.c | 6 +----- tools/firmware-utils/src/mkdapimg2.c | 5 +---- tools/firmware-utils/src/mkdhpimg.c | 6 +----- tools/firmware-utils/src/mkdniimg.c | 6 +----- tools/firmware-utils/src/mkhilinkfw.c | 14 +------------- tools/firmware-utils/src/mkmerakifw.c | 6 +----- tools/firmware-utils/src/mkplanexfw.c | 6 +----- tools/firmware-utils/src/mkporayfw.c | 6 +----- tools/firmware-utils/src/mkrasimage.c | 6 +----- tools/firmware-utils/src/mkrtn56uimg.c | 6 +----- tools/firmware-utils/src/mksenaofw.c | 6 +----- tools/firmware-utils/src/mktplinkfw-lib.c | 6 +----- tools/firmware-utils/src/mktplinkfw-lib.h | 6 +----- tools/firmware-utils/src/mktplinkfw.c | 6 +----- tools/firmware-utils/src/mktplinkfw2.c | 6 +----- tools/firmware-utils/src/mkwrggimg.c | 6 +----- tools/firmware-utils/src/mkwrgimg.c | 6 +----- tools/firmware-utils/src/mkzcfw.c | 6 +----- tools/firmware-utils/src/mkzynfw.c | 10 +--------- tools/firmware-utils/src/pc1crypt.c | 5 +---- tools/firmware-utils/src/uimage_padhdr.c | 10 +--------- tools/firmware-utils/src/zyimage.c | 6 +----- tools/firmware-utils/src/zynos.h | 6 +----- tools/firmware-utils/src/zytrx.c | 4 ---- 37 files changed, 36 insertions(+), 218 deletions(-) diff --git a/tools/firmware-utils/src/add_header.c b/tools/firmware-utils/src/add_header.c index 726e54c6bf..a5ad5f4119 100644 --- a/tools/firmware-utils/src/add_header.c +++ b/tools/firmware-utils/src/add_header.c @@ -1,21 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * add_header.c - partially based on OpenWrt's motorola-bin.c * * Copyright (C) 2008 Imre Kaloz * Gabor Juhos - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License, - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* diff --git a/tools/firmware-utils/src/buffalo-enc.c b/tools/firmware-utils/src/buffalo-enc.c index 08fad4ee61..dec226823b 100644 --- a/tools/firmware-utils/src/buffalo-enc.c +++ b/tools/firmware-utils/src/buffalo-enc.c @@ -1,10 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2009-2011 Gabor Juhos - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/buffalo-lib.c b/tools/firmware-utils/src/buffalo-lib.c index b1d5ede0a2..7f5a12de60 100644 --- a/tools/firmware-utils/src/buffalo-lib.c +++ b/tools/firmware-utils/src/buffalo-lib.c @@ -1,10 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2009-2011 Gabor Juhos - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/buffalo-lib.h b/tools/firmware-utils/src/buffalo-lib.h index 7eb9bf5398..030f7cd1d6 100644 --- a/tools/firmware-utils/src/buffalo-lib.h +++ b/tools/firmware-utils/src/buffalo-lib.h @@ -1,10 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2009-2011 Gabor Juhos - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #ifndef _BUFFALO_LIB_H diff --git a/tools/firmware-utils/src/buffalo-tag.c b/tools/firmware-utils/src/buffalo-tag.c index 6d479f7fba..a06eb4486c 100644 --- a/tools/firmware-utils/src/buffalo-tag.c +++ b/tools/firmware-utils/src/buffalo-tag.c @@ -1,10 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2009-2011 Gabor Juhos - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/buffalo-tftp.c b/tools/firmware-utils/src/buffalo-tftp.c index 087f9955b6..56af4caa93 100644 --- a/tools/firmware-utils/src/buffalo-tftp.c +++ b/tools/firmware-utils/src/buffalo-tftp.c @@ -1,10 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2009-2011 Gabor Juhos - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/dns313-header.c b/tools/firmware-utils/src/dns313-header.c index 42dd67771d..96e4b6e5c2 100644 --- a/tools/firmware-utils/src/dns313-header.c +++ b/tools/firmware-utils/src/dns313-header.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * dns313-header.c * @@ -8,7 +9,6 @@ * The DNS313 use the same header on zImage, ramdisk, rootfs. * * Written by Linus Walleij - * License terms: GPLv2 */ #include #include diff --git a/tools/firmware-utils/src/edimax_fw_header.c b/tools/firmware-utils/src/edimax_fw_header.c index b85e3a1781..f326f246ba 100644 --- a/tools/firmware-utils/src/edimax_fw_header.c +++ b/tools/firmware-utils/src/edimax_fw_header.c @@ -1,10 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2014 Gabor Juhos - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/fix-u-media-header.c b/tools/firmware-utils/src/fix-u-media-header.c index 21f184e66d..8b6a81a5e3 100644 --- a/tools/firmware-utils/src/fix-u-media-header.c +++ b/tools/firmware-utils/src/fix-u-media-header.c @@ -1,10 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Gabor Juhos - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include #include diff --git a/tools/firmware-utils/src/mkbrncmdline.c b/tools/firmware-utils/src/mkbrncmdline.c index 6eb4bfe7cf..bcb72b03e7 100644 --- a/tools/firmware-utils/src/mkbrncmdline.c +++ b/tools/firmware-utils/src/mkbrncmdline.c @@ -1,20 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * mkbrncmdline.c - partially based on OpenWrt's wndr3700.c * * Copyright (C) 2011 Tobias Diedrich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License, - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include diff --git a/tools/firmware-utils/src/mkbrnimg.c b/tools/firmware-utils/src/mkbrnimg.c index 9cddda3575..1c575c6aa7 100644 --- a/tools/firmware-utils/src/mkbrnimg.c +++ b/tools/firmware-utils/src/mkbrnimg.c @@ -1,20 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * mkbrnimg.c - partially based on OpenWrt's wndr3700.c * * Copyright (C) 2011 Tobias Diedrich - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License, - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include diff --git a/tools/firmware-utils/src/mkbuffaloimg.c b/tools/firmware-utils/src/mkbuffaloimg.c index 364dda005b..1a15fe1b55 100644 --- a/tools/firmware-utils/src/mkbuffaloimg.c +++ b/tools/firmware-utils/src/mkbuffaloimg.c @@ -1,13 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2009 Gabor Juhos * Copyright (C) 2016 FUKAUMI Naoki * * Based on mkdniimg.c - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/mkcameofw.c b/tools/firmware-utils/src/mkcameofw.c index e0da4baf33..71fb7a2756 100644 --- a/tools/firmware-utils/src/mkcameofw.c +++ b/tools/firmware-utils/src/mkcameofw.c @@ -1,10 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Gabor Juhos - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/mkcasfw.c b/tools/firmware-utils/src/mkcasfw.c index 0e7aa17c1b..8d3ea40509 100644 --- a/tools/firmware-utils/src/mkcasfw.c +++ b/tools/firmware-utils/src/mkcasfw.c @@ -1,12 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * * Copyright (C) 2007 OpenWrt.org * Copyright (C) 2007 Gabor Juhos - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/mkdapimg2.c b/tools/firmware-utils/src/mkdapimg2.c index 1d09290a16..21d90125d1 100644 --- a/tools/firmware-utils/src/mkdapimg2.c +++ b/tools/firmware-utils/src/mkdapimg2.c @@ -1,8 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0-only /* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License, - * version 2 as published by the Free Software Foundation. - * * (C) Nicolò Veronese */ diff --git a/tools/firmware-utils/src/mkdhpimg.c b/tools/firmware-utils/src/mkdhpimg.c index e61d042504..9b77b44e05 100644 --- a/tools/firmware-utils/src/mkdhpimg.c +++ b/tools/firmware-utils/src/mkdhpimg.c @@ -1,10 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2016 FUKAUMI Naoki - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/mkdniimg.c b/tools/firmware-utils/src/mkdniimg.c index 92315f9849..8798b7babf 100644 --- a/tools/firmware-utils/src/mkdniimg.c +++ b/tools/firmware-utils/src/mkdniimg.c @@ -1,10 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2009 Gabor Juhos - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/mkhilinkfw.c b/tools/firmware-utils/src/mkhilinkfw.c index 55908e5caa..059692beee 100644 --- a/tools/firmware-utils/src/mkhilinkfw.c +++ b/tools/firmware-utils/src/mkhilinkfw.c @@ -1,19 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2013 Jeff Kent * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * * This tool encrypts and decrypts uImage formatted firmware for Hilink * HLK-RM04 wireless modules. It will also truncate a dump of mtd6 and make * it an image suitable for flashing via the stock firmware upgrade page. diff --git a/tools/firmware-utils/src/mkmerakifw.c b/tools/firmware-utils/src/mkmerakifw.c index 1a50f1658f..b84d42d148 100644 --- a/tools/firmware-utils/src/mkmerakifw.c +++ b/tools/firmware-utils/src/mkmerakifw.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2015 Thomas Hebb * @@ -6,11 +7,6 @@ * same purpose. I have created this reimplementation at his request. The * original script can be found at: * - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/mkplanexfw.c b/tools/firmware-utils/src/mkplanexfw.c index 0230fe2252..c86b6b5b88 100644 --- a/tools/firmware-utils/src/mkplanexfw.c +++ b/tools/firmware-utils/src/mkplanexfw.c @@ -1,10 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2009 Gabor Juhos - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/mkporayfw.c b/tools/firmware-utils/src/mkporayfw.c index 6ec4f320d9..9efa310629 100644 --- a/tools/firmware-utils/src/mkporayfw.c +++ b/tools/firmware-utils/src/mkporayfw.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Builder/viewer/extractor utility for Poray firmware image files * @@ -12,11 +13,6 @@ * Itself based on: * TP-Link WR941 V2 firmware checksum fixing tool. * Copyright (C) 2008,2009 Wang Jian - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/mkrasimage.c b/tools/firmware-utils/src/mkrasimage.c index d8cec527fb..636e90a1cd 100644 --- a/tools/firmware-utils/src/mkrasimage.c +++ b/tools/firmware-utils/src/mkrasimage.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * --- ZyXEL header format --- * Original Version by Benjamin Berg @@ -29,11 +30,6 @@ * * The checksum for the header is calculated over the first 2048 bytes with * the rootfs image checksum as the placeholder during calculation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include #include diff --git a/tools/firmware-utils/src/mkrtn56uimg.c b/tools/firmware-utils/src/mkrtn56uimg.c index 689dc8b375..a43746dc1c 100644 --- a/tools/firmware-utils/src/mkrtn56uimg.c +++ b/tools/firmware-utils/src/mkrtn56uimg.c @@ -1,12 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * * Copyright (C) 2014 OpenWrt.org * Copyright (C) 2014 Mikko Hissa - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/mksenaofw.c b/tools/firmware-utils/src/mksenaofw.c index d9ccfbc1e0..172d5f3b4d 100644 --- a/tools/firmware-utils/src/mksenaofw.c +++ b/tools/firmware-utils/src/mksenaofw.c @@ -1,12 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * * Copyright (C) 2012 OpenWrt.org * Copyright (C) 2012 Mikko Hissa - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/mktplinkfw-lib.c b/tools/firmware-utils/src/mktplinkfw-lib.c index e3213274c1..9ad2a5d216 100644 --- a/tools/firmware-utils/src/mktplinkfw-lib.c +++ b/tools/firmware-utils/src/mktplinkfw-lib.c @@ -1,14 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2009 Gabor Juhos * * This tool was based on: * TP-Link WR941 V2 firmware checksum fixing tool. * Copyright (C) 2008,2009 Wang Jian - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/mktplinkfw-lib.h b/tools/firmware-utils/src/mktplinkfw-lib.h index 31e6d0b1e6..2003908cf9 100644 --- a/tools/firmware-utils/src/mktplinkfw-lib.h +++ b/tools/firmware-utils/src/mktplinkfw-lib.h @@ -1,14 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2009 Gabor Juhos * * This tool was based on: * TP-Link WR941 V2 firmware checksum fixing tool. * Copyright (C) 2008,2009 Wang Jian - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ diff --git a/tools/firmware-utils/src/mktplinkfw.c b/tools/firmware-utils/src/mktplinkfw.c index ed785b48e5..e6d76a1942 100644 --- a/tools/firmware-utils/src/mktplinkfw.c +++ b/tools/firmware-utils/src/mktplinkfw.c @@ -1,14 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2009 Gabor Juhos * * This tool was based on: * TP-Link WR941 V2 firmware checksum fixing tool. * Copyright (C) 2008,2009 Wang Jian - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/mktplinkfw2.c b/tools/firmware-utils/src/mktplinkfw2.c index 053ff0050b..47fe710dff 100644 --- a/tools/firmware-utils/src/mktplinkfw2.c +++ b/tools/firmware-utils/src/mktplinkfw2.c @@ -1,14 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2009 Gabor Juhos * * This tool was based on: * TP-Link WR941 V2 firmware checksum fixing tool. * Copyright (C) 2008,2009 Wang Jian - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/mkwrggimg.c b/tools/firmware-utils/src/mkwrggimg.c index d2c42b02b3..65ad293caa 100644 --- a/tools/firmware-utils/src/mkwrggimg.c +++ b/tools/firmware-utils/src/mkwrggimg.c @@ -1,11 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2011 Gabor Juhos * Copyright (C) 2016 Stijn Tintel - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #define _ANSI_SOURCE diff --git a/tools/firmware-utils/src/mkwrgimg.c b/tools/firmware-utils/src/mkwrgimg.c index 6ba2fd1577..9a5993c277 100644 --- a/tools/firmware-utils/src/mkwrgimg.c +++ b/tools/firmware-utils/src/mkwrgimg.c @@ -1,10 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2011 Gabor Juhos - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/mkzcfw.c b/tools/firmware-utils/src/mkzcfw.c index e21504e266..1318b4acdc 100644 --- a/tools/firmware-utils/src/mkzcfw.c +++ b/tools/firmware-utils/src/mkzcfw.c @@ -1,10 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2010 Gabor Juhos - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/mkzynfw.c b/tools/firmware-utils/src/mkzynfw.c index 365264ca68..e856112f16 100644 --- a/tools/firmware-utils/src/mkzynfw.c +++ b/tools/firmware-utils/src/mkzynfw.c @@ -1,16 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * * Copyright (C) 2007-2008 OpenWrt.org * Copyright (C) 2007-2008 Gabor Juhos - * - * This code was based on the information of the ZyXEL's firmware - * image format written by Kolja Waschk, can be found at: - * http://www.ixo.de/info/zyxel_uclinux - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/pc1crypt.c b/tools/firmware-utils/src/pc1crypt.c index 5eb6e01d4a..be1038b781 100644 --- a/tools/firmware-utils/src/pc1crypt.c +++ b/tools/firmware-utils/src/pc1crypt.c @@ -1,10 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2009 Gabor Juhos * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * * This code was based on: * PC1 Cipher Algorithm ( Pukall Cipher 1 ) * By Alexander PUKALL 1991 diff --git a/tools/firmware-utils/src/uimage_padhdr.c b/tools/firmware-utils/src/uimage_padhdr.c index d1a1efb575..a56b646403 100644 --- a/tools/firmware-utils/src/uimage_padhdr.c +++ b/tools/firmware-utils/src/uimage_padhdr.c @@ -1,16 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * uimage_padhdr.c : add zero paddings after the tail of uimage header * * Copyright (C) 2019 NOGUCHI Hiroshi - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License, - * version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #include diff --git a/tools/firmware-utils/src/zyimage.c b/tools/firmware-utils/src/zyimage.c index 4f7cfd6f43..51a5cf7573 100644 --- a/tools/firmware-utils/src/zyimage.c +++ b/tools/firmware-utils/src/zyimage.c @@ -1,10 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2014 Soul Trace - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include diff --git a/tools/firmware-utils/src/zynos.h b/tools/firmware-utils/src/zynos.h index aaf0fc8a73..6c9c1a0cbd 100644 --- a/tools/firmware-utils/src/zynos.h +++ b/tools/firmware-utils/src/zynos.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * * Copyright (C) 2007-2008 OpenWrt.org @@ -6,11 +7,6 @@ * This code was based on the information of the ZyXEL's firmware * image format written by Kolja Waschk, can be found at: * http://www.ixo.de/info/zyxel_uclinux - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #ifndef _ZYNOS_H diff --git a/tools/firmware-utils/src/zytrx.c b/tools/firmware-utils/src/zytrx.c index 7167679206..8c113d6d79 100644 --- a/tools/firmware-utils/src/zytrx.c +++ b/tools/firmware-utils/src/zytrx.c @@ -8,10 +8,6 @@ * Copyright (C) 2008 Imre Kaloz * Gabor Juhos * Copyright (C) 2021 Bjørn Mork - - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License, - * version 2 as published by the Free Software Foundation. */ #include From 60aa12984a948a8ad9c1d17da55ce9b20c2977bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 4 Aug 2021 13:06:24 +0200 Subject: [PATCH 02/53] firmware-utils: replace GPL 2.0+ boilerplate/reference with SPDX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This uses "GPL-2.0-or-later" header for files identified using scancode license scanner with 100% score as GPL 2.0 or later. Signed-off-by: Rafał Miłecki --- tools/firmware-utils/src/addpattern.c | 15 +-------------- tools/firmware-utils/src/asustrx.c | 6 +----- tools/firmware-utils/src/csysimg.h | 16 +--------------- tools/firmware-utils/src/dgn3500sum.c | 15 +-------------- tools/firmware-utils/src/encode_crc.c | 15 +-------------- tools/firmware-utils/src/fw.h | 17 ++--------------- tools/firmware-utils/src/jcgimage.c | 16 +--------------- tools/firmware-utils/src/lzma2eva.c | 15 +-------------- tools/firmware-utils/src/makeamitbin.c | 16 +--------------- tools/firmware-utils/src/mkchkimg.c | 15 +-------------- tools/firmware-utils/src/mkcsysimg.c | 16 +--------------- tools/firmware-utils/src/mkdlinkfw-lib.c | 6 +----- tools/firmware-utils/src/mkdlinkfw-lib.h | 6 +----- tools/firmware-utils/src/mkdlinkfw.c | 6 +----- tools/firmware-utils/src/mkedimaximg.c | 7 +------ tools/firmware-utils/src/mkfwimage.c | 15 +-------------- tools/firmware-utils/src/mkfwimage2.c | 15 +-------------- tools/firmware-utils/src/mkheader_gemtek.c | 15 +-------------- tools/firmware-utils/src/motorola-bin.c | 17 +---------------- tools/firmware-utils/src/myloader.h | 7 +------ tools/firmware-utils/src/oseama.c | 6 +----- tools/firmware-utils/src/otrx.c | 6 +----- tools/firmware-utils/src/ptgen.c | 15 +-------------- tools/firmware-utils/src/sign_dlink_ru.c | 14 +------------- tools/firmware-utils/src/spw303v.c | 15 +-------------- tools/firmware-utils/src/xorimage.c | 15 +-------------- tools/firmware-utils/src/zyxbcm.c | 15 +-------------- 27 files changed, 28 insertions(+), 314 deletions(-) diff --git a/tools/firmware-utils/src/addpattern.c b/tools/firmware-utils/src/addpattern.c index 9791527878..74286fd563 100644 --- a/tools/firmware-utils/src/addpattern.c +++ b/tools/firmware-utils/src/addpattern.c @@ -1,19 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2004 Manuel Novoa III - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* July 29, 2004 diff --git a/tools/firmware-utils/src/asustrx.c b/tools/firmware-utils/src/asustrx.c index 04af9a184a..ce721687d8 100644 --- a/tools/firmware-utils/src/asustrx.c +++ b/tools/firmware-utils/src/asustrx.c @@ -1,12 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * asustrx * * Copyright (C) 2015 Rafał Miłecki - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. */ #include diff --git a/tools/firmware-utils/src/csysimg.h b/tools/firmware-utils/src/csysimg.h index 65ab062f31..1214c7dee4 100644 --- a/tools/firmware-utils/src/csysimg.h +++ b/tools/firmware-utils/src/csysimg.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * * Copyright (C) 2007,2009 Gabor Juhos @@ -5,21 +6,6 @@ * This program was based on the code found in various Linux * source tarballs released by Edimax for it's devices. * Original author: David Hsu - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. */ #define SIG_LEN 4 diff --git a/tools/firmware-utils/src/dgn3500sum.c b/tools/firmware-utils/src/dgn3500sum.c index e86621bc1f..6c2937ed51 100644 --- a/tools/firmware-utils/src/dgn3500sum.c +++ b/tools/firmware-utils/src/dgn3500sum.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* ************************************************************************** This program creates a modified 16bit checksum used for the Netgear @@ -9,20 +10,6 @@ Based on previous unattributed work. - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - ************************************************************************* */ diff --git a/tools/firmware-utils/src/encode_crc.c b/tools/firmware-utils/src/encode_crc.c index 647fb92e89..80f44f133e 100644 --- a/tools/firmware-utils/src/encode_crc.c +++ b/tools/firmware-utils/src/encode_crc.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* ************************************************************************** This program creates a CRC checksum and encodes the file that is named @@ -9,20 +10,6 @@ Copyright: Freecom Technology GmbH, Berlin, 2004 www.freecom.com - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - ************************************************************************* */ diff --git a/tools/firmware-utils/src/fw.h b/tools/firmware-utils/src/fw.h index c8fb99b467..d2be71e983 100644 --- a/tools/firmware-utils/src/fw.h +++ b/tools/firmware-utils/src/fw.h @@ -1,20 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * * Copyright (C) 2007 Ubiquiti Networks, Inc. - * * - * * This program is free software; you can redistribute it and/or - * * modify it under the terms of the GNU General Public License as - * * published by the Free Software Foundation; either version 2 of the - * * License, or (at your option) any later version. - * * - * * This program is distributed in the hope that it will be useful, but - * * WITHOUT ANY WARRANTY; without even the implied warranty of - * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * * General Public License for more details. - * * - * * You should have received a copy of the GNU General Public License - * * along with this program; if not, write to the Free Software - * * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * */ + */ #ifndef FW_INCLUDED #define FW_INCLUDED diff --git a/tools/firmware-utils/src/jcgimage.c b/tools/firmware-utils/src/jcgimage.c index 81d9f79f52..59a6ac4de5 100644 --- a/tools/firmware-utils/src/jcgimage.c +++ b/tools/firmware-utils/src/jcgimage.c @@ -1,23 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * jcgimage - Create a JCG firmware image * * Copyright (C) 2015 Reinhard Max * Copyright (C) 2019 Davide Fioravanti - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * */ /* diff --git a/tools/firmware-utils/src/lzma2eva.c b/tools/firmware-utils/src/lzma2eva.c index 1d7e364889..f72ec74c19 100644 --- a/tools/firmware-utils/src/lzma2eva.c +++ b/tools/firmware-utils/src/lzma2eva.c @@ -1,20 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* lzma2eva - convert lzma-compressed file to AVM EVA bootloader format Copyright (C) 2007 Enrik Berkhan - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/tools/firmware-utils/src/makeamitbin.c b/tools/firmware-utils/src/makeamitbin.c index 5c334424e6..c626d5ce6a 100644 --- a/tools/firmware-utils/src/makeamitbin.c +++ b/tools/firmware-utils/src/makeamitbin.c @@ -1,23 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * makeamitbin - create firmware binaries for MGB100 * * Copyright (C) 2007 Volker Weiss * Christian Welzel - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * */ diff --git a/tools/firmware-utils/src/mkchkimg.c b/tools/firmware-utils/src/mkchkimg.c index dff5169a25..b51eca9369 100644 --- a/tools/firmware-utils/src/mkchkimg.c +++ b/tools/firmware-utils/src/mkchkimg.c @@ -1,23 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Make CHK Image * * This utility creates Netgear .chk files. * * Copyright (C) 2008 Dave C. Reeve - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include #include diff --git a/tools/firmware-utils/src/mkcsysimg.c b/tools/firmware-utils/src/mkcsysimg.c index 0ddb54c4ec..2347e63da1 100644 --- a/tools/firmware-utils/src/mkcsysimg.c +++ b/tools/firmware-utils/src/mkcsysimg.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * * Copyright (C) 2007-2009 Gabor Juhos @@ -5,21 +6,6 @@ * This program was based on the code found in various Linux * source tarballs released by Edimax for it's devices. * Original author: David Hsu - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. */ #include diff --git a/tools/firmware-utils/src/mkdlinkfw-lib.c b/tools/firmware-utils/src/mkdlinkfw-lib.c index b3f3f41348..dbe178c6dd 100644 --- a/tools/firmware-utils/src/mkdlinkfw-lib.c +++ b/tools/firmware-utils/src/mkdlinkfw-lib.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * mkdlinkfw * @@ -6,11 +7,6 @@ * This tool is based on mktplinkfw. * Copyright (C) 2009 Gabor Juhos * Copyright (C) 2008,2009 Wang Jian - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. */ #include diff --git a/tools/firmware-utils/src/mkdlinkfw-lib.h b/tools/firmware-utils/src/mkdlinkfw-lib.h index da4ecf010c..a459599665 100644 --- a/tools/firmware-utils/src/mkdlinkfw-lib.h +++ b/tools/firmware-utils/src/mkdlinkfw-lib.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * mkdlinkfw * @@ -6,11 +7,6 @@ * This tool is based on mktplinkfw. * Copyright (C) 2009 Gabor Juhos * Copyright (C) 2008,2009 Wang Jian - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. */ #ifndef mkdlinkfw_lib_h diff --git a/tools/firmware-utils/src/mkdlinkfw.c b/tools/firmware-utils/src/mkdlinkfw.c index 3b59a5d2df..6dbaf4ae27 100644 --- a/tools/firmware-utils/src/mkdlinkfw.c +++ b/tools/firmware-utils/src/mkdlinkfw.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * mkdlinkfw * @@ -6,11 +7,6 @@ * This tool is based on mktplinkfw. * Copyright (C) 2009 Gabor Juhos * Copyright (C) 2008,2009 Wang Jian - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. */ #include diff --git a/tools/firmware-utils/src/mkedimaximg.c b/tools/firmware-utils/src/mkedimaximg.c index 541eaaaa3f..899f9f6146 100644 --- a/tools/firmware-utils/src/mkedimaximg.c +++ b/tools/firmware-utils/src/mkedimaximg.c @@ -1,11 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2011 Vasilis Tsiligiannis - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * */ #include diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c index 5b749a3f66..7f15d1f196 100644 --- a/tools/firmware-utils/src/mkfwimage.c +++ b/tools/firmware-utils/src/mkfwimage.c @@ -1,20 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2007 Ubiquiti Networks, Inc. * Copyright (C) 2008 Lukas Kuna - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include diff --git a/tools/firmware-utils/src/mkfwimage2.c b/tools/firmware-utils/src/mkfwimage2.c index 9d8b2f6f8b..a0db930df2 100644 --- a/tools/firmware-utils/src/mkfwimage2.c +++ b/tools/firmware-utils/src/mkfwimage2.c @@ -1,21 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2007 Ubiquiti Networks, Inc. * Copyright (C) 2008 Lukas Kuna * Copyright (C) 2008 Gabor Juhos - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include diff --git a/tools/firmware-utils/src/mkheader_gemtek.c b/tools/firmware-utils/src/mkheader_gemtek.c index 9e618efbad..ab72a644ef 100644 --- a/tools/firmware-utils/src/mkheader_gemtek.c +++ b/tools/firmware-utils/src/mkheader_gemtek.c @@ -1,19 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2014 Claudio Leite - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/tools/firmware-utils/src/motorola-bin.c b/tools/firmware-utils/src/motorola-bin.c index fecb4ce95b..6fda2a9e31 100644 --- a/tools/firmware-utils/src/motorola-bin.c +++ b/tools/firmware-utils/src/motorola-bin.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * motorola-bin.c * @@ -5,22 +6,6 @@ * Imre Kaloz * D. Hugh Redelmeier * OpenWrt.org - * - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * */ /* diff --git a/tools/firmware-utils/src/myloader.h b/tools/firmware-utils/src/myloader.h index 7be1d49369..039f2df6d2 100644 --- a/tools/firmware-utils/src/myloader.h +++ b/tools/firmware-utils/src/myloader.h @@ -1,11 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2006-2008 Gabor Juhos - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * */ #ifndef _MYLOADER_H_ diff --git a/tools/firmware-utils/src/oseama.c b/tools/firmware-utils/src/oseama.c index 4434b11162..75580e6cf5 100644 --- a/tools/firmware-utils/src/oseama.c +++ b/tools/firmware-utils/src/oseama.c @@ -1,12 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * oseama * * Copyright (C) 2016 Rafał Miłecki - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. */ #include diff --git a/tools/firmware-utils/src/otrx.c b/tools/firmware-utils/src/otrx.c index 3bbbac39e3..b5cd70d6c8 100644 --- a/tools/firmware-utils/src/otrx.c +++ b/tools/firmware-utils/src/otrx.c @@ -1,12 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * otrx * * Copyright (C) 2015-2017 Rafał Miłecki - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. */ #include diff --git a/tools/firmware-utils/src/ptgen.c b/tools/firmware-utils/src/ptgen.c index d911b9d1f0..665c5f7a04 100644 --- a/tools/firmware-utils/src/ptgen.c +++ b/tools/firmware-utils/src/ptgen.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * ptgen - partition table generator * Copyright (C) 2006 by Felix Fietkau @@ -7,20 +8,6 @@ * * UUID/GUID definition stolen from kernel/include/uapi/linux/uuid.h * Copyright (C) 2010, Intel Corp. Huang Ying - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/tools/firmware-utils/src/sign_dlink_ru.c b/tools/firmware-utils/src/sign_dlink_ru.c index 9c02ed50af..50f2e67bf4 100644 --- a/tools/firmware-utils/src/sign_dlink_ru.c +++ b/tools/firmware-utils/src/sign_dlink_ru.c @@ -1,21 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * This program is designed to sign firmware images so they are accepted * by D-Link DIR-882 R1 WebUIs. * * Copyright (C) 2020 Andrew Pikler - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; If not, see . */ #include diff --git a/tools/firmware-utils/src/spw303v.c b/tools/firmware-utils/src/spw303v.c index 980f41ded6..3244a73a2f 100644 --- a/tools/firmware-utils/src/spw303v.c +++ b/tools/firmware-utils/src/spw303v.c @@ -1,21 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * spw303v.c - partially based on OpenWrt's imagetag.c and addpattern.c * * Copyright (C) 2011 Jonas Gorski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include diff --git a/tools/firmware-utils/src/xorimage.c b/tools/firmware-utils/src/xorimage.c index e13531ab4a..94190fd181 100644 --- a/tools/firmware-utils/src/xorimage.c +++ b/tools/firmware-utils/src/xorimage.c @@ -1,19 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * xorimage.c - partially based on OpenWrt's addpattern.c - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/tools/firmware-utils/src/zyxbcm.c b/tools/firmware-utils/src/zyxbcm.c index 1a2926bfd3..0266c82caf 100644 --- a/tools/firmware-utils/src/zyxbcm.c +++ b/tools/firmware-utils/src/zyxbcm.c @@ -1,21 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * zyxbcm.c - based on Jonas Gorski's spw303v.c * * Copyright (C) 2014 Álvaro Fernández Rojas - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include From 63bf027cc196e785afa1d72bfecdd098c662d262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 4 Aug 2021 14:26:35 +0200 Subject: [PATCH 03/53] firmware-utils: seama: replace BSD-3-Clause boilerplate with SPDX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki --- tools/firmware-utils/src/seama.c | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/tools/firmware-utils/src/seama.c b/tools/firmware-utils/src/seama.c index 05aee8e76a..89eeac90c4 100644 --- a/tools/firmware-utils/src/seama.c +++ b/tools/firmware-utils/src/seama.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause /* vi: set sw=4 ts=4: */ /* * Copyright (C) 2008, Alpha Networks, Inc. @@ -5,37 +6,6 @@ * All right reserved. * * (SEA)ttle i(MA)ge is the image which used in project seattle. - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * 1. Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * */ #include From e7ae32b8df759e4eb9627b69c3511103f50d4ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 4 Aug 2021 14:32:14 +0200 Subject: [PATCH 04/53] firmware-utils: tplink-safeloader: replace BSD-2-Clause boilerplate with SPDX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki Acked-by: Matthias Schiffer --- tools/firmware-utils/src/tplink-safeloader.c | 21 +------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index 4e7549d5e6..bd4d4b562e 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -1,26 +1,7 @@ +// SPDX-License-Identifier: BSD-2-Clause /* Copyright (c) 2014, Matthias Schiffer All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ From 2dc1e4b488fb7d35960c50d574439e6912fffebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 4 Aug 2021 15:58:47 +0200 Subject: [PATCH 05/53] firmware-utils: add GPL 2.0 SPDX to files with no license info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These files fall under the project license: GPL-2.0-only. Signed-off-by: Rafał Miłecki --- tools/firmware-utils/src/bcm_tag.h | 1 + tools/firmware-utils/src/bcmalgo.c | 1 + tools/firmware-utils/src/bcmalgo.h | 1 + tools/firmware-utils/src/dgfirmware.c | 1 + tools/firmware-utils/src/hcsmakeimage.c | 1 + tools/firmware-utils/src/mkdapimg.c | 1 + tools/firmware-utils/src/mksercommfw.c | 1 + tools/firmware-utils/src/mktitanimg.c | 1 + tools/firmware-utils/src/mktitanimg.h | 1 + tools/firmware-utils/src/srec2bin.c | 1 + tools/firmware-utils/src/trx2edips.c | 1 + tools/firmware-utils/src/utils.h | 1 + tools/firmware-utils/src/wrt400n.c | 1 + 13 files changed, 13 insertions(+) diff --git a/tools/firmware-utils/src/bcm_tag.h b/tools/firmware-utils/src/bcm_tag.h index 2730edc9ad..a0d560884f 100644 --- a/tools/firmware-utils/src/bcm_tag.h +++ b/tools/firmware-utils/src/bcm_tag.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only #ifndef __BCM63XX_TAG_H #define __BCM63XX_TAG_H diff --git a/tools/firmware-utils/src/bcmalgo.c b/tools/firmware-utils/src/bcmalgo.c index c0865a183b..fd6c1c116e 100644 --- a/tools/firmware-utils/src/bcmalgo.c +++ b/tools/firmware-utils/src/bcmalgo.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only #include #include #include diff --git a/tools/firmware-utils/src/bcmalgo.h b/tools/firmware-utils/src/bcmalgo.h index 46647cf6d3..9aec7d1931 100644 --- a/tools/firmware-utils/src/bcmalgo.h +++ b/tools/firmware-utils/src/bcmalgo.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only #ifndef bcmutils_H #define bcmutils_H diff --git a/tools/firmware-utils/src/dgfirmware.c b/tools/firmware-utils/src/dgfirmware.c index 3ec4712ec9..c5549c82be 100644 --- a/tools/firmware-utils/src/dgfirmware.c +++ b/tools/firmware-utils/src/dgfirmware.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only #include #include #include diff --git a/tools/firmware-utils/src/hcsmakeimage.c b/tools/firmware-utils/src/hcsmakeimage.c index 2888810cc7..ce954cfcc9 100644 --- a/tools/firmware-utils/src/hcsmakeimage.c +++ b/tools/firmware-utils/src/hcsmakeimage.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only #include #include #include diff --git a/tools/firmware-utils/src/mkdapimg.c b/tools/firmware-utils/src/mkdapimg.c index 0031d83dd0..e8b12599d8 100644 --- a/tools/firmware-utils/src/mkdapimg.c +++ b/tools/firmware-utils/src/mkdapimg.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only #include #include #include diff --git a/tools/firmware-utils/src/mksercommfw.c b/tools/firmware-utils/src/mksercommfw.c index f6f1d93f37..5fa323f2d5 100644 --- a/tools/firmware-utils/src/mksercommfw.c +++ b/tools/firmware-utils/src/mksercommfw.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only #include #include #include diff --git a/tools/firmware-utils/src/mktitanimg.c b/tools/firmware-utils/src/mktitanimg.c index acc21bd64d..654a6bd09b 100644 --- a/tools/firmware-utils/src/mktitanimg.c +++ b/tools/firmware-utils/src/mktitanimg.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only #include #include #include diff --git a/tools/firmware-utils/src/mktitanimg.h b/tools/firmware-utils/src/mktitanimg.h index 9ff30f6088..27b37b3fda 100644 --- a/tools/firmware-utils/src/mktitanimg.h +++ b/tools/firmware-utils/src/mktitanimg.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only #ifndef __MKTITANIMG_H #define __MKTITANIMG_H diff --git a/tools/firmware-utils/src/srec2bin.c b/tools/firmware-utils/src/srec2bin.c index 95a8195d1a..ad4222d693 100644 --- a/tools/firmware-utils/src/srec2bin.c +++ b/tools/firmware-utils/src/srec2bin.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only #include #include #include diff --git a/tools/firmware-utils/src/trx2edips.c b/tools/firmware-utils/src/trx2edips.c index 14c4eb70ba..e8ac14d830 100644 --- a/tools/firmware-utils/src/trx2edips.c +++ b/tools/firmware-utils/src/trx2edips.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only #include #include #include diff --git a/tools/firmware-utils/src/utils.h b/tools/firmware-utils/src/utils.h index 11ec740069..b051f5e6c7 100644 --- a/tools/firmware-utils/src/utils.h +++ b/tools/firmware-utils/src/utils.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only #include #include diff --git a/tools/firmware-utils/src/wrt400n.c b/tools/firmware-utils/src/wrt400n.c index 1cf1debc89..a6c1f8038b 100644 --- a/tools/firmware-utils/src/wrt400n.c +++ b/tools/firmware-utils/src/wrt400n.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * WRT400n - Firmware Generation Creator * From 84c9570aaadec70b667586c3c84dd9fd095baa9e Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Sat, 7 Aug 2021 01:28:08 +0300 Subject: [PATCH 06/53] scripts/target-metadata.pl: order features alphabetically We generaly do this in many other places, so let's do it here also. Signed-off-by: Stijn Tintel --- scripts/target-metadata.pl | 52 +++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl index 990235182d..dff24998cd 100755 --- a/scripts/target-metadata.pl +++ b/scripts/target-metadata.pl @@ -10,42 +10,42 @@ sub target_config_features(@) { while ($_ = shift @_) { /^arm_v(\w+)$/ and $ret .= "\tselect arm_v$1\n"; - /^broken$/ and $ret .= "\tdepends on BROKEN\n"; /^audio$/ and $ret .= "\tselect AUDIO_SUPPORT\n"; + /^boot-part$/ and $ret .= "\tselect USES_BOOT_PART\n"; + /^broken$/ and $ret .= "\tdepends on BROKEN\n"; + /^cpiogz$/ and $ret .= "\tselect USES_CPIOGZ\n"; /^display$/ and $ret .= "\tselect DISPLAY_SUPPORT\n"; /^dt$/ and $ret .= "\tselect USES_DEVICETREE\n"; + /^dt-overlay$/ and $ret .= "\tselect HAS_DT_OVERLAY_SUPPORT\n"; + /^ext4$/ and $ret .= "\tselect USES_EXT4\n"; + /^fpu$/ and $ret .= "\tselect HAS_FPU\n"; /^gpio$/ and $ret .= "\tselect GPIO_SUPPORT\n"; - /^pci$/ and $ret .= "\tselect PCI_SUPPORT\n"; - /^pcie$/ and $ret .= "\tselect PCIE_SUPPORT\n"; - /^usb$/ and $ret .= "\tselect USB_SUPPORT\n"; - /^usbgadget$/ and $ret .= "\tselect USB_GADGET_SUPPORT\n"; - /^pcmcia$/ and $ret .= "\tselect PCMCIA_SUPPORT\n"; - /^pwm$/ and $ret .= "\select PWM_SUPPORT\n"; - /^rtc$/ and $ret .= "\tselect RTC_SUPPORT\n"; - /^squashfs$/ and $ret .= "\tselect USES_SQUASHFS\n"; /^jffs2$/ and $ret .= "\tselect USES_JFFS2\n"; /^jffs2_nand$/ and $ret .= "\tselect USES_JFFS2_NAND\n"; - /^ext4$/ and $ret .= "\tselect USES_EXT4\n"; - /^targz$/ and $ret .= "\tselect USES_TARGZ\n"; - /^cpiogz$/ and $ret .= "\tselect USES_CPIOGZ\n"; - /^minor$/ and $ret .= "\tselect USES_MINOR\n"; - /^ubifs$/ and $ret .= "\tselect USES_UBIFS\n"; - /^fpu$/ and $ret .= "\tselect HAS_FPU\n"; - /^spe_fpu$/ and $ret .= "\tselect HAS_SPE_FPU\n"; - /^ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n"; - /^separate_ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n\tselect USES_SEPARATE_INITRAMFS\n"; - /^powerpc64$/ and $ret .= "\tselect powerpc64\n"; - /^nommu$/ and $ret .= "\tselect NOMMU\n"; - /^mips16$/ and $ret .= "\tselect HAS_MIPS16\n"; - /^rfkill$/ and $ret .= "\tselect RFKILL_SUPPORT\n"; /^low_mem$/ and $ret .= "\tselect LOW_MEMORY_FOOTPRINT\n"; - /^small_flash$/ and $ret .= "\tselect SMALL_FLASH\n"; + /^minor$/ and $ret .= "\tselect USES_MINOR\n"; + /^mips16$/ and $ret .= "\tselect HAS_MIPS16\n"; /^nand$/ and $ret .= "\tselect NAND_SUPPORT\n"; - /^virtio$/ and $ret .= "\tselect VIRTIO_SUPPORT\n"; + /^nommu$/ and $ret .= "\tselect NOMMU\n"; + /^pci$/ and $ret .= "\tselect PCI_SUPPORT\n"; + /^pcie$/ and $ret .= "\tselect PCIE_SUPPORT\n"; + /^pcmcia$/ and $ret .= "\tselect PCMCIA_SUPPORT\n"; + /^powerpc64$/ and $ret .= "\tselect powerpc64\n"; + /^pwm$/ and $ret .= "\select PWM_SUPPORT\n"; + /^ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n"; + /^rfkill$/ and $ret .= "\tselect RFKILL_SUPPORT\n"; /^rootfs-part$/ and $ret .= "\tselect USES_ROOTFS_PART\n"; - /^boot-part$/ and $ret .= "\tselect USES_BOOT_PART\n"; + /^rtc$/ and $ret .= "\tselect RTC_SUPPORT\n"; + /^separate_ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n\tselect USES_SEPARATE_INITRAMFS\n"; + /^small_flash$/ and $ret .= "\tselect SMALL_FLASH\n"; + /^spe_fpu$/ and $ret .= "\tselect HAS_SPE_FPU\n"; + /^squashfs$/ and $ret .= "\tselect USES_SQUASHFS\n"; + /^targz$/ and $ret .= "\tselect USES_TARGZ\n"; /^testing-kernel$/ and $ret .= "\tselect HAS_TESTING_KERNEL\n"; - /^dt-overlay$/ and $ret .= "\tselect HAS_DT_OVERLAY_SUPPORT\n"; + /^ubifs$/ and $ret .= "\tselect USES_UBIFS\n"; + /^usb$/ and $ret .= "\tselect USB_SUPPORT\n"; + /^usbgadget$/ and $ret .= "\tselect USB_GADGET_SUPPORT\n"; + /^virtio$/ and $ret .= "\tselect VIRTIO_SUPPORT\n"; } return $ret; } From 8347d8b4fbe41ce7db386f948df3ebb6c6bc32d3 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Fri, 30 Jul 2021 01:11:37 +0300 Subject: [PATCH 07/53] base-files: add generic sdcard upgrade method Add a generic sdcard upgrade method instead of duplicating code in yet another target, and add a feature flag to only install this upgrade method in targets that set this flag. Copied from mvebu. Signed-off-by: Stijn Tintel --- package/base-files/Makefile | 9 ++ .../base-files/files/lib/upgrade/sdcard.sh | 91 +++++++++++++++++++ scripts/target-metadata.pl | 1 + target/Config.in | 3 + 4 files changed, 104 insertions(+) create mode 100644 package/base-files/files/lib/upgrade/sdcard.sh diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 5f816a0d1b..f19b07cfe1 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -23,6 +23,7 @@ PKG_LICENSE:=GPL-2.0 PKG_CONFIG_DEPENDS += \ CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE \ CONFIG_NAND_SUPPORT \ + CONFIG_SDCARD_SUPPORT \ CONFIG_CLEAN_IPKG \ CONFIG_PER_FEED_REPO \ $(foreach feed,$(FEEDS_AVAILABLE),CONFIG_FEED_$(feed)) @@ -123,10 +124,18 @@ ifeq ($(CONFIG_NAND_SUPPORT),) endef endif +ifeq ($(CONFIG_SDCARD_SUPPORT),) + define Package/base-files/sdcard-support + rm -f $(1)/lib/upgrade/sdcard.sh + endef +endif + + define Package/base-files/install $(CP) ./files/* $(1)/ $(Package/base-files/install-key) $(Package/base-files/nand-support) + $(Package/base-files/sdcard-support) if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \ $(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \ fi diff --git a/package/base-files/files/lib/upgrade/sdcard.sh b/package/base-files/files/lib/upgrade/sdcard.sh new file mode 100644 index 0000000000..2052805acb --- /dev/null +++ b/package/base-files/files/lib/upgrade/sdcard.sh @@ -0,0 +1,91 @@ +sdcard_check_image() { + local file="$1" + local diskdev partdev diff + + export_bootdevice && export_partdevice diskdev 0 || { + v "Unable to determine upgrade device" + return 1 + } + + get_partitions "/dev/$diskdev" bootdisk + + v "Extract boot sector from the image" + get_image_dd "$1" 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)" + + rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image + + if [ -n "$diff" ]; then + v "Partition layout has changed. Full image will be written." + ask_bool 0 "Abort" && exit 1 + return 0 + fi +} + +sdcard_do_upgrade() { + local board=$(board_name) + local diskdev partdev diff + + export_bootdevice && export_partdevice diskdev 0 || { + v "Unable to determine upgrade device" + return 1 + } + + sync + + if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then + get_partitions "/dev/$diskdev" bootdisk + + v "Extract boot sector from the image" + get_image_dd "$1" 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 "$1" 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" + else + v "Writing bootloader to /dev/$diskdev" + get_image_dd "$1" 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 + v "Writing image to /dev/$partdev..." + get_image_dd "$1" of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync + else + v "Unable to find partition $part device, skipped." + fi + done < /tmp/partmap.image + + v "Writing new UUID to /dev/$diskdev..." + get_image_dd "$1" of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync + fi + + sleep 1 +} + +sdcard_copy_config() { + local partdev + + if export_partdevice partdev 1; then + mkdir -p /boot + [ -f /boot/kernel.img ] || mount -o rw,noatime /dev/$partdev /boot + cp -af "$UPGRADE_BACKUP" "/boot/$BACKUP_FILE" + sync + umount /boot + fi +} diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl index dff24998cd..34fb32a07e 100755 --- a/scripts/target-metadata.pl +++ b/scripts/target-metadata.pl @@ -36,6 +36,7 @@ sub target_config_features(@) { /^rfkill$/ and $ret .= "\tselect RFKILL_SUPPORT\n"; /^rootfs-part$/ and $ret .= "\tselect USES_ROOTFS_PART\n"; /^rtc$/ and $ret .= "\tselect RTC_SUPPORT\n"; + /^sdcard$/ and $ret .= "\tselect SDCARD_SUPPORT\n"; /^separate_ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n\tselect USES_SEPARATE_INITRAMFS\n"; /^small_flash$/ and $ret .= "\tselect SMALL_FLASH\n"; /^spe_fpu$/ and $ret .= "\tselect HAS_SPE_FPU\n"; diff --git a/target/Config.in b/target/Config.in index 51a278cae9..fde7ea4137 100644 --- a/target/Config.in +++ b/target/Config.in @@ -101,6 +101,9 @@ config RFKILL_SUPPORT config NAND_SUPPORT bool +config SDCARD_SUPPORT + bool + config ARCH_64BIT bool From b1bff5cb57fab31932ceaa0dea9509effe9f5800 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Sat, 7 Aug 2021 01:42:43 +0300 Subject: [PATCH 08/53] mvebu: switch to generic sdcard upgrade method Now that we have a generic sdcard upgrade method, which was copied from the mvebu platform method, we can switch mvebu to the generic method. Signed-off-by: Stijn Tintel --- target/linux/mvebu/Makefile | 2 +- .../mvebu/base-files/lib/upgrade/sdcard.sh | 91 ------------------- .../base-files/lib/upgrade/platform.sh | 6 +- .../base-files/lib/upgrade/platform.sh | 6 +- .../base-files/lib/upgrade/platform.sh | 6 +- 5 files changed, 10 insertions(+), 101 deletions(-) delete mode 100644 target/linux/mvebu/base-files/lib/upgrade/sdcard.sh diff --git a/target/linux/mvebu/Makefile b/target/linux/mvebu/Makefile index 1550309a92..6b992f8903 100644 --- a/target/linux/mvebu/Makefile +++ b/target/linux/mvebu/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk BOARD:=mvebu BOARDNAME:=Marvell EBU Armada -FEATURES:=fpu usb pci pcie gpio nand squashfs ramdisk boot-part rootfs-part +FEATURES:=fpu usb pci pcie gpio nand squashfs ramdisk boot-part rootfs-part sdcard SUBTARGETS:=cortexa9 cortexa53 cortexa72 KERNEL_PATCHVER:=5.4 diff --git a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh deleted file mode 100644 index caa726b4d5..0000000000 --- a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh +++ /dev/null @@ -1,91 +0,0 @@ -platform_check_image_sdcard() { - local file="$1" - local diskdev partdev diff - - export_bootdevice && export_partdevice diskdev 0 || { - v "Unable to determine upgrade device" - return 1 - } - - get_partitions "/dev/$diskdev" bootdisk - - v "Extract boot sector from the image" - get_image_dd "$1" 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)" - - rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image - - if [ -n "$diff" ]; then - v "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 partdev diff - - export_bootdevice && export_partdevice diskdev 0 || { - v "Unable to determine upgrade device" - return 1 - } - - sync - - if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then - get_partitions "/dev/$diskdev" bootdisk - - v "Extract boot sector from the image" - get_image_dd "$1" 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 "$1" 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" - else - v "Writing bootloader to /dev/$diskdev" - get_image_dd "$1" 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 - v "Writing image to /dev/$partdev..." - get_image_dd "$1" of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync - else - v "Unable to find partition $part device, skipped." - fi - done < /tmp/partmap.image - - v "Writing new UUID to /dev/$diskdev..." - get_image_dd "$1" of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync - fi - - sleep 1 -} - -platform_copy_config_sdcard() { - local partdev - - if export_partdevice partdev 1; then - mkdir -p /boot - [ -f /boot/kernel.img ] || mount -o rw,noatime /dev/$partdev /boot - cp -af "$UPGRADE_BACKUP" "/boot/$BACKUP_FILE" - sync - umount /boot - fi -} diff --git a/target/linux/mvebu/cortexa53/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/platform.sh index d78f4e884a..26bb022415 100755 --- a/target/linux/mvebu/cortexa53/base-files/lib/upgrade/platform.sh +++ b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/platform.sh @@ -15,7 +15,7 @@ platform_check_image() { globalscale,espressobin-ultra|\ globalscale,espressobin-v7|\ globalscale,espressobin-v7-emmc) - platform_check_image_sdcard "$1" + sdcard_check_image "$1" ;; *) return 0 @@ -31,7 +31,7 @@ platform_do_upgrade() { globalscale,espressobin-ultra|\ globalscale,espressobin-v7|\ globalscale,espressobin-v7-emmc) - platform_do_upgrade_sdcard "$1" + sdcard_do_upgrade "$1" ;; methode,udpu) platform_do_upgrade_uDPU "$1" @@ -49,7 +49,7 @@ platform_copy_config() { globalscale,espressobin-ultra|\ globalscale,espressobin-v7|\ globalscale,espressobin-v7-emmc) - platform_copy_config_sdcard + sdcard_copy_config ;; methode,udpu) platform_copy_config_uDPU diff --git a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh index 04ea634097..1713f55b72 100755 --- a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh +++ b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/platform.sh @@ -11,7 +11,7 @@ platform_check_image() { case "$(board_name)" in marvell,armada8040-mcbin-doubleshot|\ marvell,armada8040-mcbin-singleshot) - platform_check_image_sdcard "$1" + sdcard_check_image "$1" ;; *) return 0 @@ -23,7 +23,7 @@ platform_do_upgrade() { case "$(board_name)" in marvell,armada8040-mcbin-doubleshot|\ marvell,armada8040-mcbin-singleshot) - platform_do_upgrade_sdcard "$1" + sdcard_do_upgrade "$1" ;; *) default_do_upgrade "$1" @@ -34,7 +34,7 @@ platform_copy_config() { case "$(board_name)" in marvell,armada8040-mcbin-doubleshot|\ marvell,armada8040-mcbin-singleshot) - platform_copy_config_sdcard + sdcard_copy_config ;; esac } diff --git a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh index 42289209d5..bf3961c437 100755 --- a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh +++ b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh @@ -13,7 +13,7 @@ platform_check_image() { kobol,helios4|\ solidrun,clearfog-base-a1|\ solidrun,clearfog-pro-a1) - platform_check_image_sdcard "$1" + sdcard_check_image "$1" ;; *) return 0 @@ -30,7 +30,7 @@ platform_do_upgrade() { kobol,helios4|\ solidrun,clearfog-base-a1|\ solidrun,clearfog-pro-a1) - platform_do_upgrade_sdcard "$1" + sdcard_do_upgrade "$1" ;; linksys,wrt1200ac|\ linksys,wrt1900ac-v1|\ @@ -51,7 +51,7 @@ platform_copy_config() { kobol,helios4|\ solidrun,clearfog-base-a1|\ solidrun,clearfog-pro-a1) - platform_copy_config_sdcard + sdcard_copy_config ;; linksys,wrt1200ac|\ linksys,wrt1900ac-v1|\ From 80be893d2b3bf550ece5c15cf7ed967b31f7042d Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 8 Aug 2021 14:47:54 +0100 Subject: [PATCH 09/53] procd: change procd_add_start_mount_trigger to do restart Change procd_add_start_mount_trigger to procd_add_restart_mount_trigger and make it call 'restart' instead of 'start'. This is more useful as it allows to handle both cases, intial start of a services as well as restarting services. Calling 'restart' on a service which has not yet been started has the same result as calling 'start'. Signed-off-by: Daniel Golle --- package/system/procd/files/procd.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh index de30c76878..14314bec95 100644 --- a/package/system/procd/files/procd.sh +++ b/package/system/procd/files/procd.sh @@ -393,8 +393,8 @@ procd_get_mountpoints() { ) | sort -u } -_procd_add_start_mount_trigger() { - _procd_add_action_mount_trigger start $(procd_get_mountpoints "$@") +_procd_add_restart_mount_trigger() { + _procd_add_action_mount_trigger restart $(procd_get_mountpoints "$@") } _procd_add_reload_mount_trigger() { @@ -636,7 +636,7 @@ _procd_wrapper \ procd_add_reload_trigger \ procd_add_reload_interface_trigger \ procd_add_reload_mount_trigger \ - procd_add_start_mount_trigger \ + procd_add_restart_mount_trigger \ procd_open_trigger \ procd_close_trigger \ procd_open_instance \ From 39d12b015540b7a7e344b169fcb91c3eb37e65c1 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Mon, 2 Aug 2021 12:20:46 +0100 Subject: [PATCH 10/53] kernel: bump 5.10 to 5.10.55 No deleted or manually refreshed patches. Signed-off-by: Rui Salvaterra --- include/kernel-version.mk | 4 ++-- ...80-usb-xhci-add-support-for-performing-fake-doorbell.patch | 2 +- .../310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch | 2 +- ...0-UBI-Detect-EOF-mark-and-erase-all-remaining-blocks.patch | 2 +- .../linux/bcm53xx/patches-5.10/905-BCM53573-minor-hacks.patch | 4 ++-- .../patches-5.10/0001-MIPS-lantiq-add-pcie-driver.patch | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 1d00565c8f..dd55d69359 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -7,10 +7,10 @@ ifdef CONFIG_TESTING_KERNEL endif LINUX_VERSION-5.4 = .137 -LINUX_VERSION-5.10 = .54 +LINUX_VERSION-5.10 = .55 LINUX_KERNEL_HASH-5.4.137 = f09e5e366ce5d8bde887cda229ef17138fd1653706a702221f934f99aaa31f7c -LINUX_KERNEL_HASH-5.10.54 = bf50c63261847187eca4a1793e5df5c1355b21697409589f6ca03e32b629be44 +LINUX_KERNEL_HASH-5.10.55 = 7581113dad67a095bc5cc32b457e1a9283f91579e248f3b547a7302157fe8889 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/bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch b/target/linux/bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch index c64c94ed52..cae6069dfc 100644 --- a/target/linux/bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch +++ b/target/linux/bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch @@ -127,7 +127,7 @@ it on BCM4708 family. /* --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1880,6 +1880,7 @@ struct xhci_hcd { +@@ -1881,6 +1881,7 @@ struct xhci_hcd { #define XHCI_DISABLE_SPARSE BIT_ULL(38) #define XHCI_SG_TRB_CACHE_SIZE_QUIRK BIT_ULL(39) #define XHCI_NO_SOFT_RETRY BIT_ULL(40) diff --git a/target/linux/bcm53xx/patches-5.10/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch b/target/linux/bcm53xx/patches-5.10/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch index b0800e50ae..e67d36a4e2 100644 --- a/target/linux/bcm53xx/patches-5.10/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch +++ b/target/linux/bcm53xx/patches-5.10/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch @@ -9,7 +9,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -106,6 +106,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ +@@ -116,6 +116,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ bcm4709-buffalo-wxr-1900dhp.dtb \ bcm4709-linksys-ea9200.dtb \ bcm4709-netgear-r7000.dtb \ diff --git a/target/linux/bcm53xx/patches-5.10/500-UBI-Detect-EOF-mark-and-erase-all-remaining-blocks.patch b/target/linux/bcm53xx/patches-5.10/500-UBI-Detect-EOF-mark-and-erase-all-remaining-blocks.patch index ff9d6b0005..257214fff9 100644 --- a/target/linux/bcm53xx/patches-5.10/500-UBI-Detect-EOF-mark-and-erase-all-remaining-blocks.patch +++ b/target/linux/bcm53xx/patches-5.10/500-UBI-Detect-EOF-mark-and-erase-all-remaining-blocks.patch @@ -49,7 +49,7 @@ Signed-off-by: Rafał Miłecki return UBI_IO_BAD_HDR_EBADMSG; --- a/drivers/mtd/ubi/ubi.h +++ b/drivers/mtd/ubi/ubi.h -@@ -822,6 +822,7 @@ extern struct mutex ubi_devices_mutex; +@@ -824,6 +824,7 @@ extern struct mutex ubi_devices_mutex; extern struct blocking_notifier_head ubi_notifiers; /* attach.c */ diff --git a/target/linux/bcm53xx/patches-5.10/905-BCM53573-minor-hacks.patch b/target/linux/bcm53xx/patches-5.10/905-BCM53573-minor-hacks.patch index f47ea95c95..a1d27949f0 100644 --- a/target/linux/bcm53xx/patches-5.10/905-BCM53573-minor-hacks.patch +++ b/target/linux/bcm53xx/patches-5.10/905-BCM53573-minor-hacks.patch @@ -61,7 +61,7 @@ Signed-off-by: Rafał Miłecki #include #include #include -@@ -919,6 +920,16 @@ static void arch_timer_of_configure_rate +@@ -934,6 +935,16 @@ static void arch_timer_of_configure_rate if (of_property_read_u32(np, "clock-frequency", &arch_timer_rate)) arch_timer_rate = rate; @@ -76,5 +76,5 @@ Signed-off-by: Rafał Miłecki + } + /* Check the timer frequency. */ - if (arch_timer_rate == 0) + if (validate_timer_rate()) pr_warn("frequency not available\n"); diff --git a/target/linux/lantiq/patches-5.10/0001-MIPS-lantiq-add-pcie-driver.patch b/target/linux/lantiq/patches-5.10/0001-MIPS-lantiq-add-pcie-driver.patch index 200c5629e7..c329931791 100644 --- a/target/linux/lantiq/patches-5.10/0001-MIPS-lantiq-add-pcie-driver.patch +++ b/target/linux/lantiq/patches-5.10/0001-MIPS-lantiq-add-pcie-driver.patch @@ -5481,7 +5481,7 @@ Signed-off-by: John Crispin (transaction layer end-to-end CRC checking). --- a/include/linux/pci.h +++ b/include/linux/pci.h -@@ -1416,6 +1416,8 @@ void pci_walk_bus(struct pci_bus *top, i +@@ -1417,6 +1417,8 @@ void pci_walk_bus(struct pci_bus *top, i void *userdata); int pci_cfg_space_size(struct pci_dev *dev); unsigned char pci_bus_max_busnr(struct pci_bus *bus); From 33e84e70ef6d0dd81ce0533f0c0495f9acc86ca9 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Wed, 4 Aug 2021 12:44:53 +0100 Subject: [PATCH 11/53] kernel: bump 5.10 to 5.10.56 No patches needed refreshing Signed-off-by: Rui Salvaterra --- include/kernel-version.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index dd55d69359..54e10af9a3 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -7,10 +7,10 @@ ifdef CONFIG_TESTING_KERNEL endif LINUX_VERSION-5.4 = .137 -LINUX_VERSION-5.10 = .55 +LINUX_VERSION-5.10 = .56 LINUX_KERNEL_HASH-5.4.137 = f09e5e366ce5d8bde887cda229ef17138fd1653706a702221f934f99aaa31f7c -LINUX_KERNEL_HASH-5.10.55 = 7581113dad67a095bc5cc32b457e1a9283f91579e248f3b547a7302157fe8889 +LINUX_KERNEL_HASH-5.10.56 = 4d6a0d5f9c50fa44890e0b61e1fb63f6efe6be448ceddfe1ad7c0cbd2890ec6b remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) From 3c0a26b43a2947d22cd907fde0e551273d56b121 Mon Sep 17 00:00:00 2001 From: John Audia Date: Wed, 4 Aug 2021 07:55:58 -0400 Subject: [PATCH 12/53] kernel: bump 5.4 to 5.4.138 All patches automatically rebased. Build system: x86_64 Build-tested: ipq806x/R7800 Run-tested: ipq806x/R7800 No dmesg regressions, everything functional Signed-off-by: John Audia --- include/kernel-version.mk | 4 ++-- ...tfilter-nf_flow_table-fix-offloaded-connection-tim.patch | 4 ++-- .../801-pci-mvebu-time-out-reset-on-link-up.patch | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 54e10af9a3..3ef1aba6c3 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,10 +6,10 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-5.4 = .137 +LINUX_VERSION-5.4 = .138 LINUX_VERSION-5.10 = .56 -LINUX_KERNEL_HASH-5.4.137 = f09e5e366ce5d8bde887cda229ef17138fd1653706a702221f934f99aaa31f7c +LINUX_KERNEL_HASH-5.4.138 = a43957727a54e5e1035d7372a1e64203ae8e3060c52a3816916157967f9a8657 LINUX_KERNEL_HASH-5.10.56 = 4d6a0d5f9c50fa44890e0b61e1fb63f6efe6be448ceddfe1ad7c0cbd2890ec6b remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/target/linux/generic/backport-5.4/370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch b/target/linux/generic/backport-5.4/370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch index 9bcb33b737..bf89af3840 100644 --- a/target/linux/generic/backport-5.4/370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch +++ b/target/linux/generic/backport-5.4/370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch @@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c -@@ -1207,18 +1207,6 @@ static bool gc_worker_can_early_drop(con +@@ -1212,18 +1212,6 @@ static bool gc_worker_can_early_drop(con return false; } @@ -40,7 +40,7 @@ Signed-off-by: Felix Fietkau static void gc_worker(struct work_struct *work) { unsigned int min_interval = max(HZ / GC_MAX_BUCKETS_DIV, 1u); -@@ -1255,10 +1243,8 @@ static void gc_worker(struct work_struct +@@ -1260,10 +1248,8 @@ static void gc_worker(struct work_struct tmp = nf_ct_tuplehash_to_ctrack(h); scanned++; diff --git a/target/linux/mvebu/patches-5.4/801-pci-mvebu-time-out-reset-on-link-up.patch b/target/linux/mvebu/patches-5.4/801-pci-mvebu-time-out-reset-on-link-up.patch index 4058dc8ed5..49ea3de0d1 100644 --- a/target/linux/mvebu/patches-5.4/801-pci-mvebu-time-out-reset-on-link-up.patch +++ b/target/linux/mvebu/patches-5.4/801-pci-mvebu-time-out-reset-on-link-up.patch @@ -13,7 +13,7 @@ Signed-off-by: Russell King --- a/drivers/pci/controller/pci-mvebu.c +++ b/drivers/pci/controller/pci-mvebu.c -@@ -928,6 +928,7 @@ static int mvebu_pcie_powerup(struct mve +@@ -936,6 +936,7 @@ static int mvebu_pcie_powerup(struct mve if (port->reset_gpio) { u32 reset_udelay = PCI_PM_D3COLD_WAIT * 1000; @@ -21,7 +21,7 @@ Signed-off-by: Russell King of_property_read_u32(port->dn, "reset-delay-us", &reset_udelay); -@@ -935,7 +936,13 @@ static int mvebu_pcie_powerup(struct mve +@@ -943,7 +944,13 @@ static int mvebu_pcie_powerup(struct mve udelay(100); gpiod_set_value_cansleep(port->reset_gpio, 0); @@ -36,7 +36,7 @@ Signed-off-by: Russell King } return 0; -@@ -1099,15 +1106,16 @@ static int mvebu_pcie_probe(struct platf +@@ -1107,15 +1114,16 @@ static int mvebu_pcie_probe(struct platf if (!child) continue; From 8e10b0181cf63f969705db6054ab0c16331069cf Mon Sep 17 00:00:00 2001 From: Damien Mascord Date: Tue, 13 Jul 2021 11:16:08 +1000 Subject: [PATCH 13/53] kernel: backport mdio_find_bus from 5.10.x mdio-tools (https://github.com/wkz/mdio-tools) requires the use of mdio_find_bus, which is not present in 5.4.x. This patch backports the required change from 5.10.x to 5.4.x The original patch submission for this can be found at https://patchwork.ozlabs.org/project/netdev/patch/20200201074625.8698-2-jeremy.linton@arm.com/ Signed-off-by: Damien Mascord [Add original patch description] Signed-off-by: Hauke Mehrtens --- .../771-mdio-bus-add-generic-find-bus.patch | 67 +++++++++++++++++++ ...detach-callback-to-struct-phy_driver.patch | 2 +- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 target/linux/generic/backport-5.4/771-mdio-bus-add-generic-find-bus.patch diff --git a/target/linux/generic/backport-5.4/771-mdio-bus-add-generic-find-bus.patch b/target/linux/generic/backport-5.4/771-mdio-bus-add-generic-find-bus.patch new file mode 100644 index 0000000000..b79fa0f18a --- /dev/null +++ b/target/linux/generic/backport-5.4/771-mdio-bus-add-generic-find-bus.patch @@ -0,0 +1,67 @@ +From ce69e2162f158d9d4a0e513971d02dabc7d14cb7 Mon Sep 17 00:00:00 2001 +From: Jeremy Linton +Date: Mon, 24 Feb 2020 16:53:58 -0600 +Subject: [PATCH] mdio_bus: Add generic mdio_find_bus() + +It appears most ethernet drivers follow one of two main strategies +for mdio bus/phy management. A monolithic model where the net driver +itself creates, probes and uses the phy, and one where an external +mdio/phy driver instantiates the mdio bus/phy and the net driver +only attaches to a known phy. Usually in this latter model the phys +are discovered via DT relationships or simply phy name/address +hardcoding. + +This is a shame because modern well behaved mdio buses are self +describing and can be probed. The mdio layer itself is fully capable +of this, yet there isn't a clean way for a standalone net driver +to attach and enumerate the discovered devices. This is because +outside of of_mdio_find_bus() there isn't a straightforward way +to acquire the mii_bus pointer. + +So, lets add a mdio_find_bus which can return the mii_bus based +only on its name. + +Signed-off-by: Jeremy Linton +Acked-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/phy/mdio_bus.c | 17 +++++++++++++++++ + include/linux/phy.h | 1 + + 2 files changed, 18 insertions(+) + +--- a/drivers/net/phy/mdio_bus.c ++++ b/drivers/net/phy/mdio_bus.c +@@ -260,6 +260,23 @@ static struct class mdio_bus_class = { + .dev_release = mdiobus_release, + }; + ++/** ++ * mdio_find_bus - Given the name of a mdiobus, find the mii_bus. ++ * @mdio_bus_np: Pointer to the mii_bus. ++ * ++ * Returns a reference to the mii_bus, or NULL if none found. The ++ * embedded struct device will have its reference count incremented, ++ * and this must be put_deviced'ed once the bus is finished with. ++ */ ++struct mii_bus *mdio_find_bus(const char *mdio_name) ++{ ++ struct device *d; ++ ++ d = class_find_device_by_name(&mdio_bus_class, mdio_name); ++ return d ? to_mii_bus(d) : NULL; ++} ++EXPORT_SYMBOL(mdio_find_bus); ++ + #if IS_ENABLED(CONFIG_OF_MDIO) + /** + * of_mdio_find_bus - Given an mii_bus node, find the mii_bus. +--- a/include/linux/phy.h ++++ b/include/linux/phy.h +@@ -273,6 +273,7 @@ static inline struct mii_bus *devm_mdiob + return devm_mdiobus_alloc_size(dev, 0); + } + ++struct mii_bus *mdio_find_bus(const char *mdio_name); + void devm_mdiobus_free(struct device *dev, struct mii_bus *bus); + struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr); + diff --git a/target/linux/generic/pending-5.4/703-phy-add-detach-callback-to-struct-phy_driver.patch b/target/linux/generic/pending-5.4/703-phy-add-detach-callback-to-struct-phy_driver.patch index b74b04ca59..e95cb6a4c5 100644 --- a/target/linux/generic/pending-5.4/703-phy-add-detach-callback-to-struct-phy_driver.patch +++ b/target/linux/generic/pending-5.4/703-phy-add-detach-callback-to-struct-phy_driver.patch @@ -23,7 +23,7 @@ Signed-off-by: Gabor Juhos sysfs_remove_link(&dev->dev.kobj, "phydev"); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -540,6 +540,12 @@ struct phy_driver { +@@ -541,6 +541,12 @@ struct phy_driver { /* Override default interrupt handling */ int (*handle_interrupt)(struct phy_device *phydev); From 968dc3329961918eb97b5eea3a9a00dade24c29c Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Tue, 27 Jul 2021 20:02:31 +0100 Subject: [PATCH 14/53] kernel/generic: add CONFIG_KCSAN to the 5.10 kconfig Add the missing CONFIG_KCSAN (disabled). Found while making kernel_oldconfig on an x86-64 subtarget. Signed-off-by: Rui Salvaterra --- target/linux/generic/config-5.10 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 index c129f73526..3b27a73022 100644 --- a/target/linux/generic/config-5.10 +++ b/target/linux/generic/config-5.10 @@ -2818,6 +2818,7 @@ CONFIG_KALLSYMS_BASE_RELATIVE=y CONFIG_KASAN_STACK=1 # CONFIG_KCMP is not set # CONFIG_KCOV is not set +# CONFIG_KCSAN is not set # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_CAT is not set # CONFIG_KERNEL_GZIP is not set From 86c0c12c74597e4e4cb617788334a5755056f803 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Thu, 29 Jul 2021 12:01:04 +0100 Subject: [PATCH 15/53] ath79: fix the AR7{1,2}00 USB PHY patches PHY_SIMPLE is a bogus kconfig symbol, what we really need to select is GENERIC_PHY. Signed-off-by: Rui Salvaterra --- .../ath79/patches-5.10/0004-phy-add-ath79-usb-phys.patch | 4 ++-- .../linux/ath79/patches-5.4/0004-phy-add-ath79-usb-phys.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/linux/ath79/patches-5.10/0004-phy-add-ath79-usb-phys.patch b/target/linux/ath79/patches-5.10/0004-phy-add-ath79-usb-phys.patch index e319f738a5..56c3d61887 100644 --- a/target/linux/ath79/patches-5.10/0004-phy-add-ath79-usb-phys.patch +++ b/target/linux/ath79/patches-5.10/0004-phy-add-ath79-usb-phys.patch @@ -23,7 +23,7 @@ Signed-off-by: John Crispin + tristate "Atheros AR7100 USB PHY driver" + depends on ATH79 || COMPILE_TEST + default y if USB_EHCI_HCD_PLATFORM -+ select PHY_SIMPLE ++ select GENERIC_PHY + help + Enable this to support the USB PHY on Atheros AR7100 SoCs. + @@ -31,7 +31,7 @@ Signed-off-by: John Crispin + tristate "Atheros AR7200 USB PHY driver" + depends on ATH79 || COMPILE_TEST + default y if USB_EHCI_HCD_PLATFORM -+ select PHY_SIMPLE ++ select GENERIC_PHY + help + Enable this to support the USB PHY on Atheros AR7200 SoCs. + diff --git a/target/linux/ath79/patches-5.4/0004-phy-add-ath79-usb-phys.patch b/target/linux/ath79/patches-5.4/0004-phy-add-ath79-usb-phys.patch index e319f738a5..56c3d61887 100644 --- a/target/linux/ath79/patches-5.4/0004-phy-add-ath79-usb-phys.patch +++ b/target/linux/ath79/patches-5.4/0004-phy-add-ath79-usb-phys.patch @@ -23,7 +23,7 @@ Signed-off-by: John Crispin + tristate "Atheros AR7100 USB PHY driver" + depends on ATH79 || COMPILE_TEST + default y if USB_EHCI_HCD_PLATFORM -+ select PHY_SIMPLE ++ select GENERIC_PHY + help + Enable this to support the USB PHY on Atheros AR7100 SoCs. + @@ -31,7 +31,7 @@ Signed-off-by: John Crispin + tristate "Atheros AR7200 USB PHY driver" + depends on ATH79 || COMPILE_TEST + default y if USB_EHCI_HCD_PLATFORM -+ select PHY_SIMPLE ++ select GENERIC_PHY + help + Enable this to support the USB PHY on Atheros AR7200 SoCs. + From b3b855191b08baf88ecf0255839164ac1863726e Mon Sep 17 00:00:00 2001 From: Klaus Kudielka Date: Sat, 17 Jul 2021 19:31:44 +0200 Subject: [PATCH 16/53] mvebu: backport Turris Omnia DTS changes to 5.10 Kernel 5.10 receives the complete set of improvements from 5.11/5.12. While we are at it, move the patches accepted upstream to the 0xx series. Signed-off-by: Klaus Kudielka --- ...rris-omnia-add-comphy-handle-to-eth2.patch | 37 ++++ ...rris-omnia-describe-switch-interrupt.patch | 61 +++++++ ...11-ARM-dts-turris-omnia-add-SFP-node.patch | 90 ++++++++++ ...turris-omnia-add-LED-controller-node.patch | 160 ++++++++++++++++++ ...te-ethernet-phy-node-and-handle-name.patch | 52 ++++++ ...mnia-fix-hardware-buffer-management.patch} | 14 +- 6 files changed, 410 insertions(+), 4 deletions(-) create mode 100644 target/linux/mvebu/patches-5.10/003-v5.11-ARM-dts-turris-omnia-add-comphy-handle-to-eth2.patch create mode 100644 target/linux/mvebu/patches-5.10/004-v5.11-ARM-dts-turris-omnia-describe-switch-interrupt.patch create mode 100644 target/linux/mvebu/patches-5.10/005-v5.11-ARM-dts-turris-omnia-add-SFP-node.patch create mode 100644 target/linux/mvebu/patches-5.10/006-v5.11-ARM-dts-turris-omnia-add-LED-controller-node.patch create mode 100644 target/linux/mvebu/patches-5.10/007-v5.11-ARM-dts-turris-omnia-update-ethernet-phy-node-and-handle-name.patch rename target/linux/mvebu/patches-5.10/{100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch => 008-v5.12-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch} (66%) diff --git a/target/linux/mvebu/patches-5.10/003-v5.11-ARM-dts-turris-omnia-add-comphy-handle-to-eth2.patch b/target/linux/mvebu/patches-5.10/003-v5.11-ARM-dts-turris-omnia-add-comphy-handle-to-eth2.patch new file mode 100644 index 0000000000..99ed07e13b --- /dev/null +++ b/target/linux/mvebu/patches-5.10/003-v5.11-ARM-dts-turris-omnia-add-comphy-handle-to-eth2.patch @@ -0,0 +1,37 @@ +From 9ec25ef84832209a8326f9a71fe3ba14f4bcf301 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Sun, 15 Nov 2020 14:59:18 +0100 +Subject: ARM: dts: turris-omnia: add comphy handle to eth2 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The eth2 controller on Turris Omnia is connected to SerDes. For SFP to +be able to switch between 1G and 2.5G modes the comphy link has to be +defined. + +Signed-off-by: Marek Behún +Fixes: f3a6a9f3704a ("ARM: dts: add description for Armada 38x ...") +Reviewed-by: Andrew Lunn +Reviewed-by: Andreas Färber +Cc: linux-arm-kernel@lists.infradead.org +Cc: Uwe Kleine-König +Cc: Jason Cooper +Cc: Gregory CLEMENT +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: Gregory CLEMENT +--- + arch/arm/boot/dts/armada-385-turris-omnia.dts | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts ++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts +@@ -129,6 +129,7 @@ + status = "okay"; + phy-mode = "sgmii"; + phy = <&phy1>; ++ phys = <&comphy5 2>; + buffer-manager = <&bm>; + bm,pool-long = <2>; + bm,pool-short = <3>; diff --git a/target/linux/mvebu/patches-5.10/004-v5.11-ARM-dts-turris-omnia-describe-switch-interrupt.patch b/target/linux/mvebu/patches-5.10/004-v5.11-ARM-dts-turris-omnia-describe-switch-interrupt.patch new file mode 100644 index 0000000000..4bbd80aac4 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/004-v5.11-ARM-dts-turris-omnia-describe-switch-interrupt.patch @@ -0,0 +1,61 @@ +From d29b67c220caf5f4905e1f1576e71bcb6de4af9e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Sun, 15 Nov 2020 14:59:19 +0100 +Subject: ARM: dts: turris-omnia: describe switch interrupt +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Describe switch interrupt for Turris Omnia so that the CPU does not have +to poll the switch. We also need to to set mpp45 pin to gpio function +for this. + +Signed-off-by: Marek Behún +Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia") +Cc: linux-arm-kernel@lists.infradead.org +Cc: Uwe Kleine-König +Cc: Jason Cooper +Cc: Gregory CLEMENT +Cc: Andreas Färber +Cc: Andrew Lunn +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: Gregory CLEMENT +--- + arch/arm/boot/dts/armada-385-turris-omnia.dts | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts ++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts +@@ -261,13 +261,18 @@ + + /* Switch MV88E6176 at address 0x10 */ + switch@10 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&swint_pins>; + compatible = "marvell,mv88e6085"; + #address-cells = <1>; + #size-cells = <0>; +- dsa,member = <0 0>; + ++ dsa,member = <0 0>; + reg = <0x10>; + ++ interrupt-parent = <&gpio1>; ++ interrupts = <13 IRQ_TYPE_LEVEL_LOW>; ++ + ports { + #address-cells = <1>; + #size-cells = <0>; +@@ -320,6 +325,11 @@ + marvell,function = "gpio"; + }; + ++ swint_pins: swint-pins { ++ marvell,pins = "mpp45"; ++ marvell,function = "gpio"; ++ }; ++ + spi0cs0_pins: spi0cs0-pins { + marvell,pins = "mpp25"; + marvell,function = "spi0"; diff --git a/target/linux/mvebu/patches-5.10/005-v5.11-ARM-dts-turris-omnia-add-SFP-node.patch b/target/linux/mvebu/patches-5.10/005-v5.11-ARM-dts-turris-omnia-add-SFP-node.patch new file mode 100644 index 0000000000..2447a4e240 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/005-v5.11-ARM-dts-turris-omnia-add-SFP-node.patch @@ -0,0 +1,90 @@ +From add2d65962977caf23ca2fa21a2457d31b636574 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Mon, 16 Nov 2020 13:24:22 +0100 +Subject: ARM: dts: turris-omnia: add SFP node +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Turris Omnia has an SFP cage that, together with WAN PHY, is connected +to eth2 SerDes via a SerDes multiplexor. When a SFP module is present, +the multiplexor switches the SerDes signal from PHY to SFP. + +Describe the SFP cage, but leave it disabled. Until phylink has support +for such configuration, we are leaving it to U-Boot to enable SFP and +disable WAN PHY at boot time depending on whether a SFP module is +present. + +Signed-off-by: Marek Behún +Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia") +Reviewed-by: Andrew Lunn +Cc: Russell King - ARM Linux admin +Cc: linux-arm-kernel@lists.infradead.org +Cc: Uwe Kleine-König +Cc: Jason Cooper +Cc: Gregory CLEMENT +Cc: Andreas Färber +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: Gregory CLEMENT +--- + arch/arm/boot/dts/armada-385-turris-omnia.dts | 30 ++++++++++++++++++++++++++- + 1 file changed, 29 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts ++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts +@@ -82,6 +82,24 @@ + }; + }; + }; ++ ++ sfp: sfp { ++ compatible = "sff,sfp"; ++ i2c-bus = <&sfp_i2c>; ++ tx-fault-gpios = <&pcawan 0 GPIO_ACTIVE_HIGH>; ++ tx-disable-gpios = <&pcawan 1 GPIO_ACTIVE_HIGH>; ++ rate-select0-gpios = <&pcawan 2 GPIO_ACTIVE_HIGH>; ++ los-gpios = <&pcawan 3 GPIO_ACTIVE_HIGH>; ++ mod-def0-gpios = <&pcawan 4 GPIO_ACTIVE_LOW>; ++ maximum-power-milliwatt = <3000>; ++ ++ /* ++ * For now this has to be enabled at boot time by U-Boot when ++ * a SFP module is present. Read more in the comment in the ++ * eth2 node below. ++ */ ++ status = "disabled"; ++ }; + }; + + &bm { +@@ -126,10 +144,20 @@ + + /* WAN port */ + ð2 { ++ /* ++ * eth2 is connected via a multiplexor to both the SFP cage and to ++ * ethernet-phy@1. The multiplexor switches the signal to SFP cage when ++ * a SFP module is present, as determined by the mode-def0 GPIO. ++ * ++ * Until kernel supports this configuration properly, in case SFP module ++ * is present, U-Boot has to enable the sfp node above, remove phy ++ * handle and add managed = "in-band-status" property. ++ */ + status = "okay"; + phy-mode = "sgmii"; + phy = <&phy1>; + phys = <&comphy5 2>; ++ sfp = <&sfp>; + buffer-manager = <&bm>; + bm,pool-long = <2>; + bm,pool-short = <3>; +@@ -195,7 +223,7 @@ + /* routed to PCIe2 connector (CN62A) */ + }; + +- i2c@4 { ++ sfp_i2c: i2c@4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; diff --git a/target/linux/mvebu/patches-5.10/006-v5.11-ARM-dts-turris-omnia-add-LED-controller-node.patch b/target/linux/mvebu/patches-5.10/006-v5.11-ARM-dts-turris-omnia-add-LED-controller-node.patch new file mode 100644 index 0000000000..c69067dbdc --- /dev/null +++ b/target/linux/mvebu/patches-5.10/006-v5.11-ARM-dts-turris-omnia-add-LED-controller-node.patch @@ -0,0 +1,160 @@ +From 91dd42d0e30fdbb250c61d1192af569f07e6ada4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Sun, 15 Nov 2020 14:59:21 +0100 +Subject: ARM: dts: turris-omnia: add LED controller node +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Linux now has incomplete support for the LED controller on Turris Omnia: +it can set brightness and colors for each LED. + +The controller can also put these LEDs into HW controlled mode, in which +the LEDs are controlled by HW: for example the WAN LED is connected via +MCU to the WAN PHY LED pin. + +The driver does not support these HW controlled modes yet, and on probe +puts the LEDs into SW controlled mode. + +Add node describing the LED controller, but disable it for now. + +Signed-off-by: Marek Behún +Cc: linux-arm-kernel@lists.infradead.org +Cc: Uwe Kleine-König +Cc: Jason Cooper +Cc: Gregory CLEMENT +Cc: Andreas Färber +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: Gregory CLEMENT +--- + arch/arm/boot/dts/armada-385-turris-omnia.dts | 111 +++++++++++++++++++++++++- + 1 file changed, 110 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts ++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts +@@ -12,6 +12,7 @@ + + #include + #include ++#include + #include "armada-385.dtsi" + + / { +@@ -181,7 +182,115 @@ + reg = <0>; + + /* STM32F0 command interface at address 0x2a */ +- /* leds device (in STM32F0) at address 0x2b */ ++ ++ led-controller@2b { ++ compatible = "cznic,turris-omnia-leds"; ++ reg = <0x2b>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ /* ++ * LEDs are controlled by MCU (STM32F0) at ++ * address 0x2b. ++ * ++ * The driver does not support HW control mode ++ * for the LEDs yet. Disable the LEDs for now. ++ * ++ * Also LED functions are not stable yet: ++ * - there are 3 LEDs connected via MCU to PCIe ++ * ports. One of these ports supports mSATA. ++ * There is no mSATA nor PCIe function. ++ * For now we use LED_FUNCTION_WLAN, since ++ * in most cases users have wifi cards in ++ * these slots ++ * - there are 2 LEDs dedicated for user: A and ++ * B. Again there is no such function defined. ++ * For now we use LED_FUNCTION_INDICATOR ++ */ ++ status = "disabled"; ++ ++ multi-led@0 { ++ reg = <0x0>; ++ color = ; ++ function = LED_FUNCTION_INDICATOR; ++ function-enumerator = <2>; ++ }; ++ ++ multi-led@1 { ++ reg = <0x1>; ++ color = ; ++ function = LED_FUNCTION_INDICATOR; ++ function-enumerator = <1>; ++ }; ++ ++ multi-led@2 { ++ reg = <0x2>; ++ color = ; ++ function = LED_FUNCTION_WLAN; ++ function-enumerator = <3>; ++ }; ++ ++ multi-led@3 { ++ reg = <0x3>; ++ color = ; ++ function = LED_FUNCTION_WLAN; ++ function-enumerator = <2>; ++ }; ++ ++ multi-led@4 { ++ reg = <0x4>; ++ color = ; ++ function = LED_FUNCTION_WLAN; ++ function-enumerator = <1>; ++ }; ++ ++ multi-led@5 { ++ reg = <0x5>; ++ color = ; ++ function = LED_FUNCTION_WAN; ++ }; ++ ++ multi-led@6 { ++ reg = <0x6>; ++ color = ; ++ function = LED_FUNCTION_LAN; ++ function-enumerator = <4>; ++ }; ++ ++ multi-led@7 { ++ reg = <0x7>; ++ color = ; ++ function = LED_FUNCTION_LAN; ++ function-enumerator = <3>; ++ }; ++ ++ multi-led@8 { ++ reg = <0x8>; ++ color = ; ++ function = LED_FUNCTION_LAN; ++ function-enumerator = <2>; ++ }; ++ ++ multi-led@9 { ++ reg = <0x9>; ++ color = ; ++ function = LED_FUNCTION_LAN; ++ function-enumerator = <1>; ++ }; ++ ++ multi-led@a { ++ reg = <0xa>; ++ color = ; ++ function = LED_FUNCTION_LAN; ++ function-enumerator = <0>; ++ }; ++ ++ multi-led@b { ++ reg = <0xb>; ++ color = ; ++ function = LED_FUNCTION_POWER; ++ }; ++ }; + + eeprom@54 { + compatible = "atmel,24c64"; diff --git a/target/linux/mvebu/patches-5.10/007-v5.11-ARM-dts-turris-omnia-update-ethernet-phy-node-and-handle-name.patch b/target/linux/mvebu/patches-5.10/007-v5.11-ARM-dts-turris-omnia-update-ethernet-phy-node-and-handle-name.patch new file mode 100644 index 0000000000..603a29106b --- /dev/null +++ b/target/linux/mvebu/patches-5.10/007-v5.11-ARM-dts-turris-omnia-update-ethernet-phy-node-and-handle-name.patch @@ -0,0 +1,52 @@ +From 8ee4a5f4f40da60bb85e13d9dd218a3c9197e3e3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Sun, 15 Nov 2020 14:59:22 +0100 +Subject: ARM: dts: turris-omnia: update ethernet-phy node and handle name +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use property name `phy-handle` instead of the deprecated `phy` to +connect eth2 to the PHY. +Rename the node from "phy@1" to "ethernet-phy@1", since "phy@1" is +incorrect according to device-tree bindings documentation. +Also remove the "ethernet-phy-id0141.0DD1" compatible string, it is not +needed. Kernel can read the PHY identifier itself. + +Signed-off-by: Marek Behún +Reviewed-by: Andrew Lunn +Cc: linux-arm-kernel@lists.infradead.org +Cc: Uwe Kleine-König +Cc: Jason Cooper +Cc: Gregory CLEMENT +Cc: Andreas Färber +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: Gregory CLEMENT +--- + arch/arm/boot/dts/armada-385-turris-omnia.dts | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts ++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts +@@ -156,7 +156,7 @@ + */ + status = "okay"; + phy-mode = "sgmii"; +- phy = <&phy1>; ++ phy-handle = <&phy1>; + phys = <&comphy5 2>; + sfp = <&sfp>; + buffer-manager = <&bm>; +@@ -387,9 +387,9 @@ + pinctrl-0 = <&mdio_pins>; + status = "okay"; + +- phy1: phy@1 { ++ phy1: ethernet-phy@1 { + status = "okay"; +- compatible = "ethernet-phy-id0141.0DD1", "ethernet-phy-ieee802.3-c22"; ++ compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + marvell,reg-init = <3 18 0 0x4985>; + diff --git a/target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch b/target/linux/mvebu/patches-5.10/008-v5.12-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch similarity index 66% rename from target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch rename to target/linux/mvebu/patches-5.10/008-v5.12-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch index a3f41fb5cb..7f5322e7f3 100644 --- a/target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch +++ b/target/linux/mvebu/patches-5.10/008-v5.12-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch @@ -1,7 +1,10 @@ -From 9704292ed3230ee19dc4dd64f7484301b728ffb7 Mon Sep 17 00:00:00 2001 +From 5b2c7e0ae762fff2b172caf16b2766cc3e1ad859 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra -Date: Wed, 17 Feb 2021 15:19:30 +0000 -Subject: [PATCH] ARM: dts: turris-omnia: fix hardware buffer management +Date: Wed, 17 Feb 2021 15:30:38 +0000 +Subject: ARM: dts: turris-omnia: fix hardware buffer management +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Hardware buffer management has never worked on the Turris Omnia, as the required MBus window hadn't been reserved. Fix thusly. @@ -9,13 +12,16 @@ required MBus window hadn't been reserved. Fix thusly. Fixes: 018b88eee1a2 ("ARM: dts: turris-omnia: enable HW buffer management") Signed-off-by: Rui Salvaterra +Reviewed-by: Marek Behún +Tested-by: Klaus Kudielka +Signed-off-by: Gregory CLEMENT --- arch/arm/boot/dts/armada-385-turris-omnia.dts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/arch/arm/boot/dts/armada-385-turris-omnia.dts +++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts -@@ -31,7 +31,8 @@ +@@ -32,7 +32,8 @@ ranges = Date: Sat, 17 Jul 2021 19:32:57 +0200 Subject: [PATCH 17/53] mvebu: backport Turris Omnia DTS changes to 5.4 Kernel 5.4 receives a reduced set, just to make the SFP cage work. While we are at it, move the patches accepted upstream to the 0xx series. Signed-off-by: Klaus Kudielka --- ...s-omnia-enable-HW-buffer-management.patch} | 0 ...rris-omnia-add-comphy-handle-to-eth2.patch | 37 ++++++++ ...rris-omnia-describe-switch-interrupt.patch | 61 +++++++++++++ ...32-ARM-dts-turris-omnia-add-SFP-node.patch | 90 +++++++++++++++++++ ...te-ethernet-phy-node-and-handle-name.patch | 52 +++++++++++ ...mnia-fix-hardware-buffer-management.patch} | 12 ++- 6 files changed, 249 insertions(+), 3 deletions(-) rename target/linux/mvebu/patches-5.4/{317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch => 029-ARM-dts-turris-omnia-enable-HW-buffer-management.patch} (100%) create mode 100644 target/linux/mvebu/patches-5.4/030-ARM-dts-turris-omnia-add-comphy-handle-to-eth2.patch create mode 100644 target/linux/mvebu/patches-5.4/031-ARM-dts-turris-omnia-describe-switch-interrupt.patch create mode 100644 target/linux/mvebu/patches-5.4/032-ARM-dts-turris-omnia-add-SFP-node.patch create mode 100644 target/linux/mvebu/patches-5.4/033-ARM-dts-turris-omnia-update-ethernet-phy-node-and-handle-name.patch rename target/linux/mvebu/patches-5.4/{318-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch => 034-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch} (67%) diff --git a/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch b/target/linux/mvebu/patches-5.4/029-ARM-dts-turris-omnia-enable-HW-buffer-management.patch similarity index 100% rename from target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch rename to target/linux/mvebu/patches-5.4/029-ARM-dts-turris-omnia-enable-HW-buffer-management.patch diff --git a/target/linux/mvebu/patches-5.4/030-ARM-dts-turris-omnia-add-comphy-handle-to-eth2.patch b/target/linux/mvebu/patches-5.4/030-ARM-dts-turris-omnia-add-comphy-handle-to-eth2.patch new file mode 100644 index 0000000000..99ed07e13b --- /dev/null +++ b/target/linux/mvebu/patches-5.4/030-ARM-dts-turris-omnia-add-comphy-handle-to-eth2.patch @@ -0,0 +1,37 @@ +From 9ec25ef84832209a8326f9a71fe3ba14f4bcf301 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Sun, 15 Nov 2020 14:59:18 +0100 +Subject: ARM: dts: turris-omnia: add comphy handle to eth2 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The eth2 controller on Turris Omnia is connected to SerDes. For SFP to +be able to switch between 1G and 2.5G modes the comphy link has to be +defined. + +Signed-off-by: Marek Behún +Fixes: f3a6a9f3704a ("ARM: dts: add description for Armada 38x ...") +Reviewed-by: Andrew Lunn +Reviewed-by: Andreas Färber +Cc: linux-arm-kernel@lists.infradead.org +Cc: Uwe Kleine-König +Cc: Jason Cooper +Cc: Gregory CLEMENT +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: Gregory CLEMENT +--- + arch/arm/boot/dts/armada-385-turris-omnia.dts | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts ++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts +@@ -129,6 +129,7 @@ + status = "okay"; + phy-mode = "sgmii"; + phy = <&phy1>; ++ phys = <&comphy5 2>; + buffer-manager = <&bm>; + bm,pool-long = <2>; + bm,pool-short = <3>; diff --git a/target/linux/mvebu/patches-5.4/031-ARM-dts-turris-omnia-describe-switch-interrupt.patch b/target/linux/mvebu/patches-5.4/031-ARM-dts-turris-omnia-describe-switch-interrupt.patch new file mode 100644 index 0000000000..4bbd80aac4 --- /dev/null +++ b/target/linux/mvebu/patches-5.4/031-ARM-dts-turris-omnia-describe-switch-interrupt.patch @@ -0,0 +1,61 @@ +From d29b67c220caf5f4905e1f1576e71bcb6de4af9e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Sun, 15 Nov 2020 14:59:19 +0100 +Subject: ARM: dts: turris-omnia: describe switch interrupt +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Describe switch interrupt for Turris Omnia so that the CPU does not have +to poll the switch. We also need to to set mpp45 pin to gpio function +for this. + +Signed-off-by: Marek Behún +Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia") +Cc: linux-arm-kernel@lists.infradead.org +Cc: Uwe Kleine-König +Cc: Jason Cooper +Cc: Gregory CLEMENT +Cc: Andreas Färber +Cc: Andrew Lunn +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: Gregory CLEMENT +--- + arch/arm/boot/dts/armada-385-turris-omnia.dts | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts ++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts +@@ -261,13 +261,18 @@ + + /* Switch MV88E6176 at address 0x10 */ + switch@10 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&swint_pins>; + compatible = "marvell,mv88e6085"; + #address-cells = <1>; + #size-cells = <0>; +- dsa,member = <0 0>; + ++ dsa,member = <0 0>; + reg = <0x10>; + ++ interrupt-parent = <&gpio1>; ++ interrupts = <13 IRQ_TYPE_LEVEL_LOW>; ++ + ports { + #address-cells = <1>; + #size-cells = <0>; +@@ -320,6 +325,11 @@ + marvell,function = "gpio"; + }; + ++ swint_pins: swint-pins { ++ marvell,pins = "mpp45"; ++ marvell,function = "gpio"; ++ }; ++ + spi0cs0_pins: spi0cs0-pins { + marvell,pins = "mpp25"; + marvell,function = "spi0"; diff --git a/target/linux/mvebu/patches-5.4/032-ARM-dts-turris-omnia-add-SFP-node.patch b/target/linux/mvebu/patches-5.4/032-ARM-dts-turris-omnia-add-SFP-node.patch new file mode 100644 index 0000000000..2447a4e240 --- /dev/null +++ b/target/linux/mvebu/patches-5.4/032-ARM-dts-turris-omnia-add-SFP-node.patch @@ -0,0 +1,90 @@ +From add2d65962977caf23ca2fa21a2457d31b636574 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Mon, 16 Nov 2020 13:24:22 +0100 +Subject: ARM: dts: turris-omnia: add SFP node +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Turris Omnia has an SFP cage that, together with WAN PHY, is connected +to eth2 SerDes via a SerDes multiplexor. When a SFP module is present, +the multiplexor switches the SerDes signal from PHY to SFP. + +Describe the SFP cage, but leave it disabled. Until phylink has support +for such configuration, we are leaving it to U-Boot to enable SFP and +disable WAN PHY at boot time depending on whether a SFP module is +present. + +Signed-off-by: Marek Behún +Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia") +Reviewed-by: Andrew Lunn +Cc: Russell King - ARM Linux admin +Cc: linux-arm-kernel@lists.infradead.org +Cc: Uwe Kleine-König +Cc: Jason Cooper +Cc: Gregory CLEMENT +Cc: Andreas Färber +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: Gregory CLEMENT +--- + arch/arm/boot/dts/armada-385-turris-omnia.dts | 30 ++++++++++++++++++++++++++- + 1 file changed, 29 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts ++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts +@@ -82,6 +82,24 @@ + }; + }; + }; ++ ++ sfp: sfp { ++ compatible = "sff,sfp"; ++ i2c-bus = <&sfp_i2c>; ++ tx-fault-gpios = <&pcawan 0 GPIO_ACTIVE_HIGH>; ++ tx-disable-gpios = <&pcawan 1 GPIO_ACTIVE_HIGH>; ++ rate-select0-gpios = <&pcawan 2 GPIO_ACTIVE_HIGH>; ++ los-gpios = <&pcawan 3 GPIO_ACTIVE_HIGH>; ++ mod-def0-gpios = <&pcawan 4 GPIO_ACTIVE_LOW>; ++ maximum-power-milliwatt = <3000>; ++ ++ /* ++ * For now this has to be enabled at boot time by U-Boot when ++ * a SFP module is present. Read more in the comment in the ++ * eth2 node below. ++ */ ++ status = "disabled"; ++ }; + }; + + &bm { +@@ -126,10 +144,20 @@ + + /* WAN port */ + ð2 { ++ /* ++ * eth2 is connected via a multiplexor to both the SFP cage and to ++ * ethernet-phy@1. The multiplexor switches the signal to SFP cage when ++ * a SFP module is present, as determined by the mode-def0 GPIO. ++ * ++ * Until kernel supports this configuration properly, in case SFP module ++ * is present, U-Boot has to enable the sfp node above, remove phy ++ * handle and add managed = "in-band-status" property. ++ */ + status = "okay"; + phy-mode = "sgmii"; + phy = <&phy1>; + phys = <&comphy5 2>; ++ sfp = <&sfp>; + buffer-manager = <&bm>; + bm,pool-long = <2>; + bm,pool-short = <3>; +@@ -195,7 +223,7 @@ + /* routed to PCIe2 connector (CN62A) */ + }; + +- i2c@4 { ++ sfp_i2c: i2c@4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; diff --git a/target/linux/mvebu/patches-5.4/033-ARM-dts-turris-omnia-update-ethernet-phy-node-and-handle-name.patch b/target/linux/mvebu/patches-5.4/033-ARM-dts-turris-omnia-update-ethernet-phy-node-and-handle-name.patch new file mode 100644 index 0000000000..5ceef5dc46 --- /dev/null +++ b/target/linux/mvebu/patches-5.4/033-ARM-dts-turris-omnia-update-ethernet-phy-node-and-handle-name.patch @@ -0,0 +1,52 @@ +From 8ee4a5f4f40da60bb85e13d9dd218a3c9197e3e3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Sun, 15 Nov 2020 14:59:22 +0100 +Subject: ARM: dts: turris-omnia: update ethernet-phy node and handle name +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use property name `phy-handle` instead of the deprecated `phy` to +connect eth2 to the PHY. +Rename the node from "phy@1" to "ethernet-phy@1", since "phy@1" is +incorrect according to device-tree bindings documentation. +Also remove the "ethernet-phy-id0141.0DD1" compatible string, it is not +needed. Kernel can read the PHY identifier itself. + +Signed-off-by: Marek Behún +Reviewed-by: Andrew Lunn +Cc: linux-arm-kernel@lists.infradead.org +Cc: Uwe Kleine-König +Cc: Jason Cooper +Cc: Gregory CLEMENT +Cc: Andreas Färber +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: Gregory CLEMENT +--- + arch/arm/boot/dts/armada-385-turris-omnia.dts | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts ++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts +@@ -155,7 +155,7 @@ + */ + status = "okay"; + phy-mode = "sgmii"; +- phy = <&phy1>; ++ phy-handle = <&phy1>; + phys = <&comphy5 2>; + sfp = <&sfp>; + buffer-manager = <&bm>; +@@ -278,9 +278,9 @@ + pinctrl-0 = <&mdio_pins>; + status = "okay"; + +- phy1: phy@1 { ++ phy1: ethernet-phy@1 { + status = "okay"; +- compatible = "ethernet-phy-id0141.0DD1", "ethernet-phy-ieee802.3-c22"; ++ compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + marvell,reg-init = <3 18 0 0x4985>; + diff --git a/target/linux/mvebu/patches-5.4/318-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch b/target/linux/mvebu/patches-5.4/034-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch similarity index 67% rename from target/linux/mvebu/patches-5.4/318-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch rename to target/linux/mvebu/patches-5.4/034-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch index a3f41fb5cb..4283a61341 100644 --- a/target/linux/mvebu/patches-5.4/318-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch +++ b/target/linux/mvebu/patches-5.4/034-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch @@ -1,7 +1,10 @@ -From 9704292ed3230ee19dc4dd64f7484301b728ffb7 Mon Sep 17 00:00:00 2001 +From 5b2c7e0ae762fff2b172caf16b2766cc3e1ad859 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra -Date: Wed, 17 Feb 2021 15:19:30 +0000 -Subject: [PATCH] ARM: dts: turris-omnia: fix hardware buffer management +Date: Wed, 17 Feb 2021 15:30:38 +0000 +Subject: ARM: dts: turris-omnia: fix hardware buffer management +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Hardware buffer management has never worked on the Turris Omnia, as the required MBus window hadn't been reserved. Fix thusly. @@ -9,6 +12,9 @@ required MBus window hadn't been reserved. Fix thusly. Fixes: 018b88eee1a2 ("ARM: dts: turris-omnia: enable HW buffer management") Signed-off-by: Rui Salvaterra +Reviewed-by: Marek Behún +Tested-by: Klaus Kudielka +Signed-off-by: Gregory CLEMENT --- arch/arm/boot/dts/armada-385-turris-omnia.dts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) From 82620cd610807da73935832e3751771866faa7c9 Mon Sep 17 00:00:00 2001 From: Klaus Kudielka Date: Sat, 27 Feb 2021 12:56:10 +0100 Subject: [PATCH 18/53] mvebu: Turris Omnia: use SFP module, if present Follow the recommendations stated in the Turris Omnia DTS for eth2: "In case SFP module is present, U-Boot has to enable the sfp node above, remove phy-handle property, and add managed = "in-band-status" property." The boot script is written in a way, that it works for all U-Boot versions deployed by the vendor so far (2015.10-rc2, 2019.07). Signed-off-by: Klaus Kudielka --- .../linux/mvebu/image/turris-omnia.bootscript | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/target/linux/mvebu/image/turris-omnia.bootscript b/target/linux/mvebu/image/turris-omnia.bootscript index fcec5fc1b8..9a3fc0d8cb 100644 --- a/target/linux/mvebu/image/turris-omnia.bootscript +++ b/target/linux/mvebu/image/turris-omnia.bootscript @@ -11,7 +11,22 @@ else fi setenv bootargs earlyprintk console=ttyS0,115200 root=${rootdev} rootfstype=auto rootwait -# Load and boot +# Load device tree and prepare for modification load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} @DTB@.dtb +fdt addr ${fdt_addr_r} +fdt resize + +# Enable SFP cage, if module is present +i2c dev 0 +i2c mw 0x70 0.0 0xf +i2c read 0x71 0 1 0x00fffff1 +setexpr.b mod_def0 *0x00fffff1 \& 0x10 +if test ${mod_def0} -eq 0; then + fdt set /sfp status okay + fdt rm /soc/internal-regs/ethernet@34000 phy-handle + fdt set /soc/internal-regs/ethernet@34000 managed in-band-status +fi + +# Load kernel and boot load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} zImage bootz ${kernel_addr_r} - ${fdt_addr_r} From 7b868fe04a8961048feec1143e72fe47bde52a12 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Tue, 27 Jul 2021 13:22:30 +0200 Subject: [PATCH 19/53] Revert "mvebu: 5.4 fix DVFS caused random boot crashes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on the discussion on the mailing list [1], the patch which was reverted, it reverts only one patch without the subsequent ones. This leads to the SoC scaling issue not using a CPU parent clock, but it uses DDR clock. This is done for all variants, and it's wrong because commits (hacks) that were using the DDR clock are no longer in the mainline kernel. If someone has stability issues on 1.2 GHz, it should not affect all routers (1 GHz, 800 MHz) and it should be rather consulted with guys, who are trying to improve the situation in the kernel and not making the situation worse. There are two solutions in cases of instability: a) disable cpufreq b) underclock it up to 1 GHz This reverts commit 080a0b74e39d159eecf69c468debec42f28bf4d8. [1] https://lists.openwrt.org/pipermail/openwrt-devel/2021-June/035702.html CC: Pali Rohár Signed-off-by: Josef Schlehofer --- ...rmada-37xx-Fix-setting-TBG-parent-fo.patch | 107 ------------------ 1 file changed, 107 deletions(-) delete mode 100644 target/linux/mvebu/patches-5.4/803-Revert-cpufreq-armada-37xx-Fix-setting-TBG-parent-fo.patch diff --git a/target/linux/mvebu/patches-5.4/803-Revert-cpufreq-armada-37xx-Fix-setting-TBG-parent-fo.patch b/target/linux/mvebu/patches-5.4/803-Revert-cpufreq-armada-37xx-Fix-setting-TBG-parent-fo.patch deleted file mode 100644 index 65184df584..0000000000 --- a/target/linux/mvebu/patches-5.4/803-Revert-cpufreq-armada-37xx-Fix-setting-TBG-parent-fo.patch +++ /dev/null @@ -1,107 +0,0 @@ -From 35639bac13927d1476398b740b11cbed0ee3ddb2 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Tue, 18 May 2021 13:24:30 +0200 -Subject: [PATCH] Revert "cpufreq: armada-37xx: Fix setting TBG parent for load - levels" - -This reverts commit a13b110e7c9e0dc2edcc7a19d4255fc88abd83cc. - -This patch actually corrects the things so that 1 or 1.2GHz models would -actually get scaled to their native frequency. - -However, due to a AVS setting voltages too low this will cause random -crashes on 1.2GHz models. - -So, until a new safe for everybody voltage is agreed on -lets revert the patch. - -Signed-off-by: Robert Marko ---- - drivers/cpufreq/armada-37xx-cpufreq.c | 35 +++++++++------------------ - 1 file changed, 12 insertions(+), 23 deletions(-) - ---- a/drivers/cpufreq/armada-37xx-cpufreq.c -+++ b/drivers/cpufreq/armada-37xx-cpufreq.c -@@ -25,10 +25,6 @@ - - #include "cpufreq-dt.h" - --/* Clk register set */ --#define ARMADA_37XX_CLK_TBG_SEL 0 --#define ARMADA_37XX_CLK_TBG_SEL_CPU_OFF 22 -- - /* Power management in North Bridge register set */ - #define ARMADA_37XX_NB_L0L1 0x18 - #define ARMADA_37XX_NB_L2L3 0x1C -@@ -126,15 +122,10 @@ static struct armada_37xx_dvfs *armada_3 - * will be configured then the DVFS will be enabled. - */ - static void __init armada37xx_cpufreq_dvfs_setup(struct regmap *base, -- struct regmap *clk_base, u8 *divider) -+ struct clk *clk, u8 *divider) - { -- u32 cpu_tbg_sel; - int load_lvl; -- -- /* Determine to which TBG clock is CPU connected */ -- regmap_read(clk_base, ARMADA_37XX_CLK_TBG_SEL, &cpu_tbg_sel); -- cpu_tbg_sel >>= ARMADA_37XX_CLK_TBG_SEL_CPU_OFF; -- cpu_tbg_sel &= ARMADA_37XX_NB_TBG_SEL_MASK; -+ struct clk *parent; - - for (load_lvl = 0; load_lvl < LOAD_LEVEL_NR; load_lvl++) { - unsigned int reg, mask, val, offset = 0; -@@ -153,11 +144,6 @@ static void __init armada37xx_cpufreq_dv - mask = (ARMADA_37XX_NB_CLK_SEL_MASK - << ARMADA_37XX_NB_CLK_SEL_OFF); - -- /* Set TBG index, for all levels we use the same TBG */ -- val = cpu_tbg_sel << ARMADA_37XX_NB_TBG_SEL_OFF; -- mask = (ARMADA_37XX_NB_TBG_SEL_MASK -- << ARMADA_37XX_NB_TBG_SEL_OFF); -- - /* - * Set cpu divider based on the pre-computed array in - * order to have balanced step. -@@ -176,6 +162,14 @@ static void __init armada37xx_cpufreq_dv - - regmap_update_bits(base, reg, mask, val); - } -+ -+ /* -+ * Set cpu clock source, for all the level we keep the same -+ * clock source that the one already configured. For this one -+ * we need to use the clock framework -+ */ -+ parent = clk_get_parent(clk); -+ clk_set_parent(clk, parent); - } - - /* -@@ -401,16 +395,11 @@ static int __init armada37xx_cpufreq_dri - struct platform_device *pdev; - unsigned long freq; - unsigned int cur_frequency, base_frequency; -- struct regmap *nb_clk_base, *nb_pm_base, *avs_base; -+ struct regmap *nb_pm_base, *avs_base; - struct device *cpu_dev; - int load_lvl, ret; - struct clk *clk, *parent; - -- nb_clk_base = -- syscon_regmap_lookup_by_compatible("marvell,armada-3700-periph-clock-nb"); -- if (IS_ERR(nb_clk_base)) -- return -ENODEV; -- - nb_pm_base = - syscon_regmap_lookup_by_compatible("marvell,armada-3700-nb-pm"); - -@@ -487,7 +476,7 @@ static int __init armada37xx_cpufreq_dri - armada37xx_cpufreq_avs_configure(avs_base, dvfs); - armada37xx_cpufreq_avs_setup(avs_base, dvfs); - -- armada37xx_cpufreq_dvfs_setup(nb_pm_base, nb_clk_base, dvfs->divider); -+ armada37xx_cpufreq_dvfs_setup(nb_pm_base, clk, dvfs->divider); - clk_put(clk); - - for (load_lvl = ARMADA_37XX_DVFS_LOAD_0; load_lvl < LOAD_LEVEL_NR; From d3794768177293f584cc74f90c921276793da1e7 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Tue, 27 Jul 2021 13:22:31 +0200 Subject: [PATCH 20/53] mvebu: armada-37xx: add patch to forbid cpufreq for 1.2 GHz This patch is backported from linux-arm-kernel [1] to improve situation, when it was reported that 1.2 GHz variant is unstable with DFS. It waits to be accepted upstream, however, it waits for Marvell people to respond. [1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20210630225601.6372-1-kabel@kernel.org/ Signed-off-by: Josef Schlehofer --- ...x-forbid-cpufreq-for-1.2-GHz-variant.patch | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 target/linux/mvebu/patches-5.4/100-cpufreq-armada-37xx-forbid-cpufreq-for-1.2-GHz-variant.patch diff --git a/target/linux/mvebu/patches-5.4/100-cpufreq-armada-37xx-forbid-cpufreq-for-1.2-GHz-variant.patch b/target/linux/mvebu/patches-5.4/100-cpufreq-armada-37xx-forbid-cpufreq-for-1.2-GHz-variant.patch new file mode 100644 index 0000000000..6a5b8220f8 --- /dev/null +++ b/target/linux/mvebu/patches-5.4/100-cpufreq-armada-37xx-forbid-cpufreq-for-1.2-GHz-variant.patch @@ -0,0 +1,39 @@ +From: =?utf-8?q?Marek_Beh=C3=BAn?= +Subject: [PATCH v2] cpufreq: armada-37xx: forbid cpufreq for 1.2 GHz variant +Date: Thu, 1 Jul 2021 00:56:01 +0200 + +The 1.2 GHz variant of the Armada 3720 SOC is unstable with DVFS: when +the SOC boots, the WTMI firmware sets clocks and AVS values that work +correctly with 1.2 GHz CPU frequency, but random crashes occur once +cpufreq driver starts scaling. + +We do not know currently what is the reason: +- it may be that the voltage value for L0 for 1.2 GHz variant provided + by the vendor in the OTP is simply incorrect when scaling is used, +- it may be that some delay is needed somewhere, +- it may be something else. + +The most sane solution now seems to be to simply forbid the cpufreq +driver on 1.2 GHz variant. + +Signed-off-by: Marek Behún +Fixes: 92ce45fb875d ("cpufreq: Add DVFS support for Armada 37xx") +--- + drivers/cpufreq/armada-37xx-cpufreq.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/cpufreq/armada-37xx-cpufreq.c ++++ b/drivers/cpufreq/armada-37xx-cpufreq.c +@@ -102,7 +102,11 @@ struct armada_37xx_dvfs { + }; + + static struct armada_37xx_dvfs armada_37xx_dvfs[] = { +- {.cpu_freq_max = 1200*1000*1000, .divider = {1, 2, 4, 6} }, ++ /* ++ * The cpufreq scaling for 1.2 GHz variant of the SOC is currently ++ * unstable because we do not know how to configure it properly. ++ */ ++ /* {.cpu_freq_max = 1200*1000*1000, .divider = {1, 2, 4, 6} }, */ + {.cpu_freq_max = 1000*1000*1000, .divider = {1, 2, 4, 5} }, + {.cpu_freq_max = 800*1000*1000, .divider = {1, 2, 3, 4} }, + {.cpu_freq_max = 600*1000*1000, .divider = {2, 4, 5, 6} }, From 83441522a2389fd44630df3368c3eecf3cb2579f Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Fri, 23 Jul 2021 12:29:27 +0200 Subject: [PATCH 21/53] gemini: Add hdparm setting This uses "hdparm" (if present) to get the harddisk into low power mode on NAS set-ups. Cc: Adrian Schmutzler Signed-off-by: Linus Walleij --- .../linux/gemini/base-files/etc/board.d/03_hdparm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 target/linux/gemini/base-files/etc/board.d/03_hdparm diff --git a/target/linux/gemini/base-files/etc/board.d/03_hdparm b/target/linux/gemini/base-files/etc/board.d/03_hdparm new file mode 100644 index 0000000000..27f2b76042 --- /dev/null +++ b/target/linux/gemini/base-files/etc/board.d/03_hdparm @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Spin down drives after one minute if inactive + +if [ ! -n "$(command -v hdparm)" ]; then + exit 0 +fi + +DISKS=$(find /dev/sd[a-z] 2>/dev/null) +for DISK in $DISKS +do + if [ -b $DISK ] ; then + hdparm -S 12 $DISK > /dev/null + fi +done From 6c659fb80c6bb101d51b66e9631e8ec8116ecc9c Mon Sep 17 00:00:00 2001 From: Martin Schiller Date: Tue, 27 Jul 2021 09:10:44 +0200 Subject: [PATCH 22/53] layerscape: armv8_64b: do not disable CONFIG_IP_ADVANCED_ROUTER This option is needed e.g. to use strongswan for IPSec. BTW: This was the only target where this option was disabled. Signed-off-by: Martin Schiller --- target/linux/layerscape/armv8_64b/config-5.4 | 1 - 1 file changed, 1 deletion(-) diff --git a/target/linux/layerscape/armv8_64b/config-5.4 b/target/linux/layerscape/armv8_64b/config-5.4 index e2e998b38d..6e3618f274 100644 --- a/target/linux/layerscape/armv8_64b/config-5.4 +++ b/target/linux/layerscape/armv8_64b/config-5.4 @@ -452,7 +452,6 @@ CONFIG_IOMMU_IO_PGTABLE_LPAE=y # CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set CONFIG_IOMMU_SUPPORT=y CONFIG_IPC_NS=y -# CONFIG_IP_ADVANCED_ROUTER is not set CONFIG_IRQCHIP=y CONFIG_IRQ_BYPASS_MANAGER=y CONFIG_IRQ_DOMAIN=y From 0af0ec1b7df8740c7a4b9264f032cfd6dd87d144 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Wed, 28 Jul 2021 12:33:09 +0100 Subject: [PATCH 23/53] toolchain/gcc: bump gcc 11 to 11.2 Patches automatically refreshed. Signed-off-by: Rui Salvaterra --- toolchain/gcc/Config.version | 2 +- toolchain/gcc/common.mk | 4 ++-- .../gcc/patches/{11.1.0 => 11.2.0}/002-case_insensitive.patch | 0 .../gcc/patches/{11.1.0 => 11.2.0}/010-documentation.patch | 0 .../patches/{11.1.0 => 11.2.0}/110-Fix-MIPS-PR-84790.patch | 0 .../gcc/patches/{11.1.0 => 11.2.0}/230-musl_libssp.patch | 0 .../{11.1.0 => 11.2.0}/300-mips_Os_cpu_rtx_cost_model.patch | 0 .../patches/{11.1.0 => 11.2.0}/810-arm-softfloat-libgcc.patch | 0 toolchain/gcc/patches/{11.1.0 => 11.2.0}/820-libgcc_pic.patch | 0 .../{11.1.0 => 11.2.0}/840-armv4_pass_fix-v4bx_to_ld.patch | 0 .../patches/{11.1.0 => 11.2.0}/850-use_shared_libgcc.patch | 0 .../gcc/patches/{11.1.0 => 11.2.0}/851-libgcc_no_compat.patch | 0 .../gcc/patches/{11.1.0 => 11.2.0}/870-ppc_no_crtsavres.patch | 0 .../gcc/patches/{11.1.0 => 11.2.0}/881-no_tm_section.patch | 0 .../gcc/patches/{11.1.0 => 11.2.0}/900-bad-mips16-crt.patch | 0 toolchain/gcc/patches/{11.1.0 => 11.2.0}/910-mbsd_multi.patch | 2 +- .../{11.1.0 => 11.2.0}/920-specs_nonfatal_getenv.patch | 2 +- .../patches/{11.1.0 => 11.2.0}/930-fix-mips-noexecstack.patch | 0 .../931-libffi-fix-MIPS-softfloat-build-issue.patch | 0 ...0-gotools-fix-compilation-when-making-cross-compiler.patch | 0 20 files changed, 5 insertions(+), 5 deletions(-) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/002-case_insensitive.patch (100%) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/010-documentation.patch (100%) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/110-Fix-MIPS-PR-84790.patch (100%) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/230-musl_libssp.patch (100%) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/300-mips_Os_cpu_rtx_cost_model.patch (100%) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/810-arm-softfloat-libgcc.patch (100%) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/820-libgcc_pic.patch (100%) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/840-armv4_pass_fix-v4bx_to_ld.patch (100%) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/850-use_shared_libgcc.patch (100%) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/851-libgcc_no_compat.patch (100%) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/870-ppc_no_crtsavres.patch (100%) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/881-no_tm_section.patch (100%) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/900-bad-mips16-crt.patch (100%) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/910-mbsd_multi.patch (98%) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/920-specs_nonfatal_getenv.patch (90%) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/930-fix-mips-noexecstack.patch (100%) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/931-libffi-fix-MIPS-softfloat-build-issue.patch (100%) rename toolchain/gcc/patches/{11.1.0 => 11.2.0}/960-gotools-fix-compilation-when-making-cross-compiler.patch (100%) diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version index e8cc3215be..dd61d1e210 100644 --- a/toolchain/gcc/Config.version +++ b/toolchain/gcc/Config.version @@ -19,7 +19,7 @@ config GCC_VERSION default "7.5.0" if GCC_VERSION_7 default "9.3.0" if GCC_VERSION_9 default "10.3.0" if GCC_VERSION_10 - default "11.1.0" if GCC_VERSION_11 + default "11.2.0" if GCC_VERSION_11 default "8.4.0" config GCC_USE_IREMAP diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk index 36849de007..76c5fc114a 100644 --- a/toolchain/gcc/common.mk +++ b/toolchain/gcc/common.mk @@ -44,8 +44,8 @@ ifeq ($(PKG_VERSION),10.3.0) PKG_HASH:=64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344 endif -ifeq ($(PKG_VERSION),11.1.0) - PKG_HASH:=4c4a6fb8a8396059241c2e674b85b351c26a5d678274007f076957afa1cc9ddf +ifeq ($(PKG_VERSION),11.2.0) + PKG_HASH:=d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b endif PATCH_DIR=../patches/$(GCC_VERSION) diff --git a/toolchain/gcc/patches/11.1.0/002-case_insensitive.patch b/toolchain/gcc/patches/11.2.0/002-case_insensitive.patch similarity index 100% rename from toolchain/gcc/patches/11.1.0/002-case_insensitive.patch rename to toolchain/gcc/patches/11.2.0/002-case_insensitive.patch diff --git a/toolchain/gcc/patches/11.1.0/010-documentation.patch b/toolchain/gcc/patches/11.2.0/010-documentation.patch similarity index 100% rename from toolchain/gcc/patches/11.1.0/010-documentation.patch rename to toolchain/gcc/patches/11.2.0/010-documentation.patch diff --git a/toolchain/gcc/patches/11.1.0/110-Fix-MIPS-PR-84790.patch b/toolchain/gcc/patches/11.2.0/110-Fix-MIPS-PR-84790.patch similarity index 100% rename from toolchain/gcc/patches/11.1.0/110-Fix-MIPS-PR-84790.patch rename to toolchain/gcc/patches/11.2.0/110-Fix-MIPS-PR-84790.patch diff --git a/toolchain/gcc/patches/11.1.0/230-musl_libssp.patch b/toolchain/gcc/patches/11.2.0/230-musl_libssp.patch similarity index 100% rename from toolchain/gcc/patches/11.1.0/230-musl_libssp.patch rename to toolchain/gcc/patches/11.2.0/230-musl_libssp.patch diff --git a/toolchain/gcc/patches/11.1.0/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain/gcc/patches/11.2.0/300-mips_Os_cpu_rtx_cost_model.patch similarity index 100% rename from toolchain/gcc/patches/11.1.0/300-mips_Os_cpu_rtx_cost_model.patch rename to toolchain/gcc/patches/11.2.0/300-mips_Os_cpu_rtx_cost_model.patch diff --git a/toolchain/gcc/patches/11.1.0/810-arm-softfloat-libgcc.patch b/toolchain/gcc/patches/11.2.0/810-arm-softfloat-libgcc.patch similarity index 100% rename from toolchain/gcc/patches/11.1.0/810-arm-softfloat-libgcc.patch rename to toolchain/gcc/patches/11.2.0/810-arm-softfloat-libgcc.patch diff --git a/toolchain/gcc/patches/11.1.0/820-libgcc_pic.patch b/toolchain/gcc/patches/11.2.0/820-libgcc_pic.patch similarity index 100% rename from toolchain/gcc/patches/11.1.0/820-libgcc_pic.patch rename to toolchain/gcc/patches/11.2.0/820-libgcc_pic.patch diff --git a/toolchain/gcc/patches/11.1.0/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain/gcc/patches/11.2.0/840-armv4_pass_fix-v4bx_to_ld.patch similarity index 100% rename from toolchain/gcc/patches/11.1.0/840-armv4_pass_fix-v4bx_to_ld.patch rename to toolchain/gcc/patches/11.2.0/840-armv4_pass_fix-v4bx_to_ld.patch diff --git a/toolchain/gcc/patches/11.1.0/850-use_shared_libgcc.patch b/toolchain/gcc/patches/11.2.0/850-use_shared_libgcc.patch similarity index 100% rename from toolchain/gcc/patches/11.1.0/850-use_shared_libgcc.patch rename to toolchain/gcc/patches/11.2.0/850-use_shared_libgcc.patch diff --git a/toolchain/gcc/patches/11.1.0/851-libgcc_no_compat.patch b/toolchain/gcc/patches/11.2.0/851-libgcc_no_compat.patch similarity index 100% rename from toolchain/gcc/patches/11.1.0/851-libgcc_no_compat.patch rename to toolchain/gcc/patches/11.2.0/851-libgcc_no_compat.patch diff --git a/toolchain/gcc/patches/11.1.0/870-ppc_no_crtsavres.patch b/toolchain/gcc/patches/11.2.0/870-ppc_no_crtsavres.patch similarity index 100% rename from toolchain/gcc/patches/11.1.0/870-ppc_no_crtsavres.patch rename to toolchain/gcc/patches/11.2.0/870-ppc_no_crtsavres.patch diff --git a/toolchain/gcc/patches/11.1.0/881-no_tm_section.patch b/toolchain/gcc/patches/11.2.0/881-no_tm_section.patch similarity index 100% rename from toolchain/gcc/patches/11.1.0/881-no_tm_section.patch rename to toolchain/gcc/patches/11.2.0/881-no_tm_section.patch diff --git a/toolchain/gcc/patches/11.1.0/900-bad-mips16-crt.patch b/toolchain/gcc/patches/11.2.0/900-bad-mips16-crt.patch similarity index 100% rename from toolchain/gcc/patches/11.1.0/900-bad-mips16-crt.patch rename to toolchain/gcc/patches/11.2.0/900-bad-mips16-crt.patch diff --git a/toolchain/gcc/patches/11.1.0/910-mbsd_multi.patch b/toolchain/gcc/patches/11.2.0/910-mbsd_multi.patch similarity index 98% rename from toolchain/gcc/patches/11.1.0/910-mbsd_multi.patch rename to toolchain/gcc/patches/11.2.0/910-mbsd_multi.patch index b167436752..9f9d3226e8 100644 --- a/toolchain/gcc/patches/11.1.0/910-mbsd_multi.patch +++ b/toolchain/gcc/patches/11.2.0/910-mbsd_multi.patch @@ -114,7 +114,7 @@ Date: Tue Jul 31 00:52:27 2007 +0000 ; On SVR4 targets, it also controls whether or not to emit a --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -9054,6 +9054,17 @@ This option is only supported for C and +@@ -9055,6 +9055,17 @@ This option is only supported for C and @option{-Wall} and by @option{-Wpedantic}, which can be disabled with @option{-Wno-pointer-sign}. diff --git a/toolchain/gcc/patches/11.1.0/920-specs_nonfatal_getenv.patch b/toolchain/gcc/patches/11.2.0/920-specs_nonfatal_getenv.patch similarity index 90% rename from toolchain/gcc/patches/11.1.0/920-specs_nonfatal_getenv.patch rename to toolchain/gcc/patches/11.2.0/920-specs_nonfatal_getenv.patch index edbef09c6c..dda33c0202 100644 --- a/toolchain/gcc/patches/11.1.0/920-specs_nonfatal_getenv.patch +++ b/toolchain/gcc/patches/11.2.0/920-specs_nonfatal_getenv.patch @@ -7,7 +7,7 @@ Date: Sat Apr 21 03:02:39 2012 +0000 --- a/gcc/gcc.c +++ b/gcc/gcc.c -@@ -10090,8 +10090,10 @@ getenv_spec_function (int argc, const ch +@@ -10100,8 +10100,10 @@ getenv_spec_function (int argc, const ch } if (!value) diff --git a/toolchain/gcc/patches/11.1.0/930-fix-mips-noexecstack.patch b/toolchain/gcc/patches/11.2.0/930-fix-mips-noexecstack.patch similarity index 100% rename from toolchain/gcc/patches/11.1.0/930-fix-mips-noexecstack.patch rename to toolchain/gcc/patches/11.2.0/930-fix-mips-noexecstack.patch diff --git a/toolchain/gcc/patches/11.1.0/931-libffi-fix-MIPS-softfloat-build-issue.patch b/toolchain/gcc/patches/11.2.0/931-libffi-fix-MIPS-softfloat-build-issue.patch similarity index 100% rename from toolchain/gcc/patches/11.1.0/931-libffi-fix-MIPS-softfloat-build-issue.patch rename to toolchain/gcc/patches/11.2.0/931-libffi-fix-MIPS-softfloat-build-issue.patch diff --git a/toolchain/gcc/patches/11.1.0/960-gotools-fix-compilation-when-making-cross-compiler.patch b/toolchain/gcc/patches/11.2.0/960-gotools-fix-compilation-when-making-cross-compiler.patch similarity index 100% rename from toolchain/gcc/patches/11.1.0/960-gotools-fix-compilation-when-making-cross-compiler.patch rename to toolchain/gcc/patches/11.2.0/960-gotools-fix-compilation-when-making-cross-compiler.patch From 9df7eadcfd3129cecfb30ec78a43ae9b3175869e Mon Sep 17 00:00:00 2001 From: Jianhui Zhao Date: Mon, 2 Aug 2021 07:08:46 +0000 Subject: [PATCH 24/53] iw: enable print wpa ie for scan This increases the size of the iw_5.9-8fab0c9e-3_mips_24kc.ipk from 41166 to 41942 bytes by 776 bytes. Signed-off-by: Jianhui Zhao --- .../utils/iw/patches/200-reduce_size.patch | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/package/network/utils/iw/patches/200-reduce_size.patch b/package/network/utils/iw/patches/200-reduce_size.patch index 83e11405cb..c50a4a4d38 100644 --- a/package/network/utils/iw/patches/200-reduce_size.patch +++ b/package/network/utils/iw/patches/200-reduce_size.patch @@ -187,23 +187,29 @@ }; static void print_wifi_wpa(const uint8_t type, uint8_t len, const uint8_t *data, -@@ -2326,6 +2331,7 @@ void print_ies(unsigned char *ie, int ie - ieprinters[ie[0]].flags & BIT(ptype)) { - print_ie(&ieprinters[ie[0]], - ie[0], ie[1], ie + 2, &ie_buffer); +@@ -2080,8 +2085,10 @@ static void print_wifi_wps(const uint8_t + + static const struct ie_print wifiprinters[] = { + [1] = { "WPA", print_wifi_wpa, 2, 255, BIT(PRINT_SCAN), }, +#ifdef IW_FULL - } else if (ie[0] == 221 /* vendor */) { - print_vendor(ie[1], ie + 2, unknown, ptype); - } else if (ie[0] == 255 /* extension */) { -@@ -2337,6 +2343,7 @@ void print_ies(unsigned char *ie, int ie - for (i=0; i= 4 && memcmp(data, wfa_oui, 3) == 0) { + if (data[3] < ARRAY_SIZE(wfa_printers) && + wfa_printers[data[3]].name && +@@ -2377,6 +2388,7 @@ static void print_capa_non_dmg(__u16 cap printf(" ESS"); if (capa & WLAN_CAPABILITY_IBSS) printf(" IBSS"); @@ -211,7 +217,7 @@ if (capa & WLAN_CAPABILITY_CF_POLLABLE) printf(" CfPollable"); if (capa & WLAN_CAPABILITY_CF_POLL_REQUEST) -@@ -2405,6 +2413,7 @@ static void print_capa_non_dmg(__u16 cap +@@ -2405,6 +2417,7 @@ static void print_capa_non_dmg(__u16 cap printf(" DelayedBACK"); if (capa & WLAN_CAPABILITY_IMM_BACK) printf(" ImmediateBACK"); @@ -219,7 +225,7 @@ } static int print_bss_handler(struct nl_msg *msg, void *arg) -@@ -2489,8 +2498,10 @@ static int print_bss_handler(struct nl_m +@@ -2489,8 +2502,10 @@ static int print_bss_handler(struct nl_m if (bss[NL80211_BSS_FREQUENCY]) { int freq = nla_get_u32(bss[NL80211_BSS_FREQUENCY]); printf("\tfreq: %d\n", freq); @@ -230,7 +236,7 @@ } if (bss[NL80211_BSS_BEACON_INTERVAL]) printf("\tbeacon interval: %d TUs\n", -@@ -2684,6 +2695,7 @@ static int handle_stop_sched_scan(struct +@@ -2684,6 +2699,7 @@ static int handle_stop_sched_scan(struct return 0; } @@ -238,7 +244,7 @@ COMMAND(scan, sched_start, SCHED_SCAN_OPTIONS, NL80211_CMD_START_SCHED_SCAN, 0, CIB_NETDEV, handle_start_sched_scan, -@@ -2694,3 +2706,4 @@ COMMAND(scan, sched_start, +@@ -2694,3 +2710,4 @@ COMMAND(scan, sched_start, COMMAND(scan, sched_stop, "", NL80211_CMD_STOP_SCHED_SCAN, 0, CIB_NETDEV, handle_stop_sched_scan, "Stop an ongoing scheduled scan."); From 97d88b1fbd62ad8a24b076d317c7408ee7012757 Mon Sep 17 00:00:00 2001 From: Ansuel Smith Date: Tue, 27 Jul 2021 20:13:40 +0200 Subject: [PATCH 25/53] iproute2: bump to 5.13 Drop patch 185-libbpf-add-limits-h merged upstream Update patch 170-ip_tiny Update patch 130-no_netem_tpic_dcb... Signed-off-by: Ansuel Smith --- package/network/utils/iproute2/Makefile | 6 +-- ...h => 130-no_netem_tipc_dcb_man_vdpa.patch} | 2 +- .../utils/iproute2/patches/170-ip_tiny.patch | 17 +++---- .../patches/185-libbpf-add-limits-h.patch | 45 ------------------- 4 files changed, 13 insertions(+), 57 deletions(-) rename package/network/utils/iproute2/patches/{130-no_netem_tipc_dcb_man.patch => 130-no_netem_tipc_dcb_man_vdpa.patch} (97%) delete mode 100644 package/network/utils/iproute2/patches/185-libbpf-add-limits-h.patch diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 54165636c7..1cd4833aba 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 -PKG_VERSION:=5.11.0 -PKG_RELEASE:=4 +PKG_VERSION:=5.13.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 -PKG_HASH:=c5e2ea108212b3445051b35953ec267f9f3469e1d5c67ac034ab559849505c54 +PKG_HASH:=72a2e53774cac9e65f7b617deebb2059f87e8960d6e9713e4d788cea966f1b36 PKG_BUILD_PARALLEL:=1 PKG_BUILD_DEPENDS:=iptables PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man.patch b/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch similarity index 97% rename from package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man.patch rename to package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch index e3faee0d8f..8ddb316744 100644 --- a/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man.patch +++ b/package/network/utils/iproute2/patches/130-no_netem_tipc_dcb_man_vdpa.patch @@ -4,7 +4,7 @@ CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS) YACCFLAGS = -d -t -v --SUBDIRS=lib ip tc bridge misc netem genl tipc devlink rdma dcb man +-SUBDIRS=lib ip tc bridge misc netem genl tipc devlink rdma dcb man vdpa +SUBDIRS=lib ip tc bridge misc genl devlink rdma LIBNETLINK=../lib/libutil.a ../lib/libnetlink.a diff --git a/package/network/utils/iproute2/patches/170-ip_tiny.patch b/package/network/utils/iproute2/patches/170-ip_tiny.patch index d5e5b36936..a0dde748c7 100644 --- a/package/network/utils/iproute2/patches/170-ip_tiny.patch +++ b/package/network/utils/iproute2/patches/170-ip_tiny.patch @@ -25,19 +25,20 @@ sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \ --- a/ip/ip.c +++ b/ip/ip.c -@@ -64,10 +64,16 @@ static void usage(void) +@@ -64,11 +64,17 @@ static void usage(void) fprintf(stderr, "Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n" " ip [ -force ] -batch filename\n" +#ifndef IPROUTE2_TINY - "where OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |\n" - " tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |\n" - " netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila |\n" - " vrf | sr | nexthop | mptcp }\n" + "where OBJECT := { address | addrlabel | fou | help | ila | l2tp | link |\n" + " macsec | maddress | monitor | mptcp | mroute | mrule |\n" + " neighbor | neighbour | netconf | netns | nexthop | ntable |\n" + " ntbl | route | rule | sr | tap | tcpmetrics |\n" + " token | tunnel | tuntap | vrf | xfrm }\n" +#else -+ "where OBJECT := { link | address | route | rule | neigh | tunnel | maddress |\n" -+ " mroute | mrule | monitor | netns | macsec | token | ila |\n" -+ " vrf | sr }\n" ++ "where OBJECT := { address | ila | link | macsec | maddress | monitor |\n" ++ " mroute | mrule | neighbor | neighbour | netns | route |\n" ++ " rule | sr | token | tunnel | vrf }\n" +#endif " OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n" " -h[uman-readable] | -iec | -j[son] | -p[retty] |\n" diff --git a/package/network/utils/iproute2/patches/185-libbpf-add-limits-h.patch b/package/network/utils/iproute2/patches/185-libbpf-add-limits-h.patch deleted file mode 100644 index 07dbbc65b9..0000000000 --- a/package/network/utils/iproute2/patches/185-libbpf-add-limits-h.patch +++ /dev/null @@ -1,45 +0,0 @@ -From c77310119f9a5f99221dd967c5eb0c7a26094b41 Mon Sep 17 00:00:00 2001 -From: Tony Ambardar -Date: Wed, 3 Mar 2021 10:29:24 -0800 -Subject: [PATCH] lib/bpf: add missing limits.h includes - -Several functions in bpf_glue.c and bpf_libbpf.c rely on PATH_MAX, which is -normally included from in other iproute2 source files. - -It fixes errors seen using gcc 10.2.0, binutils 2.35.1 and musl 1.1.24: - -bpf_glue.c: In function 'get_libbpf_version': -bpf_glue.c:46:11: error: 'PATH_MAX' undeclared (first use in this function); -did you mean 'AF_MAX'? - 46 | char buf[PATH_MAX], *s; - | ^~~~~~~~ - | AF_MAX - -Reported-by: Rui Salvaterra -Signed-off-by: Tony Ambardar ---- - lib/bpf_glue.c | 2 ++ - lib/bpf_libbpf.c | 1 + - 2 files changed, 3 insertions(+) - ---- a/lib/bpf_glue.c -+++ b/lib/bpf_glue.c -@@ -4,6 +4,8 @@ - * Authors: Hangbin Liu - * - */ -+#include -+ - #include "bpf_util.h" - #ifdef HAVE_LIBBPF - #include ---- a/lib/bpf_libbpf.c -+++ b/lib/bpf_libbpf.c -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - - #include - #include From 12564c5b860f9849c9a2fb7026c2c11150b9a4fc Mon Sep 17 00:00:00 2001 From: Daniel Kestrel Date: Sun, 25 Jul 2021 20:32:05 +0200 Subject: [PATCH 26/53] fritz-tools: fix returning wrong values due to strncmp usage When having two keys that start with the same characters and the second key just has one character more nand_tffs_read and tffs_read return the wrong value for the longer key. This is due to the usage of strncmp in combination with the length of the shorter key which is usually first in the list before the longer key and when strncmp matches, the search is stopped. The problem only occurs when the length of the two keys is different, not if just the last character is different. The fix is to use strcmp and as such it will only return the value if the key (name) and the key to look for (namefilter) have the same value and length. A sample case returning wrong values is when keys macwlan and macwlan2 are defined and querying macwlan2 returns the value for macwlan. Signed-off-by: Daniel Kestrel --- package/utils/fritz-tools/src/fritz_tffs_nand_read.c | 2 +- package/utils/fritz-tools/src/fritz_tffs_read.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/utils/fritz-tools/src/fritz_tffs_nand_read.c b/package/utils/fritz-tools/src/fritz_tffs_nand_read.c index ded0577cf3..22b27336f8 100644 --- a/package/utils/fritz-tools/src/fritz_tffs_nand_read.c +++ b/package/utils/fritz-tools/src/fritz_tffs_nand_read.c @@ -340,7 +340,7 @@ static int show_matching_key_value(struct tffs_key_name_table *key_names) for (uint32_t i = 0; i < key_names->size; i++) { name = key_names->entries[i].val; - if (strncmp(name, name_filter, strlen(name)) == 0) { + if (strcmp(name, name_filter) == 0) { if (find_entry(key_names->entries[i].id, &tmp)) { print_entry_value(&tmp); printf("\n"); diff --git a/package/utils/fritz-tools/src/fritz_tffs_read.c b/package/utils/fritz-tools/src/fritz_tffs_read.c index d1b3038e63..256c34c414 100644 --- a/package/utils/fritz-tools/src/fritz_tffs_read.c +++ b/package/utils/fritz-tools/src/fritz_tffs_read.c @@ -204,7 +204,7 @@ static int show_matching_key_value(uint8_t *buffer, for (i = 0; i < key_names->size; i++) { name = key_names->entries[i].val; - if (strncmp(name, name_filter, strlen(name)) == 0) { + if (strcmp(name, name_filter) == 0) { id = to_entry_header_id(*key_names->entries[i].id); if (find_entry(buffer, id, &tmp)) { From 891c8676a1602d31adf3ab9f913664ae0d3b4029 Mon Sep 17 00:00:00 2001 From: Stephan Schmidtmer Date: Sun, 25 Jul 2021 11:50:53 +0000 Subject: [PATCH 27/53] libpcap: add rpcapd as package This enables building of rpcapd and adds it as a package. It is a daemon that allows remote packet capturing from another machine. E.g. Wireshark can talk to it using the Remote Capture Protocol (RPCAP). https://www.tcpdump.org/manpages/rpcapd.8.html Compile and run tested: OpenWrt SNAPSHOT r17190-2801fe6132 on x86/64 Signed-off-by: Stephan Schmidtmer --- package/libs/libpcap/Makefile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile index 8c08259055..518744435b 100644 --- a/package/libs/libpcap/Makefile +++ b/package/libs/libpcap/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libpcap PKG_VERSION:=1.10.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \ @@ -43,6 +43,19 @@ define Package/libpcap/config source "$(SOURCE)/Config.in" endef +define Package/rpcapd + SECTION:=net + CATEGORY:=Network + TITLE:=Capture daemon to be controlled by a remote libpcap application + URL:=http://www.tcpdump.org/ + DEPENDS+= +libpcap +endef + +ifdef CONFIG_PACKAGE_rpcapd + CMAKE_OPTIONS += \ + -DENABLE_REMOTE=ON +endif + CMAKE_OPTIONS += \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_WITH_LIBNL=OFF \ @@ -81,4 +94,10 @@ define Package/libpcap/install $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/ endef +define Package/rpcapd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rpcapd $(1)/usr/sbin/ +endef + $(eval $(call BuildPackage,libpcap)) +$(eval $(call BuildPackage,rpcapd)) From af83e3ce0ff40dcecbe913676343bf86846294f7 Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Manzano Date: Tue, 20 Jul 2021 12:13:49 +0200 Subject: [PATCH 28/53] hostapd: respect fixed channel BW in HE20 mode When using htmode 'HE20' with a radio mode that uses wpa-supplicant (like mesh or sta), it will default to 40 MHz bw if disable_ht40 is not set. This commit fixes this behaviour. Signed-off-by: Jesus Fernandez Manzano --- package/network/services/hostapd/files/hostapd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index d65565d801..821905b05e 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -1166,7 +1166,7 @@ wpa_supplicant_set_fixed_freq() { append network_data "frequency=$freq" "$N$T" case "$htmode" in NOHT) append network_data "disable_ht=1" "$N$T";; - HT20|VHT20) append network_data "disable_ht40=1" "$N$T";; + HE20|HT20|VHT20) append network_data "disable_ht40=1" "$N$T";; HT40*|VHT40*|VHT80*|VHT160*) append network_data "ht40=1" "$N$T";; esac case "$htmode" in From 292af15dca0175c367f7bb24ce8c641cb0261642 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 13 Jul 2021 13:49:14 -0700 Subject: [PATCH 29/53] util-linux: update to 2.37 Switched to AUTORELEASE to avoid manual increments. Changed PKG_LICENSE to SPDX format. Signed-off-by: Rosen Penev --- package/utils/util-linux/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package/utils/util-linux/Makefile b/package/utils/util-linux/Makefile index b385030e39..74f3f17469 100644 --- a/package/utils/util-linux/Makefile +++ b/package/utils/util-linux/Makefile @@ -8,15 +8,15 @@ include $(TOPDIR)/rules.mk PKG_NAME:=util-linux -PKG_VERSION:=2.36.1 -PKG_RELEASE:=2 +PKG_VERSION:=2.37 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.36 -PKG_HASH:=09fac242172cd8ec27f0739d8d192402c69417617091d8c6e974841568f37eed +PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.37 +PKG_HASH:=bd07b7e98839e0359842110525a3032fdb8eaf3a90bedde3dd1652d32d15cce5 PKG_CPE_ID:=cpe:/a:kernel:util-linux -PKG_LICENSE:=GPL-2.0 +PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:= COPYING \ libblkid/COPYING \ libmount/COPYING \ From 30fb675847251d3ca745201acf21dc0dca446f13 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 11 Jul 2021 18:00:55 -0700 Subject: [PATCH 30/53] gettext-full: disable parallel compilation Fails fairly reliably with make -j 12 on a Ryzen 3600. Signed-off-by: Rosen Penev --- package/libs/gettext-full/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/gettext-full/Makefile b/package/libs/gettext-full/Makefile index 8111a36f5f..6a97fd5b91 100644 --- a/package/libs/gettext-full/Makefile +++ b/package/libs/gettext-full/Makefile @@ -24,8 +24,8 @@ PKG_CPE_ID:=cpe:/a:gnu:gettext PKG_FIXUP:=autoreconf PKG_INSTALL:=1 PKG_BUILD_DEPENDS:=gettext-full/host -PKG_BUILD_PARALLEL:=1 -HOST_BUILD_PARALLEL:=1 +PKG_BUILD_PARALLEL:=0 +HOST_BUILD_PARALLEL:=0 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk From 1795bd2f1b3b30620805033d3fa5e22ae68fd6d6 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 3 Jan 2021 15:18:33 -0800 Subject: [PATCH 31/53] elfutils: update to 0.182 Add --disable-libdebuginfod with remove libcurl dependency. Remove totally unused host elfutils. Refreshed and rebased patches. Also happens to fix compilation with GCC11. Newer versions of elfutils seem to have some kind of dependency on obstack. Signed-off-by: Rosen Penev --- package/libs/elfutils/Makefile | 10 +++++--- ...cliude-asm-ptrace.h-for-pt_regs-defi.patch | 5 ---- .../patches/003-libintl-compatibility.patch | 4 +-- .../patches/005-build_only_libs.patch | 6 ++--- .../006-Fix-build-on-aarch64-musl.patch | 6 +---- .../libs/elfutils/patches/110-no-cdefs.patch | 25 ------------------- .../patches/111-fix-gcc11-build.patch | 22 ---------------- 7 files changed, 12 insertions(+), 66 deletions(-) delete mode 100644 package/libs/elfutils/patches/111-fix-gcc11-build.patch diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile index 3e36dc27b8..d595e4caf2 100644 --- a/package/libs/elfutils/Makefile +++ b/package/libs/elfutils/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=elfutils -PKG_VERSION:=0.180 -PKG_RELEASE:=2 +PKG_VERSION:=0.182 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION) -PKG_HASH:=b827b6e35c59d188ba97d7cf148fa8dc6f5c68eb6c5981888dfdbb758c0b569d +PKG_HASH:=ecc406914edf335f0b7fc084ebe6c460c4d6d5175bfdd6688c1c78d9146b8858 PKG_MAINTAINER:=Luiz Angelo Daros de Luca PKG_LICENSE:=GPL-3.0-or-later @@ -63,7 +63,9 @@ endif CONFIGURE_ARGS += \ --program-prefix=eu- \ --disable-debuginfod \ - --without-lzma + --disable-libdebuginfod \ + --without-lzma \ + --without-zstd TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result -Wno-format-nonliteral diff --git a/package/libs/elfutils/patches/0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch b/package/libs/elfutils/patches/0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch index 904da2b44e..839f86ee6a 100644 --- a/package/libs/elfutils/patches/0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch +++ b/package/libs/elfutils/patches/0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch @@ -17,8 +17,6 @@ Signed-off-by: Khem Raj backends/ppc_initreg.c | 1 + 1 file changed, 1 insertion(+) -diff --git a/backends/ppc_initreg.c b/backends/ppc_initreg.c -index 0e0d359..e5cca7e 100644 --- a/backends/ppc_initreg.c +++ b/backends/ppc_initreg.c @@ -33,6 +33,7 @@ @@ -29,6 +27,3 @@ index 0e0d359..e5cca7e 100644 # include #endif --- -2.23.0 - diff --git a/package/libs/elfutils/patches/003-libintl-compatibility.patch b/package/libs/elfutils/patches/003-libintl-compatibility.patch index e883a302e6..26fcc85c8b 100644 --- a/package/libs/elfutils/patches/003-libintl-compatibility.patch +++ b/package/libs/elfutils/patches/003-libintl-compatibility.patch @@ -11,7 +11,7 @@ Requires.private: zlib --- a/configure.ac +++ b/configure.ac -@@ -586,6 +586,9 @@ AC_CONFIG_FILES([config/libelf.pc config +@@ -590,6 +590,9 @@ AC_CONFIG_FILES([config/libelf.pc config AC_SUBST(USE_NLS, yes) AM_PO_SUBDIRS @@ -47,7 +47,7 @@ #define _(Str) dgettext ("elfutils", Str) --- a/libdwfl/libdwflP.h +++ b/libdwfl/libdwflP.h -@@ -44,6 +44,9 @@ +@@ -47,6 +47,9 @@ typedef struct Dwfl_Process Dwfl_Process; diff --git a/package/libs/elfutils/patches/005-build_only_libs.patch b/package/libs/elfutils/patches/005-build_only_libs.patch index a81d1d2cab..501348f21c 100644 --- a/package/libs/elfutils/patches/005-build_only_libs.patch +++ b/package/libs/elfutils/patches/005-build_only_libs.patch @@ -4,8 +4,8 @@ pkginclude_HEADERS = version.h SUBDIRS = config m4 lib libelf libcpu backends libebl libdwelf libdwfl libdw \ -- libasm src po doc tests +- libasm debuginfod src po doc tests + libasm - if DEBUGINFOD - SUBDIRS += debuginfod + EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \ + COPYING COPYING-GPLV2 COPYING-LGPLV3 diff --git a/package/libs/elfutils/patches/006-Fix-build-on-aarch64-musl.patch b/package/libs/elfutils/patches/006-Fix-build-on-aarch64-musl.patch index 6f7956c5ae..d8066c5ca7 100644 --- a/package/libs/elfutils/patches/006-Fix-build-on-aarch64-musl.patch +++ b/package/libs/elfutils/patches/006-Fix-build-on-aarch64-musl.patch @@ -22,8 +22,6 @@ Signed-off-by: Hongxu Jia backends/arm_initreg.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -diff --git a/backends/aarch64_initreg.c b/backends/aarch64_initreg.c -index daf6f37..6445276 100644 --- a/backends/aarch64_initreg.c +++ b/backends/aarch64_initreg.c @@ -33,7 +33,7 @@ @@ -35,7 +33,7 @@ index daf6f37..6445276 100644 # include # include /* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */ -@@ -82,7 +82,7 @@ aarch64_set_initial_registers_tid (pid_t tid __attribute__ ((unused)), +@@ -82,7 +82,7 @@ aarch64_set_initial_registers_tid (pid_t Dwarf_Word dwarf_fregs[32]; for (int r = 0; r < 32; r++) @@ -44,8 +42,6 @@ index daf6f37..6445276 100644 if (! setfunc (64, 32, dwarf_fregs, arg)) return false; -diff --git a/backends/arm_initreg.c b/backends/arm_initreg.c -index efcabaf..062bb9e 100644 --- a/backends/arm_initreg.c +++ b/backends/arm_initreg.c @@ -38,7 +38,7 @@ diff --git a/package/libs/elfutils/patches/110-no-cdefs.patch b/package/libs/elfutils/patches/110-no-cdefs.patch index f95625a913..d66f1e924f 100644 --- a/package/libs/elfutils/patches/110-no-cdefs.patch +++ b/package/libs/elfutils/patches/110-no-cdefs.patch @@ -24,28 +24,3 @@ Signed-off-by: Rosen Penev #include ---- a/libelf/elf.h -+++ b/libelf/elf.h -@@ -19,9 +19,9 @@ - #ifndef _ELF_H - #define _ELF_H 1 - --#include -- --__BEGIN_DECLS -+#ifdef __cplusplus -+extern "C" { -+#endif - - /* Standard ELF types. */ - -@@ -4103,6 +4103,8 @@ enum - #define R_ARC_TLS_LE_S9 0x4a - #define R_ARC_TLS_LE_32 0x4b - --__END_DECLS -+#ifdef __cplusplus -+} -+#endif - - #endif /* elf.h */ diff --git a/package/libs/elfutils/patches/111-fix-gcc11-build.patch b/package/libs/elfutils/patches/111-fix-gcc11-build.patch deleted file mode 100644 index 1ec880e34e..0000000000 --- a/package/libs/elfutils/patches/111-fix-gcc11-build.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/libebl/libebl.h -+++ b/libebl/libebl.h -@@ -245,7 +245,7 @@ extern ssize_t ebl_register_info (Ebl *e - Each of these is filled with the DWARF register number corresponding, - or -1 if there is none. Returns zero when the information is available. */ - extern int ebl_syscall_abi (Ebl *ebl, int *sp, int *pc, -- int *callno, int args[6]); -+ int *callno, int args[]); - - /* Supply the ABI-specified state of DWARF CFI before CIE initial programs. - ---- a/libdw/libdw.h -+++ b/libdw/libdw.h -@@ -1065,7 +1065,7 @@ extern int dwarf_frame_cfa (Dwarf_Frame - expressions in the CFI, *OPS is an internal pointer that can be used as - long as the Dwarf_CFI used to create FRAME remains alive. */ - extern int dwarf_frame_register (Dwarf_Frame *frame, int regno, -- Dwarf_Op ops_mem[3], -+ Dwarf_Op ops_mem[], - Dwarf_Op **ops, size_t *nops) - __nonnull_attribute__ (3, 4, 5); - From 094fb3f6f98d5e9e6cbd2e8141fab35ee19e9824 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 13 Jul 2021 13:16:50 -0700 Subject: [PATCH 32/53] libcap: update to 2.51 Switched to AUTORELEASE to avoid manual increments. Signed-off-by: Rosen Penev --- package/libs/libcap/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/libcap/Makefile b/package/libs/libcap/Makefile index b8e45a52c7..53a577f1f9 100644 --- a/package/libs/libcap/Makefile +++ b/package/libs/libcap/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libcap -PKG_VERSION:=2.48 -PKG_RELEASE:=1 +PKG_VERSION:=2.51 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/libs/security/linux-privs/libcap2 -PKG_HASH:=4de9590ee09a87c282d558737ffb5b6175ccbfd26d580add10df44d0f047f6c2 +PKG_HASH:=6609f3ab7aebcc8f9277f53a577c657d9f3056d1352ea623da7fd7c0f00890f9 PKG_MAINTAINER:=Paul Wassi PKG_LICENSE:=GPL-2.0-only From 7aff590ace5cda6246bd8d5c611cb91ae81e587c Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 13 Jul 2021 13:19:08 -0700 Subject: [PATCH 33/53] libnftnl: update to 1.2.0 Switch to AUTORELEASE to avoid manual increments. Signed-off-by: Rosen Penev --- package/libs/libnftnl/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/libnftnl/Makefile b/package/libs/libnftnl/Makefile index 198e01ba22..4c7f6ad465 100644 --- a/package/libs/libnftnl/Makefile +++ b/package/libs/libnftnl/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnftnl -PKG_VERSION:=1.1.8 -PKG_RELEASE:=1 +PKG_VERSION:=1.2.0 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files -PKG_HASH:=04a3fa5b08b736268f7e65836b9f05d9d5f438181467bee3c76c3c4a4f3ab711 +PKG_HASH:=90b01fddfe9be8c3245c3ba5ff5a4424a8df708828f92b2b361976b658c074f5 PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=GPL-2.0-or-later From 065d4300c09051dd90e53001d6c6fa490216187f Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 13 Jul 2021 13:24:54 -0700 Subject: [PATCH 34/53] libpcap: update to 1.10.1 Switch to AUTORELEASE to avoid manual increments. Refreshed patches. Signed-off-by: Rosen Penev --- package/libs/libpcap/Makefile | 6 +++--- package/libs/libpcap/patches/100-no-openssl.patch | 2 +- package/libs/libpcap/patches/102-skip-manpages.patch | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile index 518744435b..d07c83ac6f 100644 --- a/package/libs/libpcap/Makefile +++ b/package/libs/libpcap/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libpcap -PKG_VERSION:=1.10.0 -PKG_RELEASE:=2 +PKG_VERSION:=1.10.1 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \ http://www.tcpdump.org/release/ -PKG_HASH:=8d12b42623eeefee872f123bd0dc85d535b00df4d42e865f993c40f7bfc92b1e +PKG_HASH:=ed285f4accaf05344f90975757b3dbfe772ba41d1c401c2648b7fa45b711bdd4 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause diff --git a/package/libs/libpcap/patches/100-no-openssl.patch b/package/libs/libpcap/patches/100-no-openssl.patch index 6424cf8c6f..56896ad8ba 100644 --- a/package/libs/libpcap/patches/100-no-openssl.patch +++ b/package/libs/libpcap/patches/100-no-openssl.patch @@ -1,6 +1,6 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1006,7 +1006,6 @@ endif() +@@ -1042,7 +1042,6 @@ endif() # # OpenSSL/libressl. # diff --git a/package/libs/libpcap/patches/102-skip-manpages.patch b/package/libs/libpcap/patches/102-skip-manpages.patch index 57b780c1fe..79a365643e 100644 --- a/package/libs/libpcap/patches/102-skip-manpages.patch +++ b/package/libs/libpcap/patches/102-skip-manpages.patch @@ -9,7 +9,7 @@ Subject: [PATCH] skip manpages --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -2701,57 +2701,6 @@ if(NOT MSVC) +@@ -2732,57 +2732,6 @@ if(NOT MSVC) if(MINGW) find_program(LINK_EXECUTABLE ln) endif(MINGW) From fcfd741eb83520e496eb09de5f8b2f2b62792a80 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 13 Jul 2021 13:27:09 -0700 Subject: [PATCH 35/53] mbedtls: update to 2.16.11 Switched to AUTORELEASE to avoid manual increments. Release notes: https://github.com/ARMmbed/mbedtls/releases/tag/v2.16.11 Signed-off-by: Rosen Penev --- package/libs/mbedtls/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index 2bac22b6ac..6adf091c3c 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mbedtls -PKG_VERSION:=2.16.10 -PKG_RELEASE:=1 +PKG_VERSION:=2.16.11 +PKG_RELEASE:=$(AUTORELEASE) PKG_USE_MIPS16:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/ARMmbed/mbedtls/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=96257bb03b30300b2f35f861ffe204ed957e9fd0329d80646fe57fc49f589b29 +PKG_HASH:=c18e7e9abf95e69e425260493720470021384a1728417042060a35d0b7b18b41 PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=gpl-2.0.txt From 381f0e3e8d15e83ed1686b7f36f1944f07a0369c Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 13 Jul 2021 13:30:24 -0700 Subject: [PATCH 36/53] nettle: update to 3.7.3 Switch to AUTORELEASE to avoid manual increments. Refreshed patches. Signed-off-by: Rosen Penev --- package/libs/nettle/Makefile | 6 +++--- package/libs/nettle/patches/100-portability.patch | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package/libs/nettle/Makefile b/package/libs/nettle/Makefile index b15ea0fa07..3b4bd9d053 100644 --- a/package/libs/nettle/Makefile +++ b/package/libs/nettle/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nettle -PKG_VERSION:=3.6 -PKG_RELEASE:=1 +PKG_VERSION:=3.7.3 +PKG_RELEASE:=$(AUTORELEASE) PKG_USE_MIPS16:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@GNU/nettle -PKG_HASH:=d24c0d0f2abffbc8f4f34dcf114b0f131ec3774895f3555922fe2f40f3d5e3f1 +PKG_HASH:=661f5eb03f048a3b924c3a8ad2515d4068e40f67e774e8a26827658007e3bcf0 PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=COPYING diff --git a/package/libs/nettle/patches/100-portability.patch b/package/libs/nettle/patches/100-portability.patch index 2849e53eab..5bbae22752 100644 --- a/package/libs/nettle/patches/100-portability.patch +++ b/package/libs/nettle/patches/100-portability.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -4635,6 +4635,7 @@ $as_echo_n "checking build system compil +@@ -4661,6 +4661,7 @@ $as_echo_n "checking build system compil # remove anything that might look like compiler output to our "||" expression rm -f conftest* a.out b.out a.exe a_out.exe cat >conftest.c <conftest.c <conftest.c <conftest.c < Date: Tue, 13 Jul 2021 13:32:30 -0700 Subject: [PATCH 37/53] pcre: update to 8.45 Switch to AUTORELEASE to avoid manual increments. Signed-off-by: Rosen Penev --- package/libs/pcre/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/pcre/Makefile b/package/libs/pcre/Makefile index 8644746b4b..db157ec1b4 100644 --- a/package/libs/pcre/Makefile +++ b/package/libs/pcre/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pcre -PKG_VERSION:=8.44 -PKG_RELEASE:=4 +PKG_VERSION:=8.45 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/$(PKG_NAME) -PKG_HASH:=19108658b23b3ec5058edc9f66ac545ea19f9537234be1ec62b714c84399366d +PKG_HASH:=4dae6fdcd2bb0bb6c37b5f97c33c2be954da743985369cddac3546e3218bffb8 PKG_MAINTAINER:=Thomas Heil PKG_LICENSE:=BSD-3-Clause From 0dcb03dc63ebe6477a3bf19347b340564ade82e0 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Tue, 27 Jul 2021 13:20:42 +0200 Subject: [PATCH 38/53] Revert "mvebu: 5.10 fix DVFS caused random boot crashes" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on the discussion on the mailing list [1], the patch which was reverted, it reverts only one patch without the subsequent ones. This leads to the SoC scaling issue not using a CPU parent clock, but it uses DDR clock. This is done for all variants, and it's wrong because commits (hacks) that were using the DDR clock are no longer in the mainline kernel. If someone has stability issues on 1.2 GHz, it should not affect all routers (1 GHz, 800 MHz) and it should be rather consulted with guys, who are trying to improve the situation in the kernel and not making the situation worse. There are two solutions in cases of instability: a) disable cpufreq b) underclock it up to 1 GHz This reverts commit 080a0b74e39d159eecf69c468debec42f28bf4d8. [1] https://lists.openwrt.org/pipermail/openwrt-devel/2021-June/035702.html Fixes: d37947681772 ("mvebu: armada-37xx: add patch to forbid cpufreq for 1.2 GHz") CC: Pali Rohár Signed-off-by: Josef Schlehofer --- ...rmada-37xx-Fix-setting-TBG-parent-fo.patch | 107 ------------------ 1 file changed, 107 deletions(-) delete mode 100644 target/linux/mvebu/patches-5.10/803-Revert-cpufreq-armada-37xx-Fix-setting-TBG-parent-fo.patch diff --git a/target/linux/mvebu/patches-5.10/803-Revert-cpufreq-armada-37xx-Fix-setting-TBG-parent-fo.patch b/target/linux/mvebu/patches-5.10/803-Revert-cpufreq-armada-37xx-Fix-setting-TBG-parent-fo.patch deleted file mode 100644 index 65184df584..0000000000 --- a/target/linux/mvebu/patches-5.10/803-Revert-cpufreq-armada-37xx-Fix-setting-TBG-parent-fo.patch +++ /dev/null @@ -1,107 +0,0 @@ -From 35639bac13927d1476398b740b11cbed0ee3ddb2 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Tue, 18 May 2021 13:24:30 +0200 -Subject: [PATCH] Revert "cpufreq: armada-37xx: Fix setting TBG parent for load - levels" - -This reverts commit a13b110e7c9e0dc2edcc7a19d4255fc88abd83cc. - -This patch actually corrects the things so that 1 or 1.2GHz models would -actually get scaled to their native frequency. - -However, due to a AVS setting voltages too low this will cause random -crashes on 1.2GHz models. - -So, until a new safe for everybody voltage is agreed on -lets revert the patch. - -Signed-off-by: Robert Marko ---- - drivers/cpufreq/armada-37xx-cpufreq.c | 35 +++++++++------------------ - 1 file changed, 12 insertions(+), 23 deletions(-) - ---- a/drivers/cpufreq/armada-37xx-cpufreq.c -+++ b/drivers/cpufreq/armada-37xx-cpufreq.c -@@ -25,10 +25,6 @@ - - #include "cpufreq-dt.h" - --/* Clk register set */ --#define ARMADA_37XX_CLK_TBG_SEL 0 --#define ARMADA_37XX_CLK_TBG_SEL_CPU_OFF 22 -- - /* Power management in North Bridge register set */ - #define ARMADA_37XX_NB_L0L1 0x18 - #define ARMADA_37XX_NB_L2L3 0x1C -@@ -126,15 +122,10 @@ static struct armada_37xx_dvfs *armada_3 - * will be configured then the DVFS will be enabled. - */ - static void __init armada37xx_cpufreq_dvfs_setup(struct regmap *base, -- struct regmap *clk_base, u8 *divider) -+ struct clk *clk, u8 *divider) - { -- u32 cpu_tbg_sel; - int load_lvl; -- -- /* Determine to which TBG clock is CPU connected */ -- regmap_read(clk_base, ARMADA_37XX_CLK_TBG_SEL, &cpu_tbg_sel); -- cpu_tbg_sel >>= ARMADA_37XX_CLK_TBG_SEL_CPU_OFF; -- cpu_tbg_sel &= ARMADA_37XX_NB_TBG_SEL_MASK; -+ struct clk *parent; - - for (load_lvl = 0; load_lvl < LOAD_LEVEL_NR; load_lvl++) { - unsigned int reg, mask, val, offset = 0; -@@ -153,11 +144,6 @@ static void __init armada37xx_cpufreq_dv - mask = (ARMADA_37XX_NB_CLK_SEL_MASK - << ARMADA_37XX_NB_CLK_SEL_OFF); - -- /* Set TBG index, for all levels we use the same TBG */ -- val = cpu_tbg_sel << ARMADA_37XX_NB_TBG_SEL_OFF; -- mask = (ARMADA_37XX_NB_TBG_SEL_MASK -- << ARMADA_37XX_NB_TBG_SEL_OFF); -- - /* - * Set cpu divider based on the pre-computed array in - * order to have balanced step. -@@ -176,6 +162,14 @@ static void __init armada37xx_cpufreq_dv - - regmap_update_bits(base, reg, mask, val); - } -+ -+ /* -+ * Set cpu clock source, for all the level we keep the same -+ * clock source that the one already configured. For this one -+ * we need to use the clock framework -+ */ -+ parent = clk_get_parent(clk); -+ clk_set_parent(clk, parent); - } - - /* -@@ -401,16 +395,11 @@ static int __init armada37xx_cpufreq_dri - struct platform_device *pdev; - unsigned long freq; - unsigned int cur_frequency, base_frequency; -- struct regmap *nb_clk_base, *nb_pm_base, *avs_base; -+ struct regmap *nb_pm_base, *avs_base; - struct device *cpu_dev; - int load_lvl, ret; - struct clk *clk, *parent; - -- nb_clk_base = -- syscon_regmap_lookup_by_compatible("marvell,armada-3700-periph-clock-nb"); -- if (IS_ERR(nb_clk_base)) -- return -ENODEV; -- - nb_pm_base = - syscon_regmap_lookup_by_compatible("marvell,armada-3700-nb-pm"); - -@@ -487,7 +476,7 @@ static int __init armada37xx_cpufreq_dri - armada37xx_cpufreq_avs_configure(avs_base, dvfs); - armada37xx_cpufreq_avs_setup(avs_base, dvfs); - -- armada37xx_cpufreq_dvfs_setup(nb_pm_base, nb_clk_base, dvfs->divider); -+ armada37xx_cpufreq_dvfs_setup(nb_pm_base, clk, dvfs->divider); - clk_put(clk); - - for (load_lvl = ARMADA_37XX_DVFS_LOAD_0; load_lvl < LOAD_LEVEL_NR; From 4b2dc4dbbf9e34af9828e2ccf8d2121f88ad9ab9 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Tue, 27 Jul 2021 13:20:43 +0200 Subject: [PATCH 39/53] mvebu: armada-37xx: add patch to forbid cpufreq for 1.2 GHz This patch is backported from linux-arm-kernel [1] to improve situation, when it was reported that 1.2 GHz variant is unstable with DFS. It waits to be accepted upstream, however, it waits for Marvell people to respond. [1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/20210630225601.6372-1-kabel@kernel.org/ Fixes: 7b868fe04a89 ("Revert "mvebu: 5.4 fix DVFS caused random boot crashes"") Signed-off-by: Josef Schlehofer --- ...x-forbid-cpufreq-for-1.2-GHz-variant.patch | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 target/linux/mvebu/patches-5.10/101-cpufreq-armada-37xx-forbid-cpufreq-for-1.2-GHz-variant.patch diff --git a/target/linux/mvebu/patches-5.10/101-cpufreq-armada-37xx-forbid-cpufreq-for-1.2-GHz-variant.patch b/target/linux/mvebu/patches-5.10/101-cpufreq-armada-37xx-forbid-cpufreq-for-1.2-GHz-variant.patch new file mode 100644 index 0000000000..6a5b8220f8 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/101-cpufreq-armada-37xx-forbid-cpufreq-for-1.2-GHz-variant.patch @@ -0,0 +1,39 @@ +From: =?utf-8?q?Marek_Beh=C3=BAn?= +Subject: [PATCH v2] cpufreq: armada-37xx: forbid cpufreq for 1.2 GHz variant +Date: Thu, 1 Jul 2021 00:56:01 +0200 + +The 1.2 GHz variant of the Armada 3720 SOC is unstable with DVFS: when +the SOC boots, the WTMI firmware sets clocks and AVS values that work +correctly with 1.2 GHz CPU frequency, but random crashes occur once +cpufreq driver starts scaling. + +We do not know currently what is the reason: +- it may be that the voltage value for L0 for 1.2 GHz variant provided + by the vendor in the OTP is simply incorrect when scaling is used, +- it may be that some delay is needed somewhere, +- it may be something else. + +The most sane solution now seems to be to simply forbid the cpufreq +driver on 1.2 GHz variant. + +Signed-off-by: Marek Behún +Fixes: 92ce45fb875d ("cpufreq: Add DVFS support for Armada 37xx") +--- + drivers/cpufreq/armada-37xx-cpufreq.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/cpufreq/armada-37xx-cpufreq.c ++++ b/drivers/cpufreq/armada-37xx-cpufreq.c +@@ -102,7 +102,11 @@ struct armada_37xx_dvfs { + }; + + static struct armada_37xx_dvfs armada_37xx_dvfs[] = { +- {.cpu_freq_max = 1200*1000*1000, .divider = {1, 2, 4, 6} }, ++ /* ++ * The cpufreq scaling for 1.2 GHz variant of the SOC is currently ++ * unstable because we do not know how to configure it properly. ++ */ ++ /* {.cpu_freq_max = 1200*1000*1000, .divider = {1, 2, 4, 6} }, */ + {.cpu_freq_max = 1000*1000*1000, .divider = {1, 2, 4, 5} }, + {.cpu_freq_max = 800*1000*1000, .divider = {1, 2, 3, 4} }, + {.cpu_freq_max = 600*1000*1000, .divider = {2, 4, 5, 6} }, From 4e57f83659fad88b895dd73fb18b1f5cf2bb79d7 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 8 Aug 2021 22:38:12 +0200 Subject: [PATCH 40/53] kernel: Apply change to of_get_mac_address() to ks8851 too The code from ks8851.c was moved to ks8851_common.c, so it was not backported. This broke the compile of the omap target which uses this driver. Fixes commit 91a52f22a13d ("treewide: backport support for nvmem on non platform devices") Signed-off-by: Hauke Mehrtens --- ...the-dst-buffer-to-of_get_mac_address.patch | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/target/linux/generic/backport-5.4/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch b/target/linux/generic/backport-5.4/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch index 9f6d5727f6..ba5a068ec7 100644 --- a/target/linux/generic/backport-5.4/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch +++ b/target/linux/generic/backport-5.4/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch @@ -878,6 +878,44 @@ Signed-off-by: David S. Miller eth_hw_addr_random(dev); dev_err(eth->dev, "generated random MAC address %pM\n", dev->dev_addr); +--- a/drivers/net/ethernet/micrel/ks8851.c ++++ b/drivers/net/ethernet/micrel/ks8851.c +@@ -419,11 +419,10 @@ static void ks8851_read_mac_addr(struct + static void ks8851_init_mac(struct ks8851_net *ks) + { + struct net_device *dev = ks->netdev; +- const u8 *mac_addr; ++ int ret; + +- mac_addr = of_get_mac_address(ks->spidev->dev.of_node); +- if (!IS_ERR(mac_addr)) { +- ether_addr_copy(dev->dev_addr, mac_addr); ++ ret = of_get_mac_address(ks->spidev->dev.of_node, dev->dev_addr); ++ if (!ret) { + ks8851_write_mac_addr(dev); + return; + } +--- a/drivers/net/ethernet/micrel/ks8851_mll.c ++++ b/drivers/net/ethernet/micrel/ks8851_mll.c +@@ -1239,7 +1239,6 @@ static int ks8851_probe(struct platform_ + struct net_device *netdev; + struct ks_net *ks; + u16 id, data; +- const char *mac; + + netdev = alloc_etherdev(sizeof(struct ks_net)); + if (!netdev) +@@ -1326,9 +1325,7 @@ static int ks8851_probe(struct platform_ + + /* overwriting the default MAC address */ + if (pdev->dev.of_node) { +- mac = of_get_mac_address(pdev->dev.of_node); +- if (!IS_ERR(mac)) +- ether_addr_copy(ks->mac_addr, mac); ++ of_get_mac_address(pdev->dev.of_node, ks->mac_addr); + } else { + struct ks8851_mll_platform_data *pdata; + --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c @@ -1350,9 +1350,7 @@ static int lpc_eth_drv_probe(struct plat From e06544bdbef8e17445a071162b826d035c3ef742 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 8 Aug 2021 22:50:27 +0200 Subject: [PATCH 41/53] layerscape: Fix multiple bugs in of_get_mac_address() changes The change which backported the of_get_mac_address() change broke some patches in the layerscape target so the patches did not apply any more. This commit makes them apply again and also fixes some other problems related to this change. Fixes commit 91a52f22a13d ("treewide: backport support for nvmem on non platform devices") Signed-off-by: Hauke Mehrtens --- ...01-net-0009-dpa-SDK-DPAA-1.x-Ethernet-driver.patch | 9 ++++----- ...-dsa-ocelot-add-tsn-support-for-felix-switch.patch | 2 +- ...ing-fsl_ppfe-eth-resolve-indentation-warning.patch | 2 +- ...-staging-fsl_ppfe-eth-add-fixed-link-support.patch | 2 +- ...fsl_ppfe-eth-reorganize-platform-phy-paramet.patch | 6 +++--- ...fsl_ppfe-eth-support-single-interface-initia.patch | 4 ++-- ...0316-staging-fsl_ppfe-eth-remove-unused-code.patch | 6 +++--- ...fsl_ppfe-eth-separate-mdio-init-from-mac-ini.patch | 11 +++++------ ...fsl_ppfe-eth-use-memremap-to-map-RAM-area-us.patch | 6 +++--- ...fsl_ppfe-eth-Enhance-error-checking-in-platf.patch | 6 +----- 10 files changed, 24 insertions(+), 30 deletions(-) diff --git a/target/linux/layerscape/patches-5.4/701-net-0009-dpa-SDK-DPAA-1.x-Ethernet-driver.patch b/target/linux/layerscape/patches-5.4/701-net-0009-dpa-SDK-DPAA-1.x-Ethernet-driver.patch index 215569e406..8dbcb0654f 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0009-dpa-SDK-DPAA-1.x-Ethernet-driver.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0009-dpa-SDK-DPAA-1.x-Ethernet-driver.patch @@ -10514,7 +10514,7 @@ Signed-off-by: Madalin Bucur +module_exit(dpa_ptp_unload); --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_dpaa/mac-api.c -@@ -0,0 +1,907 @@ +@@ -0,0 +1,909 @@ +/* Copyright 2008-2012 Freescale Semiconductor, Inc. + * + * Redistribution and use in source and binary forms, with or without @@ -11426,7 +11426,7 @@ Signed-off-by: Madalin Bucur +}; --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_dpaa/mac.c -@@ -0,0 +1,489 @@ +@@ -0,0 +1,486 @@ +/* Copyright 2008-2012 Freescale Semiconductor, Inc. + * + * Redistribution and use in source and binary forms, with or without @@ -11700,11 +11700,10 @@ Signed-off-by: Madalin Bucur + mac_dev->cell_index -= 8; + + /* Get the MAC address */ -+ of_get_mac_address(mac_node, mac_dev->addr); -+ if (unlikely(!is_valid_ether_addr(mac_dev->addr))) { ++ _errno = of_get_mac_address(mac_node, mac_dev->addr); ++ if (unlikely(_errno)) { + dev_err(dev, "of_get_mac_address(%s) failed\n", + mac_node->full_name); -+ _errno = -EINVAL; + goto _return_dev_set_drvdata; + } + diff --git a/target/linux/layerscape/patches-5.4/701-net-0273-net-dsa-ocelot-add-tsn-support-for-felix-switch.patch b/target/linux/layerscape/patches-5.4/701-net-0273-net-dsa-ocelot-add-tsn-support-for-felix-switch.patch index 22d6c97a72..72b101bfb0 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0273-net-dsa-ocelot-add-tsn-support-for-felix-switch.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0273-net-dsa-ocelot-add-tsn-support-for-felix-switch.patch @@ -658,7 +658,7 @@ Signed-off-by: Xiaoliang Yang struct dsa_switch_driver { --- a/net/dsa/dsa2.c +++ b/net/dsa/dsa2.c -@@ -325,6 +325,10 @@ static int dsa_port_setup(struct dsa_por +@@ -323,6 +323,10 @@ static int dsa_port_setup(struct dsa_por if (err) break; diff --git a/target/linux/layerscape/patches-5.4/701-net-0306-staging-fsl_ppfe-eth-resolve-indentation-warning.patch b/target/linux/layerscape/patches-5.4/701-net-0306-staging-fsl_ppfe-eth-resolve-indentation-warning.patch index f57e26688f..d61a448b0b 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0306-staging-fsl_ppfe-eth-resolve-indentation-warning.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0306-staging-fsl_ppfe-eth-resolve-indentation-warning.patch @@ -28,7 +28,7 @@ Signed-off-by: Calvin Johnson --- a/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c +++ b/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c -@@ -89,11 +89,12 @@ static int pfe_get_gemac_if_proprties(st +@@ -83,11 +83,12 @@ static int pfe_get_gemac_if_proprties(st } addr = of_get_property(gem, "fsl,mdio-mux-val", &size); diff --git a/target/linux/layerscape/patches-5.4/701-net-0307-staging-fsl_ppfe-eth-add-fixed-link-support.patch b/target/linux/layerscape/patches-5.4/701-net-0307-staging-fsl_ppfe-eth-add-fixed-link-support.patch index 298c34a5e8..900a4513fe 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0307-staging-fsl_ppfe-eth-add-fixed-link-support.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0307-staging-fsl_ppfe-eth-add-fixed-link-support.patch @@ -99,7 +99,7 @@ Signed-off-by: Calvin Johnson #include #include #include -@@ -124,6 +126,8 @@ static int pfe_get_gemac_if_proprties(st +@@ -118,6 +120,8 @@ static int pfe_get_gemac_if_proprties(st pdata->ls1012a_mdio_pdata[port].irq[0] = PHY_POLL; done: diff --git a/target/linux/layerscape/patches-5.4/701-net-0313-staging-fsl_ppfe-eth-reorganize-platform-phy-paramet.patch b/target/linux/layerscape/patches-5.4/701-net-0313-staging-fsl_ppfe-eth-reorganize-platform-phy-paramet.patch index 7d59676781..8a16edf285 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0313-staging-fsl_ppfe-eth-reorganize-platform-phy-paramet.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0313-staging-fsl_ppfe-eth-reorganize-platform-phy-paramet.patch @@ -46,7 +46,7 @@ Signed-off-by: Calvin Johnson addr = of_get_property(gem, "fsl,gemac-bus-id", &size); if (!addr) pr_err("%s:%d Invalid gemac-bus-id....\n", __func__, -@@ -68,16 +61,55 @@ static int pfe_get_gemac_if_proprties(st +@@ -62,16 +56,55 @@ static int pfe_get_gemac_if_proprties(st else pdata->ls1012a_eth_pdata[port].bus_id = be32_to_cpup(addr); @@ -109,7 +109,7 @@ Signed-off-by: Calvin Johnson addr = of_get_property(gem, "fsl,mdio-mux-val", &size); if (!addr) { pr_err("%s: Invalid mdio-mux-val....\n", __func__); -@@ -90,33 +122,10 @@ static int pfe_get_gemac_if_proprties(st +@@ -84,33 +117,10 @@ static int pfe_get_gemac_if_proprties(st pfe->mdio_muxval[pdata->ls1012a_eth_pdata[port].phy_id] = pdata->ls1012a_eth_pdata[port].mdio_muxval; @@ -143,7 +143,7 @@ Signed-off-by: Calvin Johnson return 0; err: -@@ -218,8 +227,8 @@ static int pfe_platform_probe(struct pla +@@ -212,8 +222,8 @@ static int pfe_platform_probe(struct pla pfe_platform_data.ls1012a_mdio_pdata[0].phy_mask = 0xffffffff; for (ii = 0; ii < interface_count; ii++) { diff --git a/target/linux/layerscape/patches-5.4/701-net-0314-staging-fsl_ppfe-eth-support-single-interface-initia.patch b/target/linux/layerscape/patches-5.4/701-net-0314-staging-fsl_ppfe-eth-support-single-interface-initia.patch index 4c4cf6c0f3..fefe863647 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0314-staging-fsl_ppfe-eth-support-single-interface-initia.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0314-staging-fsl_ppfe-eth-support-single-interface-initia.patch @@ -250,7 +250,7 @@ Signed-off-by: Calvin Johnson struct ls1012a_pfe_platform_data pfe_platform_data; static int pfe_get_gemac_if_properties(struct device_node *parent, int port, int -@@ -64,8 +65,10 @@ static int pfe_get_gemac_if_properties(s +@@ -59,8 +60,10 @@ static int pfe_get_gemac_if_properties(s phy_node = of_parse_phandle(gem, "phy-handle", 0); pdata->ls1012a_eth_pdata[port].phy_node = phy_node; if (phy_node) { @@ -261,7 +261,7 @@ Signed-off-by: Calvin Johnson if (of_phy_register_fixed_link(gem) < 0) { pr_err("broken fixed-link specification\n"); goto err; -@@ -73,6 +76,7 @@ static int pfe_get_gemac_if_properties(s +@@ -68,6 +71,7 @@ static int pfe_get_gemac_if_properties(s phy_node = of_node_get(gem); pdata->ls1012a_eth_pdata[port].phy_node = phy_node; } else if (of_get_property(gem, "fsl,pfe-phy-if-flags", &size)) { diff --git a/target/linux/layerscape/patches-5.4/701-net-0316-staging-fsl_ppfe-eth-remove-unused-code.patch b/target/linux/layerscape/patches-5.4/701-net-0316-staging-fsl_ppfe-eth-remove-unused-code.patch index f1f2483f6f..32211953a5 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0316-staging-fsl_ppfe-eth-remove-unused-code.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0316-staging-fsl_ppfe-eth-remove-unused-code.patch @@ -35,9 +35,9 @@ Signed-off-by: Calvin Johnson u8 mac_addr[ETH_ALEN]; --- a/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c +++ b/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c -@@ -55,13 +55,6 @@ static int pfe_get_gemac_if_properties(s - ETH_ALEN); - } +@@ -50,13 +50,6 @@ static int pfe_get_gemac_if_properties(s + + of_get_mac_address(gem, pdata->ls1012a_eth_pdata[port].mac_addr); - addr = of_get_property(gem, "fsl,gemac-bus-id", &size); - if (!addr) diff --git a/target/linux/layerscape/patches-5.4/701-net-0317-staging-fsl_ppfe-eth-separate-mdio-init-from-mac-ini.patch b/target/linux/layerscape/patches-5.4/701-net-0317-staging-fsl_ppfe-eth-separate-mdio-init-from-mac-ini.patch index fbf13c8ffc..74fb01ce0b 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0317-staging-fsl_ppfe-eth-separate-mdio-init-from-mac-ini.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0317-staging-fsl_ppfe-eth-separate-mdio-init-from-mac-ini.patch @@ -549,7 +549,7 @@ Signed-off-by: Calvin Johnson int pfe_eth_suspend(struct net_device *dev); --- a/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c +++ b/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c -@@ -21,31 +21,18 @@ +@@ -21,30 +21,17 @@ extern bool pfe_use_old_dts_phy; struct ls1012a_pfe_platform_data pfe_platform_data; @@ -567,7 +567,6 @@ Signed-off-by: Calvin Johnson - int ii = 0, phy_id = 0; + int phy_id = 0; const u32 *addr; - const void *mac_addr; - for (ii = 0; ii < if_cnt; ii++) { - gem = of_get_next_child(parent, gem); @@ -588,7 +587,7 @@ Signed-off-by: Calvin Johnson pdata->ls1012a_eth_pdata[port].gem_id = port; -@@ -88,14 +75,6 @@ static int pfe_get_gemac_if_properties(s +@@ -83,14 +70,6 @@ static int pfe_get_gemac_if_properties(s if (pdata->ls1012a_eth_pdata[port].phy_flags & GEMAC_NO_PHY) goto done; @@ -603,7 +602,7 @@ Signed-off-by: Calvin Johnson } else { pr_info("%s: No PHY or fixed-link\n", __func__); return 0; -@@ -140,7 +119,7 @@ static int pfe_platform_probe(struct pla +@@ -135,7 +114,7 @@ static int pfe_platform_probe(struct pla struct resource res; int ii, rc, interface_count = 0, size = 0; const u32 *prop; @@ -612,7 +611,7 @@ Signed-off-by: Calvin Johnson struct clk *pfe_clk; np = pdev->dev.of_node; -@@ -224,8 +203,13 @@ static int pfe_platform_probe(struct pla +@@ -219,8 +198,13 @@ static int pfe_platform_probe(struct pla pfe_platform_data.ls1012a_mdio_pdata[0].phy_mask = 0xffffffff; for (ii = 0; ii < interface_count; ii++) { @@ -628,7 +627,7 @@ Signed-off-by: Calvin Johnson } pfe->dev = &pdev->dev; -@@ -347,8 +331,8 @@ static int pfe_platform_resume(struct de +@@ -342,8 +326,8 @@ static int pfe_platform_resume(struct de for (i = 0; i < (NUM_GEMAC_SUPPORT); i++) { netdev = pfe->eth.eth_priv[i]->ndev; diff --git a/target/linux/layerscape/patches-5.4/701-net-0320-staging-fsl_ppfe-eth-use-memremap-to-map-RAM-area-us.patch b/target/linux/layerscape/patches-5.4/701-net-0320-staging-fsl_ppfe-eth-use-memremap-to-map-RAM-area-us.patch index 115685c480..c9c3a7a888 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0320-staging-fsl_ppfe-eth-use-memremap-to-map-RAM-area-us.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0320-staging-fsl_ppfe-eth-use-memremap-to-map-RAM-area-us.patch @@ -15,7 +15,7 @@ Signed-off-by: Calvin Johnson --- a/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c +++ b/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c -@@ -148,9 +148,10 @@ static int pfe_platform_probe(struct pla +@@ -143,9 +143,10 @@ static int pfe_platform_probe(struct pla pfe->ddr_phys_baseaddr = res.start; pfe->ddr_size = resource_size(&res); @@ -28,7 +28,7 @@ Signed-off-by: Calvin Johnson rc = -ENOMEM; goto err_ddr; } -@@ -240,7 +241,7 @@ err_hif_irq: +@@ -235,7 +236,7 @@ err_hif_irq: iounmap(pfe->cbus_baseaddr); err_axi: @@ -37,7 +37,7 @@ Signed-off-by: Calvin Johnson err_ddr: platform_set_drvdata(pdev, NULL); -@@ -264,7 +265,8 @@ static int pfe_platform_remove(struct pl +@@ -259,7 +260,8 @@ static int pfe_platform_remove(struct pl rc = pfe_remove(pfe); iounmap(pfe->cbus_baseaddr); diff --git a/target/linux/layerscape/patches-5.4/701-net-0399-staging-fsl_ppfe-eth-Enhance-error-checking-in-platf.patch b/target/linux/layerscape/patches-5.4/701-net-0399-staging-fsl_ppfe-eth-Enhance-error-checking-in-platf.patch index 2613628d02..bcc67e869e 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0399-staging-fsl_ppfe-eth-Enhance-error-checking-in-platf.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0399-staging-fsl_ppfe-eth-Enhance-error-checking-in-platf.patch @@ -13,12 +13,8 @@ Signed-off-by: Anji Jagarlmudi --- a/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c +++ b/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c -@@ -29,15 +29,19 @@ static int pfe_get_gemac_if_properties(s - int size; - int phy_id = 0; +@@ -31,7 +31,11 @@ static int pfe_get_gemac_if_properties(s const u32 *addr; -- const void *mac_addr; -+ const u8 *mac_addr; addr = of_get_property(gem, "reg", &size); - port = be32_to_cpup(addr); From 8d143784cb8fafccdbcdc0bd5d1aa47d3d676f70 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 9 Aug 2021 00:03:43 +0200 Subject: [PATCH 42/53] uboot-layerscape: fix dtc compilation on host gcc 10 Backport a patch from upstream U-Boot to fix the compile with host GCC 10. Signed-off-by: Hauke Mehrtens --- ...10-fix_dtc_compilation_on_host_gcc10.patch | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 package/boot/uboot-layerscape/patches/010-fix_dtc_compilation_on_host_gcc10.patch diff --git a/package/boot/uboot-layerscape/patches/010-fix_dtc_compilation_on_host_gcc10.patch b/package/boot/uboot-layerscape/patches/010-fix_dtc_compilation_on_host_gcc10.patch new file mode 100644 index 0000000000..6abb151608 --- /dev/null +++ b/package/boot/uboot-layerscape/patches/010-fix_dtc_compilation_on_host_gcc10.patch @@ -0,0 +1,46 @@ +From e33a814e772cdc36436c8c188d8c42d019fda639 Mon Sep 17 00:00:00 2001 +From: Dirk Mueller +Date: Tue, 14 Jan 2020 18:53:41 +0100 +Subject: [PATCH] scripts/dtc: Remove redundant YYLOC global declaration + +gcc 10 will default to -fno-common, which causes this error at link +time: + + (.text+0x0): multiple definition of `yylloc'; dtc-lexer.lex.o (symbol from plugin):(.text+0x0): first defined here + +This is because both dtc-lexer as well as dtc-parser define the same +global symbol yyloc. Before with -fcommon those were merged into one +defintion. The proper solution would be to to mark this as "extern", +however that leads to: + + dtc-lexer.l:26:16: error: redundant redeclaration of 'yylloc' [-Werror=redundant-decls] + 26 | extern YYLTYPE yylloc; + | ^~~~~~ +In file included from dtc-lexer.l:24: +dtc-parser.tab.h:127:16: note: previous declaration of 'yylloc' was here + 127 | extern YYLTYPE yylloc; + | ^~~~~~ +cc1: all warnings being treated as errors + +which means the declaration is completely redundant and can just be +dropped. + +Signed-off-by: Dirk Mueller +Signed-off-by: David Gibson +[robh: cherry-pick from upstream] +Cc: stable@vger.kernel.org +Signed-off-by: Rob Herring +--- + scripts/dtc/dtc-lexer.l | 1 - + 1 file changed, 1 deletion(-) + +--- a/scripts/dtc/dtc-lexer.l ++++ b/scripts/dtc/dtc-lexer.l +@@ -38,7 +38,6 @@ LINECOMMENT "//".*\n + #include "srcpos.h" + #include "dtc-parser.tab.h" + +-YYLTYPE yylloc; + extern bool treesource_error; + + /* CAUTION: this will stop working if we ever use yyless() or yyunput() */ From 7057e054855561e7695c4e9a14de38e39217041a Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 9 Aug 2021 01:13:05 +0200 Subject: [PATCH 43/53] omap: Remove EXT2 and EXT3 driver config The EXT4 driver also takes care of EXT2 and EXT3 file systems. Activating the EXT2 driver kernel config options unlocked some other ext2 driver related options which OpenWrt did not take care of. Signed-off-by: Hauke Mehrtens --- target/linux/omap/config-5.4 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/target/linux/omap/config-5.4 b/target/linux/omap/config-5.4 index f202758c69..b5514a81df 100644 --- a/target/linux/omap/config-5.4 +++ b/target/linux/omap/config-5.4 @@ -232,10 +232,6 @@ CONFIG_DTC=y CONFIG_EDAC_ATOMIC_SCRUB=y CONFIG_EDAC_SUPPORT=y CONFIG_EEPROM_93CX6=y -CONFIG_EXT2_FS=y -CONFIG_EXT3_FS=y -# CONFIG_EXT3_FS_POSIX_ACL is not set -# CONFIG_EXT3_FS_SECURITY is not set CONFIG_EXT4_FS=y CONFIG_EXTCON=y CONFIG_EXTCON_PALMAS=y From fe54c3a0db72211bd3f4d68ca0ac25b576d46196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 6 Aug 2021 12:59:19 +0200 Subject: [PATCH 44/53] firmware-utils: mkmerakifw-old: replace GPL-2.0-only boilerplate with SPDX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was missed because scancode license scanner was confused by a comment about Cisco's GPL code github repository. Cc: Christian Lamparter Signed-off-by: Rafał Miłecki Acked-by: Christian Lamparter --- tools/firmware-utils/src/mkmerakifw-old.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/firmware-utils/src/mkmerakifw-old.c b/tools/firmware-utils/src/mkmerakifw-old.c index 05317c2a5b..76fd487a83 100644 --- a/tools/firmware-utils/src/mkmerakifw-old.c +++ b/tools/firmware-utils/src/mkmerakifw-old.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2015 Thomas Hebb * Copyright (C) 2016 Christian Lamparter @@ -12,11 +13,6 @@ * has been reverse engineered from the nandloader's nand_load_bk function. * The original code is part of Cisco's GPL code and can be found at: * - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include From f2e86d54c42e2af2c8ebd1ca4d881f6452edbd9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 6 Aug 2021 12:59:20 +0200 Subject: [PATCH 45/53] firmware-utils: mkmylofw: replace GPL-2.0-or-later boilerplate with SPDX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was missed because scancode license scanner was confused by a comment about (no) copyrights in the init_crc_table(). Cc: Gabor Juhos Cc: Gabor Juhos Signed-off-by: Rafał Miłecki --- tools/firmware-utils/src/mkmylofw.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/tools/firmware-utils/src/mkmylofw.c b/tools/firmware-utils/src/mkmylofw.c index 93eab202d9..9999b3c235 100644 --- a/tools/firmware-utils/src/mkmylofw.c +++ b/tools/firmware-utils/src/mkmylofw.c @@ -1,21 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2006-2008 Gabor Juhos - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * */ #include From cc8bc2168d3cbb6981cefe24a736a71633140729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 6 Aug 2021 12:59:21 +0200 Subject: [PATCH 46/53] firmware-utils: osbridge-crc: replace GPL-2.0-only boilerplate with SPDX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was missed because scancode license scanner was confused by comments about crc32buf(). Cc: Gabor Juhos Cc: Gabor Juhos Signed-off-by: Rafał Miłecki --- tools/firmware-utils/src/osbridge-crc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/firmware-utils/src/osbridge-crc.c b/tools/firmware-utils/src/osbridge-crc.c index 46ea855ec1..e9c577d8ed 100644 --- a/tools/firmware-utils/src/osbridge-crc.c +++ b/tools/firmware-utils/src/osbridge-crc.c @@ -1,10 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2009 Gabor Juhos - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * */ #include From 0e85dc0e913165c0c215b48da3f5a7ed4e209481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 6 Aug 2021 12:59:22 +0200 Subject: [PATCH 47/53] firmware-utils: trx: replace GPL-2.0-or-later boilerplate with SPDX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was missed because scancode license scanner was confused by comments about crc32buf(). Signed-off-by: Rafał Miłecki --- tools/firmware-utils/src/trx.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/tools/firmware-utils/src/trx.c b/tools/firmware-utils/src/trx.c index dc5bb672ae..e09d671f02 100644 --- a/tools/firmware-utils/src/trx.c +++ b/tools/firmware-utils/src/trx.c @@ -1,19 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2004 Manuel Novoa III - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* July 29, 2004 From 5ecd99f7d2f3456a9178e030bbed68e687b904ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 6 Aug 2021 12:59:23 +0200 Subject: [PATCH 48/53] firmware-utils: nand_ecc: replace GPL boilerplate with SPDX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: yajin Cc: Felix Fietkau Signed-off-by: Rafał Miłecki --- tools/firmware-utils/src/nand_ecc.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/tools/firmware-utils/src/nand_ecc.c b/tools/firmware-utils/src/nand_ecc.c index 58fb6ce0db..7189278011 100644 --- a/tools/firmware-utils/src/nand_ecc.c +++ b/tools/firmware-utils/src/nand_ecc.c @@ -1,23 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only /* * calculate ecc code for nand flash * * Copyright (C) 2008 yajin * Copyright (C) 2009 Felix Fietkau - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 or - * (at your option) version 3 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA */ From 29a3967e61334d0c6a1a7d391f0e751272d77b1d Mon Sep 17 00:00:00 2001 From: David Bauer Date: Tue, 10 Aug 2021 00:28:01 +0200 Subject: [PATCH 49/53] generic: fix kernel panic on existing mac-address node Calling free for the OF property can result in a kernel panic, as the buffer in question might be referenced elsewhere. Also, it is not removed from the tree. Always allocate a new property and updating the tree with it fixes both issues. Fixes commit 91a52f22a13d ("treewide: backport support for nvmem on non platform devices") Signed-off-by: David Bauer --- .../683-of_net-add-mac-address-to-of-tree.patch | 12 ++++-------- .../683-of_net-add-mac-address-to-of-tree.patch | 12 ++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/target/linux/generic/pending-5.10/683-of_net-add-mac-address-to-of-tree.patch b/target/linux/generic/pending-5.10/683-of_net-add-mac-address-to-of-tree.patch index 509d721403..ea5883f037 100644 --- a/target/linux/generic/pending-5.10/683-of_net-add-mac-address-to-of-tree.patch +++ b/target/linux/generic/pending-5.10/683-of_net-add-mac-address-to-of-tree.patch @@ -1,6 +1,6 @@ --- a/drivers/of/of_net.c +++ b/drivers/of/of_net.c -@@ -141,6 +141,30 @@ static int of_get_mac_address_mtd(struct +@@ -135,6 +135,26 @@ static int of_get_mac_address_mtd(struct return -EINVAL; } @@ -8,18 +8,14 @@ +{ + struct property *prop; + -+ prop = of_find_property(np, "mac-address", NULL); -+ if (prop) -+ kfree(prop); -+ + prop = kzalloc(sizeof(*prop), GFP_KERNEL); + if (!prop) -+ return 0; ++ return -ENOMEM; + + prop->name = "mac-address"; + prop->length = ETH_ALEN; + prop->value = kmemdup(addr, ETH_ALEN, GFP_KERNEL); -+ if (!prop->value || of_add_property(np, prop)) ++ if (!prop->value || of_update_property(np, prop)) + goto free; + + return 0; @@ -31,7 +27,7 @@ /** * Search the device tree for the best MAC address to use. 'mac-address' is -@@ -216,6 +240,7 @@ found: +@@ -210,6 +230,7 @@ found: if (!of_property_read_u32(np, "mac-address-increment", &mac_inc)) addr[inc_idx] += mac_inc; diff --git a/target/linux/generic/pending-5.4/683-of_net-add-mac-address-to-of-tree.patch b/target/linux/generic/pending-5.4/683-of_net-add-mac-address-to-of-tree.patch index 622d19d4ff..ea5883f037 100644 --- a/target/linux/generic/pending-5.4/683-of_net-add-mac-address-to-of-tree.patch +++ b/target/linux/generic/pending-5.4/683-of_net-add-mac-address-to-of-tree.patch @@ -1,6 +1,6 @@ --- a/drivers/of/of_net.c +++ b/drivers/of/of_net.c -@@ -135,6 +135,30 @@ static int of_get_mac_address_mtd(struct +@@ -135,6 +135,26 @@ static int of_get_mac_address_mtd(struct return -EINVAL; } @@ -8,18 +8,14 @@ +{ + struct property *prop; + -+ prop = of_find_property(np, "mac-address", NULL); -+ if (prop) -+ kfree(prop); -+ + prop = kzalloc(sizeof(*prop), GFP_KERNEL); + if (!prop) -+ return 0; ++ return -ENOMEM; + + prop->name = "mac-address"; + prop->length = ETH_ALEN; + prop->value = kmemdup(addr, ETH_ALEN, GFP_KERNEL); -+ if (!prop->value || of_add_property(np, prop)) ++ if (!prop->value || of_update_property(np, prop)) + goto free; + + return 0; @@ -31,7 +27,7 @@ /** * Search the device tree for the best MAC address to use. 'mac-address' is -@@ -210,6 +234,7 @@ found: +@@ -210,6 +230,7 @@ found: if (!of_property_read_u32(np, "mac-address-increment", &mac_inc)) addr[inc_idx] += mac_inc; From eaa9c94c75748265b9260691d5f59c9d3711f7d4 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Fri, 23 Jul 2021 01:32:38 +0200 Subject: [PATCH 50/53] generic: Kconfig: exit on unset symbol When a target configuration has unser Kconfig symbols, the build will fail when OpenWrt is compiled with V=s and stdin is connected to a tty. In case OpenWrt is compiled without either of these preconditions, the build will uscceed with the symbols in question being unset. Modify the kernel configuration in a way it fails on unset symbols regardless of the aformentioned preconditions. Signed-off-by: David Bauer --- include/kernel-build.mk | 1 + target/linux/generic/hack-5.10/205-kconfig-exit.patch | 11 +++++++++++ target/linux/generic/hack-5.4/205-kconfig-exit.patch | 11 +++++++++++ 3 files changed, 23 insertions(+) create mode 100644 target/linux/generic/hack-5.10/205-kconfig-exit.patch create mode 100644 target/linux/generic/hack-5.4/205-kconfig-exit.patch diff --git a/include/kernel-build.mk b/include/kernel-build.mk index 66a9f64c80..80da4455bc 100644 --- a/include/kernel-build.mk +++ b/include/kernel-build.mk @@ -132,6 +132,7 @@ define BuildKernel $(LINUX_DIR)/.modules: export STAGING_PREFIX=$$(STAGING_DIR_HOST) $(LINUX_DIR)/.modules: export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig $(LINUX_DIR)/.modules: export PKG_CONFIG_LIBDIR=$$(STAGING_DIR_HOST)/lib/pkgconfig + $(LINUX_DIR)/.modules: export FAIL_ON_UNCONFIGURED=1 $(LINUX_DIR)/.modules: $(STAMP_CONFIGURED) $(LINUX_DIR)/.config FORCE $(Kernel/CompileModules) touch $$@ diff --git a/target/linux/generic/hack-5.10/205-kconfig-exit.patch b/target/linux/generic/hack-5.10/205-kconfig-exit.patch new file mode 100644 index 0000000000..8931ad3270 --- /dev/null +++ b/target/linux/generic/hack-5.10/205-kconfig-exit.patch @@ -0,0 +1,11 @@ +--- a/scripts/kconfig/conf.c ++++ b/scripts/kconfig/conf.c +@@ -212,6 +212,8 @@ static int conf_sym(struct menu *menu) + break; + continue; + case 0: ++ if (!sym_has_value(sym) && !tty_stdio && getenv("FAIL_ON_UNCONFIGURED")) ++ exit(1); + newval = oldval; + break; + case '?': diff --git a/target/linux/generic/hack-5.4/205-kconfig-exit.patch b/target/linux/generic/hack-5.4/205-kconfig-exit.patch new file mode 100644 index 0000000000..8931ad3270 --- /dev/null +++ b/target/linux/generic/hack-5.4/205-kconfig-exit.patch @@ -0,0 +1,11 @@ +--- a/scripts/kconfig/conf.c ++++ b/scripts/kconfig/conf.c +@@ -212,6 +212,8 @@ static int conf_sym(struct menu *menu) + break; + continue; + case 0: ++ if (!sym_has_value(sym) && !tty_stdio && getenv("FAIL_ON_UNCONFIGURED")) ++ exit(1); + newval = oldval; + break; + case '?': From 1c9a9f7c7a242766ea07c2a7927a6b99b7344354 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Tue, 10 Aug 2021 20:22:18 +0200 Subject: [PATCH 51/53] treewide: add various missing config symbols Fixes commit 91a52f22a13d ("treewide: backport support for nvmem on non platform devices") Signed-off-by: David Bauer --- target/linux/gemini/config-5.10 | 1 + target/linux/gemini/config-5.4 | 1 + target/linux/generic/config-5.10 | 1 + target/linux/generic/config-5.4 | 1 + target/linux/layerscape/armv8_64b/config-5.4 | 1 + target/linux/mediatek/mt7622/config-5.10 | 1 + target/linux/mediatek/mt7623/config-5.10 | 1 + target/linux/mediatek/mt7629/config-5.4 | 1 + target/linux/mpc85xx/p1020/config-default | 1 + target/linux/ramips/mt76x8/config-5.10 | 1 + target/linux/ramips/mt76x8/config-5.4 | 1 + target/linux/rockchip/armv8/config-5.4 | 1 + target/linux/tegra/config-5.10 | 1 + target/linux/tegra/config-5.4 | 1 + target/linux/x86/64/config-5.4 | 1 - target/linux/x86/config-5.10 | 1 + target/linux/x86/config-5.4 | 1 + target/linux/x86/generic/config-5.4 | 1 - target/linux/x86/geode/config-5.4 | 1 - 19 files changed, 16 insertions(+), 3 deletions(-) diff --git a/target/linux/gemini/config-5.10 b/target/linux/gemini/config-5.10 index 481bbc27d1..2382e85bea 100644 --- a/target/linux/gemini/config-5.10 +++ b/target/linux/gemini/config-5.10 @@ -49,6 +49,7 @@ CONFIG_CMA_SIZE_PERCENTAGE=10 CONFIG_CMA_SIZE_SEL_PERCENTAGE=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_GEMINI=y +CONFIG_COMPAT_32BIT_TIME=y CONFIG_CONSOLE_TRANSLATIONS=y CONFIG_CONTIG_ALLOC=y CONFIG_COREDUMP=y diff --git a/target/linux/gemini/config-5.4 b/target/linux/gemini/config-5.4 index be90e2a2d3..9d84571b3c 100644 --- a/target/linux/gemini/config-5.4 +++ b/target/linux/gemini/config-5.4 @@ -62,6 +62,7 @@ CONFIG_CMA_SIZE_SEL_MBYTES=y # CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_GEMINI=y +CONFIG_COMPAT_32BIT_TIME=y CONFIG_CONSOLE_TRANSLATIONS=y CONFIG_COREDUMP=y CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 index 3b27a73022..901701b182 100644 --- a/target/linux/generic/config-5.10 +++ b/target/linux/generic/config-5.10 @@ -2873,6 +2873,7 @@ CONFIG_KERNFS=y # CONFIG_KGDB is not set # CONFIG_KMEMCHECK is not set # CONFIG_KMX61 is not set +# CONFIG_KPC2000 is not set # CONFIG_KPROBES is not set # CONFIG_KPROBES_SANITY_TEST is not set # CONFIG_KPROBE_EVENTS_ON_NOTRACE is not set diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index d9e2095f4d..d61c2a155e 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -2643,6 +2643,7 @@ CONFIG_KERNFS=y # CONFIG_KGDB is not set # CONFIG_KMEMCHECK is not set # CONFIG_KMX61 is not set +# CONFIG_KPC2000 is not set # CONFIG_KPROBES is not set # CONFIG_KPROBES_SANITY_TEST is not set # CONFIG_KS7010 is not set diff --git a/target/linux/layerscape/armv8_64b/config-5.4 b/target/linux/layerscape/armv8_64b/config-5.4 index 6e3618f274..4606c2304a 100644 --- a/target/linux/layerscape/armv8_64b/config-5.4 +++ b/target/linux/layerscape/armv8_64b/config-5.4 @@ -199,6 +199,7 @@ CONFIG_DMA_SHARED_BUFFER=y CONFIG_DMA_VIRTUAL_CHANNELS=y CONFIG_DNOTIFY=y CONFIG_DPAA2_CONSOLE=y +# CONFIG_DRM_CDNS_MHDP is not set CONFIG_DRM_RCAR_WRITEBACK=y CONFIG_DTC=y CONFIG_DT_IDLE_STATES=y diff --git a/target/linux/mediatek/mt7622/config-5.10 b/target/linux/mediatek/mt7622/config-5.10 index c628091172..f2f635cf43 100644 --- a/target/linux/mediatek/mt7622/config-5.10 +++ b/target/linux/mediatek/mt7622/config-5.10 @@ -403,6 +403,7 @@ CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SGL_ALLOC=y CONFIG_SG_POOL=y CONFIG_SMP=y +# CONFIG_SND_SOC_MT6359 is not set CONFIG_SPARSEMEM=y CONFIG_SPARSEMEM_EXTREME=y CONFIG_SPARSEMEM_MANUAL=y diff --git a/target/linux/mediatek/mt7623/config-5.10 b/target/linux/mediatek/mt7623/config-5.10 index 4e240b560d..da9bda7995 100644 --- a/target/linux/mediatek/mt7623/config-5.10 +++ b/target/linux/mediatek/mt7623/config-5.10 @@ -446,6 +446,7 @@ CONFIG_SERIAL_MCTRL_GPIO=y CONFIG_SGL_ALLOC=y CONFIG_SMP=y # CONFIG_SMP_ON_UP is not set +# CONFIG_SND_SOC_MT6359 is not set CONFIG_SPARSE_IRQ=y CONFIG_SPI=y CONFIG_SPI_BITBANG=y diff --git a/target/linux/mediatek/mt7629/config-5.4 b/target/linux/mediatek/mt7629/config-5.4 index 5362dddb28..9d1b5da452 100644 --- a/target/linux/mediatek/mt7629/config-5.4 +++ b/target/linux/mediatek/mt7629/config-5.4 @@ -332,6 +332,7 @@ CONFIG_SGL_ALLOC=y CONFIG_SG_POOL=y CONFIG_SMP=y CONFIG_SMP_ON_UP=y +# CONFIG_SND_SOC_MT6359 is not set CONFIG_SPARSE_IRQ=y CONFIG_SPI=y CONFIG_SPI_MASTER=y diff --git a/target/linux/mpc85xx/p1020/config-default b/target/linux/mpc85xx/p1020/config-default index c9a84a344a..3886e05579 100644 --- a/target/linux/mpc85xx/p1020/config-default +++ b/target/linux/mpc85xx/p1020/config-default @@ -15,6 +15,7 @@ CONFIG_I2C_CHARDEV=y CONFIG_LEDS_LP5521=y CONFIG_LEDS_LP55XX_COMMON=y CONFIG_LOCK_SPIN_ON_OWNER=y +# CONFIG_MAX77620_THERMAL is not set # CONFIG_MAX77620_WATCHDOG is not set CONFIG_MFD_CORE=y CONFIG_MFD_MAX77620=y diff --git a/target/linux/ramips/mt76x8/config-5.10 b/target/linux/ramips/mt76x8/config-5.10 index fd1e03685e..f20e9a96a1 100644 --- a/target/linux/ramips/mt76x8/config-5.10 +++ b/target/linux/ramips/mt76x8/config-5.10 @@ -147,6 +147,7 @@ CONFIG_PINCTRL=y # CONFIG_PINCTRL_AW9523 is not set CONFIG_PINCTRL_RT2880=y # CONFIG_PINCTRL_SINGLE is not set +# CONFIG_PWM_MEDIATEK is not set CONFIG_RALINK=y # CONFIG_RALINK_WDT is not set CONFIG_REGMAP=y diff --git a/target/linux/ramips/mt76x8/config-5.4 b/target/linux/ramips/mt76x8/config-5.4 index 5b9792b30e..d655d7ff83 100644 --- a/target/linux/ramips/mt76x8/config-5.4 +++ b/target/linux/ramips/mt76x8/config-5.4 @@ -147,6 +147,7 @@ CONFIG_PINCTRL=y # CONFIG_PINCTRL_AW9523 is not set CONFIG_PINCTRL_RT2880=y # CONFIG_PINCTRL_SINGLE is not set +# CONFIG_PWM_MEDIATEK is not set CONFIG_RALINK=y # CONFIG_RALINK_WDT is not set CONFIG_REGMAP=y diff --git a/target/linux/rockchip/armv8/config-5.4 b/target/linux/rockchip/armv8/config-5.4 index 0844401c2e..ee6a0021b5 100644 --- a/target/linux/rockchip/armv8/config-5.4 +++ b/target/linux/rockchip/armv8/config-5.4 @@ -270,6 +270,7 @@ CONFIG_INPUT_KEYBOARD=y CONFIG_INPUT_LEDS=y CONFIG_INPUT_MATRIXKMAP=y # CONFIG_INPUT_MISC is not set +# CONFIG_INPUT_RK805_PWRKEY is not set CONFIG_IOMMU_API=y # CONFIG_IOMMU_DEBUGFS is not set # CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set diff --git a/target/linux/tegra/config-5.10 b/target/linux/tegra/config-5.10 index e4b1c66f52..5328c5fc31 100644 --- a/target/linux/tegra/config-5.10 +++ b/target/linux/tegra/config-5.10 @@ -454,6 +454,7 @@ CONFIG_TEGRA_IOMMU_GART=y # CONFIG_TEGRA_IOMMU_SMMU is not set # CONFIG_TEGRA_IVC is not set CONFIG_TEGRA_MC=y +# CONFIG_TEGRA_SOCTHERM is not set CONFIG_TEGRA_TIMER=y CONFIG_TEGRA_WATCHDOG=y CONFIG_TICK_CPU_ACCOUNTING=y diff --git a/target/linux/tegra/config-5.4 b/target/linux/tegra/config-5.4 index b487296ce3..632c4128ce 100644 --- a/target/linux/tegra/config-5.4 +++ b/target/linux/tegra/config-5.4 @@ -442,6 +442,7 @@ CONFIG_TEGRA_IOMMU_GART=y # CONFIG_TEGRA_IOMMU_SMMU is not set # CONFIG_TEGRA_IVC is not set CONFIG_TEGRA_MC=y +# CONFIG_TEGRA_SOCTHERM is not set CONFIG_TEGRA_TIMER=y CONFIG_TEGRA_WATCHDOG=y CONFIG_TICK_CPU_ACCOUNTING=y diff --git a/target/linux/x86/64/config-5.4 b/target/linux/x86/64/config-5.4 index 50521a5148..dc9aa7587f 100644 --- a/target/linux/x86/64/config-5.4 +++ b/target/linux/x86/64/config-5.4 @@ -258,7 +258,6 @@ CONFIG_INFINIBAND_EFA=y CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y CONFIG_INTEL_GTT=y CONFIG_INTEL_IDLE=y -# CONFIG_INTEL_INT0002_VGPIO is not set # CONFIG_INTEL_IPS is not set # CONFIG_INTEL_MENLOW is not set # CONFIG_INTEL_MIC_BUS is not set diff --git a/target/linux/x86/config-5.10 b/target/linux/x86/config-5.10 index b1cfe54575..405c153fca 100644 --- a/target/linux/x86/config-5.10 +++ b/target/linux/x86/config-5.10 @@ -170,6 +170,7 @@ CONFIG_INITRAMFS_SOURCE="" CONFIG_INPUT=y CONFIG_INPUT_KEYBOARD=y CONFIG_INSTRUCTION_DECODER=y +# CONFIG_INTEL_INT0002_VGPIO is not set # CONFIG_INTEL_PCH_THERMAL is not set # CONFIG_INTEL_POWERCLAMP is not set # CONFIG_INTEL_SCU_PCI is not set diff --git a/target/linux/x86/config-5.4 b/target/linux/x86/config-5.4 index ebc3ec538d..a8a05cd4df 100644 --- a/target/linux/x86/config-5.4 +++ b/target/linux/x86/config-5.4 @@ -282,6 +282,7 @@ CONFIG_INIT_STACK_NONE=y CONFIG_INPUT=y CONFIG_INPUT_KEYBOARD=y CONFIG_INSTRUCTION_DECODER=y +# CONFIG_INTEL_INT0002_VGPIO is not set # CONFIG_INTEL_MEI_HDCP is not set # CONFIG_INTEL_PCH_THERMAL is not set # CONFIG_INTEL_POWERCLAMP is not set diff --git a/target/linux/x86/generic/config-5.4 b/target/linux/x86/generic/config-5.4 index 65dc36107b..b6fd4b293c 100644 --- a/target/linux/x86/generic/config-5.4 +++ b/target/linux/x86/generic/config-5.4 @@ -218,7 +218,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y CONFIG_INTEL_GTT=y CONFIG_INTEL_IDLE=y -# CONFIG_INTEL_INT0002_VGPIO is not set # CONFIG_INTEL_IPS is not set # CONFIG_INTEL_MENLOW is not set CONFIG_INTEL_PCH_THERMAL=y diff --git a/target/linux/x86/geode/config-5.4 b/target/linux/x86/geode/config-5.4 index 651c369178..83463bae56 100644 --- a/target/linux/x86/geode/config-5.4 +++ b/target/linux/x86/geode/config-5.4 @@ -57,7 +57,6 @@ CONFIG_I2C_ALGOPCA=y CONFIG_I2C_ALGOPCF=y CONFIG_I2C_BOARDINFO=y # CONFIG_I2C_MULTI_INSTANTIATE is not set -# CONFIG_INTEL_INT0002_VGPIO is not set # CONFIG_INTEL_IPS is not set # CONFIG_INTEL_MENLOW is not set # CONFIG_INTEL_PMC_IPC is not set From 4c2a8b00fed124f7b548da72b73c85a41200c01a Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 11 Aug 2021 02:09:25 +0200 Subject: [PATCH 52/53] mediatek: add missing config symbol Signed-off-by: David Bauer --- target/linux/mediatek/mt7622/config-5.10 | 1 + target/linux/mediatek/mt7623/config-5.10 | 1 + target/linux/mediatek/mt7629/config-5.4 | 1 + 3 files changed, 3 insertions(+) diff --git a/target/linux/mediatek/mt7622/config-5.10 b/target/linux/mediatek/mt7622/config-5.10 index f2f635cf43..a95b719f03 100644 --- a/target/linux/mediatek/mt7622/config-5.10 +++ b/target/linux/mediatek/mt7622/config-5.10 @@ -227,6 +227,7 @@ CONFIG_IRQ_TIME_ACCOUNTING=y CONFIG_IRQ_WORK=y CONFIG_JBD2=y CONFIG_JUMP_LABEL=y +# CONFIG_KEYBOARD_MTK_PMIC is not set CONFIG_LEDS_UBNT_LEDBAR=y CONFIG_LIBFDT=y CONFIG_LLD_VERSION=0 diff --git a/target/linux/mediatek/mt7623/config-5.10 b/target/linux/mediatek/mt7623/config-5.10 index da9bda7995..9cbee56643 100644 --- a/target/linux/mediatek/mt7623/config-5.10 +++ b/target/linux/mediatek/mt7623/config-5.10 @@ -260,6 +260,7 @@ CONFIG_IRQ_WORK=y CONFIG_JBD2=y CONFIG_KALLSYMS=y CONFIG_KCMP=y +# CONFIG_KEYBOARD_MTK_PMIC is not set CONFIG_LEDS_MT6323=y # CONFIG_LEDS_UBNT_LEDBAR is not set CONFIG_LIBFDT=y diff --git a/target/linux/mediatek/mt7629/config-5.4 b/target/linux/mediatek/mt7629/config-5.4 index 9d1b5da452..ca27a4f62c 100644 --- a/target/linux/mediatek/mt7629/config-5.4 +++ b/target/linux/mediatek/mt7629/config-5.4 @@ -212,6 +212,7 @@ CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_TIME_ACCOUNTING=y CONFIG_IRQ_WORK=y +# CONFIG_KEYBOARD_MTK_PMIC is not set # CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set # CONFIG_LEDS_UBNT_LEDBAR is not set CONFIG_LIBFDT=y From 5c88bf896ec1be9129292aeb522bfc0f75ec9898 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 11 Aug 2021 02:11:17 +0200 Subject: [PATCH 53/53] generic: add missing config symbol Signed-off-by: David Bauer --- target/linux/generic/config-5.4 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index d61c2a155e..45d8f0976e 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -4314,6 +4314,7 @@ CONFIG_RCU_TORTURE_TEST_SLOW_INIT_DELAY=3 # CONFIG_REGULATOR_LTC3589 is not set # CONFIG_REGULATOR_LTC3676 is not set # CONFIG_REGULATOR_MAX1586 is not set +# CONFIG_REGULATOR_MAX77620 is not set # CONFIG_REGULATOR_MAX8649 is not set # CONFIG_REGULATOR_MAX8660 is not set # CONFIG_REGULATOR_MAX8952 is not set