openwrt/staging/ynezz.git
4 years agofirmware-utils: mkfwimage: fix memcpy and strncpy usage wip/firmware-utils-fixes
Petr Štetiar [Fri, 26 Jul 2019 12:45:32 +0000 (14:45 +0200)]
firmware-utils: mkfwimage: fix memcpy and strncpy usage

Firmware is binary blob, so there are barely any NULL terminated strings
expected, so we should probably convert all chars into u8 types, and
after that it's clear, that using strcpy doesn't make sense anymore.

This is rather theoretical stuff, but `uint8_t name[PART_NAME_LENGTH]`
means, that you can supply PART_NAME_LENGTH sized name, not
PART_NAME_LENGTH-1 name when NULL terminated.

Ref: https://github.com/openwrt/openwrt/pull/2274
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkbuffaloimg: fix compiler warnings/errors
Petr Štetiar [Tue, 23 Jul 2019 21:29:47 +0000 (23:29 +0200)]
firmware-utils: mkbuffaloimg: fix compiler warnings/errors

mkbuffaloimg.c:179:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkcameofw: fix compiler warnings/errors
Petr Štetiar [Tue, 23 Jul 2019 21:27:46 +0000 (23:27 +0200)]
firmware-utils: mkcameofw: fix compiler warnings/errors

mkcameofw.c:188:21: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
mkcameofw.c:188:21: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
mkcameofw.c:188:21: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
mkcameofw.c:188:21: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
mkcameofw.c:157:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 20 equals destination size [-Werror=stringop-truncation]
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 30 equals destination size [-Werror=stringop-truncation]
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 12 equals destination size [-Werror=stringop-truncation]
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 4 equals destination size [-Werror=stringop-truncation]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkdapimg: fix compiler warnings/errors
Petr Štetiar [Tue, 23 Jul 2019 21:04:08 +0000 (23:04 +0200)]
firmware-utils: mkdapimg: fix compiler warnings/errors

mkdapimg.c:162:48: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
mkdapimg.c:206:48: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
mkdapimg.c:209:49: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
mkdapimg.c:211:51: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
mkdapimg.c:162:7: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin___strncpy_chk’ output may be truncated copying between 0 and 20 bytes from a string of length 30 [-Werror=stringop-truncation]
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ output may be truncated copying 20 bytes from a string of length 20 [-Werror=stringop-truncation]
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ output may be truncated copying 30 bytes from a string of length 30 [-Werror=stringop-truncation]
mkdapimg.c:216:7: error: ‘ofile’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
mkdapimg.c:225:2: error: ‘ifile’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkdapimg2: fix compiler warnings/errors
Petr Štetiar [Tue, 23 Jul 2019 20:56:11 +0000 (22:56 +0200)]
firmware-utils: mkdapimg2: fix compiler warnings/errors

mkdapimg2.c:181:48: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
mkdapimg2.c:185:7: error: ‘ofile’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
mkdapimg2.c:193:2: error: ‘ifile’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkdhpimg: fix compiler warnings/errors
Petr Štetiar [Tue, 23 Jul 2019 20:53:32 +0000 (22:53 +0200)]
firmware-utils: mkdhpimg: fix compiler warnings/errors

mkdhpimg.c:68:2: error: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Werror=unused-result]
mkdhpimg.c:79:2: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkdniimg: fix compiler warnings/errors
Petr Štetiar [Tue, 23 Jul 2019 20:52:28 +0000 (22:52 +0200)]
firmware-utils: mkdniimg: fix compiler warnings/errors

mkdniimg.c:53:21: error: unused variable ‘board’ [-Werror=unused-variable]
mkdniimg.c:191:2: error: label ‘out_flush’ defined but not used [-Werror=unused-label]
mkdniimg.c:163:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkdlinkfw: fix compiler warnings/errors
Petr Štetiar [Tue, 23 Jul 2019 20:45:14 +0000 (22:45 +0200)]
firmware-utils: mkdlinkfw: fix compiler warnings/errors

mkdlinkfw.c:235:56: error: comparison of promoted ~unsigned with unsigned [-Werror=sign-compare]
mkdlinkfw.c:287:27: error: comparison of promoted ~unsigned with unsigned [-Werror=sign-compare]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkedimaximg: fix compiler warnings/errors
Petr Štetiar [Tue, 23 Jul 2019 20:19:21 +0000 (22:19 +0200)]
firmware-utils: mkedimaximg: fix compiler warnings/errors

mkedimaximg.c:95:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
mkedimaximg.c:116:19: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘off_t’ {aka ‘long int’} [-Werror=sign-compare]
mkedimaximg.c:137:19: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘off_t’ {aka ‘long int’} [-Werror=sign-compare]
mkedimaximg.c:186:28: error: taking address of packed member of ‘struct header’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
mkedimaximg.c:192:28: error: taking address of packed member of ‘struct header’ may result in an unaligned pointer value [-Werror=address-of-packed-member]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkhilinkfw: fix compiler warnings/errors
Petr Štetiar [Mon, 22 Jul 2019 10:08:30 +0000 (12:08 +0200)]
firmware-utils: mkhilinkfw: fix compiler warnings/errors

mkhilinkfw.c:45:9: error: comparison of integer expressions of different signedness: ‘off_t’ {aka ‘long int’} and ‘long unsigned int’ [-Werror=sign-compare]
mkhilinkfw.c:45:16: error: operand of ?: changes signedness from ‘off_t’ {aka ‘long int’} to ‘long unsigned int’ due to unsignedness of other operand [-Werror=sign-compare]
mkhilinkfw.c:45:9: error: comparison of integer expressions of different signedness: ‘off_t’ {aka ‘long int’} and ‘long unsigned int’ [-Werror=sign-compare]
mkhilinkfw.c:45:16: error: operand of ?: changes signedness from ‘off_t’ {aka ‘long int’} to ‘long unsigned int’ due to unsignedness of other operand [-Werror=sign-compare]
mkhilinkfw.c:281:9: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkmerakifw-old: fix compiler warnings/errors
Petr Štetiar [Mon, 22 Jul 2019 09:57:49 +0000 (11:57 +0200)]
firmware-utils: mkmerakifw-old: fix compiler warnings/errors

mkmerakifw-old.c:257:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkmerakifw: fix compiler warnings/errors
Petr Štetiar [Mon, 22 Jul 2019 09:52:36 +0000 (11:52 +0200)]
firmware-utils: mkmerakifw: fix compiler warnings/errors

mkmerakifw.c:253:11: error: comparison of integer expressions of different signedness: ‘long int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
mkmerakifw.c:273:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkplanexfw: fix compiler warnings/errors
Petr Štetiar [Mon, 22 Jul 2019 09:48:38 +0000 (11:48 +0200)]
firmware-utils: mkplanexfw: fix compiler warnings/errors

mkplanexfw.c:108:21: error: unused variable ‘board’ [-Werror=unused-variable]
mkplanexfw.c:233:24: error: pointer targets in passing argument 2 of ‘sha1_update’ differ in signedness [-Werror=pointer-sign]
mkplanexfw.c:251:2: error: label ‘out_flush’ defined but not used [-Werror=unused-label]
mkplanexfw.c:224:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkporayfw: fix compiler warnings/errors
Petr Štetiar [Mon, 22 Jul 2019 09:46:49 +0000 (11:46 +0200)]
firmware-utils: mkporayfw: fix compiler warnings/errors

mkporayfw.c:376:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkrtn56uimg: fix compiler warnings/errors
Petr Štetiar [Sun, 21 Jul 2019 06:44:55 +0000 (08:44 +0200)]
firmware-utils: mkrtn56uimg: fix compiler warnings/errors

mkrtn56uimg.c:105:6: error: unused variable ‘i’ [-Werror=unused-variable]
mkrtn56uimg.c:168:29: error: pointer targets in passing argument 2 of ‘strncpy’ differ in signedness [-Werror=pointer-sign]
mkrtn56uimg.c:233:20: error: pointer targets in passing argument 1 of ‘strncpy’ differ in signedness [-Werror=pointer-sign]
mkrtn56uimg.c:123:11: error: unused variable ‘checksum’ [-Werror=unused-variable]
mkrtn56uimg.c:120:10: error: unused variable ‘data’ [-Werror=unused-variable]
mkrtn56uimg.c:119:12: error: unused variable ‘len’ [-Werror=unused-variable]
mkrtn56uimg.c:211:3: error: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Werror=unused-result]
mkrtn56uimg.c:245:2: error: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Werror=unused-result]
mkrtn56uimg.c:271:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
mkrtn56uimg.c:287:10: error: ‘filename’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mksercommfw: fix compiler warnings/errors
Petr Štetiar [Sun, 21 Jul 2019 06:09:42 +0000 (08:09 +0200)]
firmware-utils: mksercommfw: fix compiler warnings/errors

mksercommfw.c:134:56: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
string_fortified.h:106:10: error: ‘__builtin_strncpy’ output truncated before terminating nul copying 7 bytes from a string of the same length [-Werror=stringop-truncation]
string_fortified.h:106:10: error: ‘__builtin_strncpy’ output truncated before terminating nul copying 7 bytes from a string of the same length [-Werror=stringop-truncation]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mktitanimg: fix compiler warnings/errors
Petr Štetiar [Sun, 21 Jul 2019 06:06:02 +0000 (08:06 +0200)]
firmware-utils: mktitanimg: fix compiler warnings/errors

mktitanimg.c:65:15: error: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Werror=sign-compare]
mktitanimg.c:43:35: error: unused variable ‘sect_info’ [-Werror=unused-variable]
mktitanimg.c:225:45: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
mktitanimg.c:289:4: error: this ‘else’ clause does not guard... [-Werror=misleading-indentation]
mktitanimg.c:128:6: error: unused variable ‘desc_count’ [-Werror=unused-variable]
mktitanimg.c:122:8: error: variable ‘filen_files’ set but not used [-Werror=unused-but-set-variable]
mktitanimg.c:121:8: error: variable ‘filen_kernel’ set but not used [-Werror=unused-but-set-variable]
mktitanimg.c:408:3: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
mktitanimg.c:416:3: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
mktitanimg.c:445:3: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
mktitanimg.c:525:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
mktitanimg.c:536:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
mktitanimg.c:639:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
mktitanimg.c:640:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mktplinkfw{2,-lib}: fix compiler warnings/errors
Petr Štetiar [Sat, 20 Jul 2019 23:13:29 +0000 (01:13 +0200)]
firmware-utils: mktplinkfw{2,-lib}: fix compiler warnings/errors

mktplinkfw-lib.c:143:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare]
mktplinkfw-lib.c:104:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkwrggimg: fix compiler warnings/errors
Petr Štetiar [Sat, 20 Jul 2019 23:09:37 +0000 (01:09 +0200)]
firmware-utils: mkwrggimg: fix compiler warnings/errors

mkwrggimg.c:117:18: error: pointer targets in passing argument 1 of ‘MD5_Final’ differ in signedness [-Werror=pointer-sign]
mkwrggimg.c:233:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkwrgimg: fix compiler warnings/errors
Petr Štetiar [Sat, 20 Jul 2019 22:41:01 +0000 (00:41 +0200)]
firmware-utils: mkwrgimg: fix compiler warnings/errors

mkwrgimg.c:103:18: error: pointer targets in passing argument 1 of ‘MD5_Final’ differ in signedness [-Werror=pointer-sign]
mkwrgimg.c:195:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkzcfw: fix compiler warnings/errors
Petr Štetiar [Sat, 20 Jul 2019 22:33:32 +0000 (00:33 +0200)]
firmware-utils: mkzcfw: fix compiler warnings/errors

mkzcfw.c:130:21: error: unused variable ‘board’ [-Werror=unused-variable]
mkzcfw.c:318:37: error: pointer targets in passing argument 1 of ‘cyg_crc32’ differ in signedness [-Werror=pointer-sign]
mkzcfw.c:338:37: error: pointer targets in passing argument 1 of ‘cyg_crc32’ differ in signedness [-Werror=pointer-sign]
mkzcfw.c:346:41: error: pointer targets in passing argument 1 of ‘cyg_crc32’ differ in signedness [-Werror=pointer-sign]
mkzcfw.c:280:11: error: unused variable ‘crc’ [-Werror=unused-variable]
mkzcfw.c:279:6: error: unused variable ‘writelen’ [-Werror=unused-variable]
mkzcfw.c:366:8: error: unused variable ‘outfile’ [-Werror=unused-variable]
mkzcfw.c:364:6: error: unused variable ‘err’ [-Werror=unused-variable]
mkzcfw.c:176:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: motorola-bin: fix compiler warnings/errors
Petr Štetiar [Sat, 20 Jul 2019 12:56:44 +0000 (14:56 +0200)]
firmware-utils: motorola-bin: fix compiler warnings/errors

motorola-bin.c:146:11: error: comparison of integer expressions of different signedness: ‘off_t’ {aka ‘long int’} and ‘long unsigned int’ [-Werror=sign-compare]
motorola-bin.c:173:79: error: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘long int’} and ‘long unsigned int’ [-Werror=sign-compare]
motorola-bin.c:214:57: error: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘long int’} and ‘long unsigned int’ [-Werror=sign-compare]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: nand_ecc: fix compiler warnings/errors
Petr Štetiar [Sat, 20 Jul 2019 12:51:38 +0000 (14:51 +0200)]
firmware-utils: nand_ecc: fix compiler warnings/errors

nand_ecc.c:191:3: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: nec-enc: fix compiler warnings/errors
Petr Štetiar [Sat, 20 Jul 2019 12:50:20 +0000 (14:50 +0200)]
firmware-utils: nec-enc: fix compiler warnings/errors

nec-enc.c:34:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
nec-enc.c:101:21: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: osbridge-crc: fix compiler warnings/errors
Petr Štetiar [Sat, 20 Jul 2019 12:47:46 +0000 (14:47 +0200)]
firmware-utils: osbridge-crc: fix compiler warnings/errors

osbridge-crc.c:61:21: error: unused variable ‘board’ [-Werror=unused-variable]
osbridge-crc.c:167:2: error: label ‘out_flush’ defined but not used [-Werror=unused-label]
osbridge-crc.c:142:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: pc1crypt: fix compiler warnings/errors
Petr Štetiar [Sat, 20 Jul 2019 12:44:54 +0000 (14:44 +0200)]
firmware-utils: pc1crypt: fix compiler warnings/errors

pc1crypt.c:170:12: error: pointer targets in passing argument 1 of ‘strcpy’ differ in signedness [-Werror=pointer-sign]
pc1crypt.c:218:21: error: unused variable ‘board’ [-Werror=unused-variable]
pc1crypt.c:326:26: error: pointer targets in passing argument 2 of ‘pc1_decrypt_buf’ differ in signedness [-Werror=pointer-sign]
pc1crypt.c:328:26: error: pointer targets in passing argument 2 of ‘pc1_encrypt_buf’ differ in signedness [-Werror=pointer-sign]
pc1crypt.c:343:2: error: label ‘out_flush’ defined but not used [-Werror=unused-label]
pc1crypt.c:319:3: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: seama: fix compiler warnings/errors
Petr Štetiar [Sat, 20 Jul 2019 12:33:13 +0000 (14:33 +0200)]
firmware-utils: seama: fix compiler warnings/errors

seama.c:334:16: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
seama.c:352:14: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
seama.c:374:13: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
seama.c:411:16: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
seama.c:438:16: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
seama.c:453:4: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
seama.c:469:4: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
seama.c:473:5: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: spw303v: fix compiler warnings/errors
Petr Štetiar [Sat, 20 Jul 2019 12:27:05 +0000 (14:27 +0200)]
firmware-utils: spw303v: fix compiler warnings/errors

spw303v.c:142:25: error: pointer targets in passing argument 2 of ‘crc32’ differ in signedness [-Werror=pointer-sign]
spw303v.c:221:32: error: pointer targets in passing argument 2 of ‘crc32’ differ in signedness [-Werror=pointer-sign]
spw303v.c:170:14: error: unused variable ‘v2’ [-Werror=unused-variable]
spw303v.c:170:10: error: unused variable ‘v1’ [-Werror=unused-variable]
spw303v.c:170:6: error: unused variable ‘v0’ [-Werror=unused-variable]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: tplink-safeloader: fix compiler warnings/errors
Petr Štetiar [Sat, 20 Jul 2019 12:21:28 +0000 (14:21 +0200)]
firmware-utils: tplink-safeloader: fix compiler warnings/errors

tplink-safeloader.c:1647:5: error: suggest explicit braces to avoid ambiguous ‘else’ [-Werror=dangling-else]
tplink-safeloader.c:2003:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
tplink-safeloader.c:2010:10: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
tplink-safeloader.c:2054:32: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
tplink-safeloader.c:2145:46: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
tplink-safeloader.c:2148:48: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
tplink-safeloader.c:2154:41: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
tplink-safeloader.c:2156:43: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
tplink-safeloader.c:2209:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
tplink-safeloader.c:2225:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
tplink-safeloader.c:2242:48: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
tplink-safeloader.c:2247:13: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
tplink-safeloader.c:2249:43: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
tplink-safeloader.c:2054:6: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
tplink-safeloader.c:2145:7: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
tplink-safeloader.c:2154:7: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: trx: fix compiler warnings/errors
Petr Štetiar [Sat, 20 Jul 2019 12:14:33 +0000 (14:14 +0200)]
firmware-utils: trx: fix compiler warnings/errors

trx.c:137:12: error: this statement may fall through [-Werror=implicit-fallthrough=]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: trx2edips: fix compiler warnings/errors
Petr Štetiar [Sat, 20 Jul 2019 12:09:22 +0000 (14:09 +0200)]
firmware-utils: trx2edips: fix compiler warnings/errors

trx2edips.c:114:9: error: unused variable ‘res’ [-Werror=unused-variable]
trx2edips.c:142:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: wrt400n: fix compiler warnings/errors
Petr Štetiar [Sat, 20 Jul 2019 12:03:10 +0000 (14:03 +0200)]
firmware-utils: wrt400n: fix compiler warnings/errors

wrt400n.c:97:16: error: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Werror=sign-compare]
wrt400n.c:209:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
wrt400n.c:234:16: error: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
wrt400n.c:312:2: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: xorimage: fix compiler warnings/errors
Petr Štetiar [Sat, 20 Jul 2019 11:52:44 +0000 (13:52 +0200)]
firmware-utils: xorimage: fix compiler warnings/errors

xorimage.c:113:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare]
xorimage.c:142:21: error: pointer targets in passing argument 1 of ‘xor_data’ differ in signedness [-Werror=pointer-sign]
xorimage.c:142:29: error: pointer targets in passing argument 3 of ‘xor_data’ differ in signedness [-Werror=pointer-sign]
xorimage.c:145:21: error: pointer targets in passing argument 1 of ‘xor_data’ differ in signedness [-Werror=pointer-sign]
xorimage.c:145:29: error: pointer targets in passing argument 3 of ‘xor_data’ differ in signedness [-Werror=pointer-sign]
xorimage.c:64:14: error: unused variable ‘v2’ [-Werror=unused-variable]
xorimage.c:64:10: error: unused variable ‘v1’ [-Werror=unused-variable]
xorimage.c:64:6: error: unused variable ‘v0’ [-Werror=unused-variable]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: zyimage: fix compiler warnings/errors
Petr Štetiar [Sat, 20 Jul 2019 11:45:45 +0000 (13:45 +0200)]
firmware-utils: zyimage: fix compiler warnings/errors

zyimage.c:10: error: "_POSIX_SOURCE" redefined [-Werror]
zyimage.c:11: error: "_POSIX_C_SOURCE" redefined [-Werror]
zyimage.c:132:5: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoWIP: LOCAL: firmware-utils: reverse the build order
Petr Štetiar [Sat, 20 Jul 2019 11:32:02 +0000 (13:32 +0200)]
WIP: LOCAL: firmware-utils: reverse the build order

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: sort the build order alphabetically
Petr Štetiar [Sat, 20 Jul 2019 11:24:36 +0000 (13:24 +0200)]
firmware-utils: sort the build order alphabetically

Making it more pleasing for the reviewer's eyes.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agobuild: rules.mk: allow overriding of HOSTCC and HOSTCXX
Petr Štetiar [Sat, 20 Jul 2019 10:34:02 +0000 (12:34 +0200)]
build: rules.mk: allow overriding of HOSTCC and HOSTCXX

Currently it's not possible to change the host compiler version during
devlopment/test/fixing and one has to always hand edit rules.mk which is
tiresome, so let's allow changing of those variables from make/env vars.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: unify some of the C flags for all utils
Petr Štetiar [Sat, 20 Jul 2019 10:32:03 +0000 (12:32 +0200)]
firmware-utils: unify some of the C flags for all utils

Enable -Wextra -Werror in order to catch and fix potential errors during
compilation.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agotools: libressl: fix compilation for non-glibc clib (FS#2400)
Hans Dedecker [Tue, 23 Jul 2019 12:47:56 +0000 (14:47 +0200)]
tools: libressl: fix compilation for non-glibc clib (FS#2400)

Fixes compilaton issue for non glibc clibs :

libtool: compile:  gcc -DPACKAGE_NAME=\"libressl\" -DPACKAGE_TARNAME=\"libressl\" -DPACKAGE_VERSION=\"2.9.2\" "-DPACKAGE_STRING=\"libressl 2.9.2\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libressl\" -DVERSION=\"2.9.2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_SYMLINK=1 -DHAVE_ERR_H=1 -DHAVE_ASPRINTF=1 -DHAVE_MEMMEM=1 -DHAVE_STRLCAT=1 -DHAVE_STRLCPY=1 -DHAVE_STRNDUP=1 -DHAVE_STRNLEN=1 -DHAVE_STRSEP=1 -DHAVE_TIMEGM=1 -DHAVE_SYSLOG=1 -DHAVE_ACCEPT4=1 -DHAVE_PIPE2=1 -DHAVE_POLL=1 -DHAVE_SOCKETPAIR=1 -DHAVE_EXPLICIT_BZERO=1 -DHAVE_GETAUXVAL=1 -DHAVE_GETAUXVAL=1 -DHAVE_DL_ITERATE_PHDR=1 -DHAVE_CLOCK_GETTIME=1 -DHAVE_VA_COPY=1 -DHAS_GNU_WARNING_LONG=1 -DSIZEOF_TIME_T=8 -I. -I../include -I../include/compat -DLIBRESSL_INTERNAL -D__BEGIN_HIDDEN_DECLS= -D__END_HIDDEN_DECLS= -I../crypto/asn1 -I../crypto/bn -I../crypto/ec -I../crypto/ecdsa -I../crypto/evp -I../crypto/modes -I../crypto -I/builds/pantacor/pv-platforms/openwrt-base/openwrt/staging_dir/host/include -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE -D__STRICT_ALIGNMENT -O2 -I/builds/pantacor/pv-platforms/openwrt-base/openwrt/staging_dir/host/include -fpic -Wall -std=gnu99 -fno-strict-aliasing -fno-strict-overflow -D_FORTIFY_SOURCE=2 -fstack-protector-strong -DHAVE_GNU_STACK -Wno-pointer-sign -MT compat/getprogname_linux.lo -MD -MP -MF compat/.deps/getprogname_linux.Tpo -c compat/getprogname_linux.c -o compat/getprogname_linux.o
compat/getprogname_linux.c: In function 'getprogname':
compat/getprogname_linux.c:32:2: error: #error "Cannot emulate getprogname"
 #error "Cannot emulate getprogname"
  ^~~~~

Reported-by: Anibal Portero <anibal.portero@pantacor.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
4 years agoramips: enable Newifi D1 SD slot
DENG Qingfang [Mon, 22 Jul 2019 17:05:20 +0000 (01:05 +0800)]
ramips: enable Newifi D1 SD slot

Newifi D1 is shipped with an 8GB microSD card in its SD slot
Without SD driver users would not be able to use it unless manually installed

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
4 years agonetifd: update to latest git HEAD
Hans Dedecker [Mon, 22 Jul 2019 19:46:31 +0000 (21:46 +0200)]
netifd: update to latest git HEAD

899f168 system-linux: Coverity fixes

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
4 years agotools: libressl: fix build on MacOS
Kevin Darbyshire-Bryant [Mon, 22 Jul 2019 13:38:54 +0000 (14:38 +0100)]
tools: libressl: fix build on MacOS

Making all in tests
depbase=`echo handshake_table.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DPACKAGE_NAME=\"libressl\" -DPACKAGE_TARNAME=\"libressl\" -DPACKAGE_VERSION=\"2.9.2\" -DPACKAGE_STRING=\"libressl\ 2.9.2\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libressl\" -DVERSION=\"2.9.2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_SYMLINK=1 -DHAVE_ERR_H=1 -DHAVE_READPASSPHRASE_H=1 -DHAVE_ASPRINTF=1 -DHAVE_MEMMEM=1 -DHAVE_READPASSPHRASE=1 -DHAVE_STRLCAT=1 -DHAVE_STRLCPY=1 -DHAVE_STRNDUP=1 -DHAVE_STRNLEN=1 -DHAVE_STRSEP=1 -DHAVE_TIMEGM=1 -DHAVE_GETPROGNAME=1 -DHAVE_SYSLOG=1 -DHAVE_POLL=1 -DHAVE_SOCKETPAIR=1 -DHAVE_ARC4RANDOM=1 -DHAVE_ARC4RANDOM_BUF=1 -DHAVE_ARC4RANDOM_UNIFORM=1 -DHAVE_TIMINGSAFE_BCMP=1 -DHAVE_CLOCK_GETTIME=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DSIZEOF_TIME_T=8 -I.  -I../include -I../include/compat -DLIBRESSL_INTERNAL -D__BEGIN_HIDDEN_DECLS= -D__END_HIDDEN_DECLS= -I ../crypto/modes -I ../crypto/asn1 -I ../ssl -I ../tls -I ../apps/openssl -I ../apps/openssl/compat -D_PATH_SSL_CA_FILE=\"../apps/openssl/cert.pem\" -I/Users/kevin/wrt/staging_dir/host/include  -D__STRICT_ALIGNMENT  -O2 -I/Users/kevin/wrt/staging_dir/host/include  -fpic -Wall -std=gnu99 -fno-strict-aliasing  -fno-strict-overflow -D_FORTIFY_SOURCE=2 -fstack-protector-strong  -Qunused-arguments -Wno-pointer-sign -MT handshake_table.o -MD -MP -MF $depbase.Tpo -c -o handshake_table.o handshake_table.c &&\
mv -f $depbase.Tpo $depbase.Po
make[4]: *** No rule to make target `/Users/kevin/wrt/build_dir/host/libressl-2.9.2/crypto/.libs/libcrypto_la-cpuid-macosx-x86_64.o', needed by `handshake_table'.  Stop.
make[3]: *** [all-recursive] Error 1

A similar error & clues from
https://gitlab.com/ymorin/buildroot/commit/e783d60473944f8b39f1def45d8d6b483a062158

"
LibreSSL 2.9.1 now has a test that requires libtls.a, however, when building a
shared library only build, the --disable-static flag is passed to libressl,
which prevents the building of libtls.a.

With libtls.a not being built, the following error occurs:
libressl-2.9.1/tls/.libs/libtls.a', needed by 'handshake_table'.  Stop.

There are three options to fix this:
1) Stick with autotools, and provide a patch that removes building anything in
   the tests folder.
2) Pass --enable-static to LIBRESSL_CONF_OPTS
3) Change the package type to cmake, as a cmake build does not have this issue."

It appears we cannot change to cmake because cmake has a dependency on
an ssl library.

Take option 1 and do not build the tests.

Also take the opportunity to remove man page building as well.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years agobase-files: drop support for the platform_nand_pre_upgrade()
Rafał Miłecki [Wed, 17 Jul 2019 09:32:55 +0000 (11:32 +0200)]
base-files: drop support for the platform_nand_pre_upgrade()

No target uses it anymore. All code from that callback was moved into
the platform_do_upgrade().

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agotreewide: sysupgrade: get rid of platform_nand_pre_upgrade()
Rafał Miłecki [Wed, 17 Jul 2019 09:32:54 +0000 (11:32 +0200)]
treewide: sysupgrade: get rid of platform_nand_pre_upgrade()

1) nand_do_upgrade() is always called by a target code
2) nand_do_upgrade() starts with calling platform_nand_pre_upgrade()

It means there is no need for the platform_nand_pre_upgrade() callback
at all. All code that was present there could bo moved & simplly called
by a target right before the nand_do_upgrade().

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agolayerscape: sysupgrade: get rid of platform_pre_upgrade()
Rafał Miłecki [Wed, 17 Jul 2019 06:02:05 +0000 (08:02 +0200)]
layerscape: sysupgrade: get rid of platform_pre_upgrade()

1) RAMFS_COPY_BIN and RAMFS_COPY_DATA can be defined at top of the file
   like it's done for all other targets.
2) fw_printenv.lock can be created one step later in the
   platform_do_upgrade(). It seems to be working well on many other
   targets.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agocurl: update to 7.65.3
Hans Dedecker [Sun, 21 Jul 2019 21:25:15 +0000 (23:25 +0200)]
curl: update to 7.65.3

For changes in 7.65.3; see https://curl.haxx.se/changes.html#7_65_3

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
4 years agomac80211: brcm: backport first set of 5.4 brcmfmac changes
Rafał Miłecki [Sun, 21 Jul 2019 09:23:32 +0000 (11:23 +0200)]
mac80211: brcm: backport first set of 5.4 brcmfmac changes

This doesn't include 9ff8614a3dbe ("brcmfmac: use separate Kconfig file
for brcmfmac") due to a few conflicts with backports changes.

An important change is:
[PATCH 2/7] brcmfmac: change the order of things in brcmf_detach()
which fixes a rmmod crash in the brcmf_txfinalize().

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agotools: libressl: update to 2.9.2 version
Roman Yeryomin [Thu, 18 Jul 2019 16:35:50 +0000 (19:35 +0300)]
tools: libressl: update to 2.9.2 version

To keep in sync with OpenSSL 1.1.x branch version options.

Signed-off-by: Roman Yeryomin <roman@advem.lv>
4 years agofirmware-utils: mkfwimage: fix build failure on macOS with gcc 9
Petr Štetiar [Fri, 19 Jul 2019 21:04:23 +0000 (23:04 +0200)]
firmware-utils: mkfwimage: fix build failure on macOS with gcc 9

Fixes following errors:

 src/mkfwimage.c:279:8: error: format specifies type 'long' but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat]
                      d->stats.st_size,
                     ^~~~~~~~~~~~~~~~
 src/mkfwimage.c:280:8: error: format specifies type 'long' but the argument has type 'long long' [-Werror,-Wformat]
                      d->partition_length - d->stats.st_size);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 src/mkfwimage.c:378:6: error: format specifies type 'unsigned long' but the argument has type 'long long' [-Werror,-Wformat]
                      d->stats.st_size - d->partition_length);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reported-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkfwimage: fix more errors reported by gcc-6/7/9
Petr Štetiar [Fri, 19 Jul 2019 19:34:16 +0000 (21:34 +0200)]
firmware-utils: mkfwimage: fix more errors reported by gcc-6/7/9

src/mkfwimage.c:276:8: error: format '%lld' expects argument of type 'long long int', but argument 4 has type '__off_t' {aka 'const long int'} [-Werror=format=]
src/fw.h:71:36: error: format '%llu' expects argument of type 'long long unsigned int', but argument 6 has type '__off_t' {aka 'long int'} [-Werror=format=]
    inlined from 'main' at src/mkfwimage.c:543:12:
/string_fortified.h:106:10: error: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Werror=stringop-truncation]
    inlined from 'write_part' at src/mkfwimage.c:235:2,
string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation]
    inlined from 'main' at src/mkfwimage.c:477:5:
string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 256 equals destination size [-Werror=stringop-truncation]
    inlined from 'main' at src/mkfwimage.c:496:5:
string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 4096 equals destination size [-Werror=stringop-truncation]
    inlined from 'main' at src/mkfwimage.c:481:5:
string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 4096 equals destination size [-Werror=stringop-truncation]
    inlined from 'main' at src/mkfwimage.c:485:5:
string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation]

Runtested on ath79 and UBNT Bullet M XW.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkfwimage: fix more errors
Kevin Darbyshire-Bryant [Fri, 19 Jul 2019 15:54:17 +0000 (16:54 +0100)]
firmware-utils: mkfwimage: fix more errors

Fix 4 errors reported by gcc 9

3 mismatched format type errors
1 unused variable error

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
4 years agofirmware-utils: mkfwimage: provide human readable error
Petr Štetiar [Fri, 19 Jul 2019 13:52:46 +0000 (15:52 +0200)]
firmware-utils: mkfwimage: provide human readable error

While looking at the ath25 build breakage of 19.07 images today I've
encountered following error:

 mkfwimage -B XS5 -v [...] ath25-ubnt5-squashfs-sysupgrade.bin.new
 ERROR: Failed creating firmware layout description - error code: -2

Which is barely human readable and needs poking into the source code, so
this patch makes the error more verbose and usable by mere mortals.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agofirmware-utils: mkfwimage: enable extra compiler checks and fix them
Petr Štetiar [Fri, 19 Jul 2019 14:10:35 +0000 (16:10 +0200)]
firmware-utils: mkfwimage: enable extra compiler checks and fix them

Let's enforce additional automatic checks enforced by the compiler in
order to catch possible errors during compilation.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoath10k-ct: Revert back to version 4.19
Hauke Mehrtens [Sun, 7 Jul 2019 17:07:40 +0000 (19:07 +0200)]
ath10k-ct: Revert back to version 4.19

Version 5.2 shows a error when registering the devive for me.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years agoath10k-ct: switch to version 5.2
Hauke Mehrtens [Sun, 7 Jul 2019 11:48:20 +0000 (13:48 +0200)]
ath10k-ct: switch to version 5.2

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years agoath10k-ct: remove patches for old versions
Hauke Mehrtens [Sun, 7 Jul 2019 11:38:37 +0000 (13:38 +0200)]
ath10k-ct: remove patches for old versions

the ath10k-ct package ships multiple versions of the ath10k-ct driver,
OpenWrt currently only uses the version 4.19, but we still ship some
patches for older versions. Remove all patches only touching older
versions and also remove the patch for older versions from patches which
do the same changes to multiple versions of ath10k-ct.

This removes some unneeded patches, the end binary should stay the same.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years agoath10k-ct: update to version 2019-06-13
Hauke Mehrtens [Sun, 7 Jul 2019 11:30:03 +0000 (13:30 +0200)]
ath10k-ct: update to version 2019-06-13

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years agomac80211: Update to version 5.2-rc7
Hauke Mehrtens [Sat, 6 Jul 2019 22:08:20 +0000 (00:08 +0200)]
mac80211: Update to version 5.2-rc7

This updates mac80211 to version 5.2-rc7, this contains all the changes
to the wireless subsystem up to Linux 5.2-rc7.

* The removed patches are applied upstream
* b43 now uses kmod-lib-cordic
* Update the nl80211.h file in iw to match backports version.
* Remove the two backports from kernel 4.9, they were needed for mt76,
  but that can use the version from backports now, otherwise they
  collide and cause compile errors.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years agoath79: modify device name of I-O DATA WN-AC1600DGR2
INAGAKI Hiroshi [Sun, 16 Jun 2019 16:23:32 +0000 (01:23 +0900)]
ath79: modify device name of I-O DATA WN-AC1600DGR2

The hardware of I-O DATA WN-AC1600DGR3 has completely compatibility
with WN-AC1600DGR2, so modify the device name of WN-AC1600DGR2 to show
the images for DGR2 also support DGR3.

Specification of WN-AC1600DGR3:

- SoC        : Qualcomm Atheros QCA9557
- RAM        : DDR2 128 MiB
- Flash      : SPI-NOR 16 MiB
- WLAN       : 2.4/5 GHz
  - 2.4 GHz  : QCA9557 (SoC), 2T2R
  - 5 Ghz    : QCA9880, 3T3R
- Ethernet   : 5x 10/100/1000 Mbps
  - Switch   : QCA8337N
- LEDs/Input : 6x/6x (4x buttons, 1x slide-switch)
- UART       : through-hole on PCB
  - J1: Vcc, GND, TX, RX from ethernet port side
  - 115200n8

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
4 years agoath79: Add support for TP-Link Archer C60 v2
Adrian Schmutzler [Sun, 5 May 2019 16:46:09 +0000 (18:46 +0200)]
ath79: Add support for TP-Link Archer C60 v2

TP-Link Archer C60 v2 is a dual-band AC1350 router,
based on Qualcomm/Atheros QCA9561 + QCA9886.

Specification:

- 775/650/258 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 2T2R 5 GHz
- 5x 10/100 Mbps Ethernet
- 7x LED, 2x button
- UART header on PCB

Flash instruction (WebUI):
Download *-factory.bin image and upload it via the firmwary upgrade
function of the stock firmware WebUI.

Flash instruction (TFTP):
1. Set PC to fixed IP address 192.168.0.66
2. Download *-factory.bin image and rename it to tp_recovery.bin
3. Start a tftp server with the file tp_recovery.bin in its root
   directory
4. Turn off the router
5. Press and hold reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time the firmware should
   be transferred from the tftp server
8. Wait ~30 second to complete recovery

Flash instruction (under U-Boot, using UART):
tftp 0x81000000 ...-sysupgrade.bin
erase 0x9f030000 +$filesize
cp.b $fileaddr 0x9f030000 $filesize
reset

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: Add support for TP-Link Archer C60 v1
Adrian Schmutzler [Sun, 5 May 2019 16:36:43 +0000 (18:36 +0200)]
ath79: Add support for TP-Link Archer C60 v1

TP-Link Archer C60v1 is a dual-band AC1350 router,
based on Qualcomm/Atheros QCA9561+QCA9886.

Specification:

- 775/650/258 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 2T2R 5 GHz
- 5x 10/100 Mbps Ethernet
- 7x LED, 2x button
- UART header on PCB

Flash instruction (WebUI):
Download *-factory.bin image and upload it via the firmwary upgrade
function of the stock firmware WebUI.

Flash instruction (TFTP):
1. Set PC to fixed ip address 192.168.0.66
2. Download *-factory.bin image and rename it to tp_recovery.bin
3. Start a tftp server with the file tp_recovery.bin in its root directory
4. Turn off the router
5. Press and hold Reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time
the firmware should be transferred from the tftp server
8. Wait ~30 second to complete recovery.

Flash instruction under U-Boot, using UART:
1. tftp 0x81000000 ...-sysupgrade.bin
2. erase 0x9f020000 +$filesize
3. cp.b $fileaddr 0x9f020000 $filesize
4. reset

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: add support for TP-Link CPE510-v2/v3
Andrew Cameron [Wed, 26 Jun 2019 21:40:54 +0000 (16:40 -0500)]
ath79: add support for TP-Link CPE510-v2/v3

TP-Link CPE510-v2/v3 is an outdoor wireless CPE for 5 GHz with
one Ethernet port based on Atheros AR9344

Specifications:
 - Based on the same underlying hardware as the TP-Link CPE510
 - Power, LAN, and 4 green LEDs
 - 1 10/100Mbps Shielded Ethernet Port (Passive PoE in)
 - Built-in 13dBi 2x2 dual-polarized directional MIMO antenna
 - Adjustable transmission power from 0 to 23dBm/200mw

Flashing instructions:
 Flash factory image through stock firmware WEB UI
 or through TFTP
 To get to TFTP recovery just hold reset button while powering on for
 around 4-5 seconds and release.
 Rename factory image to recovery.bin
 Stock TFTP server IP:192.168.0.100
 Stock device TFTP adress:192.168.0.254

Signed-off-by: Andrew Cameron <apcameron@softhome.net>
[whitespace fixes]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoath79: add support for Trendnet TEW-823DRU
Pramod Pancha [Fri, 5 Jul 2019 17:45:19 +0000 (13:45 -0400)]
ath79: add support for Trendnet TEW-823DRU

Trendnet TEW-823DRU is a dual-band AC1750 router.
The router is based on Qualcomm/Atheros QCA9558 + QCA9880.

Specification:

720 MHz CPU
256 MB of RAM
16 MB of FLASH
3T3R 2.4 GHz
3T3R 5 GHz
5x 10/100/1000 Mbps Ethernet

Firmware can be flashed from the web interface. Tested on 3 routers
with no issues.

Signed-off-by: Pramod Pancha <pancha@vill.com>
[whitespace fixes]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoath79: add support for TP-Link RE355 v1 and RE450 v1
Christoph Krapp [Tue, 16 Jul 2019 18:47:49 +0000 (20:47 +0200)]
ath79: add support for TP-Link RE355 v1 and RE450 v1

Specification:

SoC: Qualcomm Atheros QCA9558
RAM: 64/128MiB
Flash: 8MiB SPI-NOR
Wifi:
  - 2.4GHz: 3T3R (QCA9558)
  - 5GHz: 3T3R (QCA9880)
LAN: 1x 10/100/1000 Mbps
UART:
  - TP1: Tx
  - TP2: Rx
  - TP3: Gnd
  - TP4: 3v3

Flash instructions:
Flash factory image through stock firmware WEB UI.

Signed-off-by: Christoph Krapp <achterin@googlemail.com>
4 years agoramips: add support for TP-Link RE650 v1
Georgi Vlaev [Wed, 17 Apr 2019 18:17:45 +0000 (21:17 +0300)]
ramips: add support for TP-Link RE650 v1

TP-Link RE650 v1 is a dual-band AC2600 range extender,
based on MediaTek MT7621A and MT7615E. According to the
wikidevi entry for RE650 this device is identical with
TP-Link RE500 as hardware. This patch supports only RE650.

Hardware specification:

- SoC 880 MHz - MediaTek MT7621AT
- 128 MB of DDR3 RAM
- 16 MB - Winbond 25Q128FVSG
- 4T4R 2.4 GHz - MediaTek MT7615E
- 4T4R 5 GHz - MediaTek MT7615E
- 1x 1 Gbps Ethernet - MT7621AT integrated
- 7x LEDs (Power, 2G, 5G, WPS(x2), Lan(x2))
- 4x buttons (Reset, Power, WPS, LED)
- UART header (J1) - 2:GND, 3:RX, 4:TX
  Serial console @ 57600,8n1

Flash instructions:

Upload
openwrt-ramips-mt7621-tplink_re650-v1-squashfs-factory.bin
from the RE650 web interface.

TFTP recovery to stock firmware:

Unfortunately, I can't find an easy way to recover the RE
without opening the device and using modified binaries. The
TFTP upload will only work if selected from u-boot, which
means you have to open the device and attach to the serial
console. The TFTP update procedure does *not* accept the
published vendor firmware binaries. However, it allows to
flash kernel + rootfs binaries, and this works if you have
a backup of the original contents of the flash. It's probably
possible to create special image out of the vendor binaries
and use that as recovery image.

Signed-off-by: Georgi Vlaev <georgi.vlaev@gmail.com>
[re-added variables for kernel header]
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agomtd: cleanup unused code and variables in fis.c
Petr Štetiar [Wed, 17 Jul 2019 21:04:22 +0000 (23:04 +0200)]
mtd: cleanup unused code and variables in fis.c

While compile checking mtd changes in PR#1359 I've noticed following
compiler warnings and cleaned them up:

 fis.c: In function 'fis_remap':
 fis.c:143:25: warning: variable 'redboot' set but not used [-Wunused-but-set-variable]
   struct fis_image_desc *redboot = NULL;
                         ^~~~~~~
 fis.c:142:25: warning: variable 'fisdir' set but not used [-Wunused-but-set-variable]
   struct fis_image_desc *fisdir = NULL;
                         ^~~~~~

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoath79: add support for Bluesocket BSAP1880 board
Daniel Gimpelevich [Sat, 1 Sep 2018 02:28:35 +0000 (19:28 -0700)]
ath79: add support for Bluesocket BSAP1880 board

This board was used in dual-band 802.11n enterprise access points, models
BSAP-1800v2 and BSAP-1840, introduced in 2010 by Bluesocket, which was
acquired by Adtran in 2011, who has now EOL'ed them. They differed only in
that the BSAP-1840's antennae were detachable, while the BSAP-1800v2's were
inside the case. They have an external RJ-45 console port, which works with
standard Cisco 72-3383-01 console cables.

Specification:
- System-On-Chip: AR7161
- CPU/Speed: 600 MHz
- Flash-Chip: Macronix MX25L12845E
- Flash size: 16 MiB
- RAM: 64 MiB
- Wireless No1: Lite-On WN2601A card: AR9160/AR9103 2.4GHz 802.11bgn
- Wireless No2: Lite-On WN2502A card: AR9160/AR9106 5GHz 802.11an
- PHY: Vitesse VSC8601, Rev. B

Installation:
1. Connect to the serial console using a terminal that supports YMODEM at
   115200 bps, 8 data bits, no parity, 1 stop bit
2. Interrupt the bootloader using its password, which is: r00t
3. Issue the "fis init" command, confirming if prompted
4. Look at the length of the openwrt-ath79-generic-*-squashfs-kernel.bin
   file, and substitute it below, instead of where I have "LeNgTh"
5. Issue the following command, and upload this file using YMODEM protocol
   load -r -v -b 0x80060000 -m ymodem
6. Issue the following commands, substituting as mentioned above:
   fis create -b 0x80060000 -l LeNgTh vmlinux_2
   load -r -v -b 0x80100000 -m ymodem
7. Using YMODEM, upload openwrt-ath79-generic-*-squashfs-rootfs.bin
8. Issue the "fis free" command, and for the first range in its response,
   use a hexadecimal calculator to subtract the start from the end in order
   to substitute it below, with the leading "0x" to specify it in
   hexadecimal, instead of where I have "LeNgTh"
9. Issue the following commands, substituting as mentioned above:
   fis create -b 0x80100000 -l LeNgTh -e 0 -r 0 rootfs
   reset
10.Wait for the status LED to go solid green

Tested-by: Brian Gonyer <bgonyer@gmail.com>
Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
[fixed obsolete $ARGV in platform_do_upgrade]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoath79: widen RedBoot directory search and add PHY
Daniel Gimpelevich [Wed, 26 Jun 2019 19:56:47 +0000 (12:56 -0700)]
ath79: widen RedBoot directory search and add PHY

The Bluesocket BSAP1880 board has a Vitesse PHY, for which the driver was
not being included, and its RedBoot directory block is earlier in the
flash than the search was allowing. This commit prepares for supporting it.

Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
4 years agoath79: support "rgmii-id" PHY mode in ag71xx
Daniel Gimpelevich [Wed, 26 Jun 2019 19:39:37 +0000 (12:39 -0700)]
ath79: support "rgmii-id" PHY mode in ag71xx

The ag71xx code did not include a case for the "rgmii-id" PHY mode in the
code. There are devices that need this mode, so I'm adding it.

Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
4 years agomtd: add CRC signature to RedBoot partition map
Daniel Gimpelevich [Sat, 1 Sep 2018 01:14:24 +0000 (18:14 -0700)]
mtd: add CRC signature to RedBoot partition map

The code for calculating the CRC32 signatures for RedBoot FIS partitions
was already included, but for unknown reasons, it was never invoked. Some
bootloaders enforce checking these for loaded kernels, so they should be
written. This patch does so.

Tested-by: Brian Gonyer <bgonyer@gmail.com>
Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
4 years agoopenvpn: add new list option tls_ciphersuites
Martin Schiller [Tue, 28 May 2019 10:50:15 +0000 (12:50 +0200)]
openvpn: add new list option tls_ciphersuites

To configure the list of allowable TLS 1.3 ciphersuites, the option
tls_ciphersuites is used instead of tls_ciphers.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
4 years agobrcm47xx: fix 831-old_gpio_wdt.patch for linux 4.19
Zachary Cook [Thu, 11 Jul 2019 20:09:15 +0000 (16:09 -0400)]
brcm47xx: fix 831-old_gpio_wdt.patch for linux 4.19

Fix the following compilation error when using linux 4.19 on brcm47xx:
drivers/watchdog/old_gpio_wdt.c:236:2: error: implicit declaration of function 'setup_timer'

setup_timer was removed and replaced by timer_setup in linux >=4.15:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=513ae785

Update the patch to use the timer_setup interface

Signed-off-by: Zachary Cook <zachcook1991@gmail.com>
4 years agoath79: ar9330: add missing watchdog node
Petr Štetiar [Wed, 17 Jul 2019 13:19:54 +0000 (15:19 +0200)]
ath79: ar9330: add missing watchdog node

It was reported in FS#2385, that Carambola2 doesn't currently have
working watchdog so fix it by adding watchdog node.

Ref: FS#2385
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoramips: add MT7615 wireless support for ELECOM WRC-1167GHBK2-S
INAGAKI Hiroshi [Thu, 27 Jun 2019 03:27:27 +0000 (12:27 +0900)]
ramips: add MT7615 wireless support for ELECOM WRC-1167GHBK2-S

ELECOM WRC-1167GHBK2-S has a MediaTek MT7615D chip for 2.4/5 GHz
wireless.

A driver package for MT7615 chip is added to OpenWrt in
a0e5ca4f3523b9eef96bff32e45f6fa8275b982f,
so add preliminary MT7615 chip support for WRC-1167GHBK2-S.

Note: Currently, DBDC mode for MT7615 is not supported in mt76 driver.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
4 years agoperf: simplify the build process
Petr Štetiar [Tue, 16 Jul 2019 19:43:08 +0000 (21:43 +0200)]
perf: simplify the build process

Redirect the build output to PKG_BUILD_DIR instead of copying over
complete source code.

Build tested on following targets:

 x86/64 ar7/generic ipq40xx/generic imx6/generic ar71xx/generic
 ramips/mt7621 ramips/mt7620 sunxi/cortexa7

Run tested on imx6/apalis.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agokernel: generic: fix perf build breakage on 4.19
Petr Štetiar [Tue, 16 Jul 2019 19:46:49 +0000 (21:46 +0200)]
kernel: generic: fix perf build breakage on 4.19

Drop 211-host_tools_portability.patch which is breaking perf build on
4.19 kernels by removing the include directory from the host's CFLAGS
leading to the following build breakage:

 pmu-events/jevents.c:48:10: fatal error: linux/list.h: No such file or directory
  #include <linux/list.h>
           ^~~~~~~~~~~~~~

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoimx6: apalis: add missing jffs2reset to ramfs during sysupgrade
Petr Štetiar [Tue, 16 Jul 2019 20:06:40 +0000 (22:06 +0200)]
imx6: apalis: add missing jffs2reset to ramfs during sysupgrade

jffs2reset is used to cleanup the rootfs_data overlay, but it's
currently missing in the ramfs during sysupgrade leading to the
following error:

 Switching to ramdisk...
 Performing system upgrade...
 /lib/upgrade/do_stage2: line 27: jffs2reset: not found

Fixes: 2f1a11d0089c ("imx6: apalis: fix config survival after sysupgrade -n")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoimx6: apalis: fix sysupgrade paths
Petr Štetiar [Tue, 16 Jul 2019 08:23:18 +0000 (10:23 +0200)]
imx6: apalis: fix sysupgrade paths

We can't use $board_name in sysupgrade paths for kernel and rootfs as we
currently generate one image which could be used on two different base
boards.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agox86: add modern network modules to Generic target
Alberto Bursi [Sun, 14 Jul 2019 01:11:00 +0000 (03:11 +0200)]
x86: add modern network modules to Generic target

Many Atom-based embedded/industrial x86 boards can't run 64bit operating
systems due to either processor or board firmware limitations, but they
have modern interfaces (PCIe) or have modern Intel gigabit controllers
onboard.  With the current default package selection for x86 Generic
target their network won't work.

Add the modern gigabit network modules needed or most likely going to be
used as add-in cards, similar to what is the list on x86_64 target.

Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
[fixed whitespace issue]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agomt76: update to the latest version
Felix Fietkau [Wed, 17 Jul 2019 07:36:33 +0000 (09:36 +0200)]
mt76: update to the latest version

3d7f738 mt76: mt7615: add missing register initialization

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years agomac80211: add config tweak for tx bursting when using VHT
Felix Fietkau [Wed, 19 Jun 2019 10:32:20 +0000 (12:32 +0200)]
mac80211: add config tweak for tx bursting when using VHT

By default, set BE tx queue TXOP limit to 1.0 in the hostapd config
Many vendor drivers are doing similar things to boost throughput.
On MT7612 under ideal conditions, it improves tx throughput from 470 Mbit/s
to about 570 Mbit/s.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years agobase-files: don't set ARGV and ARGC
Rafał Miłecki [Sun, 14 Jul 2019 17:00:00 +0000 (19:00 +0200)]
base-files: don't set ARGV and ARGC

Those are not used by any image check function anymore.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agomvebu: sysupgrade: don't use $ARGV in platform_check_image()
Rafał Miłecki [Sun, 14 Jul 2019 16:59:59 +0000 (18:59 +0200)]
mvebu: sysupgrade: don't use $ARGV in platform_check_image()

sysupgrade passes image path to platform_check_image() as an argument so
it can be simply accessed using $1

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agotreewide: sysupgrade: don't use $ARGV in platform_do_upgrade()
Rafał Miłecki [Sun, 14 Jul 2019 17:03:19 +0000 (19:03 +0200)]
treewide: sysupgrade: don't use $ARGV in platform_do_upgrade()

stage2 passes image path to platform_do_upgrade() as an argument so it
can be simply accessed using $1

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agoramips: get rid of platform_pre_upgrade()
Rafał Miłecki [Fri, 12 Jul 2019 12:05:49 +0000 (14:05 +0200)]
ramips: get rid of platform_pre_upgrade()

The only step between platform_pre_upgrade() and platform_do_upgrade()
is switching to ramdisk. It should be fine to "mtd erase firmware" from
the later callback and get rid of the first one.

This change wasn't tested on affected target but identical code logic
was verified to work as expected on brcm47xx with initramfs firmware.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agoar71xx: get rid of platform_pre_upgrade()
Rafał Miłecki [Fri, 12 Jul 2019 12:05:47 +0000 (14:05 +0200)]
ar71xx: get rid of platform_pre_upgrade()

The only step between platform_pre_upgrade() and platform_do_upgrade()
is switching to ramdisk. It should be fine to "mtd erase firmware" from
the later callback and get rid of the first one.

This change wasn't tested on affected target but identical code logic
was verified to work as expected on brcm47xx with initramfs firmware.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agoar71xx: enable SGMII fixup on Mikrotik wAP AC
Etienne Champetier [Sun, 14 Jul 2019 02:43:28 +0000 (19:43 -0700)]
ar71xx: enable SGMII fixup on Mikrotik wAP AC

fixes intermittent loss of connectivity on 1Gbit port, with log message:
> 803x_aneg_done: SGMII link is not ok

Thanks to David Bauer for pointing me in the right direction.
I just had to figure out the right bus_id, which you find in this log:
> ag71xx ag71xx.1: connected to PHY at gpio-1:00 [uid=004dd074,
  driver=Atheros 8031 ethernet]

Fixes FS#2236

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
[Wrapped commit message - Fixed whitespace erors]
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agoath79: add seama header fixup for Qihoo C301
Chuanhong Guo [Tue, 16 Jul 2019 11:38:27 +0000 (19:38 +0800)]
ath79: add seama header fixup for Qihoo C301

This script is copied from ar71xx. Without a header fixup, u-boot
checksum for kernel will fail after the first boot.

Fixes: a9360452f0 ("ath79: add support for Qihoo C301")
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agopackage: mtd: add fixseama command for ath79
Chuanhong Guo [Tue, 16 Jul 2019 11:35:12 +0000 (19:35 +0800)]
package: mtd: add fixseama command for ath79

This is needed by Qihoo C301.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agoorion: sysupgrade: change platform_check_image() args validation
Rafał Miłecki [Sun, 14 Jul 2019 20:11:40 +0000 (22:11 +0200)]
orion: sysupgrade: change platform_check_image() args validation

sysupgrade passes image to check as argument so use $# instead of $ARGC.
It also fits this function better as it checks $1 and not $ARGV.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agomvebu: sysupgrade: drop platform_copy_config_sdcard() argument
Rafał Miłecki [Sun, 14 Jul 2019 20:08:58 +0000 (22:08 +0200)]
mvebu: sysupgrade: drop platform_copy_config_sdcard() argument

That function doesn't take any arguments so don't pass anything when
calling it.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agoramips: Remove left-over mistyped device string from 02_network
Adrian Schmutzler [Mon, 15 Jul 2019 15:50:36 +0000 (17:50 +0200)]
ramips: Remove left-over mistyped device string from 02_network

In 2011 (!), network setup for nexaira,bc2 was moved to network
defaults script with a typo so it became b2c:
295e04084c ("ramips: setup bc2 mac addresses from the generic network script")

This patch just removes the useless entry without replacement,
since it seems to have worked for 8 years anyway.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: add wmac migration for all ar93xx/qca95xx SoCs
Chuanhong Guo [Fri, 21 Jun 2019 10:33:53 +0000 (18:33 +0800)]
ath79: add wmac migration for all ar93xx/qca95xx SoCs

Add migration for all ar71xx device path as well as previously
incorrect ath79 path.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agoath79: ar93xx/qca95xx: move gmac/wmac/pcie node out of apb bus
Chuanhong Guo [Fri, 21 Jun 2019 10:25:12 +0000 (18:25 +0800)]
ath79: ar93xx/qca95xx: move gmac/wmac/pcie node out of apb bus

according to functional block diagram in datasheet, these devices
don't belong to apb bus.
Move these nodes out to match datasheet description.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agoath79: add support for Qihoo C301
Chuanhong Guo [Mon, 15 Jul 2019 11:43:31 +0000 (19:43 +0800)]
ath79: add support for Qihoo C301

Specifications:
- SoC: AR9344
- RAM: 128MB
- Flash: 2 * 16MB (MX25L12845)
- Ethernet: 2 * FE LAN & 1 * FE WAN
- WiFi: 2.4G: AR9344 5G: QCA9882

Flash instruction:
1. Hold reset and power up the router
2. Set your IP to 192.168.1.x
3. Open 192.168.1.1 and upload the generated *factory* firmware

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agoramips: mtk-mmc: mt76x8: check ESD_MODE before applying AGPIO_CFG
Chuanhong Guo [Sat, 13 Jul 2019 09:59:03 +0000 (17:59 +0800)]
ramips: mtk-mmc: mt76x8: check ESD_MODE before applying AGPIO_CFG

Since mt76x8an ver1 eco2, SDXC pins can be switched to the
following pinmap:
sd_d1  -> PAD_I2S_SDI
sd_d0  -> PAD_I2S_WS
sd_cmd -> PAD_I2S_CLK
sd_d3  -> PAD_I2C_SCLK
sd_d2  -> PAD_I2C_SD
sd_clk -> PAD_GPIO0
sd_wp  -> PAD_TXD1
sd_cd  -> PAD_RXD1

To use this pinmap, one would need to set ESD_MODE bit (bit 15)
to 1 in GPIO1_MODE and switch other used pads into GPIO mode.
In this mode, we don't need to switch ethernet pins to digital
pad.

Check ESD_MODE bit before applying AGPIO_CFG and use rt_sysc_m32
to set it.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agompc85xx: split up DEVICE_TITLE
Moritz Warning [Sun, 14 Jul 2019 08:53:27 +0000 (10:53 +0200)]
mpc85xx: split up DEVICE_TITLE

Splits up DEVICE_TITLE into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
4 years agolibroxml: bump to the 3.0.2 version
Rafał Miłecki [Sun, 14 Jul 2019 20:24:54 +0000 (22:24 +0200)]
libroxml: bump to the 3.0.2 version

* Fix for memory leak regression
* Support for (un)escaping

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
4 years agotarget/toolchain/files/wrapper.sh: simplify 'case'
Eneas U de Queiroz [Mon, 15 Jul 2019 17:08:00 +0000 (14:08 -0300)]
target/toolchain/files/wrapper.sh: simplify 'case'

Removed an eglibc remnant, and while at it, grouped all of the
TOOLCHAIN_PLATFORMs using the same FLAGS together.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
4 years agolibs/toolchain: remove eglibc remnant file
Eneas U de Queiroz [Mon, 15 Jul 2019 17:07:59 +0000 (14:07 -0300)]
libs/toolchain: remove eglibc remnant file

This removes package/libs/toolchain/eglibc-files/etc/nsswitch.conf.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>