generic: routerboot sysfs platform driver
authorThibaut VARÈNE <hacks@slashdirt.org>
Sun, 22 Mar 2020 20:46:42 +0000 (21:46 +0100)
committerKoen Vandeputte <koen.vandeputte@ncentric.com>
Fri, 8 May 2020 13:17:17 +0000 (15:17 +0200)
commit5ecf7d96540ffa7c7446fa75adfa9e118f211c16
treea8253300f346580bb9a92269c870bc7cc627ce7f
parent21869e8f80c0af3977bb5bffece6986a556cb389
generic: routerboot sysfs platform driver

This driver exposes the data encoded in the "hard_config" flash segment
of MikroTik RouterBOARDs devices. It presents the data in a sysfs folder
named "hard_config". The WLAN calibration data is available on demand via
the 'wlan_data' sysfs file in that folder.

This driver permanently allocates a chunk of RAM as large as the
"hard_config" MTD partition (typically 4KB), although it is technically
possible to operate entirely from the MTD device without using a local
buffer (except when requesting WLAN calibration data), at the cost of a
performance penalty.

This driver does not reuse any of the existing code previously found in
routerboot.c.

This driver has been successfully tested on BE (ath79) and LE (ipq40xx
and ramips) hardware.

Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Tested-by: Baptiste Jonglez <git@bitsofnetworks.org>
Tested-by: Tobias Schramm <t.schramm@manjaro.org>
Tested-by: Christopher Hill <ch6574@gmail.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
target/linux/generic/files/drivers/platform/mikrotik/Kconfig [new file with mode: 0644]
target/linux/generic/files/drivers/platform/mikrotik/Makefile [new file with mode: 0644]
target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c [new file with mode: 0644]
target/linux/generic/files/drivers/platform/mikrotik/routerboot.c [new file with mode: 0644]
target/linux/generic/files/drivers/platform/mikrotik/routerboot.h [new file with mode: 0644]