Commit Graph

35 Commits

Author SHA1 Message Date
Thibaut VARÈNE
8c4a4444cf
generic: platform/mikrotik: release mtd device after use
The code uses get_mtd_device_nm() which must be followed by a call to
put_mtd_device() once the handle is no longer used.

This fixes spurious shutdown console messages such as:
[ 2256.334562] Removing MTD device #7 (soft_config) with use count 1

Reported-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2021-05-13 22:42:13 +08:00
Thibaut VARÈNE
341983f234
generic: platform/mikrotik: implement multi caldata
MikroTik recently changed again the way they store wlan calibration data
on devices. Prior to this change, ERD calibration data for all available
radios was stored within a single identifier node ("tag" in RouterBoot
parlance).

Recent devices have been seen with calibration (and BDF) data stored in
separate identifiers within LZOR packing for each radio: this patch
addresses this by:
1) ensuring that both variants are properly supported,
2) preserving backward compatibility with existing data consumers,
3) allowing for more than 2 calibration blobs to be exposed via sysfs.

Specifically, before this patch, the driver would provide a single sysfs
file named /sys/firmware/mikrotik/hard_config/wlan_data that contained
whatever calibration data found on the device's flash. After this patch,
when executed on a device that uses the old style storage, this behavior
is unchanged, but when executed on a device that uses new style storage
(for either traditional "ERD" packing or "LZOR" packing), the driver
replaces that single file with a folder containing one or more files
each containing the data encoded within individual identifiers.

As far as OpenWRT is concerned, this means that for devices which are
known to exist with both styles of data storage, a suitable hotplug stub
could look like this for e.g. the second radio:

wdata="/sys/firmware/mikrotik/hard_config/wlan_data"
( [ -f "$wdata" ] && caldata_sysfsload_from_file "$wdata" 0x8000 0x2f20 ) || \
( [ -d "$wdata" ] && caldata_sysfsload_from_file "$wdata/data_2" 0x0 0x2f20 )

This patch has been tested with LZOR old and new style packing on ipq4019,
and with old style on ath79.

Tested-by: John Thomson <git@johnthomson.fastmail.com.au>
Tested-by: Шебанов Алексей <admin@ublaze.ru>
Tested-by: Alen Opačić <subixonfire@gmail.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Tested-by: Robert Marko <robimarko@gmail.com>
2020-11-14 13:47:42 +08:00
Thibaut VARÈNE
7fd272698f
generic: platform/mikrotik: fix incorrect test
The test is meant to check the result of the preceding kmalloc()

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2020-08-19 01:06:07 +08:00
AmadeusGhost
0ca6b90875 ramips/dir878: remove the original factory partition definition 2020-08-12 11:01:24 +08:00
Thibaut VARÈNE
96f44a4f9a generic: platform/mikrotik: add partial AR71xx cpufreq support
This patch adds cpu frequency setting for AR724x and AR7161.
It is unknown if all the AR71xx devices support the same value range,
so support is only enabled for AR7161 at this stage.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2020-07-09 12:01:05 +08:00
Thibaut VARÈNE
1affa1b432 generic: platform/mikrotik: add board_revision tag
Tag was discovered exploring the hard_config of a "r2" board.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2020-07-09 12:00:27 +08:00
Thibaut VARÈNE
332cdea2de generic: platform/mikrotik: graceful fallback for cpufreq_index
The current code would return an error on ath79 when the SoC isn't known
to the driver. Return the raw hex value instead, as happens with non
supported targets.
Also return the correctly incremented value from
sc_tag_cpufreq_ath79_arraysize()

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2020-07-09 11:59:47 +08:00
Thibaut VARÈNE
e61ff86eeb generic: platform/mikrotik: match RouterBOOT nomenclature
RouterBOOT cpu frequency settings are letter-indexed. Follow the
same logic for the sysfs interface.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2020-07-09 11:59:15 +08:00
Thibaut VARÈNE
ed8476472b generic: platform/mikrotik: fix routerboot_tag_show_u32s()
The routine would only accurately print out the first word.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Fixes: 5ecf7d96 ("generic: routerboot sysfs platform driver")
2020-07-09 11:58:17 +08:00
AmadeusGhost
9bfbdcb765 Merge Lean's source 2020-06-28 17:50:37 +08:00
coolsnowwolf
378ca0f03e x64: add EFI Image boot from emmc SSD support 2020-06-23 23:44:27 +08:00
AmadeusGhost
a273d13857 Merge Lean's source 2020-05-30 12:25:05 +08:00
AmadeusGhost
6105915786
Wireless: rollback with mac80211 (#4683)
mt76: fix build
ath10k-ct: rollback to 4.19
Revert "iw/iwinfo/mwlwifi: bump version"
Revert "mac80211/5.4: fix build on kernel 4.9"
Revert "mac80211: switch to upstream owl-loader driver"
2020-05-27 11:45:56 +08:00
Adrian Schmutzler
fbc87b6755 generic: drop outdated kernel version switches in local drivers
This drops the obsolete version switches for non-supported kernels
from local drivers in generic target.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-05-24 11:33:39 +08:00
AmadeusGhost
7d597c5347
mac80211: switch to upstream owl-loader driver (#4164)
The Owl Loader (named after the codename that Atheros gave
these devices back in the day) has been accepted upstream.

This patch removes the "misc" driver OpenWrt had and adds
the remaining differences against the version that ships
with 5.4-rc1 into a separate "120-owl-loader-compat.patch"
file that can be cut down once AR71XX is being dealt with.

Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-04-04 15:55:52 +08:00
AmadeusGhost
6f0cc1cdf1 mac80211: switch to upstream owl-loader driver 2020-04-04 01:05:15 +08:00
Alan Luck
4c8ded996c ramips: add support for Dlink DIR-878 A1
Specifications:
* SoC: MT7621AT
* RAM: 128MB
* Flash: 16MB NOR SPI flash
* WiFi: MT7615N (2.4GHz) and MT7615N (5Ghz)
* LAN: 5x1000M
* Firmware layout is Uboot with extra 96 bytes in header
* Base PCB is AP-MTKH7-0002
* LEDs Power Green,Power Orange,Internet Green,Internet Orange
* LEDs "2.4G" Green & "5G" Green connected directly to wifi module
* Buttons Reset,WPS,WIFI

Flash instruction:

Upload image via emergency recovery mode via Windows "not working with Linux"
Push and hold reset button (on the bottom of the device) until power led starts flashing (about 10 secs or so) while plugging in the power cable.
Give it ~30 seconds, to boot the recovery mode GUI
Connect your client computer to LAN1 of the device
Set your client IP address manually to 192.168.0.2 / 255.255.255.0.
Call the recovery page for the device at http://192.168.0.1
Use the provided emergency web GUI to upload and flash a new firmware to the device

MAC addresses:

lan      factory 0xe000 *:55 (label)
wan      factory 0xe006 *:58
2.4 GHz  factory 0x0004 *:56
5.0 GHz  factory 0x8004 *:57

Signed-off-by: Alan Luck <luckyhome2008@gmail.com>
2020-03-03 17:08:14 +08:00
AmadeusGhost
478a80a5dc drivers/mtd: update from official 2020-03-03 17:06:29 +08:00
Hauke Mehrtens
e6929ccefd kernel: Add missing includes mtdsplit_*.c
This fixes the following compile problem with kernel 4.9 on lantiq:
drivers/mtd/mtdsplit/mtdsplit_uimage.c:244:34: error: array type has incomplete element type 'struct of_device_id'
 static const struct of_device_id mtdsplit_uimage_of_match_table[] = {
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/mtd/mtdsplit/mtdsplit_uimage.c:245:4: error: field name not in record or union initializer
  { .compatible = "denx,uimage" },

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2020-02-27 22:15:36 +08:00
LEAN-ESX
7a5b4777ba generic ar8xxx: increase VLAN table for AR83x7 2019-12-05 08:36:33 -08:00
LEAN-ESX
4e99359819 netfilter: fix NAT packaging with kernels 5.2+ 2019-10-28 19:23:17 -07:00
coolsnowwolf
5f00fa0f8b ar71xx: backport kernel 4.9 support 2019-02-13 21:50:29 +08:00
coolsnowwolf
347daa04b2 Merge branch master of https://github.com/coolsnowwolf/lede 2019-01-03 19:29:28 +08:00
coolsnowwolf
d52748954a Revert "sync with upstream patch"
This reverts commit a01e7df608.
2019-01-03 15:20:58 +08:00
coolsnowwolf
a01e7df608 sync with upstream patch 2019-01-02 21:48:12 +08:00
coolsnowwolf
806f5db174 sync with OpenWrt trunk 2018-09-07 13:43:55 +08:00
coolsnowwolf
9ba04fd0d7 sync with OpenWrt v18.06.1 stable new R8.1 version 2018-08-23 17:40:23 +08:00
coolsnowwolf
bce04f5924 switch ar71xx to kernel 4.14 (including K2T 2018-06-13 10:39:07 +08:00
coolsnowwolf
8fe0636b8a Merge branch 'master' of github.com:lede-project/source 2018-04-23 18:50:49 +08:00
coolsnowwolf
229cde62a4 Merge branch 'master' of https://github.com/lede-project/source 2018-01-09 14:38:15 +08:00
coolsnowwolf
a0abc23836 kernel: Add kernel 4.14 support 2017-12-19 13:06:11 +08:00
coolsnowwolf
688513f8fc Revert "sync wireless drivers with LEDE 17.01.4 stable"
This reverts commit 9cf4daca93.
2017-11-04 14:53:16 +08:00
coolsnowwolf
9cf4daca93 sync wireless drivers with LEDE 17.01.4 stable 2017-11-03 13:06:57 +08:00
coolsnowwolf
03efb03919 Merge branch 'master' of https://github.com/lede-project/source 2017-09-12 01:07:20 +08:00
coolsnowwolf
97a4ffcc12 update source 2017-09-06 19:19:45 +08:00