aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek
Commit message (Collapse)AuthorAgeFilesLines
* mediatek: replace mt7986 watchdog assert patch with upstreamNick Hainke2022-11-053-57/+99
| | | | | | | | Replace "920-watchdog-add-mt7986-assert.patch" with upstreamed - 920-v5.16-watchdog-mtk-add-disable_wdt_extrst-support.patch - 921-v5.19-watchdog-mtk_wdt-mt7986-Add-toprgu-reset-controller.patch Signed-off-by: Nick Hainke <vincent@systemli.org>
* mediatek: mt7629: add tag to upstreamed patchesNick Hainke2022-11-051-0/+0
| | | | | | The patches were upstreamed. Signed-off-by: Nick Hainke <vincent@systemli.org>
* mediatek: add tag for upstreamed patchesNick Hainke2022-11-053-0/+0
| | | | | | The patches were upstreamed. Signed-off-by: Nick Hainke <vincent@systemli.org>
* mediatek: mt7986: add tag to upstreamed patchesNick Hainke2022-11-052-0/+0
| | | | | | | The patch "210-pinctrl-mediatek-add-support-for-MT7986-SoC.patch" and "212-clk-mediatek-add-mt7986-clock-support.patch" are upstreamed. Signed-off-by: Nick Hainke <vincent@systemli.org>
* mediatek: mt7622: add tag to upstreamed patchesNick Hainke2022-11-052-0/+0
| | | | | | | | The patches "191-arm64-dts-mt7622-specify-the-L2-cache-topology.patch" and "192-arm64-dts-mt7622-specify-the-number-of-DMA-requests.patch" are upstreamed to 5.19. Signed-off-by: Nick Hainke <vincent@systemli.org>
* mediatek: filogic: disable swconfigAleksander Jan Bajkowski2022-11-051-1/+0
| | | | | | | | | | | | This subtarget supports 3 devices: * Bananapi BPi-R3 (added in a96382c1bb204698cd43e82193877c10e4b63027), * MediaTek MTK7986 rfba AP (added in cffc77ae55ed0e5b9e70417d6a1e1d280cea92cf), * MediaTek MTK7986 rfbb AP (added in cffc77ae55ed0e5b9e70417d6a1e1d280cea92cf). This subtarget supports DSA from the beginning. It looks like CONFIG_SWCONFIG was copied from another config when the subtarget was created. Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
* mediatek: filogic: refresh configAleksander Jan Bajkowski2022-11-051-4/+4
| | | | | | | This was done by executing these command: $ time make kernel_oldconfig CONFIG_TARGET=subtarget Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
* mediatek: remove obsolete patchDaniel Golle2022-11-021-24/+0
| | | | | | | | | The patch enabling hardware flow offloading support on the MT7623 SoC has been merged upstream as of Linux 5.13. Remove our local patch which wrongly got forward-ported and now actually enables hardware flow offloading for the MT2701 SoC family (unsupported in OpenWrt). Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: consider adc_oe thermal calibration value in efuseDaniel Golle2022-10-311-1/+1
| | | | | | | | | The use of the adc_oe value stored in the efuse has been dropped in MediaTek's SDK during a recent refactorization of the temperature calculation formula. Don't ignore this offset value and again include it in raw-to-deg-celsius calculation. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: bump 5.15 to 5.15.75John Audia2022-10-304-16/+16
| | | | | | | | | | | | | | | | | | | | | Removed upstreamed: bcm27xx/patches-5.15/950-0446-drm-vc4-Fix-timings-for-VEC-modes.patch[1] Manually rebased: patches-5.15/950-0600-xhci-quirks-add-link-TRB-quirk-for-VL805.patch bcm27xx/patches-5.15/950-0606-usb-xhci-add-VLI_TRB_CACHE_BUG-quirk.patch bcm27xx/patches-5.15/950-0717-usb-xhci-add-a-quirk-for-Superspeed-bulk-OUT-transfe.patch bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch All other patches automatically rebased 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.75&id=2810061452f9b748b096ad023d318690ca519aa3 Build system: x86_64 Build-tested: bcm2711/RPi4B, mt7622/RT3200 Run-tested: bcm2711/RPi4B, mt7622/RT3200 Signed-off-by: John Audia <therealgraysky@proton.me>
* mediatek: add Xiaomi Redmi Router AX6000 supportChukun Pan2022-10-303-0/+292
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware specification: SoC: MediaTek MT7986A 4x A53 Flash: ESMT F50L1G41LB 128 MB RAM: K4A4G165WF-BCWE 512 MB Ethernet: 4x 10/100/1000 Mbps WiFi1: MT7976GN 2.4GHz ax 4x4 WiFi2: MT7976AN 5GHz ax 4x4 Button: Mesh, Reset Flash instructions: 1. Gain ssh and serial port access, see the link below: https://openwrt.org/toh/xiaomi/redmi_ax6000#installation 2. Use ssh or serial port to log in to the router, and execute the following command: nvram set boot_wait=on nvram set flag_boot_rootfs=0 nvram set flag_boot_success=1 nvram set flag_last_success=1 nvram set flag_try_sys1_failed=8 nvram set flag_try_sys2_failed=8 nvram commit 3. Set a static ip on the ethernet interface of your computer (e.g. default: ip 192.168.31.100, gateway 192.168.31.1) 4. Download the initramfs image, rename it to initramfs.bin, and host it with the tftp server. 5. Interrupt U-Boot and run these commands: setenv mtdparts nmbm0:1024k(bl2),256k(Nvram),256k(Bdata),2048k(factory),2048k(fip),256k(crash),256k(crash_log),112640k(ubi) saveenv tftpboot initramfs.bin bootm 6. After openwrt boots up, use scp or luci web to upload sysupgrade.bin to upgrade. Revert to stock firmware: Restore mtdparts back to default, then use the vendor's recovery tool (Windows only). Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
* kernel: disable CONFIG_CPU_LITTLE_ENDIAN in generic configAleksander Jan Bajkowski2022-10-212-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Endianness depends on CPU architecture. CONFIG_CPU_(BIG/LITTLE)_ENDIAN should be enabled on target or subtarget based on SoC architecture. Fixes warning: $ make kernel_oldconfig CONFIG_TARGET=subtarget ... .config:1008:warning: override: CPU_LITTLE_ENDIAN changes choice state .... Summary: - ARC - only the CONFIG_CPU_BIG_ENDIAN symbol is defined for this architeture. If it is disabled then the processor operates in LITTLE_ENDIAN mode (default), - ARM32 - CONFIG_CPU_LITTLE_ENDIAN symbol available since kernel 5.19. This option should be enabled after OpenWRT moves to kernel 6.x. After refreshing the kernel, the symbol disappears, - ARM64 - enabled CONFIG_CPU_LITTLE_ENDIAN, - MIPS - enabled relevant symbols, - POWERPC - enabled CONFIG_CPU_BIG_ENDIAN, - UML - Symbols are not defined for this architecture, - X86 - always little endian. Symbols are not defined for this architecture. Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
* mediatek: filogic: consolidate adc '32k' clockDaniel Golle2022-10-204-180/+14
| | | | | | | | | | Add dependency to '32k' ADC clock so it is always enabled for thermal and raw access to ADC values. This allows to remove the patch for the ADC driver and reduce the patch adding thermal support for MT7986 to only add the new efuse layout and temperature decoding for V3. Suggested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mt7622: switch default CPU governor to ondemandJohn Audia2022-10-201-1/+1
| | | | | | | | | | | | | | | | | | The most common CPU governor in the OpenWRT project is currently ondemand (see below). Switch mt7622 over to it as well. Audit the code by running the following and then analyzing the results: find -name 'config-5.*' -print0 | xargs -0 grep 'CONFIG_CPU_FREQ_DEFAULT_GOV.*=y' ondemand: 16 performance: 5 schedutil: 5 userspace: 2 Build system: x86_64 Build-tested: ramips/mt7621 Signed-off-by: John Audia <graysky@archlinux.us>
* mediatek: clean up platform kernel modulesDaniel Golle2022-10-193-15/+8
| | | | | | | | | | | | | | Remove kmod-sdhci-mtk as the mtk-sd driver is built-in anyway for the relevant subtargets in order to support mounting rootfs from eMMC or SD card. Add kmod-iio-mt6577-auxadc to support reading the raw values from the auxadc unit used as in-SoC thermal sensor. This driver was previously built-in, but as thermal itself works well without it there is no use for it in every day use of a device. Build the module to still allow access to the raw values for those who need it. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: don't rely on existing image for sysupgradeDaniel Golle2022-10-191-2/+2
| | | | | | | | Don't reply on mapped rootfs partition but rather just take what ever has been set to the kernel cmdline root= parameter as a hint to decide which media to install sysupgrade to on the BananaPi BPi-R64. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: kernel config fixesDaniel Golle2022-10-191-1/+1
| | | | | | | | | | | * remove orphaned Kconfig symbol now that CONFIG_IIO is no longer selected after commit ef8b935c95 ("mediatek: clean up mt7622 kernel config") * select UBI fast-map feature to decrease boot time and keep the number of spare blocks required in sync with U-Boot's expectations (we got fast-map enabled in U-Boot) Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: update pending and rename merged patchDaniel Golle2022-10-192-21/+57
| | | | | | | Add patch headers and description for pending patch. Add version tag to patch already merged upstream. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: filogic: don't rely on image preset in flash or sysupgradeDaniel Golle2022-10-181-11/+6
| | | | | | | | Instead of trying to figure out the actual root device, just use the kernel 'root' cmdline parameter as a hint to decide which device to flash to. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: filogic: use UBI fast map to speed up bootDaniel Golle2022-10-181-0/+1
| | | | | | | Use UBI fast map feature to avoid scanning the whole flash on each boot which takes several seconds. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: don't break auxadc without 32k clkDaniel Golle2022-10-181-5/+7
| | | | | | | Make the newly added 32k clock optional for the auxadc driver also used on pre-filogic platforms. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7623: fix thermal zoneBruno Umuarama2022-10-141-0/+48
| | | | | | | | | | | | | | | | | | | | | Raising the temperatures for passive and active trips. @VA1DER proposed at issue 9396 to remove passive trip. This commit relates to his suggestion. Without this patch. the CPU will be throttled all the way down to 98MHz if the temperature rises even a degree above the trip point, and it was further discovered that if the internal temperature of the device is above the first trip point temperature when it boots then it will start in a throttled state and even $ echo disabled > /sys/class/thermal/thermal_zone0/mode will have no effect. The patch increases the passive trip point and active cooling map. The throttling temperature will then be at 77°C and 82°C, which is still a low enough temperature for ARM devices to not be in the real danger zone, and gives some operational headroom. Signed-off-by: Bruno Umuarama <anonimou_eu@hotmail.com>
* mediatek: clean up mt7622 kernel configFelix Fietkau2022-10-141-5/+2
| | | | | | Remove a few unused options to reduce kernel size Signed-off-by: Felix Fietkau <nbd@nbd.name>
* kernel: remove target specific CONFIG_IKCONFIG linesFelix Fietkau2022-10-142-4/+0
| | | | | | Use generic configuration for this feature Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mediatek: fill wlan device entries in board.json on mt7622Felix Fietkau2022-10-141-0/+12
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mediatek: filogic: set correct PWM clock and clean thermal zoneDaniel Golle2022-10-093-18/+18
| | | | | | | | | | | | * set correct clocks for PWM to work. * MT7986 PWM does have the 26MHz-clock-select, set that in patch * drop useless 'passive' trip point in thermal zone * extend pwm-fan to have 3 active operating points * set reasonable trip points in thermal zone * invert pwm-fan operating points and set shorter period to allow less noisy operation of the PWM fan of the BPi-R3. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: filogic: enable thermal, I2C and PWM of the BPi-R3Daniel Golle2022-10-072-1/+32
| | | | | | | Setup thermal zone, select pins and enabled drivers for I2C (on 26-pin GPIO bank) and PWM (1x fan and 1x GPIO bank). Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: filogic: add support for hw i2c, pwm and thermalDaniel Golle2022-10-078-1/+524
| | | | | | | Add support for hardware I2C and PWM units found in the Filogic SoCs as well as the CPU thermal support. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add support t-phy settings from efuse on MT7986Daniel Golle2022-09-303-1/+405
| | | | | | | Import patches from mtk-openwrt-feeds (MTK SDK) to support reading t-phy settings affecting PCIe as well as USB2 and USB3 from efuse. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: filogic: add efuse layout to mt7986a.dtsiDaniel Golle2022-09-301-0/+93
| | | | | | | | efuse is used to store board-specific settings of some of the in-SoC peripherals. Add it to device tree, so it gets probed on boot and can be accessed by other drivers. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add patch allowing 1-byte wide access to efuseDaniel Golle2022-09-301-0/+46
| | | | | | | Allow byte-wise access to mtk-efuse as some drivers require that. Patch imported from mtk-openwrt-feeds (MTK SDK). Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: move ubnt ledbar driver to a separate packageFelix Fietkau2022-09-302-15/+0
| | | | | | | Simplifies the tree by removing a non-upstream kernel patch and related kconfig symbols Signed-off-by: Felix Fietkau <nbd@nbd.name>
* kernel: Move some IOMMU options to genericHauke Mehrtens2022-09-241-2/+0
| | | | | | | | | | | | This adds some missing IOMMU related options for x86/64 and moves some of them to generic for all targets. On x86 IOMMU_DEFAULT_DMA_LAZY is used by default, on all other platforms IOMMU_DEFAULT_DMA_STRICT is the default. we just follow the default kernel configuration here. Fixes: 8fea4a102ccd ("x86/64: enable IOMMU support") Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* kernel: pick patches for MediaTek Ethernet from linux-nextDaniel Golle2022-09-223-5/+29
| | | | | | | | | | | | | | | | | | | Pick patches with several fixes and improvements, preparation for upcoming WED (TX) [1] as well as basic XDP support [2] with MediaTek's Filogic SoCs to the mtk_eth_soc driver. Also pick follow-up patch fixing Ethernet on MT7621 [3]. Tested on Bananapi BPi-R3 (MT7986), Bananapi BPi-R64 (MT7622), Bananapi BPi-R2 (MT7623), MikroTik RouterBoard M11G (MT7621). [1]: https://patchwork.kernel.org/project/netdevbpf/list/?series=662108&state=* [2]: https://patchwork.kernel.org/project/netdevbpf/list/?series=675368&state=* (the first part of the series adding wed nodes to mt7986a.dtsi was applied to the copy of mt7986a.dtsi in our tree) [3]: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=5e69163d3b9931098922b3fc2f8e786af8c1f37e Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: fix Unifi 6LR network configStijn Tintel2022-09-201-2/+1
| | | | | | | | | | | | | | | | When the v1 and v2 variants of the U6LR were introduced, the board network config was not adapted to the new device names. Due to this, the wrong network config is applied during initial boot. The resulting config has lan, wan and a switch, while this device only has a single ethernet interface without a switch. Fix this by using a wildcard that matches all the variants. Fixes: 15a02471bb85 ("mediatek: new target mt7622-ubnt-unifi-6-lr-v1") Fixes: 5c8d3893a78f ("mediatek: new target ubnt_unifi-6-lr-v1-ubootmod") Fixes: 31d86a1a1192 ("mediatek: add Ubiquiti UniFi 6 LR v2 targets") Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be> Acked-by: Daniel Golle <daniel@makrotopia.org>
* kernel: bump 5.15 to 5.15.68John Audia2022-09-171-2/+2
| | | | | | | | | | All patches automatically rebased Build system: x86_64 Build-tested: bcm2711/RPi4B, mt7622/RT3200 Run-tested: bcm2711/RPi4B, mt7622/RT3200 Signed-off-by: John Audia <therealgraysky@proton.me>
* mediatek: build USB XHCI support as moduleDaniel Golle2022-09-143-13/+0
| | | | | | | | Instead of always including the XHCI driver in the kernel on all MediaTek boards, selectively include the kernel module only on boards which actually make use of USB functionality. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: unset CONFIG_CMDLINE_OVERRIDE for all targets but mt7629Daniel Golle2022-09-123-0/+3
| | | | | | | | | | The newly introduced config symbol CONFIG_CMDLINE_OVERRIDE is only set for mt7629 for now which breaks automated build on all other mediatek subtargets. Make sure the symbol is configured as 'is not set' for all remaining subtargets. Fixes: c27279dc26 ("mediatek: add support for ipTIME A6004MX Add basic support for ipTIME A6004MX.") Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add support for ipTIME A6004MX Add basic support for ipTIME A6004MX.Yoonji Park2022-09-128-0/+393
| | | | | | | | | | | | | | | | | | | | | | | | | Hardware: SoC: MediaTek MT7629 Cortex-A7 (ARMv7 1.25GHz, Dual-Core) RAM: DDR3 128MB Flash: Macronix MX35LF1GE4AB (SPI-NAND 128MB) WiFi: MediaTek MT7761N (2.4GHz) / MediaTek MT7762N (5GHz) - no driver Ethernet: SoC (WAN) / MediaTek MT7531 (LAN x4) UART: [GND, RX, TX, 3.3V] (115200) Installation: - Flash recovery image with TFTP recovery Revert to stock firmware: - Flash stock firmware with TFTP recovery TFTP Recovery method: 1. Unplug the router 2. Hold the reset button and plug in 3. Release when the power LED stops flashing and go off 4. Set your computer IP address manually to 192.168.0.x / 255.255.255.0 5. Flash image with TFTP client to 192.168.0.1 Signed-off-by: Yoonji Park <koreapyj@dcmys.kr>
* mediatek: disable unsupported background radar detectionShiji Yang2022-09-123-2/+7
| | | | | | | | | | | MT7915 requires an additional antenna for background radar scanning. Disable this feature in the following devices that do not have a separate DFS antenna: linksys,e8450 ruijie,rg-ew3200gx-pro xiaomi,redmi-router-ax6s Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* mediatek: fix ledbar of UniFi 6 LR when running custom U-BootDaniel Golle2022-09-111-1/+2
| | | | | | | | | | The RGB LED of the UniFi 6 LR v1 doesn't work when using the Openwrt- built U-Boot. This is because the vendor loader resets the ledbar controller while our U-Boot doesn't care. Add reset-gpio so the ledbar driver in Linux will always reset the ledbar controller. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* generic: move ledbar driver from mediatek targetSven Wegener2022-09-112-284/+0
| | | | | | This moves the ledbar driver to generic, to be also used by the ramips target. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* mediatek: add led countSven Wegener2022-09-111-1/+7
| | | | | | | | | The LEDs connected to the MCU are so-called smart LEDs and their signal is daisy-chained. Because of this, the MCU needs to be told how many LEDs are connected. It also means the LEDs could be individually controlled, if the MCU has a command for this. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* mediatek: add initialization after resetSven Wegener2022-09-111-0/+14
| | | | | | | | During GPIO initialization the pin state flips and triggers a reset of the ledbar MCU. It needs to be moved through an initialization sequence before working correctly. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* mediatek: add support for reset gpioSven Wegener2022-09-111-0/+26
| | | | | | | Some versions of the ledbar MCU have a reset pin. It needs to be correctly initialized or we might keep the MCU in reset state. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* mediatek: support reading more than one byte of responseSven Wegener2022-09-111-7/+8
| | | | | | There are commands that return more than one byte of response. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* mediatek: cast literal value to charSven Wegener2022-09-111-1/+1
| | | | | | | | | | Or the comparison against a signed char is always true, because the literal 0xaa is treated as an unsigned int, to which the signed char is casted during comparison. 0xaa is above the positive values of a signed char and negative signed char values result in values larger than 0xaa when casted to unsigned int. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* mediatek: correctly log i2c responseSven Wegener2022-09-111-2/+2
| | | | | | | The read response is in the i2c_response variable. Also use %hhx format, because we're dealing with a single char. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* mediatek: remove gpiod_direction_output()Sven Wegener2022-09-111-2/+0
| | | | | | It's already set to output with GPIOD_OUT_LOW. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
* mediatek: do not use gpiod_set_raw_value()Sven Wegener2022-09-111-2/+2
| | | | | | The polarity of the signal is set in the device dts. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>