1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-26 17:47:29 +02:00
Commit Graph

28 Commits

Author SHA1 Message Date
Rafał Miłecki
711f1a8bcb kernel: mtd: backport SafeLoader parser
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-10-19 07:07:14 +02:00
Felix Fietkau
4363faef8a kernel: move ubnt ledbar driver to a separate package
Simplifies the tree by removing a non-upstream kernel patch and related kconfig
symbols

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-09-30 11:28:51 +02:00
Sven Wegener
820f0c07c5 ramips: add support for Ubiquiti UniFi FlexHD
Hardware
--------

- SoC: MediaTek MT7621AT with 128 MiB RAM and 32 MiB Flash
- Wi-Fi: MediaTek MT7603 (b/g/n, 2x2) and MediaTek MT7615 (ac, 4x4)
- Bluetooth: CSR8811 (internal USB, install kmod-bluetooth)

Installation
------------

1. Connect to the booted device at 192.168.1.20 using username/password
   "ubnt".

2. Update the bootloader environment.

   $ fw_setenv devmode TRUE
   $ fw_setenv boot_openwrt "fdt addr \$(fdtcontroladdr);
     fdt rm /signature; bootubnt"
   $ fw_setenv bootcmd "run boot_openwrt"

3. Transfer the OpenWrt sysupgrade image to the device using SCP.

4. Check the mtd partition number for bs / kernel0 / kernel1

   $ cat /proc/mtd

5. Set the bootselect flag to boot from kernel0

   $ dd if=/dev/zero bs=1 count=1 of=/dev/mtdblock4

6. Write the OpenWrt sysupgrade image to both kernel0 as well as kernel1

   $ dd if=openwrt.bin of=/dev/mtdblock6
   $ dd if=openwrt.bin of=/dev/mtdblock7

7. Reboot the device. It should boot into OpenWrt.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
2022-09-11 20:26:42 +01:00
Arınç ÜNAL
4807bd6a00 ramips: fix GB-PC1 and GB-PC2 device support
Change switch port labels to ethblack & ethblue.
Change lan1 & lan2 LEDs to ethblack_act & ethblue_act and fix GPIO pins.
Add the external phy with ethyellow label on the GB-PC2 devicetree.
Do not claim rgmii2 as gpio, it's used for ethernet with rgmii2 function.
Enable ICPlus PHY driver for IP1001 which GB-PC2 has got.
Update interface name and change netdev function.
Enable lzma compression to make up for the increased size of the kernel.
Make spi flash bindings on par with mainline Linux to fix read errors.

Tested on GB-PC2 by Petr.

Tested-by: Petr Louda <petr.louda@outlook.cz>
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
2022-08-20 22:56:12 +02:00
Hauke Mehrtens
ff06edd1f0 kernel: Activate CONFIG_GPIOLIB in generic configuration
All targets expect the malta target already activate the CONFIG_GPIOLIB
option. Move it to generic kernel configuration and also activate it for
malta.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-08-10 21:36:17 +02:00
Jo-Philipp Wich
b5ec04f81a Revert "nftables: fix parsing date expressions"
This reverts commit eada892577.

The commit contained unrelated target changes.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-08-09 11:50:52 +02:00
Jo-Philipp Wich
eada892577 nftables: fix parsing date expressions
Musl libc does not support the non-POSIX "%F" format for strptime() so
replace all occurrences of it with an equivalent "%Y-%m-%d" format.

Fixes: #10419
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-08-09 00:20:14 +02:00
Mikhail Zhilkin
bd783fd60a ramips: add support for Beeline SmartBox GIGA
Beeline SmartBox GIGA is a wireless WiFi 5 router manufactured by
Sercomm company.

Device specification
--------------------
SoC Type: MediaTek MT7621AT
RAM: 256 MiB, Nanya NT5CC128M16JR-EK
Flash: 128 MiB, Macronix MX30LF1G18AC
Wireless 2.4 GHz (MT7603EN): b/g/n, 2x2
Wireless 5 GHz (MT7613BE): a/n/ac, 2x2
Ethernet: 3 ports - 2xGbE (WAN, LAN1), 1xFE (LAN2)
USB ports: 1xUSB3.0
Button: 1 button (Reset/WPS)
PCB ID: DBE00B-1.6MM
LEDs: 1 RGB LED
Power: 12 VDC, 1.5 A
Connector type: barrel
Bootloader: U-Boot

Installation
-----------------
1. Downgrade stock (Beeline) firmware to v.1.0.02;
2. Give factory OpenWrt image a shorter name, e.g. 1001.img;
3. Upload and update the firmware via the original web interface.

Remark: You might need make the 3rd step twice if your running firmware
is booted from the Slot 1 (Sercomm0 bootflag). The stock firmware
reverses the bootflag (Sercomm0 / Sercomm1) on each firmware update.

Revert to stock
---------------
1. Change the bootflag to Sercomm1 in OpenWrt CLI and then reboot:
      printf 1 | dd bs=1 seek=7 count=1 of=/dev/mtdblock3
2. Optional: Update with any stock (Beeline) firmware if you want to
   overwrite OpenWrt in Slot 0 completely.

MAC Addresses
-------------
+-----+-----------+---------+
| use | address   | example |
+-----+-----------+---------+
| LAN | label     | *:16    |
| WAN | label + 1 | *:17    |
| 2g  | label + 4 | *:1a    |
| 5g  | label + 5 | *:1b    |
+-----+-----------+---------+
The label MAC address was found in Factory 0x21000

Notes
-----
1. The following scripts are required for the build:
      sercomm-crypto.py - already exists in OpenWrt
      sercomm-partition-tag.py - already exists in OpenWrt
      sercomm-payload.py - already exists in OpenWrt
      sercomm-pid.py - new, the part of this pull request
      sercomm-kernel-header.py - new, the part of this pull request
2. This device (same as other Sercomm S2,S3-based devices) requires
   special LZMA and LOADADDR settings for successful boot:
      LZMA_TEXT_START=0x82800000
      KERNEL_LOADADDR=0x81001000
      LOADADDR=0x80001000
3. This device (same as several other Sercomm-based devices - Beeline,
   Netgear, Etisalat, Rostelecom) has partition map (mtd1) containing
   real partition offsets, which may differ from device to device
   depending on the number and location of bad blocks on NAND.
   "fixed-partitions" is used if the partition map is not found or
   corrupted. This behavour (it's the same as on stock firmware) is
   provided by MTD_SERCOMM_PARTS module.

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
2022-07-03 20:25:38 +02:00
Tomasz Maciej Nowak
539e60539a generic: enable CRYPTO_LIB_BLAKE2S[_X86|_ARM]
This is now built-in, enable so it won't propagate on target configs.

Link: https://lkml.org/lkml/2022/1/3/168
Fixes: 79e7a2552e ("kernel: bump 5.15 to 5.15.44")
Fixes: 0ca9367069 ("kernel: bump 5.10 to 5.10.119")
Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
(Link to Kernel's commit taht made it built-in,
CRYPTO_LIB_BLAKE2S[_ARM|_X86] as it's selectable, 5.10 backport)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-06-24 17:10:24 +02:00
DENG Qingfang
73fd9f79ce
kernel: backport MediaTek Ethernet PHY driver
Add support for MediaTek Gigabit Ethernet PHYs found in MT7530 and
MT7531. Fix some link up/down issues.
The errornous check for the PHY mode which broke things with MT7531
has been removed as suggested by patch
 net: phy: mediatek: remove PHY mode check on MT7531
As a result, things are working fine now on MT7622+MT7531 as well.

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-02-09 21:17:54 +00:00
Hauke Mehrtens
1b311aab31 Revert "kernel: backport MediaTek Ethernet PHY driver"
This reverts commit 8b4cba53a9.

This broke the mt7530 on Linksys e8450 (mt7622) for me.
[    1.312943] mt7530 mdio-bus:00 lan1 (uninitialized): failed to connect to PHY: -EINVAL
[    1.320890] mt7530 mdio-bus:00 lan1 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 0
[    1.331163] mt7530 mdio-bus:00 lan2 (uninitialized): failed to connect to PHY: -EINVAL
[    1.339085] mt7530 mdio-bus:00 lan2 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 1
[    1.349321] mt7530 mdio-bus:00 lan3 (uninitialized): failed to connect to PHY: -EINVAL
[    1.357241] mt7530 mdio-bus:00 lan3 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 2
[    1.367452] mt7530 mdio-bus:00 lan4 (uninitialized): failed to connect to PHY: -EINVAL
[    1.375367] mt7530 mdio-bus:00 lan4 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 3
[    1.385750] mt7530 mdio-bus:00 wan (uninitialized): failed to connect to PHY: -EINVAL
[    1.393575] mt7530 mdio-bus:00 wan (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 4

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-02-05 19:13:19 +01:00
DENG Qingfang
8b4cba53a9 kernel: backport MediaTek Ethernet PHY driver
Add support for MediaTek Gigabit Ethernet PHYs found in MT7530.
Fix some link up/down issues.

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-02-05 17:46:59 +02:00
Stijn Tintel
a47f152943 ramips: enable I2C_CHARDEV in mt7621/config-5.10
I2C_CHARDEV used to be enabled in mt7621/config-5.4. Enable it in the
5.10 config, as it's required for PoE control on Unifi Switch Flex.

Fixes: b4aad29a1d ("ramips: add support for kernel 5.10")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-01-28 19:03:52 +02:00
Felix Fietkau
83b14ec026 ramips: enable badblock table support on linksys ea7xxx devices
Use remapping only on the kernel partitions.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-01-13 18:33:06 +01:00
Oskari Lemmela
8441a622ec mikrotik: enable variable size erase
Add support for variable size erase blocks.
Enable it to all targets which has mikrotik targets.

Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
2022-01-13 09:33:29 +01:00
Sergey Ryazanov
fa3690f8f1 kernel: 5.10: consolidate mac80211 crypto options
Each of
- CRYPTO_AEAD2
- CRYPTO_AEAD
- CRYPTO_GF128MUL
- CRYPTO_GHASH
- CRYPTO_HASH2
- CRYPTO_HASH
- CRYPTO_MANAGER2
- CRYPTO_MANAGER
- CRYPTO_NULL2

either directly required for mac80211 crypto support, or directly
selected by such options. Support for the mac80211 crypto was enabled in
the generic config since c7182123b9 ("kernel: make cryptoapi support
needed by mac80211 built-in"). So move the above options from the target
configs to the generic config to make it clear why do we need them.

CC: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
2021-12-17 16:16:34 +01:00
Sergey Ryazanov
b61ab8f57e kernel: filter out both Clang and LLD versions
Both CLANG_VERSION and LLD_VERISON are autogenerated runtime
configuration options, so add them to the kernel configuration filter
and remove from generic and per-target configs to keep configs clean.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
2021-12-17 16:16:34 +01:00
Rui Salvaterra
505b7a2d08 kernel: move two symbols to the generic kconfigs
CONFIG_RCU_{NEED_SEGCBLIST,STALL_COMMON} are set basically everywhere. Move them
to the generic kconfigs. And resort the generic kconfigs while at it.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-08-29 17:07:19 +02:00
David Bauer
373c08bcbb ramips: fix missing NVMEM subsystem
MAC address retrieval was switched to more generic upstream (5.13) NVMEM
based solution in commit 06bb4a5018 ("ramips: convert mtd-mac-address
to nvmem implementation") , but NVMEM subsystem wasn't enabled in the
kernel, so fix it now.

References: https://github.com/openwrt/openwrt/pull/4041#issuecomment-883322801
Fixes: 06bb4a5018 ("ramips: convert mtd-mac-address to nvmem implementation")
Signed-off-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [commit message]
2021-07-21 11:39:39 +02:00
David Bauer
51b61fd570 ramips: add support for Tenbay T-MB5EU-V01
Hardware
--------
MediaTek MT7621 SoC
256M DDR3
16MB BoHong SPI-NOR
MediaTek MT7905+7975 2x2T2R DBDC bgnax / acax
RGB LED
WPS + RESET Button
UART on compute module (silkscreened / 115200n8)

The router itself is just a board with Power / USB / RJ-45 connectors
and DC/DC converters. The SoC and WiFi components are on a
daughterboard which connect using two M.2 connectors.

The compute module has the model number "T-CB1800K-DM2 V02" printed on
it. The main baord has "T-MB5EU V01" printed on it. This information
might be useful, as it's highly likely either of these two will be
reused in similar designs.

The router itself is sold as Tenbay T-MB5EU directly from the OEM as
well as "KuWFI AX1800 Smart WiFi 6 Eouter" on Amazon.de for ~50€ in a
slightly different case.

Installation
------------

A Tool for creating a factory image for the Vendor Web Interface can be
found here: https://github.com/blocktrron/t-mb5eu-v01-factory-creator/

As the OEM Firmware is just a modified LEDE 17.01, you can also access
failsafe mode via UART while the OS boots, by connecting to UART
and pressing "f" when prompted. The Router is reachable at
192.168.1.1 via root without password.

Transfer the OpenWrt sysupgrade image via scp and apply with sysupgrade
using the -n and -F flags.

Alternatively, the board can be flashed by attaching to the UART
console, interrupting the boot process by keeping "0" pressed while
attaching power.

Serve the OpenWrt initramfs using a TFTP server with address
192.168.1.66. Rename the initramfs to ax1800.bin.

Attach your TFTP server to one of the LAN ports. Execute the following
commands.

 $ setenv ipaddr 192.168.1.67
 $ setenv serverip 192.168.1.66
 $ tftpboot 0x84000000 ax1800.bin
 $ bootm

Wait for the device to boot. Then transfer the OpenWrt sysupgrade image
to the device using SCP and apply sysupgrade.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-27 21:40:27 +02:00
David Bauer
38db2f12d6 ramips: add AW9523 I2C GPIO expander driver
This adds a driver for the AW9523 I2C GPIO expander.

This driver is required to make LEDs as well as buttons on the Tenbay
T-MB5EU-V01 work.

This driver already had several upstream iterations. I'm working to
push this driver to mainline.

Ref: https://patchwork.ozlabs.org/project/linux-gpio/list/?series=226287

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-27 21:40:15 +02:00
Rui Salvaterra
3326b5e75c treewide: switch the timer frequency to 100 Hz
Some targets select HZ=100, others HZ=250. There's no reason to select a higher
timer frequency (and 100 Hz are available in every architecture), so change all
targets to 100 Hz.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-04-21 10:31:10 +01:00
Rui Salvaterra
27b5bae2ec treewide: remove redundant ubifs kconfig symbols
For the targets which enable ubifs, these symbols are already part of the
generic kconfigs. Drop them from the target kconfigs.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-04-21 10:31:07 +01:00
Rui Salvaterra
070ead4d4a ramips/mt7621: enable support for cpuidle
MIPS Coherent Processor Systems (CPS), which include the MT7621 SoC, support
deep sleep idle states and have a specific cpuidle driver for them.
Enable support for it, while also switching from constant timer ticks to the
idle dynticks model, with the TEO governor.

Run-tested on a Redmi AC2100.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-03-31 00:58:49 +01:00
Ilya Lipnitskiy
b021642cac ramips: 5.10: refresh configs
Run-tested on Ubiquiti EdgeRouter X.

Compile tested on all other subtargets.

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
2021-03-06 11:24:12 +01:00
Ilya Lipnitskiy
a9966793e8 ramips: copy config-5.4 to config-5.10
Strict copy, no changes made.

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
2021-03-06 11:24:12 +01:00
cc4ee2eeb4 Revert "ramips: add support for kernel 5.10"
This reverts commit b4aad29a1d.

This was accidentally folded into a single commit. Remove it and
apply it properly again.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-03-06 11:23:38 +01:00
Ilya Lipnitskiy
b4aad29a1d
ramips: add support for kernel 5.10
Enable testing kernel.

Delete upstreamed patches:
 0098-disable_cm.patch can be dropped, upstream fixed CM handling.

Fix compile errors by using new kernel APIs.

Fix fuzz by manually editing patches to ensure the code goes in the
right place.

For 721-NET-no-auto-carrier-off-support.patch, revert upstream commit
a307593a6 to keep the OpenWrt ralink driver operational.

Add mt7621-pci-phy patch to select REGMAP_MMIO as discussed in PR #3693
and #3952.

Rename patches to follow the 3-digit classification from the OpenWrt
Developer Guide.

Run automatic quilt refresh.

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
2021-03-05 23:55:51 +00:00