aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files
Commit message (Collapse)AuthorAgeFilesLines
* kernel: ar8216: remove soft_resetDavid Bauer2021-06-031-8/+0
| | | | | | | | | | ar8xxx_soft_reset is effectively a NOP function. In the PHY state machine, the availability and result of a soft_reset function makes no difference for the code flow. Thus, we can safely remove this method. Signed-off-by: David Bauer <mail@david-bauer.net>
* kernel: ar8216: add get_features methodDavid Bauer2021-06-031-23/+20
| | | | | | | | | | | | | | Modifying PHY capabilities in the probe function broke with upstream commit 92ed2eb7f4b7 ("net: phy: probe the PHY before determining the supported features"). AR8316 switches only support 10/100 Mbit/s link modes because of this change. Provide a get_features method for the PHY driver, so Gigabit link mode will be advertised to link partners again. Signed-off-by: David Bauer <mail@david-bauer.net>
* generic: platform/mikrotik: release mtd device after useThibaut VARÈNE2021-05-122-2/+10
| | | | | | | | | | | | 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>
* lantiq: add Linux 5.10 support as testing kernelMathias Kresin2021-04-121-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following changes are made to the Lantiq kernel patches: 0001-MIPS-lantiq-add-pcie-driver.patch The pci header isn't included by the of_pci header any longer 0024-MIPS-lantiq-revert-DSA-switch-driver-PMU-clock-chang.patch Due to the merge of grx390 and ar10 clocks, extend support to grx390 0025-NET-MIPS-lantiq-adds-xrx200-legacy.patch The do_carrier arguments was dropped from phy_link_change. The phylib has always sets the third parameter to true so the flag is always changed anyway. of_get_phy_mode() returns an error, or 0 on success, and pass a pointer, of type phy_interface_t, where the phy mode should be stored now. So far an error wasn't considered. Print at least an error message if something unexpected happens. The stuck queue is now passed to xrx200_tx_timeout (the timeout handler) but not used so far. 0028-NET-lantiq-various-etop-fixes.patch ioremap has provided non-cached semantics by default since the Linux 2.6 days and was removed with kernel version 5.6. of_get_phy_mode() returns an error, or 0 on success, and pass a pointer, of type phy_interface_t, where the phy mode should be stored now. So far an error wasn't considered. Print at least an error message if something unexpected happens. 0042-arch-mips-increase-io_space_limit.patch Move IO space extension to laniq specific file Signed-off-by: Mathias Kresin <dev@kresin.me>
* kernel: support FIT partition parser on mtdblock devicesDaniel Golle2021-04-091-9/+8
| | | | | | | | | | | | | | | Allow using the FIT block-device partition partition parser to work on top of mtdblock devices. This is more tricky than it sounds as it requires to reorganize the procedure of registering mtdblock devices in order to avoid locking troubles caused by the block partition parsers then trying to open the mtdblock device for reading while locks are still being held. Fix that by moving the adding of the disks after the entire device has been probed when locks no longer need to be held. Also address issue with mtdsuper surfaced when using sub-partitions which prevented mounting JFFS2 using the /dev/mtdblock* device. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: mtdsplit_fit: support FIT with external dataDaniel Golle2021-04-091-39/+243
| | | | | | | | | | | | | | | | | | U-Boot has recently added support for having data blobs in uImage.FIT images stored at offsets after the FDT structure rather than embedding the data into the FDT structure itself. This is useful as it allows parts of the image to be mapped by the FIT partition parser, and it allows the FIT structure itself to be parsed more easily as it usually fits into single page. mtdsplit_fit assumed that the total length of an image is identical to the length of the FDT structure. For uImage.FIT with external data this assumption no longer holds true. Add support for uImage.FIT with external data to mtdsplit_fit and in in that case only split-off rootfs_data -- selecting and mapping rootfs partition is left to the block partition parser just like on UBI and block/GPT based platforms. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: create bootfs partition when parsing on BCM4908Rafał Miłecki2021-03-241-5/+9
| | | | | | | | It's helpful for accessing booting data (DTS, kernel, etc.). It has to be used carefully as CFE's JFFS2 support is quite dumb. It doesn't recognize deleted files and has problems handling 0 inode. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* kernel: b53: update the BCM5365 UID in the fixupDaniel González Cabanelas2021-03-051-2/+2
| | | | | | | | | | The BCM5365 UID was updated in the driver, but we should also update it in the fixup. Fixes: cbcac4fde8ba ("kernel: b53: update the BCM5365 UID") Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com> (Ammend commit description, add Fixes tag) Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* kernel: add support for enabling fit firmware partition parser via cmdlineFelix Fietkau2021-02-281-0/+6
| | | | | | | | | This is useful for dual-boot setups where the loader sets variables depending on the flash boot partition. For example the Linksys E8450 sets mtdparts=master for the first partition and mtdparts=slave for the second one. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* image: extend FIT partition parser for use on eMMC/SDcardDaniel Golle2021-02-281-12/+33
| | | | | | | | | | Introduce a magic GUID_PARTITION_LINUX_FIT_GUID to designate a GPT partition to be interpreted by the FIT partition parser. In that way, sub-partitions for (external-data) uImage.FIT stored directly in a partition can be split, similar like we do for devices with raw flash storage. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: b53: update the BCM5365 UIDDaniel González Cabanelas2021-02-261-2/+2
| | | | | | | | | | | | | | BCM63XX internal PHYs and BCM5365 SoC internal switch are both using the same phy_driver->phy_id, causing conflicts and unnecessary probes. E.g the BCM63XX phy internal IRQ is lost on the first probe. The full BCM5365 UID is 0x00406370. Use an additional byte to mask the BCM5365 UID to avoid duplicate driver phy_id's. This will fix the IRQ issue in internal BCM63XX PHYs and avoid more conflicts in the future. Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
* image: add support for building FIT image with filesystemDaniel Golle2021-02-241-0/+233
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow for single (external-data) FIT image to hold kernel, dtb and squashfs. In that way, the bootloader verifies the system integrity including the rootfs, because what's the point of checking that the hash of the kernel is correct if it won't boot in case of squashfs being corrupted? Better allow bootloader to check everything needed to make it at least up to failsafe mode. As a positive side effect this change also makes the sysupgrade process on nand potentially much easier as it is now. In short: mkimage has a parameter '-E' which allows generating FIT images with 'external' data rather than embedding the data into the device-tree blob itself. In this way, the FIT structure itself remains small and can be parsed easily (rather than having to page around megabytes of image content). This patch makes use of that and adds support for adding sub-images of type 'filesystem' which are used to store the squashfs. Now U-Boot can verify the whole OS and the new partition parsers added in the Linux kernel can detect the filesystem sub-images, create partitions for them, and select the active rootfs volume based on the configuration in FIT (passing configuration via device tree could be implemented easily at a later stage). This new FIT partition parser works for NOR flash (on top of mtdblock), NAND flash (on top of ubiblock) as well as classic block devices (ie. eMMC, SDcard, SATA, NVME, ...). It could even be used to mount such FIT images via `losetup -P` on a user PC if this patch gets included in Linux upstream one day ;) Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: mtdsplit: add support for BCM63XX CFE firmwareÁlvaro Fernández Rojas2021-02-223-0/+192
| | | | | | | | Broadcom CFE bootloader relies on a tag for identifying the current firmware, such as version, image start address, kernel address and size, rootfs size, board id, signatures, etc. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* generic: ar8216: update version switch for of_get_phy_mode fixAdrian Schmutzler2021-02-161-2/+2
| | | | | | | | | | | | | Kernel has changed the of_get_phy_mode API in commit 0c65b2b90d13 ("net: of_get_phy_mode: Change API to solve int/unit warnings"). This is already included in kernel 5.5, so fix the version switch (though this will not actually matter for the versions we support). Similar driver adjustments to account for the API change will probably be necessary to various other local drivers. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* generic: ar8216: fix kernel 5.10 compile errorDavid Bauer2021-02-161-0/+8
| | | | Signed-off-by: David Bauer <mail@david-bauer.net>
* kernel: add linux 5.10 supportFelix Fietkau2021-02-161-0/+8
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: convert UniFi Outdoor+ HSR support to OFDavid Bauer2021-02-011-2/+0
| | | | | | | | Enable support for the Ubiquiti UniFi Outdoor+ RF filter via device-tree. The old way of using platform data is not required anymore, as it was only used on the now removed ar71xx target. Signed-off-by: David Bauer <mail@david-bauer.net>
* kernel: mtdsplit_uimage: replace "edimax, uimage" parserBjørn Mork2021-01-222-99/+32
| | | | | | | | The "edimax,uimage"" parser can be replaced by the generic parser using device specific openwrt,partition-magic and openwrt,offset properties. Signed-off-by: Bjørn Mork <bjorn@mork.no>
* kernel: mtdsplit_uimage: add "openwrt, offset" and "openwrt, partition-magic"Bjørn Mork2021-01-221-12/+28
| | | | | | | | Some devices prepend a standard U-Boot Image with a vendor specific header, having its own magic. Adding two new properties will support validation of such images, including the additional magic. Signed-off-by: Bjørn Mork <bjorn@mork.no>
* kernel: mtdsplit_uimage: replace "netgear, uimage" parserBjørn Mork2021-01-221-67/+0
| | | | | | | | | | | | | | | | | | | The "netgear,uimage" parser can be replaced by the generic parser using device specific openwrt,ih-magic and openwrt,ih-type properties. Device tree properties for the following devices have not been set, as they have been dropped from OpenWrt with the removal of the ar71xx target: FW_MAGIC_WNR2000V1 0x32303031 FW_MAGIC_WNR2000V4 0x32303034 FW_MAGIC_WNR1000V2_VC 0x31303030 FW_MAGIC_WPN824N 0x31313030 Tested-by: Sander Vanheule <sander@svanheule.net> # WNDR3700v2 Tested-by: Stijn Segers <foss@volatilesystems.org> # WNDR3700v1 Signed-off-by: Bjørn Mork <bjorn@mork.no>
* kernel: mtdsplit_uimage: add "openwrt, ih-type" device-tree propertyBjørn Mork2021-01-221-10/+14
| | | | | | | Some devices use uimage headers with a non-default ih_type. Add support for overriding this in device tree. Signed-off-by: Bjørn Mork <bjorn@mork.no>
* kernel: mtdsplit_uimage: replace "allnet, uimage" parserBjørn Mork2021-01-221-49/+0
| | | | | | | 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>
* kernel: mtdsplit_uimage: replace "openwrt, okli" parserBjørn Mork2021-01-222-53/+5
| | | | | | | | | 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>
* kernel: mtdsplit_uimage: add "openwrt, ih-magic" device-tree propertyBjørn Mork2021-01-221-18/+23
| | | | | | | 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>
* kernel: mtdsplit_uimage: replace "fonfxc" and "sge" parsersBjørn Mork2021-01-221-85/+8
| | | | | | | | 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>
* kernel: mtdsplit_uimage: read extralen from device treeBjørn Mork2021-01-221-10/+14
| | | | | | | An "openwrt,padding" property in device tree can replace two device specific parsers. Signed-off-by: Bjørn Mork <bjorn@mork.no>
* dt-bindings: mtd: partitions: add OpenWrt defined U-Boot ImageBjørn Mork2021-01-222-0/+282
| | | | | | | Add devicetree bindings for vendor specific variants of U-Boot Images, as defined by OpenWrt. Signed-off-by: Bjørn Mork <bjorn@mork.no>
* kernel: add parser finding rootfs after CFE bootfsRafał Miłecki2021-01-223-0/+99
| | | | | | | | | | | | | | 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>
* kernel: remove an unused callback from the ip17xx switch driverFelix Fietkau2020-12-051-7/+0
| | | | | | Also remove the leftover kernel hack that adds support for it Signed-off-by: Felix Fietkau <nbd@nbd.name>
* kernel: add GS110TPPV1 support to mtdsplit_uimageJohn Crispin2020-11-261-3/+5
| | | | | | The ID is used be a Realtek based switch made by Netgear. Signed-off-by: John Crispin <john@phrozen.org>
* kernel: remove mvsw61xx swconfig driverDENG Qingfang2020-11-162-1402/+0
| | | | | | | 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>
* kernel: rename mtdpart_get_master to mtd_get_masterFelix Fietkau2020-11-131-1/+1
| | | | | | Preparation for supporting newer kernels Signed-off-by: Felix Fietkau <nbd@nbd.name>
* kernel: ip17xx: use pr_warn instead of pr_warningFelix Fietkau2020-11-131-3/+3
| | | | | | Fixes build with newer kernels Signed-off-by: Felix Fietkau <nbd@nbd.name>
* generic: platform/mikrotik: implement multi caldataThibaut VARÈNE2020-11-121-33/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* target: remove obsolete kernel version switches for 4.19Adrian Schmutzler2020-10-308-116/+2
| | | | | | | This removes unneeded kernel version switches from the targets after kernel 4.19 has been dropped. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* kernel: add support for ALLNET devices in mtdsplitBirger Koblitz2020-09-141-0/+50
| | | | | | | 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>
* kernel: mtdsplit: support ELF loader splittingSander Vanheule2020-09-093-0/+293
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* generic: platform/mikrotik: fix incorrect testThibaut VARÈNE2020-08-181-1/+1
| | | | | | The test is meant to check the result of the preceding kmalloc() Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
* treewide: rename POWER_ON_STRIP registerSungbo Eo2020-07-252-11/+11
| | | | | | | | | | 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>
* kernel: mtdsplit_uimage: add SGE parserMathieu Martin-Borret2020-07-131-0/+38
| | | | | | | 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>
* generic: platform/mikrotik: add partial AR71xx cpufreq supportThibaut VARÈNE2020-07-081-28/+71
| | | | | | | | 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>
* generic: platform/mikrotik: add board_revision tagThibaut VARÈNE2020-07-081-1/+6
| | | | | | Tag was discovered exploring the hard_config of a "r2" board. Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
* generic: platform/mikrotik: graceful fallback for cpufreq_indexThibaut VARÈNE2020-07-081-9/+12
| | | | | | | | | | 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>
* generic: platform/mikrotik: match RouterBOOT nomenclatureThibaut VARÈNE2020-07-081-18/+19
| | | | | | | RouterBOOT cpu frequency settings are letter-indexed. Follow the same logic for the sysfs interface. Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
* generic: platform/mikrotik: fix routerboot_tag_show_u32s()Thibaut VARÈNE2020-07-081-5/+5
| | | | | | | 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")
* kernel: rtl8367b: fix external interface modesINAGAKI Hiroshi2020-06-112-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* kernel: b53: fix compilation with kernels 5.5+Rafał Miłecki2020-06-051-0/+8
| | | | Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* kernel: mtdsplit: bcm_wfi: always add img partitionsÁlvaro Fernández Rojas2020-06-031-9/+44
| | | | | | | | | 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>
* kernel: mtdsplit: support Broadcom WFI bootflagsÁlvaro Fernández Rojas2020-06-021-0/+110
| | | | | | | | 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>
* kernel: mtdsplit: improve JFFS2 scanÁlvaro Fernández Rojas2020-06-021-6/+20
| | | | | | Allow retrieving full file name and length by parameters. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>