From c5b7a0d3a480950573800e84567f15d6043c6046 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Sat, 25 Apr 2020 11:55:38 +0800 Subject: [PATCH] package: lantiq/layerscape: sync upstream source code --- package/firmware/layerscape/ls-rcw/Makefile | 6 + .../patches/0001-Disable-byte-swapping.patch | 44 ++ ...ort-byte-swapping-without-tclsh-tool.patch | 82 --- .../patches/0002-Convert-to-python3.patch | 504 ++++++++++++++++++ package/kernel/lantiq/ltq-adsl-fw/Makefile | 6 +- package/kernel/lantiq/ltq-adsl-mei/Makefile | 1 - package/kernel/lantiq/ltq-adsl/Config.in | 6 +- package/kernel/lantiq/ltq-adsl/Makefile | 9 +- .../ltq-adsl/patches/100-dsl_compat.patch | 27 +- .../ltq-adsl/patches/120-platform.patch | 15 +- .../ltq-adsl/patches/130-linux3.8.patch | 20 +- package/kernel/lantiq/ltq-atm/Makefile | 1 - .../ltq-atm/src/ifxmips_atm_amazon_se.c | 9 +- .../lantiq/ltq-atm/src/ifxmips_atm_ar9.c | 9 +- .../lantiq/ltq-atm/src/ifxmips_atm_core.h | 2 +- .../lantiq/ltq-atm/src/ifxmips_atm_danube.c | 9 +- .../lantiq/ltq-atm/src/ifxmips_atm_vr9.c | 45 +- package/kernel/lantiq/ltq-atm/src/ltq_atm.c | 10 +- package/kernel/lantiq/ltq-deu/Makefile | 1 - .../kernel/lantiq/ltq-deu/src/ifxmips_md5.c | 2 +- .../lantiq/ltq-deu/src/ifxmips_md5_hmac.c | 2 +- .../kernel/lantiq/ltq-deu/src/ifxmips_sha1.c | 2 +- .../lantiq/ltq-deu/src/ifxmips_sha1_hmac.c | 2 +- package/kernel/lantiq/ltq-ifxos/Makefile | 1 - ...ion-failure-from-inclusion-of-wrong-.patch | 2 +- package/kernel/lantiq/ltq-ptm/Makefile | 3 +- .../lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c | 38 +- .../lantiq/ltq-ptm/src/ifxmips_ptm_adsl.h | 2 +- .../ltq-ptm/src/ifxmips_ptm_amazon_se.c | 10 +- .../lantiq/ltq-ptm/src/ifxmips_ptm_ar9.c | 10 +- .../lantiq/ltq-ptm/src/ifxmips_ptm_danube.c | 10 +- .../lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c | 40 +- .../lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.h | 2 +- .../lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c | 61 ++- package/kernel/lantiq/ltq-tapi/Makefile | 1 - .../ltq-tapi/patches/010-fix-compile.patch | 2 +- .../ltq-tapi/patches/400-linux-415.patch | 48 ++ package/kernel/lantiq/ltq-vdsl-fw/Makefile | 2 +- .../lantiq/ltq-vdsl-fw/src/vdsl_fw_install.sh | 6 +- .../lantiq/ltq-vdsl-fw/src/w921v_fw_cutter.c | 4 +- package/kernel/lantiq/ltq-vdsl-mei/Makefile | 10 +- package/kernel/lantiq/ltq-vdsl/Makefile | 1 - .../lantiq/ltq-vdsl/patches/100-compat.patch | 27 +- package/kernel/lantiq/ltq-vmmc/Makefile | 1 - 44 files changed, 887 insertions(+), 208 deletions(-) create mode 100644 package/firmware/layerscape/ls-rcw/patches/0001-Disable-byte-swapping.patch delete mode 100644 package/firmware/layerscape/ls-rcw/patches/0001-rcw-support-byte-swapping-without-tclsh-tool.patch create mode 100644 package/firmware/layerscape/ls-rcw/patches/0002-Convert-to-python3.patch create mode 100644 package/kernel/lantiq/ltq-tapi/patches/400-linux-415.patch diff --git a/package/firmware/layerscape/ls-rcw/Makefile b/package/firmware/layerscape/ls-rcw/Makefile index 5bcbff5bc4..ddef58fa0b 100644 --- a/package/firmware/layerscape/ls-rcw/Makefile +++ b/package/firmware/layerscape/ls-rcw/Makefile @@ -28,6 +28,11 @@ define Package/layerscape-rcw/Config endef endef +define Package/layerscape-rcw/ls1012afrdm + TITLE:=NXP LS1012AFRDM RCW binary + CONFIG:=ls1012afrdm/N_SSNP_3305/rcw_800.bin +endef + define Package/layerscape-rcw/ls1012ardb TITLE:=NXP LS1012ARDB RCW binary CONFIG:=ls1012ardb/R_SPNH_3508/rcw_1000_default.bin @@ -86,6 +91,7 @@ define Package/layerscape-rcw/Install endef RCWS := \ + ls1012afrdm \ ls1012ardb \ ls1012afrwy \ ls1043ardb \ diff --git a/package/firmware/layerscape/ls-rcw/patches/0001-Disable-byte-swapping.patch b/package/firmware/layerscape/ls-rcw/patches/0001-Disable-byte-swapping.patch new file mode 100644 index 0000000000..2ea260bfd4 --- /dev/null +++ b/package/firmware/layerscape/ls-rcw/patches/0001-Disable-byte-swapping.patch @@ -0,0 +1,44 @@ +From ef78dc0683a7f5ae80b27878a8a2f91d504e3290 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Wed, 19 Jun 2019 10:50:29 +0800 +Subject: [PATCH 1/2] Disable byte swapping + +Because TF-A had already handled rcw byte swapping, the +byte swapping in rcw could be dropped. + +Signed-off-by: Yangbo Lu +--- + Makefile | 4 ---- + Makefile.inc | 1 - + 2 files changed, 5 deletions(-) + +diff --git a/Makefile b/Makefile +index f697241..837b69e 100644 +--- a/Makefile ++++ b/Makefile +@@ -14,10 +14,6 @@ TCLSH := $(shell command -v tclsh 2> /dev/null) + VER = $(shell git describe --tags) + + all install clean: +-ifndef TCLSH +- $(error "tclsh is not available. please install it.") +- exit 1 +-endif + @for board in $(BOARDS); do \ + $(MAKE) -C $$board $@ DESTDIR=$(DESTDIR)/$$board; \ + done +diff --git a/Makefile.inc b/Makefile.inc +index 87639bc..7d9a3d3 100644 +--- a/Makefile.inc ++++ b/Makefile.inc +@@ -17,7 +17,6 @@ targets = $(txt_sources:.txt=.bin) $(rcw_sources:.rcw=.bin) $(swap_sources) + $(RCW) -i $< -o $@ + + all: $(targets) +- $(QSPI_SWAP_SCRIPT) $(QSPI_SWAP_LIST) + + install: $(targets) + $(INSTALL) -d $(DESTDIR) +-- +2.7.4 + diff --git a/package/firmware/layerscape/ls-rcw/patches/0001-rcw-support-byte-swapping-without-tclsh-tool.patch b/package/firmware/layerscape/ls-rcw/patches/0001-rcw-support-byte-swapping-without-tclsh-tool.patch deleted file mode 100644 index 08492dd479..0000000000 --- a/package/firmware/layerscape/ls-rcw/patches/0001-rcw-support-byte-swapping-without-tclsh-tool.patch +++ /dev/null @@ -1,82 +0,0 @@ -From c87a500c45f36ad248b1298d63e590d1d7e74f12 Mon Sep 17 00:00:00 2001 -From: Yangbo Lu -Date: Tue, 3 Jul 2018 11:06:47 +0800 -Subject: [PATCH] rcw: support byte swapping without tclsh tool - -Signed-off-by: Yangbo Lu ---- - Makefile | 4 ---- - byte_swap.py | 32 ++++++++++++++++++++++++++++++++ - qspi_swap.sh | 2 +- - 3 files changed, 33 insertions(+), 5 deletions(-) - create mode 100755 byte_swap.py - -diff --git a/Makefile b/Makefile -index 9f0587e..393bb2c 100644 ---- a/Makefile -+++ b/Makefile -@@ -13,10 +13,6 @@ TCLSH := $(shell command -v tclsh 2> /dev/null) - VER = $(shell git describe --tags) - - all install clean: --ifndef TCLSH -- $(error "tclsh is not available. please install it.") -- exit 1 --endif - @for board in $(BOARDS); do \ - $(MAKE) -C $$board $@ DESTDIR=$(DESTDIR)/$$board; \ - done -diff --git a/byte_swap.py b/byte_swap.py -new file mode 100755 -index 0000000..386310e ---- /dev/null -+++ b/byte_swap.py -@@ -0,0 +1,32 @@ -+#!/usr/bin/env python -+""" -+Swap the 4/8 bytes endian except for PBI CRC -+2016-10-9: Initial version -+ -+Usage: -+ ./byte_swap.py -+""" -+import sys -+ -+try: -+ file_name = sys.argv[1] -+ byte = int(sys.argv[2]) -+except: -+ print("Usage: ./byte_swap.py ") -+ print("E.g.: ./byte_swap.py rcw_1600.bin 8\n") -+ exit -+ -+with open(file_name,'rb') as file: -+ tmp = file.read() -+file.close() -+ -+with open(file_name + '.swapped','wb') as file: -+ for i in range(0, len(tmp) - 1, byte): -+ if(tmp[i:i+4].encode('hex')) == "08610040": -+ #print("PBI CRC command") -+ file.write(tmp[i:i+8]) -+ break -+ file.write(tmp[i:i+byte][::-1]) -+file.close() -+ -+print("Swapped file: " + file_name + '.swapped') -diff --git a/qspi_swap.sh b/qspi_swap.sh -index 0b58e44..d23fd8b 100755 ---- a/qspi_swap.sh -+++ b/qspi_swap.sh -@@ -9,7 +9,7 @@ do - if [ "$board_name" = "$current_dir" ]; then - if [ -e $filename ]; then - swapped_file="$filename.swapped" -- tclsh ../tools/byte_swap.tcl $filename $swapped_file 8 -+ ../byte_swap.py $filename 8 - fi - fi - done < $1 --- -1.7.1 - diff --git a/package/firmware/layerscape/ls-rcw/patches/0002-Convert-to-python3.patch b/package/firmware/layerscape/ls-rcw/patches/0002-Convert-to-python3.patch new file mode 100644 index 0000000000..8aa629dd85 --- /dev/null +++ b/package/firmware/layerscape/ls-rcw/patches/0002-Convert-to-python3.patch @@ -0,0 +1,504 @@ +From 7bd43eb9e5cdf2035793d50a31bf13052eb9812a Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Wed, 19 Jun 2019 10:25:41 +0800 +Subject: [PATCH 2/2] Convert to python3 + +Python 2.7 will not be maintained past 2020. Let's convert +to python3 for rcw. Below were the changes of this patch. +- Adapted print usage +- Didn't use tab anymore +- Handled str and bytes type separately +- Other minor changes + +Signed-off-by: Yangbo Lu +--- + Makefile.inc | 2 +- + rcw.py | 144 +++++++++++++++++++++++++++++------------------------------ + 2 files changed, 73 insertions(+), 73 deletions(-) + +diff --git a/Makefile.inc b/Makefile.inc +index 7d9a3d3..8bee2be 100644 +--- a/Makefile.inc ++++ b/Makefile.inc +@@ -1,6 +1,6 @@ + DESTDIR = $(shell basename $(CURDIR)) + INSTALL = install +-PYTHON ?= python2 ++PYTHON ?= python3 + RCW = $(PYTHON) ../rcw.py + QSPI_SWAP_LIST = $(shell pwd)/../qspi_swap_list.txt + QSPI_SWAP_SCRIPT=$(shell pwd)/../qspi_swap.sh +diff --git a/rcw.py b/rcw.py +index e5cd28b..619770a 100755 +--- a/rcw.py ++++ b/rcw.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python2 ++#!/usr/bin/env python3 + + # rcw.py -- compiles an RCW source file into an PBL/RCW binary + +@@ -95,7 +95,7 @@ from optparse import OptionParser, OptionGroup + class ordered_dict(dict): + def __init__(self, *args, **kwargs): + dict.__init__(self, *args, **kwargs) +- self._order = self.keys() ++ self._order = list(self.keys()) + + def __setitem__(self, key, value): + dict.__setitem__(self, key, value) +@@ -132,7 +132,7 @@ def crc32(data): + + crc = 0xffffffff + for i in data: +- crc = (crc << 8) ^ table[(crc >> 24) ^ ord(i)] ++ crc = (crc << 8) ^ table[(crc >> 24) ^ int(i)] + crc = crc & 0xffffffff + + return crc +@@ -187,7 +187,7 @@ def command_line(): + options.output = '/dev/stdout' + + if options.reverse and not options.rcwi: +- print "Error: -r option requires --rcw" ++ print("Error: -r option requires --rcw") + sys.exit(1) + + # Checks if the bits for the given field overlap those of another field that +@@ -196,27 +196,27 @@ def check_for_overlap(name, begin, end): + global symbols + + if name in symbols: +- print 'Error: Duplicate bitfield definition for', name ++ print('Error: Duplicate bitfield definition for', name) + return + + # Iterate over the list of symbols that have already been defined +- for n, [b, e] in symbols.iteritems(): ++ for n, [b, e] in symbols.items(): + # check if either 'begin' or 'end' is inside an bitfield range + if (b <= begin <= e) or (b <= end <= e): +- print 'Error: Bitfield', name, 'overlaps with', n ++ print('Error: Bitfield', name, 'overlaps with', n) + + # + # Build a u-boot PBI section for SPI/SD/NAND boot +-# refer: Chapter 10, u-boot of QorIQ_SDK_Infocenter.pdf ++# refer: Chapter 10, u-boot of QorIQ_SDK_Infocenter.pdf + # + # pre-cond 1: u-boot.xxd should be created + # how to create u-boot.xxd +-# xxd u-boot.bin > u-boot.xxd1 && cut -d " " -f1-10 u-boot.xxd1 > u-boot.xxd && rm -f u-boot.xxd1 ++# xxd u-boot.bin > u-boot.xxd1 && cut -d " " -f1-10 u-boot.xxd1 > u-boot.xxd && rm -f u-boot.xxd1 + # + # rcw file should include spi_boot.rcw as well + # + def build_pbi_uboot(lines): +- subsection = '' ++ subsection = b'' + cnt = 1 + l_tmp = [] + +@@ -224,55 +224,55 @@ def build_pbi_uboot(lines): + for l in lines: + # prepare 0x40 per lines except the last one + # add flush at the end +- lstr = l.split() +- addr = int(lstr[0][:-1], 16) ++ lstr = l.split() ++ addr = int(lstr[0][:-1], 16) + + # print l + # + # last two lines take 0x20 numbers + # +- if ((cnt % 2 == 0) and (cnt > len(lines) -4)): ++ if ((cnt % 2 == 0) and (cnt > len(lines) -4)): + l_tmp.append(l) + b = [] + +- for t in l_tmp: ++ for t in l_tmp: + lstr = t.split() + +- for i in range(1, len(lstr)): ++ for i in range(1, len(lstr)): + b.append(int(lstr[i], 16)) + + subsection += struct.pack('>LHHHHHHHHHHHHHHHH',\ +- 0x0C1F80000 + (addr - 0x10),\ +- b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7],\ +- b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15]) ++ 0x0C1F80000 + (addr - 0x10),\ ++ b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7],\ ++ b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15]) + l_tmp = [] + # + # the rest of lines take 0x40 numbers + elif (cnt % 4 == 0): + l_tmp.append(l) +- b = [] +- for t in l_tmp: ++ b = [] ++ for t in l_tmp: + lstr = t.split() +- for i in range(1, len(lstr)): ++ for i in range(1, len(lstr)): + b.append(int(lstr[i], 16)) + + subsection += struct.pack('>LHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH',\ +- 0x081F80000 + (addr - 0x30),\ +- b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7],\ +- b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15],\ +- b[16], b[17], b[18], b[19], b[20], b[21], b[22], b[23], \ +- b[24], b[25], b[26], b[27], b[28], b[29], b[30], b[31]) ++ 0x081F80000 + (addr - 0x30),\ ++ b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7],\ ++ b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15],\ ++ b[16], b[17], b[18], b[19], b[20], b[21], b[22], b[23], \ ++ b[24], b[25], b[26], b[27], b[28], b[29], b[30], b[31]) + l_tmp = [] + else: + l_tmp.append(l) + +- cnt = cnt + 1 ++ cnt = cnt + 1 + + return subsection + + # Build a PBI section + def build_pbi(lines): +- subsection = '' ++ subsection = b'' + global vars + + if 'pbiformat' in vars: +@@ -286,9 +286,9 @@ def build_pbi(lines): + for l in lines: + # Check for an instruction without 0-2 parameters + # The + ' ' is a hack to make the regex work for just 'flush' +- m = re.match(r'\s*([a-z]+)(|\.b1|\.b2|\.b4|\.short|\.long)\s*(?<=\s)([^,]*),?([^,]*),?([^,]*),?([^,]*)', l + ' ') ++ m = re.match(r'\s*([a-z]+)(|\.b1|\.b2|\.b4|\.short|\.long)\s*(?<=\s)([^,]*),?([^,]*),?([^,]*),?([^,]*)', l.decode("ascii") + ' ') + if not m: +- print 'Unknown PBI subsection command "%s"' % l ++ print('Unknown PBI subsection command "%s"' % l) + return '' + op = m.group(1) + opsize = m.group(2) +@@ -306,7 +306,7 @@ def build_pbi(lines): + p4 = eval(p4, {"__builtins__":None}, {}) if len(p4) else None + if op == 'wait': + if p1 == None: +- print 'Error: "wait" instruction requires one parameter' ++ print('Error: "wait" instruction requires one parameter') + return '' + if pbiformat == 2: + v1 = struct.pack(endianess + 'L', 0x80820000 | p1) +@@ -318,7 +318,7 @@ def build_pbi(lines): + subsection += v2 + elif op == 'write': + if p1 == None or p2 == None: +- print 'Error: "write" instruction requires two parameters' ++ print('Error: "write" instruction requires two parameters') + return '' + if pbiformat == 2: + v1 = struct.pack(endianess + 'L', (opsizebytes << 28) | p1) +@@ -329,7 +329,7 @@ def build_pbi(lines): + subsection += v2 + elif op == 'awrite': + if p1 == None or p2 == None: +- print 'Error: "awrite" instruction requires two parameters' ++ print('Error: "awrite" instruction requires two parameters') + return '' + if pbiformat == 2: + v1 = struct.pack(endianess + 'L', 0x80000000 + (opsizebytes << 26) + p1) +@@ -340,10 +340,10 @@ def build_pbi(lines): + subsection += v2 + elif op == 'poll': + if pbiformat != 2: +- print 'Error: "poll" not support for old PBI format' ++ print('Error: "poll" not support for old PBI format') + return '' + if p1 == None or p2 == None or p3 == None: +- print 'Error: "poll" instruction requires three parameters' ++ print('Error: "poll" instruction requires three parameters') + return '' + if opsize == '.long': + cmd = 0x81 +@@ -357,19 +357,19 @@ def build_pbi(lines): + subsection += v3 + elif op == 'loadacwindow': + if pbiformat != 2: +- print 'Error: "loadacwindow" not supported for old PBI format' ++ print('Error: "loadacwindow" not supported for old PBI format') + return '' + if p1 == None: +- print 'Error: "loadacwindow" instruction requires one parameter' ++ print('Error: "loadacwindow" instruction requires one parameter') + return '' + v1 = struct.pack(endianess + 'L', 0x80120000 + p1) + subsection += v1 + elif op == 'blockcopy': + if pbiformat != 2: +- print 'Error: "blockcopy" not supported for old PBI format' ++ print('Error: "blockcopy" not supported for old PBI format') + return '' + if p1 == None or p2 == None or p3 == None or p4 == None: +- print 'Error: "blockcopy" instruction requires four parameters' ++ print('Error: "blockcopy" instruction requires four parameters') + return '' + v1 = struct.pack(endianess + 'L', 0x80000000 + (p1 & 0xff)) + v2 = struct.pack(endianess + 'L', p2) +@@ -382,7 +382,7 @@ def build_pbi(lines): + elif op == 'flush': + subsection += struct.pack('>LL', 0x09000000 | (int(vars['pbladdr'], 16) & 0x00ffff00), 0) + else: +- print 'Unknown PBI subsection command "%s"' % l ++ print('Unknown PBI subsection command "%s"' % l) + return '' + + return subsection +@@ -394,7 +394,7 @@ def parse_subsection(header, lines): + elif header == "uboot": + return build_pbi_uboot(lines) + +- print 'Error: unknown subsection "%s"' % header ++ print('Error: unknown subsection "%s"' % header) + return '' + + # Parse the .rcw file, one line at a time +@@ -408,10 +408,10 @@ def parse_source_file(source): + symbols = ordered_dict() + + in_subsection = False # True == we're in a subsection +- pbi = '' ++ pbi = b'' + + for l2 in source: +- l = re.sub(r'\s+', '', l2) # Remove all whitespace ++ l = re.sub(r'\s+', '', l2.decode("ascii")) # Remove all whitespace + + if not len(l): # Skip blank or comment-only lines + continue +@@ -466,14 +466,14 @@ def parse_source_file(source): + (name, value) = m.groups() + value = int(value, 0) + if not name in symbols: +- print 'Error: Unknown bitfield', name ++ print('Error: Unknown bitfield', name) + else: + if options.warnings and (name in assignments): +- print 'Warning: Duplicate assignment for bitfield', name ++ print('Warning: Duplicate assignment for bitfield', name) + assignments[name] = value + continue + +- print 'Error: unknown command', ' '.join(l2) ++ print('Error: unknown command', ' '.join(l2)) + + # Parse the -D command line parameter for additional bitfield assignments + def parse_cmdline_bitfields(): +@@ -484,12 +484,12 @@ def parse_cmdline_bitfields(): + # This is the same regex as used in parse_source_file() + m = re.search(r'([A-Z0-9_]+)=([0-9a-zA-Z]+)', l) + if not m: +- print 'Unrecognized command-line bitfield:', l ++ print('Unrecognized command-line bitfield:', l) + else: + (name, value) = m.groups() + value = int(value, 0) + if not name in symbols: +- print 'Error: Unknown bitfield', name ++ print('Error: Unknown bitfield', name) + else: + # Don't bother printing a warning, since the command-line will + # normally be used to overwrite values in the .rcw file +@@ -510,7 +510,7 @@ def read_source_file(filename): + global options + + if not find_program('gcc'): +- print 'Could not find gcc in PATH' ++ print('Could not find gcc in PATH') + return None + + i = ['-I', '.'] # Always look in the current directory +@@ -521,7 +521,7 @@ def read_source_file(filename): + shell=False, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + ret = p.communicate() + if p.returncode != 0: +- print ret[1], ++ print(ret[1],) + return None + + return ret[0].splitlines() +@@ -532,13 +532,13 @@ def check_vars(): + global options + + if not 'size' in vars: +- print 'Error: "%size" variable must be specified' ++ print('Error: "%size" variable must be specified') + sys.exit(1) + + if options.pbl: + if 'pbiformat' in vars and int(vars['pbiformat'], 0) == 2: + if 'sysaddr' in vars: +- print 'Error: PBL format does not use %sysaddr' ++ print('Error: PBL format does not use %sysaddr') + sys.exit(1) + #if 'pbladdr' in vars: + # print 'Error: PBL format does not use %pbladdr' +@@ -546,7 +546,7 @@ def check_vars(): + else: + # If we want the PBL header/footer, the vars for those must be defined + if not 'sysaddr' in vars: +- print 'Error: PBL format requires %sysaddr to be defined' ++ print('Error: PBL format requires %sysaddr to be defined') + sys.exit(1) + + # Create a .bin file +@@ -581,7 +581,7 @@ def create_binary(): + dont64bswapcrc = 0 + if 'dont64bswapcrc' in vars and int(vars['dont64bswapcrc'], 0): + dont64bswapcrc = 1 +- bits = 0L ++ bits = 0 + + # Magic hack. If a pbi is specified and we didn't set the size, + # set it for the new format! +@@ -593,7 +593,7 @@ def create_binary(): + pbilen += 2 + assignments['PBI_LENGTH'] = pbilen + +- for n, v in assignments.iteritems(): ++ for n, v in assignments.items(): + # n = name of symbol + # v = value to assign + bb, ee = symbols[n] # First bit and last bit +@@ -603,13 +603,13 @@ def create_binary(): + + # Make sure it's not too large + if v >= (1 << s): +- print 'Error: Value', v, 'is too large for field', n ++ print('Error: Value', v, 'is too large for field', n) + continue + + # If we treat the bitfield as "classic" numbered, reverse + # the value before adding it! + if b != bb: +- v = int(bin(v)[2:].zfill(s)[::-1], 2) ++ v = int(bin(int(v))[2:].zfill(s)[::-1], 2) + + # Set the bits. We assume that bits [b:e] are already zero. They can be + # non-zero only if we have overlapping bitfield definitions, which we +@@ -617,7 +617,7 @@ def create_binary(): + bits += v << ((size - 1) - e) + + # Generate the binary. First, apply the preamble, if requested +- binary = '' ++ binary = b'' + if options.pbl: + # Starting with LS2, we have a larger field and a different + # format. +@@ -626,7 +626,7 @@ def create_binary(): + # Load RCW command + binary += struct.pack(endianess + 'L', 0x80100000) + else: +- length_byte = (((size / 8) & 63) << 1) | 1 ++ length_byte = (((size // 8) & 63) << 1) | 1 + binary += struct.pack(endianess + 'L', (length_byte << 24) | (int(vars['sysaddr'], 16) & 0x00ffffff)) + + # Then convert 'bits' into an array of bytes +@@ -634,7 +634,7 @@ def create_binary(): + byte = bits >> i & 0xff + if classicbitnumbers: + byte = int(bin(byte)[2:].zfill(8)[::-1], 2) +- binary += chr(byte) ++ binary += bytes([byte]) + + if options.pbl: + if pbiformat == 2: +@@ -672,11 +672,11 @@ def create_binary(): + # Precise bit any byte ordering of the CRC calculation is + # not clearly specified. This is empirical. + if classicbitnumbers: +- newcrcbinary = '' ++ newcrcbinary = b'' + for c in crcbinary: +- byte = ord(c) ++ byte = int(c) + byte = int(bin(byte)[2:].zfill(8)[::-1], 2) +- newcrcbinary += chr(byte) ++ newcrcbinary += bytes([byte]) + crcbinary = newcrcbinary + + # Calculate and add the CRC +@@ -693,7 +693,7 @@ def create_binary(): + l = len(binary) + if dont64bswapcrc and options.pbl: + l -= 8 +- newbinary = '' ++ newbinary = b'' + for i in range(0, l, 8): + x64 = struct.unpack('>Q', binary[i:i + 8])[0] + newbinary += struct.pack(' 0: + l = len(pbi) +@@ -953,7 +953,7 @@ def create_source(): + if cnt == 0: + cnt = 64 + if i + cnt >= l: +- print 'Error in write 0x%08x at offset %d within PBI\n' % (word, i) ++ print('Error in write 0x%08x at offset %d within PBI\n' % (word, i)) + if (addr & 0x00ffff00 == pbladdr): + arg1 = struct.unpack(endianess + 'L', pbi[i:i+4])[0] + i += 4 +@@ -986,8 +986,8 @@ def create_source(): + + return source + +-if (sys.version_info < (2,6)) or (sys.version_info >= (3,0)): +- print 'Only Python versions 2.6 or 2.7 are supported.' ++if (sys.version_info < (3,0)): ++ print('Only Python versions 3.0+ are supported.') + sys.exit(1) + + # Make all 'print' statements output to stderr instead of stdout +-- +2.7.4 + diff --git a/package/kernel/lantiq/ltq-adsl-fw/Makefile b/package/kernel/lantiq/ltq-adsl-fw/Makefile index 5775d0cf50..66f91a991e 100644 --- a/package/kernel/lantiq/ltq-adsl-fw/Makefile +++ b/package/kernel/lantiq/ltq-adsl-fw/Makefile @@ -13,7 +13,7 @@ PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/ltq-dsl-fw-$(PKG_VERSION) PKG_SOURCE:=ltq-dsl-fw-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/ +PKG_SOURCE_URL:=https://sources.openwrt.org/ PKG_HASH:=28676d41c4b76e5bf7a2c5eae106a61fb96b93eabc0cb71120575fff9997269f PKG_MAINTAINER:=John Crispin @@ -45,8 +45,8 @@ endef define Package/kmod-ltq-adsl-$(BUILD_VARIANT)/install $(INSTALL_DIR) $(1)/lib/firmware/ - $(CP) $(PKG_BUILD_DIR)/$(FW_NAME)/ltq-dsl-fw-$(ANNEX)-$(SOC).bin $(1)/lib/firmware/ - ln -s /lib/firmware/$(FW_NAME)/ltq-dsl-fw-$(ANNEX)-$(SOC).bin $(1)/lib/firmware/adsl.bin + $(CP) $(PKG_BUILD_DIR)/ltq-dsl-fw-$(ANNEX)-$(SOC).bin $(1)/lib/firmware/ + ln -s /lib/firmware/ltq-dsl-fw-$(ANNEX)-$(SOC).bin $(1)/lib/firmware/adsl.bin endef $(eval $(call BuildPackage,kmod-ltq-adsl-danube-fw-a)) diff --git a/package/kernel/lantiq/ltq-adsl-mei/Makefile b/package/kernel/lantiq/ltq-adsl-mei/Makefile index 08e5775771..31e671e53f 100644 --- a/package/kernel/lantiq/ltq-adsl-mei/Makefile +++ b/package/kernel/lantiq/ltq-adsl-mei/Makefile @@ -8,7 +8,6 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ltq-adsl-mei PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-adsl-mei-$(BUILD_VARIANT)/ PKG_MAINTAINER:=John Crispin PKG_CHECK_FORMAT_SECURITY:=0 diff --git a/package/kernel/lantiq/ltq-adsl/Config.in b/package/kernel/lantiq/ltq-adsl/Config.in index 6d9caf4419..8ae65d373a 100644 --- a/package/kernel/lantiq/ltq-adsl/Config.in +++ b/package/kernel/lantiq/ltq-adsl/Config.in @@ -1,5 +1,5 @@ -config LANTIQ_DSL_DEBUG +config LANTIQ_ADSL_DEBUG bool "verbose debugging" - depends on PACKAGE_kmod-ltq-dsl + depends on PACKAGE_kmod-ltq-adsl help - Say Y, if you need ltq-dsl to display debug messages. + Say Y, if you need ltq-adsl to display debug messages. diff --git a/package/kernel/lantiq/ltq-adsl/Makefile b/package/kernel/lantiq/ltq-adsl/Makefile index 0fbda34ff9..1a9128fc58 100644 --- a/package/kernel/lantiq/ltq-adsl/Makefile +++ b/package/kernel/lantiq/ltq-adsl/Makefile @@ -10,15 +10,14 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ltq-adsl PKG_VERSION:=3.24.4.4 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=drv_dsl_cpe_api_danube-$(PKG_VERSION).tar.gz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-dsl-$(BUILD_VARIANT)/drv_dsl_cpe_api-$(PKG_VERSION) -PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/ +PKG_SOURCE_URL:=https://mirror2.openwrt.org/sources/ PKG_HASH:=eb2ed59715d3bf4e8a1460bbbe2f1660039e0a9f9d72afb1b2b16590094eb33c PKG_MAINTAINER:=John Crispin PKG_CHECK_FORMAT_SECURITY:=0 -PKG_ASLR_PIE:=0 PKG_FIXUP:=autoreconf include $(INCLUDE_DIR)/package.mk @@ -39,7 +38,7 @@ KernelPackage/ltq-adsl-danube=$(call KernelPackage/ltq-adsl-template,danube,(TAR KernelPackage/ltq-adsl-ar9=$(call KernelPackage/ltq-adsl-template,ar9,TARGET_lantiq_xway) KernelPackage/ltq-adsl-ase=$(call KernelPackage/ltq-adsl-template,ase,TARGET_lantiq_ase) -define KernelPackage/ltq-dsl/config +define KernelPackage/ltq-adsl/config source "$(SOURCE)/Config.in" endef @@ -76,7 +75,7 @@ CONFIGURE_ARGS += --enable-add-drv-cflags="-DMODULE -DCONFIG_$(CONFIG_TAG_$(BUIL CONFIGURE_ARGS += --enable-danube -ifeq ($(CONFIG_LANTIQ_DSL_DEBUG),y) +ifeq ($(CONFIG_LANTIQ_ADSL_DEBUG),y) CONFIGURE_ARGS += \ --enable-debug=yes \ --enable-debug-prints=yes diff --git a/package/kernel/lantiq/ltq-adsl/patches/100-dsl_compat.patch b/package/kernel/lantiq/ltq-adsl/patches/100-dsl_compat.patch index 431ccb6ebc..1e860010e9 100644 --- a/package/kernel/lantiq/ltq-adsl/patches/100-dsl_compat.patch +++ b/package/kernel/lantiq/ltq-adsl/patches/100-dsl_compat.patch @@ -82,7 +82,28 @@ if ( (_IOC_TYPE(nCommand) == DSL_IOC_MAGIC_CPE_API) || (_IOC_TYPE(nCommand) == DSL_IOC_MAGIC_CPE_API_G997) || (_IOC_TYPE(nCommand) == DSL_IOC_MAGIC_CPE_API_PM) || -@@ -1058,6 +1065,7 @@ static void DSL_DRV_DebugInit(void) +@@ -828,12 +835,19 @@ DSL_int32_t DSL_DRV_ThreadShutdown( + + DSL_uint32_t DSL_DRV_SysTimeGet(DSL_uint32_t nOffset) + { +- struct timeval tv; + DSL_uint32_t nTime = 0; ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)) ++ struct timeval tv; + + memset(&tv, 0, sizeof(tv)); + do_gettimeofday(&tv); + nTime = (DSL_uint32_t)tv.tv_sec; ++#else ++ struct timespec64 now; ++ ++ ktime_get_real_ts64(&now); ++ nTime = (DSL_uint32_t)now.tv_sec; ++#endif + + if ( (nOffset == 0) || (nOffset > nTime) ) + { +@@ -1058,6 +1072,7 @@ static void DSL_DRV_DebugInit(void) /* Entry point of driver */ int __init DSL_ModuleInit(void) { @@ -90,7 +111,7 @@ DSL_int_t i; printk(DSL_DRV_CRLF DSL_DRV_CRLF "Infineon CPE API Driver version: %s" DSL_DRV_CRLF, -@@ -1104,7 +1112,8 @@ int __init DSL_ModuleInit(void) +@@ -1104,7 +1119,8 @@ int __init DSL_ModuleInit(void) } DSL_DRV_DevNodeInit(); @@ -137,7 +158,7 @@ #ifdef INCLUDE_DSL_CPE_API_IFXOS_SUPPORT /** IFXOS includes*/ --- /dev/null -+++ b/src/ifxmips_mei_interface.h ++++ b/src/include/ifxmips_mei_interface.h @@ -0,0 +1,702 @@ +/****************************************************************************** + diff --git a/package/kernel/lantiq/ltq-adsl/patches/120-platform.patch b/package/kernel/lantiq/ltq-adsl/patches/120-platform.patch index 20c1ccf471..e1dc254ec0 100644 --- a/package/kernel/lantiq/ltq-adsl/patches/120-platform.patch +++ b/package/kernel/lantiq/ltq-adsl/patches/120-platform.patch @@ -1,14 +1,15 @@ --- a/src/common/drv_dsl_cpe_os_linux.c +++ b/src/common/drv_dsl_cpe_os_linux.c -@@ -12,6 +12,7 @@ +@@ -11,7 +11,7 @@ + #ifdef __LINUX__ #define DSL_INTERN - #include -+#include +-#include ++#include #include "drv_dsl_cpe_api.h" #include "drv_dsl_cpe_api_ioctl.h" -@@ -1063,7 +1064,7 @@ static void DSL_DRV_DebugInit(void) +@@ -1070,7 +1070,7 @@ static void DSL_DRV_DebugInit(void) #endif /* Entry point of driver */ @@ -17,7 +18,7 @@ { struct class *dsl_class; DSL_int_t i; -@@ -1117,7 +1118,7 @@ int __init DSL_ModuleInit(void) +@@ -1124,7 +1124,7 @@ int __init DSL_ModuleInit(void) return 0; } @@ -26,7 +27,7 @@ { printk("Module will be unloaded"DSL_DRV_CRLF); -@@ -1132,7 +1133,7 @@ void __exit DSL_ModuleCleanup(void) +@@ -1139,7 +1139,7 @@ void __exit DSL_ModuleCleanup(void) (DSL_uint8_t**)&g_BndFpgaBase); #endif /* defined(INCLUDE_DSL_CPE_API_VINAX) && defined(INCLUDE_DSL_BONDING)*/ @@ -35,7 +36,7 @@ } #ifndef _lint -@@ -1148,8 +1149,30 @@ module_param(debug_level, byte, 0); +@@ -1155,8 +1155,30 @@ module_param(debug_level, byte, 0); MODULE_PARM_DESC(debug_level, "set to get more (1) or fewer (4) debug outputs"); #endif /* #ifndef DSL_DEBUG_DISABLE*/ diff --git a/package/kernel/lantiq/ltq-adsl/patches/130-linux3.8.patch b/package/kernel/lantiq/ltq-adsl/patches/130-linux3.8.patch index 3e2d8dcc2a..93c2f67796 100644 --- a/package/kernel/lantiq/ltq-adsl/patches/130-linux3.8.patch +++ b/package/kernel/lantiq/ltq-adsl/patches/130-linux3.8.patch @@ -5,10 +5,10 @@ #define DSL_INTERN +#include - #include - #include + #include -@@ -40,7 +41,7 @@ static DSL_ssize_t DSL_DRV_Write(DSL_DRV + #include "drv_dsl_cpe_api.h" +@@ -39,7 +40,7 @@ static DSL_ssize_t DSL_DRV_Write(DSL_DRV static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_inode_t * pINode, DSL_DRV_file_t * pFile, DSL_uint_t nCommand, unsigned long nArg); #else @@ -17,7 +17,7 @@ DSL_uint_t nCommand, unsigned long nArg); #endif static int DSL_DRV_Open(DSL_DRV_inode_t * ino, DSL_DRV_file_t * fil); -@@ -184,7 +185,7 @@ static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_ +@@ -183,7 +184,7 @@ static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_ DSL_uint_t nCommand, unsigned long nArg) #else @@ -26,7 +26,7 @@ DSL_DRV_file_t * pFile, DSL_uint_t nCommand, unsigned long nArg) -@@ -521,9 +522,9 @@ DSL_void_t* DSL_IoctlMemCpyTo( +@@ -520,9 +521,9 @@ DSL_void_t* DSL_IoctlMemCpyTo( - IFX_SUCCESS on success - IFX_ERROR on error */ @@ -38,7 +38,7 @@ DSL_int32_t retVal = -1; #ifndef _lint -@@ -546,30 +547,6 @@ DSL_DRV_STATIC DSL_int32_t DSL_DRV_Kerne +@@ -545,30 +546,6 @@ DSL_DRV_STATIC DSL_int32_t DSL_DRV_Kerne (DSL_NULL, "ENTER - Kernel Thread Startup <%s>" DSL_DRV_CRLF, pThrCntrl->thrParams.pName)); @@ -69,7 +69,7 @@ /*DSL_DRV_ThreadPriorityModify(pThrCntrl->nPriority);*/ pThrCntrl->thrParams.bRunning = 1; -@@ -639,9 +616,7 @@ DSL_int32_t DSL_DRV_ThreadInit( +@@ -638,9 +615,7 @@ DSL_int32_t DSL_DRV_ThreadInit( init_completion(&pThrCntrl->thrCompletion); /* start kernel thread via the wrapper function */ @@ -80,7 +80,7 @@ pThrCntrl->bValid = DSL_TRUE; -@@ -1064,12 +1039,12 @@ static void DSL_DRV_DebugInit(void) +@@ -1070,12 +1045,12 @@ static void DSL_DRV_DebugInit(void) #endif /* Entry point of driver */ @@ -95,7 +95,7 @@ &(dsl_cpe_api_version[4])); DSL_DRV_MemSet( ifxDevices, 0, sizeof(DSL_devCtx_t) * DSL_DRV_MAX_DEVICE_NUMBER ); -@@ -1118,7 +1093,7 @@ static int __devinit ltq_adsl_probe(stru +@@ -1124,7 +1099,7 @@ static int __devinit ltq_adsl_probe(stru return 0; } @@ -104,7 +104,7 @@ { printk("Module will be unloaded"DSL_DRV_CRLF); -@@ -1163,7 +1138,7 @@ MODULE_DEVICE_TABLE(of, ltq_adsl_match); +@@ -1169,7 +1144,7 @@ MODULE_DEVICE_TABLE(of, ltq_adsl_match); static struct platform_driver ltq_adsl_driver = { .probe = ltq_adsl_probe, diff --git a/package/kernel/lantiq/ltq-atm/Makefile b/package/kernel/lantiq/ltq-atm/Makefile index 5d63983d2c..455d7b25e3 100644 --- a/package/kernel/lantiq/ltq-atm/Makefile +++ b/package/kernel/lantiq/ltq-atm/Makefile @@ -8,7 +8,6 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ltq-atm PKG_RELEASE:=2 -PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-atm-$(BUILD_VARIANT) PKG_MAINTAINER:=John Crispin PKG_LICENSE:=GPL-2.0+ diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c index 01a2e30abd..8777418dc5 100644 --- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c +++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c @@ -40,6 +40,7 @@ #include #include #include +#include #include /* @@ -80,7 +81,7 @@ */ static inline void init_pmu(void); static inline void uninit_pmu(void); -static inline void reset_ppe(void); +static inline void reset_ppe(struct platform_device *pdev); static inline void init_ema(void); static inline void init_mailbox(void); static inline void init_atm_tc(void); @@ -136,7 +137,7 @@ static inline void uninit_pmu(void) //PPE_TOP_PMU_SETUP(IFX_PMU_DISABLE);*/ } -static inline void reset_ppe(void) +static inline void reset_ppe(struct platform_device *pdev) { #if 0 //MODULE unsigned int etop_cfg; @@ -262,11 +263,11 @@ extern void ase_fw_ver(unsigned int *major, unsigned int *minor) *minor = FW_VER_ID->minor; } -void ase_init(void) +void ase_init(struct platform_device *pdev) { init_pmu(); - reset_ppe(); + reset_ppe(pdev); init_ema(); diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c index b68848b22d..2100aea81e 100644 --- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c +++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_ar9.c @@ -40,6 +40,7 @@ #include #include #include +#include #include /* @@ -83,7 +84,7 @@ */ static inline void init_pmu(void); static inline void uninit_pmu(void); -static inline void reset_ppe(void); +static inline void reset_ppe(struct platform_device *pdev); static inline void init_ema(void); static inline void init_mailbox(void); static inline void clear_share_buffer(void); @@ -125,7 +126,7 @@ static inline void uninit_pmu(void) { } -static inline void reset_ppe(void) +static inline void reset_ppe(struct platform_device *pdev) { #ifdef MODULE // reset PPE @@ -193,10 +194,10 @@ void ar9_fw_ver(unsigned int *major, unsigned int *minor) *minor = FW_VER_ID->minor; } -void ar9_init(void) +void ar9_init(struct platform_device *pdev) { init_pmu(); - reset_ppe(); + reset_ppe(pdev); init_ema(); init_mailbox(); clear_share_buffer(); diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h index 398be7d828..31b80cf86f 100644 --- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h +++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h @@ -34,7 +34,7 @@ #define SET_BITS(x, msb, lsb, value) (((x) & ~(((1 << ((msb) + 1)) - 1) ^ ((1 << (lsb)) - 1))) | (((value) & ((1 << (1 + (msb) - (lsb))) - 1)) << (lsb))) struct ltq_atm_ops { - void (*init)(void); + void (*init)(struct platform_device *pdev); void (*shutdown)(void); int (*start)(int pp32); diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c index 9bab5b4a98..8302ae743a 100644 --- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c +++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_danube.c @@ -40,6 +40,7 @@ #include #include #include +#include #include /* @@ -61,7 +62,7 @@ #define EMA_WRITE_BURST 0x2 #define EMA_READ_BURST 0x2 -static inline void reset_ppe(void); +static inline void reset_ppe(struct platform_device *pdev); #define IFX_PMU_MODULE_PPE_SLL01 BIT(19) #define IFX_PMU_MODULE_PPE_TC BIT(21) @@ -70,7 +71,7 @@ static inline void reset_ppe(void); #define IFX_PMU_MODULE_TPE BIT(13) #define IFX_PMU_MODULE_DSL_DFE BIT(9) -static inline void reset_ppe(void) +static inline void reset_ppe(struct platform_device *pdev) { /*#ifdef MODULE unsigned int etop_cfg; @@ -140,7 +141,7 @@ static void danube_fw_ver(unsigned int *major, unsigned int *minor) *minor = FW_VER_ID->minor; } -static void danube_init(void) +static void danube_init(struct platform_device *pdev) { volatile u32 *p = SB_RAM0_ADDR(0); unsigned int i; @@ -152,7 +153,7 @@ static void danube_init(void) IFX_PMU_MODULE_TPE | IFX_PMU_MODULE_DSL_DFE); - reset_ppe(); + reset_ppe(pdev); /* init ema */ IFX_REG_W32((EMA_CMD_BUF_LEN << 16) | (EMA_CMD_BASE_ADDR >> 2), EMA_CMDCFG); diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_vr9.c b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_vr9.c index 89c71e37e6..8638b12b4e 100644 --- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_vr9.c +++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_vr9.c @@ -40,6 +40,8 @@ #include #include #include +#include +#include #include #include "ifxmips_atm_core.h" @@ -56,21 +58,46 @@ #define IFX_PMU_MODULE_AHBS BIT(13) #define IFX_PMU_MODULE_DSL_DFE BIT(9) -static inline void vr9_reset_ppe(void) +static inline void vr9_reset_ppe(struct platform_device *pdev) { -/*#ifdef MODULE - // reset PPE - ifx_rcu_rst(IFX_RCU_DOMAIN_DSLDFE, IFX_RCU_MODULE_ATM); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) + struct device *dev = &pdev->dev; + struct reset_control *dsp; + struct reset_control *dfe; + struct reset_control *tc; + + dsp = devm_reset_control_get(dev, "dsp"); + if (IS_ERR(dsp)) { + if (PTR_ERR(dsp) != -EPROBE_DEFER) + dev_err(dev, "Failed to lookup dsp reset\n"); +// return PTR_ERR(dsp); + } + + dfe = devm_reset_control_get(dev, "dfe"); + if (IS_ERR(dfe)) { + if (PTR_ERR(dfe) != -EPROBE_DEFER) + dev_err(dev, "Failed to lookup dfe reset\n"); +// return PTR_ERR(dfe); + } + + tc = devm_reset_control_get(dev, "tc"); + if (IS_ERR(tc)) { + if (PTR_ERR(tc) != -EPROBE_DEFER) + dev_err(dev, "Failed to lookup tc reset\n"); +// return PTR_ERR(tc); + } + + reset_control_assert(dsp); udelay(1000); - ifx_rcu_rst(IFX_RCU_DOMAIN_DSLTC, IFX_RCU_MODULE_ATM); + reset_control_assert(dfe); udelay(1000); - ifx_rcu_rst(IFX_RCU_DOMAIN_PPE, IFX_RCU_MODULE_ATM); + reset_control_assert(tc); udelay(1000); *PP32_SRST &= ~0x000303CF; udelay(1000); *PP32_SRST |= 0x000303CF; udelay(1000); -#endif*/ +#endif } static inline int vr9_pp32_download_code(int pp32, u32 *code_src, unsigned int code_dword_len, u32 *data_src, unsigned int data_dword_len) @@ -107,7 +134,7 @@ static void vr9_fw_ver(unsigned int *major, unsigned int *minor) *minor = FW_VER_ID->minor; } -static void vr9_init(void) +static void vr9_init(struct platform_device *pdev) { volatile u32 *p; unsigned int i; @@ -120,7 +147,7 @@ static void vr9_init(void) IFX_PMU_MODULE_AHBS | IFX_PMU_MODULE_DSL_DFE); - vr9_reset_ppe(); + vr9_reset_ppe(pdev); /* pdma init */ IFX_REG_W32(0x08, PDMA_CFG); diff --git a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c index b7ac81ca80..267a515df6 100644 --- a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c +++ b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c @@ -289,9 +289,17 @@ static int ppe_ioctl(struct atm_dev *dev, unsigned int cmd, void *arg) return -ENOTTY; if ( _IOC_DIR(cmd) & _IOC_READ ) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) + ret = !access_ok(arg, _IOC_SIZE(cmd)); +#else ret = !access_ok(VERIFY_WRITE, arg, _IOC_SIZE(cmd)); +#endif else if ( _IOC_DIR(cmd) & _IOC_WRITE ) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) + ret = !access_ok(arg, _IOC_SIZE(cmd)); +#else ret = !access_ok(VERIFY_READ, arg, _IOC_SIZE(cmd)); +#endif if ( ret ) return -EFAULT; @@ -1777,7 +1785,7 @@ static int ltq_atm_probe(struct platform_device *pdev) goto INIT_PRIV_DATA_FAIL; } - ops->init(); + ops->init(pdev); init_rx_tables(); init_tx_tables(); diff --git a/package/kernel/lantiq/ltq-deu/Makefile b/package/kernel/lantiq/ltq-deu/Makefile index af299d8883..7bc9e8532d 100644 --- a/package/kernel/lantiq/ltq-deu/Makefile +++ b/package/kernel/lantiq/ltq-deu/Makefile @@ -8,7 +8,6 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ltq-deu PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-deu-$(BUILD_VARIANT) PKG_MAINTAINER:=John Crispin PKG_LICENSE:=GPL-2.0+ diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_md5.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_md5.c index 55cea1ccee..11cb64799e 100644 --- a/package/kernel/lantiq/ltq-deu/src/ifxmips_md5.c +++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_md5.c @@ -270,7 +270,7 @@ static struct shash_alg ifxdeu_md5_alg = { .cra_name = "md5", .cra_driver_name= "ifxdeu-md5", .cra_priority = 300, - .cra_flags = CRYPTO_ALG_TYPE_DIGEST, + .cra_flags = CRYPTO_ALG_TYPE_HASH, .cra_blocksize = MD5_HMAC_BLOCK_SIZE, .cra_module = THIS_MODULE, } diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_md5_hmac.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_md5_hmac.c index 46797c9724..6cb2e5a417 100644 --- a/package/kernel/lantiq/ltq-deu/src/ifxmips_md5_hmac.c +++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_md5_hmac.c @@ -346,7 +346,7 @@ static struct shash_alg ifxdeu_md5_hmac_alg = { .cra_driver_name= "ifxdeu-md5_hmac", .cra_priority = 400, .cra_ctxsize = sizeof(struct md5_hmac_ctx), - .cra_flags = CRYPTO_ALG_TYPE_DIGEST, + .cra_flags = CRYPTO_ALG_TYPE_HASH, .cra_blocksize = MD5_HMAC_BLOCK_SIZE, .cra_module = THIS_MODULE, } diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1.c index 968dc6fb68..d711c4804d 100644 --- a/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1.c +++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1.c @@ -259,7 +259,7 @@ static struct shash_alg ifxdeu_sha1_alg = { .cra_name = "sha1", .cra_driver_name= "ifxdeu-sha1", .cra_priority = 300, - .cra_flags = CRYPTO_ALG_TYPE_DIGEST, + .cra_flags = CRYPTO_ALG_TYPE_HASH, .cra_blocksize = SHA1_HMAC_BLOCK_SIZE, .cra_module = THIS_MODULE, } diff --git a/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1_hmac.c b/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1_hmac.c index 791b966755..7776c51686 100644 --- a/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1_hmac.c +++ b/package/kernel/lantiq/ltq-deu/src/ifxmips_sha1_hmac.c @@ -334,7 +334,7 @@ static struct shash_alg ifxdeu_sha1_hmac_alg = { .cra_driver_name= "ifxdeu-sha1_hmac", .cra_priority = 400, .cra_ctxsize = sizeof(struct sha1_hmac_ctx), - .cra_flags = CRYPTO_ALG_TYPE_DIGEST, + .cra_flags = CRYPTO_ALG_TYPE_HASH, .cra_blocksize = SHA1_HMAC_BLOCK_SIZE, .cra_module = THIS_MODULE, } diff --git a/package/kernel/lantiq/ltq-ifxos/Makefile b/package/kernel/lantiq/ltq-ifxos/Makefile index 4771fda20a..4a368309d3 100644 --- a/package/kernel/lantiq/ltq-ifxos/Makefile +++ b/package/kernel/lantiq/ltq-ifxos/Makefile @@ -17,7 +17,6 @@ PKG_MAINTAINER:=John Crispin PKG_LICENSE:=GPL-2.0 BSD-2-Clause PKG_LICENSE_FILES:=LICENSE -PKG_ASLR_PIE:=0 PKG_FIXUP:=autoreconf include $(INCLUDE_DIR)/package.mk diff --git a/package/kernel/lantiq/ltq-ifxos/patches/200-Fix-app-compilation-failure-from-inclusion-of-wrong-.patch b/package/kernel/lantiq/ltq-ifxos/patches/200-Fix-app-compilation-failure-from-inclusion-of-wrong-.patch index 5d661db861..453d85849b 100644 --- a/package/kernel/lantiq/ltq-ifxos/patches/200-Fix-app-compilation-failure-from-inclusion-of-wrong-.patch +++ b/package/kernel/lantiq/ltq-ifxos/patches/200-Fix-app-compilation-failure-from-inclusion-of-wrong-.patch @@ -32,7 +32,7 @@ Compiling against glibc can fail with the following errors ^ Makefile:1945: recipe for target 'libifxos_a-ifxos_linux_device_access_appl.o' failed -Ref: https://bugs.lede-project.org/index.php?do=details&task_id=1196 +Ref: https://bugs.openwrt.org/index.php?do=details&task_id=1196 --- src/Makefile.am | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/package/kernel/lantiq/ltq-ptm/Makefile b/package/kernel/lantiq/ltq-ptm/Makefile index 13831a2b6f..8f4db69411 100644 --- a/package/kernel/lantiq/ltq-ptm/Makefile +++ b/package/kernel/lantiq/ltq-ptm/Makefile @@ -8,8 +8,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ltq-ptm -PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-ptm-$(BUILD_VARIANT) +PKG_RELEASE:=2 PKG_MAINTAINER:=John Crispin PKG_LICENSE:=GPL-2.0+ diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c index 43e171a2b4..186c848693 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c @@ -44,6 +44,8 @@ #include #include #include +#include +#include #include /* @@ -1448,6 +1450,19 @@ static int ptm_showtime_exit(void) } +static const struct of_device_id ltq_ptm_match[] = { +#ifdef CONFIG_DANUBE + { .compatible = "lantiq,ppe-danube", .data = NULL }, +#elif defined CONFIG_AMAZON_SE + { .compatible = "lantiq,ppe-ase", .data = NULL }, +#elif defined CONFIG_AR9 + { .compatible = "lantiq,ppe-arx100", .data = NULL }, +#elif defined CONFIG_VR9 + { .compatible = "lantiq,ppe-xrx200", .data = NULL }, +#endif + {}, +}; +MODULE_DEVICE_TABLE(of, ltq_ptm_match); /* * #################################### @@ -1465,7 +1480,7 @@ static int ptm_showtime_exit(void) * 0 --- successful * else --- failure, usually it is negative value of error code */ -static int ifx_ptm_init(void) +static int ltq_ptm_probe(struct platform_device *pdev) { int ret; struct port_cell_info port_cell = {0}; @@ -1481,7 +1496,7 @@ static int ifx_ptm_init(void) goto INIT_PRIV_DATA_FAIL; } - ifx_ptm_init_chip(); + ifx_ptm_init_chip(pdev); init_tables(); for ( i = 0; i < ARRAY_SIZE(g_net_dev); i++ ) { @@ -1570,7 +1585,7 @@ INIT_PRIV_DATA_FAIL: * Output: * none */ -static void __exit ifx_ptm_exit(void) +static int ltq_ptm_remove(struct platform_device *pdev) { int i; @@ -1595,7 +1610,20 @@ static void __exit ifx_ptm_exit(void) ifx_ptm_uninit_chip(); clear_priv_data(); + + return 0; } -module_init(ifx_ptm_init); -module_exit(ifx_ptm_exit); +static struct platform_driver ltq_ptm_driver = { + .probe = ltq_ptm_probe, + .remove = ltq_ptm_remove, + .driver = { + .name = "ptm", + .owner = THIS_MODULE, + .of_match_table = ltq_ptm_match, + }, +}; + +module_platform_driver(ltq_ptm_driver); + +MODULE_LICENSE("GPL"); diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.h b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.h index de307bf732..6d1cbc7ea3 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.h +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.h @@ -122,7 +122,7 @@ extern unsigned int ifx_ptm_dbg_enable; extern void ifx_ptm_get_fw_ver(unsigned int *major, unsigned int *minor); -extern void ifx_ptm_init_chip(void); +extern void ifx_ptm_init_chip(struct platform_device *pdev); extern void ifx_ptm_uninit_chip(void); extern int ifx_pp32_start(int pp32); diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_amazon_se.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_amazon_se.c index 077c900e27..81ed7f7805 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_amazon_se.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_amazon_se.c @@ -40,6 +40,8 @@ #include #include #include +#include +#include #include /* @@ -84,7 +86,7 @@ */ static inline void init_pmu(void); static inline void uninit_pmu(void); -static inline void reset_ppe(void); +static inline void reset_ppe(struct platform_device *pdev); static inline void init_ema(void); static inline void init_mailbox(void); static inline void init_atm_tc(void); @@ -129,7 +131,7 @@ static inline void uninit_pmu(void) //PPE_TOP_PMU_SETUP(IFX_PMU_DISABLE); } -static inline void reset_ppe(void) +static inline void reset_ppe(struct platform_device *pdev) { #ifdef MODULE unsigned int etop_cfg; @@ -260,11 +262,11 @@ extern void ifx_ptm_get_fw_ver(unsigned int *major, unsigned int *minor) *minor = FW_VER_ID->minor; } -void ifx_ptm_init_chip(void) +void ifx_ptm_init_chip(struct platform_device *pdev) { init_pmu(); - reset_ppe(); + reset_ppe(pdev); init_ema(); diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_ar9.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_ar9.c index 777d5cfc9b..2f108286e2 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_ar9.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_ar9.c @@ -40,6 +40,8 @@ #include #include #include +#include +#include #include /* @@ -80,7 +82,7 @@ */ static inline void init_pmu(void); static inline void uninit_pmu(void); -static inline void reset_ppe(void); +static inline void reset_ppe(struct platform_device *pdev); static inline void init_ema(void); static inline void init_mailbox(void); static inline void init_atm_tc(void); @@ -130,7 +132,7 @@ static inline void uninit_pmu(void) } -static inline void reset_ppe(void) +static inline void reset_ppe(struct platform_device *pdev) { #ifdef MODULE // reset PPE @@ -283,11 +285,11 @@ void ifx_ptm_get_fw_ver(unsigned int *major, unsigned int *minor) *minor = FW_VER_ID->minor; } -void ifx_ptm_init_chip(void) +void ifx_ptm_init_chip(struct platform_device *pdev) { init_pmu(); - reset_ppe(); + reset_ppe(pdev); init_ema(); diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_danube.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_danube.c index 279b03ba3a..47ee4110a3 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_danube.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_danube.c @@ -40,6 +40,8 @@ #include #include #include +#include +#include #include /* @@ -79,7 +81,7 @@ */ static inline void init_pmu(void); static inline void uninit_pmu(void); -static inline void reset_ppe(void); +static inline void reset_ppe(struct platform_device *pdev); static inline void init_ema(void); static inline void init_mailbox(void); static inline void init_atm_tc(void); @@ -125,7 +127,7 @@ static inline void uninit_pmu(void) IFX_PMU_MODULE_DSL_DFE); } -static inline void reset_ppe(void) +static inline void reset_ppe(struct platform_device *pdev) { #ifdef MODULE /*unsigned int etop_cfg; @@ -255,11 +257,11 @@ extern void ifx_ptm_get_fw_ver(unsigned int *major, unsigned int *minor) *minor = FW_VER_ID->minor; } -void ifx_ptm_init_chip(void) +void ifx_ptm_init_chip(struct platform_device *pdev) { init_pmu(); - reset_ppe(); + reset_ppe(pdev); init_ema(); diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c index 9cfeefd80e..46a52e29d8 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include "ifxmips_ptm_vdsl.h" #include @@ -334,6 +336,9 @@ static int ptm_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) dma_cache_wback((unsigned long)skb->data, skb->len); } + /* make the skb unowned */ + skb_orphan(skb); + *(struct sk_buff **)((unsigned int)skb->data - byteoff - sizeof(struct sk_buff *)) = skb; /* write back to physical memory */ dma_cache_wback((unsigned long)skb->data - byteoff - sizeof(struct sk_buff *), skb->len + byteoff + sizeof(struct sk_buff *)); @@ -971,9 +976,21 @@ static int ptm_showtime_exit(void) return 0; } +static const struct of_device_id ltq_ptm_match[] = { +#ifdef CONFIG_DANUBE + { .compatible = "lantiq,ppe-danube", .data = NULL }, +#elif defined CONFIG_AMAZON_SE + { .compatible = "lantiq,ppe-ase", .data = NULL }, +#elif defined CONFIG_AR9 + { .compatible = "lantiq,ppe-arx100", .data = NULL }, +#elif defined CONFIG_VR9 + { .compatible = "lantiq,ppe-xrx200", .data = NULL }, +#endif + {}, +}; +MODULE_DEVICE_TABLE(of, ltq_ptm_match); - -static int ifx_ptm_init(void) +static int ltq_ptm_probe(struct platform_device *pdev) { int ret; int i; @@ -986,7 +1003,7 @@ static int ifx_ptm_init(void) goto INIT_PRIV_DATA_FAIL; } - ifx_ptm_init_chip(); + ifx_ptm_init_chip(pdev); ret = init_tables(); if ( ret != 0 ) { err("INIT_TABLES_FAIL"); @@ -1068,7 +1085,7 @@ INIT_PRIV_DATA_FAIL: return ret; } -static void __exit ifx_ptm_exit(void) +static int ltq_ptm_remove(struct platform_device *pdev) { int i; ifx_mei_atm_showtime_enter = NULL; @@ -1092,6 +1109,8 @@ static void __exit ifx_ptm_exit(void) ifx_ptm_uninit_chip(); clear_priv_data(); + + return 0; } #ifndef MODULE @@ -1120,8 +1139,17 @@ static int __init queue_gamma_map_setup(char *line) return 0; } #endif -module_init(ifx_ptm_init); -module_exit(ifx_ptm_exit); +static struct platform_driver ltq_ptm_driver = { + .probe = ltq_ptm_probe, + .remove = ltq_ptm_remove, + .driver = { + .name = "ptm", + .owner = THIS_MODULE, + .of_match_table = ltq_ptm_match, + }, +}; + +module_platform_driver(ltq_ptm_driver); #ifndef MODULE __setup("wanqos_en=", wanqos_en_setup); __setup("queue_gamma_map=", queue_gamma_map_setup); diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.h b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.h index b06232d0f8..c0318805c5 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.h +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.h @@ -113,7 +113,7 @@ extern unsigned int ifx_ptm_dbg_enable; extern void ifx_ptm_get_fw_ver(unsigned int *major, unsigned int *minor); -extern void ifx_ptm_init_chip(void); +extern void ifx_ptm_init_chip(struct platform_device *pdev); extern void ifx_ptm_uninit_chip(void); extern int ifx_pp32_start(int pp32); diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c index 0a02569cef..cf0897b563 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vr9.c @@ -40,6 +40,8 @@ #include #include #include +#include +#include #include /* @@ -52,7 +54,7 @@ static inline void init_pmu(void); static inline void uninit_pmu(void); -static inline void reset_ppe(void); +static inline void reset_ppe(struct platform_device *pdev); static inline void init_pdma(void); static inline void init_mailbox(void); static inline void init_atm_tc(void); @@ -80,21 +82,46 @@ static inline void uninit_pmu(void) { } -static inline void reset_ppe(void) +static inline void reset_ppe(struct platform_device *pdev) { -/*#ifdef MODULE - // reset PPE - ifx_rcu_rst(IFX_RCU_DOMAIN_DSLDFE, IFX_RCU_MODULE_PTM); - udelay(1000); - ifx_rcu_rst(IFX_RCU_DOMAIN_DSLTC, IFX_RCU_MODULE_PTM); - udelay(1000); - ifx_rcu_rst(IFX_RCU_DOMAIN_PPE, IFX_RCU_MODULE_PTM); - udelay(1000); - *PP32_SRST &= ~0x000303CF; - udelay(1000); - *PP32_SRST |= 0x000303CF; - udelay(1000); -#endif*/ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) + struct device *dev = &pdev->dev; + struct reset_control *dsp; + struct reset_control *dfe; + struct reset_control *tc; + + dsp = devm_reset_control_get(dev, "dsp"); + if (IS_ERR(dsp)) { + if (PTR_ERR(dsp) != -EPROBE_DEFER) + dev_err(dev, "Failed to lookup dsp reset\n"); +// return PTR_ERR(dsp); + } + + dfe = devm_reset_control_get(dev, "dfe"); + if (IS_ERR(dfe)) { + if (PTR_ERR(dfe) != -EPROBE_DEFER) + dev_err(dev, "Failed to lookup dfe reset\n"); +// return PTR_ERR(dfe); + } + + tc = devm_reset_control_get(dev, "tc"); + if (IS_ERR(tc)) { + if (PTR_ERR(tc) != -EPROBE_DEFER) + dev_err(dev, "Failed to lookup tc reset\n"); +// return PTR_ERR(tc); + } + + reset_control_assert(dsp); + udelay(1000); + reset_control_assert(dfe); + udelay(1000); + reset_control_assert(tc); + udelay(1000); + *PP32_SRST &= ~0x000303CF; + udelay(1000); + *PP32_SRST |= 0x000303CF; + udelay(1000); +#endif } static inline void init_pdma(void) @@ -230,11 +257,11 @@ extern void ifx_ptm_get_fw_ver(unsigned int *major, unsigned int *minor) *minor = FW_VER_ID->minor; } -void ifx_ptm_init_chip(void) +void ifx_ptm_init_chip(struct platform_device *pdev) { init_pmu(); - reset_ppe(); + reset_ppe(pdev); init_pdma(); diff --git a/package/kernel/lantiq/ltq-tapi/Makefile b/package/kernel/lantiq/ltq-tapi/Makefile index 171103350e..072041c589 100644 --- a/package/kernel/lantiq/ltq-tapi/Makefile +++ b/package/kernel/lantiq/ltq-tapi/Makefile @@ -17,7 +17,6 @@ PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources PKG_HASH:=109374d52872716570fca3fef3b93c9a93159a804dfd42484b19152b825af5c0 PKG_MAINTAINER:=John Crispin -PKG_ASLR_PIE:=0 PKG_CHECK_FORMAT_SECURITY:=0 PKG_FIXUP:=autoreconf diff --git a/package/kernel/lantiq/ltq-tapi/patches/010-fix-compile.patch b/package/kernel/lantiq/ltq-tapi/patches/010-fix-compile.patch index 051e25d3ad..0407b38b6f 100644 --- a/package/kernel/lantiq/ltq-tapi/patches/010-fix-compile.patch +++ b/package/kernel/lantiq/ltq-tapi/patches/010-fix-compile.patch @@ -6,7 +6,7 @@ #include +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) + #include -+ #include ++ #include +#endif #undef CONFIG_DEVFS_FS #ifndef UTS_RELEASE diff --git a/package/kernel/lantiq/ltq-tapi/patches/400-linux-415.patch b/package/kernel/lantiq/ltq-tapi/patches/400-linux-415.patch new file mode 100644 index 0000000000..cddb1b6553 --- /dev/null +++ b/package/kernel/lantiq/ltq-tapi/patches/400-linux-415.patch @@ -0,0 +1,48 @@ +--- a/src/drv_tapi_linux.c ++++ b/src/drv_tapi_linux.c +@@ -119,7 +119,11 @@ struct _TAPI_FD_PRIV_DATA + /* ============================= */ + /* Local Functions */ + /* ============================= */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) + static IFX_void_t TAPI_timer_call_back (IFX_ulong_t arg); ++#else ++static IFX_void_t TAPI_timer_call_back (struct timer_list *t); ++#endif + #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)) + static IFX_void_t TAPI_tqueue (IFX_void_t *pWork); + #else /* for Kernel newer or equal 2.6.20 */ +@@ -3384,11 +3388,15 @@ Timer_ID TAPI_Create_Timer(TIMER_ENTRY p + pTimerData->nArgument = nArgument; + pTimerData->bStopped = IFX_FALSE; + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)) + init_timer(&(pTimerData->Timer_List)); + + /* set timer call back function */ + pTimerData->Timer_List.function = TAPI_timer_call_back; + pTimerData->Timer_List.data = (IFX_ulong_t) pTimerData; ++#else ++ timer_setup(&(pTimerData->Timer_List), TAPI_timer_call_back, 0); ++#endif + + /* Initialize Timer Task */ + #ifdef LINUX_2_6 +@@ -3529,9 +3537,17 @@ static IFX_void_t TAPI_tqueue (struct wo + + \param arg Pointer to corresponding timer ID. + */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) + static IFX_void_t TAPI_timer_call_back (IFX_ulong_t arg) ++#else ++static IFX_void_t TAPI_timer_call_back (struct timer_list *t) ++#endif + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) + Timer_ID Timer = (Timer_ID) arg; ++#else ++ Timer_ID Timer = from_timer(Timer, t, Timer_List); ++#endif + /* do the operation in process context, + not in interrupt context */ + #ifdef LINUX_2_6 diff --git a/package/kernel/lantiq/ltq-vdsl-fw/Makefile b/package/kernel/lantiq/ltq-vdsl-fw/Makefile index 8186e657e7..336fc2e5e3 100644 --- a/package/kernel/lantiq/ltq-vdsl-fw/Makefile +++ b/package/kernel/lantiq/ltq-vdsl-fw/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ltq-vdsl-fw PKG_VERSION:=6.8.6 -PKG_RELEASE:=1 +PKG_RELEASE:=3 PKG_MAINTAINER:=Daniel Golle diff --git a/package/kernel/lantiq/ltq-vdsl-fw/src/vdsl_fw_install.sh b/package/kernel/lantiq/ltq-vdsl-fw/src/vdsl_fw_install.sh index 9242e175c0..e372e95c57 100755 --- a/package/kernel/lantiq/ltq-vdsl-fw/src/vdsl_fw_install.sh +++ b/package/kernel/lantiq/ltq-vdsl-fw/src/vdsl_fw_install.sh @@ -1,9 +1,9 @@ #!/bin/sh -FW="/tmp/firmware-speedport-w921v-1.44.000.bin" -URL="https://www.telekom.de/hilfe/downloads/firmware-speedport-w921v-1.44.000.bin" +FW="/tmp/firmware-speedport-w921v-1.46.000.bin" +URL="https://www.telekom.de/hilfe/downloads/firmware-speedport-w921v-1.46.000.bin" FW_TAPI="vr9_tapi_fw.bin" FW_DSL="vr9_dsl_fw_annex_b.bin" -MD5_FW="cefbeb7073e02e0fa4ddb6b31ecb3d1e" +MD5_FW="188734c0773b225f8c130984b279621a" MD5_TAPI="57f2d07f59e11250ce1219bad99c1eda" MD5_DSL="655442e31deaa42c9c68944869361ec0" diff --git a/package/kernel/lantiq/ltq-vdsl-fw/src/w921v_fw_cutter.c b/package/kernel/lantiq/ltq-vdsl-fw/src/w921v_fw_cutter.c index 6082bdadb6..8dc392914c 100644 --- a/package/kernel/lantiq/ltq-vdsl-fw/src/w921v_fw_cutter.c +++ b/package/kernel/lantiq/ltq-vdsl-fw/src/w921v_fw_cutter.c @@ -26,7 +26,7 @@ #include "LzmaWrapper.h" -#define FW_NAME "/tmp/firmware-speedport-w921v-1.44.000.bin" +#define FW_NAME "/tmp/firmware-speedport-w921v-1.46.000.bin" #define MAGIC 0x50 #define MAGIC_SZ 0x3FFC00 @@ -78,7 +78,7 @@ int main(int argc, char **argv) if (stat(FW_NAME, &s) != 0) { printf("Failed to find %s\n", FW_NAME); - printf("Ask Google or try https://www.telekom.de/hilfe/downloads/firmware-speedport-w921v-1.44.000.bin\n"); + printf("Ask Google or try https://www.telekom.de/hilfe/downloads/firmware-speedport-w921v-1.45.000.bin\n"); return -1; } diff --git a/package/kernel/lantiq/ltq-vdsl-mei/Makefile b/package/kernel/lantiq/ltq-vdsl-mei/Makefile index 9597de0072..5d15f2650b 100644 --- a/package/kernel/lantiq/ltq-vdsl-mei/Makefile +++ b/package/kernel/lantiq/ltq-vdsl-mei/Makefile @@ -22,8 +22,6 @@ PKG_MAINTAINER:=John Crispin PKG_LICENSE:=GPL-2.0 BSD-2-Clause PKG_LICENSE_FILES:=LICENSE -PKG_ASLR_PIE:=0 - include $(INCLUDE_DIR)/package.mk define KernelPackage/ltq-vdsl-vr9-mei @@ -40,7 +38,7 @@ define KernelPackage/ltq-vdsl-vr9-mei/description endef -define Package/ltq-vdsl-mei_test +define Package/ltq-vdsl-mei-test SECTION:=net CATEGORY:=Network TITLE:=Lantiq mei driver test tool @@ -48,7 +46,7 @@ define Package/ltq-vdsl-mei_test DEPENDS:=@TARGET_lantiq_xrx200 endef -define Package/ltq-vdsl-mei_test/description +define Package/ltq-vdsl-mei-test/description Userland tool to directly control the mei driver, this is only needed for test and development purposes. endef @@ -82,9 +80,9 @@ endef $(eval $(call KernelPackage,ltq-vdsl-vr9-mei)) -define Package/ltq-vdsl-mei_test/install +define Package/ltq-vdsl-mei-test/install $(INSTALL_DIR) $(1)/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mei_cpe_drv_test $(1)/bin endef -$(eval $(call BuildPackage,ltq-vdsl-mei_test)) +$(eval $(call BuildPackage,ltq-vdsl-mei-test)) diff --git a/package/kernel/lantiq/ltq-vdsl/Makefile b/package/kernel/lantiq/ltq-vdsl/Makefile index cf3711beb7..d518bd647d 100644 --- a/package/kernel/lantiq/ltq-vdsl/Makefile +++ b/package/kernel/lantiq/ltq-vdsl/Makefile @@ -19,7 +19,6 @@ PKG_HASH:=b4966a60653acc49254b168c6cc9c49eb36c54548e763617788aa4f252a29f21 PKG_LICENSE:=GPL-2.0 BSD-2-Clause PKG_LICENSE_FILES:=LICENSE -PKG_ASLR_PIE:=0 PKG_FIXUP:=autoreconf PKG_MAINTAINER:=John Crispin diff --git a/package/kernel/lantiq/ltq-vdsl/patches/100-compat.patch b/package/kernel/lantiq/ltq-vdsl/patches/100-compat.patch index a8ce61fa36..28d1da7c33 100644 --- a/package/kernel/lantiq/ltq-vdsl/patches/100-compat.patch +++ b/package/kernel/lantiq/ltq-vdsl/patches/100-compat.patch @@ -35,7 +35,28 @@ #endif if (pINode == DSL_NULL) -@@ -1203,6 +1197,9 @@ static void DSL_DRV_NlSendMsg(DSL_char_t +@@ -917,12 +911,19 @@ DSL_int32_t DSL_DRV_ThreadShutdown( + + DSL_uint32_t DSL_DRV_SysTimeGet(DSL_uint32_t nOffset) + { +- struct timeval tv; + DSL_uint32_t nTime = 0; ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)) ++ struct timeval tv; + + memset(&tv, 0, sizeof(tv)); + do_gettimeofday(&tv); + nTime = (DSL_uint32_t)tv.tv_sec; ++#else ++ struct timespec64 now; ++ ++ ktime_get_real_ts64(&now); ++ nTime = (DSL_uint32_t)now.tv_sec; ++#endif + + if ( (nOffset == 0) || (nOffset > nTime) ) + { +@@ -1203,6 +1204,9 @@ static void DSL_DRV_NlSendMsg(DSL_char_t } #endif @@ -45,7 +66,7 @@ /* Entry point of driver */ int __init DSL_ModuleInit(void) { -@@ -1241,6 +1238,10 @@ int __init DSL_ModuleInit(void) +@@ -1241,6 +1245,10 @@ int __init DSL_ModuleInit(void) DSL_DRV_DevNodeInit(); @@ -56,7 +77,7 @@ return 0; } -@@ -1248,6 +1249,11 @@ void __exit DSL_ModuleCleanup(void) +@@ -1248,6 +1256,11 @@ void __exit DSL_ModuleCleanup(void) { printk("Module will be unloaded"DSL_DRV_CRLF); diff --git a/package/kernel/lantiq/ltq-vmmc/Makefile b/package/kernel/lantiq/ltq-vmmc/Makefile index e44b509b2e..99263cce43 100644 --- a/package/kernel/lantiq/ltq-vmmc/Makefile +++ b/package/kernel/lantiq/ltq-vmmc/Makefile @@ -17,7 +17,6 @@ PKG_HASH:=707f515eb727c032418c4da67d7e86884bb56cdc2a606e8f6ded6057d8767e57 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources PKG_MAINTAINER:=John Crispin -PKG_ASLR_PIE:=0 PKG_CHECK_FORMAT_SECURITY:=0 PKG_FIXUP:=autoreconf