| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
Convert users to the generic "openwrt,uimage" using device specific
"openwrt,ih-magic" properties, and remove "allnet,uimage".
Signed-off-by: Bjørn Mork <bjorn@mork.no>
|
|
|
|
|
|
|
|
|
| |
The only difference between the "openwrt,okli" and the generic
parser is the magic. Set this in device tree for all affected
devices and remove the "openwrt,okli" parser.
Tested-by: Michael Pratt <mcpratt@protonmail.com> # EAP300 v2, ENS202EXT and ENH202
Signed-off-by: Bjørn Mork <bjorn@mork.no>
|
|
|
|
|
|
|
| |
Many devices use uimages with non-standard magic values. Let
device tree override the default magic.
Signed-off-by: Bjørn Mork <bjorn@mork.no>
|
|
|
|
|
|
|
|
| |
Convert users of the "fonfxc" and "sge" parsers to the generic
"openwrt,uimage", using device specific "openwrt,padding" properties.
Tested-by: Stijn Segers <foss@volatilesystems.org> [DIR-878 A1]
Signed-off-by: Bjørn Mork <bjorn@mork.no>
|
|
|
|
|
|
|
| |
An "openwrt,padding" property in device tree can replace two device
specific parsers.
Signed-off-by: Bjørn Mork <bjorn@mork.no>
|
|
|
|
|
|
|
| |
Add devicetree bindings for vendor specific variants of U-Boot
Images, as defined by OpenWrt.
Signed-off-by: Bjørn Mork <bjorn@mork.no>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's required for BCM4908. It cannot use "bcm-wfi-fw" parser because
that one requires *two* JFFS2 partitions which is untested / unsupported
on the BCM4908 architecture. With a single JFFS2 partition "bcm-wfi-fw"
parser will:
1. Fail to find "vmlinux.lz" as it doesn't follow "1-openwrt" file
2. Create partitions that don't precisely match bootfs layout
The new parser is described in details in the MTD_SPLIT_CFE_BOOTFS
symbol help message.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
|
|
|
|
|
| |
Also remove the leftover kernel hack that adds support for it
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
|
|
|
|
| |
The ID is used be a Realtek based switch made by Netgear.
Signed-off-by: John Crispin <john@phrozen.org>
|
|
|
|
|
|
|
| |
All targets that used mvsw61xx have switched to upstream mv88e6xxx DSA
driver, so it can be removed.
Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
|
|
|
|
|
|
| |
Preparation for supporting newer kernels
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
|
|
|
|
| |
Fixes build with newer kernels
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
This removes unneeded kernel version switches from the targets after
kernel 4.19 has been dropped.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
|
|
|
|
|
|
|
| |
Add support for uimage headers from ALLNET and provide support for the
SG8208M and SG8310PM devices' magic bytes.
Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To parse the ELF kernel loader, a small ELF parser is used that can
handle both ELF32 or ELF64 class loaders. The splitter assumes that the
kernel is always located before the rootfs, whether it is embedded in
the loader or not. If the kernel is located after the rootfs on the
firmware partition, then the rootfs splitter will include it in the
dynamically created rootfs_data partition and the kernel will be
corrupted.
The kernel image is preferably embedded inside the ELF loader, so the
end of the loader equals the end of the kernel partition. This is due to
the way mtd_find_rootfs_from searches for the the rootfs:
- if the kernel image is embedded in the loader, the appended rootfs may
follow the loader immediately, within the same erase block.
- if the kernel image is not embedded in the loader, but placed at some
offset behind the loader (OKLI-style loader), the rootfs must be
aligned to an erase-block after the loader and kernel image.
In case section header table is empty, determine the elf loader size by
finding the end of the last segment, as defined by the program header
table.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
|
|
|
|
|
|
| |
The test is meant to check the result of the preceding kmalloc()
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
|
|
|
|
|
|
|
|
|
|
| |
AR8327 datasheet[1] calls the register at address 0x0010
"Power-on Strapping Register". As it has nothing to do with "strip",
let's rename it to "POWER_ON_STRAP" to make it easier to grasp.
[1] https://lafibre.info/images/doc/201106_spec_AR8327.pdf
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
|
|
|
|
|
|
|
| |
Adding SGE parser for SGE (T&W) Shenzhen Gongjin Electronics
to add 96 bytes padding the the firmware image
Signed-off-by: Mathieu Martin-Borret <mathieu.mb@protonmail.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Tag was discovered exploring the hard_config of a "r2" board.
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
RouterBOOT cpu frequency settings are letter-indexed. Follow the
same logic for the sysfs interface.
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
|
|
|
|
|
|
|
| |
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")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The interface mode number of RGMII_33V is 7 on RTL8367, but it's 9 on
RTL8367B.
the external interface modes for RTL8367 are follows:
- 0, Disabled
- 1, RGMII
- 2, MII_MAC
- 3, MII_PHY
- 4, TMII_MAC
- 5, TMII_PHY
- 6, GMII
- 7, RGMII_33V
the external interface modes for RTL8367B are follows:
- 0, Disabled
- 1, RGMII
- 2, MII_MAC
- 3, MII_PHY
- 4, TMII_MAC
- 5, TMII_PHY
- 6, GMII
- 7, RMII_MAC
- 8, RMII_PHY
- 9, RGMII_33V
But the driver in U-Boot of RT-N56U GPL tar blocks using RGMII_33V (9)
mode and it seems to be unsupported on RTL8367B, so drop it from
switch-case in rtl8367b_extif_set_mode.
ref (RTL8367):
- TL-WR2453ND v1
ref (RTL8367B):
- ASUS RT-N56U
- TP-Link Archer C2 v1
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
|
|
|
|
| |
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
|
|
|
|
|
|
|
|
| |
This is useful when booting OpenWrt from ramdisks in order to have both
images partitions defined.
Furthermore, instead of always using img2 for the inactive image, let's use
img1 or img2 accordingly.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
|
|
|
|
|
|
|
| |
When firmware is flashed, cferam.000 extension is renamed to the next number.
When booting, CFE scans the NAND and picks the partition with the highest
cferam extension and ignores the other one.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
|
|
|
|
|
| |
Allow retrieving full file name and length by parameters.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
|
|
|
|
|
| |
Create new parse_bcm_wfi function with common code from current parsers.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
|
|
|
|
|
|
| |
The only Sercomm WFI user has been migrated to a dedicated firmware parser.
Keep support for no cferam partition based on a boolean DT property.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
|
|
|
|
|
|
|
| |
Sercomm uses 2 bootflag partitions and boots the firmware with the highest
bootflag. Support splitting the firmware partition while keeping support for
unsplitted layout.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
|
|
|
|
|
|
|
| |
- Rename master to mtd.
- Pass mtd size as an argument.
- Rename of_match_table.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit introduces support for R/W access to the CPU frequency
setting of routerboot on ath79 hardware.
On unsupported hardware, the sysfs attribute will expose the raw tag
value (read-only) to help with reverse engineering its meaning.
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
|
|
|
|
|
|
|
|
| |
This routine will be shared between hard and soft config drivers.
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This driver exposes the data encoded in the "soft_config" flash segment
of MikroTik RouterBOARDs devices. It presents the data in a sysfs folder
named "soft_config" through a set of human-and-machine-parseable
attributes. Changes can be discarded by writing 0 to the 'commit'
attribute, or they can be committed to flash storage by writing 1.
This driver does not reuse any of the existing code previously found in
the "rbcfg" utility and makes this utility obsolete by providing a clean
sysfs interface.
Like "rbcfg", this driver requires 4K_SECTORS support since the flash
partition in which these parameters are stored is typically 4KB in size.
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
|
|
|
|
|
|
|
|
|
| |
This routine will be shared between hard and soft config drivers.
Also use scnprintf() instead of snprintf().
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For the sake of strictly typed code, add a missing const qualifier.
Add a missing return value in error path.
Check the return value of mtd_read(), for good measure.
Also demote the error printks of failed sysfs file creation to warn
level since they are not fatal in the init() sequence.
Finally, add a note regarding PAGE_SIZE and clarify a comment.
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
|
|
|
|
|
|
|
|
|
| |
The depends and select should apply to the sysfs driver, not the meta
config.
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
|
|
|
|
|
|
| |
I meant it to be GPL-2.0-only, as evidenced by the boilerplate.
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
|
|
|
|
|
|
| |
I meant it to be GPL-2.0-only, as evidenced by the boilerplate.
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
|
|
|
|
|
|
| |
SERCOMM creates separates partitions for cferam.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
|
|
|
| |
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
|
|
|
|
|
|
| |
This drops the obsolete version switches for non-supported kernels
from local drivers in generic target.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
31e99fe3da which introduced this code was unfortunately untested.
This commit fixes a number of issues and works around the fact that in
this particular scheme, the LZO payload may be padded at the end which
will trigger a harmless lzo decompression error.
This commit also disambiguates the debug printks.
Tested-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Fixes: 31e99fe3da ("generic: platform/mikrotik: support LZOR encoding")
|
|
|
|
|
|
|
|
|
| |
An e-mail response from MikroTik contained a minimal overview
on hardware option bits which mentioned a currently unknown bit.
While not being too detailed what it does, add it for documentation purposes.
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
|
|
|
|
|
|
|
|
| |
Some newer MikroTik RouterBOARD devices use a new encoding scheme
for their WLAN calibration data. This patch provides support for
decoding this new scheme.
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This driver provides an OF MTD parser to properly assign the RouterBoot
partitions on the flash. This parser builds from the "fixed-partitions"
one (see ofpart.c), but it can handle dynamic partitions as found on
routerboot devices.
The parent node must contain the following:
compatible = "mikrotik,routerboot-partitions";
#address-cells = <1>;
#size-cells = <1>;
Children routerbootpart DTS nodes are defined as follows:
For fixed partitions
node-name@unit-address {
reg = <prop-encoded-array>;
label = <string>;
read-only;
lock;
};
All properties but reg are optional.
For dynamic partitions:
node-name {
size = <prop-encoded-array>;
label = <string>;
read-only;
lock;
};
size property is mandatory unless the next partition is a fixed one or
a "well-known" one (matched from the strings defined below) in which case
it can be omitted or set to 0; other properties are optional.
By default dynamic partitions are appended after the preceding one, except
for "well-known" ones which are automatically located on flash.
Well-known partitions (matched via label or node-name):
- "hard_config"
- "soft_config"
- "dtb_config"
This parser requires the DTS to list partitions in ascending order as
expected on the MTD device.
This parser has been successfully tested on BE (ath79) and LE (ipq40xx
and ramips) hardware.
Tested-by: Baptiste Jonglez <git@bitsofnetworks.org>
Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Tested-by: Tobias Schramm <t.schramm@manjaro.org>
Tested-by: Christopher Hill <ch6574@gmail.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
ar8229 and ar8236 don't allow unknown unicast/multicast frames and
broadcast frames to be flooded to cpu port. This isn't desired behavior
for swconfig as we treat it as a standalone switch.
Current code doesn't enable unicast frame flooding for ar8229 and uses
wrong setup for ar8236. This commit fixes both of them by enabling port
0 flooding for all unknown frames.
Fixes: FS#2848
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
|