aboutsummaryrefslogtreecommitdiff
path: root/target/linux/ramips
Commit message (Collapse)AuthorAge
* ramips: mt76x8: fix build due to renamed U-Boot binaryDaniel Golle2024-02-16
| | | | | | | | | The U-Boot binary for the RAVPower RP-WD009 has been renamed. In order to be uniform with all other U-Boot binaries generated the SoC type has been prepended. Set that new name also in the image build recipe for that device in order to fix build. Fixes: 927334a8f7 ("uboot-mediatek: add basic build for ZBT-WG3526 (MT7621, 16M SPI-NOR)") Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: switch to pending XFI 10G Ethernet driversDaniel Golle2024-02-15
| | | | | | | | | Replace previous patch adding paths and SerDes modes with patch series pending upstream adding dedicated drivers for XFI T-PHY and USXGMII PCS, extends LynxI PCS to be a standalone platform driver and as a consequence makes much less changes to the actual Ethernet driver mtk_eth_soc. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: backport phylink changes from mainline LinuxDaniel Golle2024-02-15
| | | | | | | Let's pick a bunch of useful phylink changes which allow us to keep drivers in sync with mainline Linux. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* ramips: mt76x8: drop AT803X phy driverShiji Yang2024-02-12
| | | | | | | | | This Qualcomm Gigabit phy driver was mistakenly added because MT76x8 does not support external phy, and it only supports max 100M full duplex speed. Fixes: cadf5171074f ("ralink: add support for mt7628") Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* generic: 6.1: backport QCA807x PHY patchesChristian Marangi2024-02-11
| | | | | | | | | | | | Backport QCA807x PHY patches merged upstream that introduce the new concept of PHY package. Also add in generic config the new Kconfig CONFIG_QCA807X_PHY. All affected patch automatically refreshed with make target/linux/refresh. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* ramips: mtk_eth_soc: fix NULL pointer dereference for syncpShiji Yang2024-02-11
| | | | | | | | u64_stats_init() has been unable to handle NULL pointer since 6.1 kernel. This patch fixes kernel oops on mt76x8 and rt305x sub-target. Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* ramips: hsdma-mtk: fix build on 5.15 kernelShiji Yang2024-02-11
| | | | | | | | In the 5.15 kernel, we use the staging driver version instead of the downstream file. Fixes: 88d982e3bd87 ("ramips: 6.1: mt7621-dma: add hsdma driver to files") Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* ramips: add support for 6.1 kernelNick Hainke2024-02-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove upstreamed patches: - 000-v5.18-01-dt-bindings-reset-add-dt-binding-header-for-Mediatek.patch - 000-v5.18-02-staging-mt7621-dts-align-resets-with-binding-documen.patch - 001-v5.18-01-dt-bindings-clock-mediatek-mt7621-sysc-add-reset-cel.patch - 001-v5.18-02-clk-ralink-make-system-controller-node-a-reset-provi.patch - 002-v6.0-MIPS-ralink-mt7621-avoid-to-init-common-ralink-reset.patch - 100-v5.16-PCI-mt7621-Add-MediaTek-MT7621-PCIe-host-controller-.patch - 101-v5.17-PCI-mt7621-Rename-mt7621_pci_-to-mt7621_pcie_.patch - 102-v5.17-PCI-mt7621-Declare-mt7621_pci_ops-static.patch - 103-v5.17-PCI-mt7621-Move-MIPS-setup-to-pcibios_root_bridge_pr.patch - 104-v5.17-PCI-mt7621-Drop-of_match_ptr-to-avoid-unused-variabl.patch - 105-v5.17-PCI-mt7621-Remove-unused-function-pcie_rmw.patch - 106-v5.17-PCI-Let-pcibios_root_bridge_prepare-access-bridge-wi.patch - 107-v6.2-PCI-mt7621-Add-sentinel-to-quirks-table.patch - 108-v6.3-PCI-mt7621-Delay-phy-ports-initialization.patch Manually refresh: - 006-v6.5-mips-ralink-introduce-commonly-used-remap-node-funct.patch - 320-MIPS-add-support-for-buggy-MT7621S-core-detection.patch - 405-mtd-spi-nor-Add-support-for-BoHong-bh25q128as.patch - 410-mtd-rawnand-add-driver-support-for-MT7621-nand-flash.patch - 805-pinctrl-AW9523.patch - 825-i2c-MIPS-adds-ralink-I2C-driver.patch - 830-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch Automatically refresh: - 200-add-ralink-eth.patch - 314-MIPS-add-bootargs-override-property.patch - 315-owrt-hack-fix-mt7688-cache-issue.patch - 700-net-ethernet-mediatek-support-net-labels.patch - 720-Revert-net-phy-simplify-phy_link_change-arguments.patch - 721-NET-no-auto-carrier-off-support.patch - 800-dmaengine-mediatek-add-HSDMA-support-for-mt7621.patch - 802-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch - 810-uvc-add-iPassion-iP2970-support.patch - 821-SPI-ralink-add-Ralink-SoC-spi-driver.patch - 835-asoc-add-mt7620-support.patch - 840-serial-add-ugly-custom-baud-rate-hack.patch - 845-pwm-add-mediatek-support.patch - 850-awake-rt305x-dwc2-controller.patch Tested-by: Andre Heider <a.heider@gmail.com> # netgear,wac124 Tested-by: Andrey Jr. Melnikov <temnota.am@gmail.com> # Xiaomi Mi Router 3G Tested-by: Timo Dorfner <timo.capa@gmail.com> # mt7621/mir3g mt7621/rm2100 Reviewed-by: Shiji Yang <yangshiji66@qq.com> Co-Developed-by: Mieczyslaw Nalewaj <namiltd@yahoo.com> Signed-off-by: Nick Hainke <vincent@systemli.org>
* ramips: 6.1: ralink: fix ethernet driver with 6.1Mieczyslaw Nalewaj2024-02-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes errors in the form of: make[9]: Entering directory '/home/nick/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/linux-6.1.77' CC drivers/net/ethernet/ralink/mtk_eth_soc.o drivers/net/ethernet/ralink/mtk_eth_soc.c: In function 'fe_init': drivers/net/ethernet/ralink/mtk_eth_soc.c:1368:51: warning: passing argument 2 of 'of_get_mac_address' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 1368 | of_get_mac_address(priv->dev->of_node, dev->dev_addr); | ~~~^~~~~~~~~~ In file included from drivers/net/ethernet/ralink/mtk_eth_soc.c:26: ./include/linux/of_net.h:16:59: note: expected 'u8 *' {aka 'unsigned char *'} but argument is of type 'const unsigned char *' 16 | extern int of_get_mac_address(struct device_node *np, u8 *mac); | ~~~~^~~ drivers/net/ethernet/ralink/mtk_eth_soc.c: In function 'fe_probe': drivers/net/ethernet/ralink/mtk_eth_soc.c:1641:9: error: too many arguments to function 'netif_napi_add' 1641 | netif_napi_add(netdev, &priv->rx_napi, fe_poll, napi_weight); | ^~~~~~~~~~~~~~ In file included from ./include/linux/etherdevice.h:21, from drivers/net/ethernet/ralink/mtk_eth_soc.c:21: ./include/linux/netdevice.h:2611:1: note: declared here 2611 | netif_napi_add(struct net_device *dev, struct napi_struct *napi, | ^~~~~~~~~~~~~~ Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com> [split commit and rewrite commit message] Signed-off-by: Nick Hainke <vincent@systemli.org>
* ramips: 6.1: spi: fix patch by replacing cs_gpio with cs_gpiodMieczyslaw Nalewaj2024-02-10
| | | | | | | | | | | | Upstream commit f48dc6b96649 ("spi: Retire legacy GPIO handling") [0] removed support using GPIOs as chip select. Fix it by replacing cs_gpio with cs_gpiod. [0] - https://github.com/torvalds/linux/commit/f48dc6b9664963107e500aecfc2f4df27dc5afb6 Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com> [split commit and rewrite commit message] Signed-off-by: Nick Hainke <vincent@systemli.org>
* ramips: 6.1: ralink: fix const warning in the ethernet driverNick Hainke2024-02-10
| | | | | | | | | | | | | | | | | | | | | | | | | Change fe_hw_set_macaddr and the set_mac parameter to const to fix errors in the form of: drivers/net/ethernet/ralink/mtk_eth_soc.c: In function 'fe_set_mac_address': drivers/net/ethernet/ralink/mtk_eth_soc.c:174:53: error: passing argument 2 of 'priv->soc->set_mac' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] 174 | priv->soc->set_mac(priv, dev->dev_addr); | ~~~^~~~~~~~~~ drivers/net/ethernet/ralink/mtk_eth_soc.c:174:53: note: expected 'unsigned char *' but argument is of type 'const unsigned char *' drivers/net/ethernet/ralink/mtk_eth_soc.c: In function 'fe_hw_init': drivers/net/ethernet/ralink/mtk_eth_soc.c:1220:45: error: passing argument 2 of 'priv->soc->set_mac' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] 1220 | priv->soc->set_mac(priv, dev->dev_addr); | ~~~^~~~~~~~~~ drivers/net/ethernet/ralink/mtk_eth_soc.c:1220:45: note: expected 'unsigned char *' but argument is of type 'const unsigned char *' drivers/net/ethernet/ralink/mtk_eth_soc.c:1222:44: error: passing argument 2 of 'fe_hw_set_macaddr' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] 1222 | fe_hw_set_macaddr(priv, dev->dev_addr); | ~~~^~~~~~~~~~ drivers/net/ethernet/ralink/mtk_eth_soc.c:155:75: note: expected 'unsigned char *' but argument is of type 'const unsigned char *' 155 | static inline void fe_hw_set_macaddr(struct fe_priv *priv, unsigned char *mac) | ~~~~~~~~~~~~~~~^~~ cc1: all warnings being treated as errors Signed-off-by: Nick Hainke <vincent@systemli.org>
* ramips: 6.1: pwm: rewrite mtk_pwm_ops to fix pwm driverNick Hainke2024-02-10
| | | | | | | | | | | | | | | | | | | | | | | | Upstream dropped support for legacy driver [0]. Rewrite the driver like the renesas pwm driver [1]. Fixes erros in the form of: make: *** [/__w/openwrt/openwrt/openwrt/include/toplevel.mk:232: target/compile] Error 1 ====== Make errors from logs/target/linux/compile.txt ====== | ^~~~~~~~~~~~~~ drivers/pwm/pwm-mediatek-ramips.c:107:19: note: (near initialization for 'mtk_pwm_ops.free') drivers/pwm/pwm-mediatek-ramips.c:108:10: error: 'const struct pwm_ops' has no member named 'disable' 108 | .disable = mtk_pwm_disable, | ^~~~~~~ drivers/pwm/pwm-mediatek-ramips.c:108:20: error: initialization of 'int (*)(struct pwm_chip *, struct pwm_device *, struct pwm_capture *, long unsigned int)' from incompatible pointer type 'void (*)(struct pwm_chip *, struct pwm_device *)' [-Werror=incompatible-pointer-types] 108 | .disable = mtk_pwm_disable, | ^~~~~~~~~~~~~~~ drivers/pwm/pwm-mediatek-ramips.c:108:20: note: (near initialization for 'mtk_pwm_ops.capture') cc1: all warnings being treated as errors [0] - https://github.com/torvalds/linux/commit/0829c35dc5346e90f428de61896362b51ab58296 [1] - https://github.com/torvalds/linux/commit/ec00cd5e63f05461ab48128775c73c851c3c2b18 Signed-off-by: Nick Hainke <vincent@systemli.org>
* ramips: 6.1: dai_dma: drop dma_data->slave_id in mt7620 support patchNick Hainke2024-02-10
| | | | | | | | | | | | | | | | | | Upstream dropped slave_id in dai_dma [0]. So drop it also in the mt7620 support patch. Fixes errors in the form of: sound/soc/ralink/ralink-i2s.c: In function 'ralink_i2s_init_dma_data': sound/soc/ralink/ralink-i2s.c:452:17: error: 'struct snd_dmaengine_dai_dma_data' has no member named 'slave_id' 452 | dma_data->slave_id = i2s->txdma_req; | ^~ sound/soc/ralink/ralink-i2s.c:462:17: error: 'struct snd_dmaengine_dai_dma_data' has no member named 'slave_id' 462 | dma_data->slave_id = i2s->rxdma_req; | ^~ [0] - https://lore.kernel.org/r/20211122222203.4103644-3-arnd@kernel.org Signed-off-by: Nick Hainke <vincent@systemli.org>
* ramips: 6.1: pinctrl: fix compilation with 6.1Nick Hainke2024-02-10
| | | | | | | | | | | | | | | | | | | Upstream changed in ed5c2f5fd10d ("i2c: Make remove callback return void") the i2c driver's remove function to return no value. Adapt the driver code to compile with 5.15 and 6.1 like it is done in other projects [0]. Fixes errors in the form of: make[8]: Leaving directory '/home/nick/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-6.1.29' CC drivers/pinctrl/pinctrl-aw9523.o drivers/pinctrl/pinctrl-aw9523.c:1117:19: error: initialization of 'void (*)(struct i2c_client *)' from incompatible pointer type 'int (*)(struct i2c_client *)' [-Werror=incompatible-pointer-types] 1117 | .remove = aw9523_remove, | ^~~~~~~~~~~~~ drivers/pinctrl/pinctrl-aw9523.c:1117:19: note: (near initialization for 'aw9523_driver.remove') cc1: all warnings being treated as errors [0] - https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux/-/merge_requests/10/diffs Signed-off-by: Nick Hainke <vincent@systemli.org>
* ramips: 6.1: mt7621-dma: apply dma handle error from device_reset patchNick Hainke2024-02-10
| | | | | | | Apply the "109-drivers-mt7621-dma-handle-error-from-device_reset.patch" directly on the downstream maintained dma driver. Signed-off-by: Nick Hainke <vincent@systemli.org>
* ramips: 6.1: mt7621-dma: add hsdma driver to filesNick Hainke2024-02-10
| | | | | | | | Commit 87dd67f496f7 ("staging: mt7621-dma: remove driver from tree") removed the mt7621-dma driver. Maintain the driver downstream in the folder of the other mediatek drivers. Signed-off-by: Nick Hainke <vincent@systemli.org>
* ramips: 6.1: copy config and patchesNick Hainke2024-02-10
| | | | | | Copy config and patches from 5.15. This simplifies reviewing process. Signed-off-by: Nick Hainke <vincent@systemli.org>
* ramips: fix dts error in LED color/function conversionChristian Marangi2024-02-08
| | | | | | | | Fix DTS error in LED color/function conversion due to a bug in the conversion script. Fixes: 19c45b95dbb5 ("ramips: convert to new LED color/function format where possible") Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* ramips: convert to new LED color/function format where possibleChristian Marangi2024-02-07
| | | | | | | | Initial conversion to new LED color/function format and drop label format where possible. The same label is composed at runtime. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* ramips: drop redundant label with new LED color/function formatChristian Marangi2024-02-07
| | | | | | | | | Drop redundant label with new LED color/function format declared. This was needed previously when the new format wasn't supported by leds.sh functions script. Now that is supported this property can be removed in favor of the new format. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* kernel: bump 5.15 to 5.15.148John Audia2024-02-01
| | | | | | | | | | | | | | | | | | | | | Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.148 Removed upstreamed: generic/hack-5.15/321-powerpc_crtsavres_prereq.patch[1] Manually rebased: target/linux/octeontx/patches-5.15/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch[2] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.148&id=0b11a145eb00d51f7ef18cfcae587b93f9adb1e9 2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit?h=v5.15.148&id=b67064bd372300a75293efbbc70624996dccffd4 Build system: x86_64 Build-tested: ramips/tplink_archer-a6-v3 Run-tested: ramips/tplink_archer-a6-v3 Signed-off-by: John Audia <therealgraysky@proton.me>
* kernel: 5.15: backport v6.1 PHY changes required for AquantiaRafał Miłecki2024-01-26
| | | | Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* ramips: mt76x8: enable small_flash featureTomasz Maciej Nowak2024-01-22
| | | | | | | | | | | | | | | | | | | Some of devices in this target have only 8 MiB space and are closing to borders of usable space. Particularly, TP-Link RE305 v1 already suffers from this issue[1], where with current partition layout, on release images, there's not enough space for overlay. So activate small_flash feature, which will remove some userspace hardening but will gain almost 1 MiB additional flash memory space. Here is small size comparison of similar device (RE365 v1) with default config + LuCI: kernel rootfs sysupgrade current: 2305728 3635044 5964584 small_flash: 1713571 3320132 5047080 1. https://github.com/openwrt/openwrt/issues/14215 Suggested-by: Sander Vanheule <sander@svanheule.net> Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
* ramips: mt7621: convert Linksys devices EEPROM to NVMEM formatShiji Yang2024-01-17
| | | | | | | | | | | | | | -+-----------------------------+- | Model | NIC | -+-----------------------------+- | EA6350 v4 | MT7603 + MT7613 | -+-----------------------------+- | EA7300 v2 | MT7603 + MT7615 | -+-----------------------------+- | Others | MT7615 *2 | -+-----------------------------+- Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* ramips: mt7621: convert NETGEAR devices EEPROM to NVMEM formatShiji Yang2024-01-17
| | | | | | | | | | | | -+------------------------------+- | Model | NIC | -+------------------------------+- | chj series | MT7603 + MT7615 | -+------------------------------+- | bzv series | MT7615 *2 | -+------------------------------+- Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* ramips: mt7621: convert Wavlink devices EEPROM to NVMEM formatShiji Yang2024-01-17
| | | | | | | | | | | | -+------------------------------+- | Model | NIC | -+------------------------------+- | WL-WN531A6 | MT7603 + MT7615 | -+------------------------------+- | WL-WN533A8 | MT7615 *2 | -+------------------------------+- Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* ramips: mt7621: convert Ubiquiti devices EEPROM to NVMEM formatShiji Yang2024-01-17
| | | | | | | | | | -+-------------------------+- | Model | NIC | -+-------------------------+- | All | MT7603 + MT7615 | -+-------------------------+- Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* ramips: mt7621: convert I-O DATA devices EEPROM to NVMEM formatShiji Yang2024-01-17
| | | | | | | | | | | | -+-------------------------------------------+- | Model | NIC | -+-------------------------------------------+- | WN-DX1167R/WN-AX1167GR2 | MT7615D | -+-------------------------------------------+- | WN-AX2033GR/WN-DX2033GR | MT7603 + MT7615 | -+-------------------------------------------+- Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* ramips: mt7621: convert Xiaomi devices EEPROM to NVMEM formatShiji Yang2024-01-17
| | | | | | | | | | | | | | -+---------------------------+- | Model | NIC | -+---------------------------+- | AC2100 | MT7603 + MT7615 | -+---------------------------+- | MI4A V2 | MT7603 + MT7613 | -+---------------------------+- | Others | MT7603 + MT7612 | -+---------------------------+- Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* ramips: mt7621: convert MT7915 EEPROM to NVMEM formatShiji Yang2024-01-17
| | | | | | | | | | | | | Some MT7915 calibration data consists of two parts. The first part "eeprom" size is 0xe00. The second part "precal" size is 0x19c10. Though some devices may not have precal data, it's better to assume that precal data exists as no users/developers confirm it. On the other hand, some devices definitely do not contain precal data because the EEPROM partition size is smaller than the precal NVMEM cell size. Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* ramips: mt76x8: add support for TP-Link RE365 v1Tomasz Maciej Nowak2024-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TP-Link RE365 is a wireless range extender, hardware-wise resembles RE305 with slight changes regarding buttons and LEDs. Specification SoC: MediaTek MT7628AN RAM: 64 MiB DDR2 Flash: 8 MiB SPI NOR WiFi: 2.4 GHz 2T2R integrated 5 GHz 2T2R MediaTek MT7612EN conncted to PCIe lanes Ethernet: 1x 10/100 Mbps integrated LEDs: 6x GPIO controlled Buttons: 4x GPIO controlled UART: row of 4 holes marked on PCB as J1, starting count from white triangle 1. VCC (3.3V), 2. GND, 3. RX, 4. TX baud: 57600, parity: none, flow control: none Installation 1. Open web management interface. 2. Go to Settings > System Tools > Firmware upgrade. 3. Select "Browse" and select the OpenWrt image with factory.bin suffix. 4. After selecting "Upgrade" firmware writing process will start. 5. Wait till device reboots, power LED should stay solid when it's fully booted, then it's ready for configuration through LAN port. Additional information With how device manufacturer patrtitioned the flash memory, it's possible that with default packages set, initial factory.bin image won't be created. In such case, try to reduce packages amount or use older release for initial conversion to OpenWrt. Later You can use sysupgrade.bin image with full set of packages because OpenWrt uses unpartitioned flash memory space unused by vendor firmware. Reverting to vendor firmware involves converting firmware using tplink-safeloader with -z option (can be found in ImageBuilder or SDK) and forcibly applying converted firmware as sysupgrade. Known issues WARNING: after removing casing of the device one is exposed to high voltage and is in a risk of being electrocuted. Caution when interfacing whith bootloader, saving its environment either by issuing "saveenv" or selecting option "1: Load system code to SDRAM via TFTP." in boot menu, any of those will lead to overwriting part of kernel. This will lead to need of firmware recovery. The cause of this issue is bootloader having environment offset on flash at 0x40000, while kernel starts from 0x20000. Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com> [Wrap long line in DTS] Signed-off-by: Sander Vanheule <sander@svanheule.net>
* ramips: add alternative name to Etisalat (Sercomm) S3Mikhail Zhilkin2024-01-07
| | | | | | This commit adds alternative name to Etisalat (Sercomm) S3 router. Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
* ramips: sercomm s1500: enable wlan LEDs activity blinkingMikhail Zhilkin2024-01-07
| | | | | | | | | This commit enables wireless LEDs activity blinking for Sercomm S1500 devices (Beeline Smartbox PRO, WiFire s1500.nbn). Run-tested: WiFire s1500.nbn Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
* ramips: update leds & buttons dts descriptionMikhail Zhilkin2024-01-07
| | | | | | | | | | | | | This commit: 1. Removes deprecated "label" property from the dts leds subnnodes; 2. Updates buttons and leds dts description according to kernel docs examples. Scope: devices well known to me. Run-tested: TP-Link ec330-g5u, WiFire S1500.nbn Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
* ramips: add missing syscon compatible strings for MT7688 and RT3052Shiji Yang2024-01-06
| | | | | | | | | | | | MT7688 devices use the "mt7628an.dtsi" as the template. And RT3052 devices use the "rt3050.dtsi" as template. Therefore, we need to add the corresponding system controller compatible strings to make them work properly. Fixes: 1f818b09f8ae ("ramips: add proper system clock and reset driver support for legacy SoCs") Fixes: #14305 Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* ramips: reset mt7620 ethernet phy via reset controllerShiji Yang2024-01-06
| | | | | | | | | | | Use reset controller to reset mt7620 ethernet phy instead of directly writing system control registers. The reset line of "ephy" is 24, so the DTS resets properties have been updated to get the correct reset signal. Tested on HiWiFi HC5861. Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* ramips: reset mt7620 frame engine via reset controllerShiji Yang2024-01-06
| | | | | | | | | Use reset controller to reset mt7620 frame engine instead of directly writing system control registers. Tested on HiWiFi HC5861. Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* ramips: fix dtc warningsRosen Penev2024-01-05
| | | | | | Mostly leading 0 removals and wrong addresses. Signed-off-by: Rosen Penev <rosenp@gmail.com>
* treewide: use ethtool_puts instead of memcpyRosen Penev2024-01-05
| | | | | | The former is a safer and more readable version. Signed-off-by: Rosen Penev <rosenp@gmail.com>
* ramips: unielec-u7621-01: Increase SPI frequency to 50MHzDavid Bentham2024-01-03
| | | | | | | | | | | | Flash: 16MB SPI NOR flash (Macronix MX25L12805D) Based on the manufactured datasheet this chip is capable of 50MHz. We dont enable fast-read as mt7621 are only capable of 44mhz in a read state. Tested on this unit without any issues. Signed-off-by: David Bentham <db260179@gmail.com>
* ramips: lzma-loader: use default uart for rt305xMichael Pratt2024-01-02
| | | | | | | | | | | | | The rt305x series SOC have two UART devices, and the one at bus address 0x500 is disabled by default. Some boards do not even have a pinout for the first one, so use the same one that the kernel uses at 0xc00 instead. This allows the lzma-loader printing to be visible alongside the kernel log in the same console. Tested-by: Lech Perczak <lech.perczak@gmail.com> # zte,mf283plus Signed-off-by: Michael Pratt <mcpratt@pm.me>
* ramips: lzma-loader: use proper register namesMichael Pratt2024-01-02
| | | | | | | | | | | | | | | | | | | | | | | | | Before this was reworked, in the file for mt7621 subtarget (target/linux/ramips/image/lzma-loader/src/board-mt7621.c) the "Transmitter shift register empty" bit TEMT was used instead of the "Transmitter holding register empty" bit THRE, but after the rework, this value was labeled as the THRE bit instead. Functionally there is no difference, but this is confusing to read, as it suggests that the subtargets have different bits for the same register in UART when in reality they are exactly the same. One can use either bit, or both, at user's descretion in order to determine whether the UART TX buffer is ready. The generic kernel early-printk uses both, (arch/mips/kernel/early_printk_8250.c) while the ralink-specific early-printk uses only THRE, (arch/mips/ralink/early_printk.c). Define both bits and rewrite macros for readability, keep the same values, as changing which to use should be tested first. Ref: c31319b66 ("ramips: lzma-loader: Refactor loader") Signed-off-by: Michael Pratt <mcpratt@pm.me>
* ramips: lzma-loader: use virtual memory segments for uart base addressMichael Pratt2024-01-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The native bus address for UART was entered for rt305x UART_BASE, but the bootloaders have memory space remapped with the same virtual memory map the kernel uses for program addressing at boot time. In UBoot, the remapped address is often defined as TEXT_BASE. In the kernel, for rt305x this remapped address is RT305X_SYSC_BASE. (arch/mips/include/asm/mach-ralink/rt305x.h) Because the ralink I/O busses begin at a low address of 0x10000000, they are remapped using KSEG0 or KSEG1, which for all 32-bit MIPS SOCs (arch/mips/include/asm/addrspace.h) are offsets of 0x80000000 and 0xa0000000 respectively. This is consistent with the other UART_BASE macros here and with MIPS memory map documentation. Before the recent rework of the lzma-loader for ramips, the original board-$(PLATFORM).c files also did not use KSEG1ADDR for UART_BASE despite being defined, which made this mistake easier to occur. Fix this by defining KSEG1ADDR again and actually use it. Copy and paste from the kernel's macros for consistency. Link: https://training.mips.com/basic_mips/PDF/Memory_Map.pdf Fixes: c31319b66 ("ramips: lzma-loader: Refactor loader") Reported-by: Lech Perczak <lech.perczak@gmail.com> Signed-off-by: Michael Pratt <mcpratt@pm.me>
* raimps: mtk_eth_soc: drop rst_esw from ESW driverLech Perczak2024-01-02
| | | | | | | | | | | | | | | | | The ESW core needs to be reset together with FE core, so after the relevant reset controller lines are moved under FE, drop rst_esw and all related code, which would not execute anyway, because rst_esw would be NULL. While at that, ensure that if reset line for EPHY cannot be claimed, a proper error message is reported. Fixes: 60fadae62b64 ("ramips: ethernet: ralink: move reset of the esw into the esw instead of fe") Co-developed-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com> Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com> [Split out of the bigger commit, provide commit mesage, refactor error handling] Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* ramips: dts: mt7628an: reset FE and ESW cores togetherMaxim Anisimov2024-01-02
| | | | | | | | | | | | | Failing to do so will cause the DMA engine to not initialize properly and fail to forward packets between them, and in some cases will cause spurious transmission with size exceeding allowed packet size, causing a kernel panic. Fixes: 60fadae62b64 ("ramips: ethernet: ralink: move reset of the esw into the esw instead of fe") Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com> [Provide commit description, split into logical changes] Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* ramips: dts: rt5350: reset FE and ESW cores togetherLech Perczak2024-01-02
| | | | | | | | | | | | | | | | Failing to do so will cause the DMA engine to not initialize properly and fail to forward packets between them, and in some cases will cause spurious transmission with size exceeding allowed packet size, causing a kernel panic. This is behaviour of downstream driver as well, however I haven't observed bug reports about this SoC in the wild, so this commit's purpose is to align this chip with all other SoC's - MT7620 were already using this arrangement. Fixes: #9284 Fixes: 60fadae62b64 ("ramips: ethernet: ralink: move reset of the esw into the esw instead of fe") Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* ramips: dts: rt3050: reset FE and ESW cores togetherLech Perczak2024-01-02
| | | | | | | | | | | | | | | Failing to do so will cause the DMA engine to not initialize properly and fail to forward packets between them, and in some cases will cause spurious transmission with size exceeding allowed packet size, causing a kernel panic. This is behaviour of downstream driver as well, however I haven't observed bug reports about this SoC in the wild, so this commit's purpose is to align this chip with all other SoC's - MT7620 were already using this arrangement. Fixes: 60fadae62b64 ("ramips: ethernet: ralink: move reset of the esw into the esw instead of fe") Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* ramips: dts: rt3352: reset FE and ESW cores togetherMaxim Anisimov2024-01-02
| | | | | | | | | | | | | Failing to do so will cause the DMA engine to not initialize properly and fail to forward packets between them, and in some cases will cause spurious transmission with size exceeding allowed packet size, causing a kernel panic. Fixes: 60fadae62b64 ("ramips: ethernet: ralink: move reset of the esw into the esw instead of fe") Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com> [Provide commit description, split into logical changes] Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* ramips: mtk_eth_soc: wait longer after FE core reset to settleMaxim Anisimov2024-01-02
| | | | | | | | | | | | Enabling the FE core too early causes the system to hang during boot uncondtionally, after the reset is released. Increate it to 1-1.2ms range. Fixes: 60fadae62b64 ("ramips: ethernet: ralink: move reset of the esw into the esw instead of fe") Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com> [Split previous commit, provide rationale] Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* ramips: mtk_eth_soc: allow multiple resetsLech Perczak2024-01-02
| | | | | | | | | | | | | | | | | | Use devm_reset_control_array_get_exclusive to register multiple reset lines in FE driver. This is required to reattach ESW reset to FE driver again, based on device tree bindings. While at that, remove unused fe_priv.rst_ppe field, and add error message if getting the reset fails. Fixes: 60fadae62b64 ("ramips: ethernet: ralink: move reset of the esw into the esw instead of fe") Co-developed-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com> Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com> [Split out of the bigger commit, provide commit mesage, refactor error handling] Signed-off-by: Lech Perczak <lech.perczak@gmail.com>